CallbackAttributes.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233
  1. using System;
  2. using System.ComponentModel;
  3. namespace ProtoBuf
  4. {
  5. /// <summary>Specifies a method on the root-contract in an hierarchy to be invoked before serialization.</summary>
  6. [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
  7. #if !CF && !SILVERLIGHT && !MONODROID && !WINRT && !IOS && !PORTABLE && ! COREFX
  8. [ImmutableObject(true)]
  9. #endif
  10. public sealed class ProtoBeforeSerializationAttribute : Attribute { }
  11. /// <summary>Specifies a method on the root-contract in an hierarchy to be invoked after serialization.</summary>
  12. [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
  13. #if !CF && !SILVERLIGHT && !MONODROID && !WINRT && !IOS && !PORTABLE && ! COREFX
  14. [ImmutableObject(true)]
  15. #endif
  16. public sealed class ProtoAfterSerializationAttribute : Attribute { }
  17. /// <summary>Specifies a method on the root-contract in an hierarchy to be invoked before deserialization.</summary>
  18. [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
  19. #if !CF && !SILVERLIGHT && !MONODROID && !WINRT && !IOS && !PORTABLE && ! COREFX
  20. [ImmutableObject(true)]
  21. #endif
  22. public sealed class ProtoBeforeDeserializationAttribute : Attribute { }
  23. /// <summary>Specifies a method on the root-contract in an hierarchy to be invoked after deserialization.</summary>
  24. [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
  25. #if !CF && !SILVERLIGHT && !MONODROID && !WINRT && !IOS && !PORTABLE && ! COREFX
  26. [ImmutableObject(true)]
  27. #endif
  28. public sealed class ProtoAfterDeserializationAttribute : Attribute { }
  29. }