Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Security / WrapperSecurityCommunicationObject.cs / 1 / WrapperSecurityCommunicationObject.cs
//---------------------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------------------- namespace System.ServiceModel.Security { using System.ServiceModel.Channels; using System.ServiceModel; using System.ServiceModel.Diagnostics; using System.IdentityModel.Selectors; class WrapperSecurityCommunicationObject : CommunicationObject { ISecurityCommunicationObject innerCommunicationObject; public WrapperSecurityCommunicationObject(ISecurityCommunicationObject innerCommunicationObject) : base() { if (innerCommunicationObject == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("innerCommunicationObject"); } this.innerCommunicationObject = innerCommunicationObject; } protected override Type GetCommunicationObjectType() { return this.innerCommunicationObject.GetType(); } protected override TimeSpan DefaultCloseTimeout { get { return this.innerCommunicationObject.DefaultCloseTimeout; } } protected override TimeSpan DefaultOpenTimeout { get { return this.innerCommunicationObject.DefaultOpenTimeout; } } protected override void OnAbort() { this.innerCommunicationObject.OnAbort(); } protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) { return this.innerCommunicationObject.OnBeginClose(timeout, callback, state); } protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) { return this.innerCommunicationObject.OnBeginOpen(timeout, callback, state); } protected override void OnClose(TimeSpan timeout) { this.innerCommunicationObject.OnClose(timeout); } protected override void OnClosed() { this.innerCommunicationObject.OnClosed(); base.OnClosed(); } protected override void OnClosing() { this.innerCommunicationObject.OnClosing(); base.OnClosing(); } protected override void OnEndClose(IAsyncResult result) { this.innerCommunicationObject.OnEndClose(result); } protected override void OnEndOpen(IAsyncResult result) { this.innerCommunicationObject.OnEndOpen(result); } protected override void OnFaulted() { this.innerCommunicationObject.OnFaulted(); base.OnFaulted(); } protected override void OnOpen(TimeSpan timeout) { this.innerCommunicationObject.OnOpen(timeout); } protected override void OnOpened() { this.innerCommunicationObject.OnOpened(); base.OnOpened(); } protected override void OnOpening() { this.innerCommunicationObject.OnOpening(); base.OnOpening(); } new internal void ThrowIfDisposedOrImmutable() { base.ThrowIfDisposedOrImmutable(); } } abstract class CommunicationObjectSecurityTokenProvider : SecurityTokenProvider, ICommunicationObject, ISecurityCommunicationObject { WrapperSecurityCommunicationObject communicationObject; protected CommunicationObjectSecurityTokenProvider() { communicationObject = new WrapperSecurityCommunicationObject(this); } protected WrapperSecurityCommunicationObject CommunicationObject { get { return this.communicationObject; } } public event EventHandler Closed { add { this.communicationObject.Closed += value; } remove { this.communicationObject.Closed -= value; } } public event EventHandler Closing { add { this.communicationObject.Closing += value; } remove { this.communicationObject.Closing -= value; } } public event EventHandler Faulted { add { this.communicationObject.Faulted += value; } remove { this.communicationObject.Faulted -= value; } } public event EventHandler Opened { add { this.communicationObject.Opened += value; } remove { this.communicationObject.Opened -= value; } } public event EventHandler Opening { add { this.communicationObject.Opening += value; } remove { this.communicationObject.Opening -= value; } } public CommunicationState State { get { return this.communicationObject.State; } } public virtual TimeSpan DefaultOpenTimeout { get { return ServiceDefaults.OpenTimeout; } } public virtual TimeSpan DefaultCloseTimeout { get { return ServiceDefaults.CloseTimeout; } } // communication object public void Abort() { this.communicationObject.Abort(); } public void Close() { this.communicationObject.Close(); } public void Close(TimeSpan timeout) { this.communicationObject.Close(timeout); } public IAsyncResult BeginClose(AsyncCallback callback, object state) { return this.communicationObject.BeginClose(callback, state); } public IAsyncResult BeginClose(TimeSpan timeout, AsyncCallback callback, object state) { return this.communicationObject.BeginClose(timeout, callback, state); } public void EndClose(IAsyncResult result) { this.communicationObject.EndClose(result); } public void Open() { this.communicationObject.Open(); } public void Open(TimeSpan timeout) { this.communicationObject.Open(timeout); } public IAsyncResult BeginOpen(AsyncCallback callback, object state) { return this.communicationObject.BeginOpen(callback, state); } public IAsyncResult BeginOpen(TimeSpan timeout, AsyncCallback callback, object state) { return this.communicationObject.BeginOpen(timeout, callback, state); } public void EndOpen(IAsyncResult result) { this.communicationObject.EndOpen(result); } public void Dispose() { this.Close(); } // ISecurityCommunicationObject methods public virtual void OnAbort() { } public IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) { return new OperationWithTimeoutAsyncResult(new OperationWithTimeoutCallback(this.OnClose), timeout, callback, state); } public IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) { return new OperationWithTimeoutAsyncResult(new OperationWithTimeoutCallback(this.OnOpen), timeout, callback, state); } public virtual void OnClose(TimeSpan timeout) { } public virtual void OnClosed() { SecurityTraceRecordHelper.TraceTokenProviderClosed(this); } public virtual void OnClosing() { } public void OnEndClose(IAsyncResult result) { OperationWithTimeoutAsyncResult.End(result); } public void OnEndOpen(IAsyncResult result) { OperationWithTimeoutAsyncResult.End(result); } public virtual void OnFaulted() { this.OnAbort(); } public virtual void OnOpen(TimeSpan timeout) { } public virtual void OnOpened() { SecurityTraceRecordHelper.TraceTokenProviderOpened(this); } public virtual void OnOpening() { } } abstract class CommunicationObjectSecurityTokenAuthenticator : SecurityTokenAuthenticator, ICommunicationObject, ISecurityCommunicationObject { WrapperSecurityCommunicationObject communicationObject; protected CommunicationObjectSecurityTokenAuthenticator() { communicationObject = new WrapperSecurityCommunicationObject(this); } protected WrapperSecurityCommunicationObject CommunicationObject { get { return this.communicationObject; } } public event EventHandler Closed { add { this.communicationObject.Closed += value; } remove { this.communicationObject.Closed -= value; } } public event EventHandler Closing { add { this.communicationObject.Closing += value; } remove { this.communicationObject.Closing -= value; } } public event EventHandler Faulted { add { this.communicationObject.Faulted += value; } remove { this.communicationObject.Faulted -= value; } } public event EventHandler Opened { add { this.communicationObject.Opened += value; } remove { this.communicationObject.Opened -= value; } } public event EventHandler Opening { add { this.communicationObject.Opening += value; } remove { this.communicationObject.Opening -= value; } } public CommunicationState State { get { return this.communicationObject.State; } } public virtual TimeSpan DefaultOpenTimeout { get { return ServiceDefaults.OpenTimeout; } } public virtual TimeSpan DefaultCloseTimeout { get { return ServiceDefaults.CloseTimeout; } } // communication object public void Abort() { this.communicationObject.Abort(); } public void Close() { this.communicationObject.Close(); } public void Close(TimeSpan timeout) { this.communicationObject.Close(timeout); } public IAsyncResult BeginClose(AsyncCallback callback, object state) { return this.communicationObject.BeginClose(callback, state); } public IAsyncResult BeginClose(TimeSpan timeout, AsyncCallback callback, object state) { return this.communicationObject.BeginClose(timeout, callback, state); } public void EndClose(IAsyncResult result) { this.communicationObject.EndClose(result); } public void Open() { this.communicationObject.Open(); } public void Open(TimeSpan timeout) { this.communicationObject.Open(timeout); } public IAsyncResult BeginOpen(AsyncCallback callback, object state) { return this.communicationObject.BeginOpen(callback, state); } public IAsyncResult BeginOpen(TimeSpan timeout, AsyncCallback callback, object state) { return this.communicationObject.BeginOpen(timeout, callback, state); } public void EndOpen(IAsyncResult result) { this.communicationObject.EndOpen(result); } public void Dispose() { this.Close(); } // ISecurityCommunicationObject methods public virtual void OnAbort() { } public IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) { return new OperationWithTimeoutAsyncResult(new OperationWithTimeoutCallback(this.OnClose), timeout, callback, state); } public IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) { return new OperationWithTimeoutAsyncResult(new OperationWithTimeoutCallback(this.OnOpen), timeout, callback, state); } public virtual void OnClose(TimeSpan timeout) { } public virtual void OnClosed() { SecurityTraceRecordHelper.TraceTokenAuthenticatorClosed(this); } public virtual void OnClosing() { } public void OnEndClose(IAsyncResult result) { OperationWithTimeoutAsyncResult.End(result); } public void OnEndOpen(IAsyncResult result) { OperationWithTimeoutAsyncResult.End(result); } public virtual void OnFaulted() { this.OnAbort(); } public virtual void OnOpen(TimeSpan timeout) { } public virtual void OnOpened() { SecurityTraceRecordHelper.TraceTokenAuthenticatorOpened(this); } public virtual void OnOpening() { } } } // 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
- FunctionParameter.cs
- EntityProviderFactory.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- NavigationPropertyAccessor.cs
- SocketException.cs
- SemaphoreSecurity.cs
- ActivationArguments.cs
- DataSourceCollectionBase.cs
- UpdatePanelControlTrigger.cs
- RemoteArgument.cs
- WebPartsPersonalization.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- NullableLongAverageAggregationOperator.cs
- FormViewAutoFormat.cs
- ComAwareEventInfo.cs
- TdsParameterSetter.cs
- ClientRuntime.cs
- AssociationProvider.cs
- ECDiffieHellman.cs
- TextUtf8RawTextWriter.cs
- MultiAsyncResult.cs
- EncoderParameter.cs
- CustomErrorCollection.cs
- HelpEvent.cs
- tibetanshape.cs
- SQLSingleStorage.cs
- util.cs
- ImpersonateTokenRef.cs
- webbrowsersite.cs
- FacetDescription.cs
- InstanceDescriptor.cs
- ByteAnimation.cs
- WsatServiceAddress.cs
- PrefixHandle.cs
- DefaultValueConverter.cs
- TypeElement.cs
- XComponentModel.cs
- DeviceSpecificChoiceCollection.cs
- RefreshPropertiesAttribute.cs
- DescendentsWalkerBase.cs
- TextEditor.cs
- XmlTypeAttribute.cs
- Axis.cs
- CustomLineCap.cs
- DateTimeOffsetStorage.cs
- BamlResourceSerializer.cs
- ExceptionWrapper.cs
- Types.cs
- FileFormatException.cs
- VoiceSynthesis.cs
- ViewStateChangedEventArgs.cs
- Rotation3D.cs
- wgx_exports.cs
- ImpersonationContext.cs
- SystemIPInterfaceProperties.cs
- EncryptedKeyHashIdentifierClause.cs
- ExceptionAggregator.cs
- RuntimeEnvironment.cs
- WebPartCatalogAddVerb.cs
- MetafileHeader.cs
- BinaryFormatterWriter.cs
- EmbeddedMailObject.cs
- MimeTypeMapper.cs
- Graph.cs
- StaticExtension.cs
- SessionIDManager.cs
- QueryCacheManager.cs
- WorkflowItemsPresenter.cs
- ConsoleCancelEventArgs.cs
- DesignerAttribute.cs
- CodeCastExpression.cs
- ValidationRuleCollection.cs
- ScrollBar.cs
- ErrorCodes.cs
- ImageMetadata.cs
- XmlProcessingInstruction.cs
- ClientRolePrincipal.cs
- Base64Decoder.cs
- MemberMaps.cs
- ApplicationGesture.cs
- FixedHighlight.cs
- MSHTMLHost.cs
- UnmanagedMemoryStream.cs
- SymbolEqualComparer.cs
- ByteKeyFrameCollection.cs
- DictionaryTraceRecord.cs
- ManagedCodeMarkers.cs
- SqlDataSourceTableQuery.cs
- QueryStringParameter.cs
- PersonalizationProviderCollection.cs
- CheckBoxField.cs
- MatrixValueSerializer.cs
- PtsCache.cs
- UserPreferenceChangedEventArgs.cs
- DefaultSerializationProviderAttribute.cs
- Block.cs
- HighlightComponent.cs
- SchemaInfo.cs
- BaseParser.cs
- TextTreeInsertElementUndoUnit.cs