Method | Description | |
---|---|---|
AddResource ( Westwind.Globalization.ResourceItem resource ) : int |
Adds a resource to the Localization Table
|
|
AddResource ( string resourceId, object value, string cultureName, string resourceSet, string comment = null, bool valueIsFileName = false, int valueType ) : int |
Adds a resource to the Localization Table
|
|
CreateBackupTable ( string BackupTableName ) : bool |
Create a backup of the localization database. Note the table used is the one specified in the Configuration.ResourceTableName
|
|
CreateDbResourceDataManager ( DbResourceProviderTypes type ) : |
Create an instance of the provider based on the resource type
|
|
CreateDbResourceDataManager ( |
Creates an instance of the DbResourceDataManager based on configuration settings
|
|
CreateLocalizationTable ( string tableName = null ) : bool |
Creates the Localization table on the current connection string for the provider.
|
|
DeleteResource ( string resourceId, string resourceSet = null, string cultureName = null ) : bool |
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).
|
|
DeleteResourceSet ( string ResourceSet, string cultureName = null ) : bool |
Deletes an entire resource set from the database. Careful with this function!
|
|
GenerateResources ( IDictionary resourceList, string cultureName, string resourceSet, bool deleteAllResourceFirst ) : bool |
Persists resources to the database - first wipes out all resources, then writes them back in from the ResourceSet
|
|
GetAllLocaleIds ( string resourceSet ) : List |
Gets all the locales for a specific resource set. Returns a table named TLocaleIds (LocaleId field)
|
|
GetAllLocalesForResourceSet ( string resourceSet ) : List |
||
GetAllResourceIdListItems ( string resourceSet ) : List |
Returns a list with ResourceId and HasValues fields where the ResourceId is formatted for HTML display.
|
|
GetAllResourceIds ( string resourceSet ) : List |
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
|
|
GetAllResourceSets ( ResourceListingTypes type ) : List |
Returns all available resource sets
|
|
GetAllResources ( bool localResources = false, bool applyValueConverters = false, string resourceSet = null ) : List |
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
|
|
GetAllResourcesForCulture ( string resourceSet, string cultureName ) : List |
Gets all the Resourecs and ResourceIds for a given resource set and Locale returns a table "TResource" ResourceId, Value fields
|
|
GetDb ( string connectionString = null ) : DataAccessBase |
Creates an instance of the DataAccess Data provider
|
|
GetFileInfo ( string fileName, bool noPhysicalFile = false ) : |
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
|
|
GetResourceItem ( string resourceId, string resourceSet, string cultureName ) : Westwind.Globalization.ResourceItem |
Returns a resource item that returns both the Value and Comment to the fields to the client.
|
|
GetResourceItems ( string resourceId, string resourceSet, bool forAllResourceSetLocales = false ) : IEnumerable |
Returns all resource items for a given resource ID in all locales. Returned as full ResourceItem objects
|
|
GetResourceObject ( string resourceId, string resourceSet, string cultureName ) : object |
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.
|
|
GetResourceSet ( string cultureName, string resourceSet ) : IDictionary |
Returns a specific set of resources for a given culture and 'resource set' which in this case is just the virtual directory and culture.
|
|
GetResourceSetNormalizedForLocaleId ( string cultureName, string resourceSet ) : object>.Dictionary |
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.
|
|
GetResourceString ( string resourceId, string resourceSet, string cultureName ) : string |
Returns an individual Resource String from the database
|
|
GetResourceStrings ( string resourceId, string resourceSet, bool forAllResourceSetLocales = false ) : string>.Dictionary |
Returns all the resource strings for all cultures for a specific resource Id. Returned as a dictionary.
|
|
GetResourcesAsJavascriptObject ( string javaScriptVarName, string resourceSet, string localeId ) : string |
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)
|
|
IsLocalizationTable ( string tableName = null ) : bool |
Checks to see if the LocalizationTable exists
|
|
IsValidCulture ( string IetfTag ) : bool |
Returns true or false depending on whether the two letter country code exists
|
|
RenameResource ( string ResourceId, string NewResourceId, string ResourceSet ) : bool |
Renames a given resource in a resource set. Note all languages will be renamed
|
|
RenameResourceProperty ( string Property, string NewProperty, string ResourceSet ) : bool |
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.
|
|
RenameResourceSet ( string OldResourceSet, string NewResourceSet ) : bool |
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
|
|
ResourceExists ( string ResourceId, string CultureName, string ResourceSet ) : bool |
Checks to see if a resource exists in the resource store
|
|
RestoreBackupTable ( string backupTableName ) : bool |
Restores the localization table from a backup table by first wiping out
|
|
SetError ( ) : void | ||
SetError ( |
||
SetError ( string message ) : void | ||
SetFileDataOnResourceItem ( Westwind.Globalization.ResourceItem item, byte data, string fileName ) : Westwind.Globalization.ResourceItem | ||
UpdateOrAddResource ( Westwind.Globalization.ResourceItem resource ) : int |
Updates a resource if it exists, if it doesn't one is created
|
|
UpdateOrAddResource ( string resourceId, object value, string cultureName, string resourceSet, string comment = null, bool valueIsFileName = false, int valueType ) : int |
Updates a resource if it exists, if it doesn't one is created
|
|
UpdateResource ( Westwind.Globalization.ResourceItem resource ) : int |
Updates a resource if it exists, if it doesn't one is created
|
|
UpdateResource ( string resourceId, object value, string cultureName, string resourceSet, string comment = null, bool valueIsFileName = false, int valueType ) : int |
Updates an existing resource in the Localization table
|
Method | Description | |
---|---|---|
DbResourceDataManager ( ) : System | ||
DeserializeValue ( string serializedValue, string resourceType ) : object |
Deserializes serialized data in JSON format based on a type name provided in the resource type parameter.
|
|
OnResourceSetValueConvert ( object &resourceValue, string key, int valueType ) : void | ||
SerializeValue ( object value ) : string |
Serializes a value to string that can be stored in data storage. Used for serializing arbitrary objects to store in the application
|
Method | Description | |
---|---|---|
LoadFileResource ( IDataReader reader ) : object |
Internal method used to parse the data in the database into a 'real' value. Value field hold filename and type string TextFile,BinFile hold the actual file content
|
public AddResource ( Westwind.Globalization.ResourceItem resource ) : int | ||
resource | Westwind.Globalization.ResourceItem | Resource to update |
return | int |
public AddResource ( string resourceId, object value, string cultureName, string resourceSet, string comment = null, bool valueIsFileName = false, int valueType ) : int | ||
resourceId | string | The resource key name |
value | object | Value to set it to. Can also be a file which is loaded as binary data when valueIsFileName is true |
cultureName | string | name of the culture or null for invariant/default |
resourceSet | string | The ResourceSet to which the resource id is added |
comment | string | Optional comment for the key |
valueIsFileName | bool | if true the Value property is a filename to import |
valueType | int | |
return | int |
public CreateBackupTable ( string BackupTableName ) : bool | ||
BackupTableName | string | Table of the backup table. Null creates a _Backup table. |
return | bool |
public static CreateDbResourceDataManager ( DbResourceProviderTypes type ) : |
||
type | DbResourceProviderTypes | |
return |
public static CreateDbResourceDataManager ( |
||
managerType | ||
return |
public CreateLocalizationTable ( string tableName = null ) : bool | ||
tableName | string | |
return | bool |
public DeleteResource ( string resourceId, string resourceSet = null, string cultureName = null ) : bool | ||
resourceId | string | Resource Id to delete |
resourceSet | string | The resource set to remove |
cultureName | string | language ID - if empty all languages are deleted |
return | bool |
public DeleteResourceSet ( string ResourceSet, string cultureName = null ) : bool | ||
ResourceSet | string | |
cultureName | string | |
return | bool |
protected DeserializeValue ( string serializedValue, string resourceType ) : object | ||
serializedValue | string | JSON encoded string |
resourceType | string | Type name to deserialize - type must be referenced by the app |
return | object |
public GenerateResources ( IDictionary resourceList, string cultureName, string resourceSet, bool deleteAllResourceFirst ) : bool | ||
resourceList | IDictionary | |
cultureName | string | |
resourceSet | string | |
deleteAllResourceFirst | bool | |
return | bool |
public GetAllLocaleIds ( string resourceSet ) : List |
||
resourceSet | string | |
return | List |
public GetAllLocalesForResourceSet ( string resourceSet ) : List |
||
resourceSet | string | |
return | List |
public GetAllResourceIdListItems ( string resourceSet ) : List |
||
resourceSet | string | |
return | List |
public GetAllResourceIds ( string resourceSet ) : List |
||
resourceSet | string | |
return | List |
public GetAllResourceSets ( ResourceListingTypes type ) : List |
||
type | ResourceListingTypes | |
return | List |
public GetAllResources ( bool localResources = false, bool applyValueConverters = false, string resourceSet = null ) : List |
||
localResources | bool | return local resources if true |
applyValueConverters | bool | |
resourceSet | string | |
return | List |
public GetAllResourcesForCulture ( string resourceSet, string cultureName ) : List |
||
resourceSet | string | |
cultureName | string | |
return | List |
public GetDb ( string connectionString = null ) : DataAccessBase | ||
connectionString | string | |
return | DataAccessBase |
public static GetFileInfo ( string fileName, bool noPhysicalFile = false ) : |
||
fileName | string | |
noPhysicalFile | bool | |
return |
public GetResourceItem ( string resourceId, string resourceSet, string cultureName ) : Westwind.Globalization.ResourceItem | ||
resourceId | string | The ID of the resource to retrieve |
resourceSet | string | Name of the ResourceSet to return |
cultureName | string | required. Null or Empty returns invariant |
return | Westwind.Globalization.ResourceItem |
public GetResourceItems ( string resourceId, string resourceSet, bool forAllResourceSetLocales = false ) : IEnumerable |
||
resourceId | string | The resource Id to return for |
resourceSet | string | Resourceset to look in |
forAllResourceSetLocales | bool | When true returns empty entries for missing resources of locales in this resource set |
return | IEnumerable |
public GetResourceObject ( string resourceId, string resourceSet, string cultureName ) : object | ||
resourceId | string | |
resourceSet | string | |
cultureName | string | required. Null or Empty culture returns invariant |
return | object |
public GetResourceSet ( string cultureName, string resourceSet ) : IDictionary | ||
cultureName | string | name of the culture Id (de, de-de) to retrieve |
resourceSet | string | Name of the resource set to retrieve |
return | IDictionary |
public GetResourceSetNormalizedForLocaleId ( string cultureName, string resourceSet ) : object>.Dictionary |
||
cultureName | string | |
resourceSet | string | |
return | object>.Dictionary |
public GetResourceString ( string resourceId, string resourceSet, string cultureName ) : string | ||
resourceId | string | |
resourceSet | string | |
cultureName | string | |
return | string |
public GetResourceStrings ( string resourceId, string resourceSet, bool forAllResourceSetLocales = false ) : string>.Dictionary |
||
resourceId | string | Resource Id to retrieve strings for |
resourceSet | string | Resource Set on which to retrieve strings |
forAllResourceSetLocales | bool | If true returns empty entries for each locale that exists but has no value in this resource set |
return | string>.Dictionary |
public GetResourcesAsJavascriptObject ( string javaScriptVarName, string resourceSet, string localeId ) : string | ||
javaScriptVarName | string | Name of the JS object variable to createBackupTable |
resourceSet | string | ResourceSet name. Pass NULL for locale Resources |
localeId | string | |
return | string |
public IsLocalizationTable ( string tableName = null ) : bool | ||
tableName | string | Table name or the configuration.ResourceTableName if not passed |
return | bool |
public IsValidCulture ( string IetfTag ) : bool | ||
IetfTag | string | two or four letter IETF tag (examples: de, de-DE,fr,fr-CA) |
return | bool |
protected OnResourceSetValueConvert ( object &resourceValue, string key, int valueType ) : void | ||
resourceValue | object | |
key | string | |
valueType | int | |
return | void |
public RenameResource ( string ResourceId, string NewResourceId, string ResourceSet ) : bool | ||
ResourceId | string | |
NewResourceId | string | |
ResourceSet | string | |
return | bool |
public RenameResourceProperty ( string Property, string NewProperty, string ResourceSet ) : bool | ||
Property | string | |
NewProperty | string | |
ResourceSet | string | |
return | bool |
public RenameResourceSet ( string OldResourceSet, string NewResourceSet ) : bool | ||
OldResourceSet | string | Name of the existing resource set |
NewResourceSet | string | Name to set the resourceset name to |
return | bool |
public ResourceExists ( string ResourceId, string CultureName, string ResourceSet ) : bool | ||
ResourceId | string | |
CultureName | string | |
ResourceSet | string | |
return | bool |
public RestoreBackupTable ( string backupTableName ) : bool | ||
backupTableName | string | |
return | bool |
protected SerializeValue ( object value ) : string | ||
value | object | |
return | string |
public static SetFileDataOnResourceItem ( Westwind.Globalization.ResourceItem item, byte data, string fileName ) : Westwind.Globalization.ResourceItem | ||
item | Westwind.Globalization.ResourceItem | |
data | byte | |
fileName | string | |
return | Westwind.Globalization.ResourceItem |
public UpdateOrAddResource ( Westwind.Globalization.ResourceItem resource ) : int | ||
resource | Westwind.Globalization.ResourceItem | Resource to update |
return | int |
public UpdateOrAddResource ( string resourceId, object value, string cultureName, string resourceSet, string comment = null, bool valueIsFileName = false, int valueType ) : int | ||
resourceId | string | |
value | object | |
cultureName | string | |
resourceSet | string | |
comment | string | |
valueIsFileName | bool | |
valueType | int | |
return | int |
public UpdateResource ( Westwind.Globalization.ResourceItem resource ) : int | ||
resource | Westwind.Globalization.ResourceItem | Resource to update |
return | int |
public UpdateResource ( string resourceId, object value, string cultureName, string resourceSet, string comment = null, bool valueIsFileName = false, int valueType ) : int | ||
resourceId | string | |
value | object | |
cultureName | string | |
resourceSet | string | |
comment | string | |
valueIsFileName | bool | |
valueType | int | |
return | int |