WPF

Code Examples Upgrade Guide User Guide Demos Support Forums Download
  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class LocalizationResourceAccessor

    Show / Hide Table of Contents

    Class LocalizationResourceAccessor

    Represents the class that manages the localization for syncfusion controls.

    Inheritance
    System.Object
    LocalizationResourceAccessor
    DiagramLocalizationResourceAccessor
    DiagramRibbonLocalizationResourceAccessor
    GridLocalizationResourceAccessor
    SchedulerLocalizationResourceAccessor
    SpreadsheetLocalizationResourceAccessor
    TreeViewLocalizationResourceAccessor
    InputLocalizationResourceAccessor
    ColorPaletteLocalizationResourceAccessor
    PivotAnalysisLocalizationResourceAccessor
    RichTextBoxAdvLocalizationResourceAccessor
    RichTextRibbonLocalizationResourceAccessor
    SfSharedLocalizationResourceAccessor
    SpellCheckerLocalizationResourceAccessor
    EditLocalizationResourceAccessor
    PdfViewerLocalizationResourceAccessor
    PropertyGridLocalizationResourceAccessor
    SharedLocalizationResourceAccessor
    ToolsLocalizationResourceAccessor
    Inherited Members
    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: Syncfusion.Windows.Shared
    Assembly: Syncfusion.Shared.Wpf.dll
    Syntax
    public class LocalizationResourceAccessor

    Constructors

    LocalizationResourceAccessor()

    Initializes new instance of LocalizationResourceAccessor.

    Declaration
    public LocalizationResourceAccessor()

    Fields

    Resources

    Holds the resource manager of the LocalizationResourceAccessor

    Declaration
    public ResourceManager Resources
    Field Value
    Type Description
    System.Resources.ResourceManager

    Methods

    GetControlAssembly()

    Gets the assembly of the project.

    Declaration
    protected virtual Assembly GetControlAssembly()
    Returns
    Type Description
    System.Reflection.Assembly

    Returns assembly of the project.

    GetControlAssemblyDefaultNamespace()

    Gets the default namespace of the referred project.

    Declaration
    protected virtual string GetControlAssemblyDefaultNamespace()
    Returns
    Type Description
    System.String

    Default namespace of the control assembly

    GetDefaultResourceManager()

    Gets the default resource manager of the project.

    Declaration
    protected virtual ResourceManager GetDefaultResourceManager()
    Returns
    Type Description
    System.Resources.ResourceManager

    Default resource manager.

    GetString(CultureInfo, String)

    Gets the localized text.

    Declaration
    public string GetString(CultureInfo culture, string name)
    Parameters
    Type Name Description
    System.Globalization.CultureInfo culture

    Current UI culture.

    System.String name

    String that has to be localized.

    Returns
    Type Description
    System.String

    The localized string

    GetString(String)

    Gets the localized text.

    Declaration
    public string GetString(string name)
    Parameters
    Type Name Description
    System.String name

    String that has to be localized.

    Returns
    Type Description
    System.String

    The localized string.

    GetString(String, Object[])

    Gets the localized text.

    Declaration
    public string GetString(string name, params object[] args)
    Parameters
    Type Name Description
    System.String name

    String that has to be localized.

    System.Object[] args

    Control object

    Returns
    Type Description
    System.String

    The localized string.

    SetResources(Assembly, String)

    Sets the resource manager based on the assembly and namespace. It can be used to get the values from the application resource files when the assembly name and the namespace of the control or application is different.

    Declaration
    public void SetResources(Assembly lookupassembly, string nameSpace)
    Parameters
    Type Name Description
    System.Reflection.Assembly lookupassembly

    The control assembly.

    System.String nameSpace

    The namespace of the control.

    Examples
    //For the controls in shared wpf assembly. Localization WPF is the project namespace and GetType().Assembly returns the assembly of that project.
    SharedLocalizationResourceAccessor.Instance.SetResources(GetType().Assembly, "LocalizationWPF");
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved