IResourceWriter IResourceWriter IResourceWriter IResourceWriter Interface

定義

提供將資源寫入輸出檔或資料流的基本功能。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[]) AddResource(String, Byte[]) AddResource(String, Byte[]) AddResource(String, Byte[])

將 8 位元不帶正負號的整數 (Unsigned Integer) 陣列當做具名資源,加入被寫入的資源清單。Adds an 8-bit unsigned integer array as a named resource to the list of resources to be written.

AddResource(String, Object) AddResource(String, Object) AddResource(String, Object) AddResource(String, Object)

Object 型別的具名資源加入要被寫入的資源清單中。Adds a named resource of type Object to the list of resources to be written.

AddResource(String, String) AddResource(String, String) AddResource(String, String) AddResource(String, String)

String 型別的具名資源加入要被寫入的資源清單中。Adds a named resource of type String to the list of resources to be written.

Close() Close() Close() Close()

關閉基礎資源檔或資料流,確保所有資料已經寫入檔案。Closes the underlying resource file or stream, ensuring all the data has been written to the file.

Dispose() Dispose() Dispose() Dispose()

執行與釋放 (Free)、釋放 (Release) 或重設 Unmanaged 資源相關聯之應用程式定義的工作。Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

(Inherited from IDisposable)
Generate() Generate() Generate() Generate()

將所有藉由 AddResource(String, String) 方法加入的資源寫入輸出檔或資料流。Writes all the resources added by the AddResource(String, String) method to the output file or stream.

適用於

另請參閱