2010-03-23 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Tue, 23 Mar 2010 04:43:07 +0000 (04:43 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Tue, 23 Mar 2010 04:43:07 +0000 (04:43 -0000)
* ConnectionOrientedTransportElement.cs, StandardBindingElement.cs,
  LocalClientSecuritySettingsElement.cs, CustomBindingElement.cs:
  add couple of missing methods and TypeConverterAttributes.

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

mcs/class/System.ServiceModel/System.ServiceModel.Configuration/ChangeLog
mcs/class/System.ServiceModel/System.ServiceModel.Configuration/ConnectionOrientedTransportElement.cs
mcs/class/System.ServiceModel/System.ServiceModel.Configuration/CustomBindingElement.cs
mcs/class/System.ServiceModel/System.ServiceModel.Configuration/LocalClientSecuritySettingsElement.cs
mcs/class/System.ServiceModel/System.ServiceModel.Configuration/StandardBindingElement.cs

index ef771350c212cd8964035326c85fc7de135ae7e4..6e691a574073c863666c176b2d85ac6c17b60542 100755 (executable)
@@ -1,3 +1,9 @@
+2010-03-23  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * ConnectionOrientedTransportElement.cs, StandardBindingElement.cs, 
+         LocalClientSecuritySettingsElement.cs, CustomBindingElement.cs:
+         add couple of missing methods and TypeConverterAttributes.
+
 2010-03-17  Atsushi Enomoto  <atsushi@ximian.com>
 
        * ServiceMetadataPublishingElement.cs : use IsNullOrEmpty(), names
index 59c9bb259f00559a7197237dfe5e99da2e52ff73..5ec8e8dde055f1da4a64f6ea50d7de1b4053bee7 100644 (file)
@@ -59,7 +59,8 @@ namespace System.ServiceModel.Configuration
        {
                ConfigurationPropertyCollection _properties;
 
-               protected ConnectionOrientedTransportElement () {
+               internal ConnectionOrientedTransportElement ()
+               {
                }
 
                // Properties
@@ -67,6 +68,7 @@ namespace System.ServiceModel.Configuration
                [ConfigurationProperty ("channelInitializationTimeout",
                         Options = ConfigurationPropertyOptions.None,
                         DefaultValue = "00:00:05")]
+               [TypeConverter (typeof (TimeSpanConverter))]
                public TimeSpan ChannelInitializationTimeout {
                        get { return (TimeSpan) base ["channelInitializationTimeout"]; }
                        set { base ["channelInitializationTimeout"] = value; }
@@ -105,6 +107,7 @@ namespace System.ServiceModel.Configuration
                [ConfigurationProperty ("maxOutputDelay",
                         Options = ConfigurationPropertyOptions.None,
                         DefaultValue = "00:00:00.2")]
+               [TypeConverter (typeof (TimeSpanConverter))]
                public TimeSpan MaxOutputDelay {
                        get { return (TimeSpan) base ["maxOutputDelay"]; }
                        set { base ["maxOutputDelay"] = value; }
@@ -157,7 +160,44 @@ namespace System.ServiceModel.Configuration
                        set { base ["transferMode"] = value; }
                }
 
+               public override void ApplyConfiguration (BindingElement bindingElement)
+               {
+                       var e = (ConnectionOrientedTransportBindingElement) bindingElement;
+                       e.ChannelInitializationTimeout = ChannelInitializationTimeout;
+                       e.ConnectionBufferSize = ConnectionBufferSize;
+                       e.HostNameComparisonMode = HostNameComparisonMode;
+                       e.MaxBufferSize = MaxBufferSize;
+                       e.MaxOutputDelay = MaxOutputDelay;
+                       e.MaxPendingAccepts = MaxPendingAccepts;
+                       e.MaxPendingConnections = MaxPendingConnections;
+                       e.TransferMode = TransferMode;
+               }
+
+               public override void CopyFrom (ServiceModelExtensionElement from)
+               {
+                       var e = (ConnectionOrientedTransportElement) from;
+                       ChannelInitializationTimeout = e.ChannelInitializationTimeout;
+                       ConnectionBufferSize = e.ConnectionBufferSize;
+                       HostNameComparisonMode = e.HostNameComparisonMode;
+                       MaxBufferSize = e.MaxBufferSize;
+                       MaxOutputDelay = e.MaxOutputDelay;
+                       MaxPendingAccepts = e.MaxPendingAccepts;
+                       MaxPendingConnections = e.MaxPendingConnections;
+                       TransferMode = e.TransferMode;
+               }
 
+               protected internal override void InitializeFrom (BindingElement bindingElement)
+               {
+                       var e = (ConnectionOrientedTransportBindingElement) bindingElement;
+                       ChannelInitializationTimeout = e.ChannelInitializationTimeout;
+                       ConnectionBufferSize = e.ConnectionBufferSize;
+                       HostNameComparisonMode = e.HostNameComparisonMode;
+                       MaxBufferSize = e.MaxBufferSize;
+                       MaxOutputDelay = e.MaxOutputDelay;
+                       MaxPendingAccepts = e.MaxPendingAccepts;
+                       MaxPendingConnections = e.MaxPendingConnections;
+                       TransferMode = e.TransferMode;
+               }
        }
 
 }
index afa1dd0c09e6486b2dc6a8793a45057bb8e0ef05..ccf763505ed8b86aa2fccc30b957795aea6ed298 100644 (file)
@@ -72,6 +72,7 @@ namespace System.ServiceModel.Configuration
                [ConfigurationProperty ("closeTimeout",
                         Options = ConfigurationPropertyOptions.None,
                         DefaultValue = "00:01:00")]
+               [TypeConverter (typeof (TimeSpanConverter))]
                public TimeSpan CloseTimeout {
                        get { return (TimeSpan) base ["closeTimeout"]; }
                        set { base ["closeTimeout"] = value; }
@@ -80,6 +81,7 @@ namespace System.ServiceModel.Configuration
                [ConfigurationProperty ("openTimeout",
                         Options = ConfigurationPropertyOptions.None,
                         DefaultValue = "00:01:00")]
+               [TypeConverter (typeof (TimeSpanConverter))]
                public TimeSpan OpenTimeout {
                        get { return (TimeSpan) base ["openTimeout"]; }
                        set { base ["openTimeout"] = value; }
@@ -101,6 +103,7 @@ namespace System.ServiceModel.Configuration
                [ConfigurationProperty ("receiveTimeout",
                         Options = ConfigurationPropertyOptions.None,
                         DefaultValue = "00:10:00")]
+               [TypeConverter (typeof (TimeSpanConverter))]
                public TimeSpan ReceiveTimeout {
                        get { return (TimeSpan) base ["receiveTimeout"]; }
                        set { base ["receiveTimeout"] = value; }
@@ -109,14 +112,27 @@ namespace System.ServiceModel.Configuration
                [ConfigurationProperty ("sendTimeout",
                         Options = ConfigurationPropertyOptions.None,
                         DefaultValue = "00:01:00")]
+               [TypeConverter (typeof (TimeSpanConverter))]
                public TimeSpan SendTimeout {
                        get { return (TimeSpan) base ["sendTimeout"]; }
                        set { base ["sendTimeout"] = value; }
                }
 
-               [MonoTODO]
-               public void ApplyConfiguration (Binding binding) {
-                       throw new NotImplementedException ();
+               [MonoTODO ("what to reject?")]
+               public override void Add (BindingElementExtensionElement element)
+               {
+                       base.Add (element);
+               }
+
+               [MonoTODO ("what to reject?")]
+               public override bool CanAdd (BindingElementExtensionElement element)
+               {
+                       return true;
+               }
+
+               public void ApplyConfiguration (Binding binding)
+               {
+                       OnApplyConfiguration (binding);
                }
 
                [MonoTODO ("implement using EvaluationContext")]
@@ -133,6 +149,19 @@ namespace System.ServiceModel.Configuration
                        return element;
                }
 
+               protected void OnApplyConfiguration (Binding binding)
+               {
+                       if (binding == null)
+                               throw new ArgumentNullException ("binding");
+                       var b = (CustomBinding) binding;
+                       b.CloseTimeout = CloseTimeout;
+                       b.OpenTimeout = OpenTimeout;
+                       b.ReceiveTimeout = ReceiveTimeout;
+                       b.SendTimeout = SendTimeout;
+
+                       foreach (var be in this)
+                               b.Elements.Add (be.CreateBindingElement ());
+               }
        }
 
 }
index c0dce430f196af6564b33716d950adaa3fb5306c..9055f054906b5d8caef822a8ae25628f926a36b1 100644 (file)
@@ -94,6 +94,7 @@ namespace System.ServiceModel.Configuration
                [ConfigurationProperty ("maxClockSkew",
                         Options = ConfigurationPropertyOptions.None,
                         DefaultValue = "00:05:00")]
+               [TypeConverter (typeof (TimeSpanConverter))]
                public TimeSpan MaxClockSkew {
                        get { return (TimeSpan) base ["maxClockSkew"]; }
                        set { base ["maxClockSkew"] = value; }
@@ -102,6 +103,7 @@ namespace System.ServiceModel.Configuration
                [ConfigurationProperty ("maxCookieCachingTime",
                         Options = ConfigurationPropertyOptions.None,
                         DefaultValue = "10675199.02:48:05.4775807")]
+               [TypeConverter (typeof (TimeSpanConverter))]
                public TimeSpan MaxCookieCachingTime {
                        get { return (TimeSpan) base ["maxCookieCachingTime"]; }
                        set { base ["maxCookieCachingTime"] = value; }
@@ -133,6 +135,7 @@ namespace System.ServiceModel.Configuration
                [ConfigurationProperty ("replayWindow",
                         Options = ConfigurationPropertyOptions.None,
                         DefaultValue = "00:05:00")]
+               [TypeConverter (typeof (TimeSpanConverter))]
                public TimeSpan ReplayWindow {
                        get { return (TimeSpan) base ["replayWindow"]; }
                        set { base ["replayWindow"] = value; }
@@ -141,6 +144,7 @@ namespace System.ServiceModel.Configuration
                [ConfigurationProperty ("sessionKeyRenewalInterval",
                         Options = ConfigurationPropertyOptions.None,
                         DefaultValue = "10:00:00")]
+               [TypeConverter (typeof (TimeSpanConverter))]
                public TimeSpan SessionKeyRenewalInterval {
                        get { return (TimeSpan) base ["sessionKeyRenewalInterval"]; }
                        set { base ["sessionKeyRenewalInterval"] = value; }
@@ -157,6 +161,7 @@ namespace System.ServiceModel.Configuration
                [ConfigurationProperty ("timestampValidityDuration",
                         Options = ConfigurationPropertyOptions.None,
                         DefaultValue = "00:05:00")]
+               [TypeConverter (typeof (TimeSpanConverter))]
                public TimeSpan TimestampValidityDuration {
                        get { return (TimeSpan) base ["timestampValidityDuration"]; }
                        set { base ["timestampValidityDuration"] = value; }
index d3bf240bbe0e5e0fabac39bce3f1380dff86747b..519c09729e0cbd75885d5a7547da61e07df17356 100644 (file)
@@ -74,6 +74,7 @@ namespace System.ServiceModel.Configuration
                [ConfigurationProperty ("closeTimeout",
                         Options = ConfigurationPropertyOptions.None,
                         DefaultValue = "00:01:00")]
+               [TypeConverter (typeof (TimeSpanConverter))]
                public TimeSpan CloseTimeout {
                        get { return (TimeSpan) this ["closeTimeout"]; }
                        set { this ["closeTimeout"] = value; }
@@ -94,6 +95,7 @@ namespace System.ServiceModel.Configuration
                [ConfigurationProperty ("openTimeout",
                         Options = ConfigurationPropertyOptions.None,
                         DefaultValue = "00:01:00")]
+               [TypeConverter (typeof (TimeSpanConverter))]
                public TimeSpan OpenTimeout {
                        get { return (TimeSpan) this ["openTimeout"]; }
                        set { this ["openTimeout"] = value; }
@@ -116,6 +118,7 @@ namespace System.ServiceModel.Configuration
                [ConfigurationProperty ("receiveTimeout",
                         Options = ConfigurationPropertyOptions.None,
                         DefaultValue = "00:10:00")]
+               [TypeConverter (typeof (TimeSpanConverter))]
                public TimeSpan ReceiveTimeout {
                        get { return (TimeSpan) this ["receiveTimeout"]; }
                        set { this ["receiveTimeout"] = value; }
@@ -124,6 +127,7 @@ namespace System.ServiceModel.Configuration
                [ConfigurationProperty ("sendTimeout",
                         Options = ConfigurationPropertyOptions.None,
                         DefaultValue = "00:01:00")]
+               [TypeConverter (typeof (TimeSpanConverter))]
                public TimeSpan SendTimeout {
                        get { return (TimeSpan) this ["sendTimeout"]; }
                        set { this ["sendTimeout"] = value; }