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
- WebPartCatalogAddVerb.cs
- DefaultAutoFieldGenerator.cs
- RoleBoolean.cs
- ContractNamespaceAttribute.cs
- UpDownBase.cs
- Converter.cs
- ParserContext.cs
- VariableQuery.cs
- ConfigurationSchemaErrors.cs
- HMACSHA256.cs
- SamlEvidence.cs
- CodeNamespaceImportCollection.cs
- ThicknessKeyFrameCollection.cs
- DescendentsWalkerBase.cs
- ListItemConverter.cs
- ProfileBuildProvider.cs
- DESCryptoServiceProvider.cs
- XmlNodeChangedEventArgs.cs
- Matrix.cs
- ConnectionStringsExpressionBuilder.cs
- HttpConfigurationSystem.cs
- DispatchChannelSink.cs
- PositiveTimeSpanValidatorAttribute.cs
- CompoundFileDeflateTransform.cs
- Parser.cs
- CodeGenerationManager.cs
- CustomAttribute.cs
- AutomationTextAttribute.cs
- Overlapped.cs
- ButtonBase.cs
- WindowsScrollBar.cs
- StreamInfo.cs
- TPLETWProvider.cs
- ProviderConnectionPoint.cs
- SamlEvidence.cs
- BitmapMetadataEnumerator.cs
- CompareValidator.cs
- SymbolDocumentInfo.cs
- SlipBehavior.cs
- UpdatePanelTrigger.cs
- SqlUtil.cs
- TransactionValidationBehavior.cs
- Lasso.cs
- XmlNamespaceManager.cs
- ZoneIdentityPermission.cs
- ServiceOperationWrapper.cs
- RectAnimation.cs
- SplineKeyFrames.cs
- COM2TypeInfoProcessor.cs
- HtmlAnchor.cs
- DataGridViewTextBoxColumn.cs
- NativeMethods.cs
- CultureInfoConverter.cs
- PolygonHotSpot.cs
- DataStreamFromComStream.cs
- TypefaceMap.cs
- LocatorBase.cs
- DesignerUtility.cs
- GridViewEditEventArgs.cs
- DecimalMinMaxAggregationOperator.cs
- DynamicMethod.cs
- BinaryObjectReader.cs
- CodeCompileUnit.cs
- FocusChangedEventArgs.cs
- WindowVisualStateTracker.cs
- InkCanvasInnerCanvas.cs
- ParameterCollection.cs
- IssuanceLicense.cs
- ListViewAutomationPeer.cs
- AllMembershipCondition.cs
- HtmlInputSubmit.cs
- ListViewHitTestInfo.cs
- IconConverter.cs
- TemplateParser.cs
- XmlSchemaSimpleTypeList.cs
- ToolStripSplitStackLayout.cs
- ZipPackage.cs
- OutputCacheProviderCollection.cs
- TypeInfo.cs
- RectangleF.cs
- SvcMapFileSerializer.cs
- SafeCertificateStore.cs
- Logging.cs
- SequentialUshortCollection.cs
- ProxyWebPart.cs
- AssemblyHelper.cs
- _NtlmClient.cs
- _SslStream.cs
- TransactionContextManager.cs
- PathFigureCollection.cs
- CanExecuteRoutedEventArgs.cs
- assertwrapper.cs
- DBCommand.cs
- PersonalizationProvider.cs
- ArrayWithOffset.cs
- RawTextInputReport.cs
- TypeDescriptionProviderAttribute.cs
- StringPropertyBuilder.cs
- CodeMemberField.cs
- ListChangedEventArgs.cs