Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class System.​Resources.​ResourceWriter
Assembly: System.Resources.Writer
Inheritance: object → ResourceWriter
Implemented Interfaces
- IResourceWriter (Inherits: IDisposable)
Writes resources in the system-default format to an output file or an output stream. This class cannot be inherited.
Properties
Methods
public
void
AddResource​(string name,
byte[] value)
Adds a named resource specified as a byte array to the list of resources to be written.
name
The name of the resource.
value
Value of the resource as an 8-bit unsigned integer array.
public
void
AddResource​(string name,
IO.​Stream? value)
Adds a named resource specified as a stream to the list of resources to be written.
name
The name of the resource to add.
value
The value of the resource to add. The resource must support the <see cref="P:System.IO.Stream.Length" /> property.
public
void
AddResource​(string name,
IO.​Stream? value,
bool closeAfterWrite = false)
Adds a named resource specified as a stream to the list of resources to be written, and specifies whether the stream should be closed after the <see cref="M:System.Resources.ResourceWriter.Generate" /> method is called.
name
The name of the resource to add.
value
The value of the resource to add. The resource must support the <see cref="P:System.IO.Stream.Length" /> property.
closeAfterWrite
<see langword="true" /> to close the stream after the <see cref="M:System.Resources.ResourceWriter.Generate" /> method is called; otherwise, <see langword="false" /> .
public
void
AddResource​(string name,
object value)
Adds a named resource specified as an object to the list of resources to be written.
name
The name of the resource.
value
The value of the resource.
public
void
AddResource​(string name,
string value)
Adds a string resource to the list of resources to be written.
name
The name of the resource.
value
The value of the resource.
public
void
AddResourceData​(string name,
string typeName,
byte[] serializedData)
Adds a unit of data as a resource to the list of resources to be written.
name
A name that identifies the resource that contains the added data.
typeName
The type name of the added data.
serializedData
A byte array that contains the binary representation of the added data.
public
void
Close​()
Saves the resources to the output stream and then closes it.
public
void
Dispose​()
Allows users to close the resource file or stream, explicitly releasing resources.
public
void
Generate​()
Saves all resources to the output stream in the system default format.
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object