NAnt SDK Documentation - v0.92

ResourceUtils.GetString Method (String, CultureInfo, Assembly)

Returns the value of the specified string resource localized for the specified culture for the specified assembly.

[Visual Basic]
Overloads Public Shared Function GetString( _
   ByVal name As String, _
   ByVal culture As CultureInfo, _
   ByVal assembly As Assembly _
) As String
[C#]
public static string GetString(
   string name,
   CultureInfo culture,
   Assembly assembly
);

Parameters

name
A String that contains the name of the resource to get.
culture
A CultureInfo that represents the culture for which the resource is localized.
assembly
A Assembly

Return Value

A String that contains the value of the resource localized for the specified culture.

Remarks

Note    The GetString method is thread-safe.

Example

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);

See Also

ResourceUtils Class | NAnt.Core.Util Namespace | ResourceUtils.GetString Overload List