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) 那么,我们将使用理解的格式编写它们 DeserializingResourceReaderIf 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.

适用于