mscorlib(4.0.0.0) API with additions
SerializableAttribute.cs
1 using System.Reflection;
3 
4 namespace System
5 {
7  [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Delegate, Inherited = false)]
8  [ComVisible(true)]
9  public sealed class SerializableAttribute : Attribute
10  {
11  internal static Attribute GetCustomAttribute(RuntimeType type)
12  {
13  if ((type.Attributes & TypeAttributes.Serializable) != TypeAttributes.Serializable)
14  {
15  return null;
16  }
17  return new SerializableAttribute();
18  }
19 
20  internal static bool IsDefined(RuntimeType type)
21  {
22  return type.IsSerializable;
23  }
24  }
25 }
Indicates that a class can be serialized. This class cannot be inherited.
Represents the base class for custom attributes.
Definition: Attribute.cs:15
Definition: __Canon.cs:3
TypeAttributes
Specifies type attributes.
AttributeTargets
Specifies the application elements on which it is valid to apply an attribute.