Class DbResXConverter

This class can be used to export resources from the database to ASP.NET compatible resources (Resx). This class takes all the resources in the database and creates RESX files that match these resources.

Please note that it will overrwrite any existing resource files if they already exist, so please use this class with care if you have existing ResX resources.

Note this class is primarily ASP.NET specific in that it looks at ASP.NET specific directory structures for ResX imports and strongly typed resource creation.

System.Object
  Westwind.Globalization.DbResXConverter
public class DbResXConverter : object

Class Members

MemberDescription

Constructor

Creates new instance with the default Web Application base path set to the current Web application's path.

ResXDocumentTemplate

FormatResourceSetPath

Returns the path the resource file withouth the resx and localeId extension

public string FormatResourceSetPath(string resourceSet)

FormatWebResourceSetPath

Translates the resource set path ASP.NET WebForms Global or local resource path base (ie. without the .resx and localeId extension).

public string FormatWebResourceSetPath(string ResourceSet,     bool LocalResources)

GenerateGlobalWebResourceResXFiles

Genereates Local Web Resource ResX files from the DbResourceDataManager

public bool GenerateGlobalWebResourceResXFiles()

GenerateLocalWebResourceResXFiles

Genereates Local Web Resource ResX files from the DbResourceDataManager

public bool GenerateLocalWebResourceResXFiles()

GenerateResXFiles

Generates Resx Files for standard non-Web Resource files based on the BasePhysicalPath

public bool GenerateResXFiles(IEnumerable resourceSets,     bool generateStronglyTypedClasses)

GetCompiledResourcesNormalizedForLocale

Returns resources for a given resource set in a specific locale

public Dictionary<String,Object> GetCompiledResourcesNormalizedForLocale(string resourceSet,     string baseNamespace,     string localeId)

GetResourcesNormalizedForLocale

public Dictionary<String,Object> GetResourcesNormalizedForLocale(ResourceManager resourceManager,     string localeId)

GetResXResourcesNormalizedForLocale

Returns all resources for a given locale normalized down the hierarchy for a given resource file. The resource file should be specified without the .resx and locale identifier extensions.

public Dictionary<String,Object> GetResXResourcesNormalizedForLocale(string baseFile,     string LocaleId)

ImportDirectoryResources

public bool ImportDirectoryResources(string path,     string relativePath)

ImportResourceFile

Imports an individual ResX Resource file into the database

public bool ImportResourceFile(string FileName,     string ResourceSetName,     string LocaleId)

ImportWebResources

Imports ResX Web Resources of a Web application by parsing through the App_GlobalResources and App_LocalResources directories of a Web site.

Note: Requires that WebPhysicalPath is set to point at the Web root directory.

public bool ImportWebResources(string webPath)

ImportWinResources

Imports Resources recursively from a non-Web project

public bool ImportWinResources(string basePhysicalPath)

IsLocalResourceSet

Determines if a resourceset is a local resource based on the extension of the resource set

public static bool IsLocalResourceSet(string resourceSet)

BasePhysicalPath

The physical path of the Web application. This path serves as the root path to write resources to.

Example: c:\projects\MyWebApp

ErrorMessage

Error message if an operation fails

Requirements

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

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