1 //------------------------------------------------------------------------------ 2 // Copyright (c) Microsoft Corporation. All rights reserved. 3 //------------------------------------------------------------------------------ 4 5 namespace System.ServiceModel.Configuration 6 { 7 using System; 8 using System.ServiceModel; 9 using System.Configuration; 10 using System.ServiceModel.Channels; 11 using System.Xml; 12 13 public sealed partial class StandardBindingOptionalReliableSessionElement : StandardBindingReliableSessionElement 14 { StandardBindingOptionalReliableSessionElement()15 public StandardBindingOptionalReliableSessionElement() 16 { 17 } 18 19 [ConfigurationProperty(ConfigurationStrings.Enabled, DefaultValue = ReliableSessionDefaults.Enabled)] 20 public bool Enabled 21 { 22 get { return (bool)base[ConfigurationStrings.Enabled]; } 23 set { base[ConfigurationStrings.Enabled] = value; } 24 } 25 InitializeFrom(OptionalReliableSession optionalReliableSession)26 public void InitializeFrom(OptionalReliableSession optionalReliableSession) 27 { 28 if (null == optionalReliableSession) 29 { 30 throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("optionalReliableSession"); 31 } 32 base.InitializeFrom(optionalReliableSession); 33 SetPropertyValueIfNotDefaultValue(ConfigurationStrings.Enabled, optionalReliableSession.Enabled); 34 } 35 ApplyConfiguration(OptionalReliableSession optionalReliableSession)36 public void ApplyConfiguration(OptionalReliableSession optionalReliableSession) 37 { 38 if (null == optionalReliableSession) 39 { 40 throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("optionalReliableSession"); 41 } 42 base.ApplyConfiguration(optionalReliableSession); 43 optionalReliableSession.Enabled = this.Enabled; 44 } 45 } 46 } 47 48