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
- TextSelectionHelper.cs
- PopupRootAutomationPeer.cs
- MessageQueueKey.cs
- FormViewUpdatedEventArgs.cs
- FontUnitConverter.cs
- XmlSerializationGeneratedCode.cs
- ObjectIDGenerator.cs
- CustomWebEventKey.cs
- ImageBrush.cs
- DefaultValueTypeConverter.cs
- DtcInterfaces.cs
- DuplicateWaitObjectException.cs
- PerformanceCounterPermissionEntry.cs
- Span.cs
- SizeKeyFrameCollection.cs
- QueryAccessibilityHelpEvent.cs
- ParameterElementCollection.cs
- ConversionContext.cs
- ServiceHttpModule.cs
- Int32CAMarshaler.cs
- UniqueIdentifierService.cs
- PersonalizableAttribute.cs
- BamlStream.cs
- HttpCapabilitiesBase.cs
- TextHintingModeValidation.cs
- GPRECT.cs
- TableDetailsCollection.cs
- TrustManagerPromptUI.cs
- ByeOperationAsyncResult.cs
- FixedSOMSemanticBox.cs
- VerticalAlignConverter.cs
- Rijndael.cs
- Point3DKeyFrameCollection.cs
- TabletDevice.cs
- TableLayoutPanelDesigner.cs
- Constants.cs
- ProtocolsConfiguration.cs
- ObjectSet.cs
- BaseParser.cs
- TextEvent.cs
- TableStyle.cs
- InvalidWMPVersionException.cs
- Merger.cs
- PropertyMetadata.cs
- HtmlControl.cs
- Encoder.cs
- PrintDocument.cs
- JournalEntryStack.cs
- LineUtil.cs
- SessionStateItemCollection.cs
- BitmapEncoder.cs
- RecordsAffectedEventArgs.cs
- MsmqInputChannel.cs
- SectionXmlInfo.cs
- TemplateField.cs
- PropertyTabChangedEvent.cs
- TemplatedAdorner.cs
- XNameConverter.cs
- XmlResolver.cs
- Util.cs
- PrinterUnitConvert.cs
- MethodCallConverter.cs
- DragSelectionMessageFilter.cs
- WindowsSpinner.cs
- ScopeCompiler.cs
- Point3DCollection.cs
- ExpressionNormalizer.cs
- QuestionEventArgs.cs
- ServiceHostFactory.cs
- _SslStream.cs
- SoapTypeAttribute.cs
- IdentityReference.cs
- PointIndependentAnimationStorage.cs
- PersonalizationProviderCollection.cs
- SQLInt32.cs
- DataControlButton.cs
- NavigationWindow.cs
- MatrixUtil.cs
- MimeMultiPart.cs
- CallTemplateAction.cs
- WebPartRestoreVerb.cs
- SizeConverter.cs
- ArcSegment.cs
- securitycriticaldataformultiplegetandset.cs
- DataKey.cs
- XmlWhitespace.cs
- NullableBoolConverter.cs
- NameValueConfigurationCollection.cs
- StrokeFIndices.cs
- WindowsPrincipal.cs
- FrameworkContentElement.cs
- BufferAllocator.cs
- MenuItem.cs
- SHA1Managed.cs
- SqlBooleanMismatchVisitor.cs
- UInt64Converter.cs
- DataGridViewCellValidatingEventArgs.cs
- TreePrinter.cs
- PasswordPropertyTextAttribute.cs
- AliasGenerator.cs