Quasar/Server/Core/ProtoBuf/ProtoIgnoreAttribute.cs

47 lines
1.5 KiB
C#
Raw Normal View History

2014-07-08 05:58:53 -07:00
using System;
namespace ProtoBuf
{
/// <summary>
/// Indicates that a member should be excluded from serialization; this
/// is only normally used when using implict fields.
/// </summary>
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field,
AllowMultiple = false, Inherited = true)]
public class ProtoIgnoreAttribute : Attribute
{
}
2014-07-08 05:58:53 -07:00
/// <summary>
/// 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.
/// </summary>
[AttributeUsage(AttributeTargets.Class,
AllowMultiple = true, Inherited = false)]
2014-07-30 08:32:25 -07:00
public sealed class ProtoPartialIgnoreAttribute : ProtoIgnoreAttribute
2014-07-08 05:58:53 -07:00
{
/// <summary>
/// Creates a new ProtoPartialIgnoreAttribute instance.
/// </summary>
/// <param name="memberName">Specifies the member to be ignored.</param>
public ProtoPartialIgnoreAttribute(string memberName)
: base()
{
if (Helpers.IsNullOrEmpty(memberName)) throw new ArgumentNullException("memberName");
this.memberName = memberName;
}
2014-07-08 05:58:53 -07:00
/// <summary>
/// The name of the member to be ignored.
/// </summary>
public string MemberName
{
get { return memberName; }
}
2014-07-08 05:58:53 -07:00
private readonly string memberName;
}
}