/[dgee]/dgee/cslib/DotGNU/XmlRpc/Serialization/MethodCallFormatter.cs
ViewVC logotype

Diff of /dgee/cslib/DotGNU/XmlRpc/Serialization/MethodCallFormatter.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.2.2 by npg, Sun Jul 27 13:03:26 2003 UTC revision 1.1.2.3 by npg, Mon Jul 28 19:02:25 2003 UTC
# Line 23  Line 23 
23   */   */
24  using System.Runtime.Serialization;  using System.Runtime.Serialization;
25  using System.IO;  using System.IO;
26    using DotGNU.XmlRpc;
27    using System.Xml;
28    
29  namespace DotGNU.XmlRpc.Serialization  namespace DotGNU.XmlRpc.Serialization.Formatters
30  {  {
31    public sealed class MethodCallFormatter : IFormatter    public sealed class MethodCallFormatter : IFormatter
32    {    {
33        private SerializationBinder binder;
34        private StreamingContext context;
35        private ISurrogateSelector surrogateSelector;
36    
37        public  MethodCallFormatter()
38        {
39          context = new StreamingContext( StreamingContextStates.All );
40        }
41        
42        // Returns a XmlRpcMethod object from the incoming stream
43      public object Deserialize( Stream stream )      public object Deserialize( Stream stream )
44      {      {
45        return null;        StreamReader reader = new StreamReader( stream );
46          XmlTextReader tr = new XmlTextReader( stream );
47          XmlRpcMethod method = new XmlRpcMethod();
48          method.Read( tr );
49    
50          return method;
51      }      }
52    
53        // Writes a XmlRpc MethodCall from the XmlRpcMethod object
54      public void Serialize( Stream stream, object o )      public void Serialize( Stream stream, object o )
55      {      {
56          if( o is XmlRpcMethod ) {
57            StreamWriter sw = new StreamWriter( stream );
58            StringWriter s = new StringWriter();
59            XmlRpcWriter w = new XmlRpcWriter( s );
60            w.Write( (XmlRpcMethod)o );
61            sw.Write( s.ToString() );
62            sw.Flush();
63          }
64          else {
65            Console.Out.WriteLine
66              ( "BUMMER: wrong type given: {0}, expected and object of type {1}",
67                o.GetType(), "DotGNU.XmlRpc.XmlRpcMethod" );
68          }
69      }      }
70    
71      public SerializationBinder Binder      public SerializationBinder Binder
72      {      {
73        get{        get{
74          return null;          return this.binder;
75        }        }
76        set{        set{
77            this.binder = value;
78        }        }
79      }      }
80    
# Line 59  namespace DotGNU.XmlRpc.Serialization Line 90  namespace DotGNU.XmlRpc.Serialization
90      public ISurrogateSelector SurrogateSelector      public ISurrogateSelector SurrogateSelector
91      {      {
92        get {        get {
93          return null;          return this.surrogateSelector;
           
94        }        }
95        set {        set {
96            this.surrogateSelector = value;
97        }        }
98      }      }
99    }    }

Legend:
Removed from v.1.1.2.2  
changed lines
  Added in v.1.1.2.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26