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
- SecuritySessionServerSettings.cs
- OrderedDictionary.cs
- MultiPageTextView.cs
- GorillaCodec.cs
- XamlPathDataSerializer.cs
- SeverityFilter.cs
- BindingValueChangedEventArgs.cs
- streamingZipPartStream.cs
- DropTarget.cs
- NamespaceInfo.cs
- ImageKeyConverter.cs
- MemberDomainMap.cs
- StorageEntitySetMapping.cs
- HttpCookieCollection.cs
- PolicyManager.cs
- ListViewItemMouseHoverEvent.cs
- MultipartIdentifier.cs
- DataSetMappper.cs
- TableAdapterManagerNameHandler.cs
- ToolBarTray.cs
- PropertyMap.cs
- Application.cs
- RequestBringIntoViewEventArgs.cs
- DataGridViewSelectedCellCollection.cs
- ClientRequest.cs
- Stroke2.cs
- MetadataCollection.cs
- ZipFileInfoCollection.cs
- AuthenticationServiceManager.cs
- HttpCachePolicyElement.cs
- DnsEndPoint.cs
- SqlSelectStatement.cs
- TemplateModeChangedEventArgs.cs
- EmissiveMaterial.cs
- RegexCaptureCollection.cs
- DataComponentNameHandler.cs
- QuadraticBezierSegment.cs
- ConfigurationPropertyAttribute.cs
- CodeIndexerExpression.cs
- SequentialWorkflowRootDesigner.cs
- OutputCacheSection.cs
- AttributeEmitter.cs
- wgx_render.cs
- ForwardPositionQuery.cs
- RIPEMD160Managed.cs
- DataListItemEventArgs.cs
- MouseBinding.cs
- WebResourceAttribute.cs
- LateBoundBitmapDecoder.cs
- StorageMappingItemCollection.cs
- CancellationState.cs
- UnmanagedMemoryStreamWrapper.cs
- loginstatus.cs
- NumericUpDown.cs
- CryptoApi.cs
- NativeMethods.cs
- x509store.cs
- HandleRef.cs
- CompoundFileStreamReference.cs
- NetNamedPipeBinding.cs
- ToolStripButton.cs
- DbDataSourceEnumerator.cs
- EventManager.cs
- SafeThemeHandle.cs
- MetadataHelper.cs
- ObjectSecurity.cs
- TextContainerChangedEventArgs.cs
- DataKeyArray.cs
- CFGGrammar.cs
- StreamWithDictionary.cs
- ColumnPropertiesGroup.cs
- UserNamePasswordValidator.cs
- WebPartCollection.cs
- BamlStream.cs
- ScaleTransform3D.cs
- IsolatedStoragePermission.cs
- PagerSettings.cs
- HotSpotCollection.cs
- BrowserCapabilitiesCompiler.cs
- DeploymentSectionCache.cs
- InlineObject.cs
- IsolatedStorageException.cs
- BaseResourcesBuildProvider.cs
- HtmlInputText.cs
- CellTreeNode.cs
- AuthenticationModuleElementCollection.cs
- MergeEnumerator.cs
- XPathParser.cs
- EntityDataSourceWrapperPropertyDescriptor.cs
- FileStream.cs
- IisTraceListener.cs
- _Win32.cs
- EnvironmentPermission.cs
- ComAdminWrapper.cs
- EntityDataSourceWrapperPropertyDescriptor.cs
- ContractsBCL.cs
- DragDrop.cs
- HttpProtocolImporter.cs
- XmlArrayItemAttributes.cs
- METAHEADER.cs