Export (0) Print
Expand All

ResourceManager.GetResourceSet Method

Updated: March 2012

Gets the ResourceSet for a particular culture.

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

public virtual ResourceSet GetResourceSet(
	CultureInfo culture,
	bool createIfNotExists,
	bool tryParents
)

Parameters

culture
Type: System.Globalization.CultureInfo

The CultureInfo to look for.

createIfNotExists
Type: System.Boolean

If true and if the ResourceSet has not been loaded yet, load it.

tryParents
Type: System.Boolean

If the ResourceSet cannot be loaded, try parent CultureInfo objects to see if they exist.

Return Value

Type: System.Resources.ResourceSet
The specified ResourceSet.

ExceptionCondition
ArgumentNullException

The culture parameter is null.

MissingManifestResourceException

tryParents is true, no usable set of resources has been found, and there are no default culture resources.

The ResourceSet that is returned represents the resources localized for the specified culture. If the resources have not been localized for that culture and tryParents is true, GetResourceSet falls back to a parent culture (this is accomplished using CultureInfo 's Parent property), and the parent ResourceSet is returned. Otherwise, null is returned.

The parameters let you control whether the ResourceSet is created if it hasn't been loaded yet, and whether parent CultureInfo objects should be loaded as well for resource inheritance.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC, Xbox 360, Zune

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

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 3.5, 2.0, 1.0

XNA Framework

Supported in: 3.0, 2.0, 1.0

Date

History

Reason

March 2012

Added MissingManifestResourceException exception.

Content bug fix.

September 2009

Removed note about being thread safe. This method is not thread safe.

Information enhancement.

Community Additions

ADD
Show:
© 2014 Microsoft