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
- StickyNoteAnnotations.cs
- TemplateColumn.cs
- ArraySubsetEnumerator.cs
- xsdvalidator.cs
- Converter.cs
- CodeEntryPointMethod.cs
- loginstatus.cs
- CodeExporter.cs
- RequestStatusBarUpdateEventArgs.cs
- Vars.cs
- HtmlShim.cs
- HtmlElement.cs
- PLINQETWProvider.cs
- XmlEncodedRawTextWriter.cs
- ToolStripContentPanel.cs
- TypedDataSetSchemaImporterExtensionFx35.cs
- SoundPlayer.cs
- KeyboardNavigation.cs
- TriggerBase.cs
- CommandField.cs
- Helper.cs
- DesignerAttribute.cs
- ObjectSet.cs
- DataGridViewCellMouseEventArgs.cs
- ParameterCollection.cs
- FontEmbeddingManager.cs
- ColumnReorderedEventArgs.cs
- FrameworkContentElement.cs
- GroupByExpressionRewriter.cs
- Cursor.cs
- AttachedPropertyDescriptor.cs
- MultiBindingExpression.cs
- MsmqReceiveParameters.cs
- CapabilitiesPattern.cs
- WebBrowsableAttribute.cs
- WindowsTitleBar.cs
- ScriptIgnoreAttribute.cs
- ProvidePropertyAttribute.cs
- FixedDocument.cs
- LayoutDump.cs
- BmpBitmapEncoder.cs
- RemotingServices.cs
- RectAnimationUsingKeyFrames.cs
- EntityDataSourceEntitySetNameItem.cs
- TextOutput.cs
- TimeSpanValidatorAttribute.cs
- SapiGrammar.cs
- PreservationFileReader.cs
- Profiler.cs
- AuthenticationModuleElementCollection.cs
- APCustomTypeDescriptor.cs
- PassportPrincipal.cs
- MemberPathMap.cs
- TypeDependencyAttribute.cs
- TreeView.cs
- UidPropertyAttribute.cs
- iisPickupDirectory.cs
- XmlEnumAttribute.cs
- HttpPostedFile.cs
- entityreference_tresulttype.cs
- XmlCodeExporter.cs
- ContextDataSourceContextData.cs
- BitmapEffect.cs
- DataServiceException.cs
- SHA1CryptoServiceProvider.cs
- PopupEventArgs.cs
- DbMetaDataColumnNames.cs
- FormatVersion.cs
- Sql8ConformanceChecker.cs
- SoapServerProtocol.cs
- UserNamePasswordServiceCredential.cs
- CuspData.cs
- RoleGroupCollection.cs
- ExpandedWrapper.cs
- AutomationPropertyInfo.cs
- QueryCacheKey.cs
- DynamicVirtualDiscoSearcher.cs
- CqlParser.cs
- CheckPair.cs
- BaseDataListActionList.cs
- XmlNodeReader.cs
- CatalogPart.cs
- XMLUtil.cs
- Binding.cs
- PropertyInfoSet.cs
- WorkflowClientDeliverMessageWrapper.cs
- TemplateBamlTreeBuilder.cs
- DefaultSection.cs
- ErrorFormatterPage.cs
- GatewayDefinition.cs
- ObjectItemAssemblyLoader.cs
- MetadataUtilsSmi.cs
- TabControlToolboxItem.cs
- DataPagerField.cs
- StrokeCollectionDefaultValueFactory.cs
- ObjectIDGenerator.cs
- BuildProvider.cs
- OracleCommand.cs
- PolicyChain.cs
- EndpointInfoCollection.cs