StreamingContext Constructors

Definition

Initializes a new instance of the StreamingContext class.

Overloads

StreamingContext(StreamingContextStates)
Obsolete.

Initializes a new instance of the StreamingContext class with a given context state.

StreamingContext(StreamingContextStates, Object)
Obsolete.

Initializes a new instance of the StreamingContext class with a given context state, and some additional information.

StreamingContext(StreamingContextStates)

Source:
StreamingContext.cs
Source:
StreamingContext.cs
Source:
StreamingContext.cs

Caution

Formatter-based serialization is obsolete and should not be used.

Initializes a new instance of the StreamingContext class with a given context state.

public StreamingContext (System.Runtime.Serialization.StreamingContextStates state);
[System.Obsolete("Formatter-based serialization is obsolete and should not be used.", DiagnosticId="SYSLIB0050", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public StreamingContext (System.Runtime.Serialization.StreamingContextStates state);

Parameters

state
StreamingContextStates

A bitwise combination of the StreamingContextStates values that specify the source or destination context for this StreamingContext.

Attributes

See also

Applies to

.NET 9 and other versions
Product Versions (Obsolete)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7 (8, 9)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

StreamingContext(StreamingContextStates, Object)

Source:
StreamingContext.cs
Source:
StreamingContext.cs
Source:
StreamingContext.cs

Caution

Formatter-based serialization is obsolete and should not be used.

Initializes a new instance of the StreamingContext class with a given context state, and some additional information.

public StreamingContext (System.Runtime.Serialization.StreamingContextStates state, object? additional);
[System.Obsolete("Formatter-based serialization is obsolete and should not be used.", DiagnosticId="SYSLIB0050", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public StreamingContext (System.Runtime.Serialization.StreamingContextStates state, object? additional);
public StreamingContext (System.Runtime.Serialization.StreamingContextStates state, object additional);

Parameters

state
StreamingContextStates

A bitwise combination of the StreamingContextStates values that specify the source or destination context for this StreamingContext.

additional
Object

Any additional information to be associated with the StreamingContext. This information is available to any object that implements ISerializable or any serialization surrogate. Most users do not need to set this parameter.

Attributes

See also

Applies to

.NET 9 and other versions
Product Versions (Obsolete)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7 (8, 9)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1