StreamingContext 結構

定義

描述給定序列化資料流的來源和目的端,並且提供其他呼叫端定義的內容。

C#
public struct StreamingContext
C#
public readonly struct StreamingContext
C#
[System.Serializable]
public struct StreamingContext
C#
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public struct StreamingContext
繼承
StreamingContext
屬性

備註

指出格式器所使用的位來源或目的地。 具有 Surrogates 或 ISerializable 實作的類別可以根據串流內容中儲存的資訊來序列化或忽略欄位和值。 例如,如果 State 屬性設定為 System.Runtime.Serialization.StreamingContextStates.CrossProcess ,則視窗控制碼仍然有效。

建構函式

StreamingContext(StreamingContextStates)
已淘汰.

使用指定的內容狀態,初始化 StreamingContext 類別的新執行個體。

StreamingContext(StreamingContextStates, Object)
已淘汰.

使用指定的內容狀態和某些額外的資訊,初始化 StreamingContext 類別的新執行個體。

屬性

Context

取得已指定為額外內容的一部分的內容。

State
已淘汰.

取得已傳輸資料的來源或目的端。

方法

Equals(Object)

判斷兩個 StreamingContext 執行個體是否具有相同的值。

GetHashCode()

傳回這個物件的雜湊程式碼。

適用於

產品 版本
.NET Core 1.0, Core 1.1, 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
UWP 10.0

另請參閱