Skip to content

Commit

Permalink
* Implement #387
Browse files Browse the repository at this point in the history
  • Loading branch information
PWagner1 committed Dec 23, 2022
1 parent bc7c53e commit 807572b
Show file tree
Hide file tree
Showing 95 changed files with 267 additions and 256 deletions.
1 change: 1 addition & 0 deletions Documents/Help/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

## 2023-11-xx - Build 2311 - November 2023
<!--* New `Krypton.Toolkit.Suite.Extended.Themes` module, contains controls such as `KryptonManagerExtended`, which supports existing themes plus new application style themes such as Access Purple/Red, Word Blue and more. (**Note:** The controls in this module will only work with `KryptonFormExtended` found in the `Krypton.Toolkit.Suite.Extended.Forms` module)-->
* Implemented [#387](https://github.com/Krypton-Suite/Extended-Toolkit/issues/387), Fix fallout from the removal of `IPalette`
* Implemented [#384](https://github.com/Krypton-Suite/Extended-Toolkit/issues/384), Reduce build configurations
* Resolved [#378](https://github.com/Krypton-Suite/Extended-Toolkit/issues/378), `ExtendedMessageBox` does not support `CancelTryContinue` when built for "ANY" of the supported TFM's
* `KryptonMessageBoxExtended` button states now fall in line with .NET 6.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public override Size GetPreferredSize(Size proposedSize)
{
Size preferredSize = base.GetPreferredSize(proposedSize);

if (ShowSplitOption && !MissingFrameWorkAPIs.IsNullOrWhiteSpace(Text) && TextRenderer.MeasureText(Text, Font).Width + PUSH_BUTTON_WIDTH > preferredSize.Width)
if (ShowSplitOption && !string.IsNullOrWhiteSpace(Text) && TextRenderer.MeasureText(Text, Font).Width + PUSH_BUTTON_WIDTH > preferredSize.Width)
{
return preferredSize + new Size(PUSH_BUTTON_WIDTH + BORDER_SIZE * 2, 0);
}
Expand Down Expand Up @@ -207,7 +207,7 @@ protected override void OnPaint(PaintEventArgs e)

Rectangle focusRectangle = new Rectangle(internalBorder, internalBorder, bounds.Width - _dropDownRectangle.Width - internalBorder, bounds.Height - (internalBorder * 2));

IPalette palette = KryptonManager.CurrentGlobalPalette;
PaletteBase palette = KryptonManager.CurrentGlobalPalette;

Pen shadow = SystemPens.ButtonShadow, face = SystemPens.ButtonFace;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace Krypton.Toolkit.Suite.Extended.Buttons
/// The shield is extracted from the system with LoadImage if possible. Otherwise the shield will be enabled by sending the BCM_SETSHIELD Message to the control.
/// If the operating system is not Windows Vista or higher, no shield will be displayed as there's no such thing as UAC on the target system -> the shield is obsolete.
/// </remarks>
[DefaultEvent("ExecuteProcessAsAdministrator"), DesignerCategory("code"), Description("Krypton UAC Elevated Button"),
[DefaultEvent("ExecuteProcessAsAdministrator"), DesignerCategory("code"), Description("Krypton UAC Elevated Button"),
ToolboxBitmap(typeof(KryptonButton), "ToolboxBitmaps.UACButton.bmp"), ToolboxItem(true)]
public class KryptonUACButtonVersion1 : KryptonButton
{
Expand Down Expand Up @@ -136,19 +136,19 @@ protected override void OnClick(EventArgs e)

OnExecuteProcessAsAdministrator(this, administrativeTask);
}
else if (_assemblyToElevate != null && !MissingFrameWorkAPIs.IsNullOrWhiteSpace(_extraArguments))
else if (_assemblyToElevate != null && !string.IsNullOrWhiteSpace(_extraArguments))
{
ExecuteProcessAsAdministratorEventArgs administrativeTaskWithExtraArguments = new ExecuteProcessAsAdministratorEventArgs(Path.GetFullPath(_assemblyToElevate.Location), _extraArguments);

OnExecuteProcessAsAdministrator(this, administrativeTaskWithExtraArguments);
}
else if (!MissingFrameWorkAPIs.IsNullOrWhiteSpace(_processName))
else if (!string.IsNullOrWhiteSpace(_processName))
{
ExecuteProcessAsAdministratorEventArgs administrativeTask = new ExecuteProcessAsAdministratorEventArgs(_processName);

OnExecuteProcessAsAdministrator(this, administrativeTask);
}
else if (!MissingFrameWorkAPIs.IsNullOrWhiteSpace(_processName) && !MissingFrameWorkAPIs.IsNullOrWhiteSpace(_extraArguments))
else if (!string.IsNullOrWhiteSpace(_processName) && !string.IsNullOrWhiteSpace(_extraArguments))
{
ExecuteProcessAsAdministratorEventArgs administrativeTaskWithExtraArguments = new ExecuteProcessAsAdministratorEventArgs(_processName, _extraArguments);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public void ElevateProcessWithAdministrativeRights(string processName, string ar

bool hasAdministrativeRights = principal.IsInRole(WindowsBuiltInRole.Administrator);

if (MissingFrameWorkAPIs.IsNullOrWhiteSpace(processName)) throw new ArgumentNullException();
if (string.IsNullOrWhiteSpace(processName)) throw new ArgumentNullException();

if (!hasAdministrativeRights)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class CalendarKryptonRenderer : CalendarSystemRenderer
#endregion

#region "Krypton Members"
private IPalette _palette;
private PaletteBase _palette;
//private PaletteRedirect _paletteRedirect;
#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ private void Calendar_Invalidated(object sender, InvalidateEventArgs e)
#endregion

#region ... Krypton ...
private IPalette _palette;
private PaletteBase _palette;
private PaletteRedirect _paletteRedirect;

//Kripton Palette Events
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ private void RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)

private void kcmbAlgorithimType_TextChanged(object sender, EventArgs e)
{
kbtnCancel.Enabled = MissingFrameWorkAPIs.IsNullOrWhiteSpace(kcmbAlgorithimType.Text);
kbtnCancel.Enabled = string.IsNullOrWhiteSpace(kcmbAlgorithimType.Text);
}

private void kcbToggleCase_CheckedChanged(object sender, EventArgs e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ private void RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
#endregion

private string UpdateStatus(string status) => tsslStatus.Text = status;

private void kbtnValidate_Click(object sender, EventArgs e)
{
if (HelperMethods.IsValid(kwlCalculatedCheckSum.Text, ktxtVarifyCheckSum.Text.ToUpper()))
Expand All @@ -721,7 +721,7 @@ private void kbtnValidate_Click(object sender, EventArgs e)

private void ktxtVarifyCheckSum_TextChanged(object sender, EventArgs e)
{
if (MissingFrameWorkAPIs.IsNullOrWhiteSpace(ktxtVarifyCheckSum.Text))
if (string.IsNullOrWhiteSpace(ktxtVarifyCheckSum.Text))
{
ktxtVarifyCheckSum.StateCommon.Border.Color1 = _settings.IntermediateColour;

Expand All @@ -730,7 +730,7 @@ private void ktxtVarifyCheckSum_TextChanged(object sender, EventArgs e)

kbtnValidate.Enabled = true; // MissingFrameWorkAPIs.IsNullOrWhiteSpace(ktxtVarifyCheckSum.Text);

clearTextBoxToolStripMenuItem.Enabled = !MissingFrameWorkAPIs.IsNullOrWhiteSpace(ktxtVarifyCheckSum.Text);
clearTextBoxToolStripMenuItem.Enabled = !string.IsNullOrWhiteSpace(ktxtVarifyCheckSum.Text);
}

private void kbtnCompute_Click(object sender, EventArgs e)
Expand Down Expand Up @@ -833,6 +833,6 @@ private void CalculateHash()
}
}

private void kcmbAlgorithimType_TextChanged(object sender, EventArgs e) => kbtnCompute.Enabled = MissingFrameWorkAPIs.IsNullOrWhiteSpace(kcmbAlgorithimType.Text);
private void kcmbAlgorithimType_TextChanged(object sender, EventArgs e) => kbtnCompute.Enabled = string.IsNullOrWhiteSpace(kcmbAlgorithimType.Text);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class CircularProgressBar : System.Windows.Forms.ProgressBar
private PaletteBorderInheritRedirect _paletteBorder;
private PaletteContentInheritRedirect _paletteContent;

private IPalette _palette;
private PaletteBase _palette;
private PaletteRedirect _paletteRedirect;
#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

namespace Krypton.Toolkit.Suite.Extended.ComboBox
{
[Obsolete("Use 'string.IsNullOrWhiteSpace(string value)' instead")]
internal static class MissingFrameWorkAPIs
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ public enum KnobPointerStyles
private KnobPointerStyles _pointerStyle = KnobPointerStyles.CIRCLE;

#region Krypton
private KryptonManager _manager = new KryptonManager();
private KryptonManager _manager = new();

private PaletteBackInheritRedirect _paletteBack;

private PaletteBorderInheritRedirect _paletteBorder;

private PaletteContentInheritRedirect _paletteContent;

private IPalette _palette;
private PaletteBase _palette;

private PaletteRedirect _paletteRedirect;
#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace Krypton.Toolkit.Suite.Extended.Controls
public class KryptonFlowLayoutPanel : FlowLayoutPanel
{
#region Variables
private IPalette _palette;
private PaletteBase _palette;
private PaletteRedirect _paletteRedirect;
private PaletteBackInheritRedirect _paletteBack;
private PaletteBorderInheritRedirect _paletteBorder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ public class KryptonKnobControlVersion1 : UserControl
private Brush bKnobPoint;

//Palette State
private KryptonManager k_manager = new KryptonManager();
private KryptonManager k_manager = new();
private PaletteBackInheritRedirect m_paletteBack;
private PaletteBorderInheritRedirect m_paletteBorder;
private PaletteContentInheritRedirect m_paletteContent;
//private IDisposable m_mementoContent;
//private IDisposable m_mementoBack1;
//private IDisposable m_mementoBack2;

private IPalette _palette;
private PaletteBase _palette;
private PaletteRedirect _paletteRedirect;

// declare Off screen image and Offscreen graphics
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ public enum KnobPointerStyles
private KnobPointerStyles _pointerStyle = KnobPointerStyles.CIRCLE;

#region Krypton
private KryptonManager _manager = new KryptonManager();
private KryptonManager _manager = new();

private PaletteBackInheritRedirect _paletteBack;

private PaletteBorderInheritRedirect _paletteBorder;

private PaletteContentInheritRedirect _paletteContent;

private IPalette _palette;
private PaletteBase _palette;

private PaletteRedirect _paletteRedirect;
#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class ColourCollection : Collection<Color>, ICloneable, IEquatable<Colour
{
#region Instance Fields

private readonly object _lock = new object();
private readonly object _lock = new();

private IDictionary<int, int> _indexedLookup;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace Krypton.Toolkit.Suite.Extended.Core
public static class ColourExtensions
{
#region Variables
private static Random _randomiser = new Random();
private static Random _randomiser = new();
#endregion

#region Structures
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ public class ColourUtility
#region Variables
private Color _colour;

private Random randomColour = new Random(DateTime.Now.Millisecond);
private Random randomColour = new(DateTime.Now.Millisecond);

private AllMergedColourSettingsManager _colourSettingsManager = new AllMergedColourSettingsManager();
private AllMergedColourSettingsManager _colourSettingsManager = new();
#endregion

#region Constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class CombineColourSettings
#region Variables
private Color _baseColour, _darkColour, _middleColour, _lightColour, _lightestColour, _borderColourPreview, _alternativeNormalTextColourPreview, _normalTextColourPreview, _disabledTextColourPreview, _focusedTextColourPreview, _pressedTextColourPreview, _disabledColourPreview, _linkNormalColourPreview, _linkHoverColourPreview, _linkVisitedColourPreview, _customColourOne, _customColourTwo, _customColourThree, _customColourFour, _customColourFive, _customTextColourOne, _customTextColourTwo, _customTextColourThree, _customTextColourFour, _customTextColourFive, _menuTextColour, _statusTextColour, _ribbonTabTextColour;

private AllMergedColourSettingsManager _colourSettingsManager = new AllMergedColourSettingsManager();
private AllMergedColourSettingsManager _colourSettingsManager = new();
#endregion

#region Properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ public Typeface()

/// <summary>Gets the default typeface.</summary>
/// <returns>Microsoft Sans Serif, 8.25</returns>
public static Font GetDefaultTypeface() => new Font("Microsoft Sans Serif", 8.25f, FontStyle.Regular);
public static Font GetDefaultTypeface() => new("Microsoft Sans Serif", 8.25f, FontStyle.Regular);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public abstract class VisualControlBaseExtended : Control, IKryptonDebug
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;
Expand Down Expand Up @@ -345,7 +345,7 @@ public void ResetPaletteMode()
[Category("Visuals")]
[Description("Custom palette applied to drawing.")]
[DefaultValue(null)]
public IPalette Palette
public PaletteBase Palette
{
[DebuggerStepThrough]
get => _localPalette;
Expand All @@ -356,7 +356,7 @@ public IPalette Palette
if (_localPalette != value)
{
// Remember the starting palette
IPalette old = _localPalette;
PaletteBase old = _localPalette;

// Use the provided palette value
SetPalette(value);
Expand Down Expand Up @@ -459,7 +459,7 @@ public ViewManager GetViewManager()
/// </summary>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public IPalette GetResolvedPalette()
public PaletteBase GetResolvedPalette()
{
return _palette;
}
Expand Down Expand Up @@ -1238,7 +1238,7 @@ protected virtual void ContextMenuClosed()
#endregion

#region Implementation
private void SetPalette(IPalette palette)
private void SetPalette(PaletteBase palette)
{
if (palette != _palette)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ namespace Krypton.Toolkit.Suite.Extended.Core
public class PaletteImportManager
{
#region Variables
private KryptonPalette _palette;
private KryptonCustomPaletteBase _palette;

private AllMergedColourSettingsManager _colourSettingsManager = new AllMergedColourSettingsManager();
private AllMergedColourSettingsManager _colourSettingsManager = new();

private GlobalStringSettingsManager _globalStringSettingsManager = new GlobalStringSettingsManager();
private GlobalStringSettingsManager _globalStringSettingsManager = new();
#endregion

#region Constructors
Expand All @@ -46,7 +46,7 @@ public PaletteImportManager()
#endregion

#region Methods
public void ImportColourScheme(KryptonPalette palette)
public void ImportColourScheme(KryptonCustomPaletteBase palette)
{
try
{
Expand Down Expand Up @@ -112,7 +112,7 @@ public void ImportColourScheme()
{
try
{
_palette = new KryptonPalette();
_palette = new();

_palette.Import();

Expand Down Expand Up @@ -169,7 +169,7 @@ public void ImportColourScheme()
}

#region New Methods
public static void ImportPaletteColourScheme(KryptonPalette palette)
public static void ImportPaletteColourScheme(KryptonCustomPaletteBase palette)
{
GlobalStringSettingsManager globalStringSettingsManager = new GlobalStringSettingsManager();

Expand Down Expand Up @@ -259,7 +259,7 @@ public static void ImportPaletteColourScheme()

try
{
KryptonPalette palette = new KryptonPalette();
KryptonCustomPaletteBase palette = new();

palette.Import();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class RandomNumberGenerator
#region Variables
private int _alphaValue, _redValue, _greenValue, _blueValue, _hueValue; //, _max = byte.MaxValue + 1;

private Random _randomColourGenerator = new Random();
private Random _randomColourGenerator = new();
#endregion

#region Properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace Krypton.Toolkit.Suite.Extended.Core
public class SettingsManagerAlternative
{
#region Variables
private CoreSettings _mySettings = new CoreSettings();
private CoreSettings _mySettings = new();
#endregion

#region Constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static void InitialiseTypefaceStyles(KryptonListBox typefaceStyleSelectio
}
}

public static Font DefaultTypeface() => new Font("Microsoft Sans Serif", 8.25f, FontStyle.Regular);
public static Font DefaultTypeface() => new("Microsoft Sans Serif", 8.25f, FontStyle.Regular);

public static void UpdateTypefaceStyles()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class ThemingLogic
{
#region Variables
private IThemeOptions _themeOptions;
private PaletteThemeSettingsManager _paletteThemeSettingsManager = new PaletteThemeSettingsManager();
private PaletteThemeSettingsManager _paletteThemeSettingsManager = new();
#endregion

#region Constructors
Expand Down
Loading

0 comments on commit 807572b

Please sign in to comment.