Interface IDbResourceDataManager

public interface IDbResourceDataManager

Interface Members

MemberDescription

AddResource

Adds a resource to the Localization Table

public int AddResource(ResourceItem resource)

public int AddResource(string resourceId,     object value,     string cultureName,     string resourceSet,     string comment,     bool valueIsFileName,     int valueType)

CreateBackupTable

Create a backup of the localization database.

Note the table used is the one specified in the Configuration.ResourceTableName

public bool CreateBackupTable(string BackupTableName)

CreateLocalizationTable

Creates the Localization table on the current connection string for the provider.

public bool CreateLocalizationTable(string tableName)

DeleteResource

Deletes a specific resource ID based on ResourceId, ResourceSet and Culture. If an empty culture is passed the entire group is removed (ie. all locales).

public bool DeleteResource(string resourceId,     string resourceSet,     string cultureName)

DeleteResourceSet

Deletes an entire resource set from the database. Careful with this function!

public bool DeleteResourceSet(string ResourceSet,     string cultureName)

GenerateResources

Persists resources to the database - first wipes out all resources, then writes them back in from the ResourceSet

public bool GenerateResources(IDictionary resourceList,     string cultureName,     string resourceSet,     bool deleteAllResourceFirst)

GetAllLocaleIds

Gets all the locales for a specific resource set.

Returns a table named TLocaleIds (LocaleId field)

public List GetAllLocaleIds(string resourceSet)

GetAllLocalesForResourceSet

public List GetAllLocalesForResourceSet(string resourceSet)

GetAllResourceIdListItems

Returns an DataTable called TResourceIds with ResourceId and HasValues fields where the ResourceId is formatted for HTML display.

public List GetAllResourceIdListItems(string resourceSet)

GetAllResourceIds

Returns all available resource ids for a given resource set in all languages.

Returns a ResourceIdItem object with ResourecId and HasValue fields. HasValue returns whether there are any entries in any culture for this resourceId

public List GetAllResourceIds(string resourceSet)

GetAllResources

Returns a data table of all the resources for all locales. The result is in a table called TResources that contains all fields of the table. The table is ordered by LocaleId.

This version returns either local or global resources in a Web app

Fields: ResourceId,Value,LocaleId,ResourceSet,Type

public List GetAllResources(bool localResources,     bool applyValueConverters,     string resourceSet)

GetAllResourceSets

Returns all available resource sets

public List GetAllResourceSets(ResourceListingTypes type)

GetAllResourcesForCulture

Gets all the Resourecs and ResourceIds for a given resource set and Locale

returns a table "TResource" ResourceId, Value fields

public List GetAllResourcesForCulture(string resourceSet,     string cultureName)

GetDb

Creates an instance of the DataAccess Data provider

public DataAccessBase GetDb(string connectionString)

GetResourceItem

Returns a resource item that returns both the Value and Comment to the fields to the client.

public ResourceItem GetResourceItem(string resourceId,     string resourceSet,     string cultureName)

GetResourceItems

Returns all resource items for a given resource ID in all locales. Returned as full ResourceItem objects

public IEnumerable GetResourceItems(string resourceId,     string resourceSet,     bool forAllResourceSetLocales)

GetResourceObject

Returns an object from the Resources. Attempts to convert the object to its original type. Use this for any non-string types. Useful for binary resources like images, icons etc.

While this method can be used with strings, GetResourceString() is much more efficient.

public object GetResourceObject(string resourceId,     string resourceSet,     string cultureName)

GetResourcesAsJavascriptObject

Creates an global JavaScript object object that holds all non-control local string resources as property values.

All resources are returned in normalized fashion from most specifc to more generic (de-ch,de,invariant depending on availability)

public string GetResourcesAsJavascriptObject(string javaScriptVarName,     string resourceSet,     string localeId)

GetResourceSet

Returns a specific set of resources for a given culture and 'resource set' which in this case is just the virtual directory and culture.

public IDictionary GetResourceSet(string cultureName,     string resourceSet)

GetResourceSetNormalizedForLocaleId

Returns a fully normalized list of resources that contains the most specific locale version for the culture provided.

This means that this routine walks the resource hierarchy and returns the most specific value in this order: de-ch, de, invariant.

public Dictionary<String,Object> GetResourceSetNormalizedForLocaleId(string cultureName,     string resourceSet)

GetResourceString

Returns an individual Resource String from the database

public string GetResourceString(string resourceId,     string resourceSet,     string cultureName)

GetResourceStrings

Returns all the resource strings for all cultures for a specific resource Id. Returned as a dictionary.

public Dictionary<String,String> GetResourceStrings(string resourceId,     string resourceSet,     bool forAllResourceSetLocales)

IsLocalizationTable

Checks to see if the LocalizationTable exists

public bool IsLocalizationTable(string tableName)

IsValidCulture

Returns true or false depending on whether the two letter country code exists

public bool IsValidCulture(string IetfTag)

RenameResource

Renames a given resource in a resource set. Note all languages will be renamed

public bool RenameResource(string ResourceId,     string NewResourceId,     string ResourceSet)

RenameResourceProperty

Renames all property keys for a given property prefix. So this routine updates lblName.Text, lblName.ToolTip to lblName2.Text, lblName2.ToolTip if the property is changed from lblName to lblName2.

public bool RenameResourceProperty(string Property,     string NewProperty,     string ResourceSet)

RenameResourceSet

Renames a resource set. Useful if you need to move a local page resource set to a new page. ResourceSet naming for local resources is application relative page path:

test.aspx subdir/test.aspx

Global resources have a simple name

public bool RenameResourceSet(string OldResourceSet,     string NewResourceSet)

ResourceExists

Checks to see if a resource exists in the resource store

public bool ResourceExists(string ResourceId,     string CultureName,     string ResourceSet)

RestoreBackupTable

Restores the localization table from a backup table by first wiping out

public bool RestoreBackupTable(string backupTableName)

SetError

public void SetError()

public void SetError(string message)

public void SetError(Exception ex)

UpdateOrAddResource

Updates a resource if it exists, if it doesn't one is created

public int UpdateOrAddResource(ResourceItem resource)

public int UpdateOrAddResource(string resourceId,     object value,     string cultureName,     string resourceSet,     string comment,     bool valueIsFileName,     int valueType)

UpdateResource

Updates an existing resource in the Localization table

public int UpdateResource(string resourceId,     object value,     string cultureName,     string resourceSet,     string comment,     bool valueIsFileName,     int valueType)

public int UpdateResource(ResourceItem resource)

Configuration

Instance of the DbResourceConfiguration that can be overridden Defaults to the default instance - DbResourceConfiguration.Current

ErrorMessage

Error message that can be checked after a method complets and returns a failure result.

Requirements

Namespace: Westwind.Globalization
Assembly: westwind.globalization.dll

© West Wind Technologies, 2006 - 2019 • Updated: 01/24/18
Comment or report problem with topic