Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.ServiceModel.Discovery / System / ServiceModel / Discovery / Configuration / EndpointDiscoveryElement.cs / 1305376 / EndpointDiscoveryElement.cs
//----------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//---------------------------------------------------------------
namespace System.ServiceModel.Discovery.Configuration
{
using System.Configuration;
using System.Diagnostics.CodeAnalysis;
using System.Runtime;
using System.ServiceModel.Configuration;
using System.Xml.Linq;
using System.Xml;
public sealed class EndpointDiscoveryElement : BehaviorExtensionElement
{
ConfigurationPropertyCollection properties;
public EndpointDiscoveryElement()
{
}
[SuppressMessage(FxCop.Category.Configuration, FxCop.Rule.ConfigurationPropertyAttributeRule,
Justification = "This property is defined by the base class to determine the type of the behavior.")]
public override Type BehaviorType
{
get
{
return typeof(EndpointDiscoveryBehavior);
}
}
[ConfigurationProperty(ConfigurationStrings.Enabled, DefaultValue = true)]
public bool Enabled
{
get
{
return (bool)base[ConfigurationStrings.Enabled];
}
set
{
base[ConfigurationStrings.Enabled] = value;
}
}
[ConfigurationProperty(ConfigurationStrings.Types)]
[SuppressMessage(
FxCop.Category.Configuration,
FxCop.Rule.ConfigurationPropertyNameRule,
Justification = "The configuration name for this element is 'types'.")]
public ContractTypeNameElementCollection ContractTypeNames
{
get
{
return (ContractTypeNameElementCollection)base[ConfigurationStrings.Types];
}
}
[ConfigurationProperty(ConfigurationStrings.Scopes)]
public ScopeElementCollection Scopes
{
get
{
return (ScopeElementCollection)base[ConfigurationStrings.Scopes];
}
}
[ConfigurationProperty(ConfigurationStrings.Extensions)]
public XmlElementElementCollection Extensions
{
get
{
return (XmlElementElementCollection)base[ConfigurationStrings.Extensions];
}
}
protected override ConfigurationPropertyCollection Properties
{
get
{
if (this.properties == null)
{
ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection();
properties.Add(
new ConfigurationProperty(
ConfigurationStrings.Enabled,
typeof(Boolean),
true,
null,
null,
ConfigurationPropertyOptions.None));
properties.Add(
new ConfigurationProperty(
ConfigurationStrings.Types,
typeof(ContractTypeNameElementCollection),
null,
null,
null,
ConfigurationPropertyOptions.None));
properties.Add(
new ConfigurationProperty(
ConfigurationStrings.Scopes,
typeof(ScopeElementCollection),
null,
null,
null,
ConfigurationPropertyOptions.None));
properties.Add(
new ConfigurationProperty(
ConfigurationStrings.Extensions,
typeof(XmlElementElementCollection),
null,
null,
null,
ConfigurationPropertyOptions.None));
this.properties = properties;
}
return this.properties;
}
}
protected internal override object CreateBehavior()
{
EndpointDiscoveryBehavior behavior = new EndpointDiscoveryBehavior();
behavior.Enabled = Enabled;
if ((Scopes != null) && (Scopes.Count > 0))
{
foreach (ScopeElement scopeElement in Scopes)
{
behavior.Scopes.Add(scopeElement.Scope);
}
}
if (ContractTypeNames != null)
{
foreach (ContractTypeNameElement contractTypeNameElement in ContractTypeNames)
{
behavior.ContractTypeNames.Add(
new XmlQualifiedName(contractTypeNameElement.Name, contractTypeNameElement.Namespace));
}
}
if ((Extensions != null) && (Extensions.Count > 0))
{
foreach (XmlElementElement xmlElement in Extensions)
{
behavior.Extensions.Add(XElement.Parse(xmlElement.XmlElement.OuterXml));
}
}
return behavior;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Token.cs
- KeyEvent.cs
- TableDesigner.cs
- SerializerWriterEventHandlers.cs
- PublisherMembershipCondition.cs
- XsltSettings.cs
- NetworkStream.cs
- SqlTriggerAttribute.cs
- BrushProxy.cs
- SevenBitStream.cs
- PackagePartCollection.cs
- Attachment.cs
- IUnknownConstantAttribute.cs
- TextElementEnumerator.cs
- SQLUtility.cs
- DataBinding.cs
- GenericUriParser.cs
- Adorner.cs
- Lock.cs
- DeviceSpecificDesigner.cs
- FrameworkElementFactory.cs
- ElementNotEnabledException.cs
- PowerModeChangedEventArgs.cs
- Positioning.cs
- SqlFlattener.cs
- SamlAuthenticationClaimResource.cs
- Rect3DConverter.cs
- MenuItemStyle.cs
- UTF7Encoding.cs
- Baml2006ReaderFrame.cs
- RepeaterItemCollection.cs
- BinHexDecoder.cs
- JulianCalendar.cs
- SqlUDTStorage.cs
- AppDomain.cs
- HtmlCalendarAdapter.cs
- Query.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- SqlUserDefinedTypeAttribute.cs
- PtsContext.cs
- EventSinkHelperWriter.cs
- WindowsEditBoxRange.cs
- BooleanFunctions.cs
- MimePart.cs
- SupportingTokenAuthenticatorSpecification.cs
- StructuralComparisons.cs
- Latin1Encoding.cs
- PermissionRequestEvidence.cs
- WorkflowRuntimeServiceElementCollection.cs
- BooleanExpr.cs
- MetadataWorkspace.cs
- ViewLoader.cs
- BinaryObjectReader.cs
- DbgUtil.cs
- ToolStripGripRenderEventArgs.cs
- FontConverter.cs
- MetafileHeaderWmf.cs
- ResourceDescriptionAttribute.cs
- WebContext.cs
- ExceptionHandler.cs
- XPathScanner.cs
- SystemKeyConverter.cs
- ConnectionPoint.cs
- FastEncoderWindow.cs
- FunctionMappingTranslator.cs
- CookieProtection.cs
- OSFeature.cs
- BitmapEffectInput.cs
- GeneratedCodeAttribute.cs
- XmlNavigatorStack.cs
- TraceContext.cs
- OracleLob.cs
- SimpleFieldTemplateFactory.cs
- XPathItem.cs
- FocusChangedEventArgs.cs
- TransactionManager.cs
- AsymmetricKeyExchangeDeformatter.cs
- QilTernary.cs
- DecoderFallbackWithFailureFlag.cs
- FontNamesConverter.cs
- NodeInfo.cs
- SimpleHandlerBuildProvider.cs
- PageTheme.cs
- WebBrowserUriTypeConverter.cs
- ProfileProvider.cs
- BaseDataBoundControl.cs
- Content.cs
- RelationshipType.cs
- XmlILConstructAnalyzer.cs
- ToolStripArrowRenderEventArgs.cs
- ContentType.cs
- _TimerThread.cs
- TransactionFlowBindingElement.cs
- PageEventArgs.cs
- ComponentDesigner.cs
- DebugInfo.cs
- InternalTransaction.cs
- ClientRolePrincipal.cs
- XmlDataCollection.cs
- DataComponentGenerator.cs