Author: atsushi
Date: 2008-02-14 07:50:12 -0500 (Thu, 14 Feb 2008)
New Revision: 95623

Modified:
   trunk/olive/class/System.ServiceModel/System.ServiceModel/ChangeLog
   trunk/olive/class/System.ServiceModel/System.ServiceModel/ChannelFactory_1.cs
   trunk/olive/class/System.ServiceModel/System.ServiceModel/ClientBase.cs
   
trunk/olive/class/System.ServiceModel/System.ServiceModel/ClientProxyGenerator.cs
   
trunk/olive/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs
Log:
2008-02-14  Atsushi Enomoto  <[EMAIL PROTECTED]>

        * ClientBase.cs, ClientProxyGenerator.cs : the client proxy does not
          have to be generic, so removed the type argument.
        * ChannelFactory_1.cs : ditto.
          EnsureOpened() when creating a channel (it
          used to do so, but disappeared at some point ...).
        * ClientRuntimeChannel.cs : ditto (type argument).
          Factory must have been opened before creating this channel, so
          do not try to open factory here.



Modified: trunk/olive/class/System.ServiceModel/System.ServiceModel/ChangeLog
===================================================================
--- trunk/olive/class/System.ServiceModel/System.ServiceModel/ChangeLog 
2008-02-14 12:08:02 UTC (rev 95622)
+++ trunk/olive/class/System.ServiceModel/System.ServiceModel/ChangeLog 
2008-02-14 12:50:12 UTC (rev 95623)
@@ -1,3 +1,14 @@
+2008-02-14  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * ClientBase.cs, ClientProxyGenerator.cs : the client proxy does not
+         have to be generic, so removed the type argument.
+       * ChannelFactory_1.cs : ditto.
+         EnsureOpened() when creating a channel (it
+         used to do so, but disappeared at some point ...).
+       * ClientRuntimeChannel.cs : ditto (type argument).
+         Factory must have been opened before creating this channel, so
+         do not try to open factory here.
+
 2008-02-08  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * ServiceHostBase.cs : when listenUri is not absolute, make it

Modified: 
trunk/olive/class/System.ServiceModel/System.ServiceModel/ChannelFactory_1.cs
===================================================================
--- 
trunk/olive/class/System.ServiceModel/System.ServiceModel/ChannelFactory_1.cs   
    2008-02-14 12:08:02 UTC (rev 95622)
+++ 
trunk/olive/class/System.ServiceModel/System.ServiceModel/ChannelFactory_1.cs   
    2008-02-14 12:50:12 UTC (rev 95623)
@@ -114,7 +114,8 @@
                [MonoTODO]
                public virtual TChannel CreateChannel (EndpointAddress address, 
Uri via)
                {
-                       Type type = 
ClientProxyGenerator.CreateProxyType<TChannel> (Endpoint.Contract);
+                       EnsureOpened ();
+                       Type type = ClientProxyGenerator.CreateProxyType 
(Endpoint.Contract);
                        object proxy = Activator.CreateInstance (type,
                                new object [] {CreateRuntime (Endpoint), this});
                        return (TChannel) proxy;

Modified: 
trunk/olive/class/System.ServiceModel/System.ServiceModel/ClientBase.cs
===================================================================
--- trunk/olive/class/System.ServiceModel/System.ServiceModel/ClientBase.cs     
2008-02-14 12:08:02 UTC (rev 95622)
+++ trunk/olive/class/System.ServiceModel/System.ServiceModel/ClientBase.cs     
2008-02-14 12:50:12 UTC (rev 95623)
@@ -42,7 +42,7 @@
                : IDisposable, ICommunicationObject
        {
                ChannelFactory<TChannel> factory;
-               ClientRuntimeChannel<TChannel> inner_channel;
+               ClientRuntimeChannel inner_channel;
                CommunicationState state;
 
                protected ClientBase ()
@@ -167,7 +167,7 @@
                public IClientChannel InnerChannel {
                        get {
                                if (inner_channel == null)
-                                       inner_channel = 
(ClientRuntimeChannel<TChannel>) (object) factory.CreateChannel ();
+                                       inner_channel = (ClientRuntimeChannel) 
(object) factory.CreateChannel ();
                                return inner_channel;
                        }
                }
@@ -208,7 +208,6 @@
                        return ChannelFactory.CreateChannel ();
                }
 
-               [MonoTODO]
                public void Open ()
                {
                        InnerChannel.Open ();

Modified: 
trunk/olive/class/System.ServiceModel/System.ServiceModel/ClientProxyGenerator.cs
===================================================================
--- 
trunk/olive/class/System.ServiceModel/System.ServiceModel/ClientProxyGenerator.cs
   2008-02-14 12:08:02 UTC (rev 95622)
+++ 
trunk/olive/class/System.ServiceModel/System.ServiceModel/ClientProxyGenerator.cs
   2008-02-14 12:50:12 UTC (rev 95623)
@@ -38,19 +38,19 @@
 {
        internal class ClientProxyGenerator
        {
-               public static Type CreateProxyType<TContract> 
(ContractDescription cd)
+               public static Type CreateProxyType (ContractDescription cd)
                {
                        string modname = "dummy";
 
-                       // public class __clientproxy_MyContract : 
ClientRuntimeChannel<[TContract]>, TContract
+                       // public class __clientproxy_MyContract : 
ClientRuntimeChannel, [ContractType]
                        CodeClass c = new CodeModule (modname).CreateClass (
                                "__clientproxy_" + cd.Name,
-                               typeof (ClientRuntimeChannel<TContract>),
+                               typeof (ClientRuntimeChannel),
                                new Type [] {cd.ContractType});
 
                        //
                        // public __clientproxy_MyContract (
-                       //      ClientRuntime arg1, ClientBase<[TContract]> 
arg2)
+                       //      ClientRuntime arg1, ChannelFactory arg2)
                        //      : base (arg1, arg2)
                        // {
                        // }
@@ -60,8 +60,8 @@
                        CodeMethod ctor = c.CreateConstructor (
                                MethodAttributes.Public, ctorargs);
                        CodeBuilder b = ctor.CodeBuilder;
-                       MethodBase baseCtor = typeof 
(ClientRuntimeChannel<TContract>).GetConstructor (ctorargs);
-                       if (baseCtor == null) throw new Exception ("INTERNAL 
ERROR: ClientRuntimeChannel<TContract>#.ctor(ClientRuntime,ChannelFactory) does 
not exist.");
+                       MethodBase baseCtor = typeof 
(ClientRuntimeChannel).GetConstructor (ctorargs);
+                       if (baseCtor == null) throw new Exception ("INTERNAL 
ERROR: ClientRuntimeChannel#.ctor(ClientRuntime,ChannelFactory) does not 
exist.");
                        b.Call (
                                ctor.GetThis (),
                                baseCtor,
@@ -69,8 +69,8 @@
                                new CodeArgumentReference (typeof 
(ChannelFactory), 2, "arg1"));
 
                        // member implementation
-                       MethodInfo processMethod = typeof 
(ClientRuntimeChannel<TContract>).GetMethod ("Process");
-                       if (processMethod == null) throw new Exception 
("INTERNAL ERROR: ClientRuntimeChannel<TContract>.Process() does not exist.");
+                       MethodInfo processMethod = typeof 
(ClientRuntimeChannel).GetMethod ("Process");
+                       if (processMethod == null) throw new Exception 
("INTERNAL ERROR: ClientRuntimeChannel.Process() does not exist.");
                        foreach (OperationDescription od in cd.Operations) {
                                // FIXME: handle properties and events.
                                if (od.SyncMethod != null)

Modified: 
trunk/olive/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs
===================================================================
--- 
trunk/olive/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs
   2008-02-14 12:08:02 UTC (rev 95622)
+++ 
trunk/olive/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs
   2008-02-14 12:50:12 UTC (rev 95623)
@@ -34,7 +34,7 @@
 
 namespace System.ServiceModel
 {
-       internal class ClientRuntimeChannel<TContract>
+       internal class ClientRuntimeChannel
                : CommunicationObject, IClientChannel
        {
                ClientRuntime runtime;
@@ -173,17 +173,14 @@
                protected override IAsyncResult OnBeginOpen (
                        TimeSpan timeout, AsyncCallback callback, object state)
                {
-                       return factory.BeginOpen (timeout, callback, state);
                }
 
                protected override void OnEndOpen (IAsyncResult result)
                {
-                       factory.EndOpen (result);
                }
 
                protected override void OnOpen (TimeSpan timeout)
                {
-                       factory.Open (timeout);
                }
 
                // IChannel

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to