PreserializedResourceWriter.Generate 方法

定義

將所有資源寫入輸出資料流。Writes all resources to the output stream.

public:
 virtual void Generate();
public void Generate ();
abstract member Generate : unit -> unit
override this.Generate : unit -> unit
Public Sub Generate ()

實作

例外狀況

資源清單為 nullThe resource list is null.

備註

如果新增至寫入器的資源可以用 ResourceReader瞭解的系統預設格式表示,則會以這種方式撰寫。If the resources added to the writer can be represented in the system default format understood by the ResourceReader, they will be written as such. 如果資源需要系統預設格式所支援以外的執行時間還原序列化(BinaryFormatter),我們會使用 DeserializingResourceReader所瞭解的格式來撰寫它們。If the resources require runtime deserialization other than that supported by the system default format (BinaryFormatter) then we will write them using the format understood by DeserializingResourceReader.

如果在物件序列化期間或 IO 期間發生例外狀況,則會關閉並刪除 .resources 檔案,因為這很可能無效。If an exception occurs during object serialization or during IO, the .resources file is closed and deleted, since it is most likely invalid.

適用於