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

Stores all the resources localized for one particular culture, ignoring all other cultures, including any fallback rules. 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.ResourceSet:
[legend]
Collaboration diagram for System.Resources.ResourceSet:
[legend]

Public Member Functions

 ResourceSet (string fileName)
 Creates a new instance of the T:System.Resources.ResourceSet class using the system default T:System.Resources.ResourceReader that opens and reads resources from the given file. More...
 
 ResourceSet (Stream stream)
 Creates a new instance of the T:System.Resources.ResourceSet class using the system default T:System.Resources.ResourceReader that reads resources from the given stream. More...
 
 ResourceSet (IResourceReader reader)
 Creates a new instance of the T:System.Resources.ResourceSet class using the specified resource reader. More...
 
virtual void Close ()
 Closes and releases any resources used by this T:System.Resources.ResourceSet. More...
 
void Dispose ()
 Disposes of the resources (other than memory) used by the current instance of T:System.Resources.ResourceSet. More...
 
virtual Type GetDefaultReader ()
 Returns the preferred resource reader class for this kind of T:System.Resources.ResourceSet. More...
 
virtual Type GetDefaultWriter ()
 Returns the preferred resource writer class for this kind of T:System.Resources.ResourceSet. More...
 
virtual IDictionaryEnumerator GetEnumerator ()
 Returns an T:System.Collections.IDictionaryEnumerator that can iterate through the T:System.Resources.ResourceSet. More...
 
virtual string GetString (string name)
 Searches for a T:System.String resource with the specified name. More...
 
virtual string GetString (string name, bool ignoreCase)
 Searches for a T:System.String resource with the specified name in a case-insensitive manner, if requested. More...
 
virtual object GetObject (string name)
 Searches for a resource object with the specified name. More...
 
virtual object GetObject (string name, bool ignoreCase)
 Searches for a resource object with the specified name in a case-insensitive manner, if requested. More...
 

Protected Member Functions

 ResourceSet ()
 Initializes a new instance of the T:System.Resources.ResourceSet class with default properties. More...
 
virtual void Dispose (bool disposing)
 Releases resources (other than memory) associated with the current instance, closing internal managed objects if requested. More...
 
virtual void ReadResources ()
 Reads all the resources and stores them in a T:System.Collections.Hashtable indicated in the F:System.Resources.ResourceSet.Table property. More...
 

Protected Attributes

IResourceReader Reader
 Indicates the T:System.Resources.IResourceReader used to read the resources. More...
 
Hashtable Table
 The T:System.Collections.Hashtable in which the resources are stored. More...
 

Detailed Description

Stores all the resources localized for one particular culture, ignoring all other cultures, including any fallback rules. 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 12 of file ResourceSet.cs.

Constructor & Destructor Documentation

◆ ResourceSet() [1/4]

System.Resources.ResourceSet.ResourceSet ( )
protected

Initializes a new instance of the T:System.Resources.ResourceSet class with default properties.

Definition at line 24 of file ResourceSet.cs.

◆ ResourceSet() [2/4]

System.Resources.ResourceSet.ResourceSet ( string  fileName)

Creates a new instance of the T:System.Resources.ResourceSet class using the system default T:System.Resources.ResourceReader that opens and reads resources from the given file.

Parameters
fileNameResource file to read.
Exceptions
T:System.ArgumentNullExceptionThe fileName parameter is null.

Definition at line 36 of file ResourceSet.cs.

◆ ResourceSet() [3/4]

System.Resources.ResourceSet.ResourceSet ( Stream  stream)

Creates a new instance of the T:System.Resources.ResourceSet class using the system default T:System.Resources.ResourceReader that reads resources from the given stream.

Parameters
streamThe T:System.IO.Stream of resources to be read. The stream should refer to an existing resources file.
Exceptions
T:System.ArgumentExceptionThe stream is not readable.
T:System.ArgumentNullExceptionThe stream parameter is null.

Definition at line 48 of file ResourceSet.cs.

◆ ResourceSet() [4/4]

System.Resources.ResourceSet.ResourceSet ( IResourceReader  reader)

Creates a new instance of the T:System.Resources.ResourceSet class using the specified resource reader.

Parameters
readerThe reader that will be used.
Exceptions
T:System.ArgumentNullExceptionThe reader parameter is null.

Definition at line 58 of file ResourceSet.cs.

Member Function Documentation

◆ Close()

virtual void System.Resources.ResourceSet.Close ( )
virtual

Closes and releases any resources used by this T:System.Resources.ResourceSet.

Definition at line 75 of file ResourceSet.cs.

◆ Dispose() [1/2]

virtual void System.Resources.ResourceSet.Dispose ( bool  disposing)
protectedvirtual

Releases resources (other than memory) associated with the current instance, closing internal managed objects if requested.

Parameters
disposingIndicates whether the objects contained in the current instance should be explicitly closed.

Definition at line 82 of file ResourceSet.cs.

◆ Dispose() [2/2]

void System.Resources.ResourceSet.Dispose ( )

Disposes of the resources (other than memory) used by the current instance of T:System.Resources.ResourceSet.

Implements System.IDisposable.

Definition at line 96 of file ResourceSet.cs.

◆ GetDefaultReader()

virtual Type System.Resources.ResourceSet.GetDefaultReader ( )
virtual

Returns the preferred resource reader class for this kind of T:System.Resources.ResourceSet.

Returns
Returns the T:System.Type for the preferred resource reader for this kind of T:System.Resources.ResourceSet.

Definition at line 103 of file ResourceSet.cs.

◆ GetDefaultWriter()

virtual Type System.Resources.ResourceSet.GetDefaultWriter ( )
virtual

Returns the preferred resource writer class for this kind of T:System.Resources.ResourceSet.

Returns
Returns the T:System.Type for the preferred resource writer for this kind of T:System.Resources.ResourceSet.

Definition at line 110 of file ResourceSet.cs.

◆ GetEnumerator()

virtual IDictionaryEnumerator System.Resources.ResourceSet.GetEnumerator ( )
virtual

Returns an T:System.Collections.IDictionaryEnumerator that can iterate through the T:System.Resources.ResourceSet.

Returns
An T:System.Collections.IDictionaryEnumerator for this T:System.Resources.ResourceSet.
Exceptions
T:System.ObjectDisposedExceptionThe resource set has been closed or disposed.

Implements System.Collections.IEnumerable.

Definition at line 119 of file ResourceSet.cs.

◆ GetObject() [1/2]

virtual object System.Resources.ResourceSet.GetObject ( string  name)
virtual

Searches for a resource object with the specified name.

Parameters
nameCase-sensitive name of the resource to search for.
Returns
The requested resource.
Exceptions
T:System.ArgumentNullExceptionThe name parameter is null.
T:System.ObjectDisposedExceptionThe object has been closed or disposed.

Definition at line 199 of file ResourceSet.cs.

◆ GetObject() [2/2]

virtual object System.Resources.ResourceSet.GetObject ( string  name,
bool  ignoreCase 
)
virtual

Searches for a resource object with the specified name in a case-insensitive manner, if requested.

Parameters
nameName of the resource to search for.
ignoreCaseIndicates whether the case of the specified name should be ignored.
Returns
The requested resource.
Exceptions
T:System.ArgumentNullExceptionThe name parameter is null.
T:System.ObjectDisposedExceptionThe object has been closed or disposed.

Definition at line 210 of file ResourceSet.cs.

◆ GetString() [1/2]

virtual string System.Resources.ResourceSet.GetString ( string  name)
virtual

Searches for a T:System.String resource with the specified name.

Parameters
nameName of the resource to search for.
Returns
The value of a resource, if the value is a T:System.String.
Exceptions
T:System.ArgumentNullExceptionThe name parameter is null.
T:System.InvalidOperationExceptionThe resource specified by name is not a T:System.String.
T:System.ObjectDisposedExceptionThe object has been closed or disposed.

Definition at line 147 of file ResourceSet.cs.

◆ GetString() [2/2]

virtual string System.Resources.ResourceSet.GetString ( string  name,
bool  ignoreCase 
)
virtual

Searches for a T:System.String resource with the specified name in a case-insensitive manner, if requested.

Parameters
nameName of the resource to search for.
ignoreCaseIndicates whether the case of the case of the specified name should be ignored.
Returns
The value of a resource, if the value is a T:System.String.
Exceptions
T:System.ArgumentNullExceptionThe name parameter is null.
T:System.InvalidOperationExceptionThe resource specified by name is not a T:System.String.
T:System.ObjectDisposedExceptionThe object has been closed or disposed.

Definition at line 167 of file ResourceSet.cs.

◆ ReadResources()

virtual void System.Resources.ResourceSet.ReadResources ( )
protectedvirtual

Reads all the resources and stores them in a T:System.Collections.Hashtable indicated in the F:System.Resources.ResourceSet.Table property.

Definition at line 221 of file ResourceSet.cs.

Member Data Documentation

◆ Reader

IResourceReader System.Resources.ResourceSet.Reader
protected

Indicates the T:System.Resources.IResourceReader used to read the resources.

Definition at line 16 of file ResourceSet.cs.

◆ Table

Hashtable System.Resources.ResourceSet.Table
protected

The T:System.Collections.Hashtable in which the resources are stored.

Definition at line 19 of file ResourceSet.cs.


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