C# Class Westwind.Globalization.DbResourceConfiguration

The configuration class that is used to configure the Resource Provider. This class contains various configuration settings that the provider requires to operate both at design time and runtime. The application uses the static Current property to access the actual configuration settings object. By default it reads the configuration settings from web.config (at runtime). You can override this behavior by creating your own configuration object and assigning it to the DbResourceConfiguration.Current property.
Inheritance: Westwind.Utilities.Configuration.AppConfiguration
Show file Open project: RickStrahl/Westwind.Globalization Class Usage Examples

Public Properties

Property Type Description
ConfigurationMode ConfigurationModes
Current DbResourceConfiguration
LoadedProviders List
ResourceSetValueConverters List

Public Methods

Method Description
AddResourceSetValueConverter ( IResourceSetValueConverter converter ) : void
ClearResourceCache ( ) : void

This static method clears all resources from the loaded Resource Providers and forces them to be reloaded the next time they are requested. Use this method after you've edited resources in the database and you want to refresh the UI to show the newly changed values. This method works by internally tracking all the loaded ResourceProvider instances and calling the IwwResourceProvider.ClearResourceCache() method on each of the provider instances. This method is called by the Resource Administration form when you explicitly click the Reload Resources button. Class DbResourceConfiguration

CreateDbResourceDataManager ( ) : DbResourceDataManager

Creates an instance of the DbResourceDataManager based on configuration settings

Protected Methods

Method Description
OnCreateDefaultProvider ( string sectionName, object configData ) : IConfigurationProvider

Override this method to create the custom default provider. Here we allow for different configuration providers so we don't have to rely on .NET configuration classed (for vNext)

Private Methods

Method Description
DbResourceConfiguration ( ) : System

Static constructor for the Current property - guarantees this code fires exactly once giving us a singleton instance of the configuration object.

Method Details

AddResourceSetValueConverter() public method

public AddResourceSetValueConverter ( IResourceSetValueConverter converter ) : void
converter IResourceSetValueConverter
return void

ClearResourceCache() public static method

This static method clears all resources from the loaded Resource Providers and forces them to be reloaded the next time they are requested. Use this method after you've edited resources in the database and you want to refresh the UI to show the newly changed values. This method works by internally tracking all the loaded ResourceProvider instances and calling the IwwResourceProvider.ClearResourceCache() method on each of the provider instances. This method is called by the Resource Administration form when you explicitly click the Reload Resources button. Class DbResourceConfiguration
public static ClearResourceCache ( ) : void
return void

CreateDbResourceDataManager() public static method

Creates an instance of the DbResourceDataManager based on configuration settings
public static CreateDbResourceDataManager ( ) : DbResourceDataManager
return DbResourceDataManager

OnCreateDefaultProvider() protected method

Override this method to create the custom default provider. Here we allow for different configuration providers so we don't have to rely on .NET configuration classed (for vNext)
protected OnCreateDefaultProvider ( string sectionName, object configData ) : IConfigurationProvider
sectionName string
configData object
return IConfigurationProvider

Property Details

ConfigurationMode public static property

Determines how configuration information is stored: Config, Json or XML Default uses .NET configuration files.
public static ConfigurationModes ConfigurationMode
return ConfigurationModes

Current public static property

A global instance of the current configuration. By default this instance reads its configuration values from web.config at runtime, but it can be overridden to assign specific values or completely replace this object. NOTE: Any assignment made to this property should be made at Application_Start or other 'application initialization' event so that these settings are applied BEFORE the resource provider is used for the first time.
public static DbResourceConfiguration,Westwind.Globalization Current
return DbResourceConfiguration

LoadedProviders public static property

Keep track of loaded providers so we can unload them
public static List LoadedProviders
return List

ResourceSetValueConverters public property

public List ResourceSetValueConverters
return List