mscorlib(4.0.0.0) API with additions
NonSerializedAttribute.cs
1 using System.Reflection;
3 
4 namespace System
5 {
7  [AttributeUsage(AttributeTargets.Field, Inherited = false)]
8  [ComVisible(true)]
9  public sealed class NonSerializedAttribute : Attribute
10  {
11  internal static Attribute GetCustomAttribute(RuntimeFieldInfo field)
12  {
13  if ((field.Attributes & FieldAttributes.NotSerialized) == FieldAttributes.PrivateScope)
14  {
15  return null;
16  }
17  return new NonSerializedAttribute();
18  }
19 
20  internal static bool IsDefined(RuntimeFieldInfo field)
21  {
22  return (field.Attributes & FieldAttributes.NotSerialized) != FieldAttributes.PrivateScope;
23  }
24  }
25 }
Represents the base class for custom attributes.
Definition: Attribute.cs:15
Definition: __Canon.cs:3
FieldAttributes
Specifies flags that describe the attributes of a field.
Indicates that a field of a serializable class should not be serialized. This class cannot be inherit...
AttributeTargets
Specifies the application elements on which it is valid to apply an attribute.