C# Class Hourglass.Managers.ThemeManager

Manages themes.
Inheritance: Hourglass.Managers.Manager
Show file Open project: Dziemborowicz/Hourglass

Public Properties

Property Type Description
Instance ThemeManager

Public Methods

Method Description
Add ( Theme theme ) : void

Adds a theme.

AddRange ( IEnumerable collection ) : void

Adds the themes of the specified collection.

AddThemeBasedOnTheme ( Theme theme ) : Theme

Adds a theme based on another theme.

GetDarkVariantForTheme ( Theme theme ) : Theme

Returns the dark variant of a theme.

GetLightVariantForTheme ( Theme theme ) : Theme

Returns the light variant of a theme.

GetThemeByIdentifier ( string identifier ) : Theme

Returns the theme for the specified identifier, or null if no such theme is loaded.

GetThemeByName ( string name, System.StringComparison stringComparison = StringComparison.Ordinal ) : Theme

Returns the first theme for the specified name, or null if no such theme is loaded.

GetThemeOrDefaultByIdentifier ( string identifier ) : Theme

Returns the theme for the specified identifier, or DefaultTheme if no such theme is loaded.

GetThemeOrDefaultByName ( string name, System.StringComparison stringComparison = StringComparison.Ordinal ) : Theme

Returns the first theme for the specified name, or DefaultTheme if no such theme is loaded.

Initialize ( ) : void

Initializes the class.

Persist ( ) : void

Persists the state of the class.

Remove ( Theme theme ) : void

Removes a theme, and updates any timers using the theme to use the default theme.

Private Methods

Method Description
GetBuiltInThemes ( ) : IList

Loads the collection of themes defined in the assembly.

GetUserProvidedThemes ( ) : IList

Loads the collection of themes defined by the user.

ThemeManager ( ) : System

Prevents a default instance of the ThemeManager class from being created.

Method Details

Add() public method

Adds a theme.
public Add ( Theme theme ) : void
theme Hourglass.Timing.Theme A .
return void

AddRange() public method

Adds the themes of the specified collection.
public AddRange ( IEnumerable collection ) : void
collection IEnumerable A collection of s.
return void

AddThemeBasedOnTheme() public method

Adds a theme based on another theme.
public AddThemeBasedOnTheme ( Theme theme ) : Theme
theme Hourglass.Timing.Theme A .
return Hourglass.Timing.Theme

GetDarkVariantForTheme() public method

Returns the dark variant of a theme.
public GetDarkVariantForTheme ( Theme theme ) : Theme
theme Hourglass.Timing.Theme A theme.
return Hourglass.Timing.Theme

GetLightVariantForTheme() public method

Returns the light variant of a theme.
public GetLightVariantForTheme ( Theme theme ) : Theme
theme Hourglass.Timing.Theme A theme.
return Hourglass.Timing.Theme

GetThemeByIdentifier() public method

Returns the theme for the specified identifier, or null if no such theme is loaded.
public GetThemeByIdentifier ( string identifier ) : Theme
identifier string The identifier for the theme.
return Hourglass.Timing.Theme

GetThemeByName() public method

Returns the first theme for the specified name, or null if no such theme is loaded.
public GetThemeByName ( string name, System.StringComparison stringComparison = StringComparison.Ordinal ) : Theme
name string The name for the theme.
stringComparison System.StringComparison One of the enumeration values that specifies how the strings will be /// compared.
return Hourglass.Timing.Theme

GetThemeOrDefaultByIdentifier() public method

Returns the theme for the specified identifier, or DefaultTheme if no such theme is loaded.
public GetThemeOrDefaultByIdentifier ( string identifier ) : Theme
identifier string The identifier for the theme.
return Hourglass.Timing.Theme

GetThemeOrDefaultByName() public method

Returns the first theme for the specified name, or DefaultTheme if no such theme is loaded.
public GetThemeOrDefaultByName ( string name, System.StringComparison stringComparison = StringComparison.Ordinal ) : Theme
name string The name for the theme.
stringComparison System.StringComparison One of the enumeration values that specifies how the strings will be /// compared.
return Hourglass.Timing.Theme

Initialize() public method

Initializes the class.
public Initialize ( ) : void
return void

Persist() public method

Persists the state of the class.
public Persist ( ) : void
return void

Remove() public method

Removes a theme, and updates any timers using the theme to use the default theme.
public Remove ( Theme theme ) : void
theme Hourglass.Timing.Theme A .
return void

Property Details

Instance public static property

Singleton instance of the ThemeManager class.
public static ThemeManager,Hourglass.Managers Instance
return ThemeManager