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

  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. ** Interface: ISurrogateSelector
  18. **
  19. **
  20. ** Purpose: A user-supplied class for doing the type to surrogate
  21. **          mapping.
  22. **
  23. **
  24. ===========================================================*/
  25. namespace System.Runtime.Serialization
  26. {
  27.    
  28.     using System.Runtime.Remoting;
  29.     using System.Security.Permissions;
  30.     using System;
  31.     [System.Runtime.InteropServices.ComVisible(true)]
  32.     public interface ISurrogateSelector
  33.     {
  34.         // Interface does not need to be marked with the serializable attribute
  35.         // Specifies the next ISurrogateSelector to be examined for surrogates if the current
  36.         // instance doesn't have a surrogate for the given type and assembly in the given context.
  37.         [SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)]
  38.         void ChainSelector(ISurrogateSelector selector);
  39.        
  40.         // Returns the appropriate surrogate for the given type in the given context.
  41.         [SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)]
  42.         ISerializationSurrogate GetSurrogate(Type type, StreamingContext context, out ISurrogateSelector selector);
  43.        
  44.        
  45.         // Return the next surrogate in the chain. Returns null if no more exist.
  46.         [SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)]
  47.         ISurrogateSelector GetNextSelector();
  48.     }
  49. }

Developer Fusion