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
- CompositeTypefaceMetrics.cs
- TdsParserHelperClasses.cs
- ModifierKeysConverter.cs
- SafeCryptContextHandle.cs
- X509Utils.cs
- LinqTreeNodeEvaluator.cs
- ActivityExecutionWorkItem.cs
- TypeDescriptor.cs
- HwndSourceParameters.cs
- MetadataArtifactLoaderComposite.cs
- Properties.cs
- SpotLight.cs
- EdmTypeAttribute.cs
- BlurBitmapEffect.cs
- ProviderConnectionPointCollection.cs
- NamespaceDecl.cs
- DbMetaDataFactory.cs
- KeyInstance.cs
- HyperlinkAutomationPeer.cs
- HwndSourceParameters.cs
- MemberAssignmentAnalysis.cs
- SqlRewriteScalarSubqueries.cs
- ButtonBaseDesigner.cs
- CodeExpressionCollection.cs
- SessionState.cs
- ToolboxItemImageConverter.cs
- ComNativeDescriptor.cs
- SingleAnimationUsingKeyFrames.cs
- Baml2006SchemaContext.cs
- TransformCollection.cs
- PropertyKey.cs
- PeerApplicationLaunchInfo.cs
- CodeStatement.cs
- ThreadStaticAttribute.cs
- EntityCommandExecutionException.cs
- ConfigUtil.cs
- BitmapEffectvisualstate.cs
- OrderedDictionary.cs
- DataGridComponentEditor.cs
- LayoutEvent.cs
- ValidationErrorEventArgs.cs
- RoleService.cs
- BlobPersonalizationState.cs
- BitmapScalingModeValidation.cs
- GenericsNotImplementedException.cs
- StreamGeometry.cs
- SortedList.cs
- ElapsedEventArgs.cs
- ServiceChannelProxy.cs
- ExpressionConverter.cs
- QueryConverter.cs
- IconConverter.cs
- WebPageTraceListener.cs
- CSharpCodeProvider.cs
- KnownBoxes.cs
- InputReferenceExpression.cs
- TextRunCacheImp.cs
- DynamicValidatorEventArgs.cs
- Rethrow.cs
- SemanticResultValue.cs
- TypeDescriptor.cs
- SelectionWordBreaker.cs
- MarshalByValueComponent.cs
- serverconfig.cs
- HttpDebugHandler.cs
- _TLSstream.cs
- designeractionbehavior.cs
- SymLanguageVendor.cs
- Matrix3DConverter.cs
- XmlRawWriter.cs
- LambdaExpression.cs
- IndexingContentUnit.cs
- XmlSchemaAnnotation.cs
- SocketElement.cs
- ADRoleFactory.cs
- OleDbConnectionFactory.cs
- XmlSchemaComplexContentRestriction.cs
- TraceLevelHelper.cs
- UserNameSecurityTokenProvider.cs
- ExpressionBinding.cs
- ZipIOExtraField.cs
- RbTree.cs
- PeerEndPoint.cs
- PrincipalPermission.cs
- WebSysDefaultValueAttribute.cs
- SecurityPermission.cs
- WindowsGrip.cs
- EntityProviderFactory.cs
- MultiSelectRootGridEntry.cs
- AssemblyNameProxy.cs
- TraceContext.cs
- ListQueryResults.cs
- NetPipeSection.cs
- EpmContentDeSerializerBase.cs
- X509CertificateTrustedIssuerElementCollection.cs
- Part.cs
- CommonObjectSecurity.cs
- PackageRelationship.cs
- DataControlButton.cs
- QuaternionAnimationBase.cs