ServiceTimeoutsElement.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //------------------------------------------------------------------------------
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. //------------------------------------------------------------------------------
  4. namespace System.ServiceModel.Configuration
  5. {
  6. using System.ComponentModel;
  7. using System.Configuration;
  8. using System.Runtime;
  9. using System.ServiceModel.Description;
  10. public sealed partial class ServiceTimeoutsElement : BehaviorExtensionElement
  11. {
  12. public ServiceTimeoutsElement()
  13. {
  14. }
  15. [ConfigurationProperty(ConfigurationStrings.TransactionTimeout, DefaultValue = ServiceDefaults.TransactionTimeoutString)]
  16. [TypeConverter(typeof(TimeSpanOrInfiniteConverter))]
  17. [ServiceModelTimeSpanValidator(MinValueString = ConfigurationStrings.TimeSpanZero)]
  18. public TimeSpan TransactionTimeout
  19. {
  20. get { return (TimeSpan)base[ConfigurationStrings.TransactionTimeout]; }
  21. set { base[ConfigurationStrings.TransactionTimeout] = value; }
  22. }
  23. public override void CopyFrom(ServiceModelExtensionElement from)
  24. {
  25. base.CopyFrom(from);
  26. ServiceTimeoutsElement source = (ServiceTimeoutsElement)from;
  27. #pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null
  28. this.TransactionTimeout = source.TransactionTimeout;
  29. }
  30. protected internal override object CreateBehavior()
  31. {
  32. return new ServiceTimeoutsBehavior(this.TransactionTimeout);
  33. }
  34. public override Type BehaviorType
  35. {
  36. get { return typeof(ServiceTimeoutsBehavior); }
  37. }
  38. }
  39. }