Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.ServiceModel.Discovery / System / ServiceModel / Discovery / Configuration / DiscoveryClientElement.cs / 1305376 / DiscoveryClientElement.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.Channels; using System.ServiceModel.Configuration; using SR2 = System.ServiceModel.Discovery.SR; [Fx.Tag.XamlVisible(false)] public sealed class DiscoveryClientElement : BindingElementExtensionElement { ConfigurationPropertyCollection properties; [ConfigurationProperty(ConfigurationStrings.Endpoint)] [SuppressMessage( FxCop.Category.Configuration, FxCop.Rule.ConfigurationPropertyNameRule, Justification = "The configuration name for this element is 'endpoint'.")] public ChannelEndpointElement DiscoveryEndpoint { get { return (ChannelEndpointElement)base[ConfigurationStrings.Endpoint]; } } [ConfigurationProperty(ConfigurationStrings.FindCriteria)] public FindCriteriaElement FindCriteria { get { return (FindCriteriaElement)base[ConfigurationStrings.FindCriteria]; } } [SuppressMessage( FxCop.Category.Configuration, FxCop.Rule.ConfigurationPropertyAttributeRule, Justification = "This property only overrides the base property.")] public override Type BindingElementType { get { return typeof(DiscoveryClientBindingElement); } } protected override ConfigurationPropertyCollection Properties { get { if (this.properties == null) { ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); properties.Add( new ConfigurationProperty( ConfigurationStrings.Endpoint, typeof(ChannelEndpointElement), null, null, null, ConfigurationPropertyOptions.None)); properties.Add( new ConfigurationProperty( ConfigurationStrings.FindCriteria, typeof(FindCriteriaElement), null, null, null, ConfigurationPropertyOptions.None)); this.properties = properties; } return this.properties; } } public override void ApplyConfiguration(BindingElement bindingElement) { base.ApplyConfiguration(bindingElement); DiscoveryClientBindingElement discoveryClientBindingElement = (DiscoveryClientBindingElement)bindingElement; if (PropertyValueOrigin.Default == this.ElementInformation.Properties[ConfigurationStrings.Endpoint].ValueOrigin) { discoveryClientBindingElement.DiscoveryEndpointProvider = new ConfigurationDiscoveryEndpointProvider(); } else { discoveryClientBindingElement.DiscoveryEndpointProvider = new ConfigurationDiscoveryEndpointProvider(this.DiscoveryEndpoint); } this.FindCriteria.ApplyConfiguration(discoveryClientBindingElement.FindCriteria); } public override void CopyFrom(ServiceModelExtensionElement from) { base.CopyFrom(from); DiscoveryClientElement source = (DiscoveryClientElement)from; if (PropertyValueOrigin.Default == this.ElementInformation.Properties[ConfigurationStrings.Endpoint].ValueOrigin) { ChannelEndpointElement udpChannelEndpointElement = ConfigurationUtility.GetDefaultDiscoveryEndpointElement(); udpChannelEndpointElement.Copy(source.DiscoveryEndpoint); } else { this.DiscoveryEndpoint.Copy(source.DiscoveryEndpoint); } this.FindCriteria.CopyFrom(source.FindCriteria); } protected internal override BindingElement CreateBindingElement() { DiscoveryClientBindingElement discoveryClientBindingElement = new DiscoveryClientBindingElement(); this.ApplyConfiguration(discoveryClientBindingElement); return discoveryClientBindingElement; } protected internal override void InitializeFrom(BindingElement bindingElement) { throw FxTrace.Exception.AsError( new NotSupportedException(SR2.DiscoveryConfigInitializeFromNotSupported)); } } } // 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
- EditorZoneBase.cs
- HtmlUtf8RawTextWriter.cs
- CollectionBuilder.cs
- HostingEnvironmentException.cs
- WebPartAuthorizationEventArgs.cs
- SqlNotificationRequest.cs
- x509utils.cs
- InputScope.cs
- TouchesCapturedWithinProperty.cs
- DataColumnChangeEvent.cs
- WindowsMenu.cs
- DataTableMapping.cs
- SafeReversePInvokeHandle.cs
- DataMemberAttribute.cs
- NetDataContractSerializer.cs
- ObjectCacheSettings.cs
- ExpressionLexer.cs
- SchemaInfo.cs
- X509ChainElement.cs
- GroupDescription.cs
- XmlConverter.cs
- UriParserTemplates.cs
- MergablePropertyAttribute.cs
- XXXInfos.cs
- UrlMapping.cs
- DataRelation.cs
- BitArray.cs
- EnterpriseServicesHelper.cs
- IdentityHolder.cs
- TimeoutValidationAttribute.cs
- ObjectView.cs
- SqlBinder.cs
- PipelineDeploymentState.cs
- ConsoleCancelEventArgs.cs
- HttpHandlersSection.cs
- GeometryGroup.cs
- BitmapPalette.cs
- LambdaCompiler.Generated.cs
- SqlRetyper.cs
- AnyReturnReader.cs
- ColorAnimationUsingKeyFrames.cs
- ObjectParameter.cs
- Automation.cs
- ParserHooks.cs
- MimeFormatter.cs
- SamlAssertionKeyIdentifierClause.cs
- EncoderReplacementFallback.cs
- WorkflowMarkupSerializationManager.cs
- TemplateContent.cs
- Point3DIndependentAnimationStorage.cs
- RadioButtonAutomationPeer.cs
- TextLineResult.cs
- XmlBufferReader.cs
- SecurityState.cs
- Menu.cs
- XmlReaderDelegator.cs
- MouseButtonEventArgs.cs
- OciLobLocator.cs
- MemoryPressure.cs
- NumberFunctions.cs
- DataSourceExpressionCollection.cs
- StartUpEventArgs.cs
- ProgressBarAutomationPeer.cs
- HostProtectionPermission.cs
- WebReferencesBuildProvider.cs
- InputProcessorProfilesLoader.cs
- AutomationElementCollection.cs
- TableRowGroup.cs
- InvalidOperationException.cs
- CreatingCookieEventArgs.cs
- GridItemPatternIdentifiers.cs
- TableLayoutColumnStyleCollection.cs
- SettingsPropertyNotFoundException.cs
- TextBounds.cs
- DataSourceControl.cs
- SmtpNegotiateAuthenticationModule.cs
- BindStream.cs
- SimpleApplicationHost.cs
- ADConnectionHelper.cs
- DesignerTextViewAdapter.cs
- WindowsListViewItemCheckBox.cs
- DetailsViewUpdatedEventArgs.cs
- FrameworkContentElementAutomationPeer.cs
- InstanceLockLostException.cs
- LocatorPartList.cs
- XmlSchemaAny.cs
- DoubleAnimationClockResource.cs
- SecurityKeyIdentifierClause.cs
- sqlstateclientmanager.cs
- Normalization.cs
- DecryptRequest.cs
- CategoryAttribute.cs
- ExpressionBuilder.cs
- DataServiceContext.cs
- _UriSyntax.cs
- HtmlInputControl.cs
- UriScheme.cs
- OpenTypeLayoutCache.cs
- XmlSchemaSequence.cs
- DelegatingTypeDescriptionProvider.cs