Freigeben über


ResourceManager.GetResourceSet Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets the ResourceSet for a particular culture.

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

Syntax

'Declaration
<SecuritySafeCriticalAttribute> _
Public Overridable Function GetResourceSet ( _
    culture As CultureInfo, _
    createIfNotExists As Boolean, _
    tryParents As Boolean _
) As ResourceSet
[SecuritySafeCriticalAttribute]
public virtual ResourceSet GetResourceSet(
    CultureInfo culture,
    bool createIfNotExists,
    bool tryParents
)

Parameters

Return Value

Type: System.Resources.ResourceSet
The specified resource set.

Exceptions

Exception Condition
ArgumentNullException

The culture parameter is nulla null reference (Nothing in Visual Basic).

Remarks

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, nulla null reference (Nothing in Visual Basic) 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.

NoteNote:

The GetResourceSet method is thread-safe.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.