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
- Model3D.cs
- XPathNodeHelper.cs
- EntityParameter.cs
- IgnoreSectionHandler.cs
- PageDeviceFont.cs
- StyleCollection.cs
- MouseDevice.cs
- Assert.cs
- ScriptHandlerFactory.cs
- Stream.cs
- VisualTreeHelper.cs
- StaticSiteMapProvider.cs
- PropertyGridView.cs
- SoapFault.cs
- DataContract.cs
- SkinBuilder.cs
- ValueUtilsSmi.cs
- FixedTextSelectionProcessor.cs
- UpdateException.cs
- InvokeMethodActivity.cs
- RoleService.cs
- LinkedList.cs
- SafeNativeMethods.cs
- Permission.cs
- HttpResponseHeader.cs
- Path.cs
- FieldBuilder.cs
- XmlBinaryReader.cs
- FrameworkContentElementAutomationPeer.cs
- IDReferencePropertyAttribute.cs
- TypeSystemProvider.cs
- DockAndAnchorLayout.cs
- MissingFieldException.cs
- Brush.cs
- RNGCryptoServiceProvider.cs
- DiffuseMaterial.cs
- ListManagerBindingsCollection.cs
- KeyNameIdentifierClause.cs
- TextDecoration.cs
- WbemException.cs
- AsynchronousChannel.cs
- Parallel.cs
- MethodExpr.cs
- CqlBlock.cs
- ScalarConstant.cs
- IdnElement.cs
- ScriptServiceAttribute.cs
- FrameworkTemplate.cs
- XhtmlBasicCommandAdapter.cs
- TableFieldsEditor.cs
- __Filters.cs
- ToolStripRenderEventArgs.cs
- DesignerSelectionListAdapter.cs
- EndpointDesigner.cs
- MemberExpression.cs
- RepeaterItem.cs
- SafeRightsManagementSessionHandle.cs
- RectConverter.cs
- NamespaceInfo.cs
- OpenTypeLayoutCache.cs
- LazyTextWriterCreator.cs
- LinqDataSourceHelper.cs
- WindowsEditBox.cs
- XmlRootAttribute.cs
- DataServices.cs
- DataControlButton.cs
- CompilationRelaxations.cs
- CheckBoxBaseAdapter.cs
- BitmapPalettes.cs
- messageonlyhwndwrapper.cs
- DiagnosticsConfiguration.cs
- ReturnEventArgs.cs
- LabelTarget.cs
- SpeechEvent.cs
- NameValueSectionHandler.cs
- CurrencyManager.cs
- SharedDp.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- SimpleHandlerFactory.cs
- HierarchicalDataBoundControl.cs
- MSAANativeProvider.cs
- XmlDictionaryString.cs
- Int32Animation.cs
- SelectionItemProviderWrapper.cs
- AssemblyAttributesGoHere.cs
- SiteMapHierarchicalDataSourceView.cs
- BrowserCapabilitiesCompiler.cs
- FrameworkObject.cs
- XmlSchemaAll.cs
- ResourceType.cs
- MeasurementDCInfo.cs
- XmlMapping.cs
- MetadataPropertyvalue.cs
- SyndicationElementExtensionCollection.cs
- PointLightBase.cs
- DocumentViewer.cs
- DefaultMemberAttribute.cs
- Hash.cs
- DBDataPermissionAttribute.cs
- CrossContextChannel.cs