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

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ClientSettingsStore.cs
- printdlgexmarshaler.cs
- DataControlButton.cs
- LabelLiteral.cs
- StoreItemCollection.cs
- AtomicFile.cs
- QueryProcessor.cs
- BindingList.cs
- TableChangeProcessor.cs
- _Connection.cs
- InternalMappingException.cs
- TypeBuilderInstantiation.cs
- MILUtilities.cs
- Utility.cs
- BamlRecordWriter.cs
- EntityPropertyMappingAttribute.cs
- StructuredType.cs
- _UriSyntax.cs
- MdiWindowListItemConverter.cs
- ResXResourceReader.cs
- UriTemplateTableMatchCandidate.cs
- RSAPKCS1KeyExchangeFormatter.cs
- WriteTimeStream.cs
- GeometryHitTestResult.cs
- SoapIncludeAttribute.cs
- HwndSource.cs
- MaskedTextProvider.cs
- Trace.cs
- TakeQueryOptionExpression.cs
- TreeSet.cs
- ButtonDesigner.cs
- PropertyMetadata.cs
- Model3D.cs
- DataListItemEventArgs.cs
- GCHandleCookieTable.cs
- PersistenceTypeAttribute.cs
- Line.cs
- InheritanceContextHelper.cs
- ACE.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- XmlILStorageConverter.cs
- SocketElement.cs
- PageContentCollection.cs
- WebBaseEventKeyComparer.cs
- AnnotationResourceCollection.cs
- VisualProxy.cs
- PreviewPrintController.cs
- PropertiesTab.cs
- SponsorHelper.cs
- MimeTypePropertyAttribute.cs
- GacUtil.cs
- MarkedHighlightComponent.cs
- EntryWrittenEventArgs.cs
- VerticalAlignConverter.cs
- BaseTreeIterator.cs
- util.cs
- ProxyManager.cs
- UpdateRecord.cs
- WsdlContractConversionContext.cs
- LostFocusEventManager.cs
- PartialCachingAttribute.cs
- PrintingPermission.cs
- VSWCFServiceContractGenerator.cs
- ProfileSettingsCollection.cs
- KeyValuePairs.cs
- WebPartChrome.cs
- ReflectionTypeLoadException.cs
- SystemInfo.cs
- CachedRequestParams.cs
- Bold.cs
- ContainerSelectorGlyph.cs
- LoginDesignerUtil.cs
- querybuilder.cs
- JournalEntryStack.cs
- ContainerUIElement3D.cs
- ClientScriptItem.cs
- mactripleDES.cs
- Stack.cs
- DocumentViewerBaseAutomationPeer.cs
- GeneralTransform3DTo2DTo3D.cs
- BinaryEditor.cs
- PlainXmlDeserializer.cs
- HandlerBase.cs
- SrgsGrammarCompiler.cs
- BaseDataListDesigner.cs
- RandomNumberGenerator.cs
- XmlWellformedWriter.cs
- WebServiceEnumData.cs
- EntityCommandCompilationException.cs
- PeerContact.cs
- XPathNode.cs
- SourceElementsCollection.cs
- XmlSchemaException.cs
- StaticDataManager.cs
- EmptyTextWriter.cs
- AddInIpcChannel.cs
- PreviewPageInfo.cs
- MethodAccessException.cs
- SizeChangedEventArgs.cs
- ExpressionBuilderCollection.cs