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
- DataExpression.cs
- xmlfixedPageInfo.cs
- SqlServices.cs
- StandardCommands.cs
- ScaleTransform3D.cs
- QilDataSource.cs
- TextDecorations.cs
- TracingConnectionListener.cs
- HttpRawResponse.cs
- ColorContext.cs
- ConfigXmlAttribute.cs
- ScriptReferenceEventArgs.cs
- ScalarOps.cs
- BuildResult.cs
- DataControlHelper.cs
- DbConnectionPoolGroupProviderInfo.cs
- Attribute.cs
- SamlAssertion.cs
- VisualStyleRenderer.cs
- PointHitTestParameters.cs
- PageContentAsyncResult.cs
- CapabilitiesPattern.cs
- WebPartAuthorizationEventArgs.cs
- SearchForVirtualItemEventArgs.cs
- XmlSerializerSection.cs
- GridItemProviderWrapper.cs
- CodeAttributeArgument.cs
- RowsCopiedEventArgs.cs
- TextEditor.cs
- BaseTemplateParser.cs
- XslUrlEditor.cs
- RegexWriter.cs
- CqlParser.cs
- HttpFileCollection.cs
- ContractReference.cs
- Point3DKeyFrameCollection.cs
- x509store.cs
- ModelPropertyDescriptor.cs
- InternalException.cs
- _Events.cs
- ThemeDictionaryExtension.cs
- ObjRef.cs
- Viewport3DAutomationPeer.cs
- SafeNativeMethods.cs
- StreamUpdate.cs
- BaseValidator.cs
- SafeCryptContextHandle.cs
- CodeAttributeArgument.cs
- LayoutExceptionEventArgs.cs
- FlowPosition.cs
- MimeWriter.cs
- ProcessInfo.cs
- CharConverter.cs
- PathBox.cs
- TextElementEnumerator.cs
- ElementFactory.cs
- JsonCollectionDataContract.cs
- ServiceContractGenerationContext.cs
- CustomAttribute.cs
- DataListItem.cs
- ControlCodeDomSerializer.cs
- DBAsyncResult.cs
- TypeSystemProvider.cs
- ObjectQuery.cs
- ArraySortHelper.cs
- XmlHierarchicalDataSourceView.cs
- OdbcError.cs
- GridViewRowEventArgs.cs
- EmptyReadOnlyDictionaryInternal.cs
- CoreSwitches.cs
- SiteMap.cs
- Debug.cs
- GetIndexBinder.cs
- TypefaceMap.cs
- VarRefManager.cs
- ComponentChangedEvent.cs
- ClientOptions.cs
- ParserStreamGeometryContext.cs
- XmlWrappingWriter.cs
- IgnoreFlushAndCloseStream.cs
- QueryStatement.cs
- ByteFacetDescriptionElement.cs
- ToolboxItemCollection.cs
- WebPartMenuStyle.cs
- MessageHeaderAttribute.cs
- ResXResourceSet.cs
- EmptyEnumerator.cs
- SemaphoreFullException.cs
- SoapAttributeAttribute.cs
- AddingNewEventArgs.cs
- PopupRoot.cs
- __ComObject.cs
- ScrollItemPattern.cs
- ModelFactory.cs
- MetricEntry.cs
- SHA256.cs
- VariableValue.cs
- NativeMethods.cs
- CompositeFontInfo.cs
- XmlNamespaceMappingCollection.cs