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
- DataGridViewRow.cs
- IPAddressCollection.cs
- DaylightTime.cs
- _CommandStream.cs
- ModelItemKeyValuePair.cs
- BamlTreeNode.cs
- TextReader.cs
- XmlRootAttribute.cs
- Vector3DConverter.cs
- CommonProperties.cs
- UIElementCollection.cs
- SmiContextFactory.cs
- OdbcConnectionHandle.cs
- ScheduleChanges.cs
- FieldAccessException.cs
- AccessViolationException.cs
- SettingsBindableAttribute.cs
- ErrorHandlerModule.cs
- IERequestCache.cs
- CodeChecksumPragma.cs
- CodeTypeConstructor.cs
- ImageFormat.cs
- BrushValueSerializer.cs
- StorageEntityContainerMapping.cs
- Button.cs
- TcpTransportElement.cs
- StructureChangedEventArgs.cs
- ParallelQuery.cs
- SettingsBindableAttribute.cs
- SupportingTokenChannel.cs
- NativeMethodsOther.cs
- RouteValueExpressionBuilder.cs
- Win32Native.cs
- WebPartEventArgs.cs
- RepeatEnumerable.cs
- MetadataItemEmitter.cs
- WindowsStatusBar.cs
- SqlDataSourceRefreshSchemaForm.cs
- HttpProtocolImporter.cs
- MemoryMappedViewStream.cs
- DataSetUtil.cs
- PartialTrustHelpers.cs
- ClaimComparer.cs
- Journaling.cs
- XmlEntityReference.cs
- MergeLocalizationDirectives.cs
- HtmlLiteralTextAdapter.cs
- DocumentPageView.cs
- JobDuplex.cs
- SemanticValue.cs
- QilSortKey.cs
- GridItemPatternIdentifiers.cs
- FunctionDetailsReader.cs
- ScriptingJsonSerializationSection.cs
- RectAnimation.cs
- Code.cs
- SymbolMethod.cs
- Propagator.cs
- FixedSOMSemanticBox.cs
- UnderstoodHeaders.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- EventLog.cs
- MetadataCollection.cs
- EntitySetRetriever.cs
- ShutDownListener.cs
- SQLRoleProvider.cs
- WebPartManagerInternals.cs
- WrappedIUnknown.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- EventArgs.cs
- EntityDataSourceReferenceGroup.cs
- DrawingGroup.cs
- StylusButtonEventArgs.cs
- SynchronizedCollection.cs
- ClientConfigurationHost.cs
- ClusterSafeNativeMethods.cs
- BitmapEffectDrawingContextWalker.cs
- HtmlTableRow.cs
- RuntimeHandles.cs
- SqlDataSourceFilteringEventArgs.cs
- XmlQualifiedName.cs
- XmlText.cs
- DecoderBestFitFallback.cs
- ConfigurationSchemaErrors.cs
- XmlSchemaSearchPattern.cs
- PageStatePersister.cs
- AmbiguousMatchException.cs
- AccessDataSourceWizardForm.cs
- ListViewItem.cs
- UInt32.cs
- JsonStringDataContract.cs
- QueryableDataSourceView.cs
- RemoveStoryboard.cs
- EDesignUtil.cs
- PriorityChain.cs
- DataView.cs
- XmlHierarchicalEnumerable.cs
- OleDbCommand.cs
- EUCJPEncoding.cs
- sqlstateclientmanager.cs