Dependencies: DbResourceConfiguration (holds and reads all config data from .Current) SqlDataAccess (provides a data access (DAL))
public class DbResourceDataManager : object
Member | Description | |
---|---|---|
Constructor | Default constructor. Instantiates with the default connection string which is loaded from the configuration section. | |
TableCreationSql | ||
AddResource | Adds a resource to the Localization Table public int AddResource(string ResourceId,
object Value, string CultureName, string ResourceSet, string Comment); public int AddResource(string ResourceId,
object Value, string CultureName, string ResourceSet, string Comment, bool ValueIsFileName); |
|
CreateBackupTable | Create a backup of the localization database. 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 CultureName, string ResourceSet); |
|
DeleteResourceSet | Deletes an entire resource set from the database. Careful with this function! public bool DeleteResourceSet(string ResourceSet);
|
|
EmbedResourcesAsJavascriptObject | Creates an global JavaScript object object that holds all non-control local string resources as property values and embeds this object directly into an ASP.NET page. public void EmbedResourcesAsJavascriptObject(string javaScriptVarName,
string ResourceSet, Page page); |
|
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 BaseName, bool DeleteAllResourceFirst); |
|
GetAllLocaleIds | Gets all the locales for a specific resource set. public DataTable GetAllLocaleIds(string ResourceSet);
|
|
GetAllResourceIds | Returns all available resource ids for a given resource set in all languages. public DataTable GetAllResourceIds(string ResourceSet);
|
|
GetAllResourceIdsForHtmlDisplay | Returns an DataTable called TResourceIds with ResourceId and HasValues fields where the ResourceId is formatted for HTML display. public ListItem[] GetAllResourceIdsForHtmlDisplay(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. public DataTable GetAllResources(bool LocalResources);
public DataTable GetAllResources();
|
|
GetAllResourceSets | Returns all available resource sets public DataTable GetAllResourceSets(ResourceListingTypes Type);
|
|
GetAllResourcesForCulture | Gets all the Resourecs and ResourceIds for a given resource set and Locale public DataTable GetAllResourcesForCulture(string ResourceSet,
string CultureName); |
|
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); |
|
GetResourceObject | Returns an object from the Resources. Use this for any non-string types. 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. 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. 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. public Dictionary<String,String> GetResourceStrings(string ResourceId,
string ResourceSet); |
|
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: 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);
|
|
UpdateOrAdd | Updates a resource if it exists, if it doesn't one is created public int UpdateOrAdd(string ResourceId,
object Value, string CultureName, string ResourceSet, string Comment); public int UpdateOrAdd(string ResourceId,
object Value, string CultureName, string ResourceSet, string Comment, bool ValueIsFileName); |
|
UpdateResource | public int UpdateResource(string ResourceId,
object Value, string CultureName, string ResourceSet, string Comment); public int UpdateResource(string ResourceId,
object Value, string CultureName, string ResourceSet, string Comment, bool ValueIsFileName); |
|
ErrorMessage | Error message that can be checked after a method complets and returns a failure result. |