/// <summary> /// Adds a color scheme to the list. /// </summary> /// <param name="styleTheme">The color scheme.</param> public void AddStyleTheme(StyleTheme styleTheme) { var index = Count(); styleTheme.StyleThemeIndexId = index; _styleThemes.Add(styleTheme); }
/// <summary> /// Sets the active style theme. /// </summary> /// <param name="styleThemeIndex">The index of the style theme.</param> /// <exception cref="IndexOutOfRangeException">Thrown when the value is outside of the list index range.</exception> public void SetStyleTheme(int styleThemeIndex) { if (styleThemeIndex >= 0 && styleThemeIndex < Count()) { _selectedStyleTheme = GetStyleTheme(styleThemeIndex); } else { throw new IndexOutOfRangeException("Index value [" + styleThemeIndex + "] out of range of style theme list."); } }
/// <summary> /// Initializes a new instance of the <see cref="StyleThemeManager" /> class. /// </summary> /// <param name="styleThemeIndex">Index of the style theme.</param> /// <param name="loadStyleThemes">if set to <c>true</c> [load style themes].</param> public StyleThemeManager(int styleThemeIndex, bool loadStyleThemes) { if (loadStyleThemes) { LoadStyleThemes(); } else { AddDefaultThemes(); } _selectedStyleTheme = GetStyleTheme(styleThemeIndex); }
/// <summary> /// Adds a style theme to the theme list. /// </summary> /// <param name="styleTheme">The color scheme to add.</param> /// <exception cref="NullReferenceException">Thrown when class ConsoleWindow() has not been instantiated.</exception> public void AddStyleTheme(StyleTheme styleTheme) { if (_consoleWindow != null) { _consoleWindow.AddStyleTheme(styleTheme); } else { throw new NullReferenceException( "ConsoleWindow() class not instantiated. Call Show() to create console window."); } }
/// <summary> /// Adds a color scheme to the list. /// </summary> /// <param name="styleTheme">The color scheme to add.</param> public void AddStyleTheme(StyleTheme styleTheme) { _styleThemeManager.AddStyleTheme(styleTheme); }