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
- Solver.cs
- NaturalLanguageHyphenator.cs
- SecurityRuntime.cs
- DynamicPropertyReader.cs
- ParentUndoUnit.cs
- CodeAttachEventStatement.cs
- DispatcherHookEventArgs.cs
- HtmlLabelAdapter.cs
- PageRanges.cs
- GridViewRowEventArgs.cs
- ObjectPersistData.cs
- XamlDesignerSerializationManager.cs
- CodeTypeReferenceExpression.cs
- FixedSOMTextRun.cs
- SecurityMessageProperty.cs
- StateDesigner.cs
- Quaternion.cs
- EntityParameter.cs
- HttpAsyncResult.cs
- Assert.cs
- Base64WriteStateInfo.cs
- ListSurrogate.cs
- WindowCollection.cs
- DateTimeFormat.cs
- IxmlLineInfo.cs
- XPathItem.cs
- KnownBoxes.cs
- BasicViewGenerator.cs
- QueryAccessibilityHelpEvent.cs
- SQLMoneyStorage.cs
- BufferedGraphics.cs
- SmiConnection.cs
- SqlHelper.cs
- DependentList.cs
- UserControl.cs
- DomainLiteralReader.cs
- XmlUrlResolver.cs
- LocalizationParserHooks.cs
- GridPattern.cs
- DesignerCommandAdapter.cs
- MetadataPropertyAttribute.cs
- DesignerRegion.cs
- Calendar.cs
- DataGridColumnHeaderCollection.cs
- TextWriter.cs
- ModuleBuilderData.cs
- DataGridCaption.cs
- UnsignedPublishLicense.cs
- BrowserDefinition.cs
- login.cs
- LogEntryHeaderSerializer.cs
- CharacterHit.cs
- DuplicateWaitObjectException.cs
- uribuilder.cs
- XPathDocumentBuilder.cs
- SafeCryptHandles.cs
- CursorInteropHelper.cs
- UIAgentAsyncParams.cs
- WsdlBuildProvider.cs
- TaiwanLunisolarCalendar.cs
- TemplateInstanceAttribute.cs
- _CacheStreams.cs
- CellQuery.cs
- _SpnDictionary.cs
- WebSysDisplayNameAttribute.cs
- KeyNotFoundException.cs
- GeneralTransform3DCollection.cs
- BufferBuilder.cs
- AuthenticatingEventArgs.cs
- ListParaClient.cs
- XmlSchemaDatatype.cs
- XmlSerializerFactory.cs
- TagPrefixCollection.cs
- CodeFieldReferenceExpression.cs
- System.Data.OracleClient_BID.cs
- CaseStatementSlot.cs
- LabelAutomationPeer.cs
- XmlConverter.cs
- UpdatePanelTriggerCollection.cs
- HttpGetProtocolReflector.cs
- ETagAttribute.cs
- MetadataConversionError.cs
- GuidConverter.cs
- QueryOpeningEnumerator.cs
- VirtualizingStackPanel.cs
- _ConnectStream.cs
- RegexFCD.cs
- PerformanceCounterManager.cs
- Walker.cs
- InsufficientMemoryException.cs
- TargetParameterCountException.cs
- PropertyGrid.cs
- CategoryValueConverter.cs
- DispatcherHooks.cs
- BooleanStorage.cs
- WinInet.cs
- GlyphRun.cs
- DataGridViewTextBoxEditingControl.cs
- ToolStripStatusLabel.cs
- EventTrigger.cs