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
- TypeResolver.cs
- LoginView.cs
- CustomAttributeSerializer.cs
- Rect3D.cs
- XmlSchemaNotation.cs
- DropSourceBehavior.cs
- ConfigurationLocationCollection.cs
- ScrollBar.cs
- X509UI.cs
- AppModelKnownContentFactory.cs
- DynamicDataManager.cs
- AssemblyContextControlItem.cs
- NamedPipeProcessProtocolHandler.cs
- CodeMemberMethod.cs
- BrowserDefinition.cs
- Switch.cs
- CapabilitiesRule.cs
- SapiRecognizer.cs
- Identifier.cs
- BinHexEncoder.cs
- StrongName.cs
- WindowsToolbar.cs
- Misc.cs
- ApplicationFileParser.cs
- ScriptControlDescriptor.cs
- TextParentUndoUnit.cs
- mda.cs
- HttpProfileGroupBase.cs
- StateFinalizationDesigner.cs
- FrameworkElement.cs
- SaveFileDialog.cs
- XmlNotation.cs
- AssociationEndMember.cs
- SevenBitStream.cs
- ScriptingProfileServiceSection.cs
- MemberInfoSerializationHolder.cs
- commandenforcer.cs
- TransportationConfigurationTypeInstallComponent.cs
- cookiecontainer.cs
- HtmlTextViewAdapter.cs
- ClrPerspective.cs
- PropertyEmitterBase.cs
- NavigateEvent.cs
- ErrorEventArgs.cs
- OutOfMemoryException.cs
- GroupBoxAutomationPeer.cs
- MemberProjectionIndex.cs
- UntrustedRecipientException.cs
- WindowsFormsDesignerOptionService.cs
- OrderedParallelQuery.cs
- PixelFormat.cs
- CharAnimationBase.cs
- TimeSpanValidator.cs
- SelectionWordBreaker.cs
- EncoderBestFitFallback.cs
- SqlFlattener.cs
- DbConnectionStringBuilder.cs
- NullableDecimalMinMaxAggregationOperator.cs
- DataBoundControl.cs
- TripleDESCryptoServiceProvider.cs
- TypeElement.cs
- HierarchicalDataBoundControl.cs
- RuleSettings.cs
- DispatchWrapper.cs
- PersistChildrenAttribute.cs
- ZipIOLocalFileHeader.cs
- DataReaderContainer.cs
- Highlights.cs
- FieldToken.cs
- TransactionScope.cs
- UpdateEventArgs.cs
- UnsafeNativeMethods.cs
- TimeSpanValidatorAttribute.cs
- HandleCollector.cs
- AutomationElement.cs
- Cursor.cs
- CodeComment.cs
- DataTableReaderListener.cs
- GridItem.cs
- WebPartConnectVerb.cs
- StructuralType.cs
- PriorityQueue.cs
- FieldTemplateUserControl.cs
- Stopwatch.cs
- AllowedAudienceUriElement.cs
- ValueHandle.cs
- WaitForChangedResult.cs
- XmlElementAttribute.cs
- BaseDataListPage.cs
- WebMessageBodyStyleHelper.cs
- XmlExtensionFunction.cs
- TextBoxBaseDesigner.cs
- BoolLiteral.cs
- DrawingBrush.cs
- WindowsPrincipal.cs
- DateTimeOffsetAdapter.cs
- CheckBox.cs
- HttpVersion.cs
- XmlCharCheckingWriter.cs
- DigitalSignature.cs