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
- NotImplementedException.cs
- RegisteredArrayDeclaration.cs
- QilCloneVisitor.cs
- EntityModelBuildProvider.cs
- ReadOnlyHierarchicalDataSource.cs
- ProfileParameter.cs
- TemplateLookupAction.cs
- PipelineModuleStepContainer.cs
- DodSequenceMerge.cs
- CodeNamespace.cs
- DocumentGridContextMenu.cs
- CleanUpVirtualizedItemEventArgs.cs
- ThreadStaticAttribute.cs
- CategoryAttribute.cs
- EntityConnectionStringBuilder.cs
- ProgressBarHighlightConverter.cs
- SchemaNames.cs
- StylusPointProperty.cs
- Int64AnimationUsingKeyFrames.cs
- Evidence.cs
- WebPartTransformerAttribute.cs
- ConfigXmlReader.cs
- TableRowsCollectionEditor.cs
- PeerMessageDispatcher.cs
- Ticks.cs
- Missing.cs
- DecoderBestFitFallback.cs
- SoapHeaderException.cs
- WindowsHyperlink.cs
- DbDataAdapter.cs
- ComplusEndpointConfigContainer.cs
- StateItem.cs
- ApplicationInfo.cs
- Pen.cs
- IResourceProvider.cs
- SourceSwitch.cs
- WebPartConnectionsConnectVerb.cs
- RemoteWebConfigurationHost.cs
- DSASignatureFormatter.cs
- SubclassTypeValidatorAttribute.cs
- SQLChars.cs
- UniqueEventHelper.cs
- EllipseGeometry.cs
- AuthStoreRoleProvider.cs
- DataGridViewSelectedCellCollection.cs
- ColorInterpolationModeValidation.cs
- HorizontalAlignConverter.cs
- StyleHelper.cs
- ConstraintStruct.cs
- PartialTrustVisibleAssembliesSection.cs
- SetStoryboardSpeedRatio.cs
- TemplateDefinition.cs
- SspiWrapper.cs
- TreeBuilderBamlTranslator.cs
- RenderData.cs
- HwndAppCommandInputProvider.cs
- DebugHandleTracker.cs
- SettingsProperty.cs
- TextCollapsingProperties.cs
- GuidelineCollection.cs
- ApplicationFileCodeDomTreeGenerator.cs
- TreeNodeCollection.cs
- ErrorView.xaml.cs
- CasesDictionary.cs
- OperationFormatStyle.cs
- TextServicesCompartmentEventSink.cs
- ProxyHwnd.cs
- ToolboxCategoryItems.cs
- ValueExpressions.cs
- WorkflowTransactionService.cs
- LoaderAllocator.cs
- CircleHotSpot.cs
- MailMessage.cs
- DiscoveryViaBehavior.cs
- clipboard.cs
- DataListItemCollection.cs
- DoubleAnimationBase.cs
- ObjectToIdCache.cs
- ObjectConverter.cs
- ServiceMetadataContractBehavior.cs
- EncoderReplacementFallback.cs
- EventLogPermissionAttribute.cs
- ClientProxyGenerator.cs
- DatatypeImplementation.cs
- Zone.cs
- NullableFloatSumAggregationOperator.cs
- RegexCompilationInfo.cs
- AVElementHelper.cs
- GuidelineSet.cs
- StorageComplexTypeMapping.cs
- ParallelTimeline.cs
- ResolvedKeyFrameEntry.cs
- DataBindingsDialog.cs
- ValidationError.cs
- RegexCaptureCollection.cs
- SoapObjectWriter.cs
- RecordBuilder.cs
- OutputCacheEntry.cs
- ServicePointManager.cs
- BaseCollection.cs