ResourceSet Class

Stores all the resources localized for one particular culture, ignoring all other cultures, including any fallback rules.

Namespace:  System.Resources
Assembly:  mscorlib (in mscorlib.dll)

[SerializableAttribute]
[ComVisibleAttribute(true)]
public class ResourceSet : IDisposable, 
	IEnumerable

The ResourceSet type exposes the following members.

  NameDescription
Protected methodSupported by the XNA FrameworkResourceSet()Initializes a new instance of the ResourceSet class with default properties.
Public methodSupported by the XNA FrameworkResourceSet(IResourceReader)Creates a new instance of the ResourceSet class using the specified resource reader.
Public methodSupported by the XNA FrameworkResourceSet(Stream)Creates a new instance of the ResourceSet class using the system default ResourceReader that reads resources from the given stream.
Public methodSupported by the XNA FrameworkResourceSet(String)Creates a new instance of the ResourceSet class using the system default ResourceReader that opens and reads resources from the given file.
Top

  NameDescription
Public methodSupported by the XNA FrameworkCloseCloses and releases any resources used by this ResourceSet.
Public methodSupported by the XNA FrameworkDispose()Disposes of the resources (other than memory) used by the current instance of ResourceSet.
Protected methodSupported by the XNA FrameworkDispose(Boolean)Releases resources (other than memory) associated with the current instance, closing internal managed objects if requested.
Public methodSupported by the XNA FrameworkEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodSupported by the XNA FrameworkFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by the XNA FrameworkGetDefaultReaderReturns the preferred resource reader class for this kind of ResourceSet.
Public methodGetDefaultWriterReturns the preferred resource writer class for this kind of ResourceSet.
Public methodSupported by the XNA FrameworkGetEnumeratorReturns an IDictionaryEnumerator that can iterate through the ResourceSet.
Public methodSupported by the XNA FrameworkGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodSupported by the XNA FrameworkGetObject(String)Searches for a resource object with the specified name.
Public methodSupported by the XNA FrameworkGetObject(String, Boolean)Searches for a resource object with the specified name in a case-insensitive manner, if requested.
Public methodSupported by the XNA FrameworkGetString(String)Searches for a String resource with the specified name.
Public methodSupported by the XNA FrameworkGetString(String, Boolean)Searches for a String resource with the specified name in a case-insensitive manner, if requested.
Public methodSupported by the XNA FrameworkGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodSupported by the XNA FrameworkMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Protected methodSupported by the XNA FrameworkReadResourcesReads all the resources and stores them in a Hashtable indicated in the Table property.
Public methodSupported by the XNA FrameworkToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Public Extension MethodAsParallelEnables parallelization of a query. (Defined by ParallelEnumerable.)
Public Extension MethodAsQueryableConverts an IEnumerable to an IQueryable. (Defined by Queryable.)
Public Extension MethodSupported by the XNA FrameworkCast<TResult>Casts the elements of an IEnumerable to the specified type. (Defined by Enumerable.)
Public Extension MethodSupported by the XNA FrameworkOfType<TResult>Filters the elements of an IEnumerable based on a specified type. (Defined by Enumerable.)
Top

  NameDescription
Protected fieldSupported by the XNA FrameworkReaderIndicates the IResourceReader used to read the resources.
Protected fieldSupported by the XNA FrameworkTableThe Hashtable in which the resources are stored.
Top

  NameDescription
Explicit interface implemetationPrivate methodSupported by the XNA FrameworkIEnumerable.GetEnumeratorReturns an IEnumerator object to avoid a race condition with Dispose. This member is not intended to be used directly from your code.
Top

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 noteImportant

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.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone 8, Silverlight 8.1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft