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
- FileChangesMonitor.cs
- ObjectReferenceStack.cs
- BamlCollectionHolder.cs
- SQLInt32.cs
- Debug.cs
- OdbcDataReader.cs
- Token.cs
- DateTimePicker.cs
- TransformedBitmap.cs
- RadialGradientBrush.cs
- SqlWebEventProvider.cs
- AnnotationComponentManager.cs
- AbandonedMutexException.cs
- MailWebEventProvider.cs
- CheckPair.cs
- IdleTimeoutMonitor.cs
- IdentifierCreationService.cs
- SecurityTokenSerializer.cs
- designeractionbehavior.cs
- DataSetMappper.cs
- RewritingPass.cs
- MetadataException.cs
- ConnectionPoint.cs
- SessionState.cs
- IOThreadScheduler.cs
- PackageProperties.cs
- TextBoxView.cs
- ConfigXmlDocument.cs
- SQLDateTime.cs
- CodeMethodReturnStatement.cs
- SchemaObjectWriter.cs
- ParserStreamGeometryContext.cs
- DataGridTextBox.cs
- XsltLoader.cs
- StreamReader.cs
- PathFigure.cs
- ServiceOperationWrapper.cs
- TreeViewTemplateSelector.cs
- CompletionProxy.cs
- FullTrustAssemblyCollection.cs
- AppDomainCompilerProxy.cs
- HttpCachePolicy.cs
- FileEnumerator.cs
- HijriCalendar.cs
- SmiXetterAccessMap.cs
- CommandManager.cs
- ConstructorNeedsTagAttribute.cs
- SymbolDocumentInfo.cs
- ColumnResult.cs
- Grant.cs
- WebPartZoneCollection.cs
- BindingCompleteEventArgs.cs
- ListSortDescription.cs
- Events.cs
- EndpointNameMessageFilter.cs
- ApplicationFileParser.cs
- DoubleAnimationUsingKeyFrames.cs
- TransactionScope.cs
- TextServicesDisplayAttribute.cs
- CommentAction.cs
- CorePropertiesFilter.cs
- ForEachAction.cs
- WebPartHeaderCloseVerb.cs
- ConnectionManagementElementCollection.cs
- LogWriteRestartAreaState.cs
- SymDocumentType.cs
- WindowsSpinner.cs
- ResourceDictionaryCollection.cs
- XPathNodeInfoAtom.cs
- TokenBasedSet.cs
- ControlCachePolicy.cs
- BaseTemplateParser.cs
- DataGridAutoGeneratingColumnEventArgs.cs
- EntityParameter.cs
- ResolveInfo.cs
- BitmapCodecInfoInternal.cs
- CultureData.cs
- TypeDelegator.cs
- PenCursorManager.cs
- StackBuilderSink.cs
- GenericTypeParameterBuilder.cs
- FormParameter.cs
- ToolStripDropDownButton.cs
- CompressedStack.cs
- FixedSOMSemanticBox.cs
- Point4D.cs
- CodeTypeReferenceExpression.cs
- HtmlString.cs
- SqlCaseSimplifier.cs
- DBCSCodePageEncoding.cs
- COM2Enum.cs
- ConcurrentQueue.cs
- PrintPreviewDialog.cs
- _RequestCacheProtocol.cs
- BitmapEffectOutputConnector.cs
- HttpResponseHeader.cs
- PopupEventArgs.cs
- MailAddress.cs
- SqlConnectionString.cs
- ToolStripAdornerWindowService.cs