Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Channels / ChannelBase.cs / 1 / ChannelBase.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel.Channels { using System.Diagnostics; using System.ServiceModel; using System.ServiceModel.Diagnostics; public abstract class ChannelBase : CommunicationObject, IChannel, IDefaultCommunicationTimeouts { ChannelManagerBase channelManager; protected ChannelBase(ChannelManagerBase channelManager) { if (channelManager == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("channelManager"); } this.channelManager = channelManager; if (DiagnosticUtility.ShouldTraceVerbose) { DiagnosticUtility.DiagnosticTrace.TraceEvent(TraceEventType.Verbose, TraceCode.ChannelCreated, SR.GetString(SR.TraceCodeChannelCreated, DiagnosticTrace.CreateSourceString(this)), null, null, this); } } TimeSpan IDefaultCommunicationTimeouts.CloseTimeout { get { return this.DefaultCloseTimeout; } } TimeSpan IDefaultCommunicationTimeouts.OpenTimeout { get { return this.DefaultOpenTimeout; } } TimeSpan IDefaultCommunicationTimeouts.ReceiveTimeout { get { return this.DefaultReceiveTimeout; } } TimeSpan IDefaultCommunicationTimeouts.SendTimeout { get { return this.DefaultSendTimeout; } } protected override TimeSpan DefaultCloseTimeout { get { return ((IDefaultCommunicationTimeouts)this.channelManager).CloseTimeout; } } protected override TimeSpan DefaultOpenTimeout { get { return ((IDefaultCommunicationTimeouts)this.channelManager).OpenTimeout; } } protected TimeSpan DefaultReceiveTimeout { get { return ((IDefaultCommunicationTimeouts)this.channelManager).ReceiveTimeout; } } protected TimeSpan DefaultSendTimeout { get { return ((IDefaultCommunicationTimeouts)this.channelManager).SendTimeout; } } protected ChannelManagerBase Manager { get { return channelManager; } } public virtual T GetProperty() where T : class { IChannelFactory factory = this.channelManager as IChannelFactory; if (factory != null) { return factory.GetProperty (); } IChannelListener listener = this.channelManager as IChannelListener; if (listener != null) { return listener.GetProperty (); } return null; } protected override void OnClosed() { base.OnClosed(); if (DiagnosticUtility.ShouldTraceVerbose) { DiagnosticUtility.DiagnosticTrace.TraceEvent(TraceEventType.Verbose, TraceCode.ChannelDisposed, SR.GetString(SR.TraceCodeChannelDisposed, DiagnosticTrace.CreateSourceString(this)), null, null, this); } } } } // 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
- HtmlElementErrorEventArgs.cs
- HtmlEmptyTagControlBuilder.cs
- NameValuePair.cs
- DataErrorValidationRule.cs
- String.cs
- DataTablePropertyDescriptor.cs
- FontStyle.cs
- AnimationClockResource.cs
- DesignerActionPanel.cs
- BuildProvider.cs
- ColumnWidthChangingEvent.cs
- WebSysDescriptionAttribute.cs
- InlinedAggregationOperator.cs
- XmlUrlResolver.cs
- DecimalAverageAggregationOperator.cs
- MailFileEditor.cs
- DataServiceSaveChangesEventArgs.cs
- CharUnicodeInfo.cs
- Material.cs
- ProfileModule.cs
- MembershipValidatePasswordEventArgs.cs
- PerformanceCounterManager.cs
- ColorConvertedBitmapExtension.cs
- DiscreteKeyFrames.cs
- PreloadedPackages.cs
- RequestCachePolicyConverter.cs
- DoubleAnimationBase.cs
- ScaleTransform3D.cs
- RenderOptions.cs
- Proxy.cs
- TextRangeEditLists.cs
- BitmapEffectCollection.cs
- TokenBasedSetEnumerator.cs
- SubMenuStyle.cs
- SourceFileBuildProvider.cs
- XPathPatternParser.cs
- ConnectorEditor.cs
- ListViewTableCell.cs
- PageHandlerFactory.cs
- FlagsAttribute.cs
- OrderedDictionary.cs
- ACL.cs
- MobileControlsSectionHandler.cs
- GroupBoxRenderer.cs
- FontFamilyIdentifier.cs
- LOSFormatter.cs
- StreamBodyWriter.cs
- RectangleGeometry.cs
- MenuCommand.cs
- CodeIdentifiers.cs
- DesignerSerializerAttribute.cs
- ThrowHelper.cs
- Single.cs
- CodeParameterDeclarationExpressionCollection.cs
- FlowDocumentPageViewerAutomationPeer.cs
- OverloadGroupAttribute.cs
- TreeNode.cs
- SmtpNetworkElement.cs
- AttachmentCollection.cs
- ActivityTypeResolver.xaml.cs
- IconHelper.cs
- Trace.cs
- TrackingProfileCache.cs
- CookieParameter.cs
- BaseTemplateCodeDomTreeGenerator.cs
- OletxDependentTransaction.cs
- UIElementAutomationPeer.cs
- TextRangeBase.cs
- ScriptDescriptor.cs
- UTF8Encoding.cs
- SHA1CryptoServiceProvider.cs
- TextReader.cs
- NetMsmqBinding.cs
- BitmapSourceSafeMILHandle.cs
- Simplifier.cs
- RectangleHotSpot.cs
- xmlglyphRunInfo.cs
- SHA384Managed.cs
- GetUserPreferenceRequest.cs
- CommandEventArgs.cs
- StorageAssociationTypeMapping.cs
- NullableDecimalAverageAggregationOperator.cs
- NetworkInformationPermission.cs
- TextFormatterHost.cs
- NullableDoubleAverageAggregationOperator.cs
- ToolStripDropDownClosingEventArgs.cs
- RuleCache.cs
- FormViewUpdatedEventArgs.cs
- ContentHostHelper.cs
- SchemaNamespaceManager.cs
- ChangeTracker.cs
- SqlExpander.cs
- Binding.cs
- ToolStripDropDown.cs
- Assert.cs
- WebHeaderCollection.cs
- LayoutInformation.cs
- MimeObjectFactory.cs
- UnicodeEncoding.cs
- KeyInterop.cs