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
- SqlDependencyUtils.cs
- DBParameter.cs
- CompilerGlobalScopeAttribute.cs
- EntityDataSourceQueryBuilder.cs
- DockProviderWrapper.cs
- XMLUtil.cs
- InteropBitmapSource.cs
- WindowsEditBox.cs
- HiddenFieldPageStatePersister.cs
- _NativeSSPI.cs
- XPathNodePointer.cs
- CroppedBitmap.cs
- IntranetCredentialPolicy.cs
- DragStartedEventArgs.cs
- SiteMapNodeItem.cs
- CodeNamespace.cs
- DSASignatureFormatter.cs
- DBCommand.cs
- SQLRoleProvider.cs
- SqlDataSourceSelectingEventArgs.cs
- PerformanceCounter.cs
- HelpKeywordAttribute.cs
- RemotingSurrogateSelector.cs
- ObjectIDGenerator.cs
- TextRunTypographyProperties.cs
- SafeFileMappingHandle.cs
- DataFormat.cs
- ScriptingRoleServiceSection.cs
- KernelTypeValidation.cs
- HttpProxyCredentialType.cs
- WSDualHttpBindingElement.cs
- ActivityWithResult.cs
- Symbol.cs
- SessionEndingEventArgs.cs
- PrefixHandle.cs
- RewritingProcessor.cs
- RawStylusInputCustomData.cs
- DataSourceView.cs
- JapaneseLunisolarCalendar.cs
- BoundField.cs
- HtmlElementCollection.cs
- AnnotationMap.cs
- KeyValueSerializer.cs
- StringValidator.cs
- EditorAttribute.cs
- PropertyChangedEventArgs.cs
- ScopedMessagePartSpecification.cs
- DrawTreeNodeEventArgs.cs
- CommandConverter.cs
- GeneratedContractType.cs
- ISAPIWorkerRequest.cs
- TextBoxAutomationPeer.cs
- TableCell.cs
- StateDesigner.LayoutSelectionGlyph.cs
- SR.cs
- RegistrySecurity.cs
- UnsafeNativeMethods.cs
- DataGridViewRowCollection.cs
- DataBindingCollection.cs
- ViewUtilities.cs
- Int64.cs
- StringSource.cs
- SecurityTokenAuthenticator.cs
- SslStream.cs
- ExtentKey.cs
- ISO2022Encoding.cs
- RankException.cs
- GetWinFXPath.cs
- FormsAuthenticationTicket.cs
- DataGridViewCellStyle.cs
- CapiNative.cs
- XamlBrushSerializer.cs
- assertwrapper.cs
- ToolboxBitmapAttribute.cs
- __FastResourceComparer.cs
- UriScheme.cs
- DeflateStreamAsyncResult.cs
- EventManager.cs
- SqlProfileProvider.cs
- DesignerRegionMouseEventArgs.cs
- GridSplitter.cs
- ComponentRenameEvent.cs
- UpdateProgress.cs
- HttpApplicationFactory.cs
- Parser.cs
- GlyphingCache.cs
- SimpleMailWebEventProvider.cs
- IWorkflowDebuggerService.cs
- _RequestCacheProtocol.cs
- DependencyProperty.cs
- MembershipSection.cs
- TcpAppDomainProtocolHandler.cs
- COM2DataTypeToManagedDataTypeConverter.cs
- ServicePointManager.cs
- UdpReplyToBehavior.cs
- DataSourceCache.cs
- TextRunProperties.cs
- DateTimeOffsetAdapter.cs
- DbgCompiler.cs
- ResourceExpression.cs