Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.ServiceModel.Discovery / System / ServiceModel / Discovery / Configuration / ServiceDiscoveryElement.cs / 1305376 / ServiceDiscoveryElement.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.ServiceModel.Description; using SR2 = System.ServiceModel.Discovery.SR; public sealed class ServiceDiscoveryElement : BehaviorExtensionElement { ConfigurationPropertyCollection properties; public ServiceDiscoveryElement() { } [ConfigurationProperty(ConfigurationStrings.AnnouncementEndpoints)] public AnnouncementChannelEndpointElementCollection AnnouncementEndpoints { get { return (AnnouncementChannelEndpointElementCollection)base[ConfigurationStrings.AnnouncementEndpoints]; } } [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(ServiceDiscoveryBehavior); } } protected override ConfigurationPropertyCollection Properties { get { if (this.properties == null) { ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); properties.Add( new ConfigurationProperty( ConfigurationStrings.AnnouncementEndpoints, typeof(AnnouncementChannelEndpointElementCollection), null, null, null, ConfigurationPropertyOptions.None)); this.properties = properties; } return this.properties; } } protected internal override object CreateBehavior() { ServiceDiscoveryBehavior serviceDiscoveryBehavior = new ServiceDiscoveryBehavior(); AnnouncementEndpoint announcementEndpoint; foreach (ChannelEndpointElement channelEndpointElement in this.AnnouncementEndpoints) { if (string.IsNullOrEmpty(channelEndpointElement.Kind)) { throw FxTrace.Exception.AsError( new ConfigurationErrorsException( SR2.DiscoveryConfigAnnouncementEndpointMissingKind( typeof(AnnouncementEndpoint).FullName))); } ServiceEndpoint serviceEndpoint = ConfigLoader.LookupEndpoint(channelEndpointElement, null); if (serviceEndpoint == null) { throw FxTrace.Exception.AsError( new ConfigurationErrorsException( SR2.DiscoveryConfigInvalidEndpointConfiguration( channelEndpointElement.Kind))); } announcementEndpoint = serviceEndpoint as AnnouncementEndpoint; if (announcementEndpoint == null) { throw FxTrace.Exception.AsError( new InvalidOperationException( SR2.DiscoveryConfigInvalidAnnouncementEndpoint( channelEndpointElement.Kind, serviceEndpoint.GetType().FullName, typeof(AnnouncementEndpoint).FullName))); } serviceDiscoveryBehavior.AnnouncementEndpoints.Add(announcementEndpoint); } return serviceDiscoveryBehavior; } } } // 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
- Panel.cs
- OdbcConnectionString.cs
- DropDownList.cs
- Process.cs
- QuadraticEase.cs
- PaperSize.cs
- LeaseManager.cs
- GridViewCancelEditEventArgs.cs
- SafeHandles.cs
- QilList.cs
- FormsAuthentication.cs
- ToolBarButtonDesigner.cs
- HttpApplicationStateBase.cs
- PackageStore.cs
- HttpCachePolicyElement.cs
- CompensationParticipant.cs
- RepeatButtonAutomationPeer.cs
- AmbiguousMatchException.cs
- CodeSnippetStatement.cs
- ReferenceAssemblyAttribute.cs
- compensatingcollection.cs
- ToolboxDataAttribute.cs
- GenericWebPart.cs
- EntityDataSourceDesigner.cs
- TextTreeDeleteContentUndoUnit.cs
- ListItem.cs
- ByteArrayHelperWithString.cs
- XamlSerializerUtil.cs
- EventHandlerList.cs
- precedingsibling.cs
- DbFunctionCommandTree.cs
- DESCryptoServiceProvider.cs
- WinInetCache.cs
- PropertyValueUIItem.cs
- AsyncStreamReader.cs
- Grammar.cs
- FixedSOMTableRow.cs
- WebPartDisplayModeCancelEventArgs.cs
- ValidationPropertyAttribute.cs
- DeferredSelectedIndexReference.cs
- TCEAdapterGenerator.cs
- ResourcesBuildProvider.cs
- RSAPKCS1SignatureFormatter.cs
- DrawToolTipEventArgs.cs
- Guid.cs
- WebPartHelpVerb.cs
- PropertyInfo.cs
- SetStateEventArgs.cs
- MultiAsyncResult.cs
- XmlElement.cs
- HashCodeCombiner.cs
- CodeParameterDeclarationExpression.cs
- IntSecurity.cs
- ResourceAssociationTypeEnd.cs
- OletxTransactionFormatter.cs
- HttpListenerException.cs
- SqlUdtInfo.cs
- CrossAppDomainChannel.cs
- SafeLocalAllocation.cs
- PrtTicket_Public_Simple.cs
- InvalidPrinterException.cs
- ServiceDeploymentInfo.cs
- SatelliteContractVersionAttribute.cs
- Gdiplus.cs
- HtmlLink.cs
- ActivityWithResultValueSerializer.cs
- WinFormsUtils.cs
- VirtualPathUtility.cs
- XmlAttributeProperties.cs
- WrappedIUnknown.cs
- TransportSecurityHelpers.cs
- ZipIOExtraFieldZip64Element.cs
- PhysicalAddress.cs
- OleDbError.cs
- DoubleLink.cs
- PolyLineSegment.cs
- _KerberosClient.cs
- InfocardInteractiveChannelInitializer.cs
- ConfigurationElement.cs
- HtmlInputSubmit.cs
- UrlAuthFailedErrorFormatter.cs
- ConfigurationSection.cs
- XPathAncestorIterator.cs
- SessionStateSection.cs
- StylusTip.cs
- HiddenField.cs
- MinimizableAttributeTypeConverter.cs
- WebAdminConfigurationHelper.cs
- ElementsClipboardData.cs
- DbDeleteCommandTree.cs
- xmlglyphRunInfo.cs
- SRGSCompiler.cs
- StateMachineSubscription.cs
- LoginUtil.cs
- ExecutionEngineException.cs
- MarkupWriter.cs
- SecurityRuntime.cs
- Condition.cs
- SqlNamer.cs
- MdiWindowListStrip.cs