StreamingContextStates 列舉
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
警告
Formatter-based serialization is obsolete and should not be used.
定義一組旗標,指定串行化期間數據流的來源或目的地內容。
此列舉支援其成員值的位元組合。
public enum class StreamingContextStates
[System.Flags]
[System.Obsolete("Formatter-based serialization is obsolete and should not be used.", DiagnosticId="SYSLIB0050", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public enum StreamingContextStates
[System.Flags]
public enum StreamingContextStates
[System.Flags]
[System.Serializable]
public enum StreamingContextStates
[System.Flags]
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public enum StreamingContextStates
[<System.Flags>]
[<System.Obsolete("Formatter-based serialization is obsolete and should not be used.", DiagnosticId="SYSLIB0050", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type StreamingContextStates =
[<System.Flags>]
type StreamingContextStates =
[<System.Flags>]
[<System.Serializable>]
type StreamingContextStates =
[<System.Flags>]
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type StreamingContextStates =
Public Enum StreamingContextStates
- 繼承
- 屬性
欄位
| 名稱 | 值 | Description |
|---|---|---|
| CrossProcess | 1 | 指定來源或目的上下文是同一台電腦上的不同程序。 |
| CrossMachine | 2 | 指定來源或目的上下文為不同的電腦。 |
| File | 4 | 指定來源或目的上下文為檔案。 使用者可以假設檔案的保存時間會比創建它們的程序更長,而不會以以非序列化的方式序列化物件,導致反序列化需要存取當前程序中的任何資料。 |
| Persistence | 8 | 指定來源或目的上下文為持久儲存,可能包含資料庫、檔案或其他備份儲存。 使用者可以假設持久化的資料會比產生資料的程序保存更久,因此無法序列化物件,因此反序列化需要存取目前程序中的任何資料。 |
| Remoting | 16 | 指定資料被遠端傳送到未知地點的情境。 使用者無法假設這些資料是否在同一台電腦上。 |
| Other | 32 | 指定序列化上下文未知。 |
| Clone | 64 | 指定物件圖正在被克隆。 使用者可以假設複製的圖會繼續存在於同一程序中,且可以安全存取對非管理資源的句柄或其他參考。 |
| CrossAppDomain | 128 | 指定來源或目的地上下文為不同的應用域。 |
| All | 255 | 規定序列化資料可傳送或接收至任何其他上下文。 |