Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.ServiceModel.Discovery / System / ServiceModel / Discovery / DiscoveryServiceExtension.cs / 1305376 / DiscoveryServiceExtension.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.ServiceModel.Discovery { using System; using System.Collections.ObjectModel; using System.Runtime; using SR2 = System.ServiceModel.Discovery.SR; [Fx.Tag.XamlVisible(false)] public abstract class DiscoveryServiceExtension : IExtension{ ServiceHostBase owner; PublishedEndpointCollection publishedEndpoints; ReadOnlyCollection readOnlyPublishedEndpoints; protected DiscoveryServiceExtension() { this.publishedEndpoints = new PublishedEndpointCollection(); this.readOnlyPublishedEndpoints = new ReadOnlyCollection (this.publishedEndpoints); } public ReadOnlyCollection PublishedEndpoints { get { return this.readOnlyPublishedEndpoints; } } internal Collection InternalPublishedEndpoints { get { return this.publishedEndpoints; } } void IExtension .Attach(ServiceHostBase owner) { if (owner == null) { throw FxTrace.Exception.ArgumentNull("owner"); } if (this.owner != null) { throw FxTrace.Exception.AsError(new InvalidOperationException(SR2.DiscoveryExtensionAlreadyAttached)); } this.owner = owner; } void IExtension .Detach(ServiceHostBase owner) { if (owner == null) { throw FxTrace.Exception.ArgumentNull("owner"); } if (this.owner != null) { throw FxTrace.Exception.AsError(new InvalidOperationException(SR2.DiscoveryExtensionCannotBeDetached)); } } internal DiscoveryService ValidateAndGetDiscoveryService() { DiscoveryService discoveryService = this.GetDiscoveryService(); if (discoveryService == null) { throw FxTrace.Exception.AsError( new InvalidOperationException( SR.DiscoveryMethodImplementationReturnsNull("GetDiscoveryService", this.GetType()))); } return discoveryService; } protected abstract DiscoveryService GetDiscoveryService(); class PublishedEndpointCollection : NonNullItemCollection { protected override void InsertItem(int index, EndpointDiscoveryMetadata item) { base.InsertItem(index, item); item.Open(); } protected override void SetItem(int index, EndpointDiscoveryMetadata item) { base.SetItem(index, item); item.Open(); } } } } // 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
- SoapFault.cs
- ReverseInheritProperty.cs
- NullableDoubleMinMaxAggregationOperator.cs
- CharAnimationUsingKeyFrames.cs
- ComponentManagerBroker.cs
- RC2CryptoServiceProvider.cs
- Token.cs
- ReadContentAsBinaryHelper.cs
- IIS7WorkerRequest.cs
- ObjectToken.cs
- TrackingServices.cs
- CachingHintValidation.cs
- ToolStripContainerActionList.cs
- Rect.cs
- WebPartEditorOkVerb.cs
- ConstructorBuilder.cs
- StorageFunctionMapping.cs
- SQLDateTime.cs
- EventData.cs
- DataBoundControlActionList.cs
- TemplateBuilder.cs
- ProjectedWrapper.cs
- ParameterReplacerVisitor.cs
- GroupDescription.cs
- DbProviderServices.cs
- ApplicationInfo.cs
- VersionedStreamOwner.cs
- DialogBaseForm.cs
- PrefixHandle.cs
- WebRequest.cs
- ContractTypeNameCollection.cs
- EventLogTraceListener.cs
- ImageClickEventArgs.cs
- XPathSelectionIterator.cs
- Switch.cs
- XmlSchemaAll.cs
- UpDownEvent.cs
- ListViewContainer.cs
- DataFormats.cs
- PowerStatus.cs
- propertyentry.cs
- ObjectManager.cs
- CodeTypeMember.cs
- Parameter.cs
- counter.cs
- RtfFormatStack.cs
- RegexNode.cs
- Formatter.cs
- ACL.cs
- OleDbMetaDataFactory.cs
- ServiceReference.cs
- Recipient.cs
- HeaderUtility.cs
- HtmlCommandAdapter.cs
- ListItemCollection.cs
- login.cs
- MessagePropertyVariants.cs
- Viewport3DAutomationPeer.cs
- LassoHelper.cs
- XmlLinkedNode.cs
- LinearQuaternionKeyFrame.cs
- IDispatchConstantAttribute.cs
- PerformanceCounterPermission.cs
- UrlAuthFailureHandler.cs
- TableAdapterManagerMethodGenerator.cs
- RijndaelManaged.cs
- ExpandSegment.cs
- Quad.cs
- PropertyBuilder.cs
- AxHost.cs
- EventRecord.cs
- CodeTypeOfExpression.cs
- FontNamesConverter.cs
- BinaryEditor.cs
- TreeNode.cs
- DrawingGroup.cs
- CompilerInfo.cs
- basenumberconverter.cs
- PackageFilter.cs
- KeyValueConfigurationElement.cs
- XmlSchemaSimpleTypeRestriction.cs
- DBConnection.cs
- LambdaCompiler.Binary.cs
- MembershipValidatePasswordEventArgs.cs
- ControlPropertyNameConverter.cs
- LoadWorkflowByInstanceKeyCommand.cs
- Model3DGroup.cs
- HandleRef.cs
- AssertSection.cs
- StreamReader.cs
- OwnerDrawPropertyBag.cs
- SafeArrayRankMismatchException.cs
- DocumentSchemaValidator.cs
- SqlMetaData.cs
- IteratorFilter.cs
- Base64Decoder.cs
- InputLanguageCollection.cs
- TextEditorContextMenu.cs
- NamespaceListProperty.cs
- SBCSCodePageEncoding.cs