ResourceSet ResourceSet ResourceSet ResourceSet Class

Definition

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.

public ref class ResourceSet : IDisposable, System::Collections::IEnumerable
[System.Runtime.InteropServices.ComVisible(true)]
public class ResourceSet : IDisposable, System.Collections.IEnumerable
type ResourceSet = class
    interface IDisposable
    interface IEnumerable
Public Class ResourceSet
Implements IDisposable, IEnumerable
Inheritance
ResourceSetResourceSetResourceSetResourceSet
Derived
Attributes
Implements

Remarks

The ResourceSet class enumerates over an IResourceReader, loading every name and value, and storing them in a Hashtable. A custom IResourceReader can be used.

You can instantiate a ResourceSet object that represents the resources of a specific culture by calling the ResourceManager.GetResourceSet method.

Important

This type implements the IDisposable interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its Dispose method in a try/catch block. To dispose of it indirectly, use a language construct such as using (in C#) or Using (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the IDisposable interface topic.

Notes to Inheritors

Derived classes of ResourceSet that use their own resource reader and writer should override GetDefaultReader(), and GetDefaultWriter(), to provide the appropriate functionality for interpreting the resource set.

Constructors

ResourceSet() ResourceSet() ResourceSet() ResourceSet()

Initializes a new instance of the ResourceSet class with default properties.

ResourceSet(IResourceReader) ResourceSet(IResourceReader) ResourceSet(IResourceReader) ResourceSet(IResourceReader)

Creates a new instance of the ResourceSet class using the specified resource reader.

ResourceSet(Stream) ResourceSet(Stream) ResourceSet(Stream) ResourceSet(Stream)

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

ResourceSet(String) ResourceSet(String) ResourceSet(String) ResourceSet(String)

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

Fields

Reader Reader Reader Reader

Indicates the IResourceReader used to read the resources.

Table Table Table Table

The Hashtable in which the resources are stored.

Methods

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

Closes and releases any resources used by this ResourceSet.

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

Disposes of the resources (other than memory) used by the current instance of ResourceSet.

Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

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

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetDefaultReader() GetDefaultReader() GetDefaultReader() GetDefaultReader()

Returns the preferred resource reader class for this kind of ResourceSet.

GetDefaultWriter() GetDefaultWriter() GetDefaultWriter() GetDefaultWriter()

Returns the preferred resource writer class for this kind of ResourceSet.

GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

Returns an IDictionaryEnumerator that can iterate through the ResourceSet.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetObject(String) GetObject(String) GetObject(String) GetObject(String)

Searches for a resource object with the specified name.

GetObject(String, Boolean) GetObject(String, Boolean) GetObject(String, Boolean) GetObject(String, Boolean)

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

GetString(String) GetString(String) GetString(String) GetString(String)

Searches for a String resource with the specified name.

GetString(String, Boolean) GetString(String, Boolean) GetString(String, Boolean) GetString(String, Boolean)

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

GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ReadResources() ReadResources() ReadResources() ReadResources()

Reads all the resources and stores them in a Hashtable indicated in the Table property.

ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Explicit Interface Implementations

IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()

Returns an IEnumerator object to avoid a race condition with Dispose. This member is not intended to be used directly from your code.

Extension Methods

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

Converts an IEnumerable to an IQueryable.

Applies to