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
- TreeView.cs
- PrintingPermission.cs
- Transform3DGroup.cs
- ObjectCacheSettings.cs
- PrintPageEvent.cs
- BaseCodeDomTreeGenerator.cs
- MarkupCompilePass2.cs
- HatchBrush.cs
- NotifyInputEventArgs.cs
- RegexStringValidatorAttribute.cs
- HashMembershipCondition.cs
- DataTableMappingCollection.cs
- StringReader.cs
- TextFindEngine.cs
- SingleAnimation.cs
- BitmapEffectrendercontext.cs
- HelpKeywordAttribute.cs
- BooleanSwitch.cs
- LinkUtilities.cs
- ModelService.cs
- ToolStripManager.cs
- DetailsViewPagerRow.cs
- sqlpipe.cs
- RC2.cs
- RuntimeIdentifierPropertyAttribute.cs
- RtfToXamlLexer.cs
- AuthStoreRoleProvider.cs
- DependencyObject.cs
- SchemaTypeEmitter.cs
- ToolbarAUtomationPeer.cs
- XPathNode.cs
- XmlReader.cs
- TableSectionStyle.cs
- wgx_exports.cs
- FamilyMapCollection.cs
- XmlNamespaceManager.cs
- TreeBuilderBamlTranslator.cs
- Grid.cs
- RNGCryptoServiceProvider.cs
- QilGenerator.cs
- SignatureDescription.cs
- StyleBamlRecordReader.cs
- EdmError.cs
- DataTableNewRowEvent.cs
- dataprotectionpermissionattribute.cs
- PageTheme.cs
- CompilerResults.cs
- NetworkAddressChange.cs
- StorageModelBuildProvider.cs
- DiagnosticEventProvider.cs
- ChangeBlockUndoRecord.cs
- ConfigurationManagerHelperFactory.cs
- DeploymentSection.cs
- SocketException.cs
- MeshGeometry3D.cs
- DbModificationCommandTree.cs
- HealthMonitoringSectionHelper.cs
- GroupBoxRenderer.cs
- StringUtil.cs
- FaultFormatter.cs
- FontStyle.cs
- SQLUtility.cs
- FileDialog_Vista.cs
- BitmapEffectGeneralTransform.cs
- UnsafeNativeMethods.cs
- ErrorEventArgs.cs
- sqlser.cs
- ZipIOExtraFieldPaddingElement.cs
- OrderedDictionary.cs
- MarkupExtensionParser.cs
- ErrorHandlerModule.cs
- CaseKeyBox.xaml.cs
- SqlReorderer.cs
- ObjectPersistData.cs
- FormView.cs
- ToolStripScrollButton.cs
- InvalidOleVariantTypeException.cs
- BindingExpression.cs
- SubMenuStyleCollection.cs
- TextMarkerSource.cs
- X509ThumbprintKeyIdentifierClause.cs
- ProfileManager.cs
- LocationSectionRecord.cs
- DesignerOptions.cs
- ColorConvertedBitmap.cs
- TextTrailingWordEllipsis.cs
- FunctionNode.cs
- Operators.cs
- ProxyBuilder.cs
- ServiceModelConfigurationSectionCollection.cs
- CreateUserErrorEventArgs.cs
- MultipartIdentifier.cs
- RuleInfoComparer.cs
- Asn1IntegerConverter.cs
- EditorPartChrome.cs
- SystemUnicastIPAddressInformation.cs
- CalendarDateChangedEventArgs.cs
- HiddenFieldPageStatePersister.cs
- ProcessHostServerConfig.cs
- XmlValueConverter.cs