mscorlib(4.0.0.0) API with additions
System.Resources.ResourceReader Class Reference

Enumerates the resources in a binary resources (.resources) file by reading sequential resource name/value pairs. Security Note: Calling methods in this class with untrusted data is a security risk. Call the methods in the class only with trusted data. For more information, see Untrusted Data Security Risks. More...

Inheritance diagram for System.Resources.ResourceReader:
[legend]
Collaboration diagram for System.Resources.ResourceReader:
[legend]

Public Member Functions

 ResourceReader (string fileName)
 Initializes a new instance of the T:System.Resources.ResourceReader class for the specified named resource file. More...
 
 ResourceReader (Stream stream)
 Initializes a new instance of the T:System.Resources.ResourceReader class for the specified stream. More...
 
void Close ()
 Releases all operating system resources associated with this T:System.Resources.ResourceReader object. More...
 
void Dispose ()
 Releases all resources used by the current instance of the T:System.Resources.ResourceReader class. More...
 
IDictionaryEnumerator GetEnumerator ()
 Returns an enumerator for this T:System.Resources.ResourceReader object. More...
 
void GetResourceData (string resourceName, out string resourceType, out byte[] resourceData)
 Retrieves the type name and data of a named resource from an open resource file or stream. More...
 

Detailed Description

Enumerates the resources in a binary resources (.resources) file by reading sequential resource name/value pairs. Security Note: Calling methods in this class with untrusted data is a security risk. Call the methods in the class only with trusted data. For more information, see Untrusted Data Security Risks.

Definition at line 17 of file ResourceReader.cs.

Constructor & Destructor Documentation

◆ ResourceReader() [1/2]

System.Resources.ResourceReader.ResourceReader ( string  fileName)

Initializes a new instance of the T:System.Resources.ResourceReader class for the specified named resource file.

Parameters
fileNameThe path and name of the resource file to read. filename is not case-sensitive.
Exceptions
T:System.ArgumentNullExceptionThe fileName parameter is null.
T:System.IO.FileNotFoundExceptionThe file cannot be found.
T:System.IO.IOExceptionAn I/O error has occurred.
T:System.BadImageFormatExceptionThe resource file has an invalid format. For example, the length of the file may be zero.

Definition at line 265 of file ResourceReader.cs.

◆ ResourceReader() [2/2]

System.Resources.ResourceReader.ResourceReader ( Stream  stream)

Initializes a new instance of the T:System.Resources.ResourceReader class for the specified stream.

Parameters
streamThe input stream for reading resources.
Exceptions
T:System.ArgumentExceptionThe stream parameter is not readable.
T:System.ArgumentNullExceptionThe stream parameter is null.
T:System.IO.IOExceptionAn I/O error has occurred while accessing stream .

Definition at line 286 of file ResourceReader.cs.

Member Function Documentation

◆ Close()

void System.Resources.ResourceReader.Close ( )

Releases all operating system resources associated with this T:System.Resources.ResourceReader object.

Implements System.Resources.IResourceReader.

Definition at line 312 of file ResourceReader.cs.

◆ Dispose()

void System.Resources.ResourceReader.Dispose ( )

Releases all resources used by the current instance of the T:System.Resources.ResourceReader class.

Implements System.IDisposable.

Definition at line 318 of file ResourceReader.cs.

◆ GetEnumerator()

IDictionaryEnumerator System.Resources.ResourceReader.GetEnumerator ( )

Returns an enumerator for this T:System.Resources.ResourceReader object.

Returns
An enumerator for this T:System.Resources.ResourceReader object.
Exceptions
T:System.InvalidOperationExceptionThe reader has been closed or disposed, and cannot be accessed.

Implements System.Collections.IEnumerable.

Definition at line 397 of file ResourceReader.cs.

◆ GetResourceData()

void System.Resources.ResourceReader.GetResourceData ( string  resourceName,
out string  resourceType,
out byte []  resourceData 
)

Retrieves the type name and data of a named resource from an open resource file or stream.

Parameters
resourceNameThe name of a resource.
resourceTypeWhen this method returns, contains a string that represents the type name of the retrieved resource (see the Remarks section for details). This parameter is passed uninitialized.
resourceDataWhen this method returns, contains a byte array that is the binary representation of the retrieved type. This parameter is passed uninitialized.
Exceptions
T:System.ArgumentNullExceptionresourceName is null.
T:System.ArgumentExceptionresourceName does not exist.
T:System.BadImageFormatExceptionresourceName has an invalid type.
T:System.FormatExceptionThe retrieved resource data is corrupt.
T:System.InvalidOperationExceptionThe current T:System.Resources.ResourceReader object is not initialized, probably because it is closed.

Definition at line 1083 of file ResourceReader.cs.


The documentation for this class was generated from the following file: