Class
RadThemeComponentBase

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

RadThemeComponentBase()

Initializes a new instance of the RadThemeComponentBase class.

Declaration

cs-api-definition
public RadThemeComponentBase()

Properties

IsDesignMode

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

Declaration

cs-api-definition
public bool IsDesignMode { get; }

Property Value

bool

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.

Site

Gets or sets the site of the component.

Declaration

cs-api-definition
public override ISite Site { get; set; }

Property Value

ISite

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.

ThemeName

Gets the name of the theme provided by this component.

Declaration

cs-api-definition
public virtual string ThemeName { get; }

Property Value

string

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

DeserializeTheme()

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

Declaration

cs-api-definition
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.

Dispose(bool)

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

Declaration

cs-api-definition
protected override void Dispose(bool disposing)

Parameters

disposing

bool

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.

Load()

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

Declaration

cs-api-definition
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.

LoadResource(Assembly, string)

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

Declaration

cs-api-definition
protected virtual bool LoadResource(Assembly resourceAssembly, string resourcePath)

Parameters

resourceAssembly

Assembly

The assembly containing the theme resource.

resourcePath

string

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.

RemoveThemeCore()

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

Declaration

cs-api-definition
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.