TransactedBatchingElement.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //------------------------------------------------------------------------------
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. //------------------------------------------------------------------------------
  4. namespace System.ServiceModel.Configuration
  5. {
  6. using System.Configuration;
  7. using System.ServiceModel.Description;
  8. public sealed partial class TransactedBatchingElement : BehaviorExtensionElement
  9. {
  10. [ConfigurationProperty(ConfigurationStrings.MaxBatchSize, DefaultValue = 0)]
  11. [IntegerValidator(MinValue = 0)]
  12. public int MaxBatchSize
  13. {
  14. get { return (int)base[ConfigurationStrings.MaxBatchSize]; }
  15. set { base[ConfigurationStrings.MaxBatchSize] = value; }
  16. }
  17. public override void CopyFrom(ServiceModelExtensionElement from)
  18. {
  19. base.CopyFrom(from);
  20. TransactedBatchingElement source = from as TransactedBatchingElement;
  21. #pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null
  22. this.MaxBatchSize = source.MaxBatchSize;
  23. }
  24. protected internal override object CreateBehavior()
  25. {
  26. return new TransactedBatchingBehavior(this.MaxBatchSize);
  27. }
  28. public override Type BehaviorType
  29. {
  30. get { return typeof(TransactedBatchingBehavior); }
  31. }
  32. }
  33. }