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
- BaseTemplateBuildProvider.cs
- QueueSurrogate.cs
- CodeNamespace.cs
- Privilege.cs
- TreeNodeConverter.cs
- SplineQuaternionKeyFrame.cs
- GeometryValueSerializer.cs
- SiteMapDataSourceView.cs
- RelationshipDetailsCollection.cs
- SecurityContextSecurityTokenAuthenticator.cs
- PackageController.cs
- XmlAttributeAttribute.cs
- EntityDesignerDataSourceView.cs
- DynamicQueryStringParameter.cs
- ConfigUtil.cs
- ScriptControlDescriptor.cs
- Int16AnimationBase.cs
- ServiceContractGenerator.cs
- WorkflowDesignerMessageFilter.cs
- RunWorkerCompletedEventArgs.cs
- TextRangeEdit.cs
- DbConnectionOptions.cs
- TileModeValidation.cs
- ListQueryResults.cs
- XmlUtil.cs
- OleDbRowUpdatingEvent.cs
- _ServiceNameStore.cs
- Column.cs
- AttachedPropertyBrowsableAttribute.cs
- FrameworkObject.cs
- CancelEventArgs.cs
- DesignerActionPropertyItem.cs
- StrokeCollectionConverter.cs
- WorkflowViewElement.cs
- StringArrayConverter.cs
- DesignerCommandSet.cs
- EdmProperty.cs
- Propagator.ExtentPlaceholderCreator.cs
- XmlReaderSettings.cs
- XmlWrappingWriter.cs
- LocalizedNameDescriptionPair.cs
- EventLogEntryCollection.cs
- OuterGlowBitmapEffect.cs
- OletxCommittableTransaction.cs
- OpenTypeLayout.cs
- ClientSponsor.cs
- Label.cs
- SafeNativeMethods.cs
- DecimalFormatter.cs
- HtmlEmptyTagControlBuilder.cs
- DateTimeSerializationSection.cs
- ProgressiveCrcCalculatingStream.cs
- EastAsianLunisolarCalendar.cs
- RotateTransform3D.cs
- ImpersonationContext.cs
- EditorPartChrome.cs
- XmlILTrace.cs
- WindowsToolbarItemAsMenuItem.cs
- ProfilePropertyNameValidator.cs
- SecurityTokenAttachmentMode.cs
- AxDesigner.cs
- ProcessingInstructionAction.cs
- ApplicationSettingsBase.cs
- EncryptedPackageFilter.cs
- GridViewSortEventArgs.cs
- DbParameterHelper.cs
- Simplifier.cs
- TcpServerChannel.cs
- ReachNamespaceInfo.cs
- Html32TextWriter.cs
- FastEncoder.cs
- XmlDataDocument.cs
- MailAddressParser.cs
- DataServiceQueryContinuation.cs
- TableLayoutSettings.cs
- SiteOfOriginContainer.cs
- Scene3D.cs
- XamlVector3DCollectionSerializer.cs
- PerformanceCounter.cs
- GC.cs
- DiscoveryEndpointValidator.cs
- BoundColumn.cs
- AddressHeaderCollectionElement.cs
- panel.cs
- OutOfMemoryException.cs
- SymDocumentType.cs
- HMACSHA1.cs
- Nullable.cs
- sqlpipe.cs
- ToolboxItemFilterAttribute.cs
- TextTreeTextElementNode.cs
- SqlDataReaderSmi.cs
- AdapterUtil.cs
- LinkedList.cs
- OracleNumber.cs
- QueryCreatedEventArgs.cs
- WebControl.cs
- LiteralLink.cs
- TextDocumentView.cs
- InheritablePropertyChangeInfo.cs