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