Class JsonResourceSerializer

Provides convenient access to culture-specific client resources at run time Use GetResourcesAsJson to get the JSON object.

Inheritance
System.Object
System.Resources.ResourceManager
JsonResourceSerializer
Inherited Members
System.Resources.ResourceManager.BaseNameField
System.Resources.ResourceManager.ResourceSets
System.Resources.ResourceManager.MainAssembly
System.Resources.ResourceManager.MagicNumber
System.Resources.ResourceManager.HeaderVersionNumber
System.Resources.ResourceManager.ReleaseAllResources()
System.Resources.ResourceManager.CreateFileBasedResourceManager(System.String, System.String, System.Type)
System.Resources.ResourceManager.GetResourceFileName(System.Globalization.CultureInfo)
System.Resources.ResourceManager.GetResourceSet(System.Globalization.CultureInfo, System.Boolean, System.Boolean)
System.Resources.ResourceManager.InternalGetResourceSet(System.Globalization.CultureInfo, System.Boolean, System.Boolean)
System.Resources.ResourceManager.GetSatelliteContractVersion(System.Reflection.Assembly)
System.Resources.ResourceManager.GetNeutralResourcesLanguage(System.Reflection.Assembly)
System.Resources.ResourceManager.GetString(System.String)
System.Resources.ResourceManager.GetString(System.String, System.Globalization.CultureInfo)
System.Resources.ResourceManager.GetObject(System.String)
System.Resources.ResourceManager.GetObject(System.String, System.Globalization.CultureInfo)
System.Resources.ResourceManager.GetStream(System.String)
System.Resources.ResourceManager.GetStream(System.String, System.Globalization.CultureInfo)
System.Resources.ResourceManager.BaseName
System.Resources.ResourceManager.IgnoreCase
System.Resources.ResourceManager.ResourceSetType
System.Resources.ResourceManager.FallbackLocation
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Shell.Resources
Assembly: EPiServer.Shell.dll
Version: 8.11.0
Syntax
public class JsonResourceSerializer : ResourceManager

Constructors

JsonResourceSerializer(Type)

Initializes a new instance of the JsonResourceSerializer class.

Declaration
public JsonResourceSerializer(Type resourceType)
Parameters
Type Name Description
System.Type resourceType

A System.Type from which the System.Resources.ResourceManager derives all information for finding .resources files.

Methods

GetMergedResources(CultureInfo)

Merges the resources for cultureInfo with the neutral resources

Declaration
protected virtual Dictionary<string, string> GetMergedResources(CultureInfo culture)
Parameters
Type Name Description
System.Globalization.CultureInfo culture

The culture you want your resources in

Returns
Type Description
System.Collections.Generic.Dictionary<System.String, System.String>

Dictionary containing the merged resources

Remarks

Will only return resources that are of type System.String

GetResourcesAsJson(CultureInfo)

Gets the resources as a JSON object. The Resources for the cultre are merged with the neutral cultures for the type which resource manager were created for. This means that if you are asking for a resource in Swedish and it does not exist you will get the resource in the language which the assmbly has set as neutral.

Declaration
public virtual string GetResourcesAsJson(CultureInfo culture)
Parameters
Type Name Description
System.Globalization.CultureInfo culture

The culture you want your resources in.

Returns
Type Description
System.String

A string representing the JSON object. "{[ResourceKey]:[ResourceValue], [ResourceKey]:[ResourceValue]}"

Remarks

Will only return resources that are of type System.String