diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonThemeManager.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonThemeManager.cs index e1e0e7157..be042a91f 100644 --- a/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonThemeManager.cs +++ b/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonThemeManager.cs @@ -47,8 +47,8 @@ public static void PropagateThemeSelector(KryptonRibbonGroupDomainUpDown target) /// Gets the current palette mode. /// /// The manager. - /// The current . - public static PaletteModeManager GetCurrentPaletteMode(KryptonManager manager) => manager.GlobalPaletteMode; + /// The current . + public static PaletteMode GetCurrentPaletteMode(KryptonManager manager) => manager.GlobalPaletteMode; /// /// Sets the theme. @@ -63,100 +63,28 @@ public static void SetTheme(string themeName, KryptonManager manager) /// /// Returns the palette mode manager as string. /// - /// The palette mode manager. + /// The palette mode manager. /// The manager. - /// The current as a string. - public static string ReturnPaletteModeManagerAsString(PaletteModeManager paletteModeManager, KryptonManager manager = null) - { - return ThemeManager.ReturnPaletteModeManagerAsString(paletteModeManager, manager); - } - - /// - /// Returns the palette mode as string. - /// - /// The palette mode. /// The current as a string. - public static string ReturnPaletteModeAsString(PaletteMode paletteMode) - { - string result = null; - - if (paletteMode == PaletteMode.Custom) result = "Custom"; - - if (paletteMode == PaletteMode.Global) result = "Global"; - - if (paletteMode == PaletteMode.ProfessionalSystem) result = "Professional - System"; - - if (paletteMode == PaletteMode.ProfessionalOffice2003) result = "Professional - Office 2003"; - - if (paletteMode == PaletteMode.Office2007Blue) result = "Office 2007 - Blue"; - - if (paletteMode == PaletteMode.Office2007Silver) result = "Office 2007 - Silver"; - - if (paletteMode == PaletteMode.Office2007White) result = "Office 2007 - White"; - - if (paletteMode == PaletteMode.Office2007Black) result = "Office 2007 - Black"; - - if (paletteMode == PaletteMode.Office2010Blue) result = "Office 2010 - Blue"; - - if (paletteMode == PaletteMode.Office2010Silver) result = "Office 2010 - Silver"; - - if (paletteMode == PaletteMode.Office2010White) result = "Office 2010 - White"; - - if (paletteMode == PaletteMode.Office2010Black) result = "Office 2010 - Black"; - - //if (paletteMode == PaletteMode.Office2013) result = "Office 2013"; - - if (paletteMode == PaletteMode.Office2013White) result = "Office 2013 - White"; - - if (paletteMode == PaletteMode.SparkleBlue) result = "Sparkle - Blue"; - - if (paletteMode == PaletteMode.SparkleOrange) result = "Sparkle - Orange"; - - if (paletteMode == PaletteMode.SparklePurple) result = "Sparkle - Purple"; - - if (paletteMode == PaletteMode.Microsoft365Blue) result = "Microsoft 365 - Blue"; - - if (paletteMode == PaletteMode.Microsoft365Silver) result = "Microsoft 365 - Silver"; - - if (paletteMode == PaletteMode.Microsoft365White) result = "Microsoft 365 - White"; - - if (paletteMode == PaletteMode.Microsoft365Black) result = "Microsoft 365 - Black"; - - return result; - } - - /// - /// Applies the global theme. - /// - /// The manager. - /// The palette mode manager. - private static void ApplyGlobalTheme(KryptonManager manager, PaletteModeManager paletteModeManager) + public static string ReturnPaletteModeAsString(PaletteMode paletteMode, KryptonManager manager = null) { - try - { - manager.GlobalPaletteMode = paletteModeManager; - } - catch - { - - throw; - } + return ThemeManager.ReturnPaletteModeAsString(paletteMode, manager); } /// /// Applies the global theme. /// /// The manager. - /// The theme mode. - private static void ApplyGlobalTheme(KryptonManager manager, PaletteMode mode) + /// The palette mode manager. + private static void ApplyGlobalTheme(KryptonManager manager, PaletteMode paletteMode) { try { - manager.GlobalPaletteMode = (PaletteModeManager)mode; + manager.GlobalPaletteMode = paletteMode; } catch { - + // TODO: Used DebugUtilities throw; } } @@ -177,10 +105,10 @@ public static PaletteMode ApplyThemeMode(string themeName) /// Applies the theme manager mode. /// /// Name of the theme. - /// The equivalent. - public static PaletteModeManager ApplyThemeManagerMode(string themeName) + /// The equivalent. + public static PaletteMode ApplyThemeManagerMode(string themeName) { - PaletteModeManager modeManager = (PaletteModeManager)Enum.Parse(typeof(PaletteModeManager), themeName); + PaletteMode modeManager = (PaletteMode)Enum.Parse(typeof(PaletteMode), themeName); return modeManager; } diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonManager.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonManager.cs index 3be7de89c..60c5eb81c 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonManager.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonManager.cs @@ -219,8 +219,8 @@ public void Reset() /// [Category(@"Visuals")] [Description(@"Global palette applied to drawing.")] - //[DefaultValue(typeof(PaletteModeManager), "Microsoft365Blue")] - public PaletteModeManager GlobalPaletteMode + //[DefaultValue(typeof(PaletteMode), "Microsoft365Blue")] + public PaletteMode GlobalPaletteMode { get => InternalGlobalPaletteMode; @@ -232,13 +232,13 @@ public PaletteModeManager GlobalPaletteMode // Action depends on the value switch (value) { - case PaletteModeManager.Custom: + case PaletteMode.Custom: // Do nothing, you must assign a palette to the // 'GlobalPalette' property in order to get the custom mode break; default: // Cache the new values - PaletteModeManager tempMode = InternalGlobalPaletteMode; + PaletteMode tempMode = InternalGlobalPaletteMode; PaletteBase tempPalette = InternalGlobalPalette; // Use the new value @@ -273,9 +273,9 @@ public PaletteModeManager GlobalPaletteMode } } - private bool ShouldSerializeGlobalPaletteMode() => GlobalPaletteMode != PaletteModeManager.Microsoft365Blue; + private bool ShouldSerializeGlobalPaletteMode() => GlobalPaletteMode != PaletteMode.Microsoft365Blue; - private void ResetGlobalPaletteMode() => GlobalPaletteMode = PaletteModeManager.Microsoft365Blue; + private void ResetGlobalPaletteMode() => GlobalPaletteMode = PaletteMode.Microsoft365Blue; /// /// Gets and sets the global custom applied to drawing. @@ -293,11 +293,11 @@ public PaletteBase GlobalPalette if (InternalGlobalPalette != value) { // Cache the current values - PaletteModeManager tempMode = InternalGlobalPaletteMode; + PaletteMode tempMode = InternalGlobalPaletteMode; PaletteBase tempPalette = InternalGlobalPalette; // Use the new values - InternalGlobalPaletteMode = (value == null) ? PaletteModeManager.Microsoft365Blue : PaletteModeManager.Custom; + InternalGlobalPaletteMode = (value == null) ? PaletteMode.Microsoft365Blue : PaletteMode.Custom; InternalGlobalPalette = value; // If the new value creates a circular reference @@ -328,7 +328,7 @@ public PaletteBase GlobalPalette else { // No longer using a standard palette - InternalGlobalPaletteMode = PaletteModeManager.Custom; + InternalGlobalPaletteMode = PaletteMode.Custom; } // Raise the palette changed event @@ -339,7 +339,7 @@ public PaletteBase GlobalPalette private bool ShouldSerializeGlobalPalette() => GlobalPalette != null; - private void ResetGlobalPalette() => GlobalPaletteMode = PaletteModeManager.Microsoft365Blue; + private void ResetGlobalPalette() => GlobalPaletteMode = PaletteMode.Microsoft365Blue; /// /// Gets or sets a value indicating if the palette colors are applied to the tool-strips. @@ -483,103 +483,96 @@ public static PaletteBase CurrentGlobalPalette { switch (InternalGlobalPaletteMode) { - case PaletteModeManager.ProfessionalSystem: + case PaletteMode.ProfessionalSystem: return PaletteProfessionalSystem; - case PaletteModeManager.ProfessionalOffice2003: + case PaletteMode.ProfessionalOffice2003: return PaletteProfessionalOffice2003; - case PaletteModeManager.Office2007DarkGray: + case PaletteMode.Office2007DarkGray: return PaletteOffice2007DarkGray; - case PaletteModeManager.Office2007Blue: + case PaletteMode.Office2007Blue: return PaletteOffice2007Blue; - case PaletteModeManager.Office2007BlueDarkMode: + case PaletteMode.Office2007BlueDarkMode: return PaletteOffice2007BlueDarkMode; - case PaletteModeManager.Office2007BlueLightMode: + case PaletteMode.Office2007BlueLightMode: return PaletteOffice2007BlueLightMode; - case PaletteModeManager.Office2007Custom: // Note: Do something... - case PaletteModeManager.Office2007Silver: + case PaletteMode.Office2007Silver: return PaletteOffice2007Silver; - case PaletteModeManager.Office2007SilverDarkMode: + case PaletteMode.Office2007SilverDarkMode: return PaletteOffice2007SilverDarkMode; - case PaletteModeManager.Office2007SilverLightMode: + case PaletteMode.Office2007SilverLightMode: return PaletteOffice2007SilverLightMode; - case PaletteModeManager.Office2007White: + case PaletteMode.Office2007White: return PaletteOffice2007White; - case PaletteModeManager.Office2007Black: + case PaletteMode.Office2007Black: return PaletteOffice2007Black; - case PaletteModeManager.Office2007BlackDarkMode: + case PaletteMode.Office2007BlackDarkMode: return PaletteOffice2007BlackDarkMode; - case PaletteModeManager.Office2010DarkGray: + case PaletteMode.Office2010DarkGray: return PaletteOffice2010DarkGray; - case PaletteModeManager.Office2010Blue: + case PaletteMode.Office2010Blue: return PaletteOffice2010Blue; - case PaletteModeManager.Office2010BlueDarkMode: + case PaletteMode.Office2010BlueDarkMode: return PaletteOffice2010BlueDarkMode; - case PaletteModeManager.Office2010BlueLightMode: + case PaletteMode.Office2010BlueLightMode: return PaletteOffice2010BlueLightMode; - case PaletteModeManager.Office2010Custom: - // Note: Do something... - case PaletteModeManager.Office2010Silver: + case PaletteMode.Office2010Silver: return PaletteOffice2010Silver; - case PaletteModeManager.Office2010SilverDarkMode: + case PaletteMode.Office2010SilverDarkMode: return PaletteOffice2010SilverDarkMode; - case PaletteModeManager.Office2010SilverLightMode: + case PaletteMode.Office2010SilverLightMode: return PaletteOffice2010SilverLightMode; - case PaletteModeManager.Office2010White: - case PaletteModeManager.Office2013Custom: - // Note: Do something... + case PaletteMode.Office2010White: return PaletteOffice2010White; - case PaletteModeManager.Office2010Black: + case PaletteMode.Office2010Black: return PaletteOffice2010Black; - case PaletteModeManager.Office2010BlackDarkMode: + case PaletteMode.Office2010BlackDarkMode: return PaletteOffice2010BlackDarkMode; - /*case PaletteModeManager.Office2013: + /*case PaletteMode.Office2013: return PaletteOffice2013;*/ - case PaletteModeManager.Office2013DarkGray: + case PaletteMode.Office2013DarkGray: return PaletteOffice2013DarkGray; - case PaletteModeManager.Office2013White: + case PaletteMode.Office2013White: return PaletteOffice2013White; - case PaletteModeManager.SparkleBlue: + case PaletteMode.SparkleBlue: return PaletteSparkleBlue; - case PaletteModeManager.SparkleBlueDarkMode: + case PaletteMode.SparkleBlueDarkMode: return PaletteSparkleBlueDarkMode; - case PaletteModeManager.SparkleBlueLightMode: + case PaletteMode.SparkleBlueLightMode: return PaletteSparkleBlueLightMode; - case PaletteModeManager.SparkleOrange: + case PaletteMode.SparkleOrange: return PaletteSparkleOrange; - case PaletteModeManager.SparkleOrangeDarkMode: + case PaletteMode.SparkleOrangeDarkMode: return PaletteSparkleOrangeDarkMode; - case PaletteModeManager.SparkleOrangeLightMode: + case PaletteMode.SparkleOrangeLightMode: return PaletteSparkleOrangeLightMode; - case PaletteModeManager.SparklePurple: + case PaletteMode.SparklePurple: return PaletteSparklePurple; - case PaletteModeManager.SparklePurpleDarkMode: + case PaletteMode.SparklePurpleDarkMode: return PaletteSparklePurpleDarkMode; - case PaletteModeManager.SparklePurpleLightMode: + case PaletteMode.SparklePurpleLightMode: return PaletteSparklePurpleLightMode; - case PaletteModeManager.Microsoft365Black: + case PaletteMode.Microsoft365Black: return PaletteMicrosoft365Black; - case PaletteModeManager.Microsoft365BlackDarkMode: + case PaletteMode.Microsoft365BlackDarkMode: return PaletteMicrosoft365BlackDarkMode; - case PaletteModeManager.Microsoft365Blue: + case PaletteMode.Microsoft365Blue: return PaletteMicrosoft365Blue; - case PaletteModeManager.Microsoft365BlueDarkMode: + case PaletteMode.Microsoft365BlueDarkMode: return PaletteMicrosoft365BlueDarkMode; - case PaletteModeManager.Microsoft365BlueLightMode: + case PaletteMode.Microsoft365BlueLightMode: return PaletteMicrosoft365BlueLightMode; - case PaletteModeManager.Microsoft365Custom: - // Note: Do something... - case PaletteModeManager.Microsoft365DarkGray: + case PaletteMode.Microsoft365DarkGray: return PaletteMicrosoft365DarkGray; - case PaletteModeManager.Microsoft365Silver: + case PaletteMode.Microsoft365Silver: return PaletteMicrosoft365Silver; - case PaletteModeManager.Microsoft365SilverDarkMode: + case PaletteMode.Microsoft365SilverDarkMode: return PaletteMicrosoft365SilverDarkMode; - case PaletteModeManager.Microsoft365SilverLightMode: + case PaletteMode.Microsoft365SilverLightMode: return PaletteMicrosoft365SilverLightMode; - case PaletteModeManager.Microsoft365White: + case PaletteMode.Microsoft365White: return PaletteMicrosoft365White; - case PaletteModeManager.Custom: + case PaletteMode.Custom: return InternalGlobalPalette; default: Debug.Assert(false); @@ -603,8 +596,6 @@ public static PaletteBase GetPaletteForMode(PaletteMode mode) return PaletteProfessionalOffice2003; case PaletteMode.Office2007Blue: return PaletteOffice2007Blue; - case PaletteMode.Office2007Custom: - // Note: Do something... case PaletteMode.Office2007DarkGray: return PaletteOffice2007DarkGray; case PaletteMode.Office2007BlueDarkMode: @@ -631,16 +622,12 @@ public static PaletteBase GetPaletteForMode(PaletteMode mode) return PaletteOffice2010BlueDarkMode; case PaletteMode.Office2010BlueLightMode: return PaletteOffice2010BlueLightMode; - case PaletteMode.Office2010Custom: - // Note: Do something... case PaletteMode.Office2010Silver: return PaletteOffice2010Silver; case PaletteMode.Office2010SilverDarkMode: return PaletteOffice2010SilverDarkMode; case PaletteMode.Office2010SilverLightMode: return PaletteOffice2010SilverLightMode; - case PaletteMode.Office2013Custom: - // Note: Do something... case PaletteMode.Office2010White: return PaletteOffice2010White; case PaletteMode.Office2010Black: @@ -681,8 +668,6 @@ public static PaletteBase GetPaletteForMode(PaletteMode mode) return PaletteMicrosoft365BlueLightMode; case PaletteMode.Microsoft365Blue: return PaletteMicrosoft365Blue; - case PaletteMode.Microsoft365Custom: - // Note: Do something... case PaletteMode.Microsoft365DarkGray: return PaletteMicrosoft365DarkGray; case PaletteMode.Microsoft365Silver: @@ -998,7 +983,7 @@ public static IRenderer GetRendererForMode(RendererMode mode) #endregion #region Static Internal - internal static PaletteModeManager InternalGlobalPaletteMode { get; private set; } = PaletteModeManager.Microsoft365Blue; + internal static PaletteMode InternalGlobalPaletteMode { get; private set; } = PaletteMode.Microsoft365Blue; internal static PaletteBase InternalGlobalPalette { get; private set; } = CurrentGlobalPalette; @@ -1010,7 +995,7 @@ internal static bool HasCircularReference() PaletteBase palette = null; // Get the next palette up in hierarchy - if (InternalGlobalPaletteMode == PaletteModeManager.Custom) + if (InternalGlobalPaletteMode == PaletteMode.Custom) { palette = InternalGlobalPalette; } diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPropertyGrid.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPropertyGrid.cs index cbdd5fe3a..b2f3f1007 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPropertyGrid.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPropertyGrid.cs @@ -118,7 +118,7 @@ private void InitColours() HelpForeColor = _palette.ColorTable.StatusStripText; - if (KryptonManager.InternalGlobalPaletteMode == PaletteModeManager.Office2007BlackDarkMode) + if (KryptonManager.InternalGlobalPaletteMode == PaletteMode.Office2007BlackDarkMode) { LineColor = Color.Silver; } diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteModeConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteModeConverter.cs index 27409d7b4..60a741b8a 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteModeConverter.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteModeConverter.cs @@ -19,7 +19,6 @@ internal class PaletteModeConverter : StringLookupConverter { #region Static Fields - /// Converts the values into a human readable format. private readonly Pair[] _pairs = { new(PaletteMode.ProfessionalSystem, "Professional - System"), @@ -29,7 +28,6 @@ internal class PaletteModeConverter : StringLookupConverter new(PaletteMode.Office2007Blue, "Office 2007 - Blue"), new(PaletteMode.Office2007BlueDarkMode, "Office 2007 - Blue (Dark Mode)"), new(PaletteMode.Office2007BlueLightMode, "Office 2007 - Blue (Light Mode)"), - new(PaletteMode.Office2007Custom, "Office 2007 - Custom"), // Note: Re-enable when the gray themes are completed new(PaletteMode.Office2007DarkGray, "Office 2007 - Dark Gray"), //new(PaletteMode.Office2007LightGray, "Office 2007 - Light Gray"), @@ -37,7 +35,6 @@ internal class PaletteModeConverter : StringLookupConverter new(PaletteMode.Office2007SilverDarkMode, "Office 2007 - Silver (Dark Mode)"), new(PaletteMode.Office2007SilverLightMode, "Office 2007 - Silver (Light Mode)"), new(PaletteMode.Office2007White, "Office 2007 - White"), - new(PaletteMode.Office2007Custom, "Office 2007 - Custom"), new(PaletteMode.Office2010Black, "Office 2010 - Black"), new(PaletteMode.Office2010BlackDarkMode, "Office 2010 - Black (Dark Mode)"), new(PaletteMode.Office2010Blue, "Office 2010 - Blue"), @@ -50,12 +47,10 @@ internal class PaletteModeConverter : StringLookupConverter new(PaletteMode.Office2010SilverDarkMode, "Office 2010 - Silver (Dark Mode)"), new(PaletteMode.Office2010SilverLightMode, "Office 2010 - Silver (Light Mode)"), new(PaletteMode.Office2010White, "Office 2010 - White"), - new(PaletteMode.Office2010Custom, "Office 2010 - Custom"), // Note: Re-enable when the gray themes are completed new(PaletteMode.Office2013DarkGray, "Office 2013 - Dark Gray"), //new(PaletteMode.Office2013LightGray, "Office 2013 - Light Gray"), new(PaletteMode.Office2013White, "Office 2013 - White"), - new(PaletteMode.Office2013Custom, "Office 2013 - Custom"), new(PaletteMode.Microsoft365Black, "Microsoft 365 - Black"), new(PaletteMode.Microsoft365BlackDarkMode, "Microsoft 365 - Black (Dark Mode)"), new(PaletteMode.Microsoft365Blue, "Microsoft 365 - Blue"), @@ -68,7 +63,6 @@ internal class PaletteModeConverter : StringLookupConverter new(PaletteMode.Microsoft365SilverDarkMode, "Microsoft 365 - Silver (Dark Mode)"), new(PaletteMode.Microsoft365SilverLightMode, "Microsoft 365 - Silver (Light Mode)"), new(PaletteMode.Microsoft365White, "Microsoft 365 - White"), - new(PaletteMode.Microsoft365Custom, "Microsoft 365 - Custom"), new(PaletteMode.SparkleBlue, "Sparkle - Blue"), new(PaletteMode.SparkleBlueDarkMode, "Sparkle - Blue (Dark Mode)"), new(PaletteMode.SparkleBlueLightMode, "Sparkle - Blue (Light Mode)"), diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteModeManagerConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteModeManagerConverter.cs deleted file mode 100644 index 2cfd51597..000000000 --- a/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteModeManagerConverter.cs +++ /dev/null @@ -1,102 +0,0 @@ -#region BSD License -/* - * - * Original BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE) - * © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved. - * - * New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE) - * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved. - * - */ -#endregion - -namespace Krypton.Toolkit -{ - /// - /// Custom type converter so that PaletteModeManager values appear as neat text at design time. - /// - internal class PaletteModeManagerConverter : StringLookupConverter - { - #region Static Fields - - private readonly Pair[] _pairs = - { - new(PaletteModeManager.ProfessionalSystem, "Professional - System"), - new(PaletteModeManager.ProfessionalOffice2003, "Professional - Office 2003"), - new(PaletteModeManager.Office2007Black, "Office 2007 - Black"), - new(PaletteModeManager.Office2007BlackDarkMode, "Office 2007 - Black (Dark Mode)"), - new(PaletteModeManager.Office2007Blue, "Office 2007 - Blue"), - new(PaletteModeManager.Office2007BlueDarkMode, "Office 2007 - Blue (Dark Mode)"), - new(PaletteModeManager.Office2007BlueLightMode, "Office 2007 - Blue (Light Mode)"), - // Note: Re-enable when the gray themes are completed - new(PaletteModeManager.Office2007DarkGray, "Office 2007 - Dark Gray"), - //new(PaletteModeManager.Office2007LightGray, "Office 2007 - Light Gray"), - new(PaletteModeManager.Office2007Silver, "Office 2007 - Silver"), - new(PaletteModeManager.Office2007SilverDarkMode, "Office 2007 - Silver (Dark Mode)"), - new(PaletteModeManager.Office2007SilverLightMode, "Office 2007 - Silver (Light Mode)"), - new(PaletteModeManager.Office2007White, "Office 2007 - White"), - new(PaletteModeManager.Office2007Custom, "Office 2007 - Custom"), - new(PaletteModeManager.Office2010Black, "Office 2010 - Black"), - new(PaletteModeManager.Office2010BlackDarkMode, "Office 2010 - Black (Dark Mode)"), - new(PaletteModeManager.Office2010Blue, "Office 2010 - Blue"), - new(PaletteModeManager.Office2010BlueDarkMode, "Office 2010 - Blue (Dark Mode)"), - new(PaletteModeManager.Office2010BlueLightMode, "Office 2010 - Blue (Light Mode)"), - // Note: Re-enable when the gray themes are completed - new(PaletteModeManager.Office2010DarkGray, "Office 2010 - Dark Gray"), - //new(PaletteModeManager.Office2010LightGray, "Office 2010 - Light Gray"), - new(PaletteModeManager.Office2010Silver, "Office 2010 - Silver"), - new(PaletteModeManager.Office2010SilverDarkMode, "Office 2010 - Silver (Dark Mode)"), - new(PaletteModeManager.Office2010SilverLightMode, "Office 2010 - Silver (Light Mode)"), - new(PaletteModeManager.Office2010White, "Office 2010 - White"), - new(PaletteModeManager.Office2010Custom, "Office 2010 - Custom"), - // Note: Re-enable when the gray themes are completed - new(PaletteModeManager.Office2013DarkGray, "Office 2013 - Dark Gray"), - //new(PaletteModeManager.Office2013LightGray, "Office 2013 - Light Gray"), - new(PaletteModeManager.Office2013White, "Office 2013 - White"), - new(PaletteModeManager.Office2013Custom, "Office 2013 - Custom"), - new(PaletteModeManager.Microsoft365Black, "Microsoft 365 - Black"), - new(PaletteModeManager.Microsoft365BlackDarkMode, "Microsoft 365 - Black (Dark Mode)"), - new(PaletteModeManager.Microsoft365Blue, "Microsoft 365 - Blue"), - new(PaletteModeManager.Microsoft365BlueDarkMode, "Microsoft 365 - Blue (Dark Mode)"), - new(PaletteModeManager.Microsoft365BlueLightMode, "Microsoft 365 - Blue (Light Mode)"), - // Note: Re-enable when the gray themes are completed - new(PaletteModeManager.Microsoft365DarkGray, "Microsoft 365 - Dark Gray"), - //new(PaletteModeManager.Microsoft365LightGray, "Microsoft 365 - Light Gray"), - new(PaletteModeManager.Microsoft365Silver, "Microsoft 365 - Silver"), - new(PaletteModeManager.Microsoft365SilverDarkMode, "Microsoft 365 - Silver (Dark Mode)"), - new(PaletteModeManager.Microsoft365SilverLightMode, "Microsoft 365 - Silver (Light Mode)"), - new(PaletteModeManager.Microsoft365White, "Microsoft 365 - White"), - new(PaletteModeManager.Microsoft365Custom, "Microsoft 365 - Custom"), - new(PaletteModeManager.SparkleBlue, "Sparkle - Blue"), - new(PaletteModeManager.SparkleBlueDarkMode, "Sparkle - Blue (Dark Mode)"), - new(PaletteModeManager.SparkleBlueLightMode, "Sparkle - Blue (Light Mode)"), - new(PaletteModeManager.SparkleOrange, "Sparkle - Orange"), - new(PaletteModeManager.SparkleOrangeDarkMode, "Sparkle - Orange (Dark Mode)"), - new(PaletteModeManager.SparkleOrangeLightMode, "Sparkle - Orange (Light Mode)"), - new(PaletteModeManager.SparklePurple, "Sparkle - Purple"), - new(PaletteModeManager.SparklePurpleDarkMode, "Sparkle - Purple (Dark Mode)"), - new(PaletteModeManager.SparklePurpleLightMode, "Sparkle - Purple (Light Mode)") - //new(PaletteModeManager.VisualStudioDark, "Visual Studio (Dark Mode)"), - //new(PaletteModeManager.VisualStudioLight, "Visual Studio (Light Mode)") - }; - #endregion - - #region Identity - /// - /// Initialize a new instance of the PaletteModeManagerConverter class. - /// - public PaletteModeManagerConverter() - : base(typeof(PaletteModeManager)) - { - } - #endregion - - #region Protected - /// - /// Gets an array of lookup pairs. - /// - protected override Pair[] Pairs => _pairs; - - #endregion - } -} diff --git a/Source/Krypton Components/Krypton.Toolkit/Designers/Action Lists/KryptonManagerActionList.cs b/Source/Krypton Components/Krypton.Toolkit/Designers/Action Lists/KryptonManagerActionList.cs index 00ce65fd8..d2643f331 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Designers/Action Lists/KryptonManagerActionList.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Designers/Action Lists/KryptonManagerActionList.cs @@ -39,7 +39,7 @@ public KryptonManagerActionList(KryptonManagerDesigner owner) /// /// Gets and sets the global palette mode. /// - public PaletteModeManager GlobalPaletteMode + public PaletteMode GlobalPaletteMode { get => _manager.GlobalPaletteMode; diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteDefinitions.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteDefinitions.cs index ec0a31ea8..155d78f6f 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteDefinitions.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteDefinitions.cs @@ -12,594 +12,507 @@ // ReSharper disable UnusedMember.Global // ReSharper disable UnusedMemberInSuper.Global -#pragma warning disable 1591 namespace Krypton.Toolkit { - #region IPalette + #region IPaletteBack /// - /// Exposes a palette for drawing. + /// Exposes a palette source for drawing a background. /// - public interface IPalette1 + public interface IPaletteBack { - #region Events - /// - /// Occurs when a palette change requires a repaint. - /// - event EventHandler PalettePaint; - - /// - /// Occurs when the AllowFormChrome setting changes. - /// - event EventHandler AllowFormChromeChanged; - - /// - /// Occurs when the BasePalette/BasePaletteMode setting changes. - /// - event EventHandler BasePaletteChanged; - - /// - /// Occurs when the BaseRenderer/BaseRendererMode setting changes. - /// - event EventHandler BaseRendererChanged; - - /// - /// Occurs when a button spec change occurs. - /// - event EventHandler ButtonSpecChanged; - #endregion - - #region AllowFormChrome - /// - /// Gets a value indicating if KryptonForm instances should show custom chrome. - /// - /// InheritBool value. - InheritBool GetAllowFormChrome(); - #endregion - - #region Renderer - /// - /// Gets the renderer to use for this palette. - /// - /// Renderer to use for drawing palette settings. - IRenderer GetRenderer(); - #endregion - - #region Back /// /// Gets a value indicating if background should be drawn. /// - /// Background style. /// Palette value should be applicable to this state. /// InheritBool value. - InheritBool GetBackDraw(PaletteBackStyle style, PaletteState state); + InheritBool GetBackDraw(PaletteState state); /// - /// Gets the graphics drawing hint for the background. + /// Gets the graphics drawing hint. /// - /// Background style. /// Palette value should be applicable to this state. /// PaletteGraphicsHint value. - PaletteGraphicsHint GetBackGraphicsHint(PaletteBackStyle style, PaletteState state); + PaletteGraphicsHint GetBackGraphicsHint(PaletteState state); /// - /// Gets the first background color. + /// Gets the first back color. /// - /// Background style. /// Palette value should be applicable to this state. /// Color value. - Color GetBackColor1(PaletteBackStyle style, PaletteState state); + Color GetBackColor1(PaletteState state); /// /// Gets the second back color. /// - /// Background style. /// Palette value should be applicable to this state. /// Color value. - Color GetBackColor2(PaletteBackStyle style, PaletteState state); + Color GetBackColor2(PaletteState state); /// - /// Gets the color background drawing style. + /// Gets the color drawing style. /// - /// Background style. /// Palette value should be applicable to this state. /// Color drawing style. - PaletteColorStyle GetBackColorStyle(PaletteBackStyle style, PaletteState state); + PaletteColorStyle GetBackColorStyle(PaletteState state); /// /// Gets the color alignment. /// - /// Background style. /// Palette value should be applicable to this state. /// Color alignment style. - PaletteRectangleAlign GetBackColorAlign(PaletteBackStyle style, PaletteState state); + PaletteRectangleAlign GetBackColorAlign(PaletteState state); /// /// Gets the color background angle. /// - /// Background style. /// Palette value should be applicable to this state. /// Angle used for color drawing. - float GetBackColorAngle(PaletteBackStyle style, PaletteState state); + float GetBackColorAngle(PaletteState state); /// /// Gets a background image. /// - /// Background style. /// Palette value should be applicable to this state. /// Image instance. - Image GetBackImage(PaletteBackStyle style, PaletteState state); + Image GetBackImage(PaletteState state); /// /// Gets the background image style. /// - /// Background style. /// Palette value should be applicable to this state. /// Image style value. - PaletteImageStyle GetBackImageStyle(PaletteBackStyle style, PaletteState state); + PaletteImageStyle GetBackImageStyle(PaletteState state); /// /// Gets the image alignment. /// - /// Background style. /// Palette value should be applicable to this state. /// Image alignment style. - PaletteRectangleAlign GetBackImageAlign(PaletteBackStyle style, PaletteState state); - #endregion + PaletteRectangleAlign GetBackImageAlign(PaletteState state); + } + #endregion - #region Border + #region IPaletteBorder + /// + /// Exposes a palette source for drawing a border. + /// + public interface IPaletteBorder + { /// /// Gets a value indicating if border should be drawn. /// - /// Border style. /// Palette value should be applicable to this state. /// InheritBool value. - InheritBool GetBorderDraw(PaletteBorderStyle style, PaletteState state); + InheritBool GetBorderDraw(PaletteState state); /// /// Gets a value indicating which borders to draw. /// - /// Border style. /// Palette value should be applicable to this state. /// PaletteDrawBorders value. - PaletteDrawBorders GetBorderDrawBorders(PaletteBorderStyle style, PaletteState state); + PaletteDrawBorders GetBorderDrawBorders(PaletteState state); /// - /// Gets the graphics drawing hint for the border. + /// Gets the graphics drawing hint. /// - /// Border style. /// Palette value should be applicable to this state. /// PaletteGraphicsHint value. - PaletteGraphicsHint GetBorderGraphicsHint(PaletteBorderStyle style, PaletteState state); + PaletteGraphicsHint GetBorderGraphicsHint(PaletteState state); /// /// Gets the first border color. /// - /// Border style. /// Palette value should be applicable to this state. /// Color value. - Color GetBorderColor1(PaletteBorderStyle style, PaletteState state); + Color GetBorderColor1(PaletteState state); /// /// Gets the second border color. /// - /// Border style. /// Palette value should be applicable to this state. /// Color value. - Color GetBorderColor2(PaletteBorderStyle style, PaletteState state); + Color GetBorderColor2(PaletteState state); /// - /// Gets the color border drawing style. + /// Gets the color drawing style. /// - /// Border style. /// Palette value should be applicable to this state. /// Color drawing style. - PaletteColorStyle GetBorderColorStyle(PaletteBorderStyle style, PaletteState state); + PaletteColorStyle GetBorderColorStyle(PaletteState state); /// - /// Gets the color border alignment. + /// Gets the color alignment. /// - /// Border style. /// Palette value should be applicable to this state. /// Color alignment style. - PaletteRectangleAlign GetBorderColorAlign(PaletteBorderStyle style, PaletteState state); + PaletteRectangleAlign GetBorderColorAlign(PaletteState state); /// /// Gets the color border angle. /// - /// Border style. /// Palette value should be applicable to this state. /// Angle used for color drawing. - float GetBorderColorAngle(PaletteBorderStyle style, PaletteState state); + float GetBorderColorAngle(PaletteState state); /// /// Gets the border width. /// - /// Border style. /// Palette value should be applicable to this state. /// Integer width. - int GetBorderWidth(PaletteBorderStyle style, PaletteState state); + int GetBorderWidth(PaletteState state); /// /// Gets the border corner rounding. /// - /// Border style. /// Palette value should be applicable to this state. - /// Float rounding. - float GetBorderRounding(PaletteBorderStyle style, PaletteState state); + /// Integer rounding. + float GetBorderRounding(PaletteState state); /// /// Gets a border image. /// - /// Border style. /// Palette value should be applicable to this state. /// Image instance. - Image GetBorderImage(PaletteBorderStyle style, PaletteState state); + Image GetBorderImage(PaletteState state); /// /// Gets the border image style. /// - /// Border style. /// Palette value should be applicable to this state. /// Image style value. - PaletteImageStyle GetBorderImageStyle(PaletteBorderStyle style, PaletteState state); + PaletteImageStyle GetBorderImageStyle(PaletteState state); /// - /// Gets the image border alignment. + /// Gets the image alignment. /// - /// Border style. /// Palette value should be applicable to this state. /// Image alignment style. - PaletteRectangleAlign GetBorderImageAlign(PaletteBorderStyle style, PaletteState state); - #endregion + PaletteRectangleAlign GetBorderImageAlign(PaletteState state); + } + #endregion - #region Content + #region IPaletteContent + /// + /// Exposes a palette source for drawing content. + /// + public interface IPaletteContent + { /// /// Gets a value indicating if content should be drawn. /// - /// Content style. /// Palette value should be applicable to this state. /// InheritBool value. - InheritBool GetContentDraw(PaletteContentStyle style, PaletteState state); + InheritBool GetContentDraw(PaletteState state); /// /// Gets a value indicating if content should be drawn with focus indication. /// - /// Content style. /// Palette value should be applicable to this state. /// InheritBool value. - InheritBool GetContentDrawFocus(PaletteContentStyle style, PaletteState state); + InheritBool GetContentDrawFocus(PaletteState state); /// /// Gets the horizontal relative alignment of the image. /// - /// Content style. /// Palette value should be applicable to this state. /// RelativeAlignment value. - PaletteRelativeAlign GetContentImageH(PaletteContentStyle style, PaletteState state); + PaletteRelativeAlign GetContentImageH(PaletteState state); /// /// Gets the vertical relative alignment of the image. /// - /// Content style. /// Palette value should be applicable to this state. /// RelativeAlignment value. - PaletteRelativeAlign GetContentImageV(PaletteContentStyle style, PaletteState state); + PaletteRelativeAlign GetContentImageV(PaletteState state); /// /// Gets the effect applied to drawing of the image. /// - /// Content style. /// Palette value should be applicable to this state. /// PaletteImageEffect value. - PaletteImageEffect GetContentImageEffect(PaletteContentStyle style, PaletteState state); + PaletteImageEffect GetContentImageEffect(PaletteState state); /// /// Gets the image color to remap into another color. /// - /// Content style. /// Palette value should be applicable to this state. /// Color value. - Color GetContentImageColorMap(PaletteContentStyle style, PaletteState state); + Color GetContentImageColorMap(PaletteState state); /// /// Gets the color to use in place of the image map color. /// - /// Content style. /// Palette value should be applicable to this state. /// Color value. - Color GetContentImageColorTo(PaletteContentStyle style, PaletteState state); + Color GetContentImageColorTo(PaletteState state); /// /// Gets the font for the short text. /// - /// Content style. /// Palette value should be applicable to this state. /// Font value. - Font GetContentShortTextFont(PaletteContentStyle style, PaletteState state); + Font GetContentShortTextFont(PaletteState state); /// /// Gets the font for the short text by generating a new font instance. /// - /// Content style. /// Palette value should be applicable to this state. /// Font value. - Font GetContentShortTextNewFont(PaletteContentStyle style, PaletteState state); + Font GetContentShortTextNewFont(PaletteState state); /// /// Gets the rendering hint for the short text. /// - /// Content style. /// Palette value should be applicable to this state. /// PaletteTextHint value. - PaletteTextHint GetContentShortTextHint(PaletteContentStyle style, PaletteState state); + PaletteTextHint GetContentShortTextHint(PaletteState state); /// - /// Gets the flag indicating if multiline text is allowed for short text. + /// Gets the prefix drawing setting for short text. /// - /// Content style. /// Palette value should be applicable to this state. - /// InheritBool value. - InheritBool GetContentShortTextMultiLine(PaletteContentStyle style, PaletteState state); + /// PaletteTextPrefix value. + PaletteTextHotkeyPrefix GetContentShortTextPrefix(PaletteState state); /// - /// Gets the text trimming to use for short text. + /// Gets the flag indicating if multiline text is allowed for short text. /// - /// Content style. /// Palette value should be applicable to this state. - /// PaletteTextTrim value. - PaletteTextTrim GetContentShortTextTrim(PaletteContentStyle style, PaletteState state); + /// InheritBool value. + InheritBool GetContentShortTextMultiLine(PaletteState state); /// - /// Gets the prefix drawing setting for short text. + /// Gets the text trimming to use for short text. /// - /// Content style. /// Palette value should be applicable to this state. - /// PaletteTextPrefix value. - PaletteTextHotkeyPrefix GetContentShortTextPrefix(PaletteContentStyle style, PaletteState state); + /// PaletteTextTrim value. + PaletteTextTrim GetContentShortTextTrim(PaletteState state); /// /// Gets the horizontal relative alignment of the short text. /// - /// Content style. /// Palette value should be applicable to this state. /// RelativeAlignment value. - PaletteRelativeAlign GetContentShortTextH(PaletteContentStyle style, PaletteState state); + PaletteRelativeAlign GetContentShortTextH(PaletteState state); /// /// Gets the vertical relative alignment of the short text. /// - /// Content style. /// Palette value should be applicable to this state. /// RelativeAlignment value. - PaletteRelativeAlign GetContentShortTextV(PaletteContentStyle style, PaletteState state); + PaletteRelativeAlign GetContentShortTextV(PaletteState state); /// /// Gets the horizontal relative alignment of multiline short text. /// - /// Content style. /// Palette value should be applicable to this state. /// RelativeAlignment value. - PaletteRelativeAlign GetContentShortTextMultiLineH(PaletteContentStyle style, PaletteState state); + PaletteRelativeAlign GetContentShortTextMultiLineH(PaletteState state); /// /// Gets the first back color for the short text. /// - /// Content style. /// Palette value should be applicable to this state. /// Color value. - Color GetContentShortTextColor1(PaletteContentStyle style, PaletteState state); + Color GetContentShortTextColor1(PaletteState state); /// /// Gets the second back color for the short text. /// - /// Content style. /// Palette value should be applicable to this state. /// Color value. - Color GetContentShortTextColor2(PaletteContentStyle style, PaletteState state); + Color GetContentShortTextColor2(PaletteState state); /// /// Gets the color drawing style for the short text. /// - /// Content style. /// Palette value should be applicable to this state. /// Color drawing style. - PaletteColorStyle GetContentShortTextColorStyle(PaletteContentStyle style, PaletteState state); + PaletteColorStyle GetContentShortTextColorStyle(PaletteState state); /// /// Gets the color alignment for the short text. /// - /// Content style. /// Palette value should be applicable to this state. /// Color alignment style. - PaletteRectangleAlign GetContentShortTextColorAlign(PaletteContentStyle style, PaletteState state); + PaletteRectangleAlign GetContentShortTextColorAlign(PaletteState state); /// /// Gets the color background angle for the short text. /// - /// Content style. /// Palette value should be applicable to this state. /// Angle used for color drawing. - float GetContentShortTextColorAngle(PaletteContentStyle style, PaletteState state); + float GetContentShortTextColorAngle(PaletteState state); /// /// Gets a background image for the short text. /// - /// Content style. /// Palette value should be applicable to this state. /// Image instance. - Image GetContentShortTextImage(PaletteContentStyle style, PaletteState state); + Image GetContentShortTextImage(PaletteState state); /// /// Gets the background image style. /// - /// Content style. /// Palette value should be applicable to this state. /// Image style value. - PaletteImageStyle GetContentShortTextImageStyle(PaletteContentStyle style, PaletteState state); + PaletteImageStyle GetContentShortTextImageStyle(PaletteState state); /// /// Gets the image alignment for the short text. /// - /// Content style. /// Palette value should be applicable to this state. /// Image alignment style. - PaletteRectangleAlign GetContentShortTextImageAlign(PaletteContentStyle style, PaletteState state); + PaletteRectangleAlign GetContentShortTextImageAlign(PaletteState state); /// /// Gets the font for the long text. /// - /// Content style. /// Palette value should be applicable to this state. /// Font value. - Font GetContentLongTextFont(PaletteContentStyle style, PaletteState state); + Font GetContentLongTextFont(PaletteState state); /// /// Gets the font for the long text by generating a new font instance. /// - /// Content style. /// Palette value should be applicable to this state. /// Font value. - Font GetContentLongTextNewFont(PaletteContentStyle style, PaletteState state); + Font GetContentLongTextNewFont(PaletteState state); /// /// Gets the rendering hint for the long text. /// - /// Content style. - /// Palette value should be applicable to this state. - /// TextRenderingHint value. - PaletteTextHint GetContentLongTextHint(PaletteContentStyle style, PaletteState state); - - /// - /// Gets the prefix drawing setting for long text. - /// - /// Content style. /// Palette value should be applicable to this state. - /// PaletteTextPrefix value. - PaletteTextHotkeyPrefix GetContentLongTextPrefix(PaletteContentStyle style, PaletteState state); + /// PaletteTextHint value. + PaletteTextHint GetContentLongTextHint(PaletteState state); /// /// Gets the flag indicating if multiline text is allowed for long text. /// - /// Content style. /// Palette value should be applicable to this state. /// InheritBool value. - InheritBool GetContentLongTextMultiLine(PaletteContentStyle style, PaletteState state); + InheritBool GetContentLongTextMultiLine(PaletteState state); /// /// Gets the text trimming to use for long text. /// - /// Content style. /// Palette value should be applicable to this state. /// PaletteTextTrim value. - PaletteTextTrim GetContentLongTextTrim(PaletteContentStyle style, PaletteState state); + PaletteTextTrim GetContentLongTextTrim(PaletteState state); + + /// + /// Gets the prefix drawing setting for long text. + /// + /// Palette value should be applicable to this state. + /// PaletteTextPrefix value. + PaletteTextHotkeyPrefix GetContentLongTextPrefix(PaletteState state); /// /// Gets the horizontal relative alignment of the long text. /// - /// Content style. /// Palette value should be applicable to this state. /// RelativeAlignment value. - PaletteRelativeAlign GetContentLongTextH(PaletteContentStyle style, PaletteState state); + PaletteRelativeAlign GetContentLongTextH(PaletteState state); /// /// Gets the vertical relative alignment of the long text. /// - /// Content style. /// Palette value should be applicable to this state. /// RelativeAlignment value. - PaletteRelativeAlign GetContentLongTextV(PaletteContentStyle style, PaletteState state); + PaletteRelativeAlign GetContentLongTextV(PaletteState state); /// /// Gets the horizontal relative alignment of multiline long text. /// - /// Content style. /// Palette value should be applicable to this state. /// RelativeAlignment value. - PaletteRelativeAlign GetContentLongTextMultiLineH(PaletteContentStyle style, PaletteState state); + PaletteRelativeAlign GetContentLongTextMultiLineH(PaletteState state); /// /// Gets the first back color for the long text. /// - /// Content style. /// Palette value should be applicable to this state. /// Color value. - Color GetContentLongTextColor1(PaletteContentStyle style, PaletteState state); + Color GetContentLongTextColor1(PaletteState state); /// /// Gets the second back color for the long text. /// - /// Content style. /// Palette value should be applicable to this state. /// Color value. - Color GetContentLongTextColor2(PaletteContentStyle style, PaletteState state); + Color GetContentLongTextColor2(PaletteState state); /// /// Gets the color drawing style for the long text. /// - /// Content style. /// Palette value should be applicable to this state. /// Color drawing style. - PaletteColorStyle GetContentLongTextColorStyle(PaletteContentStyle style, PaletteState state); + PaletteColorStyle GetContentLongTextColorStyle(PaletteState state); /// /// Gets the color alignment for the long text. /// - /// Content style. /// Palette value should be applicable to this state. /// Color alignment style. - PaletteRectangleAlign GetContentLongTextColorAlign(PaletteContentStyle style, PaletteState state); + PaletteRectangleAlign GetContentLongTextColorAlign(PaletteState state); /// /// Gets the color background angle for the long text. /// - /// Content style. /// Palette value should be applicable to this state. /// Angle used for color drawing. - float GetContentLongTextColorAngle(PaletteContentStyle style, PaletteState state); + float GetContentLongTextColorAngle(PaletteState state); /// /// Gets a background image for the long text. /// - /// Content style. /// Palette value should be applicable to this state. /// Image instance. - Image GetContentLongTextImage(PaletteContentStyle style, PaletteState state); + Image GetContentLongTextImage(PaletteState state); /// /// Gets the background image style for the long text. /// - /// Content style. /// Palette value should be applicable to this state. /// Image style value. - PaletteImageStyle GetContentLongTextImageStyle(PaletteContentStyle style, PaletteState state); + PaletteImageStyle GetContentLongTextImageStyle(PaletteState state); /// /// Gets the image alignment for the long text. /// - /// Content style. /// Palette value should be applicable to this state. /// Image alignment style. - PaletteRectangleAlign GetContentLongTextImageAlign(PaletteContentStyle style, PaletteState state); + PaletteRectangleAlign GetContentLongTextImageAlign(PaletteState state); /// /// Gets the padding between the border and content drawing. /// - /// Content style. /// Palette value should be applicable to this state. /// Padding value. - Padding GetContentPadding(PaletteContentStyle style, PaletteState state); + Padding GetContentPadding(PaletteState state); /// /// Gets the padding between adjacent content items. /// - /// Content style. /// Palette value should be applicable to this state. /// Integer value. - int GetContentAdjacentGap(PaletteContentStyle style, PaletteState state); - #endregion + int GetContentAdjacentGap(PaletteState state); + + /// + /// Gets the style appropriate for this content. + /// + /// Content style. + PaletteContentStyle GetContentStyle(); + } + #endregion - #region Metric + #region IPaletteMetric + /// + /// Exposes a palette source for acquiring metrics. + /// + public interface IPaletteMetric + { /// /// Gets an integer metric value. /// @@ -623,70 +536,69 @@ public interface IPalette1 /// Requested metric. /// Padding value. Padding GetMetricPadding(PaletteState state, PaletteMetricPadding metric); - #endregion - - #region Images - /// - /// Gets a tree view image appropriate for the provided state. - /// - /// Is the node expanded - /// Appropriate image for drawing; otherwise null. - Image GetTreeViewImage(bool expanded); - - /// - /// Gets a check box image appropriate for the provided state. - /// - /// Is the check box enabled. - /// Is the check box checked/unchecked/indeterminate. - /// Is the check box being hot tracked. - /// Is the check box being pressed. - /// Appropriate image for drawing; otherwise null. - Image GetCheckBoxImage(bool enabled, CheckState checkState, bool tracking, bool pressed); + } + #endregion + #region IPaletteDouble + /// + /// Access to the double of back and border palettes. + /// + public interface IPaletteDouble + { /// - /// Gets a check box image appropriate for the provided state. + /// Gets the background palette. /// - /// Is the radio button enabled. - /// Is the radio button checked. - /// Is the radio button being hot tracked. - /// Is the radio button being pressed. - /// Appropriate image for drawing; otherwise null. - Image GetRadioButtonImage(bool enabled, bool checkState, bool tracking, bool pressed); + IPaletteBack PaletteBack { get; } /// - /// Gets a drop down button image appropriate for the provided state. + /// Gets the border palette. /// - /// PaletteState for which image is required. - Image GetDropDownButtonImage(PaletteState state); + IPaletteBorder PaletteBorder { get; } + } + #endregion + #region IPaletteSeparator + /// + /// Access to the back and border palettes plus metrics. + /// + public interface IPaletteSeparator : IPaletteDouble + { /// - /// Gets a checked image appropriate for a context menu item. + /// Gets the palette source for acquiring metrics. /// - /// Appropriate image for drawing; otherwise null. - Image GetContextMenuCheckedImage(); + IPaletteMetric PaletteMetric { get; } + } + #endregion + #region IPaletteTriple + /// + /// Access to the triple of back, border and content palettes. + /// + public interface IPaletteTriple + { /// - /// Gets a indeterminate image appropriate for a context menu item. + /// Gets the background palette. /// - /// Appropriate image for drawing; otherwise null. - Image GetContextMenuIndeterminateImage(); + IPaletteBack PaletteBack { get; } /// - /// Gets an image indicating a sub-menu on a context menu item. + /// Gets the border palette. /// - /// Appropriate image for drawing; otherwise null. - Image GetContextMenuSubMenuImage(); + IPaletteBorder PaletteBorder { get; } /// - /// Gets a check box image appropriate for the provided state. + /// Gets the content palette. /// - /// Enum of the button to fetch. - /// State of the button to fetch. - /// Appropriate image for drawing; otherwise null. - Image GetGalleryButtonImage(PaletteRibbonGalleryButton button, PaletteState state); - #endregion + IPaletteContent PaletteContent { get; } + } + #endregion - #region ButtonSpec + #region IPaletteButtonSpec + /// + /// Exposes a palette source button specifications. + /// + public interface IPaletteButtonSpec + { /// /// Gets the icon to display for the button. /// @@ -764,9 +676,15 @@ public interface IPalette1 /// Style of button spec. /// PaletteButtonOrientation value. PaletteButtonOrientation GetButtonSpecOrientation(PaletteButtonSpecStyle style); - #endregion + } + #endregion - #region RibbonGeneral + #region IPaletteRibbonGeneral + /// + /// Exposes a palette source for general ribbon specifications. + /// + public interface IPaletteRibbonGeneral + { /// /// Gets the ribbon shape that should be used. /// @@ -809,32 +727,32 @@ public interface IPalette1 Color GetRibbonDisabledLight(PaletteState state); /// - /// Gets the color for the drop arrow light. + /// Gets the color for the group dialog launcher dark. /// /// Palette value should be applicable to this state. /// Color value. - Color GetRibbonDropArrowLight(PaletteState state); + Color GetRibbonGroupDialogDark(PaletteState state); /// - /// Gets the color for the drop arrow dark. + /// Gets the color for the group dialog launcher light. /// /// Palette value should be applicable to this state. /// Color value. - Color GetRibbonDropArrowDark(PaletteState state); + Color GetRibbonGroupDialogLight(PaletteState state); /// - /// Gets the color for the group dialog launcher dark. + /// Gets the color for the drop arrow dark. /// /// Palette value should be applicable to this state. /// Color value. - Color GetRibbonGroupDialogDark(PaletteState state); + Color GetRibbonDropArrowDark(PaletteState state); /// - /// Gets the color for the group dialog launcher light. + /// Gets the color for the drop arrow light. /// /// Palette value should be applicable to this state. /// Color value. - Color GetRibbonGroupDialogLight(PaletteState state); + Color GetRibbonDropArrowLight(PaletteState state); /// /// Gets the color for the group separator dark. @@ -905,117 +823,80 @@ public interface IPalette1 /// Palette value should be applicable to this state. /// Color value. Color GetRibbonQATButtonLight(PaletteState state); - #endregion + } + #endregion - #region RibbonBack + #region IPaletteRibbonBack + /// + /// Exposes a palette source for ribbon background specifications. + /// + public interface IPaletteRibbonBack + { /// /// Gets the method used to draw the background of a ribbon item. /// - /// Background style. /// Palette value should be applicable to this state. /// PaletteRibbonBackStyle value. - PaletteRibbonColorStyle GetRibbonBackColorStyle(PaletteRibbonBackStyle style, PaletteState state); + PaletteRibbonColorStyle GetRibbonBackColorStyle(PaletteState state); /// /// Gets the first background color for the ribbon item. /// - /// Background style. /// Palette value should be applicable to this state. /// Color value. - Color GetRibbonBackColor1(PaletteRibbonBackStyle style, PaletteState state); + Color GetRibbonBackColor1(PaletteState state); /// /// Gets the second background color for the ribbon item. /// - /// Background style. /// Palette value should be applicable to this state. /// Color value. - Color GetRibbonBackColor2(PaletteRibbonBackStyle style, PaletteState state); + Color GetRibbonBackColor2(PaletteState state); /// /// Gets the third background color for the ribbon item. /// - /// Background style. /// Palette value should be applicable to this state. /// Color value. - Color GetRibbonBackColor3(PaletteRibbonBackStyle style, PaletteState state); + Color GetRibbonBackColor3(PaletteState state); /// /// Gets the fourth background color for the ribbon item. /// - /// Background style. /// Palette value should be applicable to this state. /// Color value. - Color GetRibbonBackColor4(PaletteRibbonBackStyle style, PaletteState state); + Color GetRibbonBackColor4(PaletteState state); /// /// Gets the fifth background color for the ribbon item. /// - /// Background style. /// Palette value should be applicable to this state. /// Color value. - Color GetRibbonBackColor5(PaletteRibbonBackStyle style, PaletteState state); - #endregion + Color GetRibbonBackColor5(PaletteState state); + } + #endregion - #region RibbonText + #region IPaletteRibbonText + /// + /// Exposes a palette source for ribbon text specifications. + /// + public interface IPaletteRibbonText + { /// /// Gets the tab color for the item text. /// - /// Text style. /// Palette value should be applicable to this state. /// Color value. - Color GetRibbonTextColor(PaletteRibbonTextStyle style, PaletteState state); - #endregion - - #region ElementColor - /// - /// Gets the first element color. - /// - /// Element for which color is required. - /// Palette value should be applicable to this state. - /// Color value. - Color GetElementColor1(PaletteElement element, PaletteState state); - - /// - /// Gets the second element color. - /// - /// Element for which color is required. - /// Palette value should be applicable to this state. - /// Color value. - Color GetElementColor2(PaletteElement element, PaletteState state); - - /// - /// Gets the third element color. - /// - /// Element for which color is required. - /// Palette value should be applicable to this state. - /// Color value. - Color GetElementColor3(PaletteElement element, PaletteState state); - - /// - /// Gets the fourth element color. - /// - /// Element for which color is required. - /// Palette value should be applicable to this state. - /// Color value. - Color GetElementColor4(PaletteElement element, PaletteState state); - - /// - /// Gets the fifth element color. - /// - /// Element for which color is required. - /// Palette value should be applicable to this state. - /// Color value. - Color GetElementColor5(PaletteElement element, PaletteState state); - #endregion - - #region DragDrop - /// - /// Gets the feedback drawing method used. - /// - /// Feedback enumeration value. - PaletteDragFeedback GetDragDropFeedback(); + Color GetRibbonTextColor(PaletteState state); + } + #endregion + #region IPaletteDragDrop + /// + /// Access to drag the drop settings. + /// + public interface IPaletteDragDrop + { /// /// Gets the background color for a solid drag drop area. /// @@ -1057,1609 +938,94 @@ public interface IPalette1 /// /// Color value. Color GetDragDropDockInactive(); - #endregion - - #region ColorTable - /// - /// Gets access to the color table instance. - /// - KryptonColorTable ColorTable { get; } - #endregion - - #region BaseFontSize - - // Gets or sets the size of the base font. - // The size of the base font. - //float BaseFontSize { get; set; } - - #endregion } #endregion - #region IPaletteBack + #region IPaletteElementColor /// - /// Exposes a palette source for drawing a background. + /// Exposes a palette source for element colors. /// - public interface IPaletteBack + public interface IPaletteElementColor { /// - /// Gets a value indicating if background should be drawn. - /// - /// Palette value should be applicable to this state. - /// InheritBool value. - InheritBool GetBackDraw(PaletteState state); - - /// - /// Gets the graphics drawing hint. - /// - /// Palette value should be applicable to this state. - /// PaletteGraphicsHint value. - PaletteGraphicsHint GetBackGraphicsHint(PaletteState state); - - /// - /// Gets the first back color. + /// Gets the first color for the element. /// /// Palette value should be applicable to this state. /// Color value. - Color GetBackColor1(PaletteState state); + Color GetElementColor1(PaletteState state); /// - /// Gets the second back color. + /// Gets the second color for the element. /// /// Palette value should be applicable to this state. /// Color value. - Color GetBackColor2(PaletteState state); - - /// - /// Gets the color drawing style. - /// - /// Palette value should be applicable to this state. - /// Color drawing style. - PaletteColorStyle GetBackColorStyle(PaletteState state); - - /// - /// Gets the color alignment. - /// - /// Palette value should be applicable to this state. - /// Color alignment style. - PaletteRectangleAlign GetBackColorAlign(PaletteState state); - - /// - /// Gets the color background angle. - /// - /// Palette value should be applicable to this state. - /// Angle used for color drawing. - float GetBackColorAngle(PaletteState state); - - /// - /// Gets a background image. - /// - /// Palette value should be applicable to this state. - /// Image instance. - Image GetBackImage(PaletteState state); - - /// - /// Gets the background image style. - /// - /// Palette value should be applicable to this state. - /// Image style value. - PaletteImageStyle GetBackImageStyle(PaletteState state); - - /// - /// Gets the image alignment. - /// - /// Palette value should be applicable to this state. - /// Image alignment style. - PaletteRectangleAlign GetBackImageAlign(PaletteState state); - } - #endregion - - #region IPaletteBorder - /// - /// Exposes a palette source for drawing a border. - /// - public interface IPaletteBorder - { - /// - /// Gets a value indicating if border should be drawn. - /// - /// Palette value should be applicable to this state. - /// InheritBool value. - InheritBool GetBorderDraw(PaletteState state); - - /// - /// Gets a value indicating which borders to draw. - /// - /// Palette value should be applicable to this state. - /// PaletteDrawBorders value. - PaletteDrawBorders GetBorderDrawBorders(PaletteState state); - - /// - /// Gets the graphics drawing hint. - /// - /// Palette value should be applicable to this state. - /// PaletteGraphicsHint value. - PaletteGraphicsHint GetBorderGraphicsHint(PaletteState state); + Color GetElementColor2(PaletteState state); /// - /// Gets the first border color. + /// Gets the third color for the element. /// /// Palette value should be applicable to this state. /// Color value. - Color GetBorderColor1(PaletteState state); + Color GetElementColor3(PaletteState state); /// - /// Gets the second border color. + /// Gets the fourth color for the element. /// /// Palette value should be applicable to this state. /// Color value. - Color GetBorderColor2(PaletteState state); - - /// - /// Gets the color drawing style. - /// - /// Palette value should be applicable to this state. - /// Color drawing style. - PaletteColorStyle GetBorderColorStyle(PaletteState state); - - /// - /// Gets the color alignment. - /// - /// Palette value should be applicable to this state. - /// Color alignment style. - PaletteRectangleAlign GetBorderColorAlign(PaletteState state); - - /// - /// Gets the color border angle. - /// - /// Palette value should be applicable to this state. - /// Angle used for color drawing. - float GetBorderColorAngle(PaletteState state); - - /// - /// Gets the border width. - /// - /// Palette value should be applicable to this state. - /// Integer width. - int GetBorderWidth(PaletteState state); - - /// - /// Gets the border corner rounding. - /// - /// Palette value should be applicable to this state. - /// Integer rounding. - float GetBorderRounding(PaletteState state); - - /// - /// Gets a border image. - /// - /// Palette value should be applicable to this state. - /// Image instance. - Image GetBorderImage(PaletteState state); - - /// - /// Gets the border image style. - /// - /// Palette value should be applicable to this state. - /// Image style value. - PaletteImageStyle GetBorderImageStyle(PaletteState state); + Color GetElementColor4(PaletteState state); /// - /// Gets the image alignment. + /// Gets the fifth color for the element. /// /// Palette value should be applicable to this state. - /// Image alignment style. - PaletteRectangleAlign GetBorderImageAlign(PaletteState state); + /// Color value. + Color GetElementColor5(PaletteState state); } #endregion - #region IPaletteContent + #region Enum InheritBool /// - /// Exposes a palette source for drawing content. + /// Specifies a boolean that can inherit its value. /// - public interface IPaletteContent + public enum InheritBool { /// - /// Gets a value indicating if content should be drawn. + /// Specifies the value should be inherited. /// - /// Palette value should be applicable to this state. - /// InheritBool value. - InheritBool GetContentDraw(PaletteState state); + Inherit, /// - /// Gets a value indicating if content should be drawn with focus indication. + /// Specifies a boolean true. /// - /// Palette value should be applicable to this state. - /// InheritBool value. - InheritBool GetContentDrawFocus(PaletteState state); + True, /// - /// Gets the horizontal relative alignment of the image. + /// Specifies a boolean false. /// - /// Palette value should be applicable to this state. - /// RelativeAlignment value. - PaletteRelativeAlign GetContentImageH(PaletteState state); + False + } + #endregion - /// - /// Gets the vertical relative alignment of the image. - /// - /// Palette value should be applicable to this state. - /// RelativeAlignment value. - PaletteRelativeAlign GetContentImageV(PaletteState state); + #region Enum BasePaletteType - /// - /// Gets the effect applied to drawing of the image. - /// - /// Palette value should be applicable to this state. - /// PaletteImageEffect value. - PaletteImageEffect GetContentImageEffect(PaletteState state); + public enum BasePaletteType + { + Custom, + Professional, + Office2007, + Office2010, + Office2013, + Microsoft365, + Sparkle + } - /// - /// Gets the image color to remap into another color. - /// - /// Palette value should be applicable to this state. - /// Color value. - Color GetContentImageColorMap(PaletteState state); - - /// - /// Gets the color to use in place of the image map color. - /// - /// Palette value should be applicable to this state. - /// Color value. - Color GetContentImageColorTo(PaletteState state); - - /// - /// Gets the font for the short text. - /// - /// Palette value should be applicable to this state. - /// Font value. - Font GetContentShortTextFont(PaletteState state); - - /// - /// Gets the font for the short text by generating a new font instance. - /// - /// Palette value should be applicable to this state. - /// Font value. - Font GetContentShortTextNewFont(PaletteState state); - - /// - /// Gets the rendering hint for the short text. - /// - /// Palette value should be applicable to this state. - /// PaletteTextHint value. - PaletteTextHint GetContentShortTextHint(PaletteState state); - - /// - /// Gets the prefix drawing setting for short text. - /// - /// Palette value should be applicable to this state. - /// PaletteTextPrefix value. - PaletteTextHotkeyPrefix GetContentShortTextPrefix(PaletteState state); - - /// - /// Gets the flag indicating if multiline text is allowed for short text. - /// - /// Palette value should be applicable to this state. - /// InheritBool value. - InheritBool GetContentShortTextMultiLine(PaletteState state); - - /// - /// Gets the text trimming to use for short text. - /// - /// Palette value should be applicable to this state. - /// PaletteTextTrim value. - PaletteTextTrim GetContentShortTextTrim(PaletteState state); - - /// - /// Gets the horizontal relative alignment of the short text. - /// - /// Palette value should be applicable to this state. - /// RelativeAlignment value. - PaletteRelativeAlign GetContentShortTextH(PaletteState state); - - /// - /// Gets the vertical relative alignment of the short text. - /// - /// Palette value should be applicable to this state. - /// RelativeAlignment value. - PaletteRelativeAlign GetContentShortTextV(PaletteState state); - - /// - /// Gets the horizontal relative alignment of multiline short text. - /// - /// Palette value should be applicable to this state. - /// RelativeAlignment value. - PaletteRelativeAlign GetContentShortTextMultiLineH(PaletteState state); - - /// - /// Gets the first back color for the short text. - /// - /// Palette value should be applicable to this state. - /// Color value. - Color GetContentShortTextColor1(PaletteState state); - - /// - /// Gets the second back color for the short text. - /// - /// Palette value should be applicable to this state. - /// Color value. - Color GetContentShortTextColor2(PaletteState state); - - /// - /// Gets the color drawing style for the short text. - /// - /// Palette value should be applicable to this state. - /// Color drawing style. - PaletteColorStyle GetContentShortTextColorStyle(PaletteState state); - - /// - /// Gets the color alignment for the short text. - /// - /// Palette value should be applicable to this state. - /// Color alignment style. - PaletteRectangleAlign GetContentShortTextColorAlign(PaletteState state); - - /// - /// Gets the color background angle for the short text. - /// - /// Palette value should be applicable to this state. - /// Angle used for color drawing. - float GetContentShortTextColorAngle(PaletteState state); - - /// - /// Gets a background image for the short text. - /// - /// Palette value should be applicable to this state. - /// Image instance. - Image GetContentShortTextImage(PaletteState state); - - /// - /// Gets the background image style. - /// - /// Palette value should be applicable to this state. - /// Image style value. - PaletteImageStyle GetContentShortTextImageStyle(PaletteState state); - - /// - /// Gets the image alignment for the short text. - /// - /// Palette value should be applicable to this state. - /// Image alignment style. - PaletteRectangleAlign GetContentShortTextImageAlign(PaletteState state); - - /// - /// Gets the font for the long text. - /// - /// Palette value should be applicable to this state. - /// Font value. - Font GetContentLongTextFont(PaletteState state); - - /// - /// Gets the font for the long text by generating a new font instance. - /// - /// Palette value should be applicable to this state. - /// Font value. - Font GetContentLongTextNewFont(PaletteState state); - - /// - /// Gets the rendering hint for the long text. - /// - /// Palette value should be applicable to this state. - /// PaletteTextHint value. - PaletteTextHint GetContentLongTextHint(PaletteState state); - - /// - /// Gets the flag indicating if multiline text is allowed for long text. - /// - /// Palette value should be applicable to this state. - /// InheritBool value. - InheritBool GetContentLongTextMultiLine(PaletteState state); - - /// - /// Gets the text trimming to use for long text. - /// - /// Palette value should be applicable to this state. - /// PaletteTextTrim value. - PaletteTextTrim GetContentLongTextTrim(PaletteState state); - - /// - /// Gets the prefix drawing setting for long text. - /// - /// Palette value should be applicable to this state. - /// PaletteTextPrefix value. - PaletteTextHotkeyPrefix GetContentLongTextPrefix(PaletteState state); - - /// - /// Gets the horizontal relative alignment of the long text. - /// - /// Palette value should be applicable to this state. - /// RelativeAlignment value. - PaletteRelativeAlign GetContentLongTextH(PaletteState state); - - /// - /// Gets the vertical relative alignment of the long text. - /// - /// Palette value should be applicable to this state. - /// RelativeAlignment value. - PaletteRelativeAlign GetContentLongTextV(PaletteState state); - - /// - /// Gets the horizontal relative alignment of multiline long text. - /// - /// Palette value should be applicable to this state. - /// RelativeAlignment value. - PaletteRelativeAlign GetContentLongTextMultiLineH(PaletteState state); - - /// - /// Gets the first back color for the long text. - /// - /// Palette value should be applicable to this state. - /// Color value. - Color GetContentLongTextColor1(PaletteState state); - - /// - /// Gets the second back color for the long text. - /// - /// Palette value should be applicable to this state. - /// Color value. - Color GetContentLongTextColor2(PaletteState state); - - /// - /// Gets the color drawing style for the long text. - /// - /// Palette value should be applicable to this state. - /// Color drawing style. - PaletteColorStyle GetContentLongTextColorStyle(PaletteState state); - - /// - /// Gets the color alignment for the long text. - /// - /// Palette value should be applicable to this state. - /// Color alignment style. - PaletteRectangleAlign GetContentLongTextColorAlign(PaletteState state); - - /// - /// Gets the color background angle for the long text. - /// - /// Palette value should be applicable to this state. - /// Angle used for color drawing. - float GetContentLongTextColorAngle(PaletteState state); - - /// - /// Gets a background image for the long text. - /// - /// Palette value should be applicable to this state. - /// Image instance. - Image GetContentLongTextImage(PaletteState state); - - /// - /// Gets the background image style for the long text. - /// - /// Palette value should be applicable to this state. - /// Image style value. - PaletteImageStyle GetContentLongTextImageStyle(PaletteState state); - - /// - /// Gets the image alignment for the long text. - /// - /// Palette value should be applicable to this state. - /// Image alignment style. - PaletteRectangleAlign GetContentLongTextImageAlign(PaletteState state); - - /// - /// Gets the padding between the border and content drawing. - /// - /// Palette value should be applicable to this state. - /// Padding value. - Padding GetContentPadding(PaletteState state); - - /// - /// Gets the padding between adjacent content items. - /// - /// Palette value should be applicable to this state. - /// Integer value. - int GetContentAdjacentGap(PaletteState state); - - /// - /// Gets the style appropriate for this content. - /// - /// Content style. - PaletteContentStyle GetContentStyle(); - } - #endregion - - #region IPaletteMetric - /// - /// Exposes a palette source for acquiring metrics. - /// - public interface IPaletteMetric - { - /// - /// Gets an integer metric value. - /// - /// Palette value should be applicable to this state. - /// Requested metric. - /// Integer value. - int GetMetricInt(PaletteState state, PaletteMetricInt metric); - - /// - /// Gets a boolean metric value. - /// - /// Palette value should be applicable to this state. - /// Requested metric. - /// InheritBool value. - InheritBool GetMetricBool(PaletteState state, PaletteMetricBool metric); - - /// - /// Gets a padding metric value. - /// - /// Palette value should be applicable to this state. - /// Requested metric. - /// Padding value. - Padding GetMetricPadding(PaletteState state, PaletteMetricPadding metric); - } - #endregion - - #region IPaletteDouble - /// - /// Access to the double of back and border palettes. - /// - public interface IPaletteDouble - { - /// - /// Gets the background palette. - /// - IPaletteBack PaletteBack { get; } - - /// - /// Gets the border palette. - /// - IPaletteBorder PaletteBorder { get; } - } - #endregion - - #region IPaletteSeparator - /// - /// Access to the back and border palettes plus metrics. - /// - public interface IPaletteSeparator : IPaletteDouble - { - /// - /// Gets the palette source for acquiring metrics. - /// - IPaletteMetric PaletteMetric { get; } - } - #endregion - - #region IPaletteTriple - /// - /// Access to the triple of back, border and content palettes. - /// - public interface IPaletteTriple - { - /// - /// Gets the background palette. - /// - IPaletteBack PaletteBack { get; } - - /// - /// Gets the border palette. - /// - IPaletteBorder PaletteBorder { get; } - - /// - /// Gets the content palette. - /// - IPaletteContent PaletteContent { get; } - } - #endregion - - #region IPaletteButtonSpec - /// - /// Exposes a palette source button specifications. - /// - public interface IPaletteButtonSpec - { - /// - /// Gets the icon to display for the button. - /// - /// Style of button spec. - /// Icon value. - Icon GetButtonSpecIcon(PaletteButtonSpecStyle style); - - /// - /// Gets the image to display for the button. - /// - /// Style of button spec. - /// State for which image is required. - /// Image value. - Image GetButtonSpecImage(PaletteButtonSpecStyle style, PaletteState state); - - /// - /// Gets the image transparent color. - /// - /// Style of button spec. - /// Color value. - Color GetButtonSpecImageTransparentColor(PaletteButtonSpecStyle style); - - /// - /// Gets the short text to display for the button. - /// - /// Style of button spec. - /// String value. - string GetButtonSpecShortText(PaletteButtonSpecStyle style); - - /// - /// Gets the long text to display for the button. - /// - /// Style of button spec. - /// String value. - string GetButtonSpecLongText(PaletteButtonSpecStyle style); - - /// - /// Gets the tooltip title text to display for the button. - /// - /// Style of button spec. - /// String value. - string GetButtonSpecToolTipTitle(PaletteButtonSpecStyle style); - - /// - /// Gets the color to remap from the image to the container foreground. - /// - /// Style of button spec. - /// Color value. - Color GetButtonSpecColorMap(PaletteButtonSpecStyle style); - - /// - /// Gets the button style used for drawing the button. - /// - /// Style of button spec. - /// PaletteButtonStyle value. - PaletteButtonStyle GetButtonSpecStyle(PaletteButtonSpecStyle style); - - /// - /// Get the location for the button. - /// - /// Style of button spec. - /// HeaderLocation value. - HeaderLocation GetButtonSpecLocation(PaletteButtonSpecStyle style); - - /// - /// Gets the edge to position the button against. - /// - /// Style of button spec. - /// PaletteRelativeEdgeAlign value. - PaletteRelativeEdgeAlign GetButtonSpecEdge(PaletteButtonSpecStyle style); - - /// - /// Gets the button orientation. - /// - /// Style of button spec. - /// PaletteButtonOrientation value. - PaletteButtonOrientation GetButtonSpecOrientation(PaletteButtonSpecStyle style); - } - #endregion - - #region IPaletteRibbonGeneral - /// - /// Exposes a palette source for general ribbon specifications. - /// - public interface IPaletteRibbonGeneral - { - /// - /// Gets the ribbon shape that should be used. - /// - /// Ribbon shape value. - PaletteRibbonShape GetRibbonShape(); - - /// - /// Gets the text alignment for the ribbon context text. - /// - /// Palette value should be applicable to this state. - /// Font value. - PaletteRelativeAlign GetRibbonContextTextAlign(PaletteState state); - - /// - /// Gets the font for the ribbon context text. - /// - /// Palette value should be applicable to this state. - /// Font value. - Font GetRibbonContextTextFont(PaletteState state); - - /// - /// Gets the color for the ribbon context text. - /// - /// Palette value should be applicable to this state. - /// Font value. - Color GetRibbonContextTextColor(PaletteState state); - - /// - /// Gets the dark disabled color used for ribbon glyphs. - /// - /// Palette value should be applicable to this state. - /// Color value. - Color GetRibbonDisabledDark(PaletteState state); - - /// - /// Gets the light disabled color used for ribbon glyphs. - /// - /// Palette value should be applicable to this state. - /// Color value. - Color GetRibbonDisabledLight(PaletteState state); - - /// - /// Gets the color for the group dialog launcher dark. - /// - /// Palette value should be applicable to this state. - /// Color value. - Color GetRibbonGroupDialogDark(PaletteState state); - - /// - /// Gets the color for the group dialog launcher light. - /// - /// Palette value should be applicable to this state. - /// Color value. - Color GetRibbonGroupDialogLight(PaletteState state); - - /// - /// Gets the color for the drop arrow dark. - /// - /// Palette value should be applicable to this state. - /// Color value. - Color GetRibbonDropArrowDark(PaletteState state); - - /// - /// Gets the color for the drop arrow light. - /// - /// Palette value should be applicable to this state. - /// Color value. - Color GetRibbonDropArrowLight(PaletteState state); - - /// - /// Gets the color for the group separator dark. - /// - /// Palette value should be applicable to this state. - /// Color value. - Color GetRibbonGroupSeparatorDark(PaletteState state); - - /// - /// Gets the color for the group separator light. - /// - /// Palette value should be applicable to this state. - /// Color value. - Color GetRibbonGroupSeparatorLight(PaletteState state); - - /// - /// Gets the color for the minimize bar dark. - /// - /// Palette value should be applicable to this state. - /// Color value. - Color GetRibbonMinimizeBarDark(PaletteState state); - - /// - /// Gets the color for the minimize bar light. - /// - /// Palette value should be applicable to this state. - /// Color value. - Color GetRibbonMinimizeBarLight(PaletteState state); - - /// - /// Gets the color for the tab separator. - /// - /// Palette value should be applicable to this state. - /// Color value. - Color GetRibbonTabSeparatorColor(PaletteState state); - - /// - /// Gets the color for the tab context separators. - /// - /// Palette value should be applicable to this state. - /// Color value. - Color GetRibbonTabSeparatorContextColor(PaletteState state); - - /// - /// Gets the font for the ribbon text. - /// - /// Palette value should be applicable to this state. - /// Font value. - Font GetRibbonTextFont(PaletteState state); - - /// - /// Gets the rendering hint for the ribbon font. - /// - /// Palette value should be applicable to this state. - /// PaletteTextHint value. - PaletteTextHint GetRibbonTextHint(PaletteState state); - - /// - /// Gets the color for the extra QAT button dark content color. - /// - /// Palette value should be applicable to this state. - /// Color value. - Color GetRibbonQATButtonDark(PaletteState state); - - /// - /// Gets the color for the extra QAT button light content color. - /// - /// Palette value should be applicable to this state. - /// Color value. - Color GetRibbonQATButtonLight(PaletteState state); - } - #endregion - - #region IPaletteRibbonBack - /// - /// Exposes a palette source for ribbon background specifications. - /// - public interface IPaletteRibbonBack - { - /// - /// Gets the method used to draw the background of a ribbon item. - /// - /// Palette value should be applicable to this state. - /// PaletteRibbonBackStyle value. - PaletteRibbonColorStyle GetRibbonBackColorStyle(PaletteState state); - - /// - /// Gets the first background color for the ribbon item. - /// - /// Palette value should be applicable to this state. - /// Color value. - Color GetRibbonBackColor1(PaletteState state); - - /// - /// Gets the second background color for the ribbon item. - /// - /// Palette value should be applicable to this state. - /// Color value. - Color GetRibbonBackColor2(PaletteState state); - - /// - /// Gets the third background color for the ribbon item. - /// - /// Palette value should be applicable to this state. - /// Color value. - Color GetRibbonBackColor3(PaletteState state); - - /// - /// Gets the fourth background color for the ribbon item. - /// - /// Palette value should be applicable to this state. - /// Color value. - Color GetRibbonBackColor4(PaletteState state); - - /// - /// Gets the fifth background color for the ribbon item. - /// - /// Palette value should be applicable to this state. - /// Color value. - Color GetRibbonBackColor5(PaletteState state); - } - #endregion - - #region IPaletteRibbonText - /// - /// Exposes a palette source for ribbon text specifications. - /// - public interface IPaletteRibbonText - { - /// - /// Gets the tab color for the item text. - /// - /// Palette value should be applicable to this state. - /// Color value. - Color GetRibbonTextColor(PaletteState state); - } - #endregion - - #region IPaletteDragDrop - /// - /// Access to drag the drop settings. - /// - public interface IPaletteDragDrop - { - /// - /// Gets the background color for a solid drag drop area. - /// - /// Color value. - Color GetDragDropSolidBack(); - - /// - /// Gets the border color for a solid drag drop area. - /// - /// Color value. - Color GetDragDropSolidBorder(); - - /// - /// Gets the opacity of the solid area. - /// - /// Opacity ranging from 0 to 1. - float GetDragDropSolidOpacity(); - - /// - /// Gets the background color for the docking indicators area. - /// - /// Color value. - Color GetDragDropDockBack(); - - /// - /// Gets the border color for the docking indicators area. - /// - /// Color value. - Color GetDragDropDockBorder(); - - /// - /// Gets the active color for docking indicators. - /// - /// Color value. - Color GetDragDropDockActive(); - - /// - /// Gets the inactive color for docking indicators. - /// - /// Color value. - Color GetDragDropDockInactive(); - } - #endregion - - #region IPaletteElementColor - /// - /// Exposes a palette source for element colors. - /// - public interface IPaletteElementColor - { - /// - /// Gets the first color for the element. - /// - /// Palette value should be applicable to this state. - /// Color value. - Color GetElementColor1(PaletteState state); - - /// - /// Gets the second color for the element. - /// - /// Palette value should be applicable to this state. - /// Color value. - Color GetElementColor2(PaletteState state); - - /// - /// Gets the third color for the element. - /// - /// Palette value should be applicable to this state. - /// Color value. - Color GetElementColor3(PaletteState state); - - /// - /// Gets the fourth color for the element. - /// - /// Palette value should be applicable to this state. - /// Color value. - Color GetElementColor4(PaletteState state); - - /// - /// Gets the fifth color for the element. - /// - /// Palette value should be applicable to this state. - /// Color value. - Color GetElementColor5(PaletteState state); - } - #endregion - - #region Enum InheritBool - /// - /// Specifies a boolean that can inherit its value. - /// - public enum InheritBool - { - /// - /// Specifies the value should be inherited. - /// - Inherit, - - /// - /// Specifies a boolean true. - /// - True, - - /// - /// Specifies a boolean false. - /// - False - } - #endregion - - #region Enum PaletteMode - // TODO: Update documentation - /// - /// Specifies the palette applied when drawing. - /// - [TypeConverter(typeof(PaletteModeConverter))] - public enum PaletteMode - { - /// - /// Specifies the renderer defined by the KryptonManager be used. - /// - Global, - - /// - /// Specifies a professional appearance based on system settings. - /// - ProfessionalSystem, - - /// - /// Specifies a professional appearance with a preference to use theme colors. - /// - ProfessionalOffice2003, - - // Note: Re-enable when the gray themes are completed - /// - /// Specifies the dark Gray color variant of the Office 2007 appearance. - /// - Office2007DarkGray, - /* - /// - /// Specifies the light Gray color variant of the Office 2007 appearance. - /// - Office2007LightGray,*/ - - /// - /// Specifies the Blue color variant of the Office 2007 appearance. - /// - Office2007Blue, - - /// - /// Specifies a custom color variant of the Office 2007 appearance. - /// - Office2007Custom, - - /// - /// Specifies the dark Blue color variant of the Office 2007 appearance. - /// - Office2007BlueDarkMode, - - /// - /// Specifies the light Blue color variant of the Office 2007 appearance. - /// - Office2007BlueLightMode, - - /// - /// Specifies the Silver color variant of the Office 2007 appearance. - /// - Office2007Silver, - - /// - /// Specifies the dark Silver color variant of the Office 2007 appearance. - /// - Office2007SilverDarkMode, - - /// - /// Specifies the light Silver color variant of the Office 2007 appearance. - /// - Office2007SilverLightMode, - - /// - /// Specifies the White color variant of the Office 2007 appearance. - /// - Office2007White, - - /// - /// Specifies the Black color variant of the Office 2007 appearance. - /// - Office2007Black, - - /// - /// Specifies the dark Black color variant of the Office 2007 appearance. - /// - Office2007BlackDarkMode, - - // Note: Re-enable when the gray themes are completed - /// - /// Specifies the dark Gray color variant of the Office 2010 appearance. - /// - Office2010DarkGray, - /* - /// - /// Specifies the light Gray color variant of the Office 2010 appearance. - /// - Office2010LightGray,*/ - - /// - /// Specifies the Blue color variant of the Office 2010 appearance. - /// - Office2010Blue, - - /// - /// Specifies a custom color variant of the Office 2010 appearance. - /// - Office2010Custom, - - /// - /// Specifies the dark Blue color variant of the Office 2010 appearance. - /// - Office2010BlueDarkMode, - - /// - /// Specifies the light Blue color variant of the Office 2010 appearance. - /// - Office2010BlueLightMode, - - /// - /// Specifies the Silver color variant of the Office 2010 appearance. - /// - Office2010Silver, - - /// - /// Specifies the dark Silver color variant of the Office 2010 appearance. - /// - Office2010SilverDarkMode, - - /// - /// Specifies the light Silver color variant of the Office 2010 appearance. - /// - Office2010SilverLightMode, - - /// - /// Specifies the White color variant of the Office 2010 appearance. - /// - Office2010White, - - /// - /// Specifies the Black color variant of the Office 2010 appearance. - /// - Office2010Black, - - /// - /// Specifies the dark Black color variant of the Office 2010 appearance. - /// - Office2010BlackDarkMode, - - /// - /// Specifies a custom color variant of the Office 2013 appearance. - /// - Office2013Custom, - - // Note: Re-enable when the gray themes are completed - /// - /// Specifies the dark Gray color variant of the Office 2013 appearance. - /// - Office2013DarkGray, - /* - /// - /// Specifies the light Gray color variant of the Office 2013 appearance. - /// - Office2013LightGray,*/ - - /// - /// Specifies the White color variant of the Office 2013 appearance. - /// - Office2013White, - - // Note: Re-enable when the gray themes are completed - - /// - /// Specifies the dark Gray color variant of the Microsoft 365 appearance. - /// - Microsoft365DarkGray, - /* - /// - /// Specifies the light Gray color variant of the Microsoft 365 appearance. - /// - Microsoft365LightGray,*/ - - /// - /// Specifies the Black color variant of the Microsoft 365 appearance. - /// - Microsoft365Black, - - /// - /// Specifies the dark Black color variant of the Microsoft 365 appearance. - /// - Microsoft365BlackDarkMode, - - /// - /// Specifies the Blue color variant of the Microsoft 365 appearance. - /// - Microsoft365Blue, - - /// - /// Specifies the dark Blue color variant of the Microsoft 365 appearance. - /// - Microsoft365BlueDarkMode, - - /// - /// Specifies the light Blue color variant of the Microsoft 365 appearance. - /// - Microsoft365BlueLightMode, - - /// - /// Specifies a custom color variant of the Microsoft 365 appearance. - /// - Microsoft365Custom, - - /// - /// Specifies the Silver color variant of the Microsoft 365 appearance. - /// - Microsoft365Silver, - - /// - /// Specifies the dark Silver color variant of the Microsoft 365 appearance. - /// - Microsoft365SilverDarkMode, - - /// - /// Specifies the light Silver color variant of the Microsoft 365 appearance. - /// - Microsoft365SilverLightMode, - - /// - /// Specifies the White color variant of the Microsoft 365 appearance. - /// - Microsoft365White, - - /// - /// Specifies the Blue color variant on the Sparkle palette theme. - /// - SparkleBlue, - - /// - /// Specifies the dark Blue color variant on the Sparkle palette theme. - /// - SparkleBlueDarkMode, - - /// - /// Specifies the light Blue color variant on the Sparkle palette theme. - /// - SparkleBlueLightMode, - - /// - /// Specifies the Orange color variant on the Sparkle palette theme. - /// - SparkleOrange, - - /// - /// Specifies the dark Orange color variant on the Sparkle palette theme. - /// - SparkleOrangeDarkMode, - - /// - /// Specifies the light Orange color variant on the Sparkle palette theme. - /// - SparkleOrangeLightMode, - - /// - /// Specifies the Purple color variant on the Sparkle palette theme. - /// - SparklePurple, - - /// - /// Specifies the dark Purple color variant on the Sparkle palette theme. - /// - SparklePurpleDarkMode, - - /// - /// Specifies the light Purple color variant on the Sparkle palette theme. - /// - SparklePurpleLightMode, - - ///// - ///// Specifies the visual studio dark palette theme. - ///// - //VisualStudioDark, - - ///// - ///// Specifies the visual studio light palette theme. - ///// - //VisualStudioLight, - - /// - /// Specifies a custom palette be used. - /// - Custom - } - - /// - /// Specifies the palette requested at the global level. - /// - [TypeConverter(typeof(PaletteModeManagerConverter))] - public enum PaletteModeManager - { - /// - /// Specifies a professional appearance based on system settings. - /// - ProfessionalSystem, - - /// - /// Specifies a professional appearance with a preference to use theme colors. - /// - ProfessionalOffice2003, - - // Note: Re-enable when the gray themes are completed - /// - /// Specifies the dark Gray color variant of the Office 2007 appearance. - /// - Office2007DarkGray, - /* - /// - /// Specifies the light Gray color variant of the Office 2007 appearance. - /// - Office2007LightGray,*/ - - /// - /// Specifies the Blue color variant of the Office 2007 appearance. - /// - Office2007Blue, - - /// - /// Specifies the dark Blue color variant of the Office 2007 appearance. - /// - Office2007BlueDarkMode, - - /// - /// Specifies the light Blue color variant of the Office 2007 appearance. - /// - Office2007BlueLightMode, - - /// - /// Specifies a custom color variant of the Office 2007 appearance. - /// - Office2007Custom, - - /// - /// Specifies the Silver color variant of the Office 2007 appearance. - /// - Office2007Silver, - - /// - /// Specifies the dark Silver color variant of the Office 2007 appearance. - /// - Office2007SilverDarkMode, - - /// - /// Specifies the light Silver color variant of the Office 2007 appearance. - /// - Office2007SilverLightMode, - - /// - /// Specifies the White color variant of the Office 2007 appearance. - /// - Office2007White, - - /// - /// Specifies the Black color variant of the Office 2007 appearance. - /// - Office2007Black, - - /// - /// Specifies the dark Black color variant of the Office 2007 appearance. - /// - Office2007BlackDarkMode, - - // Note: Re-enable when the gray themes are completed - /// - /// Specifies the dark Gray color variant of the Office 2010 appearance. - /// - Office2010DarkGray, - /* - /// - /// Specifies the light Gray color variant of the Office 2010 appearance. - /// - Office2010LightGray,*/ - - /// - /// Specifies the Blue color variant of the Office 2010 appearance. - /// - Office2010Blue, - - /// - /// Specifies the dark Blue color variant of the Office 2010 appearance. - /// - Office2010BlueDarkMode, - - /// - /// Specifies the light Blue color variant of the Office 2010 appearance. - /// - Office2010BlueLightMode, - - /// - /// Specifies a custom color variant of the Office 2010 appearance. - /// - Office2010Custom, - - /// - /// Specifies the Silver color variant of the Office 2010 appearance. - /// - Office2010Silver, - - /// - /// Specifies the dark Silver color variant of the Office 2010 appearance. - /// - Office2010SilverDarkMode, - - /// - /// Specifies the light Silver color variant of the Office 2010 appearance. - /// - Office2010SilverLightMode, - - /// - /// Specifies the White color variant of the Office 2010 appearance. - /// - Office2010White, - - /// - /// Specifies the Black color variant of the Office 2010 appearance. - /// - Office2010Black, - - /// - /// Specifies the dark Black color variant of the Office 2010 appearance. - /// - Office2010BlackDarkMode, - - /// - /// Specifies a custom color variant of the Office 2013 appearance. - /// - Office2013Custom, - - // Note: Re-enable when the gray themes are completed - /// - /// Specifies the dark Gray color variant of the Office 2013 appearance. - /// - Office2013DarkGray, - /* - /// - /// Specifies the light Gray color variant of the Office 2013 appearance. - /// - Office2013LightGray,*/ - - /// - /// Specifies the White color variant of the Office 2013 appearance. - /// - Office2013White, - - // Note: Re-enable when the gray themes are completed - /// - /// Specifies the dark Gray color variant of the Microsoft 365 appearance. - /// - Microsoft365DarkGray, - /* - /// - /// Specifies the light Gray color variant of the Microsoft 365 appearance. - /// - Microsoft365LightGray,*/ - - /// - /// Specifies the Black color variant of the Microsoft 365 appearance. - /// - Microsoft365Black, - - /// - /// Specifies the dark Black color variant of the Microsoft 365 appearance. - /// - Microsoft365BlackDarkMode, - - /// - /// Specifies the Blue color variant of the Microsoft 365 appearance. - /// - Microsoft365Blue, - - /// - /// Specifies the dark Blue color variant of the Microsoft 365 appearance. - /// - Microsoft365BlueDarkMode, - - /// - /// Specifies the light Blue color variant of the Microsoft 365 appearance. - /// - Microsoft365BlueLightMode, - - /// - /// Specifies a custom color variant of the Microsoft 365 appearance. - /// - Microsoft365Custom, - - /// - /// Specifies the Silver color variant of the Microsoft 365 appearance. - /// - Microsoft365Silver, - - /// - /// Specifies the dark Silver color variant of the Microsoft 365 appearance. - /// - Microsoft365SilverDarkMode, - - /// - /// Specifies the light Silver color variant of the Microsoft 365 appearance. - /// - Microsoft365SilverLightMode, - - /// - /// Specifies the White color variant of the Microsoft 365 appearance. - /// - Microsoft365White, - - /// - /// Specifies the Blue color variant on the Sparkle palette theme. - /// - SparkleBlue, - - /// - /// Specifies the dark Blue color variant on the Sparkle palette theme. - /// - SparkleBlueDarkMode, - - /// - /// Specifies the light Blue color variant on the Sparkle palette theme. - /// - SparkleBlueLightMode, - - /// - /// Specifies the Orange color variant on the Sparkle palette theme. - /// - SparkleOrange, - - /// - /// Specifies the dark Orange color variant on the Sparkle palette theme. - /// - SparkleOrangeDarkMode, - - /// - /// Specifies the light Orange color variant on the Sparkle palette theme. - /// - SparkleOrangeLightMode, - - /// - /// Specifies the Purple color variant on the Sparkle palette theme. - /// - SparklePurple, - - /// - /// Specifies the dark Purple color variant on the Sparkle palette theme. - /// - SparklePurpleDarkMode, - - /// - /// Specifies the light Purple color variant on the Sparkle palette theme. - /// - SparklePurpleLightMode, - - ///// - ///// Specifies the visual studio dark palette theme. - ///// - //VisualStudioDark, - - ///// - ///// Specifies the visual studio light palette theme. - ///// - //VisualStudioLight, - - /// - /// Specifies a custom palette be used. - /// - Custom - } - #endregion - - #region Enum BasePaletteType - - [Flags()] - public enum BasePaletteType - { - Custom, - Professional, - Office2007, - Office2010, - Office2013, - Microsoft365, - Sparkle - } - - #endregion + #endregion #region Enum PaletteState /// /// Specifies the state of the element. /// - [Flags()] public enum PaletteState { /// diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteMode.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteMode.cs new file mode 100644 index 000000000..570c9ea07 --- /dev/null +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteMode.cs @@ -0,0 +1,279 @@ +#region BSD License +/* + * + * Original BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE) + * © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved. + * + * New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE) + * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved. + * + */ +#endregion + +namespace Krypton.Toolkit; + +/// +/// Specifies the palette requested at the global level. +/// +[TypeConverter(typeof(PaletteModeConverter))] +public enum PaletteMode +{ + /// + /// Specifies the renderer defined by the KryptonManager be used. + /// + Global, + + /// + /// Specifies a professional appearance based on system settings. + /// + ProfessionalSystem, + + /// + /// Specifies a professional appearance with a preference to use theme colors. + /// + ProfessionalOffice2003, + + // Note: Re-enable when the gray themes are completed + /// + /// Specifies the dark Gray color variant of the Office 2007 appearance. + /// + Office2007DarkGray, + /* + /// + /// Specifies the light Gray color variant of the Office 2007 appearance. + /// + Office2007LightGray,*/ + + /// + /// Specifies the Blue color variant of the Office 2007 appearance. + /// + Office2007Blue, + + /// + /// Specifies the dark Blue color variant of the Office 2007 appearance. + /// + Office2007BlueDarkMode, + + /// + /// Specifies the light Blue color variant of the Office 2007 appearance. + /// + Office2007BlueLightMode, + + /// + /// Specifies the Silver color variant of the Office 2007 appearance. + /// + Office2007Silver, + + /// + /// Specifies the dark Silver color variant of the Office 2007 appearance. + /// + Office2007SilverDarkMode, + + /// + /// Specifies the light Silver color variant of the Office 2007 appearance. + /// + Office2007SilverLightMode, + + /// + /// Specifies the White color variant of the Office 2007 appearance. + /// + Office2007White, + + /// + /// Specifies the Black color variant of the Office 2007 appearance. + /// + Office2007Black, + + /// + /// Specifies the dark Black color variant of the Office 2007 appearance. + /// + Office2007BlackDarkMode, + + // Note: Re-enable when the gray themes are completed + /// + /// Specifies the dark Gray color variant of the Office 2010 appearance. + /// + Office2010DarkGray, + /* + /// + /// Specifies the light Gray color variant of the Office 2010 appearance. + /// + Office2010LightGray,*/ + + /// + /// Specifies the Blue color variant of the Office 2010 appearance. + /// + Office2010Blue, + + /// + /// Specifies the dark Blue color variant of the Office 2010 appearance. + /// + Office2010BlueDarkMode, + + /// + /// Specifies the light Blue color variant of the Office 2010 appearance. + /// + Office2010BlueLightMode, + + /// + /// Specifies the Silver color variant of the Office 2010 appearance. + /// + Office2010Silver, + + /// + /// Specifies the dark Silver color variant of the Office 2010 appearance. + /// + Office2010SilverDarkMode, + + /// + /// Specifies the light Silver color variant of the Office 2010 appearance. + /// + Office2010SilverLightMode, + + /// + /// Specifies the White color variant of the Office 2010 appearance. + /// + Office2010White, + + /// + /// Specifies the Black color variant of the Office 2010 appearance. + /// + Office2010Black, + + /// + /// Specifies the dark Black color variant of the Office 2010 appearance. + /// + Office2010BlackDarkMode, + + // Note: Re-enable when the gray themes are completed + /// + /// Specifies the dark Gray color variant of the Office 2013 appearance. + /// + Office2013DarkGray, + /* + /// + /// Specifies the light Gray color variant of the Office 2013 appearance. + /// + Office2013LightGray,*/ + + /// + /// Specifies the White color variant of the Office 2013 appearance. + /// + Office2013White, + + // Note: Re-enable when the gray themes are completed + /// + /// Specifies the dark Gray color variant of the Microsoft 365 appearance. + /// + Microsoft365DarkGray, + /* + /// + /// Specifies the light Gray color variant of the Microsoft 365 appearance. + /// + Microsoft365LightGray,*/ + + /// + /// Specifies the Black color variant of the Microsoft 365 appearance. + /// + Microsoft365Black, + + /// + /// Specifies the dark Black color variant of the Microsoft 365 appearance. + /// + Microsoft365BlackDarkMode, + + /// + /// Specifies the Blue color variant of the Microsoft 365 appearance. + /// + Microsoft365Blue, + + /// + /// Specifies the dark Blue color variant of the Microsoft 365 appearance. + /// + Microsoft365BlueDarkMode, + + /// + /// Specifies the light Blue color variant of the Microsoft 365 appearance. + /// + Microsoft365BlueLightMode, + + /// + /// Specifies the Silver color variant of the Microsoft 365 appearance. + /// + Microsoft365Silver, + + /// + /// Specifies the dark Silver color variant of the Microsoft 365 appearance. + /// + Microsoft365SilverDarkMode, + + /// + /// Specifies the light Silver color variant of the Microsoft 365 appearance. + /// + Microsoft365SilverLightMode, + + /// + /// Specifies the White color variant of the Microsoft 365 appearance. + /// + Microsoft365White, + + /// + /// Specifies the Blue color variant on the Sparkle palette theme. + /// + SparkleBlue, + + /// + /// Specifies the dark Blue color variant on the Sparkle palette theme. + /// + SparkleBlueDarkMode, + + /// + /// Specifies the light Blue color variant on the Sparkle palette theme. + /// + SparkleBlueLightMode, + + /// + /// Specifies the Orange color variant on the Sparkle palette theme. + /// + SparkleOrange, + + /// + /// Specifies the dark Orange color variant on the Sparkle palette theme. + /// + SparkleOrangeDarkMode, + + /// + /// Specifies the light Orange color variant on the Sparkle palette theme. + /// + SparkleOrangeLightMode, + + /// + /// Specifies the Purple color variant on the Sparkle palette theme. + /// + SparklePurple, + + /// + /// Specifies the dark Purple color variant on the Sparkle palette theme. + /// + SparklePurpleDarkMode, + + /// + /// Specifies the light Purple color variant on the Sparkle palette theme. + /// + SparklePurpleLightMode, + + ///// + ///// Specifies the visual studio dark palette theme. + ///// + //VisualStudioDark, + + ///// + ///// Specifies the visual studio light palette theme. + ///// + //VisualStudioLight, + + /// + /// Specifies a custom palette be used. + /// + Custom +} \ No newline at end of file diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteTools/PaletteTools.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteTools/PaletteTools.cs index c711d10e1..6d20ddefd 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteTools/PaletteTools.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteTools/PaletteTools.cs @@ -25,89 +25,89 @@ public class PaletteTools /// Links the type of the palette to the correct theme style. /// Name of the theme. /// - public PaletteModeManager LinkPaletteType1(string themeName) + public PaletteMode LinkPaletteType1(string themeName) { - PaletteModeManager paletteMode = new(); + PaletteMode paletteMode = new(); if (themeName.Equals("Custom")) { - paletteMode = PaletteModeManager.Custom; + paletteMode = PaletteMode.Custom; } else if (themeName.Equals("Professional - System")) { - paletteMode = PaletteModeManager.ProfessionalSystem; + paletteMode = PaletteMode.ProfessionalSystem; } else if (themeName.Equals("Professional - Office 2003")) { - paletteMode = PaletteModeManager.ProfessionalOffice2003; + paletteMode = PaletteMode.ProfessionalOffice2003; } else if (themeName.Equals("Office 2007 - Black")) { - paletteMode = PaletteModeManager.Office2007Black; + paletteMode = PaletteMode.Office2007Black; } else if (themeName.Equals("Office 2007 - Blue")) { - paletteMode = PaletteModeManager.Office2007Blue; + paletteMode = PaletteMode.Office2007Blue; } else if (themeName.Equals("Office 2007 - Silver")) { - paletteMode = PaletteModeManager.Office2007Silver; + paletteMode = PaletteMode.Office2007Silver; } else if (themeName.Equals("Office 2007 - White")) { - paletteMode = PaletteModeManager.Office2007White; + paletteMode = PaletteMode.Office2007White; } else if (themeName.Equals("Office 2010 - Black")) { - paletteMode = PaletteModeManager.Office2010Black; + paletteMode = PaletteMode.Office2010Black; } else if (themeName.Equals("Office 2010 - Blue")) { - paletteMode = PaletteModeManager.Office2010Blue; + paletteMode = PaletteMode.Office2010Blue; } else if (themeName.Equals("Office 2010 - Silver")) { - paletteMode = PaletteModeManager.Office2010Silver; + paletteMode = PaletteMode.Office2010Silver; } else if (themeName.Equals("Office 2010 - White")) { - paletteMode = PaletteModeManager.Office2010White; + paletteMode = PaletteMode.Office2010White; } /*else if (themeName.Equals("Office 2013")) { - paletteMode = PaletteModeManager.Office2013; + paletteMode = PaletteMode.Office2013; }*/ else if (themeName.Equals("Office 2013 - White")) { - paletteMode = PaletteModeManager.Office2013White; + paletteMode = PaletteMode.Office2013White; } else if (themeName.Equals("Microsoft 365 - Black")) { - paletteMode = PaletteModeManager.Microsoft365Black; + paletteMode = PaletteMode.Microsoft365Black; } else if (themeName.Equals("Microsoft 365 - Blue")) { - paletteMode = PaletteModeManager.Microsoft365Blue; + paletteMode = PaletteMode.Microsoft365Blue; } else if (themeName.Equals("Microsoft 365 - Silver")) { - paletteMode = PaletteModeManager.Microsoft365Silver; + paletteMode = PaletteMode.Microsoft365Silver; } else if (themeName.Equals("Microsoft 365 - White")) { - paletteMode = PaletteModeManager.Microsoft365White; + paletteMode = PaletteMode.Microsoft365White; } else if (themeName.Equals("Sparkle - Blue")) { - paletteMode = PaletteModeManager.SparkleBlue; + paletteMode = PaletteMode.SparkleBlue; } else if (themeName.Equals("Sparkle - Orange")) { - paletteMode = PaletteModeManager.SparkleOrange; + paletteMode = PaletteMode.SparkleOrange; } else if (themeName.Equals("Sparkle - Purple")) { - paletteMode = PaletteModeManager.SparklePurple; + paletteMode = PaletteMode.SparklePurple; } return paletteMode; @@ -117,7 +117,7 @@ public PaletteModeManager LinkPaletteType1(string themeName) /// The manager. /// The palette mode. /// The custom theme path. - public static void ApplyTheme(KryptonManager manager, PaletteModeManager paletteMode = PaletteModeManager.Microsoft365Blue, string customThemePath = "") + public static void ApplyTheme(KryptonManager manager, PaletteMode paletteMode = PaletteMode.Microsoft365Blue, string customThemePath = "") { manager.GlobalPaletteMode = paletteMode; @@ -129,7 +129,7 @@ public static void ApplyTheme(KryptonManager manager, PaletteModeManager palette manager.GlobalPalette = palette; - manager.GlobalPaletteMode = PaletteModeManager.Custom; + manager.GlobalPaletteMode = PaletteMode.Custom; } } #endregion diff --git a/Source/Krypton Components/Krypton.Toolkit/Rendering/ThemeManager.cs b/Source/Krypton Components/Krypton.Toolkit/Rendering/ThemeManager.cs index 8728d717d..f6f7c0f52 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Rendering/ThemeManager.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Rendering/ThemeManager.cs @@ -24,53 +24,53 @@ public class ThemeManager /// The supported themes /// /// TODO: this should use the list from Z:\GitHub\Krypton-Suite\Standard-Toolkit\Source\Krypton Components\Krypton.Toolkit\Converters\PaletteModeConverter.cs - private static readonly BiDictionary _supportedThemes = new(new Dictionary + private static readonly BiDictionary _supportedThemes = new(new Dictionary { - { @"Professional - System", PaletteModeManager.ProfessionalSystem }, - { @"Professional - Office 2003", PaletteModeManager.ProfessionalOffice2003 }, - { @"Office 2007 - Blue", PaletteModeManager.Office2007Blue }, - { @"Office 2007 - Blue (Dark Mode)", PaletteModeManager.Office2007BlueDarkMode }, - { @"Office 2007 - Blue (Light Mode)", PaletteModeManager.Office2007BlueLightMode }, - { @"Office 2007 - Silver", PaletteModeManager.Office2007Silver }, - { @"Office 2007 - Silver (Dark Mode)", PaletteModeManager.Office2007SilverDarkMode }, - { @"Office 2007 - Silver (Light Mode)", PaletteModeManager.Office2007SilverLightMode }, - { @"Office 2007 - White", PaletteModeManager.Office2007White }, - { @"Office 2007 - Black", PaletteModeManager.Office2007Black }, - { @"Office 2007 - Black (Dark Mode)", PaletteModeManager.Office2007BlackDarkMode }, - { @"Office 2007 - Dark Gray", PaletteModeManager.Office2007DarkGray }, - { @"Office 2010 - Blue", PaletteModeManager.Office2010Blue }, - { @"Office 2010 - Blue (Dark Mode)", PaletteModeManager.Office2010BlueDarkMode }, - { @"Office 2010 - Blue (Light Mode)", PaletteModeManager.Office2010BlueLightMode }, - { @"Office 2010 - Silver", PaletteModeManager.Office2010Silver }, - { @"Office 2010 - Silver (Dark Mode)", PaletteModeManager.Office2010SilverDarkMode }, - { @"Office 2010 - Silver (Light Mode)", PaletteModeManager.Office2010SilverLightMode }, - { @"Office 2010 - White", PaletteModeManager.Office2010White }, - { @"Office 2010 - Black", PaletteModeManager.Office2010Black }, - { @"Office 2010 - Black (Dark Mode)", PaletteModeManager.Office2010BlackDarkMode }, - { @"Office 2010 - Dark Gray", PaletteModeManager.Office2010DarkGray }, - { @"Office 2013 - Dark Gray", PaletteModeManager.Office2013DarkGray }, - //{ @"Office 2013", PaletteModeManager.Office2013 }, - { @"Office 2013 - White", PaletteModeManager.Office2013White }, - { @"Sparkle - Blue", PaletteModeManager.SparkleBlue }, - { @"Sparkle - Blue (Dark Mode)", PaletteModeManager.SparkleBlueDarkMode }, - { @"Sparkle - Blue (Light Mode)", PaletteModeManager.SparkleBlueLightMode }, - { @"Sparkle - Orange", PaletteModeManager.SparkleOrange }, - { @"Sparkle - Orange (Dark Mode)", PaletteModeManager.SparkleOrangeDarkMode }, - { @"Sparkle - Orange (Light Mode)", PaletteModeManager.SparkleOrangeLightMode }, - { @"Sparkle - Purple", PaletteModeManager.SparklePurple }, - { @"Sparkle - Purple (Dark Mode)", PaletteModeManager.SparklePurpleDarkMode }, - { @"Sparkle - Purple (Light Mode)", PaletteModeManager.SparklePurpleLightMode }, - { @"Office 365 - Blue", PaletteModeManager.Microsoft365Blue }, - { @"Office 365 - Blue (Dark Mode)", PaletteModeManager.Microsoft365BlueDarkMode }, - { @"Office 365 - Blue (Light Mode)", PaletteModeManager.Microsoft365BlueLightMode }, - { @"Office 365 - Silver", PaletteModeManager.Microsoft365Silver }, - { @"Office 365 - Silver (Dark Mode)", PaletteModeManager.Microsoft365SilverDarkMode }, - { @"Office 365 - Silver (Light Mode)", PaletteModeManager.Microsoft365SilverLightMode }, - { @"Office 365 - White", PaletteModeManager.Microsoft365White }, - { @"Office 365 - Black", PaletteModeManager.Microsoft365Black }, - { @"Office 365 - Black (Dark Mode)", PaletteModeManager.Microsoft365BlackDarkMode }, - { @"Office 365 - Dark Gray", PaletteModeManager.Microsoft365DarkGray }, - { @"Custom", PaletteModeManager.Custom } + { @"Professional - System", PaletteMode.ProfessionalSystem }, + { @"Professional - Office 2003", PaletteMode.ProfessionalOffice2003 }, + { @"Office 2007 - Blue", PaletteMode.Office2007Blue }, + { @"Office 2007 - Blue (Dark Mode)", PaletteMode.Office2007BlueDarkMode }, + { @"Office 2007 - Blue (Light Mode)", PaletteMode.Office2007BlueLightMode }, + { @"Office 2007 - Silver", PaletteMode.Office2007Silver }, + { @"Office 2007 - Silver (Dark Mode)", PaletteMode.Office2007SilverDarkMode }, + { @"Office 2007 - Silver (Light Mode)", PaletteMode.Office2007SilverLightMode }, + { @"Office 2007 - White", PaletteMode.Office2007White }, + { @"Office 2007 - Black", PaletteMode.Office2007Black }, + { @"Office 2007 - Black (Dark Mode)", PaletteMode.Office2007BlackDarkMode }, + { @"Office 2007 - Dark Gray", PaletteMode.Office2007DarkGray }, + { @"Office 2010 - Blue", PaletteMode.Office2010Blue }, + { @"Office 2010 - Blue (Dark Mode)", PaletteMode.Office2010BlueDarkMode }, + { @"Office 2010 - Blue (Light Mode)", PaletteMode.Office2010BlueLightMode }, + { @"Office 2010 - Silver", PaletteMode.Office2010Silver }, + { @"Office 2010 - Silver (Dark Mode)", PaletteMode.Office2010SilverDarkMode }, + { @"Office 2010 - Silver (Light Mode)", PaletteMode.Office2010SilverLightMode }, + { @"Office 2010 - White", PaletteMode.Office2010White }, + { @"Office 2010 - Black", PaletteMode.Office2010Black }, + { @"Office 2010 - Black (Dark Mode)", PaletteMode.Office2010BlackDarkMode }, + { @"Office 2010 - Dark Gray", PaletteMode.Office2010DarkGray }, + { @"Office 2013 - Dark Gray", PaletteMode.Office2013DarkGray }, + //{ @"Office 2013", PaletteMode.Office2013 }, + { @"Office 2013 - White", PaletteMode.Office2013White }, + { @"Sparkle - Blue", PaletteMode.SparkleBlue }, + { @"Sparkle - Blue (Dark Mode)", PaletteMode.SparkleBlueDarkMode }, + { @"Sparkle - Blue (Light Mode)", PaletteMode.SparkleBlueLightMode }, + { @"Sparkle - Orange", PaletteMode.SparkleOrange }, + { @"Sparkle - Orange (Dark Mode)", PaletteMode.SparkleOrangeDarkMode }, + { @"Sparkle - Orange (Light Mode)", PaletteMode.SparkleOrangeLightMode }, + { @"Sparkle - Purple", PaletteMode.SparklePurple }, + { @"Sparkle - Purple (Dark Mode)", PaletteMode.SparklePurpleDarkMode }, + { @"Sparkle - Purple (Light Mode)", PaletteMode.SparklePurpleLightMode }, + { @"Office 365 - Blue", PaletteMode.Microsoft365Blue }, + { @"Office 365 - Blue (Dark Mode)", PaletteMode.Microsoft365BlueDarkMode }, + { @"Office 365 - Blue (Light Mode)", PaletteMode.Microsoft365BlueLightMode }, + { @"Office 365 - Silver", PaletteMode.Microsoft365Silver }, + { @"Office 365 - Silver (Dark Mode)", PaletteMode.Microsoft365SilverDarkMode }, + { @"Office 365 - Silver (Light Mode)", PaletteMode.Microsoft365SilverLightMode }, + { @"Office 365 - White", PaletteMode.Microsoft365White }, + { @"Office 365 - Black", PaletteMode.Microsoft365Black }, + { @"Office 365 - Black (Dark Mode)", PaletteMode.Microsoft365BlackDarkMode }, + { @"Office 365 - Dark Gray", PaletteMode.Microsoft365DarkGray }, + { @"Custom", PaletteMode.Custom } }); #endregion @@ -96,14 +96,7 @@ public class ThemeManager /// /// The mode. /// The manager. - private static void ApplyTheme(PaletteModeManager mode, KryptonManager manager) => manager.GlobalPaletteMode = mode; - - /// - /// Gets the palette mode manager. - /// - /// The manager. - /// The current mode. - public static PaletteModeManager GetPaletteModeManager(KryptonManager manager) => manager.GlobalPaletteMode; + private static void ApplyTheme(PaletteMode mode, KryptonManager manager) => manager.GlobalPaletteMode = mode; /// Gets the palette mode. /// The manager. @@ -117,103 +110,11 @@ private static PaletteMode ReturnPaletteMode(string themeName) } /// Returns the palette mode. - /// The palette mode manager. + /// The palette mode manager. /// The selected . - private static PaletteMode ReturnPaletteMode(PaletteModeManager paletteModeManager) + private static PaletteMode ReturnPaletteMode(PaletteMode paletteMode) { - switch (paletteModeManager) - { - case PaletteModeManager.Custom: - return PaletteMode.Custom; - case PaletteModeManager.Office2007Black: - return PaletteMode.Office2007Black; - case PaletteModeManager.Office2007White: - return PaletteMode.Office2007White; - case PaletteModeManager.Office2007BlackDarkMode: - return PaletteMode.Office2007BlackDarkMode; - case PaletteModeManager.Office2007Blue: - return PaletteMode.Office2007Blue; - case PaletteModeManager.Office2007BlueDarkMode: - return PaletteMode.Office2007BlueDarkMode; - case PaletteModeManager.Office2007BlueLightMode: - return PaletteMode.Office2007BlueLightMode; - case PaletteModeManager.Office2007DarkGray: - return PaletteMode.Office2007DarkGray; - case PaletteModeManager.Office2007Silver: - return PaletteMode.Office2007Silver; - case PaletteModeManager.Office2007SilverDarkMode: - return PaletteMode.Office2007SilverDarkMode; - case PaletteModeManager.Office2007SilverLightMode: - return PaletteMode.Office2007SilverLightMode; - case PaletteModeManager.Office2010Black: - return PaletteMode.Office2010Black; - case PaletteModeManager.Office2010BlackDarkMode: - return PaletteMode.Office2010BlackDarkMode; - case PaletteModeManager.Office2010Blue: - return PaletteMode.Office2010Blue; - case PaletteModeManager.Office2010BlueDarkMode: - return PaletteMode.Office2010BlueDarkMode; - case PaletteModeManager.Office2010BlueLightMode: - return PaletteMode.Office2010BlueLightMode; - case PaletteModeManager.Office2010DarkGray: - return PaletteMode.Office2010DarkGray; - case PaletteModeManager.Office2010Silver: - return PaletteMode.Office2010Silver; - case PaletteModeManager.Office2010SilverDarkMode: - return PaletteMode.Office2010SilverDarkMode; - case PaletteModeManager.Office2010SilverLightMode: - return PaletteMode.Office2010SilverLightMode; - case PaletteModeManager.Office2013DarkGray: - return PaletteMode.Office2013DarkGray; - case PaletteModeManager.Office2010White: - return PaletteMode.Office2010White; - case PaletteModeManager.Office2013White: - return PaletteMode.Office2013White; - case PaletteModeManager.Microsoft365Black: - return PaletteMode.Microsoft365Black; - case PaletteModeManager.Microsoft365BlackDarkMode: - return PaletteMode.Microsoft365BlackDarkMode; - case PaletteModeManager.Microsoft365Blue: - return PaletteMode.Microsoft365Blue; - case PaletteModeManager.Microsoft365BlueDarkMode: - return PaletteMode.Microsoft365BlueDarkMode; - case PaletteModeManager.Microsoft365BlueLightMode: - return PaletteMode.Microsoft365BlueLightMode; - case PaletteModeManager.Microsoft365DarkGray: - return PaletteMode.Microsoft365DarkGray; - case PaletteModeManager.Microsoft365Silver: - return PaletteMode.Microsoft365Silver; - case PaletteModeManager.Microsoft365SilverDarkMode: - return PaletteMode.Microsoft365SilverDarkMode; - case PaletteModeManager.Microsoft365SilverLightMode: - return PaletteMode.Microsoft365SilverLightMode; - case PaletteModeManager.Microsoft365White: - return PaletteMode.Microsoft365White; - case PaletteModeManager.ProfessionalOffice2003: - return PaletteMode.ProfessionalOffice2003; - case PaletteModeManager.ProfessionalSystem: - return PaletteMode.ProfessionalSystem; - case PaletteModeManager.SparkleBlue: - return PaletteMode.SparkleBlue; - case PaletteModeManager.SparkleBlueDarkMode: - return PaletteMode.SparkleBlueDarkMode; - case PaletteModeManager.SparkleBlueLightMode: - return PaletteMode.SparkleBlueLightMode; - case PaletteModeManager.SparkleOrange: - return PaletteMode.SparkleOrange; - case PaletteModeManager.SparkleOrangeDarkMode: - return PaletteMode.SparkleOrangeDarkMode; - case PaletteModeManager.SparkleOrangeLightMode: - return PaletteMode.SparkleOrangeLightMode; - case PaletteModeManager.SparklePurple: - return PaletteMode.SparklePurple; - case PaletteModeManager.SparklePurpleDarkMode: - return PaletteMode.SparklePurpleDarkMode; - case PaletteModeManager.SparklePurpleLightMode: - return PaletteMode.SparklePurpleLightMode; - default: - return PaletteMode.Microsoft365Blue; - } + return paletteMode; } /// @@ -237,7 +138,7 @@ public static void SetTheme(string themeName, KryptonManager manager) { ApplyTheme(themeName, manager); - ApplyGlobalTheme(manager, GetPaletteModeManager(manager)); + ApplyGlobalTheme(manager, GetPaletteMode(manager)); } catch (Exception exc) { @@ -248,12 +149,12 @@ public static void SetTheme(string themeName, KryptonManager manager) /// /// Returns the palette mode manager as string. /// - /// The palette mode manager. + /// The palette mode manager. /// The manager. /// The chosen theme as a string. - public static string ReturnPaletteModeManagerAsString(PaletteModeManager paletteModeManager, KryptonManager manager = null) + public static string ReturnPaletteModeAsString(PaletteMode PaletteMode, KryptonManager manager = null) { - var paletteMode = manager?.GlobalPaletteMode ?? paletteModeManager; + var paletteMode = manager?.GlobalPaletteMode ?? PaletteMode; return _supportedThemes.GetBySecond(paletteMode); } @@ -294,7 +195,7 @@ public static void LoadCustomTheme(KryptonCustomPaletteBase palette, KryptonMana // Set manager manager.GlobalPalette = palette; - ApplyTheme(PaletteModeManager.Custom, manager); + ApplyTheme(PaletteMode.Custom, manager); } catch (Exception exc) { @@ -318,29 +219,12 @@ public static string ReturnPaletteModeAsString(PaletteMode paletteMode) /// Applies the global theme. /// /// The manager. - /// The palette mode manager. - public static void ApplyGlobalTheme(KryptonManager manager, PaletteModeManager paletteModeManager) - { - try - { - manager.GlobalPaletteMode = paletteModeManager; - } - catch (Exception exc) - { - ExceptionHandler.CaptureException(exc); - } - } - - /// - /// Applies the global theme. - /// - /// The manager. - /// The theme mode. - public static void ApplyGlobalTheme(KryptonManager manager, PaletteMode mode) + /// The palette mode manager. + public static void ApplyGlobalTheme(KryptonManager manager, PaletteMode PaletteMode) { try { - manager.GlobalPaletteMode = (PaletteModeManager)mode; + manager.GlobalPaletteMode = PaletteMode; } catch (Exception exc) { @@ -412,19 +296,12 @@ private static void AddToCollection(IList target, string[] excludes) /// do not include any string containing public static void PropagateThemeSelector(ToolStripComboBox target, params string[] excludePartials) => AddToCollection(target.Items, excludePartials); - /// - /// Applies the theme mode. - /// - /// Name of the theme. - /// The equivalent. - public static PaletteMode ApplyThemeMode(string themeName) => (PaletteMode)Enum.Parse(typeof(PaletteMode), themeName); - /// /// Applies the theme manager mode. /// /// Name of the theme. - /// The equivalent. - public static PaletteModeManager ApplyThemeManagerMode(string themeName) => (PaletteModeManager)Enum.Parse(typeof(PaletteModeManager), themeName); + /// The equivalent. + public static PaletteMode GetThemeManagerMode(string themeName) => _supportedThemes.GetByFirst(themeName); #endregion } } \ No newline at end of file