Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / SecureProtocols / AuthenticatedStream.cs / 1305376 / AuthenticatedStream.cs
/*++ Copyright (c) 2003 Microsoft Corporation Module Name: AuthenticatedStream.cs Abstract: A public contact for a base abstract authenticated stream. Author: Alexei Vopilov Sept 28-2003 Revision History: --*/ namespace System.Net.Security { using System; using System.IO; using System.Threading; using System.Security.Permissions; using System.Security.Principal; public abstract class AuthenticatedStream: Stream { private Stream _InnerStream; private bool _LeaveStreamOpen; protected AuthenticatedStream(Stream innerStream, bool leaveInnerStreamOpen) { if (innerStream == null || innerStream == Stream.Null) { throw new ArgumentNullException("innerStream"); } if (!innerStream.CanRead || !innerStream.CanWrite) { throw new ArgumentException(SR.GetString(SR.net_io_must_be_rw_stream), "innerStream"); } _InnerStream = innerStream; _LeaveStreamOpen = leaveInnerStreamOpen; } public bool LeaveInnerStreamOpen { get { return _LeaveStreamOpen; } } // // protected Stream InnerStream { get { return _InnerStream; } } // // protected override void Dispose(bool disposing) { #if DEBUG using (GlobalLog.SetThreadKind(ThreadKinds.User)) { #endif try { if (disposing) { if (_LeaveStreamOpen) { _InnerStream.Flush(); } else { _InnerStream.Close(); } } } finally { base.Dispose(disposing); } #if DEBUG } #endif } // // General informational properties // public abstract bool IsAuthenticated {get;} public abstract bool IsMutuallyAuthenticated {get;} public abstract bool IsEncrypted {get;} public abstract bool IsSigned {get;} public abstract bool IsServer {get;} } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. /*++ Copyright (c) 2003 Microsoft Corporation Module Name: AuthenticatedStream.cs Abstract: A public contact for a base abstract authenticated stream. Author: Alexei Vopilov Sept 28-2003 Revision History: --*/ namespace System.Net.Security { using System; using System.IO; using System.Threading; using System.Security.Permissions; using System.Security.Principal; public abstract class AuthenticatedStream: Stream { private Stream _InnerStream; private bool _LeaveStreamOpen; protected AuthenticatedStream(Stream innerStream, bool leaveInnerStreamOpen) { if (innerStream == null || innerStream == Stream.Null) { throw new ArgumentNullException("innerStream"); } if (!innerStream.CanRead || !innerStream.CanWrite) { throw new ArgumentException(SR.GetString(SR.net_io_must_be_rw_stream), "innerStream"); } _InnerStream = innerStream; _LeaveStreamOpen = leaveInnerStreamOpen; } public bool LeaveInnerStreamOpen { get { return _LeaveStreamOpen; } } // // protected Stream InnerStream { get { return _InnerStream; } } // // protected override void Dispose(bool disposing) { #if DEBUG using (GlobalLog.SetThreadKind(ThreadKinds.User)) { #endif try { if (disposing) { if (_LeaveStreamOpen) { _InnerStream.Flush(); } else { _InnerStream.Close(); } } } finally { base.Dispose(disposing); } #if DEBUG } #endif } // // General informational properties // public abstract bool IsAuthenticated {get;} public abstract bool IsMutuallyAuthenticated {get;} public abstract bool IsEncrypted {get;} public abstract bool IsSigned {get;} public abstract bool IsServer {get;} } } // 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
- MemoryResponseElement.cs
- DuplicateWaitObjectException.cs
- PropertyKey.cs
- _NegoState.cs
- PlaceHolder.cs
- ScrollEvent.cs
- SecurityContext.cs
- IPCCacheManager.cs
- DependencyObjectPropertyDescriptor.cs
- View.cs
- TextTreeRootNode.cs
- ComponentEvent.cs
- PenLineJoinValidation.cs
- ObjectToken.cs
- AccessDataSourceDesigner.cs
- SqlError.cs
- webbrowsersite.cs
- StickyNoteHelper.cs
- FixedSOMTableCell.cs
- AuthenticatedStream.cs
- OdbcTransaction.cs
- SecurityDocument.cs
- XmlCustomFormatter.cs
- PropertyMapper.cs
- ActivityMetadata.cs
- DesignTable.cs
- TableRowGroup.cs
- DataGridColumn.cs
- MetadataProperty.cs
- MLangCodePageEncoding.cs
- XmlSchemaRedefine.cs
- GeneralTransformGroup.cs
- DiagnosticStrings.cs
- ProfileGroupSettingsCollection.cs
- GeneratedCodeAttribute.cs
- errorpatternmatcher.cs
- DataGridViewColumn.cs
- RowParagraph.cs
- XmlSchemaAnnotation.cs
- RadioButtonAutomationPeer.cs
- IPGlobalProperties.cs
- HighContrastHelper.cs
- ConnectionModeReader.cs
- DrawingContextWalker.cs
- ToolStripPanelCell.cs
- SmtpException.cs
- GroupBox.cs
- XPathQilFactory.cs
- DataServiceHostFactory.cs
- WebUtil.cs
- RelationshipType.cs
- XmlILTrace.cs
- DBDataPermissionAttribute.cs
- UrlAuthFailedErrorFormatter.cs
- SelectionListComponentEditor.cs
- EmptyEnumerable.cs
- DbTransaction.cs
- HotSpotCollectionEditor.cs
- PolyLineSegmentFigureLogic.cs
- WrappedReader.cs
- SqlSelectStatement.cs
- PerformanceCounterManager.cs
- CalendarItem.cs
- Parser.cs
- HostedElements.cs
- LinqDataSourceSelectEventArgs.cs
- SuppressIldasmAttribute.cs
- PermissionSetEnumerator.cs
- Stylus.cs
- DesignTimeData.cs
- FixedTextSelectionProcessor.cs
- DynamicPropertyHolder.cs
- Array.cs
- MappedMetaModel.cs
- RequestQueue.cs
- ProofTokenCryptoHandle.cs
- NativeMethods.cs
- WebPartConnectionsConfigureVerb.cs
- SHA512.cs
- FunctionImportMapping.cs
- DateTimeOffsetAdapter.cs
- SafeCryptoHandles.cs
- UriSection.cs
- CacheMemory.cs
- PeerToPeerException.cs
- WebPageTraceListener.cs
- TypeSource.cs
- ModelTreeEnumerator.cs
- ExceptionHelpers.cs
- ValidatingPropertiesEventArgs.cs
- FormatterServicesNoSerializableCheck.cs
- GeometryModel3D.cs
- SchemaExporter.cs
- HostingEnvironmentException.cs
- ToolTip.cs
- TemplatedWizardStep.cs
- PerformanceCounterCategory.cs
- ListDictionary.cs
- ProxyWebPartConnectionCollection.cs
- WebPartMinimizeVerb.cs