Merge pull request #4453 from lambdageek/bug-49721
[mono.git] / mcs / class / System.ServiceModel / System.ServiceModel.Channels / Binding.cs
index a3d3b360f6b7c27e9f10b56be1ec4741097379c8..5d942eebb25d119f29d778db8f46a4f3e0c0c139 100644 (file)
@@ -85,14 +85,7 @@ namespace System.ServiceModel.Channels
                public abstract string Scheme { get; }
 
                public MessageVersion MessageVersion {
-                       get {
-                               foreach (BindingElement e in CreateBindingElements ()) {
-                                       MessageEncodingBindingElement me = e as MessageEncodingBindingElement;
-                                       if (me != null)
-                                               return me.MessageVersion;
-                               }
-                               return null;
-                       }
+                       get { return GetProperty<MessageVersion> (new BindingParameterCollection ()); }
                }
 
                BindingContext CreateContext (
@@ -140,7 +133,7 @@ namespace System.ServiceModel.Channels
                        return CreateContext (parameters).BuildInnerChannelFactory<TChannel> ();
                }
 
-#if !NET_2_1
+#if !MOBILE
                public virtual IChannelListener<TChannel>
                        BuildChannelListener<TChannel> (
                        Uri listenUriBaseAddress,
@@ -183,7 +176,7 @@ namespace System.ServiceModel.Channels
 
                public virtual IChannelListener<TChannel>
                        BuildChannelListener<TChannel> (
-                       Uri listenUri,
+                       Uri listenUriBaseAddress,
                        params object [] parameters)
                        where TChannel : class, IChannel
                {
@@ -191,16 +184,16 @@ namespace System.ServiceModel.Channels
                                new BindingParameterCollection ();
                        foreach (object o in parameters)
                                pl.Add (o);
-                       return BuildChannelListener<TChannel> (listenUri, pl);
+                       return BuildChannelListener<TChannel> (listenUriBaseAddress, pl);
                }
 
                public virtual IChannelListener<TChannel>
                        BuildChannelListener<TChannel> (
-                       Uri listenUri,
+                       Uri listenUriBaseAddress,
                        BindingParameterCollection parameters)
                        where TChannel : class, IChannel
                {
-                       return BuildChannelListener<TChannel> (listenUri,
+                       return BuildChannelListener<TChannel> (listenUriBaseAddress,
                                String.Empty, parameters);
                }
 
@@ -274,7 +267,7 @@ namespace System.ServiceModel.Channels
                        return CreateContext (parameters).CanBuildInnerChannelFactory<TChannel> ();
                }
 
-#if !NET_2_1
+#if !MOBILE
                public bool CanBuildChannelListener<TChannel> (
                        params object [] parameters)
                        where TChannel : class, IChannel