Export (0) Print
Expand All

StreamingContext Structure

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

Namespace:  System.Runtime.Serialization
Assemblies:   mscorlib (in mscorlib.dll)
  System.Runtime.Serialization.Primitives (in System.Runtime.Serialization.Primitives.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 methodSupported by Portable Class LibraryEqualsDetermines whether two StreamingContext instances contain the same values. (Overrides ValueType.Equals(Object).)
Public methodSupported by Portable Class LibraryGetHashCodeReturns a hash code of this object. (Overrides ValueType.GetHashCode().)
Public methodSupported by Portable Class LibraryGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodSupported by Portable Class LibraryToStringReturns 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.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

Supported in: Windows Phone 8.1

Supported in: Windows Phone Silverlight 8.1

Supported in: Windows Phone Silverlight 8

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:
© 2015 Microsoft