Xamarin Public Jenkins (auto-signing) e79aa3c0ed Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
2016-08-03 10:59:49 +00:00

83 lines
2.6 KiB
C#

//-----------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
namespace System.ServiceModel.Configuration
{
using System;
using System.Configuration;
using System.ServiceModel.Channels;
public sealed partial class ProtocolMappingElement : ConfigurationElement
{
public ProtocolMappingElement()
{
}
public ProtocolMappingElement(string schemeType, string binding, string bindingConfiguration)
{
if (String.IsNullOrEmpty(schemeType))
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("schemeType");
}
this.Scheme = schemeType;
if (binding == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("binding");
}
this.Binding = binding;
this.BindingConfiguration = bindingConfiguration;
}
[ConfigurationProperty(ConfigurationStrings.Scheme, Options = ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey)]
[StringValidator(MinLength = 1)]
public string Scheme
{
get { return (string)base[ConfigurationStrings.Scheme]; }
set
{
if (String.IsNullOrEmpty(value))
{
value = String.Empty;
}
base[ConfigurationStrings.Scheme] = value;
}
}
[ConfigurationProperty(ConfigurationStrings.Binding, Options = ConfigurationPropertyOptions.IsRequired)]
[StringValidator(MinLength = 1)]
public string Binding
{
get { return (String)base[ConfigurationStrings.Binding]; }
set
{
if (String.IsNullOrEmpty(value))
{
value = String.Empty;
}
base[ConfigurationStrings.Binding] = value;
}
}
[ConfigurationProperty(ConfigurationStrings.BindingConfiguration, Options = ConfigurationPropertyOptions.None)]
[StringValidator(MinLength = 0)]
public string BindingConfiguration
{
get { return (String)base[ConfigurationStrings.BindingConfiguration]; }
set
{
if (String.IsNullOrEmpty(value))
{
value = String.Empty;
}
base[ConfigurationStrings.BindingConfiguration] = value;
}
}
}
}