using System;
namespace ProtoBuf
{
///
/// Indicates that a member should be excluded from serialization; this
/// is only normally used when using implict fields.
///
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field,
AllowMultiple = false, Inherited = true)]
public class ProtoIgnoreAttribute : Attribute {}
///
/// Indicates that a member should be excluded from serialization; this
/// is only normally used when using implict fields. This allows
/// ProtoIgnoreAttribute usage
/// even for partial classes where the individual members are not
/// under direct control.
///
[AttributeUsage(AttributeTargets.Class,
AllowMultiple = true, Inherited = false)]
public sealed class ProtoPartialIgnoreAttribute : ProtoIgnoreAttribute
{
///
/// Creates a new ProtoPartialIgnoreAttribute instance.
///
/// Specifies the member to be ignored.
public ProtoPartialIgnoreAttribute(string memberName)
: base()
{
if (Helpers.IsNullOrEmpty(memberName)) throw new ArgumentNullException("memberName");
this.memberName = memberName;
}
///
/// The name of the member to be ignored.
///
public string MemberName { get { return memberName; } }
private readonly string memberName;
}
}