New to Telerik UI for WinFormsStart a free 30-day trial

Base class used by RadThemeManager to recognize classes that load themes from resources in a class library. This abstract class provides the foundation for theme components that can load and manage visual themes.

Definition

Constructors

Initializes a new instance of the RadThemeComponentBase class.

C#
public RadThemeComponentBase()

Properties

Gets a value indicating whether the component is currently in design mode.

C#
public bool IsDesignMode { get; }
Property Value:

true if the component is in design mode; otherwise, false.

Remarks:

This property is used to determine if the component is being used in a design-time environment such as Visual Studio's form designer.

Gets or sets the site of the component.

C#
public override ISite Site { get; set; }
Property Value:

The ISite associated with the component.

Overrides: Component.Site

Remarks:

When the site is set in design mode, this triggers the theme loading process if the theme is not already available in the repository.

Gets the name of the theme provided by this component.

C#
public virtual string ThemeName { get; }
Property Value:

The theme name, or an empty string if no theme name is specified.

Remarks:

This property is used by the theming system to identify and reference the theme. Derived classes should override this property to return the actual theme name.

Methods

Deserializes the theme associated with this component. Override this method to provide custom theme deserialization logic.

C#
public virtual void DeserializeTheme()
Remarks:

This method is called during the theme loading process to deserialize theme data from its stored format. The default implementation does nothing.

Releases the unmanaged resources used by the RadThemeComponentBase and optionally releases the managed resources.

C#
protected override void Dispose(bool disposing)
Parameters:disposingbool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

Overrides: Component.Dispose(bool)

Remarks:

This method removes the theme from the repository when the component is disposed in design mode.

Loads the theme associated with this component. Derived classes must implement this method to provide the theme loading logic.

C#
public abstract void Load()
Remarks:

This method is called to load the theme into the theme repository. Implementations should load theme data from embedded resources or other sources and register the theme with the ThemeRepository.

Loads a theme resource from the specified assembly and resource path.

C#
protected virtual bool LoadResource(Assembly resourceAssembly, string resourcePath)
Parameters:resourceAssemblyAssembly

The assembly containing the theme resource.

resourcePathstring

The path to the theme resource within the assembly.

Returns:

bool

true if the resource was loaded successfully; otherwise, false.

Remarks:

This method loads a theme from an embedded resource, deserializes it using a TSSPThemeReader, and adds it to the ThemeRepository. If loading fails, an error message is displayed.

Removes the theme from the theme repository. Override this method to provide custom theme removal logic.

C#
protected virtual void RemoveThemeCore()
Remarks:

This method is called during component disposal to clean up the theme from the theme repository. The default implementation removes the theme by name.