Interface IResourceManager
Provides methods for convenient access to culture-specific resources at run time.
Namespace: Terrasoft.Common
Assembly: Terrasoft.Common.dll
Syntax
public interface IResourceManager
Properties
BaseName
Gets the root name of the resources.
Declaration
string BaseName { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
GetObject(String)
Returns the value of the specified non-string resource.
Declaration
object GetObject(string objectName)
Parameters
Type | Name | Description |
---|---|---|
System.String | objectName | The name of the resource to get. |
Returns
Type | Description |
---|---|
System.Object | Value of the specified resource. |
GetObject(String, CultureInfo)
Returns the value of the specified non-string resource localized for the specified culture.
Declaration
object GetObject(string objectName, CultureInfo culture)
Parameters
Type | Name | Description |
---|---|---|
System.String | objectName | The name of the resource to retrieve. |
System.Globalization.CultureInfo | culture | An object that represents the culture for which the resource is localized. |
Returns
Type | Description |
---|---|
System.Object | Value of the specified non-string resource. |
GetObjectWithCultureFallback(String, CultureInfo)
Returns the value of the specified non-string resource localized for the specified culture. If value for the specified culture is absent, returns value for the default culture.
Declaration
object GetObjectWithCultureFallback(string objectName, CultureInfo culture)
Parameters
Type | Name | Description |
---|---|---|
System.String | objectName | The name of the resource to retrieve. |
System.Globalization.CultureInfo | culture | An object that represents the culture for which the resource is localized. |
Returns
Type | Description |
---|---|
System.Object | Value of the specified non-string resource. |
GetResourceSet(CultureInfo, Boolean, Boolean)
Retrieves the resource set for a particular culture.
Declaration
ResourceSet GetResourceSet(CultureInfo culture, bool createIfNotExist, bool tryParents)
Parameters
Type | Name | Description |
---|---|---|
System.Globalization.CultureInfo | culture | The culture whose resources are to be retrieved. |
System.Boolean | createIfNotExist |
|
System.Boolean | tryParents |
|
Returns
Type | Description |
---|---|
System.Resources.ResourceSet | The resource set for the specified culture. |
GetString(String)
Returns the value of the specified string resource.
Declaration
string GetString(string itemName)
Parameters
Type | Name | Description |
---|---|---|
System.String | itemName | The name of the resource to retrieve. |
Returns
Type | Description |
---|---|
System.String | Value of the specified string resource. |
GetString(String, CultureInfo)
Returns the value of the string resource localized for the specified culture.
Declaration
string GetString(string itemName, CultureInfo culture)
Parameters
Type | Name | Description |
---|---|---|
System.String | itemName | The name of the resource to retrieve. |
System.Globalization.CultureInfo | culture | An object that represents the culture for which the resource is localized. |
Returns
Type | Description |
---|---|
System.String | Value of the resource localized for the specified culture. |
GetStringWithCultureFallback(String, CultureInfo)
Returns the value of the string resource localized for the specified culture. If value for the specified culture is absent, returns value for the default culture.
Declaration
string GetStringWithCultureFallback(string itemName, CultureInfo culture)
Parameters
Type | Name | Description |
---|---|---|
System.String | itemName | The name of the resource to retrieve. |
System.Globalization.CultureInfo | culture | An object that represents the culture for which the resource is localized. |
Returns
Type | Description |
---|---|
System.String | Value of the resource localized for the specified culture. |
ReleaseAllResources()
Tells the resource manager to release all resources.
Declaration
void ReleaseAllResources()