The Labs \ Source Viewer \ SSCLI \ System.Runtime.Serialization \ OnDeserializedAttribute

  1. // ==++==
  2. //
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. //
  14. // ==--==
  15. /*============================================================
  16. **
  17. ** Class: OptionallySerializableAttribute
  18. **
  19. **
  20. ** Purpose: Various Attributes for Serialization
  21. **
  22. **
  23. ============================================================*/
  24. namespace System.Runtime.Serialization
  25. {
  26.     using System.Reflection;
  27.    
  28.     [AttributeUsage(AttributeTargets.Field, Inherited = false)]
  29.     [System.Runtime.InteropServices.ComVisible(true)]
  30.     public sealed class OptionalFieldAttribute : Attribute
  31.     {
  32.         int versionAdded = 1;
  33.         public OptionalFieldAttribute()
  34.         {
  35.         }
  36.        
  37.         public int VersionAdded {
  38.             get { return this.versionAdded; }
  39.             set {
  40.                 if (value < 1)
  41.                     throw new ArgumentException(Environment.GetResourceString("Serialization_OptionalFieldVersionValue"));
  42.                 this.versionAdded = value;
  43.             }
  44.         }
  45.     }
  46.    
  47.     [AttributeUsage(AttributeTargets.Method, Inherited = false)]
  48.     [System.Runtime.InteropServices.ComVisible(true)]
  49.     public sealed class OnSerializingAttribute : Attribute
  50.     {
  51.     }
  52.    
  53.     [AttributeUsage(AttributeTargets.Method, Inherited = false)]
  54.     [System.Runtime.InteropServices.ComVisible(true)]
  55.     public sealed class OnSerializedAttribute : Attribute
  56.     {
  57.     }
  58.    
  59.     [AttributeUsage(AttributeTargets.Method, Inherited = false)]
  60.     [System.Runtime.InteropServices.ComVisible(true)]
  61.     public sealed class OnDeserializingAttribute : Attribute
  62.     {
  63.     }
  64.    
  65.     [AttributeUsage(AttributeTargets.Method, Inherited = false)]
  66.     [System.Runtime.InteropServices.ComVisible(true)]
  67.     public sealed class OnDeserializedAttribute : Attribute
  68.     {
  69.     }
  70.    
  71. }

Developer Fusion