2009-09-30 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Wed, 30 Sep 2009 07:35:10 +0000 (07:35 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Wed, 30 Sep 2009 07:35:10 +0000 (07:35 -0000)
* MoonlightChannelBaseExtension.cs : add CreateChannel() override.

svn path=/trunk/mcs/; revision=142968

mcs/tools/svcutil/ChangeLog
mcs/tools/svcutil/MoonlightChannelBaseExtension.cs

index e96b040110efbc1d805881fa535a240848587f06..f3b5f0ebf95d01a207fb145322ae9c199bcc4b75 100644 (file)
@@ -1,3 +1,7 @@
+2009-09-30  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * MoonlightChannelBaseExtension.cs : add CreateChannel() override.
+
 2009-08-10  Atsushi Enomoto  <atsushi@ximian.com>
 
        * MoonlightChannelBaseExtension.cs : fixed a couple of generated
index 8a99a6ed4b5f569939fa913c8fa94d73455b951b..3bd6ac6b525bbdb6e877134d581bba17b9446714 100644 (file)
@@ -153,6 +153,21 @@ namespace Mono.ServiceContractTool
                        ctor.BaseConstructorArgs.Add (
                                new CodeArgumentReferenceExpression ("client"));
                        type.Members.Add (ctor);
+
+                       // In Client type:
+                       // protected override TChannel CreateChannel()
+                       var creator = new CodeMemberMethod ();
+                       creator.Name = "CreateChannel";
+                       creator.Attributes = MemberAttributes.Family | MemberAttributes.Override;
+                       creator.ReturnType = gt;
+                       creator.Statements.Add (
+                               new CodeMethodReturnStatement (
+                                       new CodeCastExpression (
+                                               gt,
+                                               new CodeObjectCreateExpression (
+                                                       new CodeTypeReference (name),
+                                                       new CodeThisReferenceExpression ()))));
+                       parentClass.Members.Add (creator);
                }
        }
 
@@ -209,6 +224,7 @@ namespace Mono.ServiceContractTool
                        var type = ml_context.ChannelType;
                        var od = context.Operation;
 
+                       // BeginXxx() implementation
                        CodeMemberMethod cm = new CodeMemberMethod ();
                        type.Members.Add (cm);
                        cm.Name = "Begin" + od.Name;