IResourceWriter 接口

定义

提供将资源写到输出文件或输出流的基本功能。Provides the base functionality for writing resources to an output file or stream.

public interface class IResourceWriter : IDisposable
[System.Runtime.InteropServices.ComVisible(true)]
public interface IResourceWriter : IDisposable
type IResourceWriter = interface
    interface IDisposable
Public Interface IResourceWriter
Implements IDisposable
派生
属性
实现

注解

资源编写器用于将资源写入特定文件格式的文件。Resource writers are used to write resources to files in a particular file format. 如果要控制写入资源文件的方式 (例如, 将资源存储为 .txt、.resx 或二进制 .resources 文件以外的内容), 请实现此接口。Implement this interface if you want to control the way in which a resource file is written (for example, to store resources in something other than a .txt, .resx, or binary .resources file). 否则, 请使用默认ResourceWriter类, 该默认类将资源写入二进制 .resources 文件ResXResourceWriter或类, 后者将资源写入 XML 资源 (.resx) 文件。Otherwise, use the default ResourceWriter class, which writes resources to a binary .resources file, or the ResXResourceWriter class, which writes resources to an XML resource (.resx) file.

方法

AddResource(String, Byte[])

将 8 位无符号整数数组作为命名资源添加到要写入的资源列表中。Adds an 8-bit unsigned integer array as a named resource to the list of resources to be written.

AddResource(String, Object)

Object 类型的已命名资源添加到要写入的资源列表中。Adds a named resource of type Object to the list of resources to be written.

AddResource(String, String)

String 类型的已命名资源添加到要写入的资源列表中。Adds a named resource of type String to the list of resources to be written.

Close()

关闭基础资源文件或流,并确保所有数据已写入该文件。Closes the underlying resource file or stream, ensuring all the data has been written to the file.

Dispose()

执行与释放或重置非托管资源关联的应用程序定义的任务。Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

(继承自 IDisposable)
Generate()

将所有由 AddResource(String, String) 方法添加的资源写入输出文件或输出流中。Writes all the resources added by the AddResource(String, String) method to the output file or stream.

适用于

另请参阅