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
- RotateTransform3D.cs
- MarginCollapsingState.cs
- ConstructorBuilder.cs
- ContractSearchPattern.cs
- QilStrConcatenator.cs
- Stroke2.cs
- SBCSCodePageEncoding.cs
- EventData.cs
- storepermission.cs
- DoubleAnimationClockResource.cs
- DocumentViewerHelper.cs
- SQLInt32.cs
- DataControlFieldCollection.cs
- SafeFileMapViewHandle.cs
- IndexedWhereQueryOperator.cs
- ConnectionProviderAttribute.cs
- OdbcPermission.cs
- MemberHolder.cs
- RepeatEnumerable.cs
- XsltArgumentList.cs
- ReadWriteControlDesigner.cs
- transactioncontext.cs
- Point3DValueSerializer.cs
- BindingWorker.cs
- DetailsViewUpdatedEventArgs.cs
- ResXBuildProvider.cs
- ToolStripItemRenderEventArgs.cs
- QuotedStringFormatReader.cs
- X509IssuerSerialKeyIdentifierClause.cs
- WsiProfilesElement.cs
- XmlSchema.cs
- TransactionState.cs
- TemplatedWizardStep.cs
- NetworkCredential.cs
- Vector3DCollection.cs
- SafeMarshalContext.cs
- MaskedTextProvider.cs
- Constants.cs
- ExpressionLink.cs
- OutOfMemoryException.cs
- FormatSettings.cs
- BinHexDecoder.cs
- GridViewSelectEventArgs.cs
- SafeTokenHandle.cs
- BaseProcessProtocolHandler.cs
- AppDomainFactory.cs
- Classification.cs
- EventLogEntry.cs
- Compilation.cs
- AuthStoreRoleProvider.cs
- DiscoveryReferences.cs
- UnicodeEncoding.cs
- WebPartVerbCollection.cs
- Stylesheet.cs
- WSDualHttpBindingElement.cs
- LayoutTableCell.cs
- HandleDictionary.cs
- Types.cs
- GatewayIPAddressInformationCollection.cs
- StorageAssociationSetMapping.cs
- SiteMapDataSourceView.cs
- XmlRootAttribute.cs
- PropertyItemInternal.cs
- WebBrowserNavigatedEventHandler.cs
- TextEditorThreadLocalStore.cs
- ByteStream.cs
- Transform.cs
- MultiBinding.cs
- FunctionImportMapping.cs
- DocumentEventArgs.cs
- _AuthenticationState.cs
- XmlDomTextWriter.cs
- ReadOnlyPermissionSet.cs
- BuildResult.cs
- CodeAccessPermission.cs
- JsonSerializer.cs
- ViewManager.cs
- SchemaComplexType.cs
- XmlSchemaObjectCollection.cs
- AppModelKnownContentFactory.cs
- HandleCollector.cs
- SubpageParaClient.cs
- XmlSchemaIdentityConstraint.cs
- SQLBinaryStorage.cs
- HtmlLink.cs
- XmlSchemaImporter.cs
- NumericPagerField.cs
- XPathNavigator.cs
- EncoderBestFitFallback.cs
- DuplexSecurityProtocolFactory.cs
- SecurityUtils.cs
- CryptoKeySecurity.cs
- HttpStaticObjectsCollectionBase.cs
- TransactionScope.cs
- UserControlAutomationPeer.cs
- WmiInstallComponent.cs
- FileDetails.cs
- BinaryParser.cs
- VerticalAlignConverter.cs
- SiteMapSection.cs