2003-01-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
[mono.git] / mcs / class / corlib / System / SerializableAttribute.cs
1 //
2 // System.SerializableAttribute.cs
3 //
4 // Author:
5 //   Miguel de Icaza (miguel@ximian.com)
6 //
7 // (C) Ximian, Inc.  http://www.ximian.com
8 //
9
10 namespace System {
11
12         /// <summary>
13         ///   Serialization Attribute for classes. 
14         /// </summary>
15         
16         /// <remarks>
17         ///   Use SerializableAttribute to mark classes that do not implement
18         ///   the ISerializable interface but that want to be serialized.
19         ///
20         ///   Failing to do so will cause the system to throw an exception.
21         ///
22         ///   When a class is market with the SerializableAttribute, all the
23         ///   fields are automatically serialized with the exception of those
24         ///   that are tagged with the NonSerializedAttribute.
25         ///
26         ///   SerializableAttribute should only be used for classes that contain
27         ///   simple data types that can be serialized and deserialized by the
28         ///   runtime (typically you would use NonSerializedAttribute on data
29         ///   that can be reconstructed at any point: like caches or precomputed
30         ///   tables). 
31         /// </remarks>
32
33         [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct 
34                 | AttributeTargets.Enum | AttributeTargets.Delegate, 
35                 Inherited=false, AllowMultiple=false)]
36         public sealed class SerializableAttribute : Attribute {
37         }
38 }