IFormatter.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. //
  2. // System.Runtime.Serialization.IFormatter
  3. //
  4. // Author:
  5. // David Dawkins ([email protected])
  6. //
  7. // (C) David Dawkins
  8. //
  9. using System.IO;
  10. namespace System.Runtime.Serialization {
  11. /// <summary>
  12. /// Formatting for serialized objects</summary>
  13. public interface IFormatter {
  14. //
  15. // Properties
  16. //
  17. /// <summary>
  18. /// Get or set the SerializationBinder used
  19. /// for looking up types during deserialization</summary>
  20. SerializationBinder Binder
  21. {
  22. get;
  23. set;
  24. }
  25. /// <summary>
  26. /// Get or set the StreamingContext used for serialization
  27. /// and deserialization</summary>
  28. StreamingContext Context
  29. {
  30. get;
  31. set;
  32. }
  33. /// <summary>
  34. /// Get or set the SurrogateSelector used by the current
  35. /// formatter</summary>
  36. ISurrogateSelector SurrogateSelector
  37. {
  38. get;
  39. set;
  40. }
  41. /// <summary>
  42. /// Deserialize data from the specified stream, rebuilding
  43. /// the object hierarchy</summary>
  44. object Deserialize(
  45. Stream serializationStream
  46. );
  47. /// <summary>
  48. /// Serialize the specified object to the specified stream.
  49. /// Object may be the root of a graph of objects to be
  50. /// serialized</summary>
  51. void Serialize(
  52. Stream serializationStream,
  53. object graph
  54. );
  55. }
  56. }