2002-03-12 Duncan Mak <duncan@ximian.com>
[mono.git] / mcs / class / corlib / System.Runtime.Serialization / IFormatter.cs
1 //\r
2 // System.Runtime.Serialization.IFormatter\r
3 //\r
4 // Author:\r
5 //   David Dawkins (david@dawkins.st)\r
6 //\r
7 // (C) David Dawkins\r
8 //\r
9 \r
10 using System.IO;\r
11 \r
12 namespace System.Runtime.Serialization {\r
13 \r
14         /// <summary>\r
15         /// Formatting for serialized objects</summary>\r
16         public interface IFormatter {\r
17 \r
18                 //\r
19                 // Properties\r
20                 //\r
21 \r
22                 /// <summary>\r
23                 /// Get or set the SerializationBinder used\r
24                 /// for looking up types during deserialization</summary>\r
25                 SerializationBinder Binder \r
26                 {\r
27                         get; \r
28                         set; \r
29                 }\r
30 \r
31                 /// <summary>\r
32                 /// Get or set the StreamingContext used for serialization\r
33                 /// and deserialization</summary>\r
34                 StreamingContext Context \r
35                 { \r
36                         get; \r
37                         set; \r
38                 }\r
39 \r
40                 /// <summary>\r
41                 /// Get or set the SurrogateSelector used by the current\r
42                 /// formatter</summary>\r
43                 ISurrogateSelector SurrogateSelector \r
44                 { \r
45                         get; \r
46                         set; \r
47                 }\r
48 \r
49                 /// <summary>\r
50                 /// Deserialize data from the specified stream, rebuilding\r
51                 /// the object hierarchy</summary>\r
52                 object Deserialize(\r
53                         Stream serializationStream\r
54                 );              \r
55 \r
56                 /// <summary>\r
57                 /// Serialize the specified object to the specified stream.\r
58                 /// Object may be the root of a graph of objects to be\r
59                 /// serialized</summary>\r
60                 void Serialize( \r
61                         Stream serializationStream,\r
62                         object graph\r
63                 );\r
64         }\r
65 \r
66 }\r