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
- SamlAssertion.cs
- DescendentsWalkerBase.cs
- PopOutPanel.cs
- SpStreamWrapper.cs
- KerberosTicketHashIdentifierClause.cs
- MobileTemplatedControlDesigner.cs
- WsatServiceCertificate.cs
- ProxyGenerator.cs
- UmAlQuraCalendar.cs
- CodeTypeParameterCollection.cs
- DataGridHeaderBorder.cs
- LexicalChunk.cs
- ActivityTypeDesigner.xaml.cs
- XmlUTF8TextWriter.cs
- EmissiveMaterial.cs
- TabItemAutomationPeer.cs
- EntityTypeBase.cs
- Token.cs
- SerializationEventsCache.cs
- WebPartConnectionsCancelVerb.cs
- BitmapMetadataBlob.cs
- HeaderPanel.cs
- SystemResources.cs
- VirtualPath.cs
- XsltException.cs
- TimeSpanValidatorAttribute.cs
- ProfileBuildProvider.cs
- CustomSignedXml.cs
- x509store.cs
- IteratorDescriptor.cs
- HasCopySemanticsAttribute.cs
- SizeIndependentAnimationStorage.cs
- sqlcontext.cs
- GeneralTransformGroup.cs
- JsonEnumDataContract.cs
- XmlEventCache.cs
- _DomainName.cs
- SqlTriggerContext.cs
- xmlsaver.cs
- SolidColorBrush.cs
- ConfigurationCollectionAttribute.cs
- SQLInt32Storage.cs
- DataBindingList.cs
- IPipelineRuntime.cs
- ObsoleteAttribute.cs
- CommandManager.cs
- SQLDateTime.cs
- VisualTreeHelper.cs
- CollectionBuilder.cs
- DocumentViewerHelper.cs
- LocalBuilder.cs
- GPPOINTF.cs
- AppSettingsReader.cs
- SafeHandles.cs
- OleDbConnectionInternal.cs
- TransformerTypeCollection.cs
- UTF8Encoding.cs
- LayoutTable.cs
- FontFamily.cs
- Message.cs
- DataGridRelationshipRow.cs
- ColumnProvider.cs
- ProcessThreadCollection.cs
- TableMethodGenerator.cs
- JsonFormatGeneratorStatics.cs
- StylusEditingBehavior.cs
- SHA384Managed.cs
- RMEnrollmentPage2.cs
- XmlDictionaryReader.cs
- SimplePropertyEntry.cs
- DataGridViewTextBoxCell.cs
- WmlMobileTextWriter.cs
- Assembly.cs
- TypeDescriptor.cs
- Tablet.cs
- NativeMethods.cs
- DispatcherExceptionEventArgs.cs
- SafeViewOfFileHandle.cs
- SecurityManager.cs
- ActivityPropertyReference.cs
- GridViewRow.cs
- SourceFilter.cs
- LiteralSubsegment.cs
- FrameworkPropertyMetadata.cs
- FixedTextBuilder.cs
- DataBinding.cs
- Queue.cs
- OperationInfoBase.cs
- AggregateNode.cs
- ImageCodecInfo.cs
- PropagationProtocolsTracing.cs
- PublisherMembershipCondition.cs
- SaveLedgerEntryRequest.cs
- Message.cs
- WorkflowExecutor.cs
- SoapExtensionImporter.cs
- UnsettableComboBox.cs
- BaseCodeDomTreeGenerator.cs
- PeerApplication.cs
- EntityDataSourceMemberPath.cs