diff --git a/README.md b/README.md index 4c3f6e9f1..a76b1a7b1 100644 --- a/README.md +++ b/README.md @@ -128,11 +128,17 @@ Follow the links to see the different objects and layouts that this framework al ======= # Breaking Changes + ## V80.## (2023-11-xx - Build 2311 - November 2023) There are list of changes that have occurred during the development of the V70.## version + ### KryptonMessageBoxButtons - https://github.com/Krypton-Suite/Standard-Toolkit/issues/728: -Bring MessageBox States inline with latest .Net 6 by using a new `KryptonMessageBoxButtons` type, which is effectively the same as .Net6 enum version of `MessageBoxButtons` but backward compatible with .net4.6.x onwards +Bring MessageBox States inline with latest .Net 6 by using a new `KryptonMessageBoxButtons` type, which is effectively the same as .Net6 enum version of `MessageBoxButtons` but backward compatible with .net4.6.x onwards. + +### Palette usages +-`KryptonPalette` has become `KryptonCustomPaletteBase` to better signify it's usage. +- `IPalette` has been removed, and the usage of `PaletteBase` throughout the toolkit is used; to ensure consistent usage. ## V70.## (2022-11-08 - Build 2211 - November 2022) There are list of changes that have occurred during the development of the V70.## version diff --git a/Source/Krypton Components/Krypton Toolkit Suite 2022 - VS2022.sln.DotSettings b/Source/Krypton Components/Krypton Toolkit Suite 2022 - VS2022.sln.DotSettings index 9b931e90f..edb38f90f 100644 --- a/Source/Krypton Components/Krypton Toolkit Suite 2022 - VS2022.sln.DotSettings +++ b/Source/Krypton Components/Krypton Toolkit Suite 2022 - VS2022.sln.DotSettings @@ -1,3 +1,5 @@  + True True - True \ No newline at end of file + True + True \ No newline at end of file diff --git a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavClose.cs b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavClose.cs index 3e0352f93..deb8deb40 100644 --- a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavClose.cs +++ b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavClose.cs @@ -25,7 +25,7 @@ public class ButtonSpecNavClose : ButtonSpecNavFixed public ButtonSpecNavClose(KryptonNavigator navigator) : base(navigator, PaletteButtonSpecStyle.Close) { - } + } #endregion #region IButtonSpecValues @@ -33,8 +33,8 @@ public ButtonSpecNavClose(KryptonNavigator navigator) /// Gets the button visible value. /// /// Palette to use for inheriting values. - /// Button visibiliy. - public override bool GetVisible(IPalette palette) + /// Button visibility. + public override bool GetVisible(PaletteBase palette) { switch (Navigator.Button.CloseButtonDisplay) { @@ -59,7 +59,7 @@ public override bool GetVisible(IPalette palette) /// /// Palette to use for inheriting values. /// Button enabled state. - public override ButtonEnabled GetEnabled(IPalette palette) + public override ButtonEnabled GetEnabled(PaletteBase palette) { switch (Navigator.Button.CloseButtonDisplay) { @@ -85,10 +85,10 @@ public override ButtonEnabled GetEnabled(IPalette palette) /// /// Palette to use for inheriting values. /// Button checked state. - public override ButtonCheckState GetChecked(IPalette palette) => + public override ButtonCheckState GetChecked(PaletteBase palette) => // Close button is never shown as checked ButtonCheckState.NotCheckButton; - #endregion + #endregion } } diff --git a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavContext.cs b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavContext.cs index c039112e7..661bf5c14 100644 --- a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavContext.cs +++ b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavContext.cs @@ -38,7 +38,7 @@ public ButtonSpecNavContext(KryptonNavigator navigator) /// /// Palette to use for inheriting values. /// Button visibiliy. - public override bool GetVisible(IPalette palette) + public override bool GetVisible(PaletteBase palette) { switch (Navigator.Button.ContextButtonDisplay) { @@ -76,7 +76,7 @@ public override bool GetVisible(IPalette palette) /// /// Palette to use for inheriting values. /// Button enabled state. - public override ButtonEnabled GetEnabled(IPalette palette) + public override ButtonEnabled GetEnabled(PaletteBase palette) { switch (Navigator.Button.ContextButtonDisplay) { @@ -103,7 +103,7 @@ public override ButtonEnabled GetEnabled(IPalette palette) /// /// Palette to use for inheriting values. /// Button checked state. - public override ButtonCheckState GetChecked(IPalette palette) => + public override ButtonCheckState GetChecked(PaletteBase palette) => // Context button is never shown as checked ButtonCheckState.NotCheckButton; diff --git a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavFixed.cs b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavFixed.cs index e089d10c5..f463ca361 100644 --- a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavFixed.cs +++ b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavFixed.cs @@ -42,15 +42,15 @@ protected ButtonSpecNavFixed(KryptonNavigator navigator, // Default other properties _location = HeaderLocation.PrimaryHeader; - } - #endregion + } + #endregion #region IsDefault /// /// Gets a value indicating if all values are default. /// [Browsable(false)] - public override bool IsDefault => (base.IsDefault && + public override bool IsDefault => (base.IsDefault && (HeaderLocation == HeaderLocation.PrimaryHeader)); #endregion @@ -83,7 +83,7 @@ public HeaderLocation HeaderLocation if (_location != value) { _location = value; - OnButtonSpecPropertyChanged("Location"); + OnButtonSpecPropertyChanged(@"Location"); } } } @@ -103,7 +103,7 @@ public void ResetHeaderLocation() /// /// Palette to use for inheriting values. /// Button location. - public override HeaderLocation GetLocation(IPalette palette) => + public override HeaderLocation GetLocation(PaletteBase palette) => // Ask the view builder to recover the correct location Navigator.ViewBuilder.GetFixedButtonLocation(this); diff --git a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavNext.cs b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavNext.cs index 3e53c8963..f274c8de4 100644 --- a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavNext.cs +++ b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavNext.cs @@ -34,7 +34,7 @@ public ButtonSpecNavNext(KryptonNavigator navigator) /// /// Palette to use for inheriting values. /// Button visibiliy. - public override bool GetVisible(IPalette palette) + public override bool GetVisible(PaletteBase palette) { switch (Navigator.Button.NextButtonDisplay) { @@ -72,7 +72,7 @@ public override bool GetVisible(IPalette palette) /// /// Palette to use for inheriting values. /// Button enabled state. - public override ButtonEnabled GetEnabled(IPalette palette) + public override ButtonEnabled GetEnabled(PaletteBase palette) { switch (Navigator.Button.NextButtonDisplay) { @@ -98,7 +98,7 @@ public override ButtonEnabled GetEnabled(IPalette palette) /// /// Palette to use for inheriting values. /// Button checked state. - public override ButtonCheckState GetChecked(IPalette palette) => + public override ButtonCheckState GetChecked(PaletteBase palette) => // Next button is never shown as checked ButtonCheckState.NotCheckButton; diff --git a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavPrevious.cs b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavPrevious.cs index ecfcdf0f7..1614866de 100644 --- a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavPrevious.cs +++ b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavPrevious.cs @@ -34,7 +34,7 @@ public ButtonSpecNavPrevious(KryptonNavigator navigator) /// /// Palette to use for inheriting values. /// Button visibiliy. - public override bool GetVisible(IPalette palette) + public override bool GetVisible(PaletteBase palette) { switch (Navigator.Button.PreviousButtonDisplay) { @@ -72,7 +72,7 @@ public override bool GetVisible(IPalette palette) /// /// Palette to use for inheriting values. /// Button enabled state. - public override ButtonEnabled GetEnabled(IPalette palette) + public override ButtonEnabled GetEnabled(PaletteBase palette) { switch (Navigator.Button.PreviousButtonDisplay) { @@ -97,7 +97,7 @@ public override ButtonEnabled GetEnabled(IPalette palette) /// /// Palette to use for inheriting values. /// Button checked state. - public override ButtonCheckState GetChecked(IPalette palette) => + public override ButtonCheckState GetChecked(PaletteBase palette) => // Previous button is never shown as checked ButtonCheckState.NotCheckButton; diff --git a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavRemap.cs b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavRemap.cs index 0ac8b7dd4..ea40a7d3c 100644 --- a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavRemap.cs +++ b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavRemap.cs @@ -127,7 +127,7 @@ public enum ButtonSpecRemapTarget /// Initial palette target for redirection. /// Reference to button specification. /// Target for remapping the color onto. - public ButtonSpecNavRemap(IPalette target, + public ButtonSpecNavRemap(PaletteBase target, ButtonSpec buttonSpec, ButtonSpecRemapTarget remapTarget) : base(target) diff --git a/Source/Krypton Components/Krypton.Navigator/Dragging/DragManager.cs b/Source/Krypton Components/Krypton.Navigator/Dragging/DragManager.cs index 317a54129..5d6981bce 100644 --- a/Source/Krypton Components/Krypton.Navigator/Dragging/DragManager.cs +++ b/Source/Krypton Components/Krypton.Navigator/Dragging/DragManager.cs @@ -15,7 +15,7 @@ namespace Krypton.Navigator /// /// Specialise the generic collection with type specific rules for item accessor. /// - public class DragTargetProviderCollection : TypedCollection {} + public class DragTargetProviderCollection : TypedCollection { } /// /// Manage a dragging operation. @@ -29,8 +29,8 @@ public class DragManager : IDragPageNotify, #endregion #region Instance Fields - private IPalette _dragPalette; - private IPalette _localPalette; + private PaletteBase _dragPalette; + private PaletteBase _localPalette; private IRenderer _dragRenderer; private PaletteMode _paletteMode; private readonly PaletteRedirect _redirector; @@ -137,7 +137,7 @@ public PaletteMode PaletteMode { get => _paletteMode; - set + set { if (_paletteMode != value) { @@ -158,11 +158,11 @@ public PaletteMode PaletteMode /// /// Gets and sets the custom palette implementation. /// - public IPalette Palette + public PaletteBase Palette { get => _localPalette; - set + set { if (_localPalette != value) { @@ -178,7 +178,7 @@ public IPalette Palette public DragTargetProviderCollection DragTargetProviders { get; } /// - /// Gets a value indicating if dragging is currently occuring. + /// Gets a value indicating if dragging is currently occurring. /// public bool IsDragging { get; private set; } @@ -189,7 +189,7 @@ public bool DocumentCursor { get => _documentCursor; - set + set { if (IsDragging) { @@ -207,7 +207,7 @@ public bool DocumentCursor /// /// Mouse screen point at start of drag. /// Data to be dropped at destination. - /// True if dragging waas started; otherwise false. + /// True if dragging was started; otherwise false. public virtual bool DragStart(Point screenPt, PageDragEndData dragEndData) { if (IsDisposed) @@ -222,7 +222,7 @@ public virtual bool DragStart(Point screenPt, PageDragEndData dragEndData) if (dragEndData == null) { - throw new ArgumentNullException(nameof(dragEndData), "Cannot provide a null DragEndData."); + throw new ArgumentNullException(nameof(dragEndData), @"Cannot provide a null DragEndData."); } // Generate drag targets from the set of target provides @@ -273,7 +273,7 @@ public virtual void DragMove(Point screenPt) throw new InvalidOperationException("Cannot DragMove when DragStart has not been called."); } - // Different feedback objects implement visual feeback differently and so only the feedback + // Different feedback objects implement visual feedback differently and so only the feedback // instance knows the correct target to use for the given screen point and drag data. _currentTarget = _dragFeedback.Feedback(screenPt, _currentTarget); @@ -298,7 +298,7 @@ public virtual bool DragEnd(Point screenPt) throw new InvalidOperationException("Cannot DragEnd when DragStart has not been called."); } - // Different feedback objects implement visual feeback differently and so only the feedback + // Different feedback objects implement visual feedback differently and so only the feedback // instance knows the correct target to use for the given screen point and drag data. _currentTarget = _dragFeedback.Feedback(screenPt, _currentTarget); @@ -456,7 +456,7 @@ private void ResolveDragFeedback() if (dragFeedback == PaletteDragFeedback.Rounded) { // Rounded feedback uses a per-pixel alpha blending and so we need to be on a machine that supports - // more than 256 colors and also allows the layered windows feature. If not then revert to sqaures + // more than 256 colors and also allows the layered windows feature. If not then revert to squares if ((OSFeature.Feature.GetVersionPresent(OSFeature.LayeredWindows) == null) || (CommonHelper.ColorDepth() <= 8)) { dragFeedback = PaletteDragFeedback.Square; diff --git a/Source/Krypton Components/Krypton.Navigator/Page/KryptonPage.cs b/Source/Krypton Components/Krypton.Navigator/Page/KryptonPage.cs index 79d4f8d23..a07b1dc2b 100644 --- a/Source/Krypton Components/Krypton.Navigator/Page/KryptonPage.cs +++ b/Source/Krypton Components/Krypton.Navigator/Page/KryptonPage.cs @@ -167,7 +167,7 @@ public KryptonPage(string text, string uniqueName) public KryptonPage(string text, Bitmap imageSmall, string uniqueName) : this(text, imageSmall, uniqueName, new Size(150, 50)) { - + } /// @@ -286,7 +286,7 @@ public KryptonPage(string text, Bitmap imageSmall, string uniqueName, Size minSi [Browsable(false)] [EditorBrowsable(EditorBrowsableState.Never)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public new IPalette Palette + public new PaletteBase Palette { [DebuggerStepThrough] get => base.Palette; @@ -733,7 +733,7 @@ private void ResetToolTipShadow() ToolTipShadow = true; } #endregion - + /// /// Gets and sets the unique name of the page. /// diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteRedirectRibbonTabContent.cs b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteRedirectRibbonTabContent.cs index 415f64dba..42ce55ffa 100644 --- a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteRedirectRibbonTabContent.cs +++ b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteRedirectRibbonTabContent.cs @@ -43,8 +43,8 @@ public class PaletteRedirectRibbonTabContent : PaletteRedirect /// Initialize a new instance of the PaletteRedirectRibbonDouble class. /// /// Initial palette target for redirection. - public PaletteRedirectRibbonTabContent(IPalette target) - : this(target, + public PaletteRedirectRibbonTabContent(PaletteBase target) + : this(target, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null) @@ -73,7 +73,7 @@ public PaletteRedirectRibbonTabContent(IPalette target) /// Redirection for content tracking state requests. /// Redirection for content selected states requests. /// Redirection for content focus override state requests. - public PaletteRedirectRibbonTabContent(IPalette target, + public PaletteRedirectRibbonTabContent(PaletteBase target, IPaletteRibbonBack disabledBack, IPaletteRibbonBack normalBack, IPaletteRibbonBack pressedBack, diff --git a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecExpandRibbon.cs b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecExpandRibbon.cs index 5968ede4e..8913ad934 100644 --- a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecExpandRibbon.cs +++ b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecExpandRibbon.cs @@ -35,7 +35,7 @@ public ButtonSpecExpandRibbon(KryptonRibbon ribbon) // Fix the type ProtectedType = PaletteButtonSpecStyle.RibbonExpand; - } + } #endregion #region AllowComponent @@ -64,22 +64,22 @@ public PaletteButtonSpecStyle ButtonSpecType /// Gets the button visible value. /// /// Palette to use for inheriting values. - /// Button visibiliy. - public override bool GetVisible(IPalette palette) => _ribbon.ShowMinimizeButton && _ribbon.MinimizedMode; + /// Button visibility. + public override bool GetVisible(PaletteBase palette) => _ribbon.ShowMinimizeButton && _ribbon.MinimizedMode; /// /// Gets the button enabled state. /// /// Palette to use for inheriting values. /// Button enabled state. - public override ButtonEnabled GetEnabled(IPalette palette) => ButtonEnabled.True; + public override ButtonEnabled GetEnabled(PaletteBase palette) => ButtonEnabled.True; /// /// Gets the button checked state. /// /// Palette to use for inheriting values. /// Button checked state. - public override ButtonCheckState GetChecked(IPalette palette) => + public override ButtonCheckState GetChecked(PaletteBase palette) => // Close button is never shown as checked ButtonCheckState.NotCheckButton; @@ -88,11 +88,12 @@ public override ButtonCheckState GetChecked(IPalette palette) => /// /// Palette to use for inheriting values. /// Button style. - public override ButtonStyle GetStyle(IPalette palette) => ButtonStyle.ButtonSpec; + public override ButtonStyle GetStyle(PaletteBase palette) => ButtonStyle.ButtonSpec; #endregion #region Protected Overrides + /// /// Raises the Click event. /// diff --git a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMdiChildClose.cs b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMdiChildClose.cs index 97d91dbe3..fb8919204 100644 --- a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMdiChildClose.cs +++ b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMdiChildClose.cs @@ -33,7 +33,7 @@ public ButtonSpecMdiChildClose(KryptonRibbon ribbon) { Debug.Assert(ribbon != null); _ribbon = ribbon; - } + } #endregion #region IButtonSpecValues @@ -42,7 +42,7 @@ public ButtonSpecMdiChildClose(KryptonRibbon ribbon) /// /// Palette to use for inheriting values. /// Button visibility. - public override bool GetVisible(IPalette palette) + public override bool GetVisible(PaletteBase palette) { // Cannot be seen if not attached to an mdi child window and cannot be seen // if the window is not maximized and so needing the pendant buttons @@ -60,14 +60,14 @@ public override bool GetVisible(IPalette palette) /// /// Palette to use for inheriting values. /// Button enabled state. - public override ButtonEnabled GetEnabled(IPalette palette) => ButtonEnabled.True; + public override ButtonEnabled GetEnabled(PaletteBase palette) => ButtonEnabled.True; /// /// Gets the button checked state. /// /// Palette to use for inheriting values. /// Button checked state. - public override ButtonCheckState GetChecked(IPalette palette) => + public override ButtonCheckState GetChecked(PaletteBase palette) => // Close button is never shown as checked ButtonCheckState.NotCheckButton; diff --git a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMdiChildFixed.cs b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMdiChildFixed.cs index bfee6cf07..10fa63b9e 100644 --- a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMdiChildFixed.cs +++ b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMdiChildFixed.cs @@ -69,7 +69,7 @@ public PaletteButtonSpecStyle ButtonSpecType /// /// Palette to use for inheriting values. /// Button style. - public override ButtonStyle GetStyle(IPalette palette) => ButtonStyle.ButtonSpec; + public override ButtonStyle GetStyle(PaletteBase palette) => ButtonStyle.ButtonSpec; #endregion } diff --git a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMdiChildMin.cs b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMdiChildMin.cs index 56c96f807..8608129af 100644 --- a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMdiChildMin.cs +++ b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMdiChildMin.cs @@ -33,7 +33,7 @@ public ButtonSpecMdiChildMin(KryptonRibbon ribbon) { Debug.Assert(ribbon != null); _ribbon = ribbon; - } + } #endregion #region IButtonSpecValues @@ -42,7 +42,7 @@ public ButtonSpecMdiChildMin(KryptonRibbon ribbon) /// /// Palette to use for inheriting values. /// Button visibiliy. - public override bool GetVisible(IPalette palette) + public override bool GetVisible(PaletteBase palette) { // Cannot be seen if not attached to an mdi child window and cannot be seen // if the window is not maximized and so needing the pendant buttons @@ -74,7 +74,7 @@ public override bool GetVisible(IPalette palette) /// /// Palette to use for inheriting values. /// Button enabled state. - public override ButtonEnabled GetEnabled(IPalette palette) + public override ButtonEnabled GetEnabled(PaletteBase palette) { // Cannot be enabled if not attached to an mdi child window if (MdiChild == null || MdiChild.IsDisposed || !MdiChild.IsHandleCreated || MdiChild.Disposing) @@ -91,7 +91,7 @@ public override ButtonEnabled GetEnabled(IPalette palette) /// /// Palette to use for inheriting values. /// Button checked state. - public override ButtonCheckState GetChecked(IPalette palette) => + public override ButtonCheckState GetChecked(PaletteBase palette) => // Close button is never shown as checked ButtonCheckState.NotCheckButton; diff --git a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMdiChildRestore.cs b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMdiChildRestore.cs index 4adfe676f..c6b65c4b2 100644 --- a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMdiChildRestore.cs +++ b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMdiChildRestore.cs @@ -33,7 +33,7 @@ public ButtonSpecMdiChildRestore(KryptonRibbon ribbon) { Debug.Assert(ribbon != null); _ribbon = ribbon; - } + } #endregion #region IButtonSpecValues @@ -42,7 +42,7 @@ public ButtonSpecMdiChildRestore(KryptonRibbon ribbon) /// /// Palette to use for inheriting values. /// Button visibiliy. - public override bool GetVisible(IPalette palette) + public override bool GetVisible(PaletteBase palette) { // Cannot be seen if not attached to an mdi child window and cannot be seen // if the window is not maximized and so needing the pendant buttons @@ -74,7 +74,7 @@ public override bool GetVisible(IPalette palette) /// /// Palette to use for inheriting values. /// Button enabled state. - public override ButtonEnabled GetEnabled(IPalette palette) + public override ButtonEnabled GetEnabled(PaletteBase palette) { // Cannot be enabled if not attached to an mdi child window if (MdiChild == null) @@ -91,7 +91,7 @@ public override ButtonEnabled GetEnabled(IPalette palette) /// /// Palette to use for inheriting values. /// Button checked state. - public override ButtonCheckState GetChecked(IPalette palette) => + public override ButtonCheckState GetChecked(PaletteBase palette) => // Close button is never shown as checked ButtonCheckState.NotCheckButton; diff --git a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMinimizeRibbon.cs b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMinimizeRibbon.cs index 451a2c891..3de0b3d4a 100644 --- a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMinimizeRibbon.cs +++ b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMinimizeRibbon.cs @@ -35,7 +35,7 @@ public ButtonSpecMinimizeRibbon(KryptonRibbon ribbon) // Fix the type ProtectedType = PaletteButtonSpecStyle.RibbonMinimize; - } + } #endregion #region AllowComponent @@ -65,21 +65,21 @@ public PaletteButtonSpecStyle ButtonSpecType /// /// Palette to use for inheriting values. /// Button visibiliy. - public override bool GetVisible(IPalette palette) => _ribbon.ShowMinimizeButton && !_ribbon.MinimizedMode; + public override bool GetVisible(PaletteBase palette) => _ribbon.ShowMinimizeButton && !_ribbon.MinimizedMode; /// /// Gets the button enabled state. /// /// Palette to use for inheriting values. /// Button enabled state. - public override ButtonEnabled GetEnabled(IPalette palette) => ButtonEnabled.True; + public override ButtonEnabled GetEnabled(PaletteBase palette) => ButtonEnabled.True; /// /// Gets the button checked state. /// /// Palette to use for inheriting values. /// Button checked state. - public override ButtonCheckState GetChecked(IPalette palette) => + public override ButtonCheckState GetChecked(PaletteBase palette) => // Close button is never shown as checked ButtonCheckState.NotCheckButton; @@ -88,7 +88,7 @@ public override ButtonCheckState GetChecked(IPalette palette) => /// /// Palette to use for inheriting values. /// Button style. - public override ButtonStyle GetStyle(IPalette palette) => ButtonStyle.ButtonSpec; + public override ButtonStyle GetStyle(PaletteBase palette) => ButtonStyle.ButtonSpec; #endregion diff --git a/Source/Krypton Components/Krypton.Ribbon/Controls Visuals/VisualPopupAppMenu.cs b/Source/Krypton Components/Krypton.Ribbon/Controls Visuals/VisualPopupAppMenu.cs index 93778b87d..367ff3014 100644 --- a/Source/Krypton Components/Krypton.Ribbon/Controls Visuals/VisualPopupAppMenu.cs +++ b/Source/Krypton Components/Krypton.Ribbon/Controls Visuals/VisualPopupAppMenu.cs @@ -18,7 +18,7 @@ internal class VisualPopupAppMenu : VisualPopup { #region Instance Fields private readonly KryptonRibbon _ribbon; - private IPalette _palette; + private PaletteBase _palette; private IPaletteBack _drawOutsideBack; private IPaletteBorder _drawOutsideBorder; private readonly AppButtonMenuProvider _provider; @@ -47,7 +47,7 @@ internal class VisualPopupAppMenu : VisualPopup /// Was the context menu activated by a keyboard action. public VisualPopupAppMenu(KryptonRibbon ribbon, RibbonAppButton appButton, - IPalette palette, + PaletteBase palette, PaletteMode paletteMode, PaletteRedirect redirector, Rectangle rectAppButtonTopHalf, @@ -404,7 +404,7 @@ public override bool DoesMouseDownGetEaten(Message m, Point pt) /// [Browsable(false)] [EditorBrowsable(EditorBrowsableState.Never)] - public override IPalette GetResolvedPalette() => _palette; + public override PaletteBase GetResolvedPalette() => _palette; #endregion @@ -496,7 +496,7 @@ private Size CalculatePreferredSize() } } - private void SetPalette(IPalette palette) + private void SetPalette(PaletteBase palette) { if (palette != _palette) { diff --git a/Source/Krypton Components/Krypton.Ribbon/General/AppButtonMenuProvider.cs b/Source/Krypton Components/Krypton.Ribbon/General/AppButtonMenuProvider.cs index dc1bff557..227652de4 100644 --- a/Source/Krypton Components/Krypton.Ribbon/General/AppButtonMenuProvider.cs +++ b/Source/Krypton Components/Krypton.Ribbon/General/AppButtonMenuProvider.cs @@ -58,7 +58,7 @@ public class AppButtonMenuProvider : IContextMenuProvider public AppButtonMenuProvider(ViewContextMenuManager viewManager, KryptonContextMenuItemCollection menuCollection, ViewLayoutStack viewColumns, - IPalette palette, + PaletteBase palette, PaletteMode paletteMode, PaletteRedirect redirector, NeedPaintHandler needPaintDelegate) @@ -184,8 +184,8 @@ public Rectangle ProviderShowSubMenuFixedRect(KryptonContextMenuItem menuItem) /// /// Sets the reason for the context menu being closed. /// - public ToolStripDropDownCloseReason? ProviderCloseReason - { + public ToolStripDropDownCloseReason? ProviderCloseReason + { get => _parent?.ProviderCloseReason ?? _closeReason; set @@ -254,7 +254,7 @@ public ToolStripDropDownCloseReason? ProviderCloseReason /// /// Gets access to the custom palette. /// - public IPalette ProviderPalette { get; } + public PaletteBase ProviderPalette { get; } /// /// Gets access to the palette mode. diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteCaptionRedirect.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteCaptionRedirect.cs index 24a1eafef..11cd2bf7d 100644 --- a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteCaptionRedirect.cs +++ b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteCaptionRedirect.cs @@ -24,7 +24,7 @@ internal class PaletteCaptionRedirect : PaletteRedirect /// Initialize a new instance of the PaletteCaptionRedirect class. /// /// Initial palette target for redirection. - public PaletteCaptionRedirect(IPalette target) + public PaletteCaptionRedirect(PaletteBase target) : base(target) { } diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonThemeManager.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonThemeManager.cs index 57cbad8fd..e1e0e7157 100644 --- a/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonThemeManager.cs +++ b/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonThemeManager.cs @@ -7,8 +7,6 @@ * 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. * - * Modified: Monday 12th April, 2021 @ 18:00 GMT - * */ #endregion @@ -26,17 +24,9 @@ public class RibbonThemeManager /// The target. public static void PropagateThemeSelector(KryptonRibbonGroupComboBox target) { - try - { - foreach (var theme in ThemeManager.SupportedThemeArray) - { - target.Items.Add(theme); - } - } - catch + foreach (var theme in ThemeManager.SupportedInternalThemeNames) { - - throw; + target.Items.Add(theme); } } @@ -46,171 +36,13 @@ public static void PropagateThemeSelector(KryptonRibbonGroupComboBox target) /// The target. public static void PropagateThemeSelector(KryptonRibbonGroupDomainUpDown target) { - try + foreach (var theme in ThemeManager.SupportedInternalThemeNames) { - foreach (var theme in ThemeManager.SupportedThemeArray) - { - target.Items.Add(theme); - } - } - catch - { - - throw; + target.Items.Add(theme); } } #region Built-in Redundancy - /// - /// Applies the theme. - /// - /// The palette mode. - /// The manager. - private static void ApplyTheme(PaletteModeManager paletteMode, KryptonManager manager) - { - switch (paletteMode) - { - case PaletteModeManager.ProfessionalSystem: - manager.GlobalPaletteMode = PaletteModeManager.ProfessionalSystem; - break; - case PaletteModeManager.ProfessionalOffice2003: - manager.GlobalPaletteMode = PaletteModeManager.ProfessionalOffice2003; - break; - case PaletteModeManager.Office2007Blue: - manager.GlobalPaletteMode = PaletteModeManager.Office2007Blue; - break; - case PaletteModeManager.Office2007Silver: - manager.GlobalPaletteMode = PaletteModeManager.Office2007Silver; - break; - case PaletteModeManager.Office2007White: - manager.GlobalPaletteMode = PaletteModeManager.Office2007White; - break; - case PaletteModeManager.Office2007Black: - manager.GlobalPaletteMode = PaletteModeManager.Office2007Black; - break; - case PaletteModeManager.Office2010Blue: - manager.GlobalPaletteMode = PaletteModeManager.Office2010Blue; - break; - case PaletteModeManager.Office2010Silver: - manager.GlobalPaletteMode = PaletteModeManager.Office2010Silver; - break; - case PaletteModeManager.Office2010White: - manager.GlobalPaletteMode = PaletteModeManager.Office2010White; - break; - case PaletteModeManager.Office2010Black: - manager.GlobalPaletteMode = PaletteModeManager.Office2010Black; - break; - /*case PaletteModeManager.Office2013: - manager.GlobalPaletteMode = PaletteModeManager.Office2013; - break;*/ - case PaletteModeManager.Office2013White: - manager.GlobalPaletteMode = PaletteModeManager.Office2013White; - break; - case PaletteModeManager.Microsoft365Black: - manager.GlobalPaletteMode = PaletteModeManager.Microsoft365Black; - break; - case PaletteModeManager.Microsoft365Blue: - manager.GlobalPaletteMode = PaletteModeManager.Microsoft365Blue; - break; - case PaletteModeManager.Microsoft365Silver: - manager.GlobalPaletteMode = PaletteModeManager.Microsoft365Silver; - break; - case PaletteModeManager.Microsoft365White: - manager.GlobalPaletteMode = PaletteModeManager.Microsoft365White; - break; - case PaletteModeManager.SparkleBlue: - manager.GlobalPaletteMode = PaletteModeManager.SparkleBlue; - break; - case PaletteModeManager.SparkleOrange: - manager.GlobalPaletteMode = PaletteModeManager.SparkleOrange; - break; - case PaletteModeManager.SparklePurple: - manager.GlobalPaletteMode = PaletteModeManager.SparklePurple; - break; - case PaletteModeManager.Custom: - manager.GlobalPaletteMode = PaletteModeManager.Custom; - break; - default: - break; - } - } - - /// - /// Applies the theme. - /// - /// Name of the theme. - /// The manager. - /// - private static void ApplyTheme(string themeName, KryptonManager manager) - { - switch (themeName) - { - case "Custom": - ApplyTheme(PaletteModeManager.Custom, manager); - break; - case "Professional - System": - ApplyTheme(PaletteModeManager.ProfessionalSystem, manager); - break; - case "Professional - Office 2003": - ApplyTheme(PaletteModeManager.ProfessionalOffice2003, manager); - break; - case "Office 2007 - Blue": - ApplyTheme(PaletteModeManager.Office2007Blue, manager); - break; - case "Office 2007 - Silver": - ApplyTheme(PaletteModeManager.Office2007Silver, manager); - break; - case "Office 2007 - White": - ApplyTheme(PaletteModeManager.Office2007White, manager); - break; - case "Office 2007 - Black": - ApplyTheme(PaletteModeManager.Office2007Black, manager); - break; - case "Office 2010 - Blue": - ApplyTheme(PaletteModeManager.Office2010Blue, manager); - break; - case "Office 2010 - Silver": - ApplyTheme(PaletteModeManager.Office2010Silver, manager); - break; - case "Office 2010 - White": - ApplyTheme(PaletteModeManager.Office2010White, manager); - break; - case "Office 2010 - Black": - ApplyTheme(PaletteModeManager.Office2010Black, manager); - break; - /*if (themeName == "Office 2013") - { - ApplyTheme(PaletteModeManager.Office2013, manager); - }*/ - case "Office 2013 - White": - ApplyTheme(PaletteModeManager.Office2013White, manager); - break; - case "Sparkle - Blue": - ApplyTheme(PaletteModeManager.SparkleBlue, manager); - break; - case "Sparkle - Orange": - ApplyTheme(PaletteModeManager.SparkleOrange, manager); - break; - case "Sparkle - Purple": - ApplyTheme(PaletteModeManager.SparklePurple, manager); - break; - case "Microsoft 365 - Black": - ApplyTheme(PaletteModeManager.Microsoft365Black, manager); - break; - case "Microsoft 365 - Blue": - ApplyTheme(PaletteModeManager.Microsoft365Blue, manager); - break; - case "Microsoft 365 - Silver": - ApplyTheme(PaletteModeManager.Microsoft365Silver, manager); - break; - case "Microsoft 365 - White": - ApplyTheme(PaletteModeManager.Microsoft365White, manager); - break; - default: - throw new ArgumentNullException(nameof(themeName)); - } - } - /// /// Gets the current palette mode. /// @@ -225,16 +57,7 @@ private static void ApplyTheme(string themeName, KryptonManager manager) /// The manager. public static void SetTheme(string themeName, KryptonManager manager) { - try - { - ApplyTheme(themeName, manager); - - ApplyGlobalTheme(manager, GetCurrentPaletteMode(manager)); - } - catch - { - // Swallow ? - } + ThemeManager.SetTheme(themeName, manager); } /// @@ -245,94 +68,7 @@ public static void SetTheme(string themeName, KryptonManager manager) /// The current as a string. public static string ReturnPaletteModeManagerAsString(PaletteModeManager paletteModeManager, KryptonManager manager = null) { - string result = null; - - if (manager != null) - { - if (manager.GlobalPaletteMode == PaletteModeManager.Custom) result = "Custom"; - - if (manager.GlobalPaletteMode == PaletteModeManager.ProfessionalSystem) result = "Professional - System"; - - if (manager.GlobalPaletteMode == PaletteModeManager.ProfessionalOffice2003) result = "Professional - Office 2003"; - - if (manager.GlobalPaletteMode == PaletteModeManager.Office2007Blue) result = "Office 2007 - Blue"; - - if (manager.GlobalPaletteMode == PaletteModeManager.Office2007Silver) result = "Office 2007 - Silver"; - - if (manager.GlobalPaletteMode == PaletteModeManager.Office2007White) result = "Office 2007 - White"; - - if (manager.GlobalPaletteMode == PaletteModeManager.Office2007Black) result = "Office 2007 - Black"; - - if (manager.GlobalPaletteMode == PaletteModeManager.Office2010Blue) result = "Office 2010 - Blue"; - - if (manager.GlobalPaletteMode == PaletteModeManager.Office2010Silver) result = "Office 2010 - Silver"; - - if (manager.GlobalPaletteMode == PaletteModeManager.Office2010White) result = "Office 2010 - White"; - - if (manager.GlobalPaletteMode == PaletteModeManager.Office2010Black) result = "Office 2010 - Black"; - - //if (manager.GlobalPaletteMode == PaletteModeManager.Office2013) result = "Office 2013"; - - if (manager.GlobalPaletteMode == PaletteModeManager.Office2013White) result = "Office 2013 - White"; - - if (manager.GlobalPaletteMode == PaletteModeManager.SparkleBlue) result = "Sparkle - Blue"; - - if (manager.GlobalPaletteMode == PaletteModeManager.SparkleOrange) result = "Sparkle - Orange"; - - if (manager.GlobalPaletteMode == PaletteModeManager.SparklePurple) result = "Sparkle - Purple"; - - if (manager.GlobalPaletteMode == PaletteModeManager.Microsoft365Blue) result = "Microsoft 365 - Blue"; - - if (manager.GlobalPaletteMode == PaletteModeManager.Microsoft365Silver) result = "Microsoft 365 - Silver"; - - if (manager.GlobalPaletteMode == PaletteModeManager.Microsoft365White) result = "Microsoft 365 - White"; - - if (manager.GlobalPaletteMode == PaletteModeManager.Microsoft365Black) result = "Microsoft 365 - Black"; - } - else - { - if (paletteModeManager == PaletteModeManager.Custom) result = "Custom"; - - if (paletteModeManager == PaletteModeManager.ProfessionalSystem) result = "Professional - System"; - - if (paletteModeManager == PaletteModeManager.ProfessionalOffice2003) result = "Professional - Office 2003"; - - if (paletteModeManager == PaletteModeManager.Office2007Blue) result = "Office 2007 - Blue"; - - if (paletteModeManager == PaletteModeManager.Office2007Silver) result = "Office 2007 - Silver"; - - if (paletteModeManager == PaletteModeManager.Office2007White) result = "Office 2007 - White"; - - if (paletteModeManager == PaletteModeManager.Office2007Black) result = "Office 2007 - Black"; - - if (paletteModeManager == PaletteModeManager.Office2010Blue) result = "Office 2010 - Blue"; - - if (paletteModeManager == PaletteModeManager.Office2010Silver) result = "Office 2010 - Silver"; - - if (paletteModeManager == PaletteModeManager.Office2010White) result = "Office 2010 - White"; - - if (paletteModeManager == PaletteModeManager.Office2010Black) result = "Office 2010 - Black"; - - //if (paletteModeManager == PaletteModeManager.Office2013) result = "Office 2013"; - - if (paletteModeManager == PaletteModeManager.Office2013White) result = "Office 2013 - White"; - - if (paletteModeManager == PaletteModeManager.SparkleBlue) result = "Sparkle - Blue"; - - if (paletteModeManager == PaletteModeManager.SparkleOrange) result = "Sparkle - Orange"; - - if (paletteModeManager == PaletteModeManager.SparklePurple) result = "Sparkle - Purple"; - - if (paletteModeManager == PaletteModeManager.Microsoft365Blue) result = "Microsoft 365 - Blue"; - - if (paletteModeManager == PaletteModeManager.Microsoft365Silver) result = "Microsoft 365 - Silver"; - - if (paletteModeManager == PaletteModeManager.Microsoft365White) result = "Microsoft 365 - White"; - - if (paletteModeManager == PaletteModeManager.Microsoft365Black) result = "Microsoft 365 - Black"; - } - - return result; + return ThemeManager.ReturnPaletteModeManagerAsString(paletteModeManager, manager); } /// diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGalleryButton.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGalleryButton.cs index 3f503e1cd..53ec9917a 100644 --- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGalleryButton.cs +++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGalleryButton.cs @@ -20,7 +20,7 @@ namespace Krypton.Ribbon internal class ViewDrawRibbonGalleryButton : ViewLeaf, IContentValues { #region Instance Fields - private readonly IPalette _palette; + private readonly PaletteBase _palette; private readonly GalleryImages _images; private readonly GalleryButtonController _controller; private readonly PaletteRibbonGalleryButton _button; @@ -49,7 +49,7 @@ internal class ViewDrawRibbonGalleryButton : ViewLeaf, IContentValues /// Button content to display. /// Button images. /// Paint event delegate. - public ViewDrawRibbonGalleryButton(IPalette palette, + public ViewDrawRibbonGalleryButton(PaletteBase palette, PaletteRelativeAlign alignment, PaletteRibbonGalleryButton button, GalleryImages images, @@ -65,7 +65,7 @@ public ViewDrawRibbonGalleryButton(IPalette palette, _paletteContent = new PaletteContentToPalette(palette, PaletteContentStyle.ButtonGallery); _controller = new GalleryButtonController(this, needPaint, alignment != PaletteRelativeAlign.Far); _controller.Click += OnButtonClick; - MouseController = _controller; + base.MouseController = _controller; } /// @@ -123,7 +123,7 @@ public override void Layout(ViewLayoutContext context) // We take on all the available display area ClientRectangle = context.DisplayRectangle; - // Dispose of any current memnto + // Dispose of any current memento if (_mementoContent != null) { _mementoContent.Dispose(); @@ -260,26 +260,25 @@ public virtual Image GetImage(PaletteState state) // Get image based on state Image image = null; - switch (State) + if (images != null) { - case PaletteState.Disabled: - image = images.Disabled; - break; - case PaletteState.Normal: - image = images.Normal; - break; - case PaletteState.Tracking: - image = images.Tracking; - break; - case PaletteState.Pressed: - image = images.Pressed; - break; - } - - // If no image then get the common image - if (image == null) - { - image = images.Common; + switch (State) + { + case PaletteState.Disabled: + image = images.Disabled; + break; + case PaletteState.Normal: + image = images.Normal; + break; + case PaletteState.Tracking: + image = images.Tracking; + break; + case PaletteState.Pressed: + image = images.Pressed; + break; + } + // If no image then get the common image + image ??= images.Common; } // If still no image then get is from the palette diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupButtonBackBorder.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupButtonBackBorder.cs index 3a19ede41..fdfbb2022 100644 --- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupButtonBackBorder.cs +++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupButtonBackBorder.cs @@ -229,7 +229,7 @@ public override void Layout(ViewLayoutContext context) /// Perform rendering before child elements are rendered. /// /// Rendering context. - public override void RenderBefore(RenderContext context) + public override void RenderBefore(RenderContext context) { // Get that basic drawing state that does not reflect checked state PaletteState drawState = State; @@ -477,7 +477,7 @@ private void DrawHorizontalSplit(RenderContext context, PaletteState drawState) Rectangle splitRectangle = Controller.SplitRectangle; Rectangle beforeSplitRect = new(ClientLocation, new Size(splitRectangle.X - ClientLocation.X, ClientHeight)); Rectangle splitterRect = new(splitRectangle.Location, new Size(1, ClientHeight)); - Rectangle afterSplitRect = new(splitRectangle.X, ClientLocation.Y , splitRectangle.Width, ClientHeight); + Rectangle afterSplitRect = new(splitRectangle.X, ClientLocation.Y, splitRectangle.Width, ClientHeight); var splitWithFading = SplitWithFading(drawState); switch (drawState) @@ -509,7 +509,7 @@ private void DrawHorizontalSplit(RenderContext context, PaletteState drawState) } } - Rectangle afterSplitRect1 = new(afterSplitRect.X + 1, afterSplitRect.Y, afterSplitRect.Width - 1, afterSplitRect.Height); + Rectangle afterSplitRect1 = new(afterSplitRect.X + 1, afterSplitRect.Y, afterSplitRect.Width - 1, afterSplitRect.Height); using (Clipping clipToSplitter = new(context.Graphics, afterSplitRect1)) { DrawBackground(_paletteBack, context, ClientRectangle, PaletteState.Tracking); @@ -675,7 +675,7 @@ private void DrawHorizontalSplit(RenderContext context, PaletteState drawState) private void DrawBackground(IPaletteBack paletteBack, RenderContext context, - Rectangle rect, + Rectangle rect, PaletteState state) { // Do we need to draw the background? @@ -710,7 +710,7 @@ private void DrawBorder(IPaletteBorder paletteBorder, private bool SplitWithFading(PaletteState drawState) { - IPalette palette = _ribbon.GetRedirector(); + var palette = _ribbon.GetRedirector(); return palette.GetMetricBool(drawState, PaletteMetricBool.SplitWithFading) == InheritBool.True; } @@ -726,7 +726,7 @@ private void ActionFinished(object sender, EventArgs e) } } - // Remove any popups that result from an action occuring + // Remove any popups that result from an action occurring if ((_ribbon != null) && fireAction) { _ribbon.Actionoccurred(); diff --git a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGalleryItems.cs b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGalleryItems.cs index 631b87f9b..9c521271b 100644 --- a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGalleryItems.cs +++ b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGalleryItems.cs @@ -56,7 +56,7 @@ internal class ViewLayoutRibbonGalleryItems : ViewComposite /// Reference to the up button. /// Reference to the down button. /// Reference to the context button. - public ViewLayoutRibbonGalleryItems(IPalette palette, + public ViewLayoutRibbonGalleryItems(PaletteBase palette, KryptonGallery gallery, NeedPaintHandler needPaint, ViewDrawRibbonGalleryButton buttonUp, diff --git a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpec.cs b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpec.cs index bda342f44..213a0a463 100644 --- a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpec.cs +++ b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpec.cs @@ -888,7 +888,7 @@ public virtual void CopyFrom(ButtonSpec source) /// Palette to use for inheriting values. /// State for which an image is needed. /// Button image. - public virtual Image GetImage(IPalette palette, PaletteState state) + public virtual Image GetImage(PaletteBase palette, PaletteState state) { Image image = null; @@ -919,7 +919,7 @@ public virtual Image GetImage(IPalette palette, PaletteState state) /// /// Palette to use for inheriting values. /// Color value. - public virtual Color GetImageTransparentColor(IPalette palette) + public virtual Color GetImageTransparentColor(PaletteBase palette) { if (KryptonCommand != null) { @@ -934,7 +934,7 @@ public virtual Color GetImageTransparentColor(IPalette palette) /// /// Palette to use for inheriting values. /// Short text string. - public virtual string GetShortText(IPalette palette) + public virtual string GetShortText(PaletteBase palette) { if (KryptonCommand != null) { @@ -949,7 +949,7 @@ public virtual string GetShortText(IPalette palette) /// /// Palette to use for inheriting values. /// Long text string. - public virtual string GetLongText(IPalette palette) + public virtual string GetLongText(PaletteBase palette) { if (KryptonCommand != null) { @@ -963,7 +963,7 @@ public virtual string GetLongText(IPalette palette) /// /// Palette to use for inheriting values. /// Tooltip title string. - public virtual string GetToolTipTitle(IPalette palette) => + public virtual string GetToolTipTitle(PaletteBase palette) => !string.IsNullOrEmpty(ToolTipTitle) || !AllowInheritToolTipTitle ? ToolTipTitle : palette.GetButtonSpecToolTipTitle(ProtectedType); @@ -973,7 +973,7 @@ public virtual string GetToolTipTitle(IPalette palette) => /// /// Palette to use for inheriting values. /// Color value. - public virtual Color GetColorMap(IPalette palette) => + public virtual Color GetColorMap(PaletteBase palette) => ColorMap != Color.Empty ? ColorMap : palette.GetButtonSpecColorMap(ProtectedType); /// @@ -981,7 +981,7 @@ public virtual Color GetColorMap(IPalette palette) => /// /// Palette to use for inheriting values. /// Button style. - public virtual ButtonStyle GetStyle(IPalette palette) => + public virtual ButtonStyle GetStyle(PaletteBase palette) => ConvertToButtonStyle( Style != PaletteButtonStyle.Inherit ? Style : palette.GetButtonSpecStyle(ProtectedType)); @@ -990,7 +990,7 @@ public virtual ButtonStyle GetStyle(IPalette palette) => /// /// Palette to use for inheriting values. /// Button orientation. - public virtual ButtonOrientation GetOrientation(IPalette palette) => ConvertToButtonOrientation( + public virtual ButtonOrientation GetOrientation(PaletteBase palette) => ConvertToButtonOrientation( Orientation != PaletteButtonOrientation.Inherit ? Orientation : palette.GetButtonSpecOrientation(ProtectedType)); @@ -1000,7 +1000,7 @@ public virtual ButtonOrientation GetOrientation(IPalette palette) => ConvertToBu /// /// Palette to use for inheriting values. /// Button edge. - public virtual RelativeEdgeAlign GetEdge(IPalette palette) => + public virtual RelativeEdgeAlign GetEdge(PaletteBase palette) => ConvertToRelativeEdgeAlign(Edge != PaletteRelativeEdgeAlign.Inherit ? Edge : palette.GetButtonSpecEdge(ProtectedType)); @@ -1010,14 +1010,14 @@ public virtual RelativeEdgeAlign GetEdge(IPalette palette) => /// /// Palette to use for inheriting values. /// Button location. - public virtual HeaderLocation GetLocation(IPalette palette) => HeaderLocation.PrimaryHeader; + public virtual HeaderLocation GetLocation(PaletteBase palette) => HeaderLocation.PrimaryHeader; /// /// Gets the button enabled state. /// /// Palette to use for inheriting values. /// Button enabled state. - public abstract ButtonEnabled GetEnabled(IPalette palette); + public abstract ButtonEnabled GetEnabled(PaletteBase palette); /// /// Sets the current view associated with the button spec. @@ -1042,14 +1042,14 @@ public virtual RelativeEdgeAlign GetEdge(IPalette palette) => /// /// Palette to use for inheriting values. /// Button visibility. - public abstract bool GetVisible(IPalette palette); + public abstract bool GetVisible(PaletteBase palette); /// /// Gets the button checked state. /// /// Palette to use for inheriting values. /// Button checked state. - public abstract ButtonCheckState GetChecked(IPalette palette); + public abstract ButtonCheckState GetChecked(PaletteBase palette); #endregion #region Protected diff --git a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecAny.cs b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecAny.cs index fb4826493..6052802b4 100644 --- a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecAny.cs +++ b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecAny.cs @@ -252,21 +252,21 @@ public void CopyFrom(ButtonSpecAny source) /// /// Palette to use for inheriting values. /// Button visibility. - public override bool GetVisible(IPalette palette) => Visible; + public override bool GetVisible(PaletteBase palette) => Visible; /// /// Gets the button enabled state. /// /// Palette to use for inheriting values. /// Button enabled state. - public override ButtonEnabled GetEnabled(IPalette palette) => Enabled; + public override ButtonEnabled GetEnabled(PaletteBase palette) => Enabled; /// /// Gets the button checked state. /// /// Palette to use for inheriting values. /// Button checked state. - public override ButtonCheckState GetChecked(IPalette palette) => Checked; + public override ButtonCheckState GetChecked(PaletteBase palette) => Checked; #endregion diff --git a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecCalendar.cs b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecCalendar.cs index 112cc2990..b91cb47eb 100644 --- a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecCalendar.cs +++ b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecCalendar.cs @@ -65,28 +65,28 @@ public ButtonSpecCalendar(ViewDrawMonth month, /// /// Palette to use for inheriting values. /// Button visibility. - public override bool GetVisible(IPalette palette) => Visible; + public override bool GetVisible(PaletteBase palette) => Visible; /// /// Gets the button enabled state. /// /// Palette to use for inheriting values. /// Button enabled state. - public override ButtonEnabled GetEnabled(IPalette palette) => Enabled ? ButtonEnabled.Container : ButtonEnabled.False; + public override ButtonEnabled GetEnabled(PaletteBase palette) => Enabled ? ButtonEnabled.Container : ButtonEnabled.False; /// /// Gets the button checked state. /// /// Palette to use for inheriting values. /// Button checked state. - public override ButtonCheckState GetChecked(IPalette palette) => ButtonCheckState.Unchecked; + public override ButtonCheckState GetChecked(PaletteBase palette) => ButtonCheckState.Unchecked; /// /// Gets the button edge to position against. /// /// Palette to use for inheriting values. /// Edge position. - public override RelativeEdgeAlign GetEdge(IPalette palette) => _edge; + public override RelativeEdgeAlign GetEdge(PaletteBase palette) => _edge; #endregion } diff --git a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecFormWindowClose.cs b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecFormWindowClose.cs index b81f06a09..52461c98b 100644 --- a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecFormWindowClose.cs +++ b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecFormWindowClose.cs @@ -59,7 +59,7 @@ public bool Enabled /// /// Palette to use for inheriting values. /// Button visibility. - public override bool GetVisible(IPalette palette) + public override bool GetVisible(PaletteBase palette) { // We do not show if the custom chrome is combined with composition, // in which case the form buttons are handled by the composition @@ -77,14 +77,14 @@ public override bool GetVisible(IPalette palette) /// /// Palette to use for inheriting values. /// Button enabled state. - public override ButtonEnabled GetEnabled(IPalette palette) => KryptonForm.CloseBox && Enabled ? ButtonEnabled.True: ButtonEnabled.False; + public override ButtonEnabled GetEnabled(PaletteBase palette) => KryptonForm.CloseBox && Enabled ? ButtonEnabled.True: ButtonEnabled.False; /// /// Gets the button checked state. /// /// Palette to use for inheriting values. /// Button checked state. - public override ButtonCheckState GetChecked(IPalette palette) => + public override ButtonCheckState GetChecked(PaletteBase palette) => // Close button is never shown as checked ButtonCheckState.NotCheckButton; diff --git a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecFormWindowMax.cs b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecFormWindowMax.cs index 4c70aa299..4927f9307 100644 --- a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecFormWindowMax.cs +++ b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecFormWindowMax.cs @@ -34,7 +34,7 @@ public ButtonSpecFormWindowMax(KryptonForm form) /// /// Palette to use for inheriting values. /// Button visibility. - public override bool GetVisible(IPalette palette) + public override bool GetVisible(PaletteBase palette) { // We do not show if the custom chrome is combined with composition, // in which case the form buttons are handled by the composition @@ -66,7 +66,7 @@ public override bool GetVisible(IPalette palette) /// /// Palette to use for inheriting values. /// Button enabled state. - public override ButtonEnabled GetEnabled(IPalette palette) => + public override ButtonEnabled GetEnabled(PaletteBase palette) => // Has the maximize buttons been turned off? KryptonForm.MaximizeBox ? ButtonEnabled.True : ButtonEnabled.False; @@ -75,7 +75,7 @@ public override ButtonEnabled GetEnabled(IPalette palette) => /// /// Palette to use for inheriting values. /// Button checked state. - public override ButtonCheckState GetChecked(IPalette palette) => + public override ButtonCheckState GetChecked(PaletteBase palette) => // Close button is never shown as checked ButtonCheckState.NotCheckButton; diff --git a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecFormWindowMin.cs b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecFormWindowMin.cs index 93ffb9877..41996edbc 100644 --- a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecFormWindowMin.cs +++ b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecFormWindowMin.cs @@ -34,7 +34,7 @@ public ButtonSpecFormWindowMin(KryptonForm form) /// /// Palette to use for inheriting values. /// Button visibility. - public override bool GetVisible(IPalette palette) + public override bool GetVisible(PaletteBase palette) { // We do not show if the custom chrome is combined with composition, // in which case the form buttons are handled by the composition @@ -66,7 +66,7 @@ public override bool GetVisible(IPalette palette) /// /// Palette to use for inheriting values. /// Button enabled state. - public override ButtonEnabled GetEnabled(IPalette palette) => + public override ButtonEnabled GetEnabled(PaletteBase palette) => // Has the minimize buttons been turned off? !KryptonForm.MinimizeBox ? ButtonEnabled.False : ButtonEnabled.True; @@ -75,7 +75,7 @@ public override ButtonEnabled GetEnabled(IPalette palette) => /// /// Palette to use for inheriting values. /// Button checked state. - public override ButtonCheckState GetChecked(IPalette palette) => + public override ButtonCheckState GetChecked(PaletteBase palette) => // Close button is never shown as checked ButtonCheckState.NotCheckButton; diff --git a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecHeaderGroup.cs b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecHeaderGroup.cs index 659390d26..e0a0b6e0e 100644 --- a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecHeaderGroup.cs +++ b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecHeaderGroup.cs @@ -92,7 +92,7 @@ public void CopyFrom(ButtonSpecHeaderGroup source) /// /// Palette to use for inheriting values. /// Button location. - public override HeaderLocation GetLocation(IPalette palette) => HeaderLocation; + public override HeaderLocation GetLocation(PaletteBase palette) => HeaderLocation; #endregion } diff --git a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecRemapByContentBase.cs b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecRemapByContentBase.cs index d3ae65c6b..5c4303c3c 100644 --- a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecRemapByContentBase.cs +++ b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecRemapByContentBase.cs @@ -27,7 +27,7 @@ public abstract class ButtonSpecRemapByContentBase : PaletteRedirect /// /// Initial palette target for redirection. /// Reference to button specification. - protected ButtonSpecRemapByContentBase(IPalette target, + protected ButtonSpecRemapByContentBase(PaletteBase target, ButtonSpec buttonSpec) : base(target) { diff --git a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecRemapByContentCache.cs b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecRemapByContentCache.cs index 2b386032b..da86820c9 100644 --- a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecRemapByContentCache.cs +++ b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecRemapByContentCache.cs @@ -28,7 +28,7 @@ public class ButtonSpecRemapByContentCache : ButtonSpecRemapByContentBase /// /// Initial palette target for redirection. /// Reference to button specification. - public ButtonSpecRemapByContentCache(IPalette target, + public ButtonSpecRemapByContentCache(PaletteBase target, ButtonSpec buttonSpec) : base(target, buttonSpec) { diff --git a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecRemapByContentView.cs b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecRemapByContentView.cs index 52ed309f2..1d8370ef3 100644 --- a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecRemapByContentView.cs +++ b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecRemapByContentView.cs @@ -27,7 +27,7 @@ public class ButtonSpecRemapByContentView : ButtonSpecRemapByContentBase /// /// Initial palette target for redirection. /// Reference to button specification. - public ButtonSpecRemapByContentView(IPalette target, + public ButtonSpecRemapByContentView(PaletteBase target, ButtonSpec buttonSpec) : base(target, buttonSpec) { diff --git a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecToContent.cs b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecToContent.cs index 4daddcd7f..586716aea 100644 --- a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecToContent.cs +++ b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecToContent.cs @@ -19,7 +19,7 @@ public class ButtonSpecToContent : IContentValues { #region Instance Fields private readonly ButtonSpec _buttonSpec; - private readonly IPalette _palette; + private readonly PaletteBase _palette; #endregion #region Identity @@ -28,7 +28,7 @@ public class ButtonSpecToContent : IContentValues /// /// Palette for sourcing information. /// Source button spec instance. - public ButtonSpecToContent(IPalette palette, + public ButtonSpecToContent(PaletteBase palette, ButtonSpec buttonSpec) { Debug.Assert(palette != null); diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonContextMenu.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonContextMenu.cs index 986ad9998..cd6d8e4c0 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonContextMenu.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonContextMenu.cs @@ -229,7 +229,7 @@ public void ResetPaletteMode() [Category(@"Visuals")] [Description(@"Custom palette applied to drawing.")] [DefaultValue(null)] - public IPalette Palette + public PaletteBase Palette { [DebuggerStepThrough] get; @@ -431,7 +431,7 @@ public void Close(ToolStripDropDownCloseReason reason) /// True is menu was keyboard initiated. /// VisualContextMenu reference. protected virtual VisualContextMenu CreateContextMenu(KryptonContextMenu kcm, - IPalette palette, + PaletteBase palette, PaletteMode paletteMode, PaletteRedirect redirector, PaletteRedirectContextMenu redirectorImages, diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridView.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridView.cs index 94cd97216..6a1479db1 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridView.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridView.cs @@ -97,8 +97,8 @@ private class ToolTipContent : IContentValues private bool _paintTransparent; private bool _evalTransparent; private Size _lastLayoutSize; - private IPalette _localPalette; - private IPalette _palette; + private PaletteBase _localPalette; + private PaletteBase _palette; private PaletteMode _paletteMode; private ViewDrawPanel _drawPanel; private SimpleCall _refreshCall; @@ -488,7 +488,7 @@ public void ResetPaletteMode() [Category(@"Visuals")] [Description(@"Custom palette applied to drawing.")] [DefaultValue(null)] - public IPalette Palette + public PaletteBase Palette { [DebuggerStepThrough] get => _localPalette; @@ -499,7 +499,7 @@ public IPalette Palette if (_localPalette != value) { // Remember the starting palette - IPalette old = _localPalette; + PaletteBase old = _localPalette; // Use the provided palette value SetPalette(value); @@ -796,7 +796,7 @@ public virtual PaletteState GetCellTriple(DataGridViewElementStates state, /// [Browsable(false)] [EditorBrowsable(EditorBrowsableState.Never)] - public IPalette GetResolvedPalette() => _palette; + public PaletteBase GetResolvedPalette() => _palette; /// /// Gets or Sets the internal KryptonDataGridView CellOver @@ -2491,7 +2491,7 @@ private string TruncateToolTipText(string toolTipText) return toolTipText; } - private void SetPalette(IPalette palette) + private void SetPalette(PaletteBase palette) { if (palette != _palette) { diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDateTimePicker.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDateTimePicker.cs index 0f96a2159..686ed3ffa 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDateTimePicker.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDateTimePicker.cs @@ -1121,7 +1121,7 @@ private void ResetCalendarDayOfWeekStyle() [Category(@"Visuals - DateTimePicker")] [Description(@"Custom palette applied to drawing.")] [DefaultValue(null)] - public new IPalette Palette + public new PaletteBase Palette { get => base.Palette; set => base.Palette = value; @@ -2382,7 +2382,7 @@ public class DTPContextMenu : KryptonContextMenu /// True is menu was keyboard initiated. /// VisualContextMenu reference. protected override VisualContextMenu CreateContextMenu(KryptonContextMenu kcm, - IPalette palette, + PaletteBase palette, PaletteMode paletteMode, PaletteRedirect redirector, PaletteRedirectContextMenu redirectorImages, diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonForm.cs index 925d70536..fbc45bd61 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonForm.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonForm.cs @@ -823,7 +823,7 @@ internal class FormPaletteRedirect : PaletteRedirect { private readonly KryptonForm _kryptonForm; - public FormPaletteRedirect(IPalette palette, KryptonForm kryptonForm) + public FormPaletteRedirect(PaletteBase palette, KryptonForm kryptonForm) : base(palette) => _kryptonForm = kryptonForm; diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonGroupPanel.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonGroupPanel.cs index 4aede9391..a6e6a4771 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonGroupPanel.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonGroupPanel.cs @@ -314,7 +314,7 @@ public override DockStyle Dock [Browsable(false)] [EditorBrowsable(EditorBrowsableState.Never)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public new IPalette Palette + public new PaletteBase Palette { get => base.Palette; set => base.Palette = value; diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonListView.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonListView.cs index 496c9b43f..7f9738da5 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonListView.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonListView.cs @@ -27,8 +27,8 @@ namespace Krypton.Toolkit public class KryptonListView : ListView { #region Variables - private IPalette _localPalette; - private IPalette _palette; + private PaletteBase _localPalette; + private PaletteBase _palette; private PaletteMode _paletteMode; private bool _layoutDirty; private bool _refreshAll; @@ -251,7 +251,7 @@ public IRenderer Renderer [Category(@"Visuals")] [Description(@"Custom palette applied to drawing.")] [DefaultValue(null)] - public IPalette Palette + public PaletteBase Palette { [DebuggerStepThrough] get => this._localPalette; set @@ -265,7 +265,7 @@ public IPalette Palette if (value == null) { _paletteMode = PaletteMode.Global; - _localPalette = (IPalette) null; + _localPalette = null; CacheNewPalette(KryptonManager.GetPaletteForMode(this._paletteMode)); } else @@ -775,7 +775,7 @@ protected override void Dispose(bool disposing) // Unhook from the static events, otherwise we cannot be garbage collected KryptonManager.GlobalPaletteChanged -= OnGlobalPaletteChanged; - this._localPalette = (IPalette) null; + _localPalette = null; } base.Dispose(disposing); @@ -1068,7 +1068,7 @@ private void OnGlobalPaletteChanged(object sender, EventArgs e) Invalidate(); } - private void CacheNewPalette(IPalette palette) + private void CacheNewPalette(PaletteBase palette) { if (palette != _palette) { diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonManager.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonManager.cs index 66ee2d43f..3be7de89c 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonManager.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonManager.cs @@ -35,7 +35,7 @@ public sealed class KryptonManager : Component private static PaletteProfessionalOffice2003 _paletteProfessionalOffice2003; private static PaletteProfessionalSystem _paletteProfessionalSystem; - private static IPalette _customPalette; + private static PaletteBase _customPalette; #region Office 2007 Themes @@ -239,7 +239,7 @@ public PaletteModeManager GlobalPaletteMode default: // Cache the new values PaletteModeManager tempMode = InternalGlobalPaletteMode; - IPalette tempPalette = InternalGlobalPalette; + PaletteBase tempPalette = InternalGlobalPalette; // Use the new value InternalGlobalPaletteMode = value; @@ -283,7 +283,7 @@ public PaletteModeManager GlobalPaletteMode [Category(@"Visuals")] [Description(@"Global custom palette applied to drawing.")] [DefaultValue(null)] - public IPalette GlobalPalette + public PaletteBase GlobalPalette { get => InternalGlobalPalette; @@ -294,7 +294,7 @@ public IPalette GlobalPalette { // Cache the current values PaletteModeManager tempMode = InternalGlobalPaletteMode; - IPalette tempPalette = InternalGlobalPalette; + PaletteBase tempPalette = InternalGlobalPalette; // Use the new values InternalGlobalPaletteMode = (value == null) ? PaletteModeManager.Microsoft365Blue : PaletteModeManager.Custom; @@ -393,14 +393,22 @@ public bool GlobalAllowFormChrome [Category(@"Visuals")] [Description(@"")] [DefaultValue(null)] - public KryptonCustomPaletteManager CustomPaletteManager { get => _customPaletteManager; set => _customPaletteManager = value; } + public KryptonCustomPaletteManager CustomPaletteManager + { + get => _customPaletteManager; + set => _customPaletteManager = value; + } /// Specify a custom palette outside the existing palettes. /// A custom palette. [Category(@"Visuals")] [Description(@"Specify a custom palette outside the existing palettes.")] [DefaultValue(null)] - public IPalette CustomPalette { get => _customPalette; set => _customPalette = value; } + public PaletteBase CustomPalette + { + get => _customPalette; + set => _customPalette = value; + } #endregion @@ -469,7 +477,7 @@ public static bool AllowFormChrome /// /// Gets the current global palette instance given the manager settings. /// - public static IPalette CurrentGlobalPalette + public static PaletteBase CurrentGlobalPalette { get { @@ -584,8 +592,8 @@ public static IPalette CurrentGlobalPalette /// Gets the implementation for the requested palette mode. /// /// Requested palette mode. - /// IPalette reference is available; otherwise false. - public static IPalette GetPaletteForMode(PaletteMode mode) + /// PaletteBase reference is available; otherwise false. + public static PaletteBase GetPaletteForMode(PaletteMode mode) { switch (mode) { @@ -596,7 +604,7 @@ public static IPalette GetPaletteForMode(PaletteMode mode) case PaletteMode.Office2007Blue: return PaletteOffice2007Blue; case PaletteMode.Office2007Custom: - // Note: Do something... + // Note: Do something... case PaletteMode.Office2007DarkGray: return PaletteOffice2007DarkGray; case PaletteMode.Office2007BlueDarkMode: @@ -918,7 +926,7 @@ public static IPalette GetPaletteForMode(PaletteMode mode) /// public static PaletteSparklePurpleLightMode PaletteSparklePurpleLightMode => _paletteSparklePurpleLightMode ??= new PaletteSparklePurpleLightMode(); - //public static PaletteBase CustomPaletteBase => _customPalette ??= new PaletteBase(); + //public static PaletteBase CustomPaletteBase => _customPalette ??= new PaletteBase (); /// /// Gets the implementation for the requested renderer mode. @@ -992,14 +1000,14 @@ public static IRenderer GetRendererForMode(RendererMode mode) #region Static Internal internal static PaletteModeManager InternalGlobalPaletteMode { get; private set; } = PaletteModeManager.Microsoft365Blue; - internal static IPalette InternalGlobalPalette { get; private set; } = CurrentGlobalPalette; + internal static PaletteBase InternalGlobalPalette { get; private set; } = CurrentGlobalPalette; internal static bool HasCircularReference() { // Use a dictionary as a set to check for existence - var paletteSet = new Dictionary(); + var paletteSet = new Dictionary(); - IPalette palette = null; + PaletteBase palette = null; // Get the next palette up in hierarchy if (InternalGlobalPaletteMode == PaletteModeManager.Custom) @@ -1022,7 +1030,7 @@ internal static bool HasCircularReference() // Cast to correct type // If this is a KryptonPalette instance - if (palette is KryptonPalette owner) + if (palette is KryptonCustomPaletteBase owner) { // Get the next palette up in hierarchy palette = owner.BasePaletteMode switch @@ -1101,7 +1109,7 @@ private static void OnPalettePaint(object sender, PaletteLayoutEventArgs e) } } - private static void SetPalette(IPalette globalPalette) + private static void SetPalette(PaletteBase globalPalette) { if (globalPalette != InternalGlobalPalette) { diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPalette.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPalette.cs index df0db2d8f..f7fa1956a 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPalette.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPalette.cs @@ -16,13 +16,13 @@ namespace Krypton.Toolkit /// Define and modify a palette for styling Krypton controls. /// [ToolboxItem(true)] - [ToolboxBitmap(typeof(KryptonPalette), "ToolboxBitmaps.KryptonPalette.bmp")] + [ToolboxBitmap(typeof(KryptonCustomPaletteBase), "ToolboxBitmaps.KryptonPalette.bmp")] [DefaultEvent("PalettePaint")] [DefaultProperty("BasePaletteMode")] [DesignerCategory(@"code")] [Designer("Krypton.Toolkit.KryptonPaletteDesigner, Krypton.Toolkit")] [Description(@"A customisable palette component.")] - public class KryptonPalette : Component, IPalette + public class KryptonCustomPaletteBase : PaletteBase { #region Type Definitions private class ImageDictionary : Dictionary { } @@ -39,7 +39,7 @@ private class ImageReverseDictionary : Dictionary { } private int _suspendCount; private IRenderer _baseRenderer; private RendererMode _baseRenderMode; - private IPalette _basePalette; + private PaletteBase _basePalette; private PaletteMode _basePaletteMode; private InheritBool _allowFormChrome; private readonly PaletteRedirect _redirector; @@ -47,48 +47,11 @@ private class ImageReverseDictionary : Dictionary { } private readonly NeedPaintHandler _needPaintDelegate; #endregion - #region Events - /// - /// Occurs when a palette change requires a repaint. - /// - [Category(@"Action")] - [Description(@"Occurs when a change requires a repaint to reflect the update.")] - public event EventHandler PalettePaint; - - /// - /// Occurs when the AllowFormChrome setting changes. - /// - [Category(@"Action")] - [Description(@"Occurs when the AllowFormChrome setting changes.")] - public event EventHandler AllowFormChromeChanged; - - /// - /// Occurs when the BasePalette/BasePaletteMode setting changes. - /// - [Category(@"Action")] - [Description(@"Occurs when a base palette setting change occurs.")] - public event EventHandler BasePaletteChanged; - - /// - /// Occurs when the BaseRenderer/BaseRendererMode setting changes. - /// - [Category(@"Action")] - [Description(@"Occurs when a base renderer setting change occurs.")] - public event EventHandler BaseRendererChanged; - - /// - /// Occurs when a button spec change occurs. - /// - [Category(@"Action")] - [Description(@"Occurs when a button spec change occurs.")] - public event EventHandler ButtonSpecChanged; - #endregion - #region Identity /// /// Initialize a new instance of the KryptonPalette class. /// - public KryptonPalette() + public KryptonCustomPaletteBase() { // Setup the need paint delegate _needPaintDelegate = OnNeedPaint; @@ -155,7 +118,7 @@ public KryptonPalette() /// Initialize a new instance of the KryptonPalette class. /// /// Container that owns the component. - public KryptonPalette(IContainer container) + public KryptonCustomPaletteBase(IContainer container) : this() { Debug.Assert(container != null); @@ -405,7 +368,7 @@ public KryptonPaletteCheckButtons ButtonStyles [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] public KryptonPaletteHeaders HeaderStyles { get; set; } - private bool ShouldSerializeHeaders() => !HeaderStyles.IsDefault; + private bool ShouldSerializeHeaderStyles() => !HeaderStyles.IsDefault; #endregion @@ -568,7 +531,7 @@ public KryptonPaletteCheckButtons ButtonStyles /// Gets the renderer to use for this palette. /// /// Renderer to use for drawing palette settings. - public IRenderer GetRenderer() + public override IRenderer GetRenderer() => _baseRenderMode switch { RendererMode.Inherit => _basePalette.GetRenderer(), @@ -582,17 +545,17 @@ public IRenderer GetRenderer() /// Gets a value indicating if KryptonForm instances should show custom chrome. /// /// InheritBool value. - public InheritBool GetAllowFormChrome() => AllowFormChrome == InheritBool.Inherit ? _basePalette.GetAllowFormChrome() : AllowFormChrome; + public override InheritBool GetAllowFormChrome() => AllowFormChrome == InheritBool.Inherit ? _basePalette.GetAllowFormChrome() : AllowFormChrome; #endregion - #region IPalette Back + #region PaletteBase Back /// /// Gets a value indicating if background should be drawn. /// /// Background style. /// Palette value should be applicable to this state. /// InheritBool value. - public InheritBool GetBackDraw(PaletteBackStyle style, PaletteState state) => + public override InheritBool GetBackDraw(PaletteBackStyle style, PaletteState state) => // Find the correct destination in the palette and pass on request GetPaletteBack(style, state).GetBackDraw(state); @@ -602,7 +565,7 @@ public InheritBool GetBackDraw(PaletteBackStyle style, PaletteState state) => /// Background style. /// Palette value should be applicable to this state. /// PaletteGraphicsHint value. - public PaletteGraphicsHint GetBackGraphicsHint(PaletteBackStyle style, PaletteState state) => + public override PaletteGraphicsHint GetBackGraphicsHint(PaletteBackStyle style, PaletteState state) => // Find the correct destination in the palette and pass on request GetPaletteBack(style, state).GetBackGraphicsHint(state); @@ -612,7 +575,7 @@ public PaletteGraphicsHint GetBackGraphicsHint(PaletteBackStyle style, PaletteSt /// Background style. /// Palette value should be applicable to this state. /// Color value. - public Color GetBackColor1(PaletteBackStyle style, PaletteState state) => + public override Color GetBackColor1(PaletteBackStyle style, PaletteState state) => // Find the correct destination in the palette and pass on request GetPaletteBack(style, state).GetBackColor1(state); @@ -622,7 +585,7 @@ public Color GetBackColor1(PaletteBackStyle style, PaletteState state) => /// Background style. /// Palette value should be applicable to this state. /// Color value. - public Color GetBackColor2(PaletteBackStyle style, PaletteState state) => + public override Color GetBackColor2(PaletteBackStyle style, PaletteState state) => // Find the correct destination in the palette and pass on request GetPaletteBack(style, state).GetBackColor2(state); @@ -632,7 +595,7 @@ public Color GetBackColor2(PaletteBackStyle style, PaletteState state) => /// Background style. /// Palette value should be applicable to this state. /// Color drawing style. - public PaletteColorStyle GetBackColorStyle(PaletteBackStyle style, PaletteState state) => + public override PaletteColorStyle GetBackColorStyle(PaletteBackStyle style, PaletteState state) => // Find the correct destination in the palette and pass on request GetPaletteBack(style, state).GetBackColorStyle(state); @@ -642,7 +605,7 @@ public PaletteColorStyle GetBackColorStyle(PaletteBackStyle style, PaletteState /// Background style. /// Palette value should be applicable to this state. /// Color alignment style. - public PaletteRectangleAlign GetBackColorAlign(PaletteBackStyle style, PaletteState state) + public override PaletteRectangleAlign GetBackColorAlign(PaletteBackStyle style, PaletteState state) => GetPaletteBack(style, state).GetBackColorAlign(state); /// @@ -651,7 +614,7 @@ public PaletteRectangleAlign GetBackColorAlign(PaletteBackStyle style, PaletteSt /// Background style. /// Palette value should be applicable to this state. /// Angle used for color drawing. - public float GetBackColorAngle(PaletteBackStyle style, PaletteState state) => + public override float GetBackColorAngle(PaletteBackStyle style, PaletteState state) => // Find the correct destination in the palette and pass on request GetPaletteBack(style, state).GetBackColorAngle(state); @@ -661,7 +624,7 @@ public float GetBackColorAngle(PaletteBackStyle style, PaletteState state) => /// Background style. /// Palette value should be applicable to this state. /// Image instance. - public Image GetBackImage(PaletteBackStyle style, PaletteState state) + public override Image GetBackImage(PaletteBackStyle style, PaletteState state) => GetPaletteBack(style, state).GetBackImage(state); /// @@ -670,7 +633,7 @@ public Image GetBackImage(PaletteBackStyle style, PaletteState state) /// Background style. /// Palette value should be applicable to this state. /// Image style value. - public PaletteImageStyle GetBackImageStyle(PaletteBackStyle style, PaletteState state) + public override PaletteImageStyle GetBackImageStyle(PaletteBackStyle style, PaletteState state) => GetPaletteBack(style, state).GetBackImageStyle(state); /// @@ -679,18 +642,18 @@ public PaletteImageStyle GetBackImageStyle(PaletteBackStyle style, PaletteState /// Background style. /// Palette value should be applicable to this state. /// Image alignment style. - public PaletteRectangleAlign GetBackImageAlign(PaletteBackStyle style, PaletteState state) + public override PaletteRectangleAlign GetBackImageAlign(PaletteBackStyle style, PaletteState state) => GetPaletteBack(style, state).GetBackImageAlign(state); #endregion - #region IPalette Border + #region PaletteBase Border /// /// Gets a value indicating if border should be drawn. /// /// Palette value should be applicable to this state. /// Border style. /// InheritBool value. - public InheritBool GetBorderDraw(PaletteBorderStyle style, PaletteState state) + public override InheritBool GetBorderDraw(PaletteBorderStyle style, PaletteState state) => GetPaletteBorder(style, state).GetBorderDraw(state); /// @@ -699,7 +662,7 @@ public InheritBool GetBorderDraw(PaletteBorderStyle style, PaletteState state) /// Border style. /// Palette value should be applicable to this state. /// PaletteDrawBorders value. - public PaletteDrawBorders GetBorderDrawBorders(PaletteBorderStyle style, PaletteState state) + public override PaletteDrawBorders GetBorderDrawBorders(PaletteBorderStyle style, PaletteState state) => GetPaletteBorder(style, state).GetBorderDrawBorders(state); /// @@ -708,7 +671,7 @@ public PaletteDrawBorders GetBorderDrawBorders(PaletteBorderStyle style, Palette /// Border style. /// Palette value should be applicable to this state. /// PaletteGraphicsHint value. - public PaletteGraphicsHint GetBorderGraphicsHint(PaletteBorderStyle style, PaletteState state) + public override PaletteGraphicsHint GetBorderGraphicsHint(PaletteBorderStyle style, PaletteState state) => GetPaletteBorder(style, state).GetBorderGraphicsHint(state); /// @@ -717,7 +680,7 @@ public PaletteGraphicsHint GetBorderGraphicsHint(PaletteBorderStyle style, Palet /// Border style. /// Palette value should be applicable to this state. /// Color value. - public Color GetBorderColor1(PaletteBorderStyle style, PaletteState state) + public override Color GetBorderColor1(PaletteBorderStyle style, PaletteState state) => GetPaletteBorder(style, state).GetBorderColor1(state); /// @@ -726,7 +689,7 @@ public Color GetBorderColor1(PaletteBorderStyle style, PaletteState state) /// Border style. /// Palette value should be applicable to this state. /// Color value. - public Color GetBorderColor2(PaletteBorderStyle style, PaletteState state) + public override Color GetBorderColor2(PaletteBorderStyle style, PaletteState state) => GetPaletteBorder(style, state).GetBorderColor2(state); /// @@ -735,7 +698,7 @@ public Color GetBorderColor2(PaletteBorderStyle style, PaletteState state) /// Border style. /// Palette value should be applicable to this state. /// Color drawing style. - public PaletteColorStyle GetBorderColorStyle(PaletteBorderStyle style, PaletteState state) + public override PaletteColorStyle GetBorderColorStyle(PaletteBorderStyle style, PaletteState state) => GetPaletteBorder(style, state).GetBorderColorStyle(state); /// @@ -744,7 +707,7 @@ public PaletteColorStyle GetBorderColorStyle(PaletteBorderStyle style, PaletteSt /// Border style. /// Palette value should be applicable to this state. /// Color alignment style. - public PaletteRectangleAlign GetBorderColorAlign(PaletteBorderStyle style, PaletteState state) + public override PaletteRectangleAlign GetBorderColorAlign(PaletteBorderStyle style, PaletteState state) => GetPaletteBorder(style, state).GetBorderColorAlign(state); /// @@ -753,7 +716,7 @@ public PaletteRectangleAlign GetBorderColorAlign(PaletteBorderStyle style, Palet /// Border style. /// Palette value should be applicable to this state. /// Angle used for color drawing. - public float GetBorderColorAngle(PaletteBorderStyle style, PaletteState state) + public override float GetBorderColorAngle(PaletteBorderStyle style, PaletteState state) => GetPaletteBorder(style, state).GetBorderColorAngle(state); /// @@ -762,7 +725,7 @@ public float GetBorderColorAngle(PaletteBorderStyle style, PaletteState state) /// Border style. /// Palette value should be applicable to this state. /// Integer width. - public int GetBorderWidth(PaletteBorderStyle style, PaletteState state) + public override int GetBorderWidth(PaletteBorderStyle style, PaletteState state) => GetPaletteBorder(style, state).GetBorderWidth(state); /// @@ -771,7 +734,7 @@ public int GetBorderWidth(PaletteBorderStyle style, PaletteState state) /// Border style. /// Palette value should be applicable to this state. /// Float rounding. - public float GetBorderRounding(PaletteBorderStyle style, PaletteState state) + public override float GetBorderRounding(PaletteBorderStyle style, PaletteState state) => GetPaletteBorder(style, state).GetBorderRounding(state); /// @@ -780,7 +743,7 @@ public float GetBorderRounding(PaletteBorderStyle style, PaletteState state) /// Border style. /// Palette value should be applicable to this state. /// Image instance. - public Image GetBorderImage(PaletteBorderStyle style, PaletteState state) + public override Image GetBorderImage(PaletteBorderStyle style, PaletteState state) => GetPaletteBorder(style, state).GetBorderImage(state); /// @@ -789,7 +752,7 @@ public Image GetBorderImage(PaletteBorderStyle style, PaletteState state) /// Border style. /// Palette value should be applicable to this state. /// Image style value. - public PaletteImageStyle GetBorderImageStyle(PaletteBorderStyle style, PaletteState state) + public override PaletteImageStyle GetBorderImageStyle(PaletteBorderStyle style, PaletteState state) => GetPaletteBorder(style, state).GetBorderImageStyle(state); /// @@ -798,18 +761,18 @@ public PaletteImageStyle GetBorderImageStyle(PaletteBorderStyle style, PaletteSt /// Border style. /// Palette value should be applicable to this state. /// Image alignment style. - public PaletteRectangleAlign GetBorderImageAlign(PaletteBorderStyle style, PaletteState state) + public override PaletteRectangleAlign GetBorderImageAlign(PaletteBorderStyle style, PaletteState state) => GetPaletteBorder(style, state).GetBorderImageAlign(state); #endregion - #region IPalette Content + #region PaletteBase Content /// /// Gets a value indicating if content should be drawn. /// /// Content style. /// Palette value should be applicable to this state. /// InheritBool value. - public InheritBool GetContentDraw(PaletteContentStyle style, PaletteState state) + public override InheritBool GetContentDraw(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentDraw(state); /// @@ -818,7 +781,7 @@ public InheritBool GetContentDraw(PaletteContentStyle style, PaletteState state) /// Content style. /// Palette value should be applicable to this state. /// InheritBool value. - public InheritBool GetContentDrawFocus(PaletteContentStyle style, PaletteState state) + public override InheritBool GetContentDrawFocus(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentDrawFocus(state); /// @@ -827,7 +790,7 @@ public InheritBool GetContentDrawFocus(PaletteContentStyle style, PaletteState s /// Content style. /// Palette value should be applicable to this state. /// RelativeAlignment value. - public PaletteRelativeAlign GetContentImageH(PaletteContentStyle style, PaletteState state) + public override PaletteRelativeAlign GetContentImageH(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentImageH(state); /// @@ -836,7 +799,7 @@ public PaletteRelativeAlign GetContentImageH(PaletteContentStyle style, PaletteS /// Content style. /// Palette value should be applicable to this state. /// RelativeAlignment value. - public PaletteRelativeAlign GetContentImageV(PaletteContentStyle style, PaletteState state) + public override PaletteRelativeAlign GetContentImageV(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentImageV(state); /// @@ -845,7 +808,7 @@ public PaletteRelativeAlign GetContentImageV(PaletteContentStyle style, PaletteS /// Content style. /// Palette value should be applicable to this state. /// PaletteImageEffect value. - public PaletteImageEffect GetContentImageEffect(PaletteContentStyle style, PaletteState state) + public override PaletteImageEffect GetContentImageEffect(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentImageEffect(state); /// @@ -854,7 +817,7 @@ public PaletteImageEffect GetContentImageEffect(PaletteContentStyle style, Palet /// Content style. /// Palette value should be applicable to this state. /// Color value. - public Color GetContentImageColorMap(PaletteContentStyle style, PaletteState state) + public override Color GetContentImageColorMap(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentImageColorMap(state); /// @@ -863,16 +826,18 @@ public Color GetContentImageColorMap(PaletteContentStyle style, PaletteState sta /// Content style. /// Palette value should be applicable to this state. /// Color value. - public Color GetContentImageColorTo(PaletteContentStyle style, PaletteState state) + public override Color GetContentImageColorTo(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentImageColorTo(state); + public override Color GetContentImageColorTransparent(PaletteContentStyle style, PaletteState state) => throw new NotImplementedException(); + /// /// Gets the font for the short text. /// /// Content style. /// Palette value should be applicable to this state. /// Font value. - public Font GetContentShortTextFont(PaletteContentStyle style, PaletteState state) + public override Font GetContentShortTextFont(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentShortTextFont(state); /// @@ -881,7 +846,7 @@ public Font GetContentShortTextFont(PaletteContentStyle style, PaletteState stat /// Content style. /// Palette value should be applicable to this state. /// Font value. - public Font GetContentShortTextNewFont(PaletteContentStyle style, PaletteState state) + public override Font GetContentShortTextNewFont(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentShortTextFont(state); /// @@ -890,7 +855,7 @@ public Font GetContentShortTextNewFont(PaletteContentStyle style, PaletteState s /// Content style. /// Palette value should be applicable to this state. /// PaletteTextHint value. - public PaletteTextHint GetContentShortTextHint(PaletteContentStyle style, PaletteState state) + public override PaletteTextHint GetContentShortTextHint(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentShortTextHint(state); /// @@ -899,7 +864,7 @@ public PaletteTextHint GetContentShortTextHint(PaletteContentStyle style, Palett /// Content style. /// Palette value should be applicable to this state. /// InheritBool value. - public InheritBool GetContentShortTextMultiLine(PaletteContentStyle style, PaletteState state) + public override InheritBool GetContentShortTextMultiLine(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentShortTextMultiLine(state); /// @@ -908,7 +873,7 @@ public InheritBool GetContentShortTextMultiLine(PaletteContentStyle style, Palet /// Content style. /// Palette value should be applicable to this state. /// PaletteTextTrim value. - public PaletteTextTrim GetContentShortTextTrim(PaletteContentStyle style, PaletteState state) + public override PaletteTextTrim GetContentShortTextTrim(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentShortTextTrim(state); /// @@ -917,7 +882,7 @@ public PaletteTextTrim GetContentShortTextTrim(PaletteContentStyle style, Palett /// Content style. /// Palette value should be applicable to this state. /// PaletteTextPrefix value. - public PaletteTextHotkeyPrefix GetContentShortTextPrefix(PaletteContentStyle style, PaletteState state) + public override PaletteTextHotkeyPrefix GetContentShortTextPrefix(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentShortTextPrefix(state); /// @@ -926,7 +891,7 @@ public PaletteTextHotkeyPrefix GetContentShortTextPrefix(PaletteContentStyle sty /// Content style. /// Palette value should be applicable to this state. /// RelativeAlignment value. - public PaletteRelativeAlign GetContentShortTextH(PaletteContentStyle style, PaletteState state) + public override PaletteRelativeAlign GetContentShortTextH(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentShortTextH(state); /// @@ -935,7 +900,7 @@ public PaletteRelativeAlign GetContentShortTextH(PaletteContentStyle style, Pale /// Content style. /// Palette value should be applicable to this state. /// RelativeAlignment value. - public PaletteRelativeAlign GetContentShortTextV(PaletteContentStyle style, PaletteState state) + public override PaletteRelativeAlign GetContentShortTextV(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentShortTextV(state); /// @@ -944,7 +909,7 @@ public PaletteRelativeAlign GetContentShortTextV(PaletteContentStyle style, Pale /// Content style. /// Palette value should be applicable to this state. /// RelativeAlignment value. - public PaletteRelativeAlign GetContentShortTextMultiLineH(PaletteContentStyle style, PaletteState state) + public override PaletteRelativeAlign GetContentShortTextMultiLineH(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentShortTextMultiLineH(state); /// @@ -953,7 +918,7 @@ public PaletteRelativeAlign GetContentShortTextMultiLineH(PaletteContentStyle st /// Content style. /// Palette value should be applicable to this state. /// Color value. - public Color GetContentShortTextColor1(PaletteContentStyle style, PaletteState state) + public override Color GetContentShortTextColor1(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentShortTextColor1(state); /// @@ -962,7 +927,7 @@ public Color GetContentShortTextColor1(PaletteContentStyle style, PaletteState s /// Content style. /// Palette value should be applicable to this state. /// Color value. - public Color GetContentShortTextColor2(PaletteContentStyle style, PaletteState state) + public override Color GetContentShortTextColor2(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentShortTextColor2(state); /// @@ -971,7 +936,7 @@ public Color GetContentShortTextColor2(PaletteContentStyle style, PaletteState s /// Content style. /// Palette value should be applicable to this state. /// Color drawing style. - public PaletteColorStyle GetContentShortTextColorStyle(PaletteContentStyle style, PaletteState state) + public override PaletteColorStyle GetContentShortTextColorStyle(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentShortTextColorStyle(state); /// @@ -980,7 +945,7 @@ public PaletteColorStyle GetContentShortTextColorStyle(PaletteContentStyle style /// Content style. /// Palette value should be applicable to this state. /// Color alignment style. - public PaletteRectangleAlign GetContentShortTextColorAlign(PaletteContentStyle style, PaletteState state) + public override PaletteRectangleAlign GetContentShortTextColorAlign(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentShortTextColorAlign(state); /// @@ -989,7 +954,7 @@ public PaletteRectangleAlign GetContentShortTextColorAlign(PaletteContentStyle s /// Content style. /// Palette value should be applicable to this state. /// Angle used for color drawing. - public float GetContentShortTextColorAngle(PaletteContentStyle style, PaletteState state) + public override float GetContentShortTextColorAngle(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentShortTextColorAngle(state); /// @@ -998,7 +963,7 @@ public float GetContentShortTextColorAngle(PaletteContentStyle style, PaletteSta /// Content style. /// Palette value should be applicable to this state. /// Image instance. - public Image GetContentShortTextImage(PaletteContentStyle style, PaletteState state) + public override Image GetContentShortTextImage(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentShortTextImage(state); /// @@ -1007,7 +972,7 @@ public Image GetContentShortTextImage(PaletteContentStyle style, PaletteState st /// Content style. /// Palette value should be applicable to this state. /// Image style value. - public PaletteImageStyle GetContentShortTextImageStyle(PaletteContentStyle style, PaletteState state) + public override PaletteImageStyle GetContentShortTextImageStyle(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentShortTextImageStyle(state); /// @@ -1016,7 +981,7 @@ public PaletteImageStyle GetContentShortTextImageStyle(PaletteContentStyle style /// Content style. /// Palette value should be applicable to this state. /// Image alignment style. - public PaletteRectangleAlign GetContentShortTextImageAlign(PaletteContentStyle style, PaletteState state) + public override PaletteRectangleAlign GetContentShortTextImageAlign(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentShortTextImageAlign(state); /// @@ -1025,7 +990,7 @@ public PaletteRectangleAlign GetContentShortTextImageAlign(PaletteContentStyle s /// Content style. /// Palette value should be applicable to this state. /// Font value. - public Font GetContentLongTextFont(PaletteContentStyle style, PaletteState state) + public override Font GetContentLongTextFont(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentLongTextFont(state); /// @@ -1034,7 +999,7 @@ public Font GetContentLongTextFont(PaletteContentStyle style, PaletteState state /// Content style. /// Palette value should be applicable to this state. /// Font value. - public Font GetContentLongTextNewFont(PaletteContentStyle style, PaletteState state) + public override Font GetContentLongTextNewFont(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentLongTextFont(state); /// @@ -1043,7 +1008,7 @@ public Font GetContentLongTextNewFont(PaletteContentStyle style, PaletteState st /// Content style. /// Palette value should be applicable to this state. /// TextRenderingHint value. - public PaletteTextHint GetContentLongTextHint(PaletteContentStyle style, PaletteState state) + public override PaletteTextHint GetContentLongTextHint(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentLongTextHint(state); /// @@ -1052,7 +1017,7 @@ public PaletteTextHint GetContentLongTextHint(PaletteContentStyle style, Palette /// Content style. /// Palette value should be applicable to this state. /// PaletteTextPrefix value. - public PaletteTextHotkeyPrefix GetContentLongTextPrefix(PaletteContentStyle style, PaletteState state) + public override PaletteTextHotkeyPrefix GetContentLongTextPrefix(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentLongTextPrefix(state); /// @@ -1061,7 +1026,7 @@ public PaletteTextHotkeyPrefix GetContentLongTextPrefix(PaletteContentStyle styl /// Content style. /// Palette value should be applicable to this state. /// InheritBool value. - public InheritBool GetContentLongTextMultiLine(PaletteContentStyle style, PaletteState state) + public override InheritBool GetContentLongTextMultiLine(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentLongTextMultiLine(state); /// @@ -1070,7 +1035,7 @@ public InheritBool GetContentLongTextMultiLine(PaletteContentStyle style, Palett /// Content style. /// Palette value should be applicable to this state. /// PaletteTextTrim value. - public PaletteTextTrim GetContentLongTextTrim(PaletteContentStyle style, PaletteState state) + public override PaletteTextTrim GetContentLongTextTrim(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentLongTextTrim(state); /// @@ -1079,7 +1044,7 @@ public PaletteTextTrim GetContentLongTextTrim(PaletteContentStyle style, Palette /// Content style. /// Palette value should be applicable to this state. /// RelativeAlignment value. - public PaletteRelativeAlign GetContentLongTextH(PaletteContentStyle style, PaletteState state) + public override PaletteRelativeAlign GetContentLongTextH(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentLongTextH(state); /// @@ -1088,7 +1053,7 @@ public PaletteRelativeAlign GetContentLongTextH(PaletteContentStyle style, Palet /// Content style. /// Palette value should be applicable to this state. /// RelativeAlignment value. - public PaletteRelativeAlign GetContentLongTextV(PaletteContentStyle style, PaletteState state) + public override PaletteRelativeAlign GetContentLongTextV(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentLongTextV(state); /// @@ -1097,7 +1062,7 @@ public PaletteRelativeAlign GetContentLongTextV(PaletteContentStyle style, Palet /// Content style. /// Palette value should be applicable to this state. /// RelativeAlignment value. - public PaletteRelativeAlign GetContentLongTextMultiLineH(PaletteContentStyle style, PaletteState state) + public override PaletteRelativeAlign GetContentLongTextMultiLineH(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentLongTextMultiLineH(state); /// @@ -1106,7 +1071,7 @@ public PaletteRelativeAlign GetContentLongTextMultiLineH(PaletteContentStyle sty /// Content style. /// Palette value should be applicable to this state. /// Color value. - public Color GetContentLongTextColor1(PaletteContentStyle style, PaletteState state) + public override Color GetContentLongTextColor1(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentLongTextColor1(state); /// @@ -1115,7 +1080,7 @@ public Color GetContentLongTextColor1(PaletteContentStyle style, PaletteState st /// Content style. /// Palette value should be applicable to this state. /// Color value. - public Color GetContentLongTextColor2(PaletteContentStyle style, PaletteState state) + public override Color GetContentLongTextColor2(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentLongTextColor2(state); /// @@ -1124,7 +1089,7 @@ public Color GetContentLongTextColor2(PaletteContentStyle style, PaletteState st /// Content style. /// Palette value should be applicable to this state. /// Color drawing style. - public PaletteColorStyle GetContentLongTextColorStyle(PaletteContentStyle style, PaletteState state) + public override PaletteColorStyle GetContentLongTextColorStyle(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentLongTextColorStyle(state); /// @@ -1133,7 +1098,7 @@ public PaletteColorStyle GetContentLongTextColorStyle(PaletteContentStyle style, /// Content style. /// Palette value should be applicable to this state. /// Color alignment style. - public PaletteRectangleAlign GetContentLongTextColorAlign(PaletteContentStyle style, PaletteState state) + public override PaletteRectangleAlign GetContentLongTextColorAlign(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentLongTextColorAlign(state); /// @@ -1142,7 +1107,7 @@ public PaletteRectangleAlign GetContentLongTextColorAlign(PaletteContentStyle st /// Content style. /// Palette value should be applicable to this state. /// Angle used for color drawing. - public float GetContentLongTextColorAngle(PaletteContentStyle style, PaletteState state) + public override float GetContentLongTextColorAngle(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentLongTextColorAngle(state); /// @@ -1151,7 +1116,7 @@ public float GetContentLongTextColorAngle(PaletteContentStyle style, PaletteStat /// Content style. /// Palette value should be applicable to this state. /// Image instance. - public Image GetContentLongTextImage(PaletteContentStyle style, PaletteState state) + public override Image GetContentLongTextImage(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentLongTextImage(state); /// @@ -1160,7 +1125,7 @@ public Image GetContentLongTextImage(PaletteContentStyle style, PaletteState sta /// Content style. /// Palette value should be applicable to this state. /// Image style value. - public PaletteImageStyle GetContentLongTextImageStyle(PaletteContentStyle style, PaletteState state) + public override PaletteImageStyle GetContentLongTextImageStyle(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentLongTextImageStyle(state); /// @@ -1169,7 +1134,7 @@ public PaletteImageStyle GetContentLongTextImageStyle(PaletteContentStyle style, /// Content style. /// Palette value should be applicable to this state. /// Image alignment style. - public PaletteRectangleAlign GetContentLongTextImageAlign(PaletteContentStyle style, PaletteState state) + public override PaletteRectangleAlign GetContentLongTextImageAlign(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentLongTextImageAlign(state); /// @@ -1178,7 +1143,7 @@ public PaletteRectangleAlign GetContentLongTextImageAlign(PaletteContentStyle st /// Content style. /// Palette value should be applicable to this state. /// Padding value. - public Padding GetContentPadding(PaletteContentStyle style, PaletteState state) + public override Padding GetContentPadding(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentPadding(state); /// @@ -1187,18 +1152,18 @@ public Padding GetContentPadding(PaletteContentStyle style, PaletteState state) /// Content style. /// Palette value should be applicable to this state. /// Integer value. - public int GetContentAdjacentGap(PaletteContentStyle style, PaletteState state) + public override int GetContentAdjacentGap(PaletteContentStyle style, PaletteState state) => GetPaletteContent(style, state).GetContentAdjacentGap(state); #endregion - #region IPalette Metric + #region PaletteBase Metric /// /// Gets an integer metric value. /// /// Palette value should be applicable to this state. /// Requested metric. /// Integer value. - public int GetMetricInt(PaletteState state, PaletteMetricInt metric) + public override int GetMetricInt(PaletteState state, PaletteMetricInt metric) { return metric switch { @@ -1222,7 +1187,7 @@ public int GetMetricInt(PaletteState state, PaletteMetricInt metric) /// Palette value should be applicable to this state. /// Requested metric. /// InheritBool value. - public InheritBool GetMetricBool(PaletteState state, PaletteMetricBool metric) + public override InheritBool GetMetricBool(PaletteState state, PaletteMetricBool metric) { if (metric == PaletteMetricBool.HeaderGroupOverlay) { @@ -1239,7 +1204,7 @@ public InheritBool GetMetricBool(PaletteState state, PaletteMetricBool metric) /// Palette value should be applicable to this state. /// Requested metric. /// Padding value. - public Padding GetMetricPadding(PaletteState state, PaletteMetricPadding metric) + public override Padding GetMetricPadding(PaletteState state, PaletteMetricPadding metric) { switch (metric) { @@ -1344,13 +1309,13 @@ public Padding GetMetricPadding(PaletteState state, PaletteMetricPadding metric) #endregion - #region IPalette Images + #region PaletteBase Images /// /// Gets a tree view image appropriate for the provided state. /// /// Is the node expanded /// Appropriate image for drawing; otherwise null. - public Image GetTreeViewImage(bool expanded) => + public override Image GetTreeViewImage(bool expanded) => // Not found, then inherit from target (expanded ? Images.TreeView.Minus : Images.TreeView.Plus) ?? _redirector.GetTreeViewImage(expanded); @@ -1362,7 +1327,7 @@ public Image GetTreeViewImage(bool expanded) => /// Is the check box being hot tracked. /// Is the check box being pressed. /// Appropriate image for drawing; otherwise null. - public Image GetCheckBoxImage(bool enabled, CheckState checkState, bool tracking, bool pressed) + public override Image GetCheckBoxImage(bool enabled, CheckState checkState, bool tracking, bool pressed) { Image retImage = null; @@ -1443,7 +1408,7 @@ public Image GetCheckBoxImage(bool enabled, CheckState checkState, bool tracking /// Is the radio button being hot tracked. /// Is the radio button being pressed. /// Appropriate image for drawing; otherwise null. - public Image GetRadioButtonImage(bool enabled, bool checkState, bool tracking, bool pressed) + public override Image GetRadioButtonImage(bool enabled, bool checkState, bool tracking, bool pressed) { Image retImage; @@ -1498,7 +1463,7 @@ public Image GetRadioButtonImage(bool enabled, bool checkState, bool tracking, b /// Gets a drop down button image appropriate for the provided state. /// /// PaletteState for which image is required. - public Image GetDropDownButtonImage(PaletteState state) + public override Image GetDropDownButtonImage(PaletteState state) { // Grab state specific image Image retImage = state switch @@ -1521,7 +1486,7 @@ public Image GetDropDownButtonImage(PaletteState state) /// Gets a checked image appropriate for a context menu item. /// /// Appropriate image for drawing; otherwise null. - public Image GetContextMenuCheckedImage() + public override Image GetContextMenuCheckedImage() { Image retImage = Images.ContextMenu.Checked; @@ -1533,7 +1498,7 @@ public Image GetContextMenuCheckedImage() /// Gets a indeterminate image appropriate for a context menu item. /// /// Appropriate image for drawing; otherwise null. - public Image GetContextMenuIndeterminateImage() + public override Image GetContextMenuIndeterminateImage() { Image retImage = Images.ContextMenu.Indeterminate; @@ -1545,7 +1510,7 @@ public Image GetContextMenuIndeterminateImage() /// Gets an image indicating a sub-menu on a context menu item. /// /// Appropriate image for drawing; otherwise null. - public Image GetContextMenuSubMenuImage() + public override Image GetContextMenuSubMenuImage() { Image retImage = Images.ContextMenu.SubMenu; @@ -1559,7 +1524,7 @@ public Image GetContextMenuSubMenuImage() /// Enum of the button to fetch. /// State of the button to fetch. /// Appropriate image for drawing; otherwise null. - public Image GetGalleryButtonImage(PaletteRibbonGalleryButton button, PaletteState state) + public override Image GetGalleryButtonImage(PaletteRibbonGalleryButton button, PaletteState state) { Image retImage = null; KryptonPaletteImagesGalleryButton images = button switch @@ -1587,13 +1552,13 @@ public Image GetGalleryButtonImage(PaletteRibbonGalleryButton button, PaletteSta } #endregion - #region IPalette ButtonSpec + #region PaletteBase ButtonSpec /// /// Gets the icon to display for the button. /// /// Style of button spec. /// Icon value. - public Icon GetButtonSpecIcon(PaletteButtonSpecStyle style) + public override Icon GetButtonSpecIcon(PaletteButtonSpecStyle style) => GetPaletteButtonSpec(style).GetButtonSpecIcon(style); /// @@ -1602,7 +1567,7 @@ public Icon GetButtonSpecIcon(PaletteButtonSpecStyle style) /// Style of button spec. /// State for which image is required. /// Image value. - public Image GetButtonSpecImage(PaletteButtonSpecStyle style, PaletteState state) + public override Image GetButtonSpecImage(PaletteButtonSpecStyle style, PaletteState state) => GetPaletteButtonSpec(style).GetButtonSpecImage(style, state); /// @@ -1610,7 +1575,7 @@ public Image GetButtonSpecImage(PaletteButtonSpecStyle style, PaletteState state /// /// Style of button spec. /// Color value. - public Color GetButtonSpecImageTransparentColor(PaletteButtonSpecStyle style) + public override Color GetButtonSpecImageTransparentColor(PaletteButtonSpecStyle style) => GetPaletteButtonSpec(style).GetButtonSpecImageTransparentColor(style); /// @@ -1618,7 +1583,7 @@ public Color GetButtonSpecImageTransparentColor(PaletteButtonSpecStyle style) /// /// Style of button spec. /// String value. - public string GetButtonSpecShortText(PaletteButtonSpecStyle style) + public override string GetButtonSpecShortText(PaletteButtonSpecStyle style) => GetPaletteButtonSpec(style).GetButtonSpecShortText(style); /// @@ -1626,7 +1591,7 @@ public string GetButtonSpecShortText(PaletteButtonSpecStyle style) /// /// Style of button spec. /// String value. - public string GetButtonSpecLongText(PaletteButtonSpecStyle style) + public override string GetButtonSpecLongText(PaletteButtonSpecStyle style) => GetPaletteButtonSpec(style).GetButtonSpecLongText(style); /// @@ -1634,7 +1599,7 @@ public string GetButtonSpecLongText(PaletteButtonSpecStyle style) /// /// Style of button spec. /// String value. - public string GetButtonSpecToolTipTitle(PaletteButtonSpecStyle style) + public override string GetButtonSpecToolTipTitle(PaletteButtonSpecStyle style) => GetPaletteButtonSpec(style).GetButtonSpecToolTipTitle(style); /// @@ -1642,15 +1607,17 @@ public string GetButtonSpecToolTipTitle(PaletteButtonSpecStyle style) /// /// Style of button spec. /// Color value. - public Color GetButtonSpecColorMap(PaletteButtonSpecStyle style) + public override Color GetButtonSpecColorMap(PaletteButtonSpecStyle style) => GetPaletteButtonSpec(style).GetButtonSpecColorMap(style); + public override Color GetButtonSpecColorTransparent(PaletteButtonSpecStyle style) => throw new NotImplementedException(); + /// /// Gets the button style used for drawing the button. /// /// Style of button spec. /// PaletteButtonStyle value. - public PaletteButtonStyle GetButtonSpecStyle(PaletteButtonSpecStyle style) + public override PaletteButtonStyle GetButtonSpecStyle(PaletteButtonSpecStyle style) => GetPaletteButtonSpec(style).GetButtonSpecStyle(style); /// @@ -1658,7 +1625,7 @@ public PaletteButtonStyle GetButtonSpecStyle(PaletteButtonSpecStyle style) /// /// Style of button spec. /// HeaderLocation value. - public HeaderLocation GetButtonSpecLocation(PaletteButtonSpecStyle style) + public override HeaderLocation GetButtonSpecLocation(PaletteButtonSpecStyle style) => GetPaletteButtonSpec(style).GetButtonSpecLocation(style); /// @@ -1666,7 +1633,7 @@ public HeaderLocation GetButtonSpecLocation(PaletteButtonSpecStyle style) /// /// Style of button spec. /// PaletteRelativeEdgeAlign value. - public PaletteRelativeEdgeAlign GetButtonSpecEdge(PaletteButtonSpecStyle style) + public override PaletteRelativeEdgeAlign GetButtonSpecEdge(PaletteButtonSpecStyle style) => GetPaletteButtonSpec(style).GetButtonSpecEdge(style); /// @@ -1674,16 +1641,16 @@ public PaletteRelativeEdgeAlign GetButtonSpecEdge(PaletteButtonSpecStyle style) /// /// Style of button spec. /// PaletteButtonOrientation value. - public PaletteButtonOrientation GetButtonSpecOrientation(PaletteButtonSpecStyle style) + public override PaletteButtonOrientation GetButtonSpecOrientation(PaletteButtonSpecStyle style) => GetPaletteButtonSpec(style).GetButtonSpecOrientation(style); #endregion - #region IPalette RibbonGeneral + #region PaletteBase RibbonGeneral /// /// Gets the ribbon shape that should be used. /// /// Ribbon shape value. - public PaletteRibbonShape GetRibbonShape() + public override PaletteRibbonShape GetRibbonShape() => GetPaletteRibbonGeneral().GetRibbonShape(); /// @@ -1691,14 +1658,14 @@ public PaletteRibbonShape GetRibbonShape() /// /// Palette value should be applicable to this state. /// Font value. - public virtual PaletteRelativeAlign GetRibbonContextTextAlign(PaletteState state) => GetPaletteRibbonGeneral().GetRibbonContextTextAlign(state); + public override PaletteRelativeAlign GetRibbonContextTextAlign(PaletteState state) => GetPaletteRibbonGeneral().GetRibbonContextTextAlign(state); /// /// Gets the font for the ribbon context text. /// /// Palette value should be applicable to this state. /// Font value. - public Font GetRibbonContextTextFont(PaletteState state) + public override Font GetRibbonContextTextFont(PaletteState state) => GetPaletteRibbonGeneral().GetRibbonContextTextFont(state); /// @@ -1706,7 +1673,7 @@ public Font GetRibbonContextTextFont(PaletteState state) /// /// Palette value should be applicable to this state. /// Font value. - public Color GetRibbonContextTextColor(PaletteState state) + public override Color GetRibbonContextTextColor(PaletteState state) => GetPaletteRibbonGeneral().GetRibbonContextTextColor(state); /// @@ -1714,7 +1681,7 @@ public Color GetRibbonContextTextColor(PaletteState state) /// /// Palette value should be applicable to this state. /// Color value. - public Color GetRibbonDisabledDark(PaletteState state) + public override Color GetRibbonDisabledDark(PaletteState state) => GetPaletteRibbonGeneral(state).GetRibbonDisabledDark(state); /// @@ -1722,7 +1689,7 @@ public Color GetRibbonDisabledDark(PaletteState state) /// /// Palette value should be applicable to this state. /// Color value. - public Color GetRibbonDisabledLight(PaletteState state) + public override Color GetRibbonDisabledLight(PaletteState state) => GetPaletteRibbonGeneral(state).GetRibbonDisabledLight(state); /// @@ -1730,7 +1697,7 @@ public Color GetRibbonDisabledLight(PaletteState state) /// /// Palette value should be applicable to this state. /// Color value. - public Color GetRibbonDropArrowLight(PaletteState state) + public override Color GetRibbonDropArrowLight(PaletteState state) => GetPaletteRibbonGeneral(state).GetRibbonDropArrowLight(state); /// @@ -1738,7 +1705,7 @@ public Color GetRibbonDropArrowLight(PaletteState state) /// /// Palette value should be applicable to this state. /// Color value. - public Color GetRibbonDropArrowDark(PaletteState state) + public override Color GetRibbonDropArrowDark(PaletteState state) => GetPaletteRibbonGeneral(state).GetRibbonDropArrowDark(state); /// @@ -1746,7 +1713,7 @@ public Color GetRibbonDropArrowDark(PaletteState state) /// /// Palette value should be applicable to this state. /// Color value. - public Color GetRibbonGroupDialogDark(PaletteState state) + public override Color GetRibbonGroupDialogDark(PaletteState state) => GetPaletteRibbonGeneral(state).GetRibbonGroupDialogDark(state); /// @@ -1754,7 +1721,7 @@ public Color GetRibbonGroupDialogDark(PaletteState state) /// /// Palette value should be applicable to this state. /// Color value. - public Color GetRibbonGroupDialogLight(PaletteState state) + public override Color GetRibbonGroupDialogLight(PaletteState state) => GetPaletteRibbonGeneral(state).GetRibbonGroupDialogLight(state); /// @@ -1762,7 +1729,7 @@ public Color GetRibbonGroupDialogLight(PaletteState state) /// /// Palette value should be applicable to this state. /// Color value. - public Color GetRibbonGroupSeparatorDark(PaletteState state) + public override Color GetRibbonGroupSeparatorDark(PaletteState state) => GetPaletteRibbonGeneral(state).GetRibbonGroupSeparatorDark(state); /// @@ -1770,7 +1737,7 @@ public Color GetRibbonGroupSeparatorDark(PaletteState state) /// /// Palette value should be applicable to this state. /// Color value. - public Color GetRibbonGroupSeparatorLight(PaletteState state) + public override Color GetRibbonGroupSeparatorLight(PaletteState state) => GetPaletteRibbonGeneral(state).GetRibbonGroupSeparatorLight(state); /// @@ -1778,7 +1745,7 @@ public Color GetRibbonGroupSeparatorLight(PaletteState state) /// /// Palette value should be applicable to this state. /// Color value. - public Color GetRibbonMinimizeBarDark(PaletteState state) + public override Color GetRibbonMinimizeBarDark(PaletteState state) => GetPaletteRibbonGeneral(state).GetRibbonMinimizeBarDark(state); /// @@ -1786,7 +1753,7 @@ public Color GetRibbonMinimizeBarDark(PaletteState state) /// /// Palette value should be applicable to this state. /// Color value. - public Color GetRibbonMinimizeBarLight(PaletteState state) + public override Color GetRibbonMinimizeBarLight(PaletteState state) => GetPaletteRibbonGeneral(state).GetRibbonMinimizeBarLight(state); /// @@ -1794,7 +1761,7 @@ public Color GetRibbonMinimizeBarLight(PaletteState state) /// /// Palette value should be applicable to this state. /// Font value. - public Font GetRibbonTextFont(PaletteState state) + public override Font GetRibbonTextFont(PaletteState state) => GetPaletteRibbonGeneral(state).GetRibbonTextFont(state); /// @@ -1802,7 +1769,7 @@ public Font GetRibbonTextFont(PaletteState state) /// /// Palette value should be applicable to this state. /// PaletteTextHint value. - public PaletteTextHint GetRibbonTextHint(PaletteState state) + public override PaletteTextHint GetRibbonTextHint(PaletteState state) => GetPaletteRibbonGeneral(state).GetRibbonTextHint(state); /// @@ -1810,7 +1777,7 @@ public PaletteTextHint GetRibbonTextHint(PaletteState state) /// /// Palette value should be applicable to this state. /// Color value. - public Color GetRibbonTabSeparatorColor(PaletteState state) + public override Color GetRibbonTabSeparatorColor(PaletteState state) => GetPaletteRibbonGeneral(state).GetRibbonTabSeparatorColor(state); /// @@ -1818,14 +1785,14 @@ public Color GetRibbonTabSeparatorColor(PaletteState state) /// /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetRibbonTabSeparatorContextColor(PaletteState state) => GetPaletteRibbonGeneral(state).GetRibbonTabSeparatorContextColor(state); + public override Color GetRibbonTabSeparatorContextColor(PaletteState state) => GetPaletteRibbonGeneral(state).GetRibbonTabSeparatorContextColor(state); /// /// Gets the color for the extra QAT button dark content color. /// /// Palette value should be applicable to this state. /// Color value. - public Color GetRibbonQATButtonDark(PaletteState state) + public override Color GetRibbonQATButtonDark(PaletteState state) => GetPaletteRibbonGeneral(state).GetRibbonQATButtonDark(state); /// @@ -1833,18 +1800,18 @@ public Color GetRibbonQATButtonDark(PaletteState state) /// /// Palette value should be applicable to this state. /// Color value. - public Color GetRibbonQATButtonLight(PaletteState state) + public override Color GetRibbonQATButtonLight(PaletteState state) => GetPaletteRibbonGeneral(state).GetRibbonQATButtonLight(state); #endregion - #region IPalette RibbonBack + #region PaletteBase RibbonBack /// /// Gets the method used to draw the background of a ribbon item. /// /// Background style. /// Palette value should be applicable to this state. /// PaletteRibbonBackStyle value. - public PaletteRibbonColorStyle GetRibbonBackColorStyle(PaletteRibbonBackStyle style, PaletteState state) + public override PaletteRibbonColorStyle GetRibbonBackColorStyle(PaletteRibbonBackStyle style, PaletteState state) => GetPaletteRibbonBack(style, state).GetRibbonBackColorStyle(state); /// @@ -1853,7 +1820,7 @@ public PaletteRibbonColorStyle GetRibbonBackColorStyle(PaletteRibbonBackStyle st /// Background style. /// Palette value should be applicable to this state. /// Color value. - public Color GetRibbonBackColor1(PaletteRibbonBackStyle style, PaletteState state) + public override Color GetRibbonBackColor1(PaletteRibbonBackStyle style, PaletteState state) => GetPaletteRibbonBack(style, state).GetRibbonBackColor1(state); /// @@ -1862,7 +1829,7 @@ public Color GetRibbonBackColor1(PaletteRibbonBackStyle style, PaletteState stat /// Background style. /// Palette value should be applicable to this state. /// Color value. - public Color GetRibbonBackColor2(PaletteRibbonBackStyle style, PaletteState state) + public override Color GetRibbonBackColor2(PaletteRibbonBackStyle style, PaletteState state) => GetPaletteRibbonBack(style, state).GetRibbonBackColor2(state); /// @@ -1871,7 +1838,7 @@ public Color GetRibbonBackColor2(PaletteRibbonBackStyle style, PaletteState stat /// Background style. /// Palette value should be applicable to this state. /// Color value. - public Color GetRibbonBackColor3(PaletteRibbonBackStyle style, PaletteState state) + public override Color GetRibbonBackColor3(PaletteRibbonBackStyle style, PaletteState state) => GetPaletteRibbonBack(style, state).GetRibbonBackColor3(state); /// @@ -1880,7 +1847,7 @@ public Color GetRibbonBackColor3(PaletteRibbonBackStyle style, PaletteState stat /// Background style. /// Palette value should be applicable to this state. /// Color value. - public Color GetRibbonBackColor4(PaletteRibbonBackStyle style, PaletteState state) + public override Color GetRibbonBackColor4(PaletteRibbonBackStyle style, PaletteState state) => GetPaletteRibbonBack(style, state).GetRibbonBackColor4(state); /// @@ -1889,29 +1856,29 @@ public Color GetRibbonBackColor4(PaletteRibbonBackStyle style, PaletteState stat /// Background style. /// Palette value should be applicable to this state. /// Color value. - public Color GetRibbonBackColor5(PaletteRibbonBackStyle style, PaletteState state) + public override Color GetRibbonBackColor5(PaletteRibbonBackStyle style, PaletteState state) => GetPaletteRibbonBack(style, state).GetRibbonBackColor5(state); #endregion - #region IPalette RibbonText + #region PaletteBase RibbonText /// /// Gets the tab color for the item text. /// /// Text style. /// Palette value should be applicable to this state. /// Color value. - public Color GetRibbonTextColor(PaletteRibbonTextStyle style, PaletteState state) + public override Color GetRibbonTextColor(PaletteRibbonTextStyle style, PaletteState state) => GetPaletteRibbonText(style, state).GetRibbonTextColor(state); #endregion - #region IPalette ElementColor + #region PaletteBase ElementColor /// /// Gets the first element color. /// /// Element for which color is required. /// Palette value should be applicable to this state. /// Color value. - public Color GetElementColor1(PaletteElement element, PaletteState state) + public override Color GetElementColor1(PaletteElement element, PaletteState state) => GetTrackBar(element, state).GetElementColor1(state); /// @@ -1920,7 +1887,7 @@ public Color GetElementColor1(PaletteElement element, PaletteState state) /// Element for which color is required. /// Palette value should be applicable to this state. /// Color value. - public Color GetElementColor2(PaletteElement element, PaletteState state) + public override Color GetElementColor2(PaletteElement element, PaletteState state) => GetTrackBar(element, state).GetElementColor2(state); /// @@ -1929,7 +1896,7 @@ public Color GetElementColor2(PaletteElement element, PaletteState state) /// Element for which color is required. /// Palette value should be applicable to this state. /// Color value. - public Color GetElementColor3(PaletteElement element, PaletteState state) + public override Color GetElementColor3(PaletteElement element, PaletteState state) => GetTrackBar(element, state).GetElementColor3(state); /// @@ -1938,7 +1905,7 @@ public Color GetElementColor3(PaletteElement element, PaletteState state) /// Element for which color is required. /// Palette value should be applicable to this state. /// Color value. - public Color GetElementColor4(PaletteElement element, PaletteState state) + public override Color GetElementColor4(PaletteElement element, PaletteState state) => GetTrackBar(element, state).GetElementColor4(state); /// @@ -1947,68 +1914,10 @@ public Color GetElementColor4(PaletteElement element, PaletteState state) /// Element for which color is required. /// Palette value should be applicable to this state. /// Color value. - public Color GetElementColor5(PaletteElement element, PaletteState state) + public override Color GetElementColor5(PaletteElement element, PaletteState state) => GetTrackBar(element, state).GetElementColor5(state); #endregion - #region IPalette DragDrop - /// - /// Gets the feedback drawing method used. - /// - /// Feedback enumeration value. - public PaletteDragFeedback GetDragDropFeedback() - => DragDrop.GetDragDropFeedback(); - - /// - /// Gets the background color for a solid drag drop area. - /// - /// Color value. - public Color GetDragDropSolidBack() - => DragDrop.GetDragDropSolidBack(); - - /// - /// Gets the border color for a solid drag drop area. - /// - /// Color value. - public Color GetDragDropSolidBorder() - => DragDrop.GetDragDropSolidBorder(); - - /// - /// Gets the opacity of the solid area. - /// - /// Opacity ranging from 0 to 1. - public float GetDragDropSolidOpacity() - => DragDrop.GetDragDropSolidOpacity(); - - /// - /// Gets the background color for the docking indicators area. - /// - /// Color value. - public Color GetDragDropDockBack() - => DragDrop.GetDragDropDockBack(); - - /// - /// Gets the border color for the docking indicators area. - /// - /// Color value. - public Color GetDragDropDockBorder() - => DragDrop.GetDragDropDockBorder(); - - /// - /// Gets the active color for docking indicators. - /// - /// Color value. - public Color GetDragDropDockActive() - => DragDrop.GetDragDropDockActive(); - - /// - /// Gets the inactive color for docking indicators. - /// - /// Color value. - public Color GetDragDropDockInactive() - => DragDrop.GetDragDropDockInactive(); - #endregion - #region Public Methods /// /// Suspend the notification of drawing updates when palette values are changed. @@ -2609,7 +2518,7 @@ public PaletteMode BasePaletteMode default: // Cache the original values PaletteMode tempMode = _basePaletteMode; - IPalette tempPalette = _basePalette; + PaletteBase tempPalette = _basePalette; // Use the new value _basePaletteMode = value; @@ -2656,7 +2565,7 @@ public PaletteMode BasePaletteMode [Category(@"Visuals")] [Description(@"KryptonPalette used to inherit from.")] [DefaultValue(null)] - public IPalette BasePalette + public PaletteBase BasePalette { get => _basePalette; @@ -2667,7 +2576,7 @@ public IPalette BasePalette { // Store the original values PaletteMode tempMode = _basePaletteMode; - IPalette tempPalette = _basePalette; + PaletteBase tempPalette = _basePalette; // Find the new palette mode based on the incoming value _basePaletteMode = value == null ? PaletteMode.Microsoft365Blue : PaletteMode.Custom; @@ -2793,11 +2702,16 @@ public IRenderer BaseRenderer private bool ShouldSerializeBaseRenderer() => BaseRenderer != null; private void ResetBaseRenderer() => BaseRenderer = null; + protected override void DefineFonts() + { + throw new NotImplementedException(); + } + /// /// Gets access to the color table instance. /// [Browsable(false)] - public KryptonColorTable ColorTable => ToolMenuStatus.InternalKCT; + public override KryptonColorTable ColorTable => ToolMenuStatus.InternalKCT; #endregion @@ -2813,12 +2727,12 @@ public IRenderer BaseRenderer /// /// Source of the event. /// An PaintLayoutEventArgs containing event data. - protected virtual void OnPalettePaint(object sender, PaletteLayoutEventArgs e) + protected override void OnPalettePaint(object sender, PaletteLayoutEventArgs e) { // Can only generate change events if not suspended if (_suspendCount == 0) { - PalettePaint?.Invoke(this, e); + base.OnPalettePaint(this, e); } } @@ -2827,12 +2741,12 @@ protected virtual void OnPalettePaint(object sender, PaletteLayoutEventArgs e) /// /// Source of the event. /// An EventArgs containing event data. - protected virtual void OnAllowFormChromeChanged(object sender, EventArgs e) + protected override void OnAllowFormChromeChanged(object sender, EventArgs e) { // Can only generate change events if not suspended if (_suspendCount == 0) { - AllowFormChromeChanged?.Invoke(this, e); + base.OnAllowFormChromeChanged(this, e); } } @@ -2841,12 +2755,12 @@ protected virtual void OnAllowFormChromeChanged(object sender, EventArgs e) /// /// Source of the event. /// An EventArgs containing event data. - protected virtual void OnBasePaletteChanged(object sender, EventArgs e) + protected override void OnBasePaletteChanged(object sender, EventArgs e) { // Can only generate change events if not suspended if (_suspendCount == 0) { - BasePaletteChanged?.Invoke(this, e); + base.OnBasePaletteChanged(this, e); } } @@ -2855,12 +2769,12 @@ protected virtual void OnBasePaletteChanged(object sender, EventArgs e) /// /// Source of the event. /// An EventArgs containing event data. - protected virtual void OnBaseRendererChanged(object sender, EventArgs e) + protected override void OnBaseRendererChanged(object sender, EventArgs e) { // Can only generate change events if not suspended if (_suspendCount == 0) { - BaseRendererChanged?.Invoke(this, e); + base.OnBaseRendererChanged(this, e); } } @@ -2869,35 +2783,24 @@ protected virtual void OnBaseRendererChanged(object sender, EventArgs e) /// /// Source of the event. /// An EventArgs containing event data. - protected virtual void OnButtonSpecChanged(object sender, EventArgs e) + protected override void OnButtonSpecChanged(object sender, EventArgs e) { // Can only generate change events if not suspended if (_suspendCount == 0) { - ButtonSpecChanged?.Invoke(this, e); + base.OnButtonSpecChanged(this, e); } } #endregion - #region Property Grid - // Note: Uncomment when `KryptonPalettePropertyGrid` is completed - //[KryptonPersist] - //[Category(@"Visuals")] - //[Description(@"Colors associated with the property grid control.")] - //[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] - //public KryptonPalettePropertyGrid PropertyGrid { get; set; } - - //public bool ShouldSerializePropertyGrid() => !PropertyGrid.IsDefault; - #endregion - #region Internal internal bool HasCircularReference() { // Use a dictionary as a set to check for existence - var paletteSet = new Dictionary(); + var paletteSet = new Dictionary(); // Start processing from ourself upwards - IPalette palette = this; + PaletteBase palette = this; // Keep searching until no more palettes found while (palette != null) @@ -2914,7 +2817,7 @@ internal bool HasCircularReference() // Cast to correct type // If this is a KryptonPalette instance - if (palette is KryptonPalette owner) + if (palette is KryptonCustomPaletteBase owner) { // Get the next palette up in hierarchy palette = owner.BasePaletteMode switch @@ -3594,7 +3497,7 @@ private void ResetObjectToDefault(object obj, bool populate) if (propertyIsDefault != null && propertyIsDefault.PropertyType == typeof(bool)) { // If the object 'IsDefault' then no need to reset it - if ((bool)propertyIsDefault.GetValue(childObj)) + if ((bool)propertyIsDefault.GetValue(childObj)!) { childObj = null; } @@ -5702,7 +5605,7 @@ private void OnNeedPaint(object sender, NeedLayoutEventArgs e) } } - private void SetPalette(IPalette basePalette) + private void SetPalette(PaletteBase basePalette) { if (basePalette != _basePalette) { diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPropertyGrid.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPropertyGrid.cs index 90bb27631..cbdd5fe3a 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPropertyGrid.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPropertyGrid.cs @@ -18,7 +18,7 @@ namespace Krypton.Toolkit public class KryptonPropertyGrid : PropertyGrid { #region Variables - private IPalette _palette; + private PaletteBase _palette; private readonly PaletteRedirect _paletteRedirect; diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTableLayoutPanel.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTableLayoutPanel.cs index f4ff400d6..d3e7e573d 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTableLayoutPanel.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTableLayoutPanel.cs @@ -167,7 +167,7 @@ public void ResetPaletteMode() [Category(@"Visuals")] [Description(@"Custom palette applied to drawing.")] [DefaultValue(null)] - public IPalette Palette + public PaletteBase Palette { [DebuggerStepThrough] get => _backGroundPanel.Palette; diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonThemeComboBox.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonThemeComboBox.cs index 96c12bb54..c38b3f88e 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonThemeComboBox.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonThemeComboBox.cs @@ -19,14 +19,17 @@ namespace Krypton.Toolkit public class KryptonThemeComboBox : KryptonComboBox { #region Instance Fields - private readonly List _supportedThemesList; + private readonly ICollection _supportedThemesNames; private int _selectedIndex; #endregion #region Properties + /// + /// Helper, to return a new list of names + /// [EditorBrowsable(EditorBrowsableState.Never)] - public List SupportedThemesList => _supportedThemesList; + public List SupportedThemesList => _supportedThemesNames.ToList(); /// /// Gets and sets the ThemeSelectedIndex. @@ -62,7 +65,7 @@ public KryptonThemeComboBox() { DropDownStyle = ComboBoxStyle.DropDownList; - _supportedThemesList = ThemeManager.PropagateSupportedThemeList(); + _supportedThemesNames = ThemeManager.SupportedInternalThemeNames; _selectedIndex = 25; } #endregion @@ -79,13 +82,15 @@ public KryptonThemeComboBox() #region Protected Overrides + /// protected override void OnCreateControl() { base.OnCreateControl(); - Items.AddRange(ThemeManager.ReturnThemeArray()); + Items.AddRange(_supportedThemesNames.ToArray()); SelectedIndex = _selectedIndex; } + /// protected override void OnSelectedIndexChanged(EventArgs e) { ThemeManager.ApplyTheme(Text, Manager); diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonWebBrowser.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonWebBrowser.cs index 19ec37316..ba090ab19 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonWebBrowser.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonWebBrowser.cs @@ -23,7 +23,7 @@ namespace Krypton.Toolkit public class KryptonWebBrowser : WebBrowser { #region Instance Fields - private IPalette _palette; + private PaletteBase _palette; private readonly PaletteMode _paletteMode = PaletteMode.Global; private KryptonContextMenu _kryptonContextMenu; private IRenderer _renderer; @@ -199,7 +199,7 @@ private void OnKryptonContextMenuDisposed(object sender, EventArgs e) /// Sets the palette being used. /// The chosen palette. - private void SetPalette(IPalette palette) + private void SetPalette(PaletteBase palette) { if (palette != _palette) { @@ -262,7 +262,7 @@ protected virtual void OnGlobalPaletteChanged(object sender, EventArgs e) /// [Browsable(false)] [EditorBrowsable(EditorBrowsableState.Never)] - public IPalette GetResolvedPalette() => _palette; + public PaletteBase GetResolvedPalette() => _palette; #endregion Palette Controls } diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonWrapLabel.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonWrapLabel.cs index 52540352c..cbc54a2fe 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonWrapLabel.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonWrapLabel.cs @@ -30,8 +30,8 @@ public sealed class KryptonWrapLabel : Label #endregion #region Instance Fields - private IPalette _localPalette; - private IPalette _palette; + private PaletteBase _localPalette; + private PaletteBase _palette; private PaletteMode _paletteMode; private readonly PaletteRedirect _redirector; private LabelStyle _labelStyle; @@ -320,7 +320,7 @@ public PaletteMode PaletteMode [Category(@"Visuals")] [Description(@"Custom palette applied to drawing.")] [DefaultValue(null)] - public IPalette Palette + public PaletteBase Palette { [DebuggerStepThrough] get => _localPalette; @@ -331,7 +331,7 @@ public IPalette Palette if (_localPalette != value) { // Remember the starting palette - IPalette old = _localPalette; + PaletteBase old = _localPalette; // Use the provided palette value SetPalette(value); @@ -405,7 +405,7 @@ public KryptonContextMenu KryptonContextMenu /// [Browsable(false)] [EditorBrowsable(EditorBrowsableState.Never)] - public IPalette GetResolvedPalette() => _palette; + public PaletteBase GetResolvedPalette() => _palette; /// /// Gets access to the current renderer. @@ -775,7 +775,7 @@ private bool CanProcessMnemonic() /// Sets the palette. /// The palette. - private void SetPalette(IPalette palette) + private void SetPalette(PaletteBase palette) { if (palette != _palette) { diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualContainerControlBase.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualContainerControlBase.cs index 5938e83e0..eb616606a 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualContainerControlBase.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualContainerControlBase.cs @@ -30,8 +30,8 @@ public abstract class VisualContainerControlBase : ContainerControl, private bool _refreshAll; private bool _paintTransparent; private bool _evalTransparent; - private IPalette _localPalette; - private IPalette _palette; + private PaletteBase _localPalette; + private PaletteBase _palette; private PaletteMode _paletteMode; private readonly SimpleCall _refreshCall; private readonly SimpleCall _layoutCall; @@ -318,7 +318,7 @@ public void ResetPaletteMode() [Category(@"Visuals")] [Description(@"Custom palette applied to drawing.")] [DefaultValue(null)] - public IPalette Palette + public PaletteBase Palette { [DebuggerStepThrough] get => _localPalette; @@ -329,7 +329,7 @@ public IPalette Palette if (_localPalette != value) { // Remember the starting palette - IPalette old = _localPalette; + PaletteBase old = _localPalette; // Use the provided palette value SetPalette(value); @@ -426,7 +426,7 @@ public override ImageLayout BackgroundImageLayout /// [Browsable(false)] [EditorBrowsable(EditorBrowsableState.Never)] - public IPalette GetResolvedPalette() => _palette; + public PaletteBase GetResolvedPalette() => _palette; /// /// Gets and sets the dirty palette counter. @@ -1081,7 +1081,7 @@ protected virtual void ContextMenuClosed() #endregion #region Implementation - private void SetPalette(IPalette palette) + private void SetPalette(PaletteBase palette) { if (palette != _palette) { diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualContextMenu.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualContextMenu.cs index d3da546a9..6fe66c431 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualContextMenu.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualContextMenu.cs @@ -19,7 +19,7 @@ public class VisualContextMenu : VisualPopup { #region Instance Fields private readonly KryptonContextMenu _contextMenu; - private IPalette _palette; + private PaletteBase _palette; private readonly ContextMenuProvider _provider; private ViewDrawDocker _drawDocker; private readonly ViewLayoutStack _viewColumns; @@ -70,7 +70,7 @@ public VisualContextMenu(IContextMenuProvider provider, /// Enabled state of the context menu. /// Was the context menu activate by a keyboard action. public VisualContextMenu(KryptonContextMenu contextMenu, - IPalette palette, + PaletteBase palette, PaletteMode paletteMode, PaletteRedirect redirector, PaletteRedirectContextMenu redirectorImages, @@ -468,7 +468,7 @@ private Size CalculatePreferredSize() } } - private void SetPalette(IPalette palette) + private void SetPalette(PaletteBase palette) { if (palette != _palette) { diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualContextMenuDTP.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualContextMenuDTP.cs index 77f124a40..b4239d824 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualContextMenuDTP.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualContextMenuDTP.cs @@ -35,7 +35,7 @@ public class VisualContextMenuDTP : VisualContextMenu /// Was the context menu activate by a keyboard action. /// Screen rectangle of the drop down button. public VisualContextMenuDTP(KryptonContextMenu contextMenu, - IPalette palette, + PaletteBase palette, PaletteMode paletteMode, PaletteRedirect redirector, PaletteRedirectContextMenu redirectorImages, diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualControlBase.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualControlBase.cs index 8b402cfa7..b406cf3c3 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualControlBase.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualControlBase.cs @@ -31,8 +31,8 @@ public abstract class VisualControlBase : Control, private bool _paintTransparent; private bool _evalTransparent; private bool _globalEvents; - private IPalette _localPalette; - private IPalette _palette; + private PaletteBase _localPalette; + private PaletteBase _palette; private PaletteMode _paletteMode; private readonly SimpleCall _refreshCall; private readonly SimpleCall _layoutCall; @@ -325,7 +325,7 @@ public void ResetPaletteMode() [Category(@"Visuals")] [Description(@"Custom palette applied to drawing.")] [DefaultValue(null)] - public IPalette Palette + public PaletteBase Palette { [DebuggerStepThrough] get => _localPalette; @@ -336,7 +336,7 @@ public IPalette Palette if (_localPalette != value) { // Remember the starting palette - IPalette old = _localPalette; + PaletteBase old = _localPalette; // Use the provided palette value SetPalette(value); @@ -433,7 +433,7 @@ public override ImageLayout BackgroundImageLayout /// [Browsable(false)] [EditorBrowsable(EditorBrowsableState.Never)] - public IPalette GetResolvedPalette() => _palette; + public PaletteBase GetResolvedPalette() => _palette; /// /// Gets and sets the dirty palette counter. @@ -1170,7 +1170,7 @@ protected virtual void ContextMenuClosed() #endregion #region Implementation - private void SetPalette(IPalette palette) + private void SetPalette(PaletteBase palette) { if (palette != _palette) { diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualForm.cs index fca590ed8..3aaf5223f 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualForm.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualForm.cs @@ -39,8 +39,8 @@ public abstract class VisualForm : Form, private int _compositionHeight; private int _ignoreCount; private ViewBase _capturedElement; - private IPalette _localPalette; - private IPalette _palette; + private PaletteBase _localPalette; + private PaletteBase _palette; private PaletteMode _paletteMode; private readonly IntPtr _screenDC; private ShadowValues _shadowValues; @@ -454,7 +454,7 @@ public BlurValues BlurValues [Category(@"Visuals")] [Description(@"Custom palette applied to drawing.")] [DefaultValue(null)] - public IPalette Palette + public PaletteBase Palette { [DebuggerStepThrough] get => _localPalette; @@ -465,7 +465,7 @@ public IPalette Palette if (_localPalette != value) { // Remember the starting palette - IPalette old = _localPalette; + PaletteBase old = _localPalette; // Use the provided palette value SetPalette(value); @@ -531,7 +531,7 @@ public IRenderer Renderer /// [Browsable(false)] [EditorBrowsable(EditorBrowsableState.Never)] - public IPalette GetResolvedPalette() => _palette; + public PaletteBase GetResolvedPalette() => _palette; /// /// Create a tool strip renderer appropriate for the current renderer/palette pair. @@ -1881,7 +1881,7 @@ private void OnUserPreferenceChanged(object sender, UserPreferenceChangedEventAr } } - private void SetPalette(IPalette palette) + private void SetPalette(PaletteBase palette) { if (palette != _palette) { diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualPanel.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualPanel.cs index 3730950e1..505f76556 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualPanel.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualPanel.cs @@ -34,8 +34,8 @@ public abstract class VisualPanel : Panel, private bool _evalTransparent; private bool _globalEvents; private Size _lastLayoutSize; - private IPalette _localPalette; - private IPalette _palette; + private PaletteBase _localPalette; + private PaletteBase _palette; private PaletteMode _paletteMode; private readonly SimpleCall _refreshCall; private KryptonContextMenu _kryptonContextMenu; @@ -353,7 +353,7 @@ public void ResetPaletteMode() [Category(@"Visuals")] [Description(@"Custom palette applied to drawing.")] [DefaultValue(null)] - public IPalette Palette + public PaletteBase Palette { [DebuggerStepThrough] get => _localPalette; @@ -364,7 +364,7 @@ public IPalette Palette if (_localPalette != value) { // Remember the starting palette - IPalette old = _localPalette; + PaletteBase old = _localPalette; // Use the provided palette value SetPalette(value); @@ -705,7 +705,7 @@ protected bool NeedTransparentPaint /// [Browsable(false)] [EditorBrowsable(EditorBrowsableState.Never)] - public IPalette GetResolvedPalette() => _palette; + public PaletteBase GetResolvedPalette() => _palette; #endregion @@ -1061,7 +1061,7 @@ protected override void OnLostFocus(EventArgs e) #endregion #region Implementation - private void SetPalette(IPalette palette) + private void SetPalette(PaletteBase palette) { if (palette != _palette) { diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualPopup.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualPopup.cs index 210d2b234..2da2c0eb5 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualPopup.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualPopup.cs @@ -79,8 +79,8 @@ public VisualPopup(ViewManager viewManager, #endregion // We use double buffering to reduce drawing flicker - SetStyle(ControlStyles.OptimizedDoubleBuffer - | ControlStyles.AllPaintingInWmPaint + SetStyle(ControlStyles.OptimizedDoubleBuffer + | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true); // We need to repaint entire control whenever resized @@ -292,7 +292,7 @@ public virtual bool AllowMouseMove(Message m, Point pt) => /// [Browsable(false)] [EditorBrowsable(EditorBrowsableState.Never)] - public virtual IPalette GetResolvedPalette() => null; + public virtual PaletteBase GetResolvedPalette() => null; /// /// Gets access to the current renderer. diff --git a/Source/Krypton Components/Krypton.Toolkit/Designers/Action Lists/KryptonPaletteActionList.cs b/Source/Krypton Components/Krypton.Toolkit/Designers/Action Lists/KryptonPaletteActionList.cs index c6e65b546..e9fd989eb 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Designers/Action Lists/KryptonPaletteActionList.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Designers/Action Lists/KryptonPaletteActionList.cs @@ -15,7 +15,7 @@ namespace Krypton.Toolkit internal class KryptonPaletteActionList : DesignerActionList { #region Instance Fields - private readonly KryptonPalette _palette; + private readonly KryptonCustomPaletteBase _palette; private readonly IComponentChangeService _service; #endregion @@ -28,7 +28,7 @@ public KryptonPaletteActionList(KryptonPaletteDesigner owner) : base(owner.Component) { // Remember the panel instance - _palette = owner.Component as KryptonPalette; + _palette = owner.Component as KryptonCustomPaletteBase; // Cache service used to notify when a property has changed _service = (IComponentChangeService)GetService(typeof(IComponentChangeService)); diff --git a/Source/Krypton Components/Krypton.Toolkit/General/ContextMenuProvider.cs b/Source/Krypton Components/Krypton.Toolkit/General/ContextMenuProvider.cs index 4264a07be..d02aa2bf2 100644 --- a/Source/Krypton Components/Krypton.Toolkit/General/ContextMenuProvider.cs +++ b/Source/Krypton Components/Krypton.Toolkit/General/ContextMenuProvider.cs @@ -88,7 +88,7 @@ public ContextMenuProvider(IContextMenuProvider provider, public ContextMenuProvider(KryptonContextMenu contextMenu, ViewContextMenuManager viewManager, ViewLayoutStack viewColumns, - IPalette palette, + PaletteBase palette, PaletteMode paletteMode, PaletteRedirect redirector, PaletteRedirectContextMenu redirectorImages, @@ -132,7 +132,7 @@ public ContextMenuProvider(KryptonContextMenu contextMenu, /// Enabled state of the context menu. public ContextMenuProvider(ViewContextMenuManager viewManager, ViewLayoutStack viewColumns, - IPalette palette, + PaletteBase palette, PaletteMode paletteMode, PaletteContextMenuRedirect stateCommon, PaletteContextMenuItemState stateDisabled, @@ -305,7 +305,7 @@ public ToolStripDropDownCloseReason? ProviderCloseReason /// /// Gets access to the custom palette. /// - public IPalette ProviderPalette { get; } + public PaletteBase ProviderPalette { get; } /// /// Gets access to the palette mode. diff --git a/Source/Krypton Components/Krypton.Toolkit/General/Definitions.cs b/Source/Krypton Components/Krypton.Toolkit/General/Definitions.cs index db58aaa26..67654e852 100644 --- a/Source/Krypton Components/Krypton.Toolkit/General/Definitions.cs +++ b/Source/Krypton Components/Krypton.Toolkit/General/Definitions.cs @@ -67,56 +67,56 @@ public interface IButtonSpecValues /// Palette to use for inheriting values. /// State for which an image is needed. /// Button image. - Image GetImage(IPalette palette, PaletteState state); + Image GetImage(PaletteBase palette, PaletteState state); /// /// Gets the button image transparent color. /// /// Palette to use for inheriting values. /// Color value. - Color GetImageTransparentColor(IPalette palette); + Color GetImageTransparentColor(PaletteBase palette); /// /// Gets the button short text. /// /// Palette to use for inheriting values. /// Short text string. - string GetShortText(IPalette palette); + string GetShortText(PaletteBase palette); /// /// Gets the button long text. /// /// Palette to use for inheriting values. /// Long text string. - string GetLongText(IPalette palette); + string GetLongText(PaletteBase palette); /// /// Gets the button tooltip title text. /// /// Palette to use for inheriting values. /// Tooltip title string. - string GetToolTipTitle(IPalette palette); + string GetToolTipTitle(PaletteBase palette); /// /// Gets and image color to remap to container foreground. /// /// Palette to use for inheriting values. /// Color value. - Color GetColorMap(IPalette palette); + Color GetColorMap(PaletteBase palette); /// /// Gets the button visibility. /// /// Palette to use for inheriting values. /// Button visibility value. - bool GetVisible(IPalette palette); + bool GetVisible(PaletteBase palette); /// /// Gets the button enabled state. /// /// Palette to use for inheriting values. /// Button enabled value. - ButtonEnabled GetEnabled(IPalette palette); + ButtonEnabled GetEnabled(PaletteBase palette); /// /// Sets the current view associated with the button spec. @@ -141,28 +141,28 @@ public interface IButtonSpecValues /// /// Palette to use for inheriting values. /// Button edge value. - RelativeEdgeAlign GetEdge(IPalette palette); + RelativeEdgeAlign GetEdge(PaletteBase palette); /// /// Gets the button style. /// /// Palette to use for inheriting values. /// Button style value. - ButtonStyle GetStyle(IPalette palette); + ButtonStyle GetStyle(PaletteBase palette); /// /// Gets the button location value. /// /// Palette to use for inheriting values. /// Button location. - HeaderLocation GetLocation(IPalette palette); + HeaderLocation GetLocation(PaletteBase palette); /// /// Gets the button orientation. /// /// Palette to use for inheriting values. /// Orientation value. - ButtonOrientation GetOrientation(IPalette palette); + ButtonOrientation GetOrientation(PaletteBase palette); } #endregion @@ -292,7 +292,7 @@ public interface IContextMenuProvider /// /// Gets access to the custom palette. /// - IPalette ProviderPalette { get; } + PaletteBase ProviderPalette { get; } /// /// Gets access to the palette mode. diff --git a/Source/Krypton Components/Krypton.Toolkit/General/GlobalId.cs b/Source/Krypton Components/Krypton.Toolkit/General/GlobalId.cs index d6950717c..718dac462 100644 --- a/Source/Krypton Components/Krypton.Toolkit/General/GlobalId.cs +++ b/Source/Krypton Components/Krypton.Toolkit/General/GlobalId.cs @@ -12,10 +12,20 @@ namespace Krypton.Toolkit { + public interface IGlobalId + { + #region Id + /// + /// Gets the unique identifier of the object. + /// + int Id { get; } + #endregion + } + /// /// Contains a global identifier that is unique among objects. /// - public class GlobalId + public class GlobalId : IGlobalId { #region Instance Fields diff --git a/Source/Krypton Components/Krypton.Toolkit/General/Scroll Bars/HScrollSkin.cs b/Source/Krypton Components/Krypton.Toolkit/General/Scroll Bars/HScrollSkin.cs index 1b51e3447..5340a6e0e 100644 --- a/Source/Krypton Components/Krypton.Toolkit/General/Scroll Bars/HScrollSkin.cs +++ b/Source/Krypton Components/Krypton.Toolkit/General/Scroll Bars/HScrollSkin.cs @@ -35,7 +35,7 @@ public class HScrollSkin : Panel private HScrollBar HSB; - private static IPalette _palette; + private static PaletteBase _palette; private readonly PaletteRedirect _paletteRedirect; #endregion diff --git a/Source/Krypton Components/Krypton.Toolkit/General/Scroll Bars/ScrollBarExtendedRenderer.cs b/Source/Krypton Components/Krypton.Toolkit/General/Scroll Bars/ScrollBarExtendedRenderer.cs index b0d81e49e..e76abab91 100644 --- a/Source/Krypton Components/Krypton.Toolkit/General/Scroll Bars/ScrollBarExtendedRenderer.cs +++ b/Source/Krypton Components/Krypton.Toolkit/General/Scroll Bars/ScrollBarExtendedRenderer.cs @@ -54,7 +54,7 @@ internal static class ScrollBarExtendedRenderer /// public static Color[] gripColours = new Color[2]; - private static IPalette _palette; + private static PaletteBase _palette; private static PaletteRedirect _paletteRedirect; #endregion diff --git a/Source/Krypton Components/Krypton.Toolkit/General/Scroll Bars/ScrollBarKryptonRenderer.cs b/Source/Krypton Components/Krypton.Toolkit/General/Scroll Bars/ScrollBarKryptonRenderer.cs index 5c796ceb4..150148329 100644 --- a/Source/Krypton Components/Krypton.Toolkit/General/Scroll Bars/ScrollBarKryptonRenderer.cs +++ b/Source/Krypton Components/Krypton.Toolkit/General/Scroll Bars/ScrollBarKryptonRenderer.cs @@ -54,7 +54,7 @@ internal static class ScrollBarKryptonRenderer /// public static Color[] gripColours = new Color[2]; - private static IPalette _palette; + private static PaletteBase _palette; private static PaletteRedirect _paletteRedirect; #endregion diff --git a/Source/Krypton Components/Krypton.Toolkit/General/Scroll Bars/VScrollSkin.cs b/Source/Krypton Components/Krypton.Toolkit/General/Scroll Bars/VScrollSkin.cs index 5c3000846..bc22671f3 100644 --- a/Source/Krypton Components/Krypton.Toolkit/General/Scroll Bars/VScrollSkin.cs +++ b/Source/Krypton Components/Krypton.Toolkit/General/Scroll Bars/VScrollSkin.cs @@ -35,7 +35,7 @@ public class VScrollSkin : Panel private VScrollBar VSB; private HScrollBar HSC; - private static IPalette _palette; + private static PaletteBase _palette; private readonly PaletteRedirect _paletteRedirect; #endregion diff --git a/Source/Krypton Components/Krypton.Toolkit/Krypton.Toolkit 2022.csproj.DotSettings b/Source/Krypton Components/Krypton.Toolkit/Krypton.Toolkit 2022.csproj.DotSettings index 4887f9475..195c46069 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Krypton.Toolkit 2022.csproj.DotSettings +++ b/Source/Krypton Components/Krypton.Toolkit/Krypton.Toolkit 2022.csproj.DotSettings @@ -1,2 +1,2 @@  - CSharp100 \ No newline at end of file + Latest \ No newline at end of file diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteBack/PaletteBackToPalette.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteBack/PaletteBackToPalette.cs index 1c8cc58b5..64a3183f4 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteBack/PaletteBackToPalette.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteBack/PaletteBackToPalette.cs @@ -18,7 +18,7 @@ namespace Krypton.Toolkit public class PaletteBackToPalette : IPaletteBack { #region Instance Fields - private readonly IPalette _palette; + private readonly PaletteBase _palette; #endregion @@ -28,7 +28,7 @@ public class PaletteBackToPalette : IPaletteBack /// /// Source for getting all values. /// Style of values required. - public PaletteBackToPalette(IPalette palette, PaletteBackStyle style) + public PaletteBackToPalette(PaletteBase palette, PaletteBackStyle style) { // Remember source palette _palette = palette; diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteBorder/PaletteBorderToPalette.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteBorder/PaletteBorderToPalette.cs index 7759438ee..b785b9154 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteBorder/PaletteBorderToPalette.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteBorder/PaletteBorderToPalette.cs @@ -18,7 +18,7 @@ namespace Krypton.Toolkit public class PaletteBorderToPalette : IPaletteBorder { #region Instance Fields - private readonly IPalette _palette; + private readonly PaletteBase _palette; #endregion @@ -28,7 +28,7 @@ public class PaletteBorderToPalette : IPaletteBorder /// /// Source for getting all values. /// Style of values required. - public PaletteBorderToPalette(IPalette palette, + public PaletteBorderToPalette(PaletteBase palette, PaletteBorderStyle style) { // Remember inheritance diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteContent/PaletteContentToPalette.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteContent/PaletteContentToPalette.cs index ce321e6e4..0f630b500 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteContent/PaletteContentToPalette.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteContent/PaletteContentToPalette.cs @@ -18,7 +18,7 @@ namespace Krypton.Toolkit public class PaletteContentToPalette : IPaletteContent { #region Instance Fields - private readonly IPalette _palette; + private readonly PaletteBase _palette; #endregion @@ -28,7 +28,7 @@ public class PaletteContentToPalette : IPaletteContent /// /// Source for getting all values. /// Style of values required. - public PaletteContentToPalette(IPalette palette, PaletteContentStyle style) + public PaletteContentToPalette(PaletteBase palette, PaletteContentStyle style) { // Remember source palette _palette = palette; diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteDefinitions.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteDefinitions.cs index 589c0e792..ec0a31ea8 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteDefinitions.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteDefinitions.cs @@ -20,7 +20,7 @@ namespace Krypton.Toolkit /// /// Exposes a palette for drawing. /// - public interface IPalette + public interface IPalette1 { #region Events /// diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteDragDrop/PaletteDragDrop.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteDragDrop/PaletteDragDrop.cs index 84189ecbb..17c75dac9 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteDragDrop/PaletteDragDrop.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteDragDrop/PaletteDragDrop.cs @@ -19,7 +19,7 @@ public class PaletteDragDrop : Storage, IPaletteDragDrop { #region Instance Fields - private IPalette _inherit; + private PaletteBase _inherit; private PaletteDragFeedback _feedback; private Color _solidBack; private Color _solidBorder; @@ -36,7 +36,7 @@ public class PaletteDragDrop : Storage, /// /// Source for inheriting values. /// Delegate for notifying paint requests. - public PaletteDragDrop(IPalette inherit, + public PaletteDragDrop(PaletteBase inherit, NeedPaintHandler needPaint) { // Remember inheritance @@ -77,7 +77,7 @@ public PaletteDragDrop(IPalette inherit, /// /// Sets the inheritance parent. /// - public void SetInherit(IPalette inherit) + public void SetInherit(PaletteBase inherit) { _inherit = inherit; } diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirect.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirect.cs index 954689e03..49cf70b17 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirect.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirect.cs @@ -15,38 +15,10 @@ namespace Krypton.Toolkit /// /// Redirects requests onto a dynamic instance of a IPalette. /// - public class PaletteRedirect : GlobalId, - IPalette + public class PaletteRedirect : PaletteBase, IGlobalId { #region Instance Fields - private IPalette _target; - #endregion - - #region Events - /// - /// Occurs when a palette change requires a repaint. - /// - public event EventHandler PalettePaint; - - /// - /// Occurs when the AllowFormChrome setting changes. - /// - public event EventHandler AllowFormChromeChanged; - - /// - /// Occurs when the BasePalette/BasePaletteMode setting changes. - /// - public event EventHandler BasePaletteChanged; - - /// - /// Occurs when the BaseRenderer/BaseRendererMode setting changes. - /// - public event EventHandler BaseRendererChanged; - - /// - /// Occurs when a button spec change occurs. - /// - public event EventHandler ButtonSpecChanged; + private PaletteBase _target; #endregion #region Identity @@ -62,16 +34,20 @@ public PaletteRedirect() /// Initialize a new instance of the PaletteRedirect class. /// /// Initial palette target for redirection. - public PaletteRedirect(IPalette target) => + public PaletteRedirect(PaletteBase target) + { + Id = CommonHelper.NextId; // Remember incoming target _target = target; + } + #endregion #region Target /// /// Gets and sets the redirection target. /// - public virtual IPalette Target + public virtual PaletteBase Target { get => _target; set => _target = value; @@ -83,7 +59,7 @@ public virtual IPalette Target /// Gets a value indicating if KryptonForm instances should show custom chrome. /// /// InheritBool value. - public virtual InheritBool GetAllowFormChrome() => _target.GetAllowFormChrome(); + public override InheritBool GetAllowFormChrome() => _target.GetAllowFormChrome(); #endregion @@ -92,7 +68,7 @@ public virtual IPalette Target /// Gets the renderer to use for this palette. /// /// Renderer to use for drawing palette settings. - public virtual IRenderer GetRenderer() => _target.GetRenderer(); + public override IRenderer GetRenderer() => _target.GetRenderer(); #endregion @@ -103,7 +79,7 @@ public virtual IPalette Target /// Background style. /// Palette value should be applicable to this state. /// InheritBool value. - public virtual InheritBool GetBackDraw(PaletteBackStyle style, PaletteState state) => _target.GetBackDraw(style, state); + public override InheritBool GetBackDraw(PaletteBackStyle style, PaletteState state) => _target.GetBackDraw(style, state); /// /// Gets the graphics drawing hint for the background. @@ -111,7 +87,7 @@ public virtual IPalette Target /// Border style. /// Palette value should be applicable to this state. /// PaletteGraphicsHint value. - public virtual PaletteGraphicsHint GetBackGraphicsHint(PaletteBackStyle style, PaletteState state) => _target.GetBackGraphicsHint(style, state); + public override PaletteGraphicsHint GetBackGraphicsHint(PaletteBackStyle style, PaletteState state) => _target.GetBackGraphicsHint(style, state); /// /// Gets the first background color. @@ -119,7 +95,7 @@ public virtual IPalette Target /// Background style. /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetBackColor1(PaletteBackStyle style, PaletteState state) => _target.GetBackColor1(style, state); + public override Color GetBackColor1(PaletteBackStyle style, PaletteState state) => _target.GetBackColor1(style, state); /// /// Gets the second back color. @@ -127,7 +103,7 @@ public virtual IPalette Target /// Background style. /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetBackColor2(PaletteBackStyle style, PaletteState state) => _target.GetBackColor2(style, state); + public override Color GetBackColor2(PaletteBackStyle style, PaletteState state) => _target.GetBackColor2(style, state); /// /// Gets the color background drawing style. @@ -135,7 +111,7 @@ public virtual IPalette Target /// Background style. /// Palette value should be applicable to this state. /// Color drawing style. - public virtual PaletteColorStyle GetBackColorStyle(PaletteBackStyle style, PaletteState state) => _target.GetBackColorStyle(style, state); + public override PaletteColorStyle GetBackColorStyle(PaletteBackStyle style, PaletteState state) => _target.GetBackColorStyle(style, state); /// /// Gets the color alignment. @@ -143,7 +119,7 @@ public virtual IPalette Target /// Background style. /// Palette value should be applicable to this state. /// Color alignment style. - public virtual PaletteRectangleAlign GetBackColorAlign(PaletteBackStyle style, PaletteState state) => _target.GetBackColorAlign(style, state); + public override PaletteRectangleAlign GetBackColorAlign(PaletteBackStyle style, PaletteState state) => _target.GetBackColorAlign(style, state); /// /// Gets the color background angle. @@ -151,7 +127,7 @@ public virtual IPalette Target /// Background style. /// Palette value should be applicable to this state. /// Angle used for color drawing. - public virtual float GetBackColorAngle(PaletteBackStyle style, PaletteState state) => _target.GetBackColorAngle(style, state); + public override float GetBackColorAngle(PaletteBackStyle style, PaletteState state) => _target.GetBackColorAngle(style, state); /// /// Gets a background image. @@ -159,7 +135,7 @@ public virtual IPalette Target /// Background style. /// Palette value should be applicable to this state. /// Image instance. - public virtual Image GetBackImage(PaletteBackStyle style, PaletteState state) => _target.GetBackImage(style, state); + public override Image GetBackImage(PaletteBackStyle style, PaletteState state) => _target.GetBackImage(style, state); /// /// Gets the background image style. @@ -167,7 +143,7 @@ public virtual IPalette Target /// Background style. /// Palette value should be applicable to this state. /// Image style value. - public virtual PaletteImageStyle GetBackImageStyle(PaletteBackStyle style, PaletteState state) => _target.GetBackImageStyle(style, state); + public override PaletteImageStyle GetBackImageStyle(PaletteBackStyle style, PaletteState state) => _target.GetBackImageStyle(style, state); /// /// Gets the image alignment. @@ -175,7 +151,7 @@ public virtual IPalette Target /// Background style. /// Palette value should be applicable to this state. /// Image alignment style. - public virtual PaletteRectangleAlign GetBackImageAlign(PaletteBackStyle style, PaletteState state) => _target.GetBackImageAlign(style, state); + public override PaletteRectangleAlign GetBackImageAlign(PaletteBackStyle style, PaletteState state) => _target.GetBackImageAlign(style, state); #endregion @@ -186,7 +162,7 @@ public virtual IPalette Target /// Border style. /// Palette value should be applicable to this state. /// InheritBool value. - public virtual InheritBool GetBorderDraw(PaletteBorderStyle style, PaletteState state) => _target.GetBorderDraw(style, state); + public override InheritBool GetBorderDraw(PaletteBorderStyle style, PaletteState state) => _target.GetBorderDraw(style, state); /// /// Gets a value indicating which borders to draw. @@ -194,7 +170,7 @@ public virtual IPalette Target /// Border style. /// Palette value should be applicable to this state. /// PaletteDrawBorders value. - public virtual PaletteDrawBorders GetBorderDrawBorders(PaletteBorderStyle style, PaletteState state) => _target.GetBorderDrawBorders(style, state); + public override PaletteDrawBorders GetBorderDrawBorders(PaletteBorderStyle style, PaletteState state) => _target.GetBorderDrawBorders(style, state); /// /// Gets the graphics drawing hint for the border. @@ -202,7 +178,7 @@ public virtual IPalette Target /// Border style. /// Palette value should be applicable to this state. /// PaletteGraphicsHint value. - public virtual PaletteGraphicsHint GetBorderGraphicsHint(PaletteBorderStyle style, PaletteState state) => _target.GetBorderGraphicsHint(style, state); + public override PaletteGraphicsHint GetBorderGraphicsHint(PaletteBorderStyle style, PaletteState state) => _target.GetBorderGraphicsHint(style, state); /// /// Gets the first border color. @@ -210,7 +186,7 @@ public virtual IPalette Target /// Border style. /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetBorderColor1(PaletteBorderStyle style, PaletteState state) => _target.GetBorderColor1(style, state); + public override Color GetBorderColor1(PaletteBorderStyle style, PaletteState state) => _target.GetBorderColor1(style, state); /// /// Gets the second border color. @@ -218,7 +194,7 @@ public virtual IPalette Target /// Border style. /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetBorderColor2(PaletteBorderStyle style, PaletteState state) => _target.GetBorderColor2(style, state); + public override Color GetBorderColor2(PaletteBorderStyle style, PaletteState state) => _target.GetBorderColor2(style, state); /// /// Gets the color border drawing style. @@ -226,7 +202,7 @@ public virtual IPalette Target /// Border style. /// Palette value should be applicable to this state. /// Color drawing style. - public virtual PaletteColorStyle GetBorderColorStyle(PaletteBorderStyle style, PaletteState state) => _target.GetBorderColorStyle(style, state); + public override PaletteColorStyle GetBorderColorStyle(PaletteBorderStyle style, PaletteState state) => _target.GetBorderColorStyle(style, state); /// /// Gets the color border alignment. @@ -234,7 +210,7 @@ public virtual IPalette Target /// Border style. /// Palette value should be applicable to this state. /// Color alignment style. - public virtual PaletteRectangleAlign GetBorderColorAlign(PaletteBorderStyle style, PaletteState state) => _target.GetBorderColorAlign(style, state); + public override PaletteRectangleAlign GetBorderColorAlign(PaletteBorderStyle style, PaletteState state) => _target.GetBorderColorAlign(style, state); /// /// Gets the color border angle. @@ -242,7 +218,7 @@ public virtual IPalette Target /// Border style. /// Palette value should be applicable to this state. /// Angle used for color drawing. - public virtual float GetBorderColorAngle(PaletteBorderStyle style, PaletteState state) => _target.GetBorderColorAngle(style, state); + public override float GetBorderColorAngle(PaletteBorderStyle style, PaletteState state) => _target.GetBorderColorAngle(style, state); /// /// Gets the border width. @@ -250,7 +226,7 @@ public virtual IPalette Target /// Border style. /// Palette value should be applicable to this state. /// Integer width. - public virtual int GetBorderWidth(PaletteBorderStyle style, PaletteState state) => _target.GetBorderWidth(style, state); + public override int GetBorderWidth(PaletteBorderStyle style, PaletteState state) => _target.GetBorderWidth(style, state); /// /// Gets the border corner rounding. @@ -258,7 +234,7 @@ public virtual IPalette Target /// Border style. /// Palette value should be applicable to this state. /// Float rounding. - public virtual float GetBorderRounding(PaletteBorderStyle style, PaletteState state) => _target.GetBorderRounding(style, state); + public override float GetBorderRounding(PaletteBorderStyle style, PaletteState state) => _target.GetBorderRounding(style, state); /// /// Gets a border image. @@ -266,7 +242,7 @@ public virtual IPalette Target /// Border style. /// Palette value should be applicable to this state. /// Image instance. - public virtual Image GetBorderImage(PaletteBorderStyle style, PaletteState state) => _target.GetBorderImage(style, state); + public override Image GetBorderImage(PaletteBorderStyle style, PaletteState state) => _target.GetBorderImage(style, state); /// /// Gets the border image style. @@ -274,7 +250,7 @@ public virtual IPalette Target /// Border style. /// Palette value should be applicable to this state. /// Image style value. - public virtual PaletteImageStyle GetBorderImageStyle(PaletteBorderStyle style, PaletteState state) => _target.GetBorderImageStyle(style, state); + public override PaletteImageStyle GetBorderImageStyle(PaletteBorderStyle style, PaletteState state) => _target.GetBorderImageStyle(style, state); /// /// Gets the image border alignment. @@ -282,7 +258,7 @@ public virtual IPalette Target /// Border style. /// Palette value should be applicable to this state. /// Image alignment style. - public virtual PaletteRectangleAlign GetBorderImageAlign(PaletteBorderStyle style, PaletteState state) => _target.GetBorderImageAlign(style, state); + public override PaletteRectangleAlign GetBorderImageAlign(PaletteBorderStyle style, PaletteState state) => _target.GetBorderImageAlign(style, state); #endregion #region Content @@ -292,7 +268,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// InheritBool value. - public virtual InheritBool GetContentDraw(PaletteContentStyle style, PaletteState state) => _target.GetContentDraw(style, state); + public override InheritBool GetContentDraw(PaletteContentStyle style, PaletteState state) => _target.GetContentDraw(style, state); /// /// Gets a value indicating if content should be drawn with focus indication. @@ -300,7 +276,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// InheritBool value. - public virtual InheritBool GetContentDrawFocus(PaletteContentStyle style, PaletteState state) => _target.GetContentDrawFocus(style, state); + public override InheritBool GetContentDrawFocus(PaletteContentStyle style, PaletteState state) => _target.GetContentDrawFocus(style, state); /// /// Gets the horizontal relative alignment of the image. @@ -308,7 +284,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// RelativeAlignment value. - public virtual PaletteRelativeAlign GetContentImageH(PaletteContentStyle style, PaletteState state) => _target.GetContentImageH(style, state); + public override PaletteRelativeAlign GetContentImageH(PaletteContentStyle style, PaletteState state) => _target.GetContentImageH(style, state); /// /// Gets the vertical relative alignment of the image. @@ -316,7 +292,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// RelativeAlignment value. - public virtual PaletteRelativeAlign GetContentImageV(PaletteContentStyle style, PaletteState state) => _target.GetContentImageV(style, state); + public override PaletteRelativeAlign GetContentImageV(PaletteContentStyle style, PaletteState state) => _target.GetContentImageV(style, state); /// /// Gets the effect applied to drawing of the image. @@ -324,7 +300,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// PaletteImageEffect value. - public virtual PaletteImageEffect GetContentImageEffect(PaletteContentStyle style, PaletteState state) => _target.GetContentImageEffect(style, state); + public override PaletteImageEffect GetContentImageEffect(PaletteContentStyle style, PaletteState state) => _target.GetContentImageEffect(style, state); /// /// Gets the image color to remap into another color. @@ -332,7 +308,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetContentImageColorMap(PaletteContentStyle style, PaletteState state) => _target.GetContentImageColorMap(style, state); + public override Color GetContentImageColorMap(PaletteContentStyle style, PaletteState state) => _target.GetContentImageColorMap(style, state); /// /// Gets the color to use in place of the image map color. @@ -340,7 +316,10 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetContentImageColorTo(PaletteContentStyle style, PaletteState state) => _target.GetContentImageColorTo(style, state); + public override Color GetContentImageColorTo(PaletteContentStyle style, PaletteState state) => _target.GetContentImageColorTo(style, state); + + /// + public override Color GetContentImageColorTransparent(PaletteContentStyle style, PaletteState state) => _target.GetContentImageColorTransparent(style, state); /// /// Gets the font for the short text. @@ -348,7 +327,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// Font value. - public virtual Font GetContentShortTextFont(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextFont(style, state); + public override Font GetContentShortTextFont(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextFont(style, state); /// /// Gets the font for the short text by generating a new font instance. @@ -356,7 +335,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// Font value. - public virtual Font GetContentShortTextNewFont(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextNewFont(style, state); + public override Font GetContentShortTextNewFont(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextNewFont(style, state); /// /// Gets the rendering hint for the short text. @@ -364,7 +343,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// PaletteTextHint value. - public virtual PaletteTextHint GetContentShortTextHint(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextHint(style, state); + public override PaletteTextHint GetContentShortTextHint(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextHint(style, state); /// /// Gets the prefix drawing setting for short text. @@ -372,7 +351,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// PaletteTextPrefix value. - public virtual PaletteTextHotkeyPrefix GetContentShortTextPrefix(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextPrefix(style, state); + public override PaletteTextHotkeyPrefix GetContentShortTextPrefix(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextPrefix(style, state); /// /// Gets the flag indicating if multiline text is allowed for short text. @@ -380,7 +359,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// InheritBool value. - public virtual InheritBool GetContentShortTextMultiLine(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextMultiLine(style, state); + public override InheritBool GetContentShortTextMultiLine(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextMultiLine(style, state); /// /// Gets the text trimming to use for short text. @@ -388,7 +367,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// PaletteTextTrim value. - public virtual PaletteTextTrim GetContentShortTextTrim(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextTrim(style, state); + public override PaletteTextTrim GetContentShortTextTrim(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextTrim(style, state); /// /// Gets the horizontal relative alignment of the short text. @@ -396,7 +375,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// RelativeAlignment value. - public virtual PaletteRelativeAlign GetContentShortTextH(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextH(style, state); + public override PaletteRelativeAlign GetContentShortTextH(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextH(style, state); /// /// Gets the vertical relative alignment of the short text. @@ -404,7 +383,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// RelativeAlignment value. - public virtual PaletteRelativeAlign GetContentShortTextV(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextV(style, state); + public override PaletteRelativeAlign GetContentShortTextV(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextV(style, state); /// /// Gets the horizontal relative alignment of multiline short text. @@ -412,7 +391,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// RelativeAlignment value. - public virtual PaletteRelativeAlign GetContentShortTextMultiLineH(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextMultiLineH(style, state); + public override PaletteRelativeAlign GetContentShortTextMultiLineH(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextMultiLineH(style, state); /// /// Gets the first back color for the short text. @@ -420,7 +399,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetContentShortTextColor1(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextColor1(style, state); + public override Color GetContentShortTextColor1(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextColor1(style, state); /// /// Gets the second back color for the short text. @@ -428,7 +407,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetContentShortTextColor2(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextColor2(style, state); + public override Color GetContentShortTextColor2(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextColor2(style, state); /// /// Gets the color drawing style for the short text. @@ -436,7 +415,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// Color drawing style. - public virtual PaletteColorStyle GetContentShortTextColorStyle(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextColorStyle(style, state); + public override PaletteColorStyle GetContentShortTextColorStyle(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextColorStyle(style, state); /// /// Gets the color alignment for the short text. @@ -444,7 +423,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// Color alignment style. - public virtual PaletteRectangleAlign GetContentShortTextColorAlign(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextColorAlign(style, state); + public override PaletteRectangleAlign GetContentShortTextColorAlign(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextColorAlign(style, state); /// /// Gets the color background angle for the short text. @@ -452,7 +431,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// Angle used for color drawing. - public virtual float GetContentShortTextColorAngle(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextColorAngle(style, state); + public override float GetContentShortTextColorAngle(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextColorAngle(style, state); /// /// Gets a background image for the short text. @@ -460,7 +439,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// Image instance. - public virtual Image GetContentShortTextImage(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextImage(style, state); + public override Image GetContentShortTextImage(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextImage(style, state); /// /// Gets the background image style. @@ -468,7 +447,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// Image style value. - public virtual PaletteImageStyle GetContentShortTextImageStyle(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextImageStyle(style, state); + public override PaletteImageStyle GetContentShortTextImageStyle(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextImageStyle(style, state); /// /// Gets the image alignment for the short text. @@ -476,7 +455,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// Image alignment style. - public virtual PaletteRectangleAlign GetContentShortTextImageAlign(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextImageAlign(style, state); + public override PaletteRectangleAlign GetContentShortTextImageAlign(PaletteContentStyle style, PaletteState state) => _target.GetContentShortTextImageAlign(style, state); /// /// Gets the font for the long text. @@ -484,7 +463,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// Font value. - public virtual Font GetContentLongTextFont(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextFont(style, state); + public override Font GetContentLongTextFont(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextFont(style, state); /// /// Gets the font for the long text by generating a new font instance. @@ -492,7 +471,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// Font value. - public virtual Font GetContentLongTextNewFont(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextNewFont(style, state); + public override Font GetContentLongTextNewFont(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextNewFont(style, state); /// /// Gets the rendering hint for the long text. @@ -500,7 +479,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// PaletteTextHint value. - public virtual PaletteTextHint GetContentLongTextHint(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextHint(style, state); + public override PaletteTextHint GetContentLongTextHint(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextHint(style, state); /// /// Gets the flag indicating if multiline text is allowed for long text. @@ -508,7 +487,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// InheritBool value. - public virtual InheritBool GetContentLongTextMultiLine(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextMultiLine(style, state); + public override InheritBool GetContentLongTextMultiLine(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextMultiLine(style, state); /// /// Gets the text trimming to use for long text. @@ -516,7 +495,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// PaletteTextTrim value. - public virtual PaletteTextTrim GetContentLongTextTrim(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextTrim(style, state); + public override PaletteTextTrim GetContentLongTextTrim(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextTrim(style, state); /// /// Gets the prefix drawing setting for long text. @@ -524,7 +503,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// PaletteTextPrefix value. - public virtual PaletteTextHotkeyPrefix GetContentLongTextPrefix(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextPrefix(style, state); + public override PaletteTextHotkeyPrefix GetContentLongTextPrefix(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextPrefix(style, state); /// /// Gets the horizontal relative alignment of the long text. @@ -532,7 +511,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// RelativeAlignment value. - public virtual PaletteRelativeAlign GetContentLongTextH(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextH(style, state); + public override PaletteRelativeAlign GetContentLongTextH(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextH(style, state); /// /// Gets the vertical relative alignment of the long text. @@ -540,7 +519,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// RelativeAlignment value. - public virtual PaletteRelativeAlign GetContentLongTextV(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextV(style, state); + public override PaletteRelativeAlign GetContentLongTextV(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextV(style, state); /// /// Gets the horizontal relative alignment of multiline long text. @@ -548,7 +527,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// RelativeAlignment value. - public virtual PaletteRelativeAlign GetContentLongTextMultiLineH(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextMultiLineH(style, state); + public override PaletteRelativeAlign GetContentLongTextMultiLineH(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextMultiLineH(style, state); /// /// Gets the first back color for the long text. @@ -556,7 +535,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetContentLongTextColor1(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextColor1(style, state); + public override Color GetContentLongTextColor1(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextColor1(style, state); /// /// Gets the second back color for the long text. @@ -564,7 +543,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetContentLongTextColor2(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextColor2(style, state); + public override Color GetContentLongTextColor2(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextColor2(style, state); /// /// Gets the color drawing style for the long text. @@ -572,7 +551,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// Color drawing style. - public virtual PaletteColorStyle GetContentLongTextColorStyle(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextColorStyle(style, state); + public override PaletteColorStyle GetContentLongTextColorStyle(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextColorStyle(style, state); /// /// Gets the color alignment for the long text. @@ -580,7 +559,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// Color alignment style. - public virtual PaletteRectangleAlign GetContentLongTextColorAlign(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextColorAlign(style, state); + public override PaletteRectangleAlign GetContentLongTextColorAlign(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextColorAlign(style, state); /// /// Gets the color background angle for the long text. @@ -588,7 +567,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// Angle used for color drawing. - public virtual float GetContentLongTextColorAngle(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextColorAngle(style, state); + public override float GetContentLongTextColorAngle(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextColorAngle(style, state); /// /// Gets a background image for the long text. @@ -596,7 +575,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// Image instance. - public virtual Image GetContentLongTextImage(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextImage(style, state); + public override Image GetContentLongTextImage(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextImage(style, state); /// /// Gets the background image style for the long text. @@ -604,7 +583,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// Image style value. - public virtual PaletteImageStyle GetContentLongTextImageStyle(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextImageStyle(style, state); + public override PaletteImageStyle GetContentLongTextImageStyle(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextImageStyle(style, state); /// /// Gets the image alignment for the long text. @@ -612,7 +591,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// Image alignment style. - public virtual PaletteRectangleAlign GetContentLongTextImageAlign(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextImageAlign(style, state); + public override PaletteRectangleAlign GetContentLongTextImageAlign(PaletteContentStyle style, PaletteState state) => _target.GetContentLongTextImageAlign(style, state); /// /// Gets the padding between the border and content drawing. @@ -620,7 +599,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// Padding value. - public virtual Padding GetContentPadding(PaletteContentStyle style, PaletteState state) => _target.GetContentPadding(style, state); + public override Padding GetContentPadding(PaletteContentStyle style, PaletteState state) => _target.GetContentPadding(style, state); /// /// Gets the padding between adjacent content items. @@ -628,7 +607,7 @@ public virtual IPalette Target /// Content style. /// Palette value should be applicable to this state. /// Integer value. - public virtual int GetContentAdjacentGap(PaletteContentStyle style, PaletteState state) => _target.GetContentAdjacentGap(style, state); + public override int GetContentAdjacentGap(PaletteContentStyle style, PaletteState state) => _target.GetContentAdjacentGap(style, state); #endregion @@ -639,7 +618,7 @@ public virtual IPalette Target /// Palette value should be applicable to this state. /// Requested metric. /// Integer value. - public virtual int GetMetricInt(PaletteState state, PaletteMetricInt metric) => _target.GetMetricInt(state, metric); + public override int GetMetricInt(PaletteState state, PaletteMetricInt metric) => _target.GetMetricInt(state, metric); /// /// Gets a boolean metric value. @@ -647,7 +626,7 @@ public virtual IPalette Target /// Palette value should be applicable to this state. /// Requested metric. /// InheritBool value. - public virtual InheritBool GetMetricBool(PaletteState state, PaletteMetricBool metric) => _target.GetMetricBool(state, metric); + public override InheritBool GetMetricBool(PaletteState state, PaletteMetricBool metric) => _target.GetMetricBool(state, metric); /// /// Gets a padding metric value. @@ -655,7 +634,7 @@ public virtual IPalette Target /// Palette value should be applicable to this state. /// Requested metric. /// Padding value. - public virtual Padding GetMetricPadding(PaletteState state, PaletteMetricPadding metric) => _target.GetMetricPadding(state, metric); + public override Padding GetMetricPadding(PaletteState state, PaletteMetricPadding metric) => _target.GetMetricPadding(state, metric); #endregion @@ -665,7 +644,7 @@ public virtual IPalette Target /// /// Is the node expanded /// Appropriate image for drawing; otherwise null. - public virtual Image GetTreeViewImage(bool expanded) => _target.GetTreeViewImage(expanded); + public override Image GetTreeViewImage(bool expanded) => _target.GetTreeViewImage(expanded); /// /// Gets a check box image appropriate for the provided state. @@ -675,7 +654,7 @@ public virtual IPalette Target /// Is the check box being hot tracked. /// Is the check box being pressed. /// Appropriate image for drawing; otherwise null. - public virtual Image GetCheckBoxImage(bool enabled, CheckState checkState, bool tracking, bool pressed) => _target.GetCheckBoxImage(enabled, checkState, tracking, pressed); + public override Image GetCheckBoxImage(bool enabled, CheckState checkState, bool tracking, bool pressed) => _target.GetCheckBoxImage(enabled, checkState, tracking, pressed); /// /// Gets a check box image appropriate for the provided state. @@ -685,31 +664,31 @@ public virtual IPalette Target /// Is the radio button being hot tracked. /// Is the radio button being pressed. /// Appropriate image for drawing; otherwise null. - public virtual Image GetRadioButtonImage(bool enabled, bool checkState, bool tracking, bool pressed) => _target.GetRadioButtonImage(enabled, checkState, tracking, pressed); + public override Image GetRadioButtonImage(bool enabled, bool checkState, bool tracking, bool pressed) => _target.GetRadioButtonImage(enabled, checkState, tracking, pressed); /// /// Gets a drop down button image appropriate for the provided state. /// /// PaletteState for which image is required. - public virtual Image GetDropDownButtonImage(PaletteState state) => _target.GetDropDownButtonImage(state); + public override Image GetDropDownButtonImage(PaletteState state) => _target.GetDropDownButtonImage(state); /// /// Gets a checked image appropriate for a context menu item. /// /// Appropriate image for drawing; otherwise null. - public virtual Image GetContextMenuCheckedImage() => _target.GetContextMenuCheckedImage(); + public override Image GetContextMenuCheckedImage() => _target.GetContextMenuCheckedImage(); /// /// Gets a indeterminate image appropriate for a context menu item. /// /// Appropriate image for drawing; otherwise null. - public virtual Image GetContextMenuIndeterminateImage() => _target.GetContextMenuIndeterminateImage(); + public override Image GetContextMenuIndeterminateImage() => _target.GetContextMenuIndeterminateImage(); /// /// Gets an image indicating a sub-menu on a context menu item. /// /// Appropriate image for drawing; otherwise null. - public virtual Image GetContextMenuSubMenuImage() => _target.GetContextMenuSubMenuImage(); + public override Image GetContextMenuSubMenuImage() => _target.GetContextMenuSubMenuImage(); /// /// Gets a check box image appropriate for the provided state. @@ -717,7 +696,7 @@ public virtual IPalette Target /// Enum of the button to fetch. /// State of the button to fetch. /// Appropriate image for drawing; otherwise null. - public virtual Image GetGalleryButtonImage(PaletteRibbonGalleryButton button, PaletteState state) => _target.GetGalleryButtonImage(button, state); + public override Image GetGalleryButtonImage(PaletteRibbonGalleryButton button, PaletteState state) => _target.GetGalleryButtonImage(button, state); #endregion @@ -727,7 +706,7 @@ public virtual IPalette Target /// /// Style of button spec. /// Icon value. - public virtual Icon GetButtonSpecIcon(PaletteButtonSpecStyle style) => _target.GetButtonSpecIcon(style); + public override Icon GetButtonSpecIcon(PaletteButtonSpecStyle style) => _target.GetButtonSpecIcon(style); /// /// Gets the image to display for the button. @@ -735,7 +714,7 @@ public virtual IPalette Target /// Style of button spec. /// State for which image is required. /// Image value. - public virtual Image GetButtonSpecImage(PaletteButtonSpecStyle style, + public override Image GetButtonSpecImage(PaletteButtonSpecStyle style, PaletteState state) => _target.GetButtonSpecImage(style, state); @@ -744,63 +723,66 @@ public virtual Image GetButtonSpecImage(PaletteButtonSpecStyle style, /// /// Style of button spec. /// Color value. - public virtual Color GetButtonSpecImageTransparentColor(PaletteButtonSpecStyle style) => _target.GetButtonSpecImageTransparentColor(style); + public override Color GetButtonSpecImageTransparentColor(PaletteButtonSpecStyle style) => _target.GetButtonSpecImageTransparentColor(style); /// /// Gets the short text to display for the button. /// /// Style of button spec. /// String value. - public virtual string GetButtonSpecShortText(PaletteButtonSpecStyle style) => _target.GetButtonSpecShortText(style); + public override string GetButtonSpecShortText(PaletteButtonSpecStyle style) => _target.GetButtonSpecShortText(style); /// /// Gets the long text to display for the button. /// /// Style of button spec. /// String value. - public virtual string GetButtonSpecLongText(PaletteButtonSpecStyle style) => _target.GetButtonSpecLongText(style); + public override string GetButtonSpecLongText(PaletteButtonSpecStyle style) => _target.GetButtonSpecLongText(style); /// /// Gets the tooltip title text to display for the button. /// /// Style of button spec. /// String value. - public virtual string GetButtonSpecToolTipTitle(PaletteButtonSpecStyle style) => _target.GetButtonSpecToolTipTitle(style); + public override string GetButtonSpecToolTipTitle(PaletteButtonSpecStyle style) => _target.GetButtonSpecToolTipTitle(style); /// /// Gets the color to remap from the image to the container foreground. /// /// Style of button spec. /// Color value. - public virtual Color GetButtonSpecColorMap(PaletteButtonSpecStyle style) => _target.GetButtonSpecColorMap(style); + public override Color GetButtonSpecColorMap(PaletteButtonSpecStyle style) => _target.GetButtonSpecColorMap(style); + + /// + public override Color GetButtonSpecColorTransparent(PaletteButtonSpecStyle style) => _target.GetButtonSpecColorTransparent(style); /// /// Gets the button style used for drawing the button. /// /// Style of button spec. /// ButtonStyle value. - public virtual PaletteButtonStyle GetButtonSpecStyle(PaletteButtonSpecStyle style) => _target.GetButtonSpecStyle(style); + public override PaletteButtonStyle GetButtonSpecStyle(PaletteButtonSpecStyle style) => _target.GetButtonSpecStyle(style); /// /// Get the location for the button. /// /// Style of button spec. /// HeaderLocation value. - public virtual HeaderLocation GetButtonSpecLocation(PaletteButtonSpecStyle style) => _target.GetButtonSpecLocation(style); + public override HeaderLocation GetButtonSpecLocation(PaletteButtonSpecStyle style) => _target.GetButtonSpecLocation(style); /// /// Gets the edge to position the button against. /// /// Style of button spec. /// PaletteRelativeEdgeAlign value. - public virtual PaletteRelativeEdgeAlign GetButtonSpecEdge(PaletteButtonSpecStyle style) => _target.GetButtonSpecEdge(style); + public override PaletteRelativeEdgeAlign GetButtonSpecEdge(PaletteButtonSpecStyle style) => _target.GetButtonSpecEdge(style); /// /// Gets the button orientation. /// /// Style of button spec. /// PaletteButtonOrientation value. - public virtual PaletteButtonOrientation GetButtonSpecOrientation(PaletteButtonSpecStyle style) => _target.GetButtonSpecOrientation(style); + public override PaletteButtonOrientation GetButtonSpecOrientation(PaletteButtonSpecStyle style) => _target.GetButtonSpecOrientation(style); #endregion @@ -809,140 +791,140 @@ public virtual Image GetButtonSpecImage(PaletteButtonSpecStyle style, /// Gets the ribbon shape that should be used. /// /// Ribbon shape value. - public virtual PaletteRibbonShape GetRibbonShape() => _target.GetRibbonShape(); + public override PaletteRibbonShape GetRibbonShape() => _target.GetRibbonShape(); /// /// Gets the text alignment for the ribbon context text. /// /// Palette value should be applicable to this state. /// Font value. - public virtual PaletteRelativeAlign GetRibbonContextTextAlign(PaletteState state) => _target.GetRibbonContextTextAlign(state); + public override PaletteRelativeAlign GetRibbonContextTextAlign(PaletteState state) => _target.GetRibbonContextTextAlign(state); /// /// Gets the font for the ribbon context text. /// /// Palette value should be applicable to this state. /// Font value. - public virtual Font GetRibbonContextTextFont(PaletteState state) => _target.GetRibbonContextTextFont(state); + public override Font GetRibbonContextTextFont(PaletteState state) => _target.GetRibbonContextTextFont(state); /// /// Gets the color for the ribbon context text. /// /// Palette value should be applicable to this state. /// Font value. - public virtual Color GetRibbonContextTextColor(PaletteState state) => _target.GetRibbonContextTextColor(state); + public override Color GetRibbonContextTextColor(PaletteState state) => _target.GetRibbonContextTextColor(state); /// /// Gets the dark disabled color used for ribbon glyphs. /// /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetRibbonDisabledDark(PaletteState state) => _target.GetRibbonDisabledDark(state); + public override Color GetRibbonDisabledDark(PaletteState state) => _target.GetRibbonDisabledDark(state); /// /// Gets the light disabled color used for ribbon glyphs. /// /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetRibbonDisabledLight(PaletteState state) => _target.GetRibbonDisabledLight(state); + public override Color GetRibbonDisabledLight(PaletteState state) => _target.GetRibbonDisabledLight(state); /// /// Gets the color for the drop arrow light. /// /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetRibbonDropArrowLight(PaletteState state) => _target.GetRibbonDropArrowLight(state); + public override Color GetRibbonDropArrowLight(PaletteState state) => _target.GetRibbonDropArrowLight(state); /// /// Gets the color for the drop arrow dark. /// /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetRibbonDropArrowDark(PaletteState state) => _target.GetRibbonDropArrowDark(state); + public override Color GetRibbonDropArrowDark(PaletteState state) => _target.GetRibbonDropArrowDark(state); /// /// Gets the color for the dialog launcher dark. /// /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetRibbonGroupDialogDark(PaletteState state) => _target.GetRibbonGroupDialogDark(state); + public override Color GetRibbonGroupDialogDark(PaletteState state) => _target.GetRibbonGroupDialogDark(state); /// /// Gets the color for the dialog launcher light. /// /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetRibbonGroupDialogLight(PaletteState state) => _target.GetRibbonGroupDialogLight(state); + public override Color GetRibbonGroupDialogLight(PaletteState state) => _target.GetRibbonGroupDialogLight(state); /// /// Gets the color for the group separator dark. /// /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetRibbonGroupSeparatorDark(PaletteState state) => _target.GetRibbonGroupSeparatorDark(state); + public override Color GetRibbonGroupSeparatorDark(PaletteState state) => _target.GetRibbonGroupSeparatorDark(state); /// /// Gets the color for the group separator light. /// /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetRibbonGroupSeparatorLight(PaletteState state) => _target.GetRibbonGroupSeparatorLight(state); + public override Color GetRibbonGroupSeparatorLight(PaletteState state) => _target.GetRibbonGroupSeparatorLight(state); /// /// Gets the color for the minimize bar dark. /// /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetRibbonMinimizeBarDark(PaletteState state) => _target.GetRibbonMinimizeBarDark(state); + public override Color GetRibbonMinimizeBarDark(PaletteState state) => _target.GetRibbonMinimizeBarDark(state); /// /// Gets the color for the minimize bar light. /// /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetRibbonMinimizeBarLight(PaletteState state) => _target.GetRibbonMinimizeBarLight(state); + public override Color GetRibbonMinimizeBarLight(PaletteState state) => _target.GetRibbonMinimizeBarLight(state); /// /// Gets the color for the tab separator. /// /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetRibbonTabSeparatorColor(PaletteState state) => _target.GetRibbonTabSeparatorColor(state); + public override Color GetRibbonTabSeparatorColor(PaletteState state) => _target.GetRibbonTabSeparatorColor(state); /// /// Gets the color for the tab context separators. /// /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetRibbonTabSeparatorContextColor(PaletteState state) => _target.GetRibbonTabSeparatorContextColor(state); + public override Color GetRibbonTabSeparatorContextColor(PaletteState state) => _target.GetRibbonTabSeparatorContextColor(state); /// /// Gets the font for the ribbon text. /// /// Palette value should be applicable to this state. /// Font value. - public virtual Font GetRibbonTextFont(PaletteState state) => _target.GetRibbonTextFont(state); + public override Font GetRibbonTextFont(PaletteState state) => _target.GetRibbonTextFont(state); /// /// Gets the rendering hint for the ribbon font. /// /// Palette value should be applicable to this state. /// PaletteTextHint value. - public virtual PaletteTextHint GetRibbonTextHint(PaletteState state) => _target.GetRibbonTextHint(state); + public override PaletteTextHint GetRibbonTextHint(PaletteState state) => _target.GetRibbonTextHint(state); /// /// Gets the color for the extra QAT button dark content color. /// /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetRibbonQATButtonDark(PaletteState state) => _target.GetRibbonQATButtonDark(state); + public override Color GetRibbonQATButtonDark(PaletteState state) => _target.GetRibbonQATButtonDark(state); /// /// Gets the color for the extra QAT button light content color. /// /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetRibbonQATButtonLight(PaletteState state) => _target.GetRibbonQATButtonLight(state); + public override Color GetRibbonQATButtonLight(PaletteState state) => _target.GetRibbonQATButtonLight(state); #endregion @@ -953,7 +935,7 @@ public virtual Image GetButtonSpecImage(PaletteButtonSpecStyle style, /// Background style. /// Palette value should be applicable to this state. /// PaletteRibbonBackStyle value. - public virtual PaletteRibbonColorStyle GetRibbonBackColorStyle(PaletteRibbonBackStyle style, PaletteState state) => _target.GetRibbonBackColorStyle(style, state); + public override PaletteRibbonColorStyle GetRibbonBackColorStyle(PaletteRibbonBackStyle style, PaletteState state) => _target.GetRibbonBackColorStyle(style, state); /// /// Gets the first background color for the ribbon item. @@ -961,7 +943,7 @@ public virtual Image GetButtonSpecImage(PaletteButtonSpecStyle style, /// Background style. /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetRibbonBackColor1(PaletteRibbonBackStyle style, PaletteState state) => _target.GetRibbonBackColor1(style, state); + public override Color GetRibbonBackColor1(PaletteRibbonBackStyle style, PaletteState state) => _target.GetRibbonBackColor1(style, state); /// /// Gets the second background color for the ribbon item. @@ -969,7 +951,7 @@ public virtual Image GetButtonSpecImage(PaletteButtonSpecStyle style, /// Background style. /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetRibbonBackColor2(PaletteRibbonBackStyle style, PaletteState state) => _target.GetRibbonBackColor2(style, state); + public override Color GetRibbonBackColor2(PaletteRibbonBackStyle style, PaletteState state) => _target.GetRibbonBackColor2(style, state); /// /// Gets the third background color for the ribbon item. @@ -977,7 +959,7 @@ public virtual Image GetButtonSpecImage(PaletteButtonSpecStyle style, /// Background style. /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetRibbonBackColor3(PaletteRibbonBackStyle style, PaletteState state) => _target.GetRibbonBackColor3(style, state); + public override Color GetRibbonBackColor3(PaletteRibbonBackStyle style, PaletteState state) => _target.GetRibbonBackColor3(style, state); /// /// Gets the fourth background color for the ribbon item. @@ -985,7 +967,7 @@ public virtual Image GetButtonSpecImage(PaletteButtonSpecStyle style, /// Background style. /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetRibbonBackColor4(PaletteRibbonBackStyle style, PaletteState state) => _target.GetRibbonBackColor4(style, state); + public override Color GetRibbonBackColor4(PaletteRibbonBackStyle style, PaletteState state) => _target.GetRibbonBackColor4(style, state); /// /// Gets the fifth background color for the ribbon item. @@ -993,7 +975,7 @@ public virtual Image GetButtonSpecImage(PaletteButtonSpecStyle style, /// Background style. /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetRibbonBackColor5(PaletteRibbonBackStyle style, PaletteState state) => _target.GetRibbonBackColor5(style, state); + public override Color GetRibbonBackColor5(PaletteRibbonBackStyle style, PaletteState state) => _target.GetRibbonBackColor5(style, state); #endregion @@ -1004,7 +986,7 @@ public virtual Image GetButtonSpecImage(PaletteButtonSpecStyle style, /// Text style. /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetRibbonTextColor(PaletteRibbonTextStyle style, PaletteState state) => _target.GetRibbonTextColor(style, state); + public override Color GetRibbonTextColor(PaletteRibbonTextStyle style, PaletteState state) => _target.GetRibbonTextColor(style, state); #endregion @@ -1015,7 +997,7 @@ public virtual Image GetButtonSpecImage(PaletteButtonSpecStyle style, /// Element for which color is required. /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetElementColor1(PaletteElement element, PaletteState state) => _target.GetElementColor1(element, state); + public override Color GetElementColor1(PaletteElement element, PaletteState state) => _target.GetElementColor1(element, state); /// /// Gets the second element color. @@ -1023,7 +1005,7 @@ public virtual Image GetButtonSpecImage(PaletteButtonSpecStyle style, /// Element for which color is required. /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetElementColor2(PaletteElement element, PaletteState state) => _target.GetElementColor2(element, state); + public override Color GetElementColor2(PaletteElement element, PaletteState state) => _target.GetElementColor2(element, state); /// /// Gets the third element color. @@ -1031,7 +1013,7 @@ public virtual Image GetButtonSpecImage(PaletteButtonSpecStyle style, /// Element for which color is required. /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetElementColor3(PaletteElement element, PaletteState state) => _target.GetElementColor3(element, state); + public override Color GetElementColor3(PaletteElement element, PaletteState state) => _target.GetElementColor3(element, state); /// /// Gets the fourth element color. @@ -1039,7 +1021,7 @@ public virtual Image GetButtonSpecImage(PaletteButtonSpecStyle style, /// Element for which color is required. /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetElementColor4(PaletteElement element, PaletteState state) => _target.GetElementColor4(element, state); + public override Color GetElementColor4(PaletteElement element, PaletteState state) => _target.GetElementColor4(element, state); /// /// Gets the fifth element color. @@ -1047,7 +1029,7 @@ public virtual Image GetButtonSpecImage(PaletteButtonSpecStyle style, /// Element for which color is required. /// Palette value should be applicable to this state. /// Color value. - public virtual Color GetElementColor5(PaletteElement element, PaletteState state) => _target.GetElementColor5(element, state); + public override Color GetElementColor5(PaletteElement element, PaletteState state) => _target.GetElementColor5(element, state); #endregion @@ -1056,108 +1038,70 @@ public virtual Image GetButtonSpecImage(PaletteButtonSpecStyle style, /// Gets the feedback drawing method used. /// /// Feedback enumeration value. - public virtual PaletteDragFeedback GetDragDropFeedback() => _target.GetDragDropFeedback(); + public override PaletteDragFeedback GetDragDropFeedback() => _target.GetDragDropFeedback(); /// /// Gets the background color for a solid drag drop area. /// /// Color value. - public virtual Color GetDragDropSolidBack() => _target.GetDragDropSolidBack(); + public override Color GetDragDropSolidBack() => _target.GetDragDropSolidBack(); /// /// Gets the border color for a solid drag drop area. /// /// Color value. - public virtual Color GetDragDropSolidBorder() => _target.GetDragDropSolidBack(); + public override Color GetDragDropSolidBorder() => _target.GetDragDropSolidBack(); /// /// Gets the opacity of the solid area. /// /// Opacity ranging from 0 to 1. - public virtual float GetDragDropSolidOpacity() => _target.GetDragDropSolidOpacity(); + public override float GetDragDropSolidOpacity() => _target.GetDragDropSolidOpacity(); /// /// Gets the background color for the docking indicators area. /// /// Color value. - public virtual Color GetDragDropDockBack() => _target.GetDragDropDockBack(); + public override Color GetDragDropDockBack() => _target.GetDragDropDockBack(); /// /// Gets the border color for the docking indicators area. /// /// Color value. - public virtual Color GetDragDropDockBorder() => _target.GetDragDropDockBorder(); + public override Color GetDragDropDockBorder() => _target.GetDragDropDockBorder(); /// /// Gets the active color for docking indicators. /// /// Color value. - public virtual Color GetDragDropDockActive() => _target.GetDragDropDockActive(); + public override Color GetDragDropDockActive() => _target.GetDragDropDockActive(); /// /// Gets the inactive color for docking indicators. /// /// Color value. - public virtual Color GetDragDropDockInactive() => _target.GetDragDropDockInactive(); + public override Color GetDragDropDockInactive() => _target.GetDragDropDockInactive(); #endregion #region ColorTable - /// - /// Gets access to the color table instance. - /// - public virtual KryptonColorTable ColorTable => _target.ColorTable; - #endregion - - #region OnPalettePaint - /// - /// Raises the PalettePaint event. - /// - /// Source of the event. - /// An PaletteLayoutEventArgs containing event data. - protected virtual void OnPalettePaint(object sender, PaletteLayoutEventArgs e) => PalettePaint?.Invoke(this, e); - - #endregion - - #region OnAllowFormChromeChanged - /// - /// Raises the AllowFormChromeChanged event. - /// - /// Source of the event. - /// An EventArgs containing event data. - protected virtual void OnAllowFormChromeChanged(object sender, EventArgs e) => AllowFormChromeChanged?.Invoke(this, e); - - #endregion - - #region OnBasePaletteChanged - /// - /// Raises the BasePaletteChanged event. - /// - /// Source of the event. - /// An EventArgs containing event data. - protected virtual void OnBasePaletteChanged(object sender, EventArgs e) => BasePaletteChanged?.Invoke(this, e); - - #endregion + /// + protected override void DefineFonts() + { + throw new NotImplementedException(); + } - #region OnBaseRendererChanged /// - /// Raises the BaseRendererChanged event. + /// Gets access to the color table instance. /// - /// Source of the event. - /// An EventArgs containing event data. - protected virtual void OnBaseRendererChanged(object sender, EventArgs e) => BaseRendererChanged?.Invoke(this, e); + public override KryptonColorTable ColorTable => _target.ColorTable; #endregion - #region OnButtonSpecChanged - /// - /// Raises the ButtonSpecChanged event. - /// - /// Source of the event. - /// An EventArgs containing event data. - protected virtual void OnButtonSpecChanged(object sender, EventArgs e) => ButtonSpecChanged?.Invoke(this, e); - - #endregion + /// + [EditorBrowsable(EditorBrowsableState.Advanced)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public int Id { get; } } } diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectBack.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectBack.cs index eac4542fc..982c95798 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectBack.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectBack.cs @@ -34,7 +34,7 @@ public class PaletteRedirectBack : PaletteRedirect /// Initialize a new instance of the PaletteRedirectBack class. /// /// Initial palette target for redirection. - public PaletteRedirectBack(IPalette target) + public PaletteRedirectBack(PaletteBase target) : this(target, null, null, null, null, null, null, null, null, null) { } @@ -45,7 +45,7 @@ public PaletteRedirectBack(IPalette target) /// Initial palette target for redirection. /// Redirection for disabled state requests. /// Redirection for normal state requests. - public PaletteRedirectBack(IPalette target, + public PaletteRedirectBack(PaletteBase target, IPaletteBack disabled, IPaletteBack normal) : this(target, disabled, normal, null, null, null, null, null, null, null) @@ -65,7 +65,7 @@ public PaletteRedirectBack(IPalette target, /// Redirection for checked tracking state requests. /// Redirection for focus override state requests. /// Redirection for normal default override state requests. - public PaletteRedirectBack(IPalette target, + public PaletteRedirectBack(PaletteBase target, IPaletteBack disabled, IPaletteBack normal, IPaletteBack pressed, diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectBorder.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectBorder.cs index acca473fe..3d78b328d 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectBorder.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectBorder.cs @@ -34,7 +34,7 @@ public class PaletteRedirectBorder : PaletteRedirect /// Initialize a new instance of the PaletteRedirectBorder class. /// /// Initial palette target for redirection. - public PaletteRedirectBorder(IPalette target) + public PaletteRedirectBorder(PaletteBase target) : this(target, null, null, null, null, null, null, null, null, null) { } @@ -45,7 +45,7 @@ public PaletteRedirectBorder(IPalette target) /// Initial palette target for redirection. /// Redirection for disabled state requests. /// Redirection for normal state requests. - public PaletteRedirectBorder(IPalette target, + public PaletteRedirectBorder(PaletteBase target, IPaletteBorder disabled, IPaletteBorder normal) : this(target, disabled, normal, null, null, null, null, null, null, null) @@ -60,7 +60,7 @@ public PaletteRedirectBorder(IPalette target, /// Redirection for normal state requests. /// Redirection for pressed state requests. /// Redirection for tracking state requests. - public PaletteRedirectBorder(IPalette target, + public PaletteRedirectBorder(PaletteBase target, IPaletteBorder disabled, IPaletteBorder normal, IPaletteBorder pressed, @@ -82,7 +82,7 @@ public PaletteRedirectBorder(IPalette target, /// Redirection for checked tracking state requests. /// Redirection for focus override state requests. /// Redirection for normal default override state requests. - public PaletteRedirectBorder(IPalette target, + public PaletteRedirectBorder(PaletteBase target, IPaletteBorder disabled, IPaletteBorder normal, IPaletteBorder pressed, diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectBorderEdge.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectBorderEdge.cs index 72f50b622..949988eef 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectBorderEdge.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectBorderEdge.cs @@ -27,7 +27,7 @@ public class PaletteRedirectBorderEdge : PaletteRedirect /// Initialize a new instance of the PaletteRedirectBorderEdge class. /// /// Initial palette target for redirection. - public PaletteRedirectBorderEdge(IPalette target) + public PaletteRedirectBorderEdge(PaletteBase target) : this(target, null, null) { } @@ -38,7 +38,7 @@ public PaletteRedirectBorderEdge(IPalette target) /// Initial palette target for redirection. /// Redirection for disabled state requests. /// Redirection for normal state requests. - public PaletteRedirectBorderEdge(IPalette target, + public PaletteRedirectBorderEdge(PaletteBase target, PaletteBorderEdge disabled, PaletteBorderEdge normal) : base(target) diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectButtonSpec.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectButtonSpec.cs index e55274bd5..5aae13d19 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectButtonSpec.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectButtonSpec.cs @@ -27,7 +27,7 @@ public class PaletteRedirectButtonSpec : PaletteRedirect /// /// Initial palette target for redirection. /// Redirection button spec requests. - public PaletteRedirectButtonSpec(IPalette target, IPaletteButtonSpec inherit) + public PaletteRedirectButtonSpec(PaletteBase target, IPaletteButtonSpec inherit) : base(target) => _inherit = inherit; diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectContent.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectContent.cs index af9a6a332..1904c2a47 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectContent.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectContent.cs @@ -47,7 +47,7 @@ public PaletteRedirectContent() /// Initial palette target for redirection. /// Redirection for disabled state requests. /// Redirection for normal state requests. - public PaletteRedirectContent(IPalette target, + public PaletteRedirectContent(PaletteBase target, IPaletteContent disabled, IPaletteContent normal) : this(target, disabled, normal, null, null, null, null, null, null, null, null, null, null) @@ -70,7 +70,7 @@ public PaletteRedirectContent(IPalette target, /// Redirection for link visited override state requests. /// Redirection for link not visited override state requests. /// Redirection for link pressed override state requests. - public PaletteRedirectContent(IPalette target, + public PaletteRedirectContent(PaletteBase target, IPaletteContent disabled, IPaletteContent normal, IPaletteContent pressed, diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectDouble.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectDouble.cs index 54337b4c2..da988618d 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectDouble.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectDouble.cs @@ -42,7 +42,7 @@ public PaletteRedirectDouble() /// Initialize a new instance of the PaletteRedirectDouble class. /// /// Initial palette target for redirection. - public PaletteRedirectDouble(IPalette target) + public PaletteRedirectDouble(PaletteBase target) : this(target, null, null, null, null, null, null, null, null, null) { } @@ -53,7 +53,7 @@ public PaletteRedirectDouble(IPalette target) /// Initial palette target for redirection. /// Redirection for disabled state requests. /// Redirection for normal state requests. - public PaletteRedirectDouble(IPalette target, + public PaletteRedirectDouble(PaletteBase target, IPaletteDouble disabled, IPaletteDouble normal) : this(target, disabled, normal, null, null, null, null, null, null, null) @@ -68,7 +68,7 @@ public PaletteRedirectDouble(IPalette target, /// Redirection for normal state requests. /// Redirection for pressed state requests. /// Redirection for tracking state requests. - public PaletteRedirectDouble(IPalette target, + public PaletteRedirectDouble(PaletteBase target, IPaletteDouble disabled, IPaletteDouble normal, IPaletteDouble pressed, @@ -90,7 +90,7 @@ public PaletteRedirectDouble(IPalette target, /// Redirection for checked tracking state requests. /// Redirection for focus override state requests. /// Redirection for normal default override state requests. - public PaletteRedirectDouble(IPalette target, + public PaletteRedirectDouble(PaletteBase target, IPaletteDouble disabled, IPaletteDouble normal, IPaletteDouble pressed, diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectDoubleMetric.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectDoubleMetric.cs index 77013d5cd..f7f426907 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectDoubleMetric.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectDoubleMetric.cs @@ -29,7 +29,7 @@ public class PaletteRedirectDoubleMetric : PaletteRedirectDouble /// Initialize a new instance of the PaletteRedirectDoubleMetric class. /// /// Initial palette target for redirection. - public PaletteRedirectDoubleMetric(IPalette target) + public PaletteRedirectDoubleMetric(PaletteBase target) : this(target, null, null, null, null) { } @@ -42,7 +42,7 @@ public PaletteRedirectDoubleMetric(IPalette target) /// Redirection for disabled metric requests. /// Redirection for normal state requests. /// Redirection for normal metric requests. - public PaletteRedirectDoubleMetric(IPalette target, + public PaletteRedirectDoubleMetric(PaletteBase target, IPaletteDouble disabled, IPaletteMetric disableMetric, IPaletteDouble normal, IPaletteMetric normalMetric) : base(target, disabled, normal) diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectGrids.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectGrids.cs index 20ab80ea4..696de562f 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectGrids.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectGrids.cs @@ -27,7 +27,7 @@ public class PaletteRedirectGrids : PaletteRedirect /// /// Initial palette target for redirection. /// Grid reference for directing palette requests. - public PaletteRedirectGrids(IPalette target, KryptonPaletteGrid grid) + public PaletteRedirectGrids(PaletteBase target, KryptonPaletteGrid grid) : base(target) { Debug.Assert(grid != null); diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectMetric.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectMetric.cs index ffdb710dd..7c847db75 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectMetric.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectMetric.cs @@ -27,7 +27,7 @@ public class PaletteRedirectMetric : PaletteRedirect /// Initialize a new instance of the PaletteRedirectMetric class. /// /// Initial palette target for redirection. - public PaletteRedirectMetric(IPalette target) + public PaletteRedirectMetric(PaletteBase target) : this(target, null, null) { } @@ -38,7 +38,7 @@ public PaletteRedirectMetric(IPalette target) /// Initial palette target for redirection. /// Redirection for disabled metric requests. /// Redirection for normal metric requests. - public PaletteRedirectMetric(IPalette target, + public PaletteRedirectMetric(PaletteBase target, IPaletteMetric disableMetric, IPaletteMetric normalMetric) : base(target) diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectRibbonBack.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectRibbonBack.cs index 5563f3038..13aceaab3 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectRibbonBack.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectRibbonBack.cs @@ -31,7 +31,7 @@ public class PaletteRedirectRibbonBack : PaletteRedirect /// Initialize a new instance of the PaletteRedirectRibbonBack class. /// /// Initial palette target for redirection. - public PaletteRedirectRibbonBack(IPalette target) + public PaletteRedirectRibbonBack(PaletteBase target) : this(target, null, null, null, null, null, null) { } @@ -42,7 +42,7 @@ public PaletteRedirectRibbonBack(IPalette target) /// Initial palette target for redirection. /// Redirection for back disabled state requests. /// Redirection for back normal state requests. - public PaletteRedirectRibbonBack(IPalette target, + public PaletteRedirectRibbonBack(PaletteBase target, IPaletteRibbonBack disabledBack, IPaletteRibbonBack normalBack) : this(target, disabledBack, normalBack, null, null, null, null) @@ -59,7 +59,7 @@ public PaletteRedirectRibbonBack(IPalette target, /// Redirection for back tracking state requests. /// Redirection for selected states requests. /// Redirection for back focus override state requests. - public PaletteRedirectRibbonBack(IPalette target, + public PaletteRedirectRibbonBack(PaletteBase target, IPaletteRibbonBack disabledBack, IPaletteRibbonBack normalBack, IPaletteRibbonBack pressedBack, diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectRibbonDouble.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectRibbonDouble.cs index 5847feaae..a14505aca 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectRibbonDouble.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectRibbonDouble.cs @@ -37,7 +37,7 @@ public class PaletteRedirectRibbonDouble : PaletteRedirect /// Initialize a new instance of the PaletteRedirectRibbonDouble class. /// /// Initial palette target for redirection. - public PaletteRedirectRibbonDouble(IPalette target) + public PaletteRedirectRibbonDouble(PaletteBase target) : this(target, null, null, null, null, null, null, null, null, null, null, null, null) @@ -60,7 +60,7 @@ public PaletteRedirectRibbonDouble(IPalette target) /// Redirection for text tracking state requests. /// Redirection for text selected states requests. /// Redirection for text focus override state requests. - public PaletteRedirectRibbonDouble(IPalette target, + public PaletteRedirectRibbonDouble(PaletteBase target, IPaletteRibbonBack disabledBack, IPaletteRibbonBack normalBack, IPaletteRibbonBack pressedBack, diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectRibbonGeneral.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectRibbonGeneral.cs index 226a61616..56f839538 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectRibbonGeneral.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectRibbonGeneral.cs @@ -29,7 +29,7 @@ public class PaletteRedirectRibbonGeneral : PaletteRedirect /// Initialize a new instance of the PaletteRedirectRibbonGeneral class. /// /// Initial palette target for redirection. - public PaletteRedirectRibbonGeneral(IPalette target) + public PaletteRedirectRibbonGeneral(PaletteBase target) : this(target, null, null, null, null) { } @@ -42,7 +42,7 @@ public PaletteRedirectRibbonGeneral(IPalette target) /// Redirection for normal state requests. /// Redirection for pressed state requests. /// Redirection for tracking state requests. - public PaletteRedirectRibbonGeneral(IPalette target, + public PaletteRedirectRibbonGeneral(PaletteBase target, IPaletteRibbonGeneral disabled, IPaletteRibbonGeneral normal, IPaletteRibbonGeneral pressed, diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectTriple.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectTriple.cs index 4aae364d1..98fa18e54 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectTriple.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectTriple.cs @@ -42,7 +42,7 @@ public PaletteRedirectTriple() /// Initialize a new instance of the PaletteRedirectTriple class. /// /// Initial palette target for redirection. - public PaletteRedirectTriple(IPalette target) + public PaletteRedirectTriple(PaletteBase target) : this(target, null, null, null, null, null, null, null, null, null) { } @@ -53,7 +53,7 @@ public PaletteRedirectTriple(IPalette target) /// Initial palette target for redirection. /// Redirection for disabled state requests. /// Redirection for normal state requests. - public PaletteRedirectTriple(IPalette target, + public PaletteRedirectTriple(PaletteBase target, IPaletteTriple disabled, IPaletteTriple normal) : this(target, disabled, normal, null, null, null, null, null, null, null) @@ -67,7 +67,7 @@ public PaletteRedirectTriple(IPalette target, /// Redirection for disabled state requests. /// Redirection for normal state requests. /// Redirection for tracking state requests. - public PaletteRedirectTriple(IPalette target, + public PaletteRedirectTriple(PaletteBase target, IPaletteTriple disabled, IPaletteTriple normal, IPaletteTriple tracking) @@ -85,7 +85,7 @@ public PaletteRedirectTriple(IPalette target, /// Redirection for tracking state requests. /// Redirection for all checked states. /// Redirection for focus override state requests. - public PaletteRedirectTriple(IPalette target, + public PaletteRedirectTriple(PaletteBase target, IPaletteTriple disabled, IPaletteTriple normal, IPaletteTriple pressed, @@ -110,7 +110,7 @@ public PaletteRedirectTriple(IPalette target, /// Redirection for checked tracking state requests. /// Redirection for focus override state requests. /// Redirection for normal default override state requests. - public PaletteRedirectTriple(IPalette target, + public PaletteRedirectTriple(PaletteBase target, IPaletteTriple disabled, IPaletteTriple normal, IPaletteTriple pressed, diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectTripleMetric.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectTripleMetric.cs index 005bbe2f5..c7d4f01ad 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectTripleMetric.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteRedirect/PaletteRedirectTripleMetric.cs @@ -27,7 +27,7 @@ public class PaletteRedirectTripleMetric : PaletteRedirectTriple /// Initialize a new instance of the PaletteRedirectTripleMetric class. /// /// Initial palette target for redirection. - public PaletteRedirectTripleMetric(IPalette target) + public PaletteRedirectTripleMetric(PaletteBase target) : this(target, null, null, null, null) { } @@ -40,7 +40,7 @@ public PaletteRedirectTripleMetric(IPalette target) /// Redirection for disabled metric requests. /// Redirection for normal state requests. /// Redirection for normal metric requests. - public PaletteRedirectTripleMetric(IPalette target, + public PaletteRedirectTripleMetric(PaletteBase target, IPaletteTriple disabled, IPaletteMetric disableMetric, IPaletteTriple normal, IPaletteMetric normalMetric) : base(target, disabled, normal) 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 e2fa2aa4e..c711d10e1 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteTools/PaletteTools.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteTools/PaletteTools.cs @@ -14,48 +14,18 @@ namespace Krypton.Toolkit { public class PaletteTools { - #region Variables - private static readonly string[] _themeList = new string[] { "Custom", - "Professional - System", - "Professional - Office 2003", - "Office 2007 - Black", - "Office 2007 - Blue", - "Office 2007 - Silver", - "Office 2007 - White", - "Office 2010 - Black", - "Office 2010 - Blue", - "Office 2010 - Silver", - "Office 2010 - White", - //"Office 2013", - "Office 2013 - White", - "Microsoft 365 - Black", - "Microsoft 365 - Blue", - "Microsoft 365 - Silver", - "Microsoft 365 - White", - "Sparkle - Blue", - "Sparkle - Orange", - "Sparkle - Purple" }; - #endregion - #region Properties /// Gets the theme list. /// The theme list. - public static string[] ThemeList => _themeList; - - #endregion + public static List ThemeList1 => ThemeManager.SupportedInternalThemeNames.ToList(); - #region Constructor - public PaletteTools() - { - - } #endregion #region Methods /// Links the type of the palette to the correct theme style. /// Name of the theme. /// - public PaletteModeManager LinkPaletteType(string themeName) + public PaletteModeManager LinkPaletteType1(string themeName) { PaletteModeManager paletteMode = new(); @@ -153,7 +123,7 @@ public static void ApplyTheme(KryptonManager manager, PaletteModeManager palette if (!string.IsNullOrWhiteSpace(customThemePath)) { - KryptonPalette palette = new(); + KryptonCustomPaletteBase palette = new(); palette.Import(customThemePath); diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteTriple/PaletteTripleToPalette.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteTriple/PaletteTripleToPalette.cs index e477f508e..7c6f7c77b 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteTriple/PaletteTripleToPalette.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteTriple/PaletteTripleToPalette.cs @@ -31,7 +31,7 @@ public class PaletteTripleToPalette : IPaletteTriple /// Initial background style. /// Initial border style. /// Initial content style. - public PaletteTripleToPalette(IPalette palette, + public PaletteTripleToPalette(PaletteBase palette, PaletteBackStyle backStyle, PaletteBorderStyle borderStyle, PaletteContentStyle contentStyle) diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Microsoft 365/Bases/PaletteMicrosoft365Base.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Microsoft 365/Bases/PaletteMicrosoft365Base.cs index 6ab3f577a..5298ec2c8 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Microsoft 365/Bases/PaletteMicrosoft365Base.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Microsoft 365/Bases/PaletteMicrosoft365Base.cs @@ -16,7 +16,7 @@ namespace Krypton.Toolkit /// Provides a base for Microsoft 365 palettes. /// /// - public abstract class PaletteMicrosoft365Base : PaletteBase + public abstract class PaletteMicrosoft365Base : PaletteBase { #region Static Fields private static readonly Padding _contentPaddingGrid = new(2, 1, 2, 1); diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Microsoft 365/Extra Themes/PaletteMicrosoft365BlackDarkMode.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Microsoft 365/Extra Themes/PaletteMicrosoft365BlackDarkMode.cs index 3bd627a7d..b9426e348 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Microsoft 365/Extra Themes/PaletteMicrosoft365BlackDarkMode.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Microsoft 365/Extra Themes/PaletteMicrosoft365BlackDarkMode.cs @@ -410,7 +410,7 @@ public override Image GetButtonSpecImage(PaletteButtonSpecStyle style, PaletteSt /// Provides a base for Office 365 palettes. /// /// - public abstract class PaletteMicrosoft365BlackDarkModeBase : PaletteBase + public abstract class PaletteMicrosoft365BlackDarkModeBase : PaletteBase { #region Static Fields @@ -5177,7 +5177,7 @@ static KryptonColorTable365BlackDarkMode() /// Source of /// Should have rounded edges. /// Associated palette instance. - public KryptonColorTable365BlackDarkMode(Color[] colors, InheritBool roundedEdges, IPalette palette) : base(palette) + public KryptonColorTable365BlackDarkMode(Color[] colors, InheritBool roundedEdges, PaletteBase palette) : base(palette) { Debug.Assert(colors != null); _colors = colors; diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Microsoft 365/Extra Themes/PaletteMicrosoft365BlueDarkMode.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Microsoft 365/Extra Themes/PaletteMicrosoft365BlueDarkMode.cs index 52c38fca0..99c510393 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Microsoft 365/Extra Themes/PaletteMicrosoft365BlueDarkMode.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Microsoft 365/Extra Themes/PaletteMicrosoft365BlueDarkMode.cs @@ -404,7 +404,7 @@ public override Image GetButtonSpecImage(PaletteButtonSpecStyle style, PaletteSt /// Provides a base for Office 365 palettes. /// /// - public abstract class PaletteMicrosoft365BlueDarkModeBase : PaletteBase + public abstract class PaletteMicrosoft365BlueDarkModeBase : PaletteBase { #region Static Fields @@ -5156,7 +5156,7 @@ static KryptonColorTable365BlueDarkMode() /// Source of /// Should have rounded edges. /// Associated palette instance. - public KryptonColorTable365BlueDarkMode(Color[] colors, InheritBool roundedEdges, IPalette palette) : base(palette) + public KryptonColorTable365BlueDarkMode(Color[] colors, InheritBool roundedEdges, PaletteBase palette) : base(palette) { Debug.Assert(colors != null); _colors = colors; diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Microsoft 365/Extra Themes/PaletteMicrosoft365BlueLightMode.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Microsoft 365/Extra Themes/PaletteMicrosoft365BlueLightMode.cs index bf9e440e7..9820fc38f 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Microsoft 365/Extra Themes/PaletteMicrosoft365BlueLightMode.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Microsoft 365/Extra Themes/PaletteMicrosoft365BlueLightMode.cs @@ -410,7 +410,7 @@ public override Image GetButtonSpecImage(PaletteButtonSpecStyle style, PaletteSt /// Provides a base for Office 365 palettes. /// /// - public abstract class PaletteMicrosoft365BlueLightModeBase : PaletteBase + public abstract class PaletteMicrosoft365BlueLightModeBase : PaletteBase { #region Static Fields @@ -5184,7 +5184,7 @@ static KryptonColorTable365BlueLightMode() /// Source of /// Should have rounded edges. /// Associated palette instance. - public KryptonColorTable365BlueLightMode(Color[] colors, InheritBool roundedEdges, IPalette palette) : base(palette) + public KryptonColorTable365BlueLightMode(Color[] colors, InheritBool roundedEdges, PaletteBase palette) : base(palette) { Debug.Assert(colors != null); _colors = colors; diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Microsoft 365/Extra Themes/PaletteMicrosoft365SilverDarkMode.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Microsoft 365/Extra Themes/PaletteMicrosoft365SilverDarkMode.cs index baf907741..4cb78ef7f 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Microsoft 365/Extra Themes/PaletteMicrosoft365SilverDarkMode.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Microsoft 365/Extra Themes/PaletteMicrosoft365SilverDarkMode.cs @@ -406,7 +406,7 @@ public override Image GetButtonSpecImage(PaletteButtonSpecStyle style, PaletteSt /// Provides a base for Office 365 palettes. /// /// - public abstract class PaletteMicrosoft365SilverDarkModeBase : PaletteBase + public abstract class PaletteMicrosoft365SilverDarkModeBase : PaletteBase { #region Static Fields @@ -5141,7 +5141,7 @@ static KryptonColorTable365SilverDarkMode() /// Source of /// Should have rounded edges. /// Associated palette instance. - public KryptonColorTable365SilverDarkMode(Color[] colors, InheritBool roundedEdges, IPalette palette) : base(palette) + public KryptonColorTable365SilverDarkMode(Color[] colors, InheritBool roundedEdges, PaletteBase palette) : base(palette) { Debug.Assert(colors != null); _colors = colors; diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Microsoft 365/Extra Themes/PaletteMicrosoft365SilverLightMode.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Microsoft 365/Extra Themes/PaletteMicrosoft365SilverLightMode.cs index 63e163235..738bd1c19 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Microsoft 365/Extra Themes/PaletteMicrosoft365SilverLightMode.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Microsoft 365/Extra Themes/PaletteMicrosoft365SilverLightMode.cs @@ -411,7 +411,7 @@ public override Image GetButtonSpecImage(PaletteButtonSpecStyle style, PaletteSt /// Provides a base for Office 365 palettes. /// /// - public abstract class PaletteMicrosoft365SilverLightModeBase : PaletteBase + public abstract class PaletteMicrosoft365SilverLightModeBase : PaletteBase { #region Static Fields @@ -5176,7 +5176,7 @@ static KryptonColorTable365SilverLightMode() /// Source of /// Should have rounded edges. /// Associated palette instance. - public KryptonColorTable365SilverLightMode(Color[] colors, InheritBool roundedEdges, IPalette palette) : base(palette) + public KryptonColorTable365SilverLightMode(Color[] colors, InheritBool roundedEdges, PaletteBase palette) : base(palette) { Debug.Assert(colors != null); _colors = colors; diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Microsoft 365/Official Themes/PaletteMicrosoft365Black.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Microsoft 365/Official Themes/PaletteMicrosoft365Black.cs index 22c0220dc..f891dd05f 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Microsoft 365/Official Themes/PaletteMicrosoft365Black.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Microsoft 365/Official Themes/PaletteMicrosoft365Black.cs @@ -423,7 +423,7 @@ public override Image GetButtonSpecImage(PaletteButtonSpecStyle style, PaletteSt /// Provides a base for Office 365 palettes. /// /// - public abstract class PaletteMicrosoft365BlackThemeBase : PaletteBase + public abstract class PaletteMicrosoft365BlackThemeBase : PaletteBase { #region Static Fields private static readonly Padding _contentPaddingGrid = new(2, 1, 2, 1); diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2007/Bases/PaletteOffice2007Base.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2007/Bases/PaletteOffice2007Base.cs index bdc2faf30..153c68799 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2007/Bases/PaletteOffice2007Base.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2007/Bases/PaletteOffice2007Base.cs @@ -15,7 +15,7 @@ namespace Krypton.Toolkit /// /// Provides a professional appearance using colors/fonts generated from system settings. /// - public abstract class PaletteOffice2007Base : PaletteBase + public abstract class PaletteOffice2007Base : PaletteBase { #region Static Fields diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2007/Extra Themes/PaletteOffice2007BlackDarkMode.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2007/Extra Themes/PaletteOffice2007BlackDarkMode.cs index bdb9e5ae9..7a97332c8 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2007/Extra Themes/PaletteOffice2007BlackDarkMode.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2007/Extra Themes/PaletteOffice2007BlackDarkMode.cs @@ -590,7 +590,7 @@ public override PaletteRibbonColorStyle GetRibbonBackColorStyle(PaletteRibbonBac /// /// Provides a professional appearance using colors/fonts generated from system settings. /// - public abstract class PaletteOffice2007BlackDarkModeBase : PaletteBase + public abstract class PaletteOffice2007BlackDarkModeBase : PaletteBase { #region Static Fields @@ -6232,7 +6232,7 @@ static KryptonColorTable2007BlackDarkMode() /// Associated palette instance. public KryptonColorTable2007BlackDarkMode(Color[] colors, InheritBool roundedEdges, - IPalette palette) + PaletteBase palette) : base(palette) { Debug.Assert(colors != null); diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2007/Extra Themes/PaletteOffice2007BlueDarkMode.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2007/Extra Themes/PaletteOffice2007BlueDarkMode.cs index 1ec674c47..4f3fc1c21 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2007/Extra Themes/PaletteOffice2007BlueDarkMode.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2007/Extra Themes/PaletteOffice2007BlueDarkMode.cs @@ -436,7 +436,7 @@ public override PaletteRibbonColorStyle GetRibbonBackColorStyle(PaletteRibbonBac /// /// Provides a professional appearance using colors/fonts generated from system settings. /// - public abstract class PaletteOffice2007BlueDarkModeBase : PaletteBase + public abstract class PaletteOffice2007BlueDarkModeBase : PaletteBase { #region Static Fields @@ -5524,7 +5524,7 @@ static KryptonColorTable2007BlueDarkMode() /// Associated palette instance. public KryptonColorTable2007BlueDarkMode(Color[] colors, InheritBool roundedEdges, - IPalette palette) + PaletteBase palette) : base(palette) { Debug.Assert(colors != null); diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2007/Extra Themes/PaletteOffice2007BlueLightMode.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2007/Extra Themes/PaletteOffice2007BlueLightMode.cs index 9779c69c0..227432802 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2007/Extra Themes/PaletteOffice2007BlueLightMode.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2007/Extra Themes/PaletteOffice2007BlueLightMode.cs @@ -437,7 +437,7 @@ public override PaletteRibbonColorStyle GetRibbonBackColorStyle(PaletteRibbonBac /// /// Provides a professional appearance using colors/fonts generated from system settings. /// - public abstract class PaletteOffice2007BlueLightModeBase : PaletteBase + public abstract class PaletteOffice2007BlueLightModeBase : PaletteBase { #region Static Fields @@ -5991,7 +5991,7 @@ static KryptonColorTable2007BlueLightMode() /// Associated palette instance. public KryptonColorTable2007BlueLightMode(Color[] colours, InheritBool roundedEdges, - IPalette palette) + PaletteBase palette) : base(palette) { Debug.Assert(colours != null); diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2007/Extra Themes/PaletteOffice2007SilverDarkMode.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2007/Extra Themes/PaletteOffice2007SilverDarkMode.cs index 88c4124f2..fa72c46c0 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2007/Extra Themes/PaletteOffice2007SilverDarkMode.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2007/Extra Themes/PaletteOffice2007SilverDarkMode.cs @@ -417,7 +417,7 @@ public override Image GetButtonSpecImage(PaletteButtonSpecStyle style, /// /// Provides a professional appearance using colors/fonts generated from system settings. /// - public abstract class PaletteOffice2007SilverDarkModeBase : PaletteBase + public abstract class PaletteOffice2007SilverDarkModeBase : PaletteBase { #region Static Fields @@ -5972,7 +5972,7 @@ static KryptonColorTable2007SilverDarkMode() /// Associated palette instance. public KryptonColorTable2007SilverDarkMode(Color[] colors, InheritBool roundedEdges, - IPalette palette) + PaletteBase palette) : base(palette) { Debug.Assert(colors != null); diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2007/Extra Themes/PaletteOffice2007SilverLightMode.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2007/Extra Themes/PaletteOffice2007SilverLightMode.cs index 310e88245..3447dcf69 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2007/Extra Themes/PaletteOffice2007SilverLightMode.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2007/Extra Themes/PaletteOffice2007SilverLightMode.cs @@ -422,7 +422,7 @@ public override Image GetButtonSpecImage(PaletteButtonSpecStyle style, /// /// Provides a professional appearance using colors/fonts generated from system settings. /// - public abstract class PaletteOffice2007SilverLightModeBase : PaletteBase + public abstract class PaletteOffice2007SilverLightModeBase : PaletteBase { #region Static Fields @@ -6030,7 +6030,7 @@ static KryptonColorTable2007SilverLightMode() /// Associated palette instance. public KryptonColorTable2007SilverLightMode(Color[] colors, InheritBool roundedEdges, - IPalette palette) + PaletteBase palette) : base(palette) { Debug.Assert(colors != null); diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2010/Bases/PaletteOffice2010Base.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2010/Bases/PaletteOffice2010Base.cs index b1bcbc4dd..1379f76ad 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2010/Bases/PaletteOffice2010Base.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2010/Bases/PaletteOffice2010Base.cs @@ -15,7 +15,7 @@ namespace Krypton.Toolkit /// /// Provides a base for Office 2010 palettes. /// - public abstract class PaletteOffice2010Base : PaletteBase + public abstract class PaletteOffice2010Base : PaletteBase { #region Static Fields private static readonly Padding _contentPaddingGrid = new(2, 1, 2, 1); diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2010/Extra Themes/PaletteOffice2010BlackDarkMode.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2010/Extra Themes/PaletteOffice2010BlackDarkMode.cs index a83eea083..a7b685374 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2010/Extra Themes/PaletteOffice2010BlackDarkMode.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2010/Extra Themes/PaletteOffice2010BlackDarkMode.cs @@ -754,7 +754,7 @@ public override PaletteRibbonColorStyle GetRibbonBackColorStyle(PaletteRibbonBac /// /// Provides a base for Office 2010 palettes. /// - public abstract class PaletteOffice2010BlackDarkModeBase : PaletteBase + public abstract class PaletteOffice2010BlackDarkModeBase : PaletteBase { #region Static Fields @@ -5567,7 +5567,7 @@ static KryptonColorTable2010BlackDarkMode() /// Associated palette instance. public KryptonColorTable2010BlackDarkMode(Color[] colors, InheritBool roundedEdges, - IPalette palette) + PaletteBase palette) : base(palette) { Debug.Assert(colors != null); diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2010/Extra Themes/PaletteOffice2010BlueDarkMode.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2010/Extra Themes/PaletteOffice2010BlueDarkMode.cs index 44e1f7dfa..7ab13a3fb 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2010/Extra Themes/PaletteOffice2010BlueDarkMode.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2010/Extra Themes/PaletteOffice2010BlueDarkMode.cs @@ -408,7 +408,7 @@ public override Image GetButtonSpecImage(PaletteButtonSpecStyle style, /// /// Provides a base for Office 2010 palettes. /// - public abstract class PaletteOffice2010BlueDarkModeBase : PaletteBase + public abstract class PaletteOffice2010BlueDarkModeBase : PaletteBase { #region Static Fields @@ -5185,7 +5185,7 @@ static KryptonColorTable2010BlueDarkMode() /// Associated palette instance. public KryptonColorTable2010BlueDarkMode(Color[] colors, InheritBool roundedEdges, - IPalette palette) + PaletteBase palette) : base(palette) { Debug.Assert(colors != null); diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2010/Extra Themes/PaletteOffice2010BlueLightMode.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2010/Extra Themes/PaletteOffice2010BlueLightMode.cs index a38db5322..ed6f0cfdc 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2010/Extra Themes/PaletteOffice2010BlueLightMode.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2010/Extra Themes/PaletteOffice2010BlueLightMode.cs @@ -412,7 +412,7 @@ public override Image GetButtonSpecImage(PaletteButtonSpecStyle style, /// /// Provides a base for Office 2010 palettes. /// - public abstract class PaletteOffice2010BlueLightModeBase : PaletteBase + public abstract class PaletteOffice2010BlueLightModeBase : PaletteBase { #region Static Fields @@ -5189,7 +5189,7 @@ static KryptonColorTable2010BlueLightMode() /// Associated palette instance. public KryptonColorTable2010BlueLightMode(Color[] colors, InheritBool roundedEdges, - IPalette palette) + PaletteBase palette) : base(palette) { Debug.Assert(colors != null); diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2010/Extra Themes/PaletteOffice2010SilverDarkMode.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2010/Extra Themes/PaletteOffice2010SilverDarkMode.cs index 943508198..aa3fbc432 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2010/Extra Themes/PaletteOffice2010SilverDarkMode.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2010/Extra Themes/PaletteOffice2010SilverDarkMode.cs @@ -405,7 +405,7 @@ public override Image GetButtonSpecImage(PaletteButtonSpecStyle style, /// /// Provides a base for Office 2010 palettes. /// - public abstract class PaletteOffice2010SilverDarkModeBase : PaletteBase + public abstract class PaletteOffice2010SilverDarkModeBase : PaletteBase { #region Static Fields @@ -5183,7 +5183,7 @@ static KryptonColorTable2010SilverDarkMode() /// Associated palette instance. public KryptonColorTable2010SilverDarkMode(Color[] colors, InheritBool roundedEdges, - IPalette palette) + PaletteBase palette) : base(palette) { Debug.Assert(colors != null); diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2010/Extra Themes/PaletteOffice2010SilverLightMode.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2010/Extra Themes/PaletteOffice2010SilverLightMode.cs index 1443c532e..fb58f166c 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2010/Extra Themes/PaletteOffice2010SilverLightMode.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2010/Extra Themes/PaletteOffice2010SilverLightMode.cs @@ -416,7 +416,7 @@ public override Image GetButtonSpecImage(PaletteButtonSpecStyle style, /// /// Provides a base for Office 2010 palettes. /// - public abstract class PaletteOffice2010SilverLightModeBase : PaletteBase + public abstract class PaletteOffice2010SilverLightModeBase : PaletteBase { #region Static Fields @@ -5224,7 +5224,7 @@ static KryptonColorTable2010SilverLightMode() /// Associated palette instance. public KryptonColorTable2010SilverLightMode(Color[] colors, InheritBool roundedEdges, - IPalette palette) + PaletteBase palette) : base(palette) { Debug.Assert(colors != null); diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2013/Bases/PaletteOffice2013Base.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2013/Bases/PaletteOffice2013Base.cs index 9b13c3f76..fc5a9ec33 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2013/Bases/PaletteOffice2013Base.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2013/Bases/PaletteOffice2013Base.cs @@ -15,7 +15,7 @@ namespace Krypton.Toolkit /// /// Provides a base for Office 2013 palettes. /// - public abstract class PaletteOffice2013Base : PaletteBase + public abstract class PaletteOffice2013Base : PaletteBase { #region Static Fields private static readonly Padding _contentPaddingGrid = new(2, 1, 2, 1); diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2013/Official Themes/PaletteOffice2013White.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2013/Official Themes/PaletteOffice2013White.cs index 36331b0ac..09756210f 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2013/Official Themes/PaletteOffice2013White.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Office 2013/Official Themes/PaletteOffice2013White.cs @@ -391,7 +391,7 @@ public override Image GetButtonSpecImage(PaletteButtonSpecStyle style, /// /// Gets the single instance of the ### palette. /// - public abstract class PaletteOffice2013WhiteBase : PaletteBase + public abstract class PaletteOffice2013WhiteBase : PaletteBase { #region Static Fields private static readonly Padding _contentPaddingGrid = new(2, 1, 2, 1); diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/PaletteBase.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/PaletteBase.cs index ad3af2169..afd3203ca 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/PaletteBase.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/PaletteBase.cs @@ -16,7 +16,7 @@ namespace Krypton.Toolkit /// Provides base class implementation for palettes. /// [ToolboxItem(false)] - public abstract class PaletteBase : Component, IPalette + public abstract class PaletteBase : Component { #region Instance Fields private BasePaletteType _basePaletteType; @@ -55,7 +55,7 @@ public abstract class PaletteBase : Component, IPalette #region Identity /// Initializes a new instance of the class. - protected PaletteBase() + protected PaletteBase () { // We need to notice when system color settings change SystemEvents.UserPreferenceChanged += OnUserPreferenceChanged; diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/PaletteVisualStudioBase.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/PaletteVisualStudioBase.cs index 4645124eb..9b0679eca 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/PaletteVisualStudioBase.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/PaletteVisualStudioBase.cs @@ -16,7 +16,7 @@ namespace Krypton.Toolkit /// Provides a base for Visual Studio 2020 palettes. /// /// - public abstract class PaletteVisualStudioBase : PaletteBase + public abstract class PaletteVisualStudioBase : PaletteBase { #region Static Fields private static readonly Padding _contentPaddingGrid = new(2, 1, 2, 1); diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Professional/PaletteProfessionalSystem.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Professional/PaletteProfessionalSystem.cs index 3ae522826..7391e9cb1 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Professional/PaletteProfessionalSystem.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Professional/PaletteProfessionalSystem.cs @@ -15,7 +15,7 @@ namespace Krypton.Toolkit /// /// Provides a professional appearance using colors/fonts generated from system settings. /// - public class PaletteProfessionalSystem : PaletteBase + public class PaletteProfessionalSystem : PaletteBase { #region Static Fields private static readonly Padding _contentPaddingGrid = new(2, 1, 2, 1); diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Sparkle/Base/PaletteSparkleBase.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Sparkle/Base/PaletteSparkleBase.cs index cd7b3a8d6..8788a4d20 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Sparkle/Base/PaletteSparkleBase.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Sparkle/Base/PaletteSparkleBase.cs @@ -15,7 +15,7 @@ namespace Krypton.Toolkit /// /// Provides a fixed blue variation on the sparkle appearance. /// - public class PaletteSparkleBase : PaletteBase + public class PaletteSparkleBase : PaletteBase { #region Static Fields private static readonly Padding _contentPaddingGrid = new(2, 1, 2, 1); diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Sparkle/Extra Themes/PaletteSparkleBlueDarkMode.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Sparkle/Extra Themes/PaletteSparkleBlueDarkMode.cs index bd2144695..d8ddaa5cd 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Sparkle/Extra Themes/PaletteSparkleBlueDarkMode.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/Sparkle/Extra Themes/PaletteSparkleBlueDarkMode.cs @@ -339,7 +339,7 @@ public PaletteSparkleBlueDarkMode() /// /// Provides a fixed blue variation on the sparkle appearance. /// - public abstract class PaletteSparkleBlueDarkModeBase : PaletteBase + public abstract class PaletteSparkleBlueDarkModeBase : PaletteBase { #region Static Fields private static readonly Padding _contentPaddingGrid = new(2, 1, 2, 1); diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Component/KryptonInternalKCT.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Component/KryptonInternalKCT.cs index f044f3020..035f3b706 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Component/KryptonInternalKCT.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Component/KryptonInternalKCT.cs @@ -27,7 +27,7 @@ public class KryptonInternalKCT : KryptonColorTable /// Initial base KCT to inherit values from. /// Reference to associated palette. public KryptonInternalKCT(KryptonColorTable baseKCT, - IPalette palette) + PaletteBase palette) : base(palette) { Debug.Assert(baseKCT != null); diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Component/KryptonPaletteTMS.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Component/KryptonPaletteTMS.cs index e4212da2d..7a3ec9be1 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Component/KryptonPaletteTMS.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Component/KryptonPaletteTMS.cs @@ -28,7 +28,7 @@ public class KryptonPaletteTMS : Storage /// Associated palettte instance. /// Initial base KCT to inherit values from. /// Delegate for notifying paint requests. - public KryptonPaletteTMS(IPalette palette, + public KryptonPaletteTMS(PaletteBase palette, KryptonColorTable baseKCT, NeedPaintHandler needPaint) { diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonColorTable.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonColorTable.cs index 0e465f9fa..b70da3d9d 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonColorTable.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonColorTable.cs @@ -19,7 +19,7 @@ public class KryptonColorTable : ProfessionalColorTable { #region Instance Fields - private IPalette _palette; + private PaletteBase _palette; #endregion #region Identity @@ -27,7 +27,7 @@ public class KryptonColorTable : ProfessionalColorTable /// Creates a new instance of the KryptonColorTable class. /// /// Reference to associated palette. - public KryptonColorTable(IPalette palette) => Palette = palette; + public KryptonColorTable(PaletteBase palette) => Palette = palette; #endregion @@ -35,7 +35,7 @@ public class KryptonColorTable : ProfessionalColorTable /// /// Gets the associated palette instance. /// - public IPalette Palette { get; } + public PaletteBase Palette { get; } #endregion diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonColorTable2007.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonColorTable2007.cs index 4951cff7b..9ec060831 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonColorTable2007.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonColorTable2007.cs @@ -55,7 +55,7 @@ static KryptonColorTable2007() /// Associated palette instance. public KryptonColorTable2007(Color[] colors, InheritBool roundedEdges, - IPalette palette) + PaletteBase palette) : base(palette) { Debug.Assert(colors != null); diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonColorTable2010.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonColorTable2010.cs index 74e4101c4..504e69819 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonColorTable2010.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonColorTable2010.cs @@ -55,7 +55,7 @@ static KryptonColorTable2010() /// Associated palette instance. public KryptonColorTable2010(Color[] colors, InheritBool roundedEdges, - IPalette palette) + PaletteBase palette) : base(palette) { Debug.Assert(colors != null); diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonColorTable2013.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonColorTable2013.cs index b5f7b5644..910631e4e 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonColorTable2013.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonColorTable2013.cs @@ -57,7 +57,7 @@ static KryptonColorTable2013() /// Associated palette instance. public KryptonColorTable2013(Color[] colors, InheritBool roundedEdges, - IPalette palette) + PaletteBase palette) : base(palette) { Debug.Assert(colors != null); diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonColorTable365.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonColorTable365.cs index 672488ac7..a822f0c89 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonColorTable365.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonColorTable365.cs @@ -55,7 +55,7 @@ static KryptonColorTable365() /// Source of /// Should have rounded edges. /// Associated palette instance. - public KryptonColorTable365(Color[] colors, InheritBool roundedEdges, IPalette palette) : base(palette) + public KryptonColorTable365(Color[] colors, InheritBool roundedEdges, PaletteBase palette) : base(palette) { Debug.Assert(colors != null); _colors = colors; diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonColorTableOffice365.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonColorTableOffice365.cs index 6d5f430b9..b81d2561b 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonColorTableOffice365.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonColorTableOffice365.cs @@ -58,7 +58,7 @@ static KryptonColorTableOffice365() /// Associated palette instance. public KryptonColorTableOffice365(Color[] colors, InheritBool roundedEdges, - IPalette palette) + PaletteBase palette) : base(palette) { Debug.Assert(colors != null); diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonColorTableSparkle.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonColorTableSparkle.cs index 8e199362b..6c8e2b257 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonColorTableSparkle.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonColorTableSparkle.cs @@ -53,7 +53,7 @@ static KryptonColorTableSparkle() public KryptonColorTableSparkle(Color[] colors, Color[] sparkleColors, InheritBool roundedEdges, - IPalette palette) + PaletteBase palette) : base(palette) { Debug.Assert(colors != null); diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonColorTableVisualStudio2019.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonColorTableVisualStudio2019.cs index 395e673f7..21ad25011 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonColorTableVisualStudio2019.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonColorTableVisualStudio2019.cs @@ -56,7 +56,7 @@ static KryptonColorTableVisualStudio2020() /// Source of /// Should have rounded edges. /// Associated palette instance. - public KryptonColorTableVisualStudio2020(Color[] colors, InheritBool roundedEdges, IPalette palette) : base(palette) + public KryptonColorTableVisualStudio2020(Color[] colors, InheritBool roundedEdges, PaletteBase palette) : base(palette) { Debug.Assert(colors != null); _colors = colors; diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonProfessionalCustomKCT.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonProfessionalCustomKCT.cs index d89d9be79..c73bb83c9 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonProfessionalCustomKCT.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonProfessionalCustomKCT.cs @@ -29,7 +29,7 @@ internal class KryptonProfessionalCustomKCT : KryptonProfessionalKCT public KryptonProfessionalCustomKCT(Color[] headerColors, Color[] colorTableColors, bool useSystemColors, - IPalette palette) + PaletteBase palette) : base(headerColors, useSystemColors, palette) => _colors = colorTableColors; diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonProfessionalKCT.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonProfessionalKCT.cs index 77adf77a9..a178b7982 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonProfessionalKCT.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/KryptonProfessionalKCT.cs @@ -27,7 +27,7 @@ internal class KryptonProfessionalKCT : KryptonColorTable /// Reference to associated palette. public KryptonProfessionalKCT(Color[] colors, bool useSystemColors, - IPalette palette) + PaletteBase palette) : base(palette) { Debug.Assert(colors != null); diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/PaletteRedirectBreadCrumb.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/PaletteRedirectBreadCrumb.cs index 3997d27f3..3f5c57624 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/PaletteRedirectBreadCrumb.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/PaletteRedirectBreadCrumb.cs @@ -26,7 +26,7 @@ public class PaletteRedirectBreadCrumb : PaletteRedirect /// Initialize a new instance of the PaletteRedirectBreadCrumb class. /// /// Initial palette target for redirection. - public PaletteRedirectBreadCrumb(IPalette target) + public PaletteRedirectBreadCrumb(PaletteBase target) : base(target) { Left = false; diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/PaletteRedirectCheckBox.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/PaletteRedirectCheckBox.cs index 73da6682f..a5ee337f4 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/PaletteRedirectCheckBox.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/PaletteRedirectCheckBox.cs @@ -36,7 +36,7 @@ public PaletteRedirectCheckBox(CheckBoxImages images) /// /// Initial palette target for redirection. /// Reference to source of check box images. - public PaletteRedirectCheckBox(IPalette target, + public PaletteRedirectCheckBox(PaletteBase target, CheckBoxImages images) : base(target) { diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/PaletteRedirectCommon.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/PaletteRedirectCommon.cs index 0cbab3454..024bb2780 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/PaletteRedirectCommon.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/PaletteRedirectCommon.cs @@ -29,7 +29,7 @@ public class PaletteRedirectCommon : PaletteRedirect /// Initial palette target for redirection. /// Redirection for disabled state requests. /// Redirection for all other state requests. - public PaletteRedirectCommon(IPalette target, + public PaletteRedirectCommon(PaletteBase target, IPaletteTriple disabled, IPaletteTriple others) : base(target) diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/PaletteRedirectContextMenu.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/PaletteRedirectContextMenu.cs index 73e5026f7..6a11bee90 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/PaletteRedirectContextMenu.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/PaletteRedirectContextMenu.cs @@ -27,7 +27,7 @@ public class PaletteRedirectContextMenu : PaletteRedirect /// /// Initial palette target for redirection. /// Reference to source of context menu images. - public PaletteRedirectContextMenu(IPalette target, + public PaletteRedirectContextMenu(PaletteBase target, ContextMenuImages images) : base(target) { diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/PaletteRedirectDropDownButton.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/PaletteRedirectDropDownButton.cs index 676cd0c14..262014fec 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/PaletteRedirectDropDownButton.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/PaletteRedirectDropDownButton.cs @@ -36,7 +36,7 @@ public PaletteRedirectDropDownButton(DropDownButtonImages images) /// /// Initial palette target for redirection. /// Reference to source of drop down button images. - public PaletteRedirectDropDownButton(IPalette target, + public PaletteRedirectDropDownButton(PaletteBase target, DropDownButtonImages images) : base(target) { diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/PaletteRedirectRadioButton.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/PaletteRedirectRadioButton.cs index a8f08c32b..ad36d638c 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/PaletteRedirectRadioButton.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/PaletteRedirectRadioButton.cs @@ -36,7 +36,7 @@ public PaletteRedirectRadioButton(RadioButtonImages images) /// /// Initial palette target for redirection. /// Reference to source of radio button images. - public PaletteRedirectRadioButton(IPalette target, + public PaletteRedirectRadioButton(PaletteBase target, RadioButtonImages images) : base(target) { diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/PaletteRedirectTreeView.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/PaletteRedirectTreeView.cs index ec0fc79b8..a7a01074e 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/PaletteRedirectTreeView.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/PaletteRedirectTreeView.cs @@ -40,7 +40,7 @@ public PaletteRedirectTreeView(TreeViewImages plusMinusImages, /// Initial palette target for redirection. /// Reference to source of tree view images. /// Reference to source of check box images. - public PaletteRedirectTreeView(IPalette target, + public PaletteRedirectTreeView(PaletteBase target, TreeViewImages plusMinusImages, CheckBoxImages checkboxImages) : base(target) diff --git a/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderBase.cs b/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderBase.cs index 0a68318b6..98192d126 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderBase.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderBase.cs @@ -144,7 +144,7 @@ public IRenderGlyph RenderGlyph /// Gets a renderer for drawing the toolstrips. /// /// Color palette to use when rendering toolstrip. - public abstract ToolStripRenderer RenderToolStrip(IPalette colorPalette); + public abstract ToolStripRenderer RenderToolStrip(PaletteBase colorPalette); #endregion #region RenderStandardBorder @@ -552,7 +552,7 @@ public abstract void DrawSeparator(RenderContext context, /// Should check box be Displayed as hot tracking. /// Should check box be Displayed as pressed. public abstract Size GetCheckBoxPreferredSize(ViewLayoutContext context, - IPalette palette, + PaletteBase palette, bool enabled, CheckState checkState, bool tracking, @@ -570,7 +570,7 @@ public abstract Size GetCheckBoxPreferredSize(ViewLayoutContext context, /// Should check box be Displayed as pressed. public abstract void DrawCheckBox(RenderContext context, Rectangle displayRect, - IPalette palette, + PaletteBase palette, bool enabled, CheckState checkState, bool tracking, @@ -586,7 +586,7 @@ public abstract void DrawCheckBox(RenderContext context, /// Should check box be Displayed as hot tracking. /// Should check box be Displayed as pressed. public abstract Size GetRadioButtonPreferredSize(ViewLayoutContext context, - IPalette palette, + PaletteBase palette, bool enabled, bool checkState, bool tracking, @@ -603,7 +603,7 @@ public abstract Size GetRadioButtonPreferredSize(ViewLayoutContext context, /// Should radio button be Displayed as pressed. public abstract void DrawRadioButton(RenderContext context, Rectangle displayRect, - IPalette palette, + PaletteBase palette, bool enabled, bool checkState, bool tracking, @@ -617,7 +617,7 @@ public abstract void DrawRadioButton(RenderContext context, /// State for which image size is needed. /// How to orientate the image. public abstract Size GetDropDownButtonPreferredSize(ViewLayoutContext context, - IPalette palette, + PaletteBase palette, PaletteState state, VisualOrientation orientation); @@ -631,7 +631,7 @@ public abstract Size GetDropDownButtonPreferredSize(ViewLayoutContext context, /// How to orientate the image. public abstract void DrawDropDownButton(RenderContext context, Rectangle displayRect, - IPalette palette, + PaletteBase palette, PaletteState state, VisualOrientation orientation); diff --git a/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderDefinitions.cs b/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderDefinitions.cs index 3556c93c8..df865b317 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderDefinitions.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderDefinitions.cs @@ -72,7 +72,7 @@ bool EvalTransparentPaint(IPaletteBack paletteBack, /// Gets a renderer for drawing the toolstrips. /// /// Color palette to use when rendering toolstrip. - ToolStripRenderer RenderToolStrip(IPalette colorPalette); + ToolStripRenderer RenderToolStrip(PaletteBase colorPalette); } #endregion @@ -515,7 +515,7 @@ void DrawSeparator(RenderContext context, /// Should check box be Displayed as hot tracking. /// Should check box be Displayed as pressed. Size GetCheckBoxPreferredSize(ViewLayoutContext context, - IPalette palette, + PaletteBase palette, bool enabled, CheckState checkState, bool tracking, @@ -533,7 +533,7 @@ Size GetCheckBoxPreferredSize(ViewLayoutContext context, /// Should check box be Displayed as pressed. void DrawCheckBox(RenderContext context, Rectangle displayRect, - IPalette palette, + PaletteBase palette, bool enabled, CheckState checkState, bool tracking, @@ -549,7 +549,7 @@ void DrawCheckBox(RenderContext context, /// Should check box be Displayed as hot tracking. /// Should check box be Displayed as pressed. Size GetRadioButtonPreferredSize(ViewLayoutContext context, - IPalette palette, + PaletteBase palette, bool enabled, bool checkState, bool tracking, @@ -567,7 +567,7 @@ Size GetRadioButtonPreferredSize(ViewLayoutContext context, /// Should radio button be Displayed as pressed. void DrawRadioButton(RenderContext context, Rectangle displayRect, - IPalette palette, + PaletteBase palette, bool enabled, bool checkState, bool tracking, @@ -581,7 +581,7 @@ void DrawRadioButton(RenderContext context, /// State for which image size is needed. /// How to orientate the image. Size GetDropDownButtonPreferredSize(ViewLayoutContext context, - IPalette palette, + PaletteBase palette, PaletteState state, VisualOrientation orientation); @@ -595,7 +595,7 @@ Size GetDropDownButtonPreferredSize(ViewLayoutContext context, /// How to orientate the image. void DrawDropDownButton(RenderContext context, Rectangle displayRect, - IPalette palette, + PaletteBase palette, PaletteState state, VisualOrientation orientation); diff --git a/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderMicrosoft365.cs b/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderMicrosoft365.cs index 70dba0468..049f1104d 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderMicrosoft365.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderMicrosoft365.cs @@ -61,7 +61,7 @@ public override void DrawRibbonClusterEdge(PaletteRibbonShape shape, RenderConte /// /// The colour palette. /// - public override ToolStripRenderer RenderToolStrip(IPalette colourPalette) + public override ToolStripRenderer RenderToolStrip(PaletteBase colourPalette) { Debug.Assert(colourPalette != null); diff --git a/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderOffice2007.cs b/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderOffice2007.cs index cedce0df0..5bfd0f1bf 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderOffice2007.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderOffice2007.cs @@ -88,7 +88,7 @@ public override void DrawRibbonClusterEdge(PaletteRibbonShape shape, /// /// Color palette to use when rendering toolstrip. /// - public override ToolStripRenderer RenderToolStrip(IPalette colorPalette) + public override ToolStripRenderer RenderToolStrip(PaletteBase colorPalette) { Debug.Assert(colorPalette != null); diff --git a/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderOffice2010.cs b/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderOffice2010.cs index c772620bd..177bde734 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderOffice2010.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderOffice2010.cs @@ -88,7 +88,7 @@ public override void DrawRibbonClusterEdge(PaletteRibbonShape shape, /// /// Color palette to use when rendering toolstrip. /// - public override ToolStripRenderer RenderToolStrip(IPalette colorPalette) + public override ToolStripRenderer RenderToolStrip(PaletteBase colorPalette) { Debug.Assert(colorPalette != null); diff --git a/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderOffice2013.cs b/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderOffice2013.cs index c98b467c0..a00294c21 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderOffice2013.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderOffice2013.cs @@ -81,7 +81,7 @@ public override void DrawRibbonClusterEdge(PaletteRibbonShape shape, /// /// Color palette to use when rendering toolstrip. /// - public override ToolStripRenderer RenderToolStrip(IPalette colorPalette) + public override ToolStripRenderer RenderToolStrip(PaletteBase colorPalette) { Debug.Assert(colorPalette != null); diff --git a/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderSparkle.cs b/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderSparkle.cs index 73ad57b73..be69c59ac 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderSparkle.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderSparkle.cs @@ -290,7 +290,7 @@ public override void DrawInputControlNumericDownGlyph(RenderContext context, /// /// Color palette to use when rendering toolstrip. /// - public override ToolStripRenderer RenderToolStrip(IPalette colorPalette) + public override ToolStripRenderer RenderToolStrip(PaletteBase colorPalette) { Debug.Assert(colorPalette != null); diff --git a/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderStandard.cs b/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderStandard.cs index 7646b2119..057b411dd 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderStandard.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Rendering/RenderStandard.cs @@ -375,7 +375,7 @@ static RenderStandard() /// Gets a renderer for drawing the toolstrips. /// /// Color palette to use when rendering toolstrip. - public override ToolStripRenderer RenderToolStrip(IPalette colorPalette) + public override ToolStripRenderer RenderToolStrip(PaletteBase colorPalette) { Debug.Assert(colorPalette != null); @@ -2352,7 +2352,7 @@ public override void DrawSeparator(RenderContext context, /// Should check box be Displayed as pressed. /// public override Size GetCheckBoxPreferredSize(ViewLayoutContext context, - IPalette palette, + PaletteBase palette, bool enabled, CheckState checkState, bool tracking, @@ -2403,7 +2403,7 @@ public override Size GetCheckBoxPreferredSize(ViewLayoutContext context, /// public override void DrawCheckBox(RenderContext context, Rectangle displayRect, - IPalette palette, + PaletteBase palette, bool enabled, CheckState checkState, bool tracking, @@ -2458,7 +2458,7 @@ public override void DrawCheckBox(RenderContext context, /// Should check box be Displayed as hot tracking. /// Should check box be Displayed as pressed. public override Size GetRadioButtonPreferredSize(ViewLayoutContext context, - IPalette palette, + PaletteBase palette, bool enabled, bool checkState, bool tracking, @@ -2494,7 +2494,7 @@ public override Size GetRadioButtonPreferredSize(ViewLayoutContext context, /// public override void DrawRadioButton(RenderContext context, Rectangle displayRect, - IPalette palette, + PaletteBase palette, bool enabled, bool checkState, bool tracking, @@ -2547,7 +2547,7 @@ public override void DrawRadioButton(RenderContext context, /// State for which image size is needed. /// How to orientate the image. public override Size GetDropDownButtonPreferredSize(ViewLayoutContext context, - IPalette palette, + PaletteBase palette, PaletteState state, VisualOrientation orientation) { @@ -2582,7 +2582,7 @@ public override Size GetDropDownButtonPreferredSize(ViewLayoutContext context, /// public override void DrawDropDownButton(RenderContext context, Rectangle displayRect, - IPalette palette, + PaletteBase palette, PaletteState state, VisualOrientation orientation) { diff --git a/Source/Krypton Components/Krypton.Toolkit/Rendering/ThemeManager.cs b/Source/Krypton Components/Krypton.Toolkit/Rendering/ThemeManager.cs index 49082f920..8728d717d 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Rendering/ThemeManager.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Rendering/ThemeManager.cs @@ -10,6 +10,8 @@ */ #endregion +using Krypton.Toolkit.Utilities; + namespace Krypton.Toolkit { /// @@ -21,100 +23,56 @@ public class ThemeManager /// /// The supported themes /// - private static readonly string[] _supportedThemes = - { - "Professional - System", - - "Professional - Office 2003", - - "Office 2007 - Black", - - "Office 2007 - Black (Dark Mode)", - - //"Office 2007 - Black (Light Mode)", - - "Office 2007 - Blue", - - "Office 2007 - Blue (Dark Mode)", - - "Office 2007 - Blue (Light Mode)", - - "Office 2007 - Dark Gray", - - "Office 2007 - Silver", - - "Office 2007 - Silver (Dark Mode)", - - "Office 2007 - Silver (Light Mode)", - - "Office 2010 - Black", - - "Office 2010 - Black (Dark Mode)", - - //"Office 2010 - Black (Light Mode)", - - "Office 2010 - Blue", - - "Office 2010 - Blue (Dark Mode)", - - "Office 2010 - Blue (Light Mode)", - - "Office 2010 - Dark Gray", - - "Office 2010 - Silver", - - "Office 2010 - Silver (Dark Mode)", - - "Office 2010 - Silver (Light Mode)", - - "Office 2010 - White", - - "Office 2013 - White", - - "Office 2013 - Dark Gray", - - "Microsoft 365 - Black", - - "Microsoft 365 - Black (Dark Mode)", - - //"Microsoft 365 - Black (Light Mode)", - - "Microsoft 365 - Blue", - - "Microsoft 365 - Blue (Dark Mode)", - - "Microsoft 365 - Blue (Light Mode)", - - "Microsoft 365 - Dark Gray", - - "Microsoft 365 - Silver", - - "Microsoft 365 - Silver (Dark Mode)", - - "Microsoft 365 - Silver (Light Mode)", - - "Microsoft 365 - White", - - "Sparkle - Blue", - - "Sparkle - Blue (Dark Mode)", - - "Sparkle - Blue (Light Mode)", - - "Sparkle - Orange", - - "Sparkle - Orange (Dark Mode)", - - "Sparkle - Orange (Light Mode)", - - "Sparkle - Purple", - - "Sparkle - Purple (Dark Mode)", - - "Sparkle - Purple (Light Mode)", + /// 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 + { + { @"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 } + }); - "Custom" - }; #endregion #region Instance Fields @@ -128,7 +86,7 @@ public class ThemeManager /// /// The supported theme array. /// - public static string[] SupportedThemeArray => _supportedThemes; + public static ICollection SupportedInternalThemeNames => _supportedThemes.GetAllFirsts(); #endregion @@ -265,147 +223,7 @@ private static PaletteMode ReturnPaletteMode(PaletteModeManager paletteModeManag /// The manager. public static void ApplyTheme(string themeName, KryptonManager manager) { - switch (themeName) - { - case @"Custom": - ApplyTheme(PaletteModeManager.Custom, manager); - break; - case @"Professional - System": - ApplyTheme(PaletteModeManager.ProfessionalSystem, manager); - break; - case @"Professional - Office 2003": - ApplyTheme(PaletteModeManager.ProfessionalOffice2003, manager); - break; - case @"Office 2007 - Blue": - ApplyTheme(PaletteModeManager.Office2007Blue, manager); - break; - case @"Office 2007 - Blue (Dark Mode)": - ApplyTheme(PaletteModeManager.Office2007BlueDarkMode, manager); - break; - case @"Office 2007 - Blue (Light Mode)": - ApplyTheme(PaletteModeManager.Office2007BlueLightMode, manager); - break; - case @"Office 2007 - Silver": - ApplyTheme(PaletteModeManager.Office2007Silver, manager); - break; - case @"Office 2007 - Silver (Dark Mode)": - ApplyTheme(PaletteModeManager.Office2007SilverDarkMode, manager); - break; - case @"Office 2007 - Silver (Light Mode)": - ApplyTheme(PaletteModeManager.Office2007SilverLightMode, manager); - break; - case @"Office 2007 - White": - ApplyTheme(PaletteModeManager.Office2007White, manager); - break; - case @"Office 2007 - Black": - ApplyTheme(PaletteModeManager.Office2007Black, manager); - break; - case @"Office 2007 - Black (Dark Mode)": - ApplyTheme(PaletteModeManager.Office2007BlackDarkMode, manager); - break; - case @"Office 2007 - Dark Gray": - ApplyTheme(PaletteModeManager.Office2007DarkGray, manager); - break; - case @"Office 2010 - Blue": - ApplyTheme(PaletteModeManager.Office2010Blue, manager); - break; - case @"Office 2010 - Blue (Dark Mode)": - ApplyTheme(PaletteModeManager.Office2010BlueDarkMode, manager); - break; - case @"Office 2010 - Blue (Light Mode)": - ApplyTheme(PaletteModeManager.Office2010BlueLightMode, manager); - break; - case @"Office 2010 - Silver": - ApplyTheme(PaletteModeManager.Office2010Silver, manager); - break; - case @"Office 2010 - Silver (Dark Mode)": - ApplyTheme(PaletteModeManager.Office2010SilverDarkMode, manager); - break; - case @"Office 2010 - Silver (Light Mode)": - ApplyTheme(PaletteModeManager.Office2010SilverLightMode, manager); - break; - case @"Office 2010 - White": - ApplyTheme(PaletteModeManager.Office2010White, manager); - break; - case @"Office 2010 - Black": - ApplyTheme(PaletteModeManager.Office2010Black, manager); - break; - case @"Office 2010 - Black (Dark Mode)": - ApplyTheme(PaletteModeManager.Office2010BlackDarkMode, manager); - break; - case @"Office 2010 - Dark Gray": - ApplyTheme(PaletteModeManager.Office2010DarkGray, manager); - break; - case @"Office 2013 - Dark Gray": - ApplyTheme(PaletteModeManager.Office2013DarkGray, manager); - break; - /*case @"Office 2013": - ApplyTheme(PaletteModeManager.Office2013, manager); - break;*/ - case @"Office 2013 - White": - ApplyTheme(PaletteModeManager.Office2013White, manager); - break; - case @"Sparkle - Blue": - ApplyTheme(PaletteModeManager.SparkleBlue, manager); - break; - case @"Sparkle - Blue (Dark Mode)": - ApplyTheme(PaletteModeManager.SparkleBlueDarkMode, manager); - break; - case @"Sparkle - Blue (Light Mode)": - ApplyTheme(PaletteModeManager.SparkleBlueLightMode, manager); - break; - case @"Sparkle - Orange": - ApplyTheme(PaletteModeManager.SparkleOrange, manager); - break; - case @"Sparkle - Orange (Dark Mode)": - ApplyTheme(PaletteModeManager.SparkleOrangeDarkMode, manager); - break; - case @"Sparkle - Orange (Light Mode)": - ApplyTheme(PaletteModeManager.SparkleOrangeLightMode, manager); - break; - case @"Sparkle - Purple": - ApplyTheme(PaletteModeManager.SparklePurple, manager); - break; - case @"Sparkle - Purple (Dark Mode)": - ApplyTheme(PaletteModeManager.SparklePurpleDarkMode, manager); - break; - case @"Sparkle - Purple (Light Mode)": - ApplyTheme(PaletteModeManager.SparklePurpleLightMode, manager); - break; - case @"Microsoft 365 - Blue": - ApplyTheme(PaletteModeManager.Microsoft365Blue, manager); - break; - case @"Microsoft 365 - Blue (Dark Mode)": - ApplyTheme(PaletteModeManager.Microsoft365BlueDarkMode, manager); - break; - case @"Microsoft 365 - Blue (Light Mode)": - ApplyTheme(PaletteModeManager.Microsoft365BlueLightMode, manager); - break; - case @"Microsoft 365 - Silver": - ApplyTheme(PaletteModeManager.Microsoft365Silver, manager); - break; - case @"Microsoft 365 - Silver (Dark Mode)": - ApplyTheme(PaletteModeManager.Microsoft365SilverDarkMode, manager); - break; - case @"Microsoft 365 - Silver (Light Mode)": - ApplyTheme(PaletteModeManager.Microsoft365SilverLightMode, manager); - break; - case @"Microsoft 365 - White": - ApplyTheme(PaletteModeManager.Microsoft365White, manager); - break; - case @"Microsoft 365 - Black": - ApplyTheme(PaletteModeManager.Microsoft365Black, manager); - break; - case @"Microsoft 365 - Black (Dark Mode)": - ApplyTheme(PaletteModeManager.Microsoft365BlackDarkMode, manager); - break; - case @"Microsoft 365 - Dark Gray": - ApplyTheme(PaletteModeManager.Microsoft365DarkGray, manager); - break; - default: - throw new ArgumentNullException(nameof(themeName)); - } - + ApplyTheme(_supportedThemes.GetByFirst(themeName), manager); } /// @@ -437,49 +255,7 @@ public static string ReturnPaletteModeManagerAsString(PaletteModeManager palette { var paletteMode = manager?.GlobalPaletteMode ?? paletteModeManager; - return paletteMode switch - { - PaletteModeManager.Custom => "Custom", - PaletteModeManager.ProfessionalSystem => "Professional - System", - PaletteModeManager.ProfessionalOffice2003 => "Professional - Office 2003", - PaletteModeManager.Office2007Blue => "Office 2007 - Blue", - PaletteModeManager.Office2007BlueDarkMode => "Office 2007 - Blue (Dark Mode)", - PaletteModeManager.Office2007BlueLightMode => "Office 2007 - Blue (Light Mode)", - PaletteModeManager.Office2007Silver => "Office 2007 - Silver", - PaletteModeManager.Office2007SilverDarkMode => "Office 2007 - Silver (Dark Mode)", - PaletteModeManager.Office2007SilverLightMode => "Office 2007 - Silver (Light Mode)", - PaletteModeManager.Office2007White => "Office 2007 - White", - PaletteModeManager.Office2007Black => "Office 2007 - Black", - PaletteModeManager.Office2007BlackDarkMode => "Office 2007 - Black (Dark Mode)", - PaletteModeManager.Office2007DarkGray => "Office 2007 - Dark Gray", - PaletteModeManager.Office2010Blue => "Office 2010 - Blue", - PaletteModeManager.Office2010BlueDarkMode => "Office 2010 - Blue (Dark Mode)", - PaletteModeManager.Office2010BlueLightMode => "Office 2010 - Blue (Light Mode)", - PaletteModeManager.Office2010Silver => "Office 2010 - Silver", - PaletteModeManager.Office2010SilverDarkMode => "Office 2010 - Silver (Dark Mode)", - PaletteModeManager.Office2010SilverLightMode => "Office 2010 - Silver (Light Mode)", - PaletteModeManager.Office2010White => "Office 2010 - White", - PaletteModeManager.Office2010Black => "Office 2010 - Black", - PaletteModeManager.Office2010BlackDarkMode => "Office 2010 - Black (Dark Mode)", - PaletteModeManager.Office2010DarkGray => "Office 2010 - Dark Gray", - PaletteModeManager.Office2013DarkGray => "Office 2013 - Dark Gray", - //PaletteModeManager.Office2013 => "Office 2013", - PaletteModeManager.Office2013White => "Office 2013 - White", - PaletteModeManager.SparkleBlue => "Sparkle - Blue", - PaletteModeManager.SparkleOrange => "Sparkle - Orange", - PaletteModeManager.SparklePurple => "Sparkle - Purple", - PaletteModeManager.Microsoft365Blue => "Microsoft 365 - Blue", - PaletteModeManager.Microsoft365BlueDarkMode => "Microsoft 365 - Blue (Dark Mode)", - PaletteModeManager.Microsoft365BlueLightMode => "Microsoft 365 - Blue (Light Mode)", - PaletteModeManager.Microsoft365Silver => "Microsoft 365 - Silver", - PaletteModeManager.Microsoft365SilverDarkMode => "Microsoft 365 - Silver (Dark Mode)", - PaletteModeManager.Microsoft365SilverLightMode => "Microsoft 365 - Silver (Light Mode)", - PaletteModeManager.Microsoft365White => "Microsoft 365 - White", - PaletteModeManager.Microsoft365Black => "Microsoft 365 - Black", - PaletteModeManager.Microsoft365BlackDarkMode => "Microsoft 365 - Black (Dark Mode)", - PaletteModeManager.Microsoft365DarkGray => "Microsoft 365 - Dark Gray", - _ => null - }; + return _supportedThemes.GetBySecond(paletteMode); } /// @@ -489,14 +265,14 @@ public static string ReturnPaletteModeManagerAsString(PaletteModeManager palette /// The manager. /// A custom theme file. /// if set to true [silent]. - public static void LoadCustomTheme(KryptonPalette palette, KryptonManager manager, string themeFile = "", bool silent = false) + public static void LoadCustomTheme(KryptonCustomPaletteBase palette, KryptonManager manager, string themeFile = "", bool silent = false) { try { //throw new ApplicationException(@"Currently not implemented correctly"); // Declare new instances - palette = new KryptonPalette(); + palette = new KryptonCustomPaletteBase(); manager = new KryptonManager(); @@ -586,7 +362,7 @@ private static void AddToCollection(IList target, string[] excludes) { try { - foreach (var theme in SupportedThemeArray) + foreach (var theme in SupportedInternalThemeNames) { if (!excludes.Any(t => theme.IndexOf(t, StringComparison.InvariantCultureIgnoreCase) > -1)) { @@ -649,30 +425,6 @@ private static void AddToCollection(IList target, string[] excludes) /// Name of the theme. /// The equivalent. public static PaletteModeManager ApplyThemeManagerMode(string themeName) => (PaletteModeManager)Enum.Parse(typeof(PaletteModeManager), themeName); - - /// Returns the theme array. - /// - ///
- ///
- public static string[] ReturnThemeArray() => _supportedThemes; - - /// - /// - /// - public static List PropagateSupportedThemeList() - { - try - { - return ReturnThemeArray().ToList(); - } - catch (Exception e) - { - ExceptionHandler.CaptureException(e); - } - - return new List(); - } - #endregion } } \ No newline at end of file diff --git a/Source/Krypton Components/Krypton.Toolkit/Tooling/DebugTools.cs b/Source/Krypton Components/Krypton.Toolkit/Tooling/DebugTools.cs index 42f90aa94..ea121234e 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Tooling/DebugTools.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Tooling/DebugTools.cs @@ -20,12 +20,12 @@ internal static void NotImplemented(string methodSignature, string className, in if (lineNumber > 0) { KryptonMessageBox.Show($"If you are seeing this message, please submit a new bug report at: https://github.com/Krypton-Suite/Standard-Toolkit/issues/new/choose.\n\nAdditional details:-\nMethod Signature: {methodSignature}\nClass Name: {className}\nLine Number: {lineNumber}", - "Not Implemented", KryptonMessageBoxButtons.OK, KryptonMessageBoxIcon.Information); + "Not Implemented", KryptonMessageBoxButtons.OK, KryptonMessageBoxIcon.SystemError); } else { KryptonMessageBox.Show($"If you are seeing this message, please submit a new bug report at: https://github.com/Krypton-Suite/Standard-Toolkit/issues/new/choose.\n\nAdditional details:-\nMethod Signature: {methodSignature}\nClass Name: {className}", - "Not Implemented", KryptonMessageBoxButtons.OK, KryptonMessageBoxIcon.Information); + "Not Implemented", KryptonMessageBoxButtons.OK, KryptonMessageBoxIcon.SystemError); } } #endregion diff --git a/Source/Krypton Components/Krypton.Toolkit/Utilities/BiDictionary.cs b/Source/Krypton Components/Krypton.Toolkit/Utilities/BiDictionary.cs new file mode 100644 index 000000000..74d8fb5d6 --- /dev/null +++ b/Source/Krypton Components/Krypton.Toolkit/Utilities/BiDictionary.cs @@ -0,0 +1,68 @@ +#region BSD License +/* + * 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. 2022 - 2023. All rights reserved. + * + */ +#endregion + +namespace Krypton.Toolkit.Utilities +{ + /// + /// Taken and then modified from + /// https://stackoverflow.com/questions/255341/getting-multiple-keys-of-specified-value-of-a-generic-dictionary/255638#255638 + /// + /// + /// + internal class BiDictionary + { + private static readonly IList _emptyFirstList = Array.Empty(); + private static readonly IList _emptySecondList = Array.Empty(); + + private readonly IDictionary _firstToSecond = new Dictionary(); + private readonly IDictionary _secondToFirst = new Dictionary(); + + + public BiDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + throw new ArgumentNullException(nameof(dictionary)); + } + + foreach (KeyValuePair keyValuePair in dictionary) + { + this.Add(keyValuePair.Key, keyValuePair.Value); + } + } + + public void Add(TFirst first, TSecond second) + { + _firstToSecond.Add(first, second); + _secondToFirst.Add(second, first); + } + + // Note potential ambiguity using indexers (e.g. mapping from int to int) + // Hence the methods as well... + public TSecond this[TFirst first] => GetByFirst(first); + + public TFirst this[TSecond second] => GetBySecond(second); + + public TSecond GetByFirst(TFirst first) + { + _firstToSecond.TryGetValue(first, out var second); + return second; + } + + public TFirst GetBySecond(TSecond second) + { + _secondToFirst.TryGetValue(second, out var first); + return first; + } + + public ICollection GetAllFirsts() + { + return _firstToSecond.Keys; + } + } +} diff --git a/Source/Krypton Components/Krypton.Toolkit/Utilities/PaletteImageScaler.cs b/Source/Krypton Components/Krypton.Toolkit/Utilities/PaletteImageScaler.cs index eca56f8fa..36522d950 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Utilities/PaletteImageScaler.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Utilities/PaletteImageScaler.cs @@ -35,7 +35,7 @@ public static class PaletteImageScaler /// multiplier from dpi of 96 X /// multiplier from dpi of 96 Y /// KryptonPalette - public static void ScalePalette(float factorDpiX, float factorDpiY, KryptonPalette pal) + public static void ScalePalette(float factorDpiX, float factorDpiY, KryptonCustomPaletteBase pal) { if (pal == null //|| pal.HasAlreadyBeenScaled diff --git a/Source/Krypton Components/Krypton.Toolkit/View Draw/ViewDrawButton.cs b/Source/Krypton Components/Krypton.Toolkit/View Draw/ViewDrawButton.cs index 1c2b0ebdd..80d089702 100644 --- a/Source/Krypton Components/Krypton.Toolkit/View Draw/ViewDrawButton.cs +++ b/Source/Krypton Components/Krypton.Toolkit/View Draw/ViewDrawButton.cs @@ -234,7 +234,7 @@ public VisualOrientation DropDownOrientation /// /// Gets and sets the drop down capability of the button. /// - public IPalette DropDownPalette + public PaletteBase DropDownPalette { get => _drawDropDownButton.Palette; set => _drawDropDownButton.Palette = value; diff --git a/Source/Krypton Components/Krypton.Toolkit/View Draw/ViewDrawCheckBox.cs b/Source/Krypton Components/Krypton.Toolkit/View Draw/ViewDrawCheckBox.cs index 16eb5ba80..f1332eefd 100644 --- a/Source/Krypton Components/Krypton.Toolkit/View Draw/ViewDrawCheckBox.cs +++ b/Source/Krypton Components/Krypton.Toolkit/View Draw/ViewDrawCheckBox.cs @@ -18,7 +18,7 @@ namespace Krypton.Toolkit public class ViewDrawCheckBox : ViewLeaf { #region Instance Fields - private readonly IPalette _palette; + private readonly PaletteBase _palette; private bool _tracking; #endregion @@ -28,7 +28,7 @@ public class ViewDrawCheckBox : ViewLeaf /// Initialize a new instance of the ViewDrawCheckBox class. ///
/// Palette for source of drawing values. - public ViewDrawCheckBox(IPalette palette) + public ViewDrawCheckBox(PaletteBase palette) { Debug.Assert(palette != null); _palette = palette; diff --git a/Source/Krypton Components/Krypton.Toolkit/View Draw/ViewDrawDropDownButton.cs b/Source/Krypton Components/Krypton.Toolkit/View Draw/ViewDrawDropDownButton.cs index 9c56bd7de..4583e6120 100644 --- a/Source/Krypton Components/Krypton.Toolkit/View Draw/ViewDrawDropDownButton.cs +++ b/Source/Krypton Components/Krypton.Toolkit/View Draw/ViewDrawDropDownButton.cs @@ -41,7 +41,7 @@ public override string ToString() => /// /// Gets and sets the palette to use. /// - public IPalette Palette { get; set; } + public PaletteBase Palette { get; set; } #endregion diff --git a/Source/Krypton Components/Krypton.Toolkit/View Draw/ViewDrawRadioButton.cs b/Source/Krypton Components/Krypton.Toolkit/View Draw/ViewDrawRadioButton.cs index 9c916ff20..05a253fa3 100644 --- a/Source/Krypton Components/Krypton.Toolkit/View Draw/ViewDrawRadioButton.cs +++ b/Source/Krypton Components/Krypton.Toolkit/View Draw/ViewDrawRadioButton.cs @@ -18,7 +18,7 @@ namespace Krypton.Toolkit public class ViewDrawRadioButton : ViewLeaf { #region Instance Fields - private readonly IPalette _palette; + private readonly PaletteBase _palette; #endregion @@ -27,7 +27,7 @@ public class ViewDrawRadioButton : ViewLeaf /// Initialize a new instance of the ViewDrawRadioButton class. ///
/// Palette for source of drawing values. - public ViewDrawRadioButton(IPalette palette) + public ViewDrawRadioButton(PaletteBase palette) { Debug.Assert(palette != null); _palette = palette; diff --git a/Source/Krypton Components/Krypton.Toolkit/View Layout/ViewLayoutMenuItemSelect.cs b/Source/Krypton Components/Krypton.Toolkit/View Layout/ViewLayoutMenuItemSelect.cs index d6ffe586f..5c8b3b3c2 100644 --- a/Source/Krypton Components/Krypton.Toolkit/View Layout/ViewLayoutMenuItemSelect.cs +++ b/Source/Krypton Components/Krypton.Toolkit/View Layout/ViewLayoutMenuItemSelect.cs @@ -68,7 +68,7 @@ public ViewLayoutMenuItemSelect(KryptonContextMenuImageSelect itemSelect, _imageIndexEnd = Math.Min(_imageIndexEnd, _imageCount - 1); _imageIndexCount = Math.Max(0, _imageIndexEnd - _imageIndexStart + 1); - IPalette palette = provider.ProviderPalette ?? KryptonManager.GetPaletteForMode(provider.ProviderPaletteMode); + PaletteBase palette = provider.ProviderPalette ?? KryptonManager.GetPaletteForMode(provider.ProviderPaletteMode); // Create triple that can be used by the draw button _triple = new PaletteTripleToPalette(palette,