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
- XmlSchemaAnnotation.cs
- MSAAWinEventWrap.cs
- ButtonStandardAdapter.cs
- HostedAspNetEnvironment.cs
- InfoCardServiceInstallComponent.cs
- CompModSwitches.cs
- TextElementCollection.cs
- SHA512Managed.cs
- Lasso.cs
- ReplyChannelAcceptor.cs
- XpsViewerException.cs
- BamlTreeUpdater.cs
- AddIn.cs
- TransformCollection.cs
- ADMembershipProvider.cs
- TableLayoutColumnStyleCollection.cs
- ClientBuildManager.cs
- RtfControls.cs
- XmlException.cs
- BooleanToVisibilityConverter.cs
- RunClient.cs
- ValidationError.cs
- ErrorRuntimeConfig.cs
- AlignmentYValidation.cs
- DayRenderEvent.cs
- SqlUnionizer.cs
- DecimalFormatter.cs
- SiteMap.cs
- TextParagraphView.cs
- MailDefinitionBodyFileNameEditor.cs
- DesignerOptionService.cs
- AuthenticationException.cs
- PreviewControlDesigner.cs
- Converter.cs
- WebHeaderCollection.cs
- FreezableCollection.cs
- ObjectParameter.cs
- Stack.cs
- Variable.cs
- PropertyInformationCollection.cs
- Wizard.cs
- LocalizedNameDescriptionPair.cs
- DbProviderServices.cs
- ServiceOperation.cs
- TypeFieldSchema.cs
- XNodeNavigator.cs
- PointConverter.cs
- ToolStripContentPanelRenderEventArgs.cs
- PropertyDescriptorGridEntry.cs
- InheritedPropertyChangedEventArgs.cs
- XmlCharType.cs
- GlobalAllocSafeHandle.cs
- HwndTarget.cs
- XmlSchemaSimpleContentRestriction.cs
- SspiNegotiationTokenAuthenticatorState.cs
- TemplateNameScope.cs
- XhtmlTextWriter.cs
- LoginView.cs
- XomlDesignerLoader.cs
- SystemKeyConverter.cs
- FileUtil.cs
- AsyncPostBackErrorEventArgs.cs
- PeerNodeAddress.cs
- InternalPermissions.cs
- SID.cs
- OdbcUtils.cs
- NameValueConfigurationElement.cs
- XmlElement.cs
- TemplatedMailWebEventProvider.cs
- DataViewListener.cs
- Utils.cs
- ResourceManager.cs
- StrokeRenderer.cs
- DecryptedHeader.cs
- TabControlAutomationPeer.cs
- ObjectDataSourceSelectingEventArgs.cs
- PictureBoxDesigner.cs
- EnumConverter.cs
- PseudoWebRequest.cs
- RealizationContext.cs
- GAC.cs
- WebExceptionStatus.cs
- SecurityCookieModeValidator.cs
- ItemChangedEventArgs.cs
- UserControl.cs
- NetPipeSectionData.cs
- ProfileParameter.cs
- DebugView.cs
- WebBrowser.cs
- Object.cs
- SafeReadContext.cs
- EventManager.cs
- NotImplementedException.cs
- CommentEmitter.cs
- ISessionStateStore.cs
- Parser.cs
- XmlCharCheckingReader.cs
- CodeIndexerExpression.cs
- BaseHashHelper.cs
- DisplayNameAttribute.cs