New test.
[mono.git] / mcs / class / corlib / System.Runtime.Serialization / ISerializationSurrogate.cs
1 //\r
2 // System.Runtime.Serialization.ISerializationSurrogate\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 //\r
11 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)\r
12 //\r
13 // Permission is hereby granted, free of charge, to any person obtaining\r
14 // a copy of this software and associated documentation files (the\r
15 // "Software"), to deal in the Software without restriction, including\r
16 // without limitation the rights to use, copy, modify, merge, publish,\r
17 // distribute, sublicense, and/or sell copies of the Software, and to\r
18 // permit persons to whom the Software is furnished to do so, subject to\r
19 // the following conditions:\r
20 // \r
21 // The above copyright notice and this permission notice shall be\r
22 // included in all copies or substantial portions of the Software.\r
23 // \r
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
25 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
26 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
27 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
28 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
29 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
30 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
31 //\r
32 \r
33 namespace System.Runtime.Serialization {\r
34 \r
35         /// <summary>\r
36         /// Interface for serialization surrogates</summary>\r
37         public interface ISerializationSurrogate {\r
38 \r
39                 /// <summary>\r
40                 /// Get the SerializationInfo necessary to serialize\r
41                 /// the specified object </summary>\r
42                 /// <param name="obj">Object to be serialized</param>\r
43                 /// <param name="info">SerializationInfo to be populated</param>\r
44                 /// <param name="context">Destination for serialization</param>\r
45                 void GetObjectData(\r
46                         object obj,\r
47                         SerializationInfo info,\r
48                         StreamingContext context\r
49                 );      \r
50 \r
51                 /// <summary>\r
52                 /// Populate an object using the specified SerializationInfo </summary>\r
53                 /// <param name="obj">Object to be populated</param>\r
54                 /// <param name="info">Data used for populating object</param>\r
55                 /// <param name="context">Source for deserialization of object</param>\r
56                 /// <param name="selector>Starting point for searching for compatible surrogates</param>\r
57                 /// <returns>The deserialized object</returns>\r
58                 object SetObjectData(\r
59                         object obj,\r
60                         SerializationInfo info,\r
61                         StreamingContext context,\r
62                         ISurrogateSelector selector\r
63                 );\r
64         }\r
65 \r
66 }\r