Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.ServiceModel.Discovery / System / ServiceModel / Discovery / DynamicEndpoint.cs / 1305376 / DynamicEndpoint.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.ServiceModel.Discovery { using System.ServiceModel; using System.ServiceModel.Channels; using System.ServiceModel.Description; using System.ServiceModel.Dispatcher; using System.Runtime; using System.Xml; [Fx.Tag.XamlVisible(false)] public class DynamicEndpoint : ServiceEndpoint { DiscoveryClientBindingElement discoveryClientBindingElement; internal DynamicEndpoint(ContractDescription contract) : base(contract, null, DiscoveryClientBindingElement.DiscoveryEndpointAddress) { this.discoveryClientBindingElement = new DiscoveryClientBindingElement(); } public DynamicEndpoint(ContractDescription contract, Binding binding) : base(contract, binding, DiscoveryClientBindingElement.DiscoveryEndpointAddress) { if (binding == null) { throw FxTrace.Exception.ArgumentNull("binding"); } this.discoveryClientBindingElement = new DiscoveryClientBindingElement(); if (this.ValidateAndInsertDiscoveryClientBindingElement(binding)) { this.FindCriteria.ContractTypeNames.Add( new XmlQualifiedName(contract.Name, contract.Namespace)); } else { throw FxTrace.Exception.Argument( "binding", SR.DiscoveryClientBindingElementPresentInDynamicEndpoint); } } public DiscoveryEndpointProvider DiscoveryEndpointProvider { get { return this.discoveryClientBindingElement.DiscoveryEndpointProvider; } set { if (value == null) { throw FxTrace.Exception.ArgumentNull("value"); } this.discoveryClientBindingElement.DiscoveryEndpointProvider = value; } } public FindCriteria FindCriteria { get { return this.discoveryClientBindingElement.FindCriteria; } set { if (value == null) { throw FxTrace.Exception.ArgumentNull("value"); } this.discoveryClientBindingElement.FindCriteria = value; } } internal bool ValidateAndInsertDiscoveryClientBindingElement(Binding binding) { CustomBinding customBinding = new CustomBinding(binding); if (customBinding.Elements.Find() == null) { customBinding.Elements.Insert(0, this.discoveryClientBindingElement); this.Binding = customBinding; return true; } else { return false; } } } } // 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
- InstanceDataCollectionCollection.cs
- BaseInfoTable.cs
- safePerfProviderHandle.cs
- DataGridDetailsPresenterAutomationPeer.cs
- SmiGettersStream.cs
- MeasureItemEvent.cs
- DataStorage.cs
- RichTextBoxContextMenu.cs
- PolicyUnit.cs
- TextParagraphCache.cs
- CompilerResults.cs
- basecomparevalidator.cs
- CompoundFileIOPermission.cs
- DataControlImageButton.cs
- CodeSpit.cs
- CurrentChangedEventManager.cs
- ClientBuildManager.cs
- HashHelpers.cs
- IsolatedStorage.cs
- FlowDocumentPage.cs
- LifetimeManager.cs
- DesignerActionMethodItem.cs
- DataGridItem.cs
- GroupBoxAutomationPeer.cs
- BuilderInfo.cs
- FacetEnabledSchemaElement.cs
- DbProviderFactoriesConfigurationHandler.cs
- HashAlgorithm.cs
- GridPatternIdentifiers.cs
- HtmlAnchor.cs
- DES.cs
- SkewTransform.cs
- ProxyFragment.cs
- Empty.cs
- WebServiceMethodData.cs
- WindowsGraphicsWrapper.cs
- PrivateFontCollection.cs
- ParameterCollection.cs
- SortQuery.cs
- ObjectDataSourceStatusEventArgs.cs
- BlobPersonalizationState.cs
- ADMembershipUser.cs
- Package.cs
- PageParserFilter.cs
- ExpressionEditorAttribute.cs
- DataGridViewColumnEventArgs.cs
- FontCollection.cs
- AssemblySettingAttributes.cs
- ToolZone.cs
- Rfc2898DeriveBytes.cs
- Filter.cs
- IOThreadTimer.cs
- InstanceOwnerQueryResult.cs
- QueryComponents.cs
- FixedDocumentSequencePaginator.cs
- ListViewAutomationPeer.cs
- PeerInvitationResponse.cs
- VersionedStream.cs
- While.cs
- EnumType.cs
- ContentTextAutomationPeer.cs
- AddDataControlFieldDialog.cs
- ConnectionManagementSection.cs
- ImageSourceConverter.cs
- InkCanvasSelectionAdorner.cs
- FileSystemWatcher.cs
- WebPartManagerDesigner.cs
- LicenseException.cs
- ByteStream.cs
- HostingEnvironment.cs
- EdmError.cs
- HttpPostedFile.cs
- SymbolPair.cs
- ToolTipAutomationPeer.cs
- ListViewItem.cs
- TimeoutException.cs
- ControlCachePolicy.cs
- SrgsGrammarCompiler.cs
- FormsAuthenticationCredentials.cs
- ContactManager.cs
- ReferenceAssemblyAttribute.cs
- XmlIterators.cs
- SecurityContext.cs
- ListViewDeleteEventArgs.cs
- FixedSOMImage.cs
- InputDevice.cs
- RepeaterCommandEventArgs.cs
- ToolBarOverflowPanel.cs
- DrawingServices.cs
- TemplatePartAttribute.cs
- PropertyGridEditorPart.cs
- SingleObjectCollection.cs
- ToolStripItemBehavior.cs
- ISFTagAndGuidCache.cs
- WebMessageBodyStyleHelper.cs
- VerificationAttribute.cs
- InputDevice.cs
- GlobalizationSection.cs
- BaseResourcesBuildProvider.cs
- OdbcEnvironment.cs