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

Provides common helpers for value swapping, resource URIs, enum parsing, and designer detection.

Definition

Namespace:Telerik.WinForms.Documents.Utils

Assembly:Telerik.WinControls.RichTextEditor.dll

Syntax:

C#
public static class TelerikUtils

Inheritance: objectTelerikUtils

Methods

Parses a string into the target value type, optionally ignoring case.

C#
public static bool EnumTryParse<TEnum>(string valueAsString, bool ignoreCase, out TEnum value) where TEnum : struct
Parameters:valueAsStringstring

The text to parse.

ignoreCasebool

true to ignore case when matching names; otherwise, false.

valueTEnum

Receives the parsed value, or the default value of TEnum if parsing fails.

Returns:

bool

true if parsing succeeds; otherwise, false.

For enum types, a numeric string can parse successfully even when it does not name a declared member.

Parses a string into the target value type using case-sensitive matching.

C#
public static bool EnumTryParse<TEnum>(string valueAsString, out TEnum value) where TEnum : struct
Parameters:valueAsStringstring

The text to parse.

valueTEnum

Receives the parsed value, or the default value of TEnum if parsing fails.

Returns:

bool

true if parsing succeeds; otherwise, false.

For enum types, a numeric string can parse successfully even when it does not name a declared member.

Creates a relative URI for a resource in the RichTextEditor assembly.

C#
public static Uri GetResourceUri(string resource)
Parameters:resourcestring

The resource path relative to the component's resource root.

Returns:

Uri

A relative URI in the resource format used by the current target framework.

Reports whether the current host is running the RichTextEditor in a designer.

C#
public static bool IsInDesignMode()
Returns:

bool

true when the active target framework reports design mode; otherwise, false.

Exchanges the values held by two references.

C#
public static void Swap<T>(ref T first, ref T second)
Parameters:firstT

The first value to exchange.

secondT

The second value to exchange.