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
- EnumValidator.cs
- MsmqProcessProtocolHandler.cs
- DefaultProxySection.cs
- DataFormats.cs
- HorizontalAlignConverter.cs
- XmlIlVisitor.cs
- Token.cs
- RawStylusInput.cs
- BulletedList.cs
- HttpModulesInstallComponent.cs
- XPathDocumentIterator.cs
- UnSafeCharBuffer.cs
- DependencyObjectProvider.cs
- Debug.cs
- StateBag.cs
- SQLRoleProvider.cs
- Stack.cs
- WebRequest.cs
- DbSourceCommand.cs
- Soap12ProtocolImporter.cs
- StrongName.cs
- ADRole.cs
- RelationshipFixer.cs
- PictureBox.cs
- EmptyCollection.cs
- DataGridViewHitTestInfo.cs
- FlowchartDesigner.Helpers.cs
- ColumnHeader.cs
- FormParameter.cs
- ObjectTag.cs
- StrokeCollectionConverter.cs
- XmlElementAttributes.cs
- TreeWalkHelper.cs
- ProtocolInformationReader.cs
- DrawListViewSubItemEventArgs.cs
- TypeDelegator.cs
- CacheDependency.cs
- FileDataSourceCache.cs
- ContentDisposition.cs
- XPathNodeHelper.cs
- XamlParser.cs
- MD5.cs
- listitem.cs
- NativeMethods.cs
- WindowsToolbarAsMenu.cs
- HashCodeCombiner.cs
- SimpleApplicationHost.cs
- SmtpFailedRecipientException.cs
- ImageSource.cs
- Pool.cs
- HiddenFieldPageStatePersister.cs
- OrderablePartitioner.cs
- ToolboxItemLoader.cs
- BrowserCapabilitiesCompiler.cs
- ContentElementAutomationPeer.cs
- SessionStateSection.cs
- DesignerDataRelationship.cs
- PluralizationServiceUtil.cs
- ServiceDesigner.cs
- EntityDesignerUtils.cs
- GraphicsPathIterator.cs
- ImageListImageEditor.cs
- ComponentEditorForm.cs
- PhonemeEventArgs.cs
- Attributes.cs
- PermissionToken.cs
- RectAnimationBase.cs
- ProfessionalColorTable.cs
- XmlILOptimizerVisitor.cs
- RuntimeEnvironment.cs
- TextElement.cs
- ButtonChrome.cs
- CompiledQueryCacheKey.cs
- FontSource.cs
- Binding.cs
- PerformanceCounterManager.cs
- RowBinding.cs
- Process.cs
- FrameworkContextData.cs
- MenuItem.cs
- remotingproxy.cs
- GrammarBuilderWildcard.cs
- ListBindingConverter.cs
- MinimizableAttributeTypeConverter.cs
- RightsManagementEncryptedStream.cs
- Regex.cs
- EntityDataSourceChangingEventArgs.cs
- __Filters.cs
- LeafCellTreeNode.cs
- ChooseAction.cs
- JoinElimination.cs
- CleanUpVirtualizedItemEventArgs.cs
- Gdiplus.cs
- BindableTemplateBuilder.cs
- XmlDataCollection.cs
- oledbconnectionstring.cs
- NotifyIcon.cs
- CommandEventArgs.cs
- ExecutorLocksHeldException.cs
- EntityTemplateUserControl.cs