You've already forked linux-packaging-mono
Imported Upstream version 4.0.0~alpha1
Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
@ -0,0 +1,98 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace System.ServiceModel.Configuration
|
||||
{
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.ServiceModel.Channels;
|
||||
using System.Xml;
|
||||
using System.Security;
|
||||
using System.Runtime;
|
||||
|
||||
public sealed partial class AddressHeaderCollectionElement : ServiceModelConfigurationElement
|
||||
{
|
||||
public AddressHeaderCollectionElement()
|
||||
{
|
||||
}
|
||||
|
||||
internal void Copy(AddressHeaderCollectionElement source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("source");
|
||||
}
|
||||
|
||||
PropertyInformationCollection properties = source.ElementInformation.Properties;
|
||||
if (properties[ConfigurationStrings.Headers].ValueOrigin != PropertyValueOrigin.Default)
|
||||
{
|
||||
this.Headers = source.Headers;
|
||||
}
|
||||
}
|
||||
|
||||
[ConfigurationProperty(ConfigurationStrings.Headers, DefaultValue = null)]
|
||||
public AddressHeaderCollection Headers
|
||||
{
|
||||
get
|
||||
{
|
||||
AddressHeaderCollection retVal = (AddressHeaderCollection)base[ConfigurationStrings.Headers];
|
||||
if (null == retVal)
|
||||
{
|
||||
retVal = AddressHeaderCollection.EmptyHeaderCollection;
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
value = AddressHeaderCollection.EmptyHeaderCollection;
|
||||
}
|
||||
base[ConfigurationStrings.Headers] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[Fx.Tag.SecurityNote(Critical = "Uses the critical helper SetIsPresent.",
|
||||
Safe = "Controls how/when SetIsPresent is used, not arbitrarily callable from PT (method is protected and class is sealed).")]
|
||||
[SecuritySafeCritical]
|
||||
protected override void DeserializeElement(XmlReader reader, bool serializeCollectionKey)
|
||||
{
|
||||
SetIsPresent();
|
||||
DeserializeElementCore(reader);
|
||||
}
|
||||
|
||||
private void DeserializeElementCore(XmlReader reader)
|
||||
{
|
||||
this.Headers = AddressHeaderCollection.ReadServiceParameters(XmlDictionaryReader.CreateDictionaryReader(reader));
|
||||
}
|
||||
|
||||
[Fx.Tag.SecurityNote(Critical = "Uses the critical helper SetIsPresent which elevates in order to set a property.",
|
||||
Safe = "Only passes 'this', does not let caller influence parameter.")]
|
||||
[SecurityCritical]
|
||||
void SetIsPresent()
|
||||
{
|
||||
ConfigurationHelpers.SetIsPresent(this);
|
||||
}
|
||||
|
||||
protected override bool SerializeToXmlElement(XmlWriter writer, String elementName)
|
||||
{
|
||||
bool dataToWrite = this.Headers.Count != 0;
|
||||
if (dataToWrite && writer != null)
|
||||
{
|
||||
writer.WriteStartElement(elementName);
|
||||
this.Headers.WriteContentsTo(XmlDictionaryWriter.CreateDictionaryWriter(writer));
|
||||
writer.WriteEndElement();
|
||||
}
|
||||
return dataToWrite;
|
||||
}
|
||||
|
||||
internal void InitializeFrom(AddressHeaderCollection headers)
|
||||
{
|
||||
SetPropertyValueIfNotDefaultValue(ConfigurationStrings.Headers, headers);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,30 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace System.ServiceModel.Configuration
|
||||
{
|
||||
using System.Configuration;
|
||||
|
||||
public sealed partial class AllowedAudienceUriElement : ConfigurationElement
|
||||
{
|
||||
public AllowedAudienceUriElement() : base() { }
|
||||
|
||||
// AudienceUri is exposed as a string instead of an Uri so that WCF can do as there is no standard for the actual string.
|
||||
[ConfigurationProperty(ConfigurationStrings.AllowedAudienceUri, Options = ConfigurationPropertyOptions.IsKey )]
|
||||
[StringValidator(MinLength = 1)]
|
||||
public string AllowedAudienceUri
|
||||
{
|
||||
get { return (string)base[ConfigurationStrings.AllowedAudienceUri]; }
|
||||
set
|
||||
{
|
||||
if (String.IsNullOrEmpty(value))
|
||||
{
|
||||
value = String.Empty;
|
||||
}
|
||||
base[ConfigurationStrings.AllowedAudienceUri] = value;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace System.ServiceModel.Configuration
|
||||
{
|
||||
using System.Configuration;
|
||||
|
||||
[ConfigurationCollection(typeof(AllowedAudienceUriElement), CollectionType = ConfigurationElementCollectionType.BasicMap)]
|
||||
public sealed partial class AllowedAudienceUriElementCollection : ServiceModelConfigurationElementCollection<AllowedAudienceUriElement>
|
||||
{
|
||||
public AllowedAudienceUriElementCollection()
|
||||
: base(ConfigurationElementCollectionType.BasicMap, ConfigurationStrings.Add)
|
||||
{ }
|
||||
|
||||
protected override ConfigurationElement CreateNewElement()
|
||||
{
|
||||
return new AllowedAudienceUriElement();
|
||||
}
|
||||
|
||||
protected override object GetElementKey(ConfigurationElement element)
|
||||
{
|
||||
if (element == null)
|
||||
{
|
||||
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("element");
|
||||
}
|
||||
|
||||
AllowedAudienceUriElement configElementKey = (AllowedAudienceUriElement)element;
|
||||
return configElementKey.AllowedAudienceUri;
|
||||
}
|
||||
|
||||
protected override bool ThrowOnDuplicate
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,131 @@
|
||||
// <copyright>
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace System.ServiceModel.Configuration
|
||||
{
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Configuration;
|
||||
using System.Globalization;
|
||||
using System.Runtime;
|
||||
using System.ServiceModel.Channels;
|
||||
|
||||
/// <summary>
|
||||
/// The ApplicationContainerSettingsElement provides configuration support for the NamedPipes
|
||||
/// services in in application containers.
|
||||
/// </summary>
|
||||
public sealed partial class ApplicationContainerSettingsElement : ServiceModelConfigurationElement
|
||||
{
|
||||
public ApplicationContainerSettingsElement()
|
||||
{
|
||||
}
|
||||
|
||||
[ConfigurationProperty(ConfigurationStrings.PackageFullName, DefaultValue = ApplicationContainerSettingsDefaults.PackageFullNameDefaultString)]
|
||||
[StringValidator(MinLength = 0)]
|
||||
public string PackageFullName
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)base[ConfigurationStrings.PackageFullName];
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (string.IsNullOrEmpty(value))
|
||||
{
|
||||
value = string.Empty;
|
||||
}
|
||||
|
||||
base[ConfigurationStrings.PackageFullName] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[ConfigurationProperty(ConfigurationStrings.SessionIdAttribute, DefaultValue = ApplicationContainerSettingsDefaults.CurrentUserSessionDefaultString)]
|
||||
[TypeConverter(typeof(SessionIdTypeConvertor))]
|
||||
[SessionIdTypeValidator]
|
||||
public int SessionId
|
||||
{
|
||||
get { return (int)base[ConfigurationStrings.SessionIdAttribute]; }
|
||||
set { base[ConfigurationStrings.SessionIdAttribute] = value; }
|
||||
}
|
||||
|
||||
internal void ApplyConfiguration(ApplicationContainerSettings settings)
|
||||
{
|
||||
if (null == settings)
|
||||
{
|
||||
throw FxTrace.Exception.ArgumentNull("settings");
|
||||
}
|
||||
|
||||
settings.PackageFullName = this.PackageFullName;
|
||||
settings.SessionId = this.SessionId;
|
||||
}
|
||||
|
||||
internal void InitializeFrom(ApplicationContainerSettings settings)
|
||||
{
|
||||
if (null == settings)
|
||||
{
|
||||
throw FxTrace.Exception.ArgumentNull("settings");
|
||||
}
|
||||
|
||||
SetPropertyValueIfNotDefaultValue(ConfigurationStrings.PackageFullName, settings.PackageFullName);
|
||||
SetPropertyValueIfNotDefaultValue(ConfigurationStrings.SessionIdAttribute, settings.SessionId);
|
||||
}
|
||||
|
||||
internal void CopyFrom(ApplicationContainerSettingsElement source)
|
||||
{
|
||||
if (null == source)
|
||||
{
|
||||
throw FxTrace.Exception.ArgumentNull("source");
|
||||
}
|
||||
|
||||
this.PackageFullName = source.PackageFullName;
|
||||
this.SessionId = source.SessionId;
|
||||
}
|
||||
|
||||
class SessionIdTypeValidator : IntegerValidator
|
||||
{
|
||||
public SessionIdTypeValidator()
|
||||
: base(1, int.MaxValue)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Validate(object value)
|
||||
{
|
||||
int id = (int)value;
|
||||
|
||||
if (id == ApplicationContainerSettingsDefaults.CurrentSession ||
|
||||
id == ApplicationContainerSettingsDefaults.ServiceSession)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
base.Validate(value);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (Fx.IsFatal(ex))
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
||||
throw FxTrace.Exception.AsError(new InvalidEnumArgumentException(SR.GetString(SR.SessionValueInvalid, value)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Property)]
|
||||
sealed class SessionIdTypeValidatorAttribute : ConfigurationValidatorAttribute
|
||||
{
|
||||
public override ConfigurationValidatorBase ValidatorInstance
|
||||
{
|
||||
get
|
||||
{
|
||||
return new SessionIdTypeValidator();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace System.ServiceModel.Configuration
|
||||
{
|
||||
public enum AuthenticationMode
|
||||
{
|
||||
AnonymousForCertificate,
|
||||
AnonymousForSslNegotiated,
|
||||
CertificateOverTransport,
|
||||
IssuedToken,
|
||||
IssuedTokenForCertificate,
|
||||
IssuedTokenForSslNegotiated,
|
||||
IssuedTokenOverTransport,
|
||||
Kerberos,
|
||||
KerberosOverTransport,
|
||||
MutualCertificate,
|
||||
MutualCertificateDuplex,
|
||||
MutualSslNegotiated,
|
||||
SecureConversation,
|
||||
SspiNegotiated,
|
||||
UserNameForCertificate,
|
||||
UserNameForSslNegotiated,
|
||||
UserNameOverTransport,
|
||||
SspiNegotiatedOverTransport
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,35 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace System.ServiceModel.Configuration
|
||||
{
|
||||
|
||||
static class AuthenticationModeHelper
|
||||
{
|
||||
public static bool IsDefined(AuthenticationMode value)
|
||||
{
|
||||
return value == AuthenticationMode.AnonymousForCertificate
|
||||
|| value == AuthenticationMode.AnonymousForSslNegotiated
|
||||
|| value == AuthenticationMode.CertificateOverTransport
|
||||
|| value == AuthenticationMode.IssuedToken
|
||||
|| value == AuthenticationMode.IssuedTokenForCertificate
|
||||
|| value == AuthenticationMode.IssuedTokenForSslNegotiated
|
||||
|| value == AuthenticationMode.IssuedTokenOverTransport
|
||||
|| value == AuthenticationMode.Kerberos
|
||||
|| value == AuthenticationMode.KerberosOverTransport
|
||||
|| value == AuthenticationMode.MutualCertificate
|
||||
|| value == AuthenticationMode.MutualCertificateDuplex
|
||||
|| value == AuthenticationMode.MutualSslNegotiated
|
||||
|| value == AuthenticationMode.SecureConversation
|
||||
|| value == AuthenticationMode.SspiNegotiated
|
||||
|| value == AuthenticationMode.UserNameForCertificate
|
||||
|| value == AuthenticationMode.UserNameForSslNegotiated
|
||||
|| value == AuthenticationMode.UserNameOverTransport
|
||||
|| value == AuthenticationMode.SspiNegotiatedOverTransport;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,39 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace System.ServiceModel.Configuration
|
||||
{
|
||||
using System.Configuration;
|
||||
|
||||
public sealed partial class AuthorizationPolicyTypeElement : ConfigurationElement
|
||||
{
|
||||
public AuthorizationPolicyTypeElement()
|
||||
{
|
||||
}
|
||||
|
||||
public AuthorizationPolicyTypeElement(string policyType)
|
||||
{
|
||||
if (String.IsNullOrEmpty(policyType))
|
||||
{
|
||||
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("policyType");
|
||||
}
|
||||
this.PolicyType = policyType;
|
||||
}
|
||||
|
||||
[ConfigurationProperty(ConfigurationStrings.PolicyType, Options = ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey)]
|
||||
[StringValidator(MinLength = 1)]
|
||||
public string PolicyType
|
||||
{
|
||||
get { return (string)base[ConfigurationStrings.PolicyType]; }
|
||||
set
|
||||
{
|
||||
if (String.IsNullOrEmpty(value))
|
||||
{
|
||||
value = String.Empty;
|
||||
}
|
||||
base[ConfigurationStrings.PolicyType] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace System.ServiceModel.Configuration
|
||||
{
|
||||
using System.Configuration;
|
||||
|
||||
[ConfigurationCollection(typeof(AuthorizationPolicyTypeElement))]
|
||||
public sealed class AuthorizationPolicyTypeElementCollection : ServiceModelConfigurationElementCollection<AuthorizationPolicyTypeElement>
|
||||
{
|
||||
public AuthorizationPolicyTypeElementCollection()
|
||||
: base()
|
||||
{ }
|
||||
|
||||
protected override object GetElementKey(ConfigurationElement element)
|
||||
{
|
||||
if (element == null)
|
||||
{
|
||||
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("element");
|
||||
}
|
||||
AuthorizationPolicyTypeElement authorizationPolicyTypeElement = (AuthorizationPolicyTypeElement)element;
|
||||
return authorizationPolicyTypeElement.PolicyType;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace System.ServiceModel.Configuration
|
||||
{
|
||||
using System.Configuration;
|
||||
|
||||
public sealed partial class BaseAddressElement : ConfigurationElement
|
||||
{
|
||||
public BaseAddressElement() : base() { }
|
||||
|
||||
// BaseAddress is exposed as a string instead of an Uri so that WCF can do
|
||||
// special parsing of wildcards (e.g. '*').
|
||||
[ConfigurationProperty(ConfigurationStrings.BaseAddress, Options = ConfigurationPropertyOptions.IsKey | ConfigurationPropertyOptions.IsRequired)]
|
||||
[StringValidator(MinLength = 1)]
|
||||
public string BaseAddress
|
||||
{
|
||||
get { return (string)base[ConfigurationStrings.BaseAddress]; }
|
||||
set
|
||||
{
|
||||
if (String.IsNullOrEmpty(value))
|
||||
{
|
||||
value = String.Empty;
|
||||
}
|
||||
base[ConfigurationStrings.BaseAddress] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace System.ServiceModel.Configuration
|
||||
{
|
||||
using System.Configuration;
|
||||
|
||||
[ConfigurationCollection(typeof(BaseAddressElement), CollectionType = ConfigurationElementCollectionType.BasicMap)]
|
||||
public sealed partial class BaseAddressElementCollection : ServiceModelConfigurationElementCollection<BaseAddressElement>
|
||||
{
|
||||
public BaseAddressElementCollection()
|
||||
: base(ConfigurationElementCollectionType.BasicMap, ConfigurationStrings.Add)
|
||||
{ }
|
||||
|
||||
protected override ConfigurationElement CreateNewElement()
|
||||
{
|
||||
return new BaseAddressElement();
|
||||
}
|
||||
|
||||
protected override object GetElementKey(ConfigurationElement element)
|
||||
{
|
||||
if (element == null)
|
||||
{
|
||||
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("element");
|
||||
}
|
||||
|
||||
BaseAddressElement configElementKey = (BaseAddressElement)element;
|
||||
return configElementKey.BaseAddress;
|
||||
}
|
||||
|
||||
protected override bool ThrowOnDuplicate
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace System.ServiceModel.Configuration
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
|
||||
public sealed partial class BaseAddressPrefixFilterElement : ConfigurationElement
|
||||
{
|
||||
public BaseAddressPrefixFilterElement()
|
||||
{
|
||||
}
|
||||
|
||||
public BaseAddressPrefixFilterElement(Uri prefix)
|
||||
: this()
|
||||
{
|
||||
if (prefix == null)
|
||||
{
|
||||
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("prefix");
|
||||
}
|
||||
this.Prefix = prefix;
|
||||
}
|
||||
|
||||
[ConfigurationProperty(ConfigurationStrings.Prefix, Options = ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey)]
|
||||
public Uri Prefix
|
||||
{
|
||||
get { return (Uri)base[ConfigurationStrings.Prefix]; }
|
||||
set { base[ConfigurationStrings.Prefix] = value; }
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace System.ServiceModel.Configuration
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Configuration;
|
||||
|
||||
[ConfigurationCollection(typeof(BaseAddressPrefixFilterElement))]
|
||||
public sealed class BaseAddressPrefixFilterElementCollection : ServiceModelConfigurationElementCollection<BaseAddressPrefixFilterElement>
|
||||
{
|
||||
public BaseAddressPrefixFilterElementCollection()
|
||||
: base(ConfigurationElementCollectionType.AddRemoveClearMap, ConfigurationStrings.Add)
|
||||
{ }
|
||||
|
||||
protected override ConfigurationElement CreateNewElement()
|
||||
{
|
||||
return new BaseAddressPrefixFilterElement();
|
||||
}
|
||||
|
||||
protected override Object GetElementKey(ConfigurationElement element)
|
||||
{
|
||||
if (element == null)
|
||||
{
|
||||
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("element");
|
||||
}
|
||||
|
||||
BaseAddressPrefixFilterElement configElementKey = (BaseAddressPrefixFilterElement)element;
|
||||
return configElementKey.Prefix;
|
||||
}
|
||||
|
||||
protected override bool ThrowOnDuplicate
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace System.ServiceModel.Configuration
|
||||
{
|
||||
using System.Configuration;
|
||||
using System.ServiceModel;
|
||||
using System.Globalization;
|
||||
|
||||
public partial class BasicHttpBindingCollectionElement : StandardBindingCollectionElement<BasicHttpBinding, BasicHttpBindingElement>
|
||||
{
|
||||
internal static BasicHttpBindingCollectionElement GetBindingCollectionElement()
|
||||
{
|
||||
return (BasicHttpBindingCollectionElement)ConfigurationHelpers.GetBindingCollectionElement(ConfigurationStrings.BasicHttpBindingCollectionElementName);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace System.ServiceModel.Configuration
|
||||
{
|
||||
using System.Configuration;
|
||||
using System.ServiceModel;
|
||||
using System.ServiceModel.Channels;
|
||||
|
||||
public partial class BasicHttpBindingElement : HttpBindingBaseElement
|
||||
{
|
||||
public BasicHttpBindingElement(string name)
|
||||
: base(name)
|
||||
{
|
||||
}
|
||||
|
||||
public BasicHttpBindingElement()
|
||||
: this(null)
|
||||
{
|
||||
}
|
||||
|
||||
protected override Type BindingElementType
|
||||
{
|
||||
get { return typeof(BasicHttpBinding); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty(ConfigurationStrings.MessageEncoding, DefaultValue = BasicHttpBindingDefaults.MessageEncoding)]
|
||||
[ServiceModelEnumValidator(typeof(WSMessageEncodingHelper))]
|
||||
public WSMessageEncoding MessageEncoding
|
||||
{
|
||||
get { return (WSMessageEncoding)base[ConfigurationStrings.MessageEncoding]; }
|
||||
set { base[ConfigurationStrings.MessageEncoding] = value; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty(ConfigurationStrings.Security)]
|
||||
public BasicHttpSecurityElement Security
|
||||
{
|
||||
get { return (BasicHttpSecurityElement)base[ConfigurationStrings.Security]; }
|
||||
}
|
||||
|
||||
protected internal override void InitializeFrom(Binding binding)
|
||||
{
|
||||
base.InitializeFrom(binding);
|
||||
BasicHttpBinding bpBinding = (BasicHttpBinding)binding;
|
||||
|
||||
SetPropertyValueIfNotDefaultValue(ConfigurationStrings.MessageEncoding, bpBinding.MessageEncoding);
|
||||
this.Security.InitializeFrom(bpBinding.Security);
|
||||
}
|
||||
|
||||
protected override void OnApplyConfiguration(Binding binding)
|
||||
{
|
||||
base.OnApplyConfiguration(binding);
|
||||
BasicHttpBinding bpBinding = (BasicHttpBinding)binding;
|
||||
bpBinding.MessageEncoding = this.MessageEncoding;
|
||||
this.Security.ApplyConfiguration(bpBinding.Security);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace System.ServiceModel.Configuration
|
||||
{
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.ServiceModel;
|
||||
|
||||
[TypeForwardedFrom("System.WorkflowServices, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")]
|
||||
public class BasicHttpContextBindingCollectionElement : StandardBindingCollectionElement<BasicHttpContextBinding, BasicHttpContextBindingElement>
|
||||
{
|
||||
internal const string basicHttpContextBindingName = "basicHttpContextBinding";
|
||||
|
||||
public BasicHttpContextBindingCollectionElement()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
internal static BasicHttpContextBindingCollectionElement GetBindingCollectionElement()
|
||||
{
|
||||
return (BasicHttpContextBindingCollectionElement) ConfigurationHelpers.GetBindingCollectionElement(basicHttpContextBindingName);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
//------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------
|
||||
|
||||
namespace System.ServiceModel.Configuration
|
||||
{
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.ServiceModel.Channels;
|
||||
|
||||
[TypeForwardedFrom("System.WorkflowServices, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")]
|
||||
public partial class BasicHttpContextBindingElement : BasicHttpBindingElement
|
||||
{
|
||||
const string ContextManagementEnabledName = ContextBindingElementExtensionElement.ContextManagementEnabledName;
|
||||
|
||||
public BasicHttpContextBindingElement()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
public BasicHttpContextBindingElement(string name)
|
||||
: base(name)
|
||||
{
|
||||
}
|
||||
|
||||
protected override Type BindingElementType
|
||||
{
|
||||
get { return typeof(BasicHttpContextBinding); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty(ContextManagementEnabledName, DefaultValue = ContextBindingElement.DefaultContextManagementEnabled)]
|
||||
public bool ContextManagementEnabled
|
||||
{
|
||||
get { return (bool)base[ContextManagementEnabledName]; }
|
||||
set { base[ContextManagementEnabledName] = value; }
|
||||
}
|
||||
|
||||
protected internal override void InitializeFrom(Binding binding)
|
||||
{
|
||||
base.InitializeFrom(binding);
|
||||
BasicHttpContextBinding basicHttpContextBinding = (BasicHttpContextBinding)binding;
|
||||
SetPropertyValueIfNotDefaultValue(BasicHttpContextBindingElement.ContextManagementEnabledName, basicHttpContextBinding.ContextManagementEnabled);
|
||||
}
|
||||
|
||||
internal override void InitializeAllowCookies(HttpBindingBase binding)
|
||||
{
|
||||
// do not emit allowCookies=true in generated config because BasicHttpContextBinding will always set AllowCookies to true anyway
|
||||
}
|
||||
|
||||
protected override void OnApplyConfiguration(Binding binding)
|
||||
{
|
||||
base.OnApplyConfiguration(binding);
|
||||
if (this.ElementInformation.Properties["allowCookies"].ValueOrigin == PropertyValueOrigin.Default)
|
||||
{
|
||||
((BasicHttpBinding) binding).AllowCookies = true;
|
||||
}
|
||||
else if (!this.AllowCookies)
|
||||
{
|
||||
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument(SR.GetString(SR.BasicHttpContextBindingRequiresAllowCookie, this.Name, ""));
|
||||
}
|
||||
|
||||
((BasicHttpContextBinding)binding).ContextManagementEnabled = this.ContextManagementEnabled;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace System.ServiceModel.Configuration
|
||||
{
|
||||
using System.Configuration;
|
||||
using System.Globalization;
|
||||
using System.Net;
|
||||
using System.Net.Security;
|
||||
using System.ServiceModel;
|
||||
using System.ServiceModel.Security;
|
||||
using System.ComponentModel;
|
||||
|
||||
public sealed partial class BasicHttpMessageSecurityElement : ServiceModelConfigurationElement
|
||||
{
|
||||
[ConfigurationProperty(ConfigurationStrings.ClientCredentialType, DefaultValue = BasicHttpMessageSecurity.DefaultClientCredentialType)]
|
||||
[ServiceModelEnumValidator(typeof(BasicHttpMessageCredentialTypeHelper))]
|
||||
public BasicHttpMessageCredentialType ClientCredentialType
|
||||
{
|
||||
get { return (BasicHttpMessageCredentialType)base[ConfigurationStrings.ClientCredentialType]; }
|
||||
set { base[ConfigurationStrings.ClientCredentialType] = value; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty(ConfigurationStrings.AlgorithmSuite, DefaultValue = ConfigurationStrings.Default)]
|
||||
[TypeConverter(typeof(SecurityAlgorithmSuiteConverter))]
|
||||
public SecurityAlgorithmSuite AlgorithmSuite
|
||||
{
|
||||
get { return (SecurityAlgorithmSuite)base[ConfigurationStrings.AlgorithmSuite]; }
|
||||
set { base[ConfigurationStrings.AlgorithmSuite] = value; }
|
||||
}
|
||||
|
||||
internal void ApplyConfiguration(BasicHttpMessageSecurity security)
|
||||
{
|
||||
if (security == null)
|
||||
{
|
||||
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("security");
|
||||
}
|
||||
security.ClientCredentialType = this.ClientCredentialType;
|
||||
if (PropertyValueOrigin.Default != this.ElementInformation.Properties[ConfigurationStrings.AlgorithmSuite].ValueOrigin)
|
||||
{
|
||||
security.AlgorithmSuite = this.AlgorithmSuite;
|
||||
}
|
||||
}
|
||||
|
||||
internal void InitializeFrom(BasicHttpMessageSecurity security)
|
||||
{
|
||||
if (security == null)
|
||||
{
|
||||
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("security");
|
||||
}
|
||||
SetPropertyValueIfNotDefaultValue(ConfigurationStrings.ClientCredentialType, security.ClientCredentialType);
|
||||
SetPropertyValueIfNotDefaultValue(ConfigurationStrings.AlgorithmSuite, security.AlgorithmSuite);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace System.ServiceModel.Configuration
|
||||
{
|
||||
using System.ServiceModel;
|
||||
|
||||
public partial class BasicHttpsBindingCollectionElement : StandardBindingCollectionElement<BasicHttpsBinding, BasicHttpsBindingElement>
|
||||
{
|
||||
internal static BasicHttpsBindingCollectionElement GetBindingCollectionElement()
|
||||
{
|
||||
return (BasicHttpsBindingCollectionElement)ConfigurationHelpers.GetBindingCollectionElement(ConfigurationStrings.BasicHttpsBindingCollectionElementName);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace System.ServiceModel.Configuration
|
||||
{
|
||||
using System.ComponentModel;
|
||||
using System.Configuration;
|
||||
using System.ServiceModel;
|
||||
using System.ServiceModel.Channels;
|
||||
using System.Text;
|
||||
|
||||
public partial class BasicHttpsBindingElement : HttpBindingBaseElement
|
||||
{
|
||||
public BasicHttpsBindingElement(string name)
|
||||
: base(name)
|
||||
{
|
||||
}
|
||||
|
||||
public BasicHttpsBindingElement()
|
||||
: this(null)
|
||||
{
|
||||
}
|
||||
|
||||
[ConfigurationProperty(ConfigurationStrings.MessageEncoding, DefaultValue = BasicHttpBindingDefaults.MessageEncoding)]
|
||||
[ServiceModelEnumValidator(typeof(WSMessageEncodingHelper))]
|
||||
public WSMessageEncoding MessageEncoding
|
||||
{
|
||||
get { return (WSMessageEncoding)base[ConfigurationStrings.MessageEncoding]; }
|
||||
set { base[ConfigurationStrings.MessageEncoding] = value; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty(ConfigurationStrings.Security)]
|
||||
public BasicHttpsSecurityElement Security
|
||||
{
|
||||
get { return (BasicHttpsSecurityElement)base[ConfigurationStrings.Security]; }
|
||||
}
|
||||
|
||||
protected override Type BindingElementType
|
||||
{
|
||||
get { return typeof(BasicHttpsBinding); }
|
||||
}
|
||||
|
||||
protected internal override void InitializeFrom(Binding binding)
|
||||
{
|
||||
base.InitializeFrom(binding);
|
||||
BasicHttpsBinding bpBinding = (BasicHttpsBinding)binding;
|
||||
|
||||
SetPropertyValueIfNotDefaultValue(ConfigurationStrings.MessageEncoding, bpBinding.MessageEncoding);
|
||||
this.Security.InitializeFrom(bpBinding.Security);
|
||||
}
|
||||
|
||||
protected override void OnApplyConfiguration(Binding binding)
|
||||
{
|
||||
base.OnApplyConfiguration(binding);
|
||||
BasicHttpsBinding bpBinding = (BasicHttpsBinding)binding;
|
||||
|
||||
bpBinding.MessageEncoding = this.MessageEncoding;
|
||||
|
||||
this.Security.ApplyConfiguration(bpBinding.Security);
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user