add new AddServiceEndpoint() overload in 4.0.
authorAtsushi Eno <atsushi@ximian.com>
Wed, 11 Aug 2010 17:25:33 +0000 (02:25 +0900)
committerAtsushi Eno <atsushi@ximian.com>
Wed, 11 Aug 2010 17:25:33 +0000 (02:25 +0900)
mcs/class/System.ServiceModel/System.ServiceModel/ServiceHostBase.cs

index 1f8484264b9d0c8353371b3de031051964d3dabf..52bb1ed723e0d72aed7641f7267d62829f39bb0e 100644 (file)
@@ -203,6 +203,25 @@ namespace System.ServiceModel
                        return AddServiceEndpointCore (cd, binding, ea, listenUri);
                }
 
+#if NET_4_0
+               public virtual void AddServiceEndpoint (ServiceEndpoint endpoint)
+               {
+                       if (endpoint == null)
+                               throw new ArgumentNullException ("endpoint");
+
+                       ThrowIfDisposedOrImmutable ();
+
+                       if (endpoint.Address == null)
+                               throw new ArgumentException ("Address on the argument endpoint is null");
+                       if (endpoint.Contract == null)
+                               throw new ArgumentException ("Contract on the argument endpoint is null");
+                       if (endpoint.Binding == null)
+                               throw new ArgumentException ("Binding on the argument endpoint is null");
+
+                       Description.Endpoints.Add (endpoint);
+               }
+#endif
+
                Type PopulateType (string typeName)
                {
                        Type type = Type.GetType (typeName);