Class DbResourceDataManager
public abstract class DbResourceDataManager : object, IDbResourceDataManager

Class Members



Adds a resource to the Localization Table

public virtual int AddResource(ResourceItem resource)

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


Create a backup of the localization database.

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

public virtual bool CreateBackupTable(string BackupTableName)


Creates an instance of the DbResourceDataManager based on configuration settings

public static DbResourceDataManager CreateDbResourceDataManager(Type managerType,     DbResourceConfiguration configuration)

public static DbResourceDataManager CreateDbResourceDataManager(DbResourceProviderTypes type,     DbResourceConfiguration configuration)


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

public virtual bool CreateLocalizationTable(string tableName)


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 virtual bool DeleteResource(string resourceId,     string resourceSet,     string cultureName)


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

public virtual bool DeleteResourceSet(string ResourceSet,     string cultureName)


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

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


Gets all the locales for a specific resource set.

Returns a table named TLocaleIds (LocaleId field)

public virtual List GetAllLocaleIds(string resourceSet)


public virtual List GetAllLocalesForResourceSet(string resourceSet)


Returns a list with ResourceId and HasValues fields where the ResourceId is formatted for HTML display.

public virtual List GetAllResourceIdListItems(string resourceSet)


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 virtual List GetAllResourceIds(string resourceSet)


Returns a list 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 virtual List GetAllResources(bool localResources,     bool applyValueConverters,     string resourceSet)


Returns all available resource sets

public virtual List GetAllResourceSets(ResourceListingTypes type)


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

returns a table "TResource" ResourceId, Value fields

public virtual List GetAllResourcesForCulture(string resourceSet,     string cultureName)


Creates an instance of the DataAccess Data provider

public virtual DataAccessBase GetDb(string connectionString)


Internal routine that looks at a file and based on its extension determines how that file needs to be stored in the database. Returns FileInfoFormat structure

public static FileInfoFormat GetFileInfo(string fileName,     bool noPhysicalFile)


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

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


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

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


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 virtual object GetResourceObject(string resourceId,     string resourceSet,     string cultureName)


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 virtual string GetResourcesAsJavascriptObject(string javaScriptVarName,     string resourceSet,     string localeId)


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 virtual IDictionary GetResourceSet(string cultureName,     string resourceSet)


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 virtual Dictionary<String,Object> GetResourceSetNormalizedForLocaleId(string cultureName,     string resourceSet)


Returns an individual Resource String from the database

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


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

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


Checks to see if the LocalizationTable exists

public virtual bool IsLocalizationTable(string tableName)


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

public virtual bool IsValidCulture(string IetfTag)


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

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


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 virtual bool RenameResourceProperty(string Property,     string NewProperty,     string ResourceSet)


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 virtual bool RenameResourceSet(string OldResourceSet,     string NewResourceSet)


Checks to see if a resource exists in the resource store

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


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

public virtual bool RestoreBackupTable(string backupTableName)


public sealed void SetError()

public sealed void SetError(string message)

public sealed void SetError(Exception ex)


public static ResourceItem SetFileDataOnResourceItem(ResourceItem item,     Byte[] data,     string fileName)


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

public virtual int UpdateOrAddResource(ResourceItem resource)

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


Updates an existing resource in the Localization table

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

public virtual int UpdateResource(ResourceItem resource)


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


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


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

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