This documentation is archived and is not being maintained.

StreamingContext Structure

Describes the source and destination of a given serialized stream, and provides an additional caller-defined context.

Namespace:  System.Runtime.Serialization
Assembly:  mscorlib (in mscorlib.dll)

[<Sealed>]
[<SerializableAttribute>]
[<ComVisibleAttribute(true)>]
type StreamingContext =  struct end

The StreamingContext type exposes the following members.

  NameDescription
Public methodStreamingContext(StreamingContextStates)Initializes a new instance of the StreamingContext class with a given context state.
Public methodStreamingContext(StreamingContextStates, Object)Initializes a new instance of the StreamingContext class with a given context state, and some additional information.
Top

  NameDescription
Public propertyContextGets context specified as part of the additional context.
Public propertyStateGets the source or destination of the transmitted data.
Top

  NameDescription
Public methodEqualsDetermines whether two StreamingContext instances contain the same values. (Overrides ValueType.Equals(Object).)
Protected methodSupported by Portable Class LibraryFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeReturns a hash code of this object. (Overrides ValueType.GetHashCode().)
Public methodSupported by Portable Class LibraryGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodSupported by Portable Class LibraryMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns the fully qualified type name of this instance. (Inherited from ValueType.)
Top

Indicates the source or destination of the bits that the formatter uses. Classes with surrogates or that implement ISerializable can serialize or ignore fields and values based on the information stored in the streaming context. For example, a window handle is still valid if the State property is set to System.Runtime.Serialization.StreamingContextStates.CrossProcess.

The following code example demonstrates the StreamingContext structure.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show: