mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-19 01:31:17 -10:00
Adding reference source for System.Data System.Data.DataSetExtensions System.Data.Entity System.Data.Entity.Design System.Data.Linq System.Data.SqlXml System.ServiceModel System.ServiceModel.Activation System.ServiceModel.Activities System.ServiceModel.Channels System.ServiceModel.Discovery System.ServiceModel.Internals System.ServiceModel.Routing System.ServiceModel.WasHosting System.ServiceModel.Web System.Web System.Web.ApplicationServices System.Web.DynamicData System.Web.Entity System.Web.Entity.Design System.Web.Extensions System.Web.Mobile System.Web.Routing System.Web.Services System.Xml System.Xml.Linq
85 lines
3.8 KiB
C#
85 lines
3.8 KiB
C#
//------------------------------------------------------------------------------
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
//------------------------------------------------------------------------------
|
|
|
|
namespace System.ServiceModel.Configuration
|
|
{
|
|
using System.Configuration;
|
|
using System.Diagnostics.CodeAnalysis;
|
|
using System.ServiceModel.Channels;
|
|
using System.Globalization;
|
|
using System.Net;
|
|
using System.Net.Security;
|
|
using System.Runtime;
|
|
using System.Security.Authentication.ExtendedProtection.Configuration;
|
|
using System.ServiceModel;
|
|
using System.ServiceModel.Security;
|
|
using System.ComponentModel;
|
|
|
|
public sealed partial class HttpTransportSecurityElement : ServiceModelConfigurationElement
|
|
{
|
|
[ConfigurationProperty(ConfigurationStrings.ClientCredentialType, DefaultValue = HttpTransportSecurity.DefaultClientCredentialType)]
|
|
[ServiceModelEnumValidator(typeof(HttpClientCredentialTypeHelper))]
|
|
public HttpClientCredentialType ClientCredentialType
|
|
{
|
|
get { return (HttpClientCredentialType)base[ConfigurationStrings.ClientCredentialType]; }
|
|
set { base[ConfigurationStrings.ClientCredentialType] = value; }
|
|
}
|
|
|
|
[ConfigurationProperty(ConfigurationStrings.ProxyCredentialType, DefaultValue = HttpTransportSecurity.DefaultProxyCredentialType)]
|
|
[ServiceModelEnumValidator(typeof(HttpProxyCredentialTypeHelper))]
|
|
public HttpProxyCredentialType ProxyCredentialType
|
|
{
|
|
get { return (HttpProxyCredentialType)base[ConfigurationStrings.ProxyCredentialType]; }
|
|
set { base[ConfigurationStrings.ProxyCredentialType] = value; }
|
|
}
|
|
|
|
[ConfigurationProperty(ConfigurationStrings.ExtendedProtectionPolicy)]
|
|
public ExtendedProtectionPolicyElement ExtendedProtectionPolicy
|
|
{
|
|
get { return (ExtendedProtectionPolicyElement)base[ConfigurationStrings.ExtendedProtectionPolicy]; }
|
|
private set { base[ConfigurationStrings.ExtendedProtectionPolicy] = value; }
|
|
}
|
|
|
|
[ConfigurationProperty(ConfigurationStrings.Realm, DefaultValue = HttpTransportSecurity.DefaultRealm)]
|
|
[StringValidator(MinLength = 0)]
|
|
public string Realm
|
|
{
|
|
get { return (string)base[ConfigurationStrings.Realm]; }
|
|
set
|
|
{
|
|
if (String.IsNullOrEmpty(value))
|
|
{
|
|
value = String.Empty;
|
|
}
|
|
base[ConfigurationStrings.Realm] = value;
|
|
}
|
|
}
|
|
|
|
internal void ApplyConfiguration(HttpTransportSecurity security)
|
|
{
|
|
if (security == null)
|
|
{
|
|
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("security");
|
|
}
|
|
security.ClientCredentialType = this.ClientCredentialType;
|
|
security.ProxyCredentialType = this.ProxyCredentialType;
|
|
security.Realm = this.Realm;
|
|
security.ExtendedProtectionPolicy = ChannelBindingUtility.BuildPolicy(this.ExtendedProtectionPolicy);
|
|
}
|
|
|
|
internal void InitializeFrom(HttpTransportSecurity security)
|
|
{
|
|
if (security == null)
|
|
{
|
|
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("security");
|
|
}
|
|
SetPropertyValueIfNotDefaultValue(ConfigurationStrings.ClientCredentialType, security.ClientCredentialType);
|
|
SetPropertyValueIfNotDefaultValue(ConfigurationStrings.ProxyCredentialType, security.ProxyCredentialType);
|
|
SetPropertyValueIfNotDefaultValue(ConfigurationStrings.Realm, security.Realm);
|
|
|
|
ChannelBindingUtility.InitializeFrom(security.ExtendedProtectionPolicy, this.ExtendedProtectionPolicy);
|
|
}
|
|
}
|
|
}
|