New to Telerik UI for WinForms? Start a free 30-day trial

Loads RichTextBox localization strings from the built-in resource, a file, a resource, or a stream.

Definition

Namespace:Telerik.WinForms.RichTextEditor

Assembly:Telerik.WinControls.RichTextEditor.dll

Syntax:

C#
public class RichTextBoxLocalizationProvider

Inheritance: objectRichTextBoxLocalizationProvider

Constructors

Creates a provider initialized with the RichTextBox localization strings embedded in this assembly.

C#
public RichTextBoxLocalizationProvider()

Creates a provider from localization XML in a stream. Entries are read from children of the root element that have a name attribute and a value child. Malformed XML, a missing root, a missing name attribute, or a duplicate key leaves the provider without loaded strings.

C#
public RichTextBoxLocalizationProvider(Stream input)
Parameters:inputStream

The stream containing the localization XML; the stream is not disposed.

Properties

Gets or sets the same shared provider exposed by CurrentProvider.

C#
public static RichTextBoxLocalizationProvider CurrentProvider { get; set; }

Methods

Creates a provider from a localization XML file.

C#
public static RichTextBoxLocalizationProvider FromFile(string path)
Parameters:pathstring

The path to the XML localization file.

Returns:

RichTextBoxLocalizationProvider

A provider initialized from the file contents.

Creates a provider from a manifest resource in the specified assembly.

C#
public static RichTextBoxLocalizationProvider FromResource(string resourceName, Assembly assembly)
Parameters:resourceNamestring

The fully qualified manifest resource name.

assemblyAssembly

The assembly containing the resource.

Returns:

RichTextBoxLocalizationProvider

A provider initialized from the resource contents.

Exceptions: ArgumentException

The resource does not exist in assembly.

Creates a provider from a manifest resource in the executing assembly.

C#
public static RichTextBoxLocalizationProvider FromResource(string resourceName)
Parameters:resourceNamestring

The fully qualified manifest resource name.

Returns:

RichTextBoxLocalizationProvider

A provider initialized from the resource contents.

Creates a provider by loading localization XML from a stream. The stream remains owned by the caller.

C#
public static RichTextBoxLocalizationProvider FromStream(Stream input)
Parameters:inputStream

The stream containing the localization XML.

Returns:

RichTextBoxLocalizationProvider

A provider initialized from the stream contents.

Gets the localized value for an identifier, or returns the identifier when no value is loaded.

C#
public virtual string GetLocalizedString(string id)
Parameters:idstring

The localization identifier.

Returns:

string

The localized value when present; otherwise, id.