+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
{
ConfigurationPropertyCollection _properties;
- protected ConnectionOrientedTransportElement () {
+ internal ConnectionOrientedTransportElement ()
+ {
}
// Properties
[ConfigurationProperty ("channelInitializationTimeout",
Options = ConfigurationPropertyOptions.None,
DefaultValue = "00:00:05")]
+ [TypeConverter (typeof (TimeSpanConverter))]
public TimeSpan ChannelInitializationTimeout {
get { return (TimeSpan) base ["channelInitializationTimeout"]; }
set { base ["channelInitializationTimeout"] = value; }
[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; }
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;
+ }
}
}
[ConfigurationProperty ("closeTimeout",
Options = ConfigurationPropertyOptions.None,
DefaultValue = "00:01:00")]
+ [TypeConverter (typeof (TimeSpanConverter))]
public TimeSpan CloseTimeout {
get { return (TimeSpan) base ["closeTimeout"]; }
set { base ["closeTimeout"] = value; }
[ConfigurationProperty ("openTimeout",
Options = ConfigurationPropertyOptions.None,
DefaultValue = "00:01:00")]
+ [TypeConverter (typeof (TimeSpanConverter))]
public TimeSpan OpenTimeout {
get { return (TimeSpan) base ["openTimeout"]; }
set { base ["openTimeout"] = value; }
[ConfigurationProperty ("receiveTimeout",
Options = ConfigurationPropertyOptions.None,
DefaultValue = "00:10:00")]
+ [TypeConverter (typeof (TimeSpanConverter))]
public TimeSpan ReceiveTimeout {
get { return (TimeSpan) base ["receiveTimeout"]; }
set { base ["receiveTimeout"] = value; }
[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")]
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 ());
+ }
}
}
[ConfigurationProperty ("maxClockSkew",
Options = ConfigurationPropertyOptions.None,
DefaultValue = "00:05:00")]
+ [TypeConverter (typeof (TimeSpanConverter))]
public TimeSpan MaxClockSkew {
get { return (TimeSpan) base ["maxClockSkew"]; }
set { base ["maxClockSkew"] = value; }
[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; }
[ConfigurationProperty ("replayWindow",
Options = ConfigurationPropertyOptions.None,
DefaultValue = "00:05:00")]
+ [TypeConverter (typeof (TimeSpanConverter))]
public TimeSpan ReplayWindow {
get { return (TimeSpan) base ["replayWindow"]; }
set { base ["replayWindow"] = value; }
[ConfigurationProperty ("sessionKeyRenewalInterval",
Options = ConfigurationPropertyOptions.None,
DefaultValue = "10:00:00")]
+ [TypeConverter (typeof (TimeSpanConverter))]
public TimeSpan SessionKeyRenewalInterval {
get { return (TimeSpan) base ["sessionKeyRenewalInterval"]; }
set { base ["sessionKeyRenewalInterval"] = value; }
[ConfigurationProperty ("timestampValidityDuration",
Options = ConfigurationPropertyOptions.None,
DefaultValue = "00:05:00")]
+ [TypeConverter (typeof (TimeSpanConverter))]
public TimeSpan TimestampValidityDuration {
get { return (TimeSpan) base ["timestampValidityDuration"]; }
set { base ["timestampValidityDuration"] = value; }
[ConfigurationProperty ("closeTimeout",
Options = ConfigurationPropertyOptions.None,
DefaultValue = "00:01:00")]
+ [TypeConverter (typeof (TimeSpanConverter))]
public TimeSpan CloseTimeout {
get { return (TimeSpan) this ["closeTimeout"]; }
set { this ["closeTimeout"] = value; }
[ConfigurationProperty ("openTimeout",
Options = ConfigurationPropertyOptions.None,
DefaultValue = "00:01:00")]
+ [TypeConverter (typeof (TimeSpanConverter))]
public TimeSpan OpenTimeout {
get { return (TimeSpan) this ["openTimeout"]; }
set { this ["openTimeout"] = value; }
[ConfigurationProperty ("receiveTimeout",
Options = ConfigurationPropertyOptions.None,
DefaultValue = "00:10:00")]
+ [TypeConverter (typeof (TimeSpanConverter))]
public TimeSpan ReceiveTimeout {
get { return (TimeSpan) this ["receiveTimeout"]; }
set { this ["receiveTimeout"] = value; }
[ConfigurationProperty ("sendTimeout",
Options = ConfigurationPropertyOptions.None,
DefaultValue = "00:01:00")]
+ [TypeConverter (typeof (TimeSpanConverter))]
public TimeSpan SendTimeout {
get { return (TimeSpan) this ["sendTimeout"]; }
set { this ["sendTimeout"] = value; }