Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Dispatcher / ChannelDispatcherCollection.cs / 1 / ChannelDispatcherCollection.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel.Dispatcher { using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.Runtime.Serialization; public class ChannelDispatcherCollection : SynchronizedCollection{ ServiceHostBase service; internal ChannelDispatcherCollection(ServiceHostBase service, object syncRoot) : base(syncRoot) { if (service == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("service"); this.service = service; } protected override void ClearItems() { ChannelDispatcherBase[] array = new ChannelDispatcherBase[this.Count]; this.CopyTo(array, 0); base.ClearItems(); if (this.service != null) { foreach (ChannelDispatcherBase channelDispatcher in array) this.service.OnRemoveChannelDispatcher(channelDispatcher); } } protected override void InsertItem(int index, ChannelDispatcherBase item) { if (this.service != null) { if (this.service.State == CommunicationState.Closed) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ObjectDisposedException(this.service.GetType().ToString())); this.service.OnAddChannelDispatcher(item); } base.InsertItem(index, item); } protected override void RemoveItem(int index) { ChannelDispatcherBase channelDispatcher = this.Items[index]; base.RemoveItem(index); if (this.service != null) this.service.OnRemoveChannelDispatcher(channelDispatcher); } protected override void SetItem(int index, ChannelDispatcherBase item) { if (this.service != null) { if (this.service.State == CommunicationState.Closed) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ObjectDisposedException(this.service.GetType().ToString())); } if (this.service != null) this.service.OnAddChannelDispatcher(item); ChannelDispatcherBase old; lock (this.SyncRoot) { old = this.Items[index]; base.SetItem(index, item); } if (this.service != null) this.service.OnRemoveChannelDispatcher(old); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SwitchElementsCollection.cs
- TextRangeEdit.cs
- DesignerTransactionCloseEvent.cs
- OuterGlowBitmapEffect.cs
- ProvidePropertyAttribute.cs
- GetPageNumberCompletedEventArgs.cs
- Listbox.cs
- PenThreadWorker.cs
- SqlUserDefinedAggregateAttribute.cs
- DependencyPropertyAttribute.cs
- MultipartIdentifier.cs
- LogWriteRestartAreaState.cs
- DelegatingConfigHost.cs
- TransformGroup.cs
- Focus.cs
- RepeaterItemCollection.cs
- NegotiateStream.cs
- ElementProxy.cs
- InvokeWebServiceDesigner.cs
- FontFaceLayoutInfo.cs
- TraceShell.cs
- SslStream.cs
- UnescapedXmlDiagnosticData.cs
- ObjectQueryExecutionPlan.cs
- ModuleConfigurationInfo.cs
- CharStorage.cs
- SourceLineInfo.cs
- StringUtil.cs
- _CommandStream.cs
- RegisteredHiddenField.cs
- CharEnumerator.cs
- WebPartZoneBase.cs
- FixedDocument.cs
- DataControlLinkButton.cs
- GlobalItem.cs
- SqlOuterApplyReducer.cs
- GetIsBrowserClientRequest.cs
- PathGeometry.cs
- XPathNodeHelper.cs
- KnownIds.cs
- ContextStaticAttribute.cs
- RadioButton.cs
- HtmlInputPassword.cs
- IdentifierCreationService.cs
- CodeStatementCollection.cs
- ColorContextHelper.cs
- CreateWorkflowOwnerCommand.cs
- NavigationFailedEventArgs.cs
- ProfileSettings.cs
- PeerToPeerException.cs
- SqlWebEventProvider.cs
- DefaultBinder.cs
- XmlSerializableServices.cs
- AutomationPatternInfo.cs
- GeneralTransform.cs
- CircleHotSpot.cs
- _Semaphore.cs
- WrapPanel.cs
- SvcMapFileSerializer.cs
- WebPartConnectionsEventArgs.cs
- WebPartsPersonalization.cs
- ContextProperty.cs
- Baml2006SchemaContext.cs
- SubMenuStyleCollection.cs
- StaticExtensionConverter.cs
- DesignDataSource.cs
- ComAdminInterfaces.cs
- FixedPageStructure.cs
- OutputCacheSettings.cs
- DataGridViewColumnCollection.cs
- BuilderPropertyEntry.cs
- XmlSchemaAppInfo.cs
- ProcessProtocolHandler.cs
- SchemaCompiler.cs
- Fault.cs
- WSSecurityPolicy12.cs
- _ConnectStream.cs
- PersistenceContextEnlistment.cs
- MailWebEventProvider.cs
- TraceUtility.cs
- TextServicesLoader.cs
- BindValidator.cs
- ClientSettingsStore.cs
- ResolvedKeyFrameEntry.cs
- TextRangeBase.cs
- DiffuseMaterial.cs
- SafeProcessHandle.cs
- CachedPathData.cs
- XmlAttributeOverrides.cs
- Subtree.cs
- DBSchemaRow.cs
- PassportPrincipal.cs
- CommunicationObjectFaultedException.cs
- Parser.cs
- GroupItem.cs
- RuntimeHandles.cs
- PrimitiveCodeDomSerializer.cs
- StyleTypedPropertyAttribute.cs
- DataGridViewSortCompareEventArgs.cs
- ResourceManagerWrapper.cs