Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Description / ServiceEndpointCollection.cs / 1 / ServiceEndpointCollection.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel.Description { using System.ServiceModel; using System.ServiceModel.Channels; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Xml; using System.Runtime.Serialization; public class ServiceEndpointCollection : Collection{ internal ServiceEndpointCollection() { } public ServiceEndpoint Find(Type contractType) { if (contractType == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("contractType"); } foreach (ServiceEndpoint endpoint in this) { if (endpoint != null && endpoint.Contract.ContractType == contractType) { return endpoint; } } return null; } public ServiceEndpoint Find(XmlQualifiedName contractName) { if (contractName == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("contractName"); } foreach (ServiceEndpoint endpoint in this) { if (endpoint != null && endpoint.Contract.Name == contractName.Name && endpoint.Contract.Namespace == contractName.Namespace) { return endpoint; } } return null; } public ServiceEndpoint Find(Type contractType, XmlQualifiedName bindingName) { if (contractType == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("contractType"); } if (bindingName == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("bindingName"); } foreach (ServiceEndpoint endpoint in this) { if (endpoint != null && endpoint.Contract.ContractType == contractType && endpoint.Binding.Name == bindingName.Name && endpoint.Binding.Namespace == bindingName.Namespace) { return endpoint; } } return null; } public ServiceEndpoint Find(XmlQualifiedName contractName, XmlQualifiedName bindingName) { if (contractName == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("contractName"); } if (bindingName == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("bindingName"); } foreach (ServiceEndpoint endpoint in this) { if (endpoint != null && endpoint.Contract.Name == contractName.Name && endpoint.Contract.Namespace == contractName.Namespace && endpoint.Binding.Name == bindingName.Name && endpoint.Binding.Namespace == bindingName.Namespace) { return endpoint; } } return null; } public ServiceEndpoint Find(Uri address) { if (address == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("address"); } foreach (ServiceEndpoint endpoint in this) { if (endpoint != null && endpoint.Address.Uri == address) { return endpoint; } } return null; } public Collection FindAll(Type contractType) { if (contractType == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("contractType"); } Collection results = new Collection (); foreach (ServiceEndpoint endpoint in this) { if (endpoint != null && endpoint.Contract.ContractType == contractType) { results.Add(endpoint); } } return results; } public Collection FindAll(XmlQualifiedName contractName) { if (contractName == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("contractName"); } Collection results = new Collection (); foreach (ServiceEndpoint endpoint in this) { if (endpoint != null && endpoint.Contract.Name == contractName.Name && endpoint.Contract.Namespace == contractName.Namespace) { results.Add(endpoint); } } return results; } protected override void InsertItem(int index, ServiceEndpoint item) { if (item == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("item"); } base.InsertItem(index, item); } protected override void SetItem(int index, ServiceEndpoint item) { if (item == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("item"); } base.SetItem(index, item); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- COM2FontConverter.cs
- SrgsSemanticInterpretationTag.cs
- ListSortDescription.cs
- HttpHandlerAction.cs
- ApplicationManager.cs
- PermissionRequestEvidence.cs
- GeneralTransform2DTo3D.cs
- MemberInitExpression.cs
- RegexNode.cs
- BitmapEffectGroup.cs
- DataBindingExpressionBuilder.cs
- WrappedReader.cs
- webproxy.cs
- TypedReference.cs
- Event.cs
- DataServiceCollectionOfT.cs
- ScrollViewerAutomationPeer.cs
- NameTable.cs
- Vector3DAnimationUsingKeyFrames.cs
- EditorZoneBase.cs
- ExpressionBinding.cs
- RectAnimation.cs
- Simplifier.cs
- MobileComponentEditorPage.cs
- Blend.cs
- UserValidatedEventArgs.cs
- AddingNewEventArgs.cs
- TargetInvocationException.cs
- DataFormats.cs
- MatrixTransform.cs
- SpoolingTask.cs
- SynchronizingStream.cs
- DataBindingHandlerAttribute.cs
- HostedHttpContext.cs
- RectangleConverter.cs
- BaseValidatorDesigner.cs
- Timer.cs
- FileInfo.cs
- GridViewRowPresenterBase.cs
- DoubleMinMaxAggregationOperator.cs
- CombinedGeometry.cs
- FrameworkTemplate.cs
- SplineKeyFrames.cs
- BooleanConverter.cs
- XmlnsCompatibleWithAttribute.cs
- ZipIOLocalFileBlock.cs
- LocalValueEnumerator.cs
- SettingsPropertyNotFoundException.cs
- DirectoryGroupQuery.cs
- ChangeConflicts.cs
- CompilerLocalReference.cs
- UnsafePeerToPeerMethods.cs
- RowToParametersTransformer.cs
- ErrorFormatterPage.cs
- RangeValidator.cs
- ConstNode.cs
- DataGridViewCellStyleConverter.cs
- ImageSource.cs
- SizeConverter.cs
- CmsUtils.cs
- ConstraintManager.cs
- iisPickupDirectory.cs
- NodeFunctions.cs
- BinaryUtilClasses.cs
- dataSvcMapFileLoader.cs
- FileSystemEnumerable.cs
- ping.cs
- HMACSHA512.cs
- TabItem.cs
- Activity.cs
- TextBounds.cs
- HtmlUtf8RawTextWriter.cs
- SignatureToken.cs
- GeneralTransform3DTo2D.cs
- Span.cs
- LinkDescriptor.cs
- RuntimeCompatibilityAttribute.cs
- ScrollableControl.cs
- ZoneButton.cs
- Stack.cs
- GZipUtils.cs
- SqlProvider.cs
- ScriptResourceHandler.cs
- GroupBoxAutomationPeer.cs
- PseudoWebRequest.cs
- BypassElementCollection.cs
- StreamGeometryContext.cs
- EventRouteFactory.cs
- BevelBitmapEffect.cs
- KeysConverter.cs
- DeferredElementTreeState.cs
- CustomExpressionEventArgs.cs
- InternalRelationshipCollection.cs
- CompilationSection.cs
- WebResourceAttribute.cs
- ProxyWebPartConnectionCollection.cs
- ConnectionManagementElement.cs
- BitmapEffectInput.cs
- IUnknownConstantAttribute.cs
- OdbcFactory.cs