C# Class Open.Core.Common.LocalizationExtensions

Extensions for performing localization on strings.
Afficher le fichier Open project: philcockfield/Open.TestHarness.SL

Méthodes publiques

Méthode Description
GetStringLibrary ( this assembly ) : ResourceManager

Gets the 'StringLibrary' resource for the given assembly.

This method assumes that the resource file is named 'StringLibrary.resx' (or standard regional variant, such as 'StringLibrary.de.resx' or 'StringLibrary.de-DE.resx') and placed within the project.
This can be placed anywhere within the project, but only one file with this name should be present.

ToLocalString ( this key ) : string

Converts the given key to it's localized form.

This method assumes that the resource file is named 'StringLibrary.resx' (or standard regional variant, such as 'StringLibrary.de.resx' or 'StringLibrary.de-DE.resx') and placed within the project.
This can be placed anywhere within the project, but only one file with this name should be present.

ToLocalString ( this key, Assembly assembly ) : string

Converts the given key to it's localized form.

This method assumes that the resource file is named 'StringLibrary.resx' (or standard regional variant, such as 'StringLibrary.de.resx' or 'StringLibrary.de-DE.resx') and placed within the project.
This can be placed anywhere within the project, but only one file with this name should be present.

Private Methods

Méthode Description
GetLocalStringValue ( string key, Assembly assembly ) : string

Method Details

GetStringLibrary() public static méthode

Gets the 'StringLibrary' resource for the given assembly.
This method assumes that the resource file is named 'StringLibrary.resx' (or standard regional variant, such as 'StringLibrary.de.resx' or 'StringLibrary.de-DE.resx') and placed within the project.
This can be placed anywhere within the project, but only one file with this name should be present.
public static GetStringLibrary ( this assembly ) : ResourceManager
assembly this The assembly containing the resource.
Résultat System.Resources.ResourceManager

ToLocalString() public static méthode

Converts the given key to it's localized form.
This method assumes that the resource file is named 'StringLibrary.resx' (or standard regional variant, such as 'StringLibrary.de.resx' or 'StringLibrary.de-DE.resx') and placed within the project.
This can be placed anywhere within the project, but only one file with this name should be present.
public static ToLocalString ( this key ) : string
key this The key to lookup in the asset library.
Résultat string

ToLocalString() public static méthode

Converts the given key to it's localized form.
This method assumes that the resource file is named 'StringLibrary.resx' (or standard regional variant, such as 'StringLibrary.de.resx' or 'StringLibrary.de-DE.resx') and placed within the project.
This can be placed anywhere within the project, but only one file with this name should be present.
public static ToLocalString ( this key, Assembly assembly ) : string
key this The key to lookup in the asset library.
assembly System.Reflection.Assembly The assembly to use as a content lookup.
Résultat string