Writes resources in the system-default format to an output file or an output stream. This class cannot be inherited.
More...
|
| ResourceWriter (string fileName) |
| Initializes a new instance of the T:System.Resources.ResourceWriter class that writes the resources to the specified file. More...
|
|
| ResourceWriter (Stream stream) |
| Initializes a new instance of the T:System.Resources.ResourceWriter class that writes the resources to the provided stream. More...
|
|
void | AddResource (string name, string value) |
| Adds a string resource to the list of resources to be written. More...
|
|
void | AddResource (string name, object value) |
| Adds a named resource specified as an object to the list of resources to be written. More...
|
|
void | AddResource (string name, Stream value) |
| Adds a named resource specified as a stream to the list of resources to be written. More...
|
|
void | AddResource (string name, Stream value, bool closeAfterWrite) |
| 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 M:System.Resources.ResourceWriter.Generate method is called. More...
|
|
void | AddResource (string name, byte[] value) |
| Adds a named resource specified as a byte array to the list of resources to be written. More...
|
|
void | AddResourceData (string name, string typeName, byte[] serializedData) |
| Adds a unit of data as a resource to the list of resources to be written. More...
|
|
void | Close () |
| Saves the resources to the output stream and then closes it. More...
|
|
void | Dispose () |
| Allows users to close the resource file or stream, explicitly releasing resources. More...
|
|
void | Generate () |
| Saves all resources to the output stream in the system default format. More...
|
|
|
Func< Type, string > | TypeNameConverter [get, set] |
| Gets or sets a delegate that enables resource assemblies to be written that target versions of the .NET Framework prior to the .NET Framework 4 by using qualified assembly names. More...
|
|
Writes resources in the system-default format to an output file or an output stream. This class cannot be inherited.
Definition at line 16 of file ResourceWriter.cs.
◆ ResourceWriter() [1/2]
System.Resources.ResourceWriter.ResourceWriter |
( |
string |
fileName | ) |
|
Initializes a new instance of the T:System.Resources.ResourceWriter class that writes the resources to the specified file.
- Parameters
-
fileName | The output file name. |
- Exceptions
-
T:System.ArgumentNullException | The fileName parameter is null . |
Definition at line 79 of file ResourceWriter.cs.
◆ ResourceWriter() [2/2]
System.Resources.ResourceWriter.ResourceWriter |
( |
Stream |
stream | ) |
|
Initializes a new instance of the T:System.Resources.ResourceWriter class that writes the resources to the provided stream.
- Parameters
-
- Exceptions
-
T:System.ArgumentException | The stream parameter is not writable. |
T:System.ArgumentNullException | The stream parameter is null . |
Definition at line 94 of file ResourceWriter.cs.
◆ AddResource() [1/5]
void System.Resources.ResourceWriter.AddResource |
( |
string |
name, |
|
|
string |
value |
|
) |
| |
Adds a string resource to the list of resources to be written.
- Parameters
-
name | The name of the resource. |
value | The value of the resource. |
- Exceptions
-
T:System.ArgumentException | name (or a name that varies only by capitalization) has already been added to this ResourceWriter. |
T:System.ArgumentNullException | The name parameter is null . |
T:System.InvalidOperationException | This T:System.Resources.ResourceWriter has been closed and its hash table is unavailable. |
Implements System.Resources.IResourceWriter.
Definition at line 116 of file ResourceWriter.cs.
◆ AddResource() [2/5]
void System.Resources.ResourceWriter.AddResource |
( |
string |
name, |
|
|
object |
value |
|
) |
| |
Adds a named resource specified as an object to the list of resources to be written.
- Parameters
-
name | The name of the resource. |
value | The value of the resource. |
- Exceptions
-
T:System.ArgumentException | name (or a name that varies only by capitalization) has already been added to this T:System.Resources.ResourceWriter. |
T:System.ArgumentNullException | The name parameter is null . |
T:System.InvalidOperationException | This T:System.Resources.ResourceWriter has been closed and its hash table is unavailable. |
Implements System.Resources.IResourceWriter.
Definition at line 137 of file ResourceWriter.cs.
◆ AddResource() [3/5]
void System.Resources.ResourceWriter.AddResource |
( |
string |
name, |
|
|
Stream |
value |
|
) |
| |
Adds a named resource specified as a stream to the list of resources to be written.
- Parameters
-
name | The name of the resource to add. |
value | The value of the resource to add. The resource must support the P:System.IO.Stream.Length property. |
- Exceptions
-
T:System.ArgumentException | name (or a name that varies only by capitalization) has already been added to this T:System.Resources.ResourceWriter.-or-The stream does not support the P:System.IO.Stream.Length property. |
T:System.ArgumentNullException | name or value is null . |
T:System.InvalidOperationException | This T:System.Resources.ResourceWriter has been closed. |
Definition at line 164 of file ResourceWriter.cs.
◆ AddResource() [4/5]
void System.Resources.ResourceWriter.AddResource |
( |
string |
name, |
|
|
Stream |
value, |
|
|
bool |
closeAfterWrite |
|
) |
| |
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 M:System.Resources.ResourceWriter.Generate method is called.
- Parameters
-
name | The name of the resource to add. |
value | The value of the resource to add. The resource must support the P:System.IO.Stream.Length property. |
closeAfterWrite | true to close the stream after the M:System.Resources.ResourceWriter.Generate method is called; otherwise, false . |
- Exceptions
-
T:System.ArgumentException | name (or a name that varies only by capitalization) has already been added to this T:System.Resources.ResourceWriter.-or-The stream does not support the P:System.IO.Stream.Length property. |
T:System.ArgumentNullException | name or value is null . |
T:System.InvalidOperationException | This T:System.Resources.ResourceWriter has been closed. |
Definition at line 187 of file ResourceWriter.cs.
◆ AddResource() [5/5]
void System.Resources.ResourceWriter.AddResource |
( |
string |
name, |
|
|
byte [] |
value |
|
) |
| |
Adds a named resource specified as a byte array to the list of resources to be written.
- Parameters
-
name | The name of the resource. |
value | Value of the resource as an 8-bit unsigned integer array. |
- Exceptions
-
T:System.ArgumentException | name (or a name that varies only by capitalization) has already been added to this T:System.Resources.ResourceWriter. |
T:System.ArgumentNullException | The name parameter is null . |
T:System.InvalidOperationException | This T:System.Resources.ResourceWriter has been closed and its hash table is unavailable. |
Implements System.Resources.IResourceWriter.
Definition at line 223 of file ResourceWriter.cs.
◆ AddResourceData()
void System.Resources.ResourceWriter.AddResourceData |
( |
string |
name, |
|
|
string |
typeName, |
|
|
byte [] |
serializedData |
|
) |
| |
Adds a unit of data as a resource to the list of resources to be written.
- Parameters
-
name | A name that identifies the resource that contains the added data. |
typeName | The type name of the added data. For more information, see the Remarks section. |
serializedData | A byte array that contains the binary representation of the added data. |
- Exceptions
-
T:System.ArgumentNullException | name , typeName , or serializedData is null . |
T:System.ArgumentException | name (or a name that varies only by capitalization) has already been added to this T:System.Resources.ResourceWriter object. |
T:System.InvalidOperationException | The current T:System.Resources.ResourceWriter object is not initialized. The probable cause is that the T:System.Resources.ResourceWriter object is closed. |
Definition at line 246 of file ResourceWriter.cs.
◆ Close()
void System.Resources.ResourceWriter.Close |
( |
| ) |
|
Saves the resources to the output stream and then closes it.
- Exceptions
-
T:System.IO.IOException | An I/O error has occurred. |
T:System.Runtime.Serialization.SerializationException | An error has occurred during serialization of the object. |
Implements System.Resources.IResourceWriter.
Definition at line 275 of file ResourceWriter.cs.
◆ Dispose()
void System.Resources.ResourceWriter.Dispose |
( |
| ) |
|
Allows users to close the resource file or stream, explicitly releasing resources.
- Exceptions
-
T:System.IO.IOException | An I/O error has occurred. |
T:System.Runtime.Serialization.SerializationException | An error has occurred during serialization of the object. |
Implements System.IDisposable.
Definition at line 300 of file ResourceWriter.cs.
◆ Generate()
void System.Resources.ResourceWriter.Generate |
( |
| ) |
|
Saves all resources to the output stream in the system default format.
- Exceptions
-
T:System.IO.IOException | An I/O error occurred. |
T:System.Runtime.Serialization.SerializationException | An error occurred during serialization of the object. |
T:System.InvalidOperationException | This T:System.Resources.ResourceWriter has been closed and its hash table is unavailable. |
Implements System.Resources.IResourceWriter.
Definition at line 310 of file ResourceWriter.cs.
◆ TypeNameConverter
Func<Type, string> System.Resources.ResourceWriter.TypeNameConverter |
|
getset |
Gets or sets a delegate that enables resource assemblies to be written that target versions of the .NET Framework prior to the .NET Framework 4 by using qualified assembly names.
- Returns
- The type that is encapsulated by the delegate.
Definition at line 65 of file ResourceWriter.cs.
The documentation for this class was generated from the following file: