Class DbResourceManager

This class provides a databased implementation of a ResourceManager.

A ResourceManager holds each of the InternalResourceSets for a given group of resources. In ResX files a group is a file group wiht the same name (ie. Resources.resx, Resources.en.resx, Resources.de.resx). In this database driven provider the group is determined by the ResourceSet and the LocaleId as stored in the database. This class is instantiated and gets passed both of these values for identity.

An application can have many ResourceManagers - one for each localized page and one for each global resource with each hold multiple resourcesets for each of the locale's that are part of that resourceSet.

This class implements only the GetInternalResourceSet method to provide the ResourceSet from a database. It also implements all the base class constructors and captures only the BaseName which is the name of the ResourceSet (ie. a global or local resource group)

Dependencies: DbResourceDataManager for data access DbResourceConfiguration which holds and reads config settings

DbResourceSet DbResourceReader

System.Object
  System.Resources.ResourceManager
    Westwind.Globalization.DbResourceManager
public class DbResourceManager : ResourceManager

Class Members

MemberDescription

Constructor

Constructs a DbResourceManager object

Configuration

Configuration used to access the Db Resources. If not set uses the static global configuration, otherwise you can pass in a customized configuration that is used by this provider

AddMissingResource

Add a new resource to the base resource set

public void AddMissingResource(string name,     string value,     CultureInfo culture)

GetObject

Core worker method on the manager that returns resource. This override returns the resource for the currently active UICulture for this manager/resource set.

If resource is not found it returns null

public virtual object GetObject(string name)

public virtual object GetObject(string name,     CultureInfo culture)

ReleaseAllResources

Clears all resource sets and forces reloading on next resource set retrieval. Effectively this refreshes resources if the source has changed. Required to see DB changes in the live UI.

public virtual void ReleaseAllResources()

AutoAddMissingEntries

If true causes any entries that aren't found to be added

ResourceSetType

Requirements

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

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