Summary
Returns the value of the specified string resource localized for
the specified culture for the specified assembly.
- Assembly
- NAnt
.Core .dll - Namespace
- NAnt
.Core .Util - Containing Type
- ResourceUtils
Syntax
public static string GetString(string name, CultureInfo culture, Assembly assembly)
Examples
The following example demonstrates the
GetString
method using
specific culture and assembly.
CultureInfo culture = CultureInfo.CreateSpecificCulture("en-US");
Assembly assembly = Assembly.GetCallingAssembly();
string localizedString = ResourceUtils.GetString("String_HelloWorld", culture, assembly);
Remarks
The
GetString
method is thread-safe.
Parameters
Name | Type | Description |
---|---|---|
name | string |
A string that contains the name of the
resource to get.
|
culture | CultureInfo |
A System.Globalization.CultureInfo that represents
the culture for which the resource is localized.
|
assembly | Assembly |
A System.Reflection.Assembly
|
Return Value
Type | Description |
---|---|
string |
A string that contains the value of the
resource localized for the specified culture.
|