Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Channels / StreamSecurityUpgradeAcceptorBase.cs / 1 / StreamSecurityUpgradeAcceptorBase.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel.Channels { using System.IO; using System.ServiceModel.Security; abstract class StreamSecurityUpgradeAcceptorBase : StreamSecurityUpgradeAcceptor { SecurityMessageProperty remoteSecurity; bool securityUpgraded; string upgradeString; protected StreamSecurityUpgradeAcceptorBase(string upgradeString) { this.upgradeString = upgradeString; } public override Stream AcceptUpgrade(Stream stream) { if (stream == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("stream"); } Stream result = this.OnAcceptUpgrade(stream, out this.remoteSecurity); this.securityUpgraded = true; return result; } public override IAsyncResult BeginAcceptUpgrade(Stream stream, AsyncCallback callback, object state) { if (stream == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("stream"); } return this.OnBeginAcceptUpgrade(stream, callback, state); } public override bool CanUpgrade(string contentType) { if (this.securityUpgraded) { return false; } return (contentType == this.upgradeString); } public override Stream EndAcceptUpgrade(IAsyncResult result) { if (result == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("result"); } Stream retValue = this.OnEndAcceptUpgrade(result, out this.remoteSecurity); this.securityUpgraded = true; return retValue; } public override SecurityMessageProperty GetRemoteSecurity() { // this could be null if upgrade not completed. return this.remoteSecurity; } protected abstract Stream OnAcceptUpgrade(Stream stream, out SecurityMessageProperty remoteSecurity); protected abstract IAsyncResult OnBeginAcceptUpgrade(Stream stream, AsyncCallback callback, object state); protected abstract Stream OnEndAcceptUpgrade(IAsyncResult result, out SecurityMessageProperty remoteSecurity); } } // 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
- XsltContext.cs
- NavigationProperty.cs
- UIElement3DAutomationPeer.cs
- XmlSchemaComplexContent.cs
- PeerName.cs
- DataKey.cs
- EventArgs.cs
- SHA256Managed.cs
- ObjectView.cs
- Stylesheet.cs
- SafeNativeMethods.cs
- PrivilegedConfigurationManager.cs
- ConnectorDragDropGlyph.cs
- BasicExpressionVisitor.cs
- SelectionGlyph.cs
- ArglessEventHandlerProxy.cs
- TraceHandler.cs
- StylusCaptureWithinProperty.cs
- Win32.cs
- EntityTypeEmitter.cs
- RegexCharClass.cs
- SynchronizedDispatch.cs
- CommandHelper.cs
- VersionedStreamOwner.cs
- XmlAttributeCollection.cs
- CustomAttributeFormatException.cs
- BuildManager.cs
- ToolStripPanelSelectionGlyph.cs
- ConstraintStruct.cs
- ViewBase.cs
- ObjectFullSpanRewriter.cs
- FilteredSchemaElementLookUpTable.cs
- TextDecorationLocationValidation.cs
- SafeFileMappingHandle.cs
- ListItemParagraph.cs
- WrappedKeySecurityToken.cs
- XmlSerializerObjectSerializer.cs
- SafeHandles.cs
- WsatProxy.cs
- TransmissionStrategy.cs
- DataObjectCopyingEventArgs.cs
- _NegotiateClient.cs
- Label.cs
- ACE.cs
- Debugger.cs
- XmlAttributeCollection.cs
- FormClosedEvent.cs
- TypedRowHandler.cs
- HtmlString.cs
- Renderer.cs
- CompoundFileStorageReference.cs
- TracedNativeMethods.cs
- x509utils.cs
- CurrentChangingEventManager.cs
- ToolStripPanelRenderEventArgs.cs
- OpCodes.cs
- XmlSignatureManifest.cs
- xdrvalidator.cs
- NullNotAllowedCollection.cs
- OverrideMode.cs
- MediaTimeline.cs
- BitVec.cs
- _ConnectStream.cs
- SqlConnectionString.cs
- CompositionTarget.cs
- ClientSettingsProvider.cs
- sqlcontext.cs
- ToolbarAUtomationPeer.cs
- StringAnimationUsingKeyFrames.cs
- StreamBodyWriter.cs
- CryptoConfig.cs
- PathStreamGeometryContext.cs
- CTreeGenerator.cs
- TextRangeEditLists.cs
- shaper.cs
- ZipFileInfoCollection.cs
- AsyncResult.cs
- SymLanguageVendor.cs
- DataDocumentXPathNavigator.cs
- BaseTemplateCodeDomTreeGenerator.cs
- RegexCapture.cs
- UserNamePasswordValidationMode.cs
- DbInsertCommandTree.cs
- EvidenceBase.cs
- DebugManager.cs
- DPTypeDescriptorContext.cs
- ObjectNavigationPropertyMapping.cs
- ArgumentDesigner.xaml.cs
- DbConnectionPoolIdentity.cs
- XPathSelfQuery.cs
- NonClientArea.cs
- ListViewTableRow.cs
- PriorityQueue.cs
- ListViewInsertEventArgs.cs
- StyleCollection.cs
- ComPlusContractBehavior.cs
- JsonQNameDataContract.cs
- BlobPersonalizationState.cs
- ToggleButton.cs
- _OSSOCK.cs