e79aa3c0ed
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
61 lines
2.3 KiB
C#
61 lines
2.3 KiB
C#
//------------------------------------------------------------------------------
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
//------------------------------------------------------------------------------
|
|
|
|
namespace System.ServiceModel.Configuration
|
|
{
|
|
using System.Configuration;
|
|
using System.ServiceModel.Channels;
|
|
using System.Globalization;
|
|
using System.Net;
|
|
using System.Net.Security;
|
|
using System.ServiceModel;
|
|
using System.ServiceModel.Security;
|
|
using System.ComponentModel;
|
|
|
|
public sealed partial class BasicHttpSecurityElement : ServiceModelConfigurationElement
|
|
{
|
|
[ConfigurationProperty(ConfigurationStrings.Mode, DefaultValue = BasicHttpSecurity.DefaultMode)]
|
|
[ServiceModelEnumValidator(typeof(BasicHttpSecurityModeHelper))]
|
|
public BasicHttpSecurityMode Mode
|
|
{
|
|
get { return (BasicHttpSecurityMode)base[ConfigurationStrings.Mode]; }
|
|
set { base[ConfigurationStrings.Mode] = value; }
|
|
}
|
|
|
|
[ConfigurationProperty(ConfigurationStrings.Transport)]
|
|
public HttpTransportSecurityElement Transport
|
|
{
|
|
get { return (HttpTransportSecurityElement)base[ConfigurationStrings.Transport]; }
|
|
}
|
|
|
|
[ConfigurationProperty(ConfigurationStrings.Message)]
|
|
public BasicHttpMessageSecurityElement Message
|
|
{
|
|
get { return (BasicHttpMessageSecurityElement)base[ConfigurationStrings.Message]; }
|
|
}
|
|
|
|
internal void ApplyConfiguration(BasicHttpSecurity security)
|
|
{
|
|
if (security == null)
|
|
{
|
|
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("security");
|
|
}
|
|
security.Mode = this.Mode;
|
|
this.Transport.ApplyConfiguration(security.Transport);
|
|
this.Message.ApplyConfiguration(security.Message);
|
|
}
|
|
|
|
internal void InitializeFrom(BasicHttpSecurity security)
|
|
{
|
|
if (security == null)
|
|
{
|
|
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("security");
|
|
}
|
|
SetPropertyValueIfNotDefaultValue(ConfigurationStrings.Mode, security.Mode);
|
|
this.Transport.InitializeFrom(security.Transport);
|
|
this.Message.InitializeFrom(security.Message);
|
|
}
|
|
}
|
|
}
|