Files
dotnet-bot adf899c629 Adding System.Data..., System.ServiceModel..., and System.Web...
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
2016-05-03 00:07:37 +02:00

93 lines
3.3 KiB
C#

//------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
namespace System.ServiceModel.Configuration
{
using System.Configuration;
using System.Runtime;
using System.Security;
public sealed partial class ServiceElement : ConfigurationElement, IConfigurationContextProviderInternal
{
[Fx.Tag.SecurityNote(Critical = "Stores information used in a security decision.")]
[SecurityCritical]
EvaluationContextHelper contextHelper;
public ServiceElement() : base() { }
public ServiceElement(string serviceName)
: this()
{
this.Name = serviceName;
}
[ConfigurationProperty(ConfigurationStrings.BehaviorConfiguration, DefaultValue = "")]
[StringValidator(MinLength = 0)]
public string BehaviorConfiguration
{
get { return (string)base[ConfigurationStrings.BehaviorConfiguration]; }
set
{
if (String.IsNullOrEmpty(value))
{
value = String.Empty;
}
base[ConfigurationStrings.BehaviorConfiguration] = value;
}
}
[ConfigurationProperty(ConfigurationStrings.DefaultCollectionName, Options = ConfigurationPropertyOptions.IsDefaultCollection)]
public ServiceEndpointElementCollection Endpoints
{
get { return (ServiceEndpointElementCollection)base[ConfigurationStrings.DefaultCollectionName]; }
}
[ConfigurationProperty(ConfigurationStrings.Host, Options = ConfigurationPropertyOptions.None)]
public HostElement Host
{
get { return (HostElement)base[ConfigurationStrings.Host]; }
}
[ConfigurationProperty(ConfigurationStrings.Name, Options = ConfigurationPropertyOptions.IsKey | ConfigurationPropertyOptions.IsRequired)]
[StringValidator(MinLength = 1)]
public string Name
{
get { return (string)base[ConfigurationStrings.Name]; }
set
{
if (String.IsNullOrEmpty(value))
{
value = String.Empty;
}
base[ConfigurationStrings.Name] = value;
}
}
[Fx.Tag.SecurityNote(Critical = "Accesses critical field contextHelper.")]
[SecurityCritical]
protected override void Reset(ConfigurationElement parentElement)
{
this.contextHelper.OnReset(parentElement);
base.Reset(parentElement);
}
ContextInformation IConfigurationContextProviderInternal.GetEvaluationContext()
{
return this.EvaluationContext;
}
[Fx.Tag.SecurityNote(Critical = "Accesses critical field contextHelper.",
Miscellaneous = "RequiresReview -- the return value will be used for a security decision -- see comment in interface definition")]
[SecurityCritical]
ContextInformation IConfigurationContextProviderInternal.GetOriginalEvaluationContext()
{
return this.contextHelper.GetOriginalContext(this);
}
}
}