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
- DefaultBinder.cs
- LocalizationComments.cs
- FrameworkContentElementAutomationPeer.cs
- ZipIOBlockManager.cs
- HMACSHA512.cs
- CuspData.cs
- CodeParameterDeclarationExpression.cs
- GeometryGroup.cs
- FontWeightConverter.cs
- CompletedAsyncResult.cs
- ResourceDefaultValueAttribute.cs
- KeyboardEventArgs.cs
- EventLogWatcher.cs
- QilReference.cs
- oledbconnectionstring.cs
- SafeCryptHandles.cs
- SqlRecordBuffer.cs
- SortQueryOperator.cs
- CacheMode.cs
- NamedPipeAppDomainProtocolHandler.cs
- XmlSchemaObjectTable.cs
- IpcChannelHelper.cs
- Transform.cs
- Triangle.cs
- DesignerEventService.cs
- TabControlEvent.cs
- QilLiteral.cs
- CodeDomConfigurationHandler.cs
- CreateParams.cs
- WindowsUpDown.cs
- AutomationElementIdentifiers.cs
- DiscoveryEndpoint.cs
- SystemTcpStatistics.cs
- HtmlToClrEventProxy.cs
- SortableBindingList.cs
- SendOperation.cs
- DispatcherExceptionFilterEventArgs.cs
- DiagnosticsConfigurationHandler.cs
- ImmutableAssemblyCacheEntry.cs
- SmiTypedGetterSetter.cs
- DataViewSetting.cs
- NameValuePair.cs
- FixedSOMFixedBlock.cs
- ChangeInterceptorAttribute.cs
- _ListenerAsyncResult.cs
- InheritablePropertyChangeInfo.cs
- XmlSchemaSimpleTypeUnion.cs
- ProcessModelSection.cs
- StyleXamlParser.cs
- UnsettableComboBox.cs
- SafeRightsManagementQueryHandle.cs
- WebBrowser.cs
- EffectiveValueEntry.cs
- Adorner.cs
- InstanceLockQueryResult.cs
- CompiledIdentityConstraint.cs
- LinqDataSourceHelper.cs
- ContentFilePart.cs
- __ConsoleStream.cs
- FastEncoder.cs
- JsonEncodingStreamWrapper.cs
- DeferredTextReference.cs
- GeneralTransform3DGroup.cs
- KeyMatchBuilder.cs
- ImagingCache.cs
- AuthenticationModuleElementCollection.cs
- Label.cs
- LowerCaseStringConverter.cs
- PropertyTabChangedEvent.cs
- ContextMenuService.cs
- XhtmlBasicListAdapter.cs
- XmlSchemaSet.cs
- VisualStyleRenderer.cs
- Queue.cs
- DesignerVerbCollection.cs
- DrawingImage.cs
- ChineseLunisolarCalendar.cs
- OdbcCommand.cs
- MatrixKeyFrameCollection.cs
- SqlDataReader.cs
- FormViewPageEventArgs.cs
- RightsManagementInformation.cs
- DataGridViewControlCollection.cs
- DecimalStorage.cs
- ObjectMaterializedEventArgs.cs
- SqlWriter.cs
- DocumentOutline.cs
- Misc.cs
- dsa.cs
- WindowsSpinner.cs
- StringDictionaryWithComparer.cs
- SkinIDTypeConverter.cs
- ExtendedPropertyDescriptor.cs
- ToolStripDropTargetManager.cs
- XmlSchemaAll.cs
- Transform3D.cs
- Border.cs
- OdbcConnectionPoolProviderInfo.cs
- NameTable.cs
- XmlName.cs