diff --git a/.gitignore b/.gitignore
index e61c3af33..cb8206bc1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -325,3 +325,10 @@ Installer Project Files/Krypton Toolkit Suite/Krypton Toolkit Suite-cache/part1/
Source\Miscellaneous Toolkit Items\Krypton Toolkit Documentation\Help
*.bak
Source/Krypton Components/Temp.txt
+
+# Don't ignore these files
+!Source/Krypton Components/TestForm/invoices.xml
+
+# Log files
+/Logs
+Source/Krypton Components/Krypton.Ribbon/Temp.txt
diff --git a/Assets/PDN/New Logo Green.pdn b/Assets/PDN/New Logo Green.pdn
deleted file mode 100644
index 8070481a6..000000000
Binary files a/Assets/PDN/New Logo Green.pdn and /dev/null differ
diff --git a/Assets/PDN/New Logo.pdn b/Assets/PDN/New Logo.pdn
deleted file mode 100644
index 85a300cf2..000000000
Binary files a/Assets/PDN/New Logo.pdn and /dev/null differ
diff --git a/Assets/PNG/Main Icon/128 x 128/Main Icon 128 x 128 Canary.png b/Assets/PNG/Main Icon/128 x 128/Krypton 128 x 128 Canary.png
similarity index 100%
rename from Assets/PNG/Main Icon/128 x 128/Main Icon 128 x 128 Canary.png
rename to Assets/PNG/Main Icon/128 x 128/Krypton 128 x 128 Canary.png
diff --git a/Assets/PNG/Main Icon/128 x 128/Krypton 128 x 128 LTS.png b/Assets/PNG/Main Icon/128 x 128/Krypton 128 x 128 LTS.png
new file mode 100644
index 000000000..4f410ad94
Binary files /dev/null and b/Assets/PNG/Main Icon/128 x 128/Krypton 128 x 128 LTS.png differ
diff --git a/Assets/PNG/Main Icon/128 x 128/Main Icon 128 x 128 Nightly.png b/Assets/PNG/Main Icon/128 x 128/Krypton 128 x 128 Nightly.png
similarity index 100%
rename from Assets/PNG/Main Icon/128 x 128/Main Icon 128 x 128 Nightly.png
rename to Assets/PNG/Main Icon/128 x 128/Krypton 128 x 128 Nightly.png
diff --git a/Assets/PNG/Main Icon/128 x 128/Square Design 128 x 128 Green.png b/Assets/PNG/Main Icon/128 x 128/Krypton 128 x 128 Stable.png
similarity index 100%
rename from Assets/PNG/Main Icon/128 x 128/Square Design 128 x 128 Green.png
rename to Assets/PNG/Main Icon/128 x 128/Krypton 128 x 128 Stable.png
diff --git a/Assets/PNG/Main Icon/16 x 16/Main Icon 16 x 16 Canary.png b/Assets/PNG/Main Icon/16 x 16/Krypton 16 x 16 Canary.png
similarity index 100%
rename from Assets/PNG/Main Icon/16 x 16/Main Icon 16 x 16 Canary.png
rename to Assets/PNG/Main Icon/16 x 16/Krypton 16 x 16 Canary.png
diff --git a/Assets/PNG/Main Icon/16 x 16/Krypton 16 x 16 LTS.png b/Assets/PNG/Main Icon/16 x 16/Krypton 16 x 16 LTS.png
new file mode 100644
index 000000000..a96a84014
Binary files /dev/null and b/Assets/PNG/Main Icon/16 x 16/Krypton 16 x 16 LTS.png differ
diff --git a/Assets/PNG/Main Icon/16 x 16/Main Icon 16 x 16 Nightly.png b/Assets/PNG/Main Icon/16 x 16/Krypton 16 x 16 Nightly.png
similarity index 100%
rename from Assets/PNG/Main Icon/16 x 16/Main Icon 16 x 16 Nightly.png
rename to Assets/PNG/Main Icon/16 x 16/Krypton 16 x 16 Nightly.png
diff --git a/Assets/PNG/Main Icon/16 x 16/Square Design 16 x 16 Green.png b/Assets/PNG/Main Icon/16 x 16/Krypton 16 x 16 Stable.png
similarity index 100%
rename from Assets/PNG/Main Icon/16 x 16/Square Design 16 x 16 Green.png
rename to Assets/PNG/Main Icon/16 x 16/Krypton 16 x 16 Stable.png
diff --git a/Assets/PNG/Main Icon/24 x 24/Main Icon 24 x 24 Canary.png b/Assets/PNG/Main Icon/24 x 24/Krypton 24 x 24 Canary.png
similarity index 100%
rename from Assets/PNG/Main Icon/24 x 24/Main Icon 24 x 24 Canary.png
rename to Assets/PNG/Main Icon/24 x 24/Krypton 24 x 24 Canary.png
diff --git a/Assets/PNG/Main Icon/24 x 24/Krypton 24 x 24 LTS.png b/Assets/PNG/Main Icon/24 x 24/Krypton 24 x 24 LTS.png
new file mode 100644
index 000000000..28379d00f
Binary files /dev/null and b/Assets/PNG/Main Icon/24 x 24/Krypton 24 x 24 LTS.png differ
diff --git a/Assets/PNG/Main Icon/24 x 24/Main Icon 24 x 24 Nightly.png b/Assets/PNG/Main Icon/24 x 24/Krypton 24 x 24 Nightly.png
similarity index 100%
rename from Assets/PNG/Main Icon/24 x 24/Main Icon 24 x 24 Nightly.png
rename to Assets/PNG/Main Icon/24 x 24/Krypton 24 x 24 Nightly.png
diff --git a/Assets/PNG/Main Icon/24 x 24/Square Design 24 x 24 Green.png b/Assets/PNG/Main Icon/24 x 24/Krypton 24 x 24 Stable.png
similarity index 100%
rename from Assets/PNG/Main Icon/24 x 24/Square Design 24 x 24 Green.png
rename to Assets/PNG/Main Icon/24 x 24/Krypton 24 x 24 Stable.png
diff --git a/Assets/PNG/Main Icon/256 x 256/Main Icon 256 x 256 Canary.png b/Assets/PNG/Main Icon/256 x 256/Krypton 256 x 256 Canary.png
similarity index 100%
rename from Assets/PNG/Main Icon/256 x 256/Main Icon 256 x 256 Canary.png
rename to Assets/PNG/Main Icon/256 x 256/Krypton 256 x 256 Canary.png
diff --git a/Assets/PNG/Main Icon/256 x 256/Krypton 256 x 256 LTS.png b/Assets/PNG/Main Icon/256 x 256/Krypton 256 x 256 LTS.png
new file mode 100644
index 000000000..5f713cb67
Binary files /dev/null and b/Assets/PNG/Main Icon/256 x 256/Krypton 256 x 256 LTS.png differ
diff --git a/Assets/PNG/Main Icon/256 x 256/Main Icon 256 x 256 Nightly.png b/Assets/PNG/Main Icon/256 x 256/Krypton 256 x 256 Nightly.png
similarity index 100%
rename from Assets/PNG/Main Icon/256 x 256/Main Icon 256 x 256 Nightly.png
rename to Assets/PNG/Main Icon/256 x 256/Krypton 256 x 256 Nightly.png
diff --git a/Assets/PNG/Main Icon/256 x 256/Square Design 256 x 256 Green.png b/Assets/PNG/Main Icon/256 x 256/Krypton 256 x 256 Stable.png
similarity index 100%
rename from Assets/PNG/Main Icon/256 x 256/Square Design 256 x 256 Green.png
rename to Assets/PNG/Main Icon/256 x 256/Krypton 256 x 256 Stable.png
diff --git a/Assets/PNG/Main Icon/32 x 32/Main Icon 32 x 32 Canary.png b/Assets/PNG/Main Icon/32 x 32/Krypton 32 x 32 Canary.png
similarity index 100%
rename from Assets/PNG/Main Icon/32 x 32/Main Icon 32 x 32 Canary.png
rename to Assets/PNG/Main Icon/32 x 32/Krypton 32 x 32 Canary.png
diff --git a/Assets/PNG/Main Icon/32 x 32/Krypton 32 x 32 LTS.png b/Assets/PNG/Main Icon/32 x 32/Krypton 32 x 32 LTS.png
new file mode 100644
index 000000000..c84b0c075
Binary files /dev/null and b/Assets/PNG/Main Icon/32 x 32/Krypton 32 x 32 LTS.png differ
diff --git a/Assets/PNG/Main Icon/32 x 32/Main Icon 32 x 32 Nightly.png b/Assets/PNG/Main Icon/32 x 32/Krypton 32 x 32 Nightly.png
similarity index 100%
rename from Assets/PNG/Main Icon/32 x 32/Main Icon 32 x 32 Nightly.png
rename to Assets/PNG/Main Icon/32 x 32/Krypton 32 x 32 Nightly.png
diff --git a/Assets/PNG/Main Icon/32 x 32/Square Design 32 x 32 Green.png b/Assets/PNG/Main Icon/32 x 32/Krypton 32 x 32 Stable.png
similarity index 100%
rename from Assets/PNG/Main Icon/32 x 32/Square Design 32 x 32 Green.png
rename to Assets/PNG/Main Icon/32 x 32/Krypton 32 x 32 Stable.png
diff --git a/Assets/PNG/Main Icon/48 x 48/Main Icon 48 x 48 Canary.png b/Assets/PNG/Main Icon/48 x 48/Krypton 48 x 48 Canary.png
similarity index 100%
rename from Assets/PNG/Main Icon/48 x 48/Main Icon 48 x 48 Canary.png
rename to Assets/PNG/Main Icon/48 x 48/Krypton 48 x 48 Canary.png
diff --git a/Assets/PNG/Main Icon/48 x 48/Krypton 48 x 48 LTS.png b/Assets/PNG/Main Icon/48 x 48/Krypton 48 x 48 LTS.png
new file mode 100644
index 000000000..7dd0c6f95
Binary files /dev/null and b/Assets/PNG/Main Icon/48 x 48/Krypton 48 x 48 LTS.png differ
diff --git a/Assets/PNG/Main Icon/48 x 48/Main Icon 48 x 48 Nightly.png b/Assets/PNG/Main Icon/48 x 48/Krypton 48 x 48 Nightly.png
similarity index 100%
rename from Assets/PNG/Main Icon/48 x 48/Main Icon 48 x 48 Nightly.png
rename to Assets/PNG/Main Icon/48 x 48/Krypton 48 x 48 Nightly.png
diff --git a/Assets/PNG/Main Icon/48 x 48/Square Design 48 x 48 Green.png b/Assets/PNG/Main Icon/48 x 48/Krypton 48 x 48 Stable.png
similarity index 100%
rename from Assets/PNG/Main Icon/48 x 48/Square Design 48 x 48 Green.png
rename to Assets/PNG/Main Icon/48 x 48/Krypton 48 x 48 Stable.png
diff --git a/Assets/PNG/Main Icon/512 x 512/Main Icon 512 x 512 Canary.png b/Assets/PNG/Main Icon/512 x 512/Krypton 512 x 512 Canary.png
similarity index 100%
rename from Assets/PNG/Main Icon/512 x 512/Main Icon 512 x 512 Canary.png
rename to Assets/PNG/Main Icon/512 x 512/Krypton 512 x 512 Canary.png
diff --git a/Assets/PNG/Main Icon/512 x 512/Krypton 512 x 512 LTS.png b/Assets/PNG/Main Icon/512 x 512/Krypton 512 x 512 LTS.png
new file mode 100644
index 000000000..2a2599cb0
Binary files /dev/null and b/Assets/PNG/Main Icon/512 x 512/Krypton 512 x 512 LTS.png differ
diff --git a/Assets/PNG/Main Icon/512 x 512/Main Icon 512 x 512 Nightly.png b/Assets/PNG/Main Icon/512 x 512/Krypton 512 x 512 Nightly.png
similarity index 100%
rename from Assets/PNG/Main Icon/512 x 512/Main Icon 512 x 512 Nightly.png
rename to Assets/PNG/Main Icon/512 x 512/Krypton 512 x 512 Nightly.png
diff --git a/Assets/PNG/Main Icon/512 x 512/Square Design 512 x 512 Green.png b/Assets/PNG/Main Icon/512 x 512/Krypton 512 x 512 Stable.png
similarity index 100%
rename from Assets/PNG/Main Icon/512 x 512/Square Design 512 x 512 Green.png
rename to Assets/PNG/Main Icon/512 x 512/Krypton 512 x 512 Stable.png
diff --git a/Assets/PNG/Main Icon/64 x 64/Main Icon 64 x 64 Canary.png b/Assets/PNG/Main Icon/64 x 64/Krypton 64 x 64 Canary.png
similarity index 100%
rename from Assets/PNG/Main Icon/64 x 64/Main Icon 64 x 64 Canary.png
rename to Assets/PNG/Main Icon/64 x 64/Krypton 64 x 64 Canary.png
diff --git a/Assets/PNG/Main Icon/64 x 64/Krypton 64 x 64 LTS.png b/Assets/PNG/Main Icon/64 x 64/Krypton 64 x 64 LTS.png
new file mode 100644
index 000000000..6fdf65776
Binary files /dev/null and b/Assets/PNG/Main Icon/64 x 64/Krypton 64 x 64 LTS.png differ
diff --git a/Assets/PNG/Main Icon/64 x 64/Main Icon 64 x 64 Nightly.png b/Assets/PNG/Main Icon/64 x 64/Krypton 64 x 64 Nightly.png
similarity index 100%
rename from Assets/PNG/Main Icon/64 x 64/Main Icon 64 x 64 Nightly.png
rename to Assets/PNG/Main Icon/64 x 64/Krypton 64 x 64 Nightly.png
diff --git a/Assets/PNG/Main Icon/64 x 64/Main Icon 64 x 64.png b/Assets/PNG/Main Icon/64 x 64/Krypton 64 x 64 Stable.png
similarity index 100%
rename from Assets/PNG/Main Icon/64 x 64/Main Icon 64 x 64.png
rename to Assets/PNG/Main Icon/64 x 64/Krypton 64 x 64 Stable.png
diff --git a/Assets/PNG/NuGet Package Icons/Krypton LTS.png b/Assets/PNG/NuGet Package Icons/Krypton LTS.png
new file mode 100644
index 000000000..6fdf65776
Binary files /dev/null and b/Assets/PNG/NuGet Package Icons/Krypton LTS.png differ
diff --git a/Assets/PSD/Main Icon/New Logo Canary.psd b/Assets/PSD/Main Icon/New Logo Canary.psd
deleted file mode 100644
index 485e343ff..000000000
Binary files a/Assets/PSD/Main Icon/New Logo Canary.psd and /dev/null differ
diff --git a/Assets/PSD/Main Icon/New Logo Green.psd b/Assets/PSD/Main Icon/New Logo Green.psd
deleted file mode 100644
index f559e479a..000000000
Binary files a/Assets/PSD/Main Icon/New Logo Green.psd and /dev/null differ
diff --git a/Assets/PSD/Main Icon/New Logo Template.psd b/Assets/PSD/Main Icon/New Logo Template.psd
deleted file mode 100644
index 8021e5913..000000000
Binary files a/Assets/PSD/Main Icon/New Logo Template.psd and /dev/null differ
diff --git a/Directory.Build.props b/Directory.Build.props
index af4a64269..98a0e89d9 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -7,16 +7,16 @@
$([System.DateTime]::Now.get_DayOfYear().ToString())
- 80.$(Minor).$(Build).$(Revision)
+ 90.$(Minor).$(Build).$(Revision)
- 80.$(Minor).$(Build).$(Revision)-beta
+ 90.$(Minor).$(Build).$(Revision)-beta
@@ -27,17 +27,17 @@
$([System.DateTime]::Now.get_DayOfYear().ToString())
- 80.$(Minor).$(Build).$(Revision)
+ 90.$(Minor).$(Build).$(Revision)
- 80.$(Minor).$(Build).$(Revision)-alpha
+ 90.$(Minor).$(Build).$(Revision)-alpha
@@ -48,8 +48,8 @@
$([System.DateTime]::Now.get_DayOfYear().ToString())
@@ -57,9 +57,9 @@
- 80.$(Minor).$(Build).$(Revision)
+ 90.$(Minor).$(Build).$(Revision)
- 80.$(Minor).$(Build).$(Revision)
+ 90.$(Minor).$(Build).$(Revision)
@@ -69,16 +69,16 @@
$([System.DateTime]::Now.get_DayOfYear().ToString())
- 80.$(Minor).$(Build).$(Revision)
+ 90.$(Minor).$(Build).$(Revision)
- 80.$(Minor).$(Build).$(Revision)
+ 90.$(Minor).$(Build).$(Revision)
diff --git a/Documents/Help/Changelog.md b/Documents/Changelog/Changelog.md
similarity index 61%
rename from Documents/Help/Changelog.md
rename to Documents/Changelog/Changelog.md
index be737c6fb..f575898a1 100644
--- a/Documents/Help/Changelog.md
+++ b/Documents/Changelog/Changelog.md
@@ -2,16 +2,232 @@
=======
-## 2023-11-17 - Build 2311 (Patch 1) - November 2023
+## 2024-11-12 - Build 2411 - November 2024
+* Resolved [#1820](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1820), When KryptonDataGridView.AutoGenerate is set Winforms columns are used. See the issue for full text.
+* Resolved [#1787](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1787), Office 2007 & 2010 Silver Darkmode themes ribbon buttton tracking colors adjusted.
+* Resolved [#1800](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1800), `KryptonDataGridViewComboBoxEditingControl.EditingControlFormattedValue` property is differently implemented.
+* Resolved [#66](https://github.com/Krypton-Suite/Standard-Toolkit/issues/66), Cannot Add Ribbon-Buttons-Container (KryptonRibbonGroupTripple) when using .netcore onwards [Returns error due to abstract class]
+* Resolved [#1757](https://github.com/Krypton-Suite/Standard-Toolkit/issues1757), KForm has a thin magenta border after the fix of #1749
+* Implemented [#1765](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1765), Colours for `KryptonRibbon` contexts need sorting out
+* Resolved [#1715](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1715), Not Implemented Exception thrown for `GetRibbonBackColorStyle` `PaletteOffice2010Base.cs`
+* Resolved [#1299](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1299), Ribbon context colours not implemented
+* Resolved [#1749](https://github.com/Krypton-Suite/Standard-Toolkit/issues1749), Rounded Form borders have "Triangles" in corners.
+* Resolved [#1692](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1692), Resolves `KryptonMessageBoxes` incompatibility between message text and dark themes.
+* Implemented [#1734](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1734), Add `ForceDesignerDPIUnaware` option
+* Resolved [#1729](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1729), `KryptonCustomPaletteBase` does not implement ##Tracking states
+* Resolved [#1693](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1693), `KryptonCustomPaletteBase` Illegal characters in path
+* Resolved [#1552](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1552), `KryptonMessageBox` throws an error when using custom theme `Asphalt_v19.xml`.
+* Resolved [#1708](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1708). `KryptonButton` crashes program on invalid type cast.
+* Resolved [#1706](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1706), Restore: `KryptonComboBox` (On Form) does not respect designers `DropDownWidth` setting
+* Resolved [#1704](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1704), Remove properties from `KryptonRichtTextBox`
+* Implemented [#1700](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1700), Adds a method to `CommonHelper` which normalizes line breaks within a string, `CommonHelper.NormalizeLineBreaks`.
+* Resolved [#1685](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1685), Theme Selectors `KryptonManagerGlobalPaletteChanged` event sometimes gets fired while the control is not fully initialized.
+* Resolved [#1689](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1689), MessageBox text is "Hard to read" when using "MS 365 dark theme"
+* Resolved [#1672](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1672), `KryptonContextMenuItemBase`: does not have a "Text" access AP
+* Resolved [#1686](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1686), `TestForm`: MessageBox "No Close button" is not respected anymore
+* Resolved [#1683](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1683), After #1657 `TestForm` forms still have Toolkit Image strings in the designer files
+* Resolved [#1657](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1657), What is/does "GenericToolkitImages" supposed to do
+* Resolved [#1661](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1661), Office 2007 Dark Blue theme: Form Text is hard to read when app loses focus
+* Implemented [#1650](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1650), EditorConfig null masking needs to be "Unhidden"
+* Resolved [#822](https://github.com/Krypton-Suite/Standard-Toolkit/issues/822), Unable to make closed auto hidden docked page visible after config reloading (fix courtesy of [dyurshevich](https://github.com/dyurshevich))
+* Resolved [#1646](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1646), `KryptonRibbonGroupThemeComboBox` does not react to index changes anymore.
+* Resolved [#1633](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1633), `KryptonRibbon` - Clicking the Mini QAT Menu Button causes an exception.
+* Resolved [#1624](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1624), Theme Selector controls default to Professional System theme when set to `PaletteMode.Global`. Instead those shoud default to `ThemeManager.DefaultGlobalPalette`.
+* Resolved [#1628](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1628), Some themes do not render the "ToolStrip" Correctly
+* Implemented [#632](https://github.com/Krypton-Suite/Standard-Toolkit/issues/632), **[Breaking Change]** `KryptonPropertyGrid` should have a customisable back colour.
+* Resolved [#1564](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1564), Disabled Button Text in Ribbons is not visible in some themes
+* Resolved [#1607](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1607), "MS365 - Black" theme is unreadable
+* Resolved [#1581](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1581), **Enhancement** KListview has background problems for disabled view on each "Item" [now with added List and Details Views]
+* Resolved/Implemented [#1597](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1597), Use `KryptonUseRTLLayout` to prevent LTR/RTL issues
+* Resolved/Implemented [#1601](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1601), Rollback `KryptonPaletteCustomBase` ability to use a single schema
+* Resolved [#1593](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1593), KInputBox is stuck in RTL mode
+* RollBack [#1584](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1584), Disable the FadeValues property in VisualForm and move the FadeValues class to Extended. It was a V90 feature but is up for further development in V100.
+* Resolved [#1573](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1573), KCheckedListbox & KListBox do not respect 'disabled' back colours
+* Resolved [#1522](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1522), Declare `ThemeManager.SetTheme()` Obsolete from V100
+* Resolved [#371](https://github.com/Krypton-Suite/Standard-Toolkit/issues/371), Office 365 Black theme ribbon needs better colours for disabled etc.
+* Resolved [#1522](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1522), Declare `ThemeManager.SetTheme()` Obsolete from V100
+* Resolved [#1092](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1092), `KryptonManager.GlobalPaletteMode` property is not updated when a custom theme is assigned.
+* Resolved [#1561](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1561), KryptonRibbonGroup Controls remain enabled at runtime when set to disabled in the designer.
+* Resolved [#1536](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1536), Build script does not follow same behaviour when 'rebuilding'
+* Resolved [#1381](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1508), Update `ButtonSpecAny` `ShowDrop` property description.
+* Resolved [#1381](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1502), Docking Persistence broken since build `##.23.10.303`
+* Resolved [#1522](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1522), **[Breaking Change]** Check `ThemeManager` & `KryptonManager` for the use of hard coded theme indexes. See issue for full details.
+* Resolved [#239](https://github.com/Krypton-Suite/Standard-Toolkit/issues/239), Toolstrip combo boxes do not have the theme background applied
+* Implemented [#1507](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1507), **[Breaking Change]** `KryptonThemeComboBox`, `KryptonThemeListBox` & `KryptonRibbonGroupThemeComboBox`:
+ - All controls had their code base updated to one standard.
+ - The assignment of themes via an index has been removed from all.
+ - The previous has been replaced by assignment per PaletteMode identifier.
+ - All controls do now react to theme changes propagated via the KryptonManager. The control will then synchronize the selected item in the list with the newly activated theme.
+ - Form designer files or your code using a theme selector control might hold references to these properties: `KryptonManager`, `ReportSelectedThemeIndex`, `ThemeSelectedIndex` & `SynchronizeDropDownWidth`. These can, safely, be removed.
+ - The DefaultPalette property is now stored in the designer file and if set, the selected palette wil be loaded when the selector control is instantiated.
+ - The DefaultPalette property can also be used to switch palettes from code.
+* Resolved [#1502](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1502), Fixes some problems creating workspaces introduced through warnings removal.
+* Resolved [#1497](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1497), When pressing ALT to show the Ribbon KeyTips a null reference exception is thrown.
+* Resolved [#1462](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1462), TestForm app: KCombobox from main.cs causes a crash
+* Resolved [#1414](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1414), `SetDate` API is missing from `KryptonMonthCalendar`
+* Resolved [#1138](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1138), BinaryFormatter is deprecated due to possible security risks and will be removed with .NET 9.
+* Resolved [#1490](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1490), **[Regression]** Clean get of alpha branches results in multiple build errors
+* Resolved [#1489](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1489), **[Regression]** KMessageBox (and "Deprecated") using Error Icon plays the wrong sound
+* Resolved [#1461](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1461), Remove designer visibility of MouseDoubleClick and DoubleClick Events for the KryptonComboxBox
+* Resolved [#1478](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1478), Wrongly assigned designers to `KryptonListview` and `KryptonProgressBar` corrected. DesignerActionLists code updated.
+* Resolved [#1475](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1475), Build Scripts will run when no suitable environment is detected. Add 'BinLog' option to `build-*.cmd`
+* Implemented [#1435](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1435), **[Breaking Change]** Take KMB back to the Winform override (Remove Checkbox etc)
+* Implemented [#1432](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1432), Copy `KryptonMessageBox` to `KryptonMessageBoxDep`
+* Resolved [#1424](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1424), **[Breaking Change]** `KryptonMessageBox` does not obey tab characters like `MessageBox`
+* Resolved [#1381](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1381), **[Regression]** Docking Persistence broken since build ##.23.10.303
+* Resolved [#1356](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1356), **[Breaking Change]** AppButton colours don't change while switching themes
+ - See https://github.com/Krypton-Suite/Standard-Toolkit/issues/1356#issuecomment-2039412890
+ - `RibbonAppButton` has become `RibbonFileAppButton`
+ - Addition `RibbonFileAppTab` to hold the tab text (Defaults to `File`)
+ - Colours for the `FileAppTab` have been moved into the `StateCommon` area
+* Resolved [#1301](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1301), **[Regression]** When Maximised - intergrated KryptonRibbon has titlebar issues
+* Resolved [#1383](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1383), Closing last Page in undocked page group prevents addition of further Pages via `KryptonDockingManager.AddToWorkspace` (fix courtesy of [stizler](https://github.com/stigzler))
+* Resolved [#1336](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1336), **[Regression]** KryptonForm has "Black Line" under Titlebar when maximised
+* Resolved [#1370](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1370), **[Regression]** KryptonForm background colour
+* **[Breaking Change]:** The `RibbonStrings` options, usually located in `KryptonRibbon` has been moved to `KryptonManager` -> `ToolkitStrings` -> `RibbonStrings`
+* Resolved [#1363](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1363), Incorrect usage of storage objects
+* Resolved [#1362](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1362), Using today's Alpha and todays alpha Demos: cannot open Outlook Mail Clone Form in the designer
+* Tested [#1188](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1188), Duplicate window titles when window maximized
+* Resolved [#1362](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1362), **[Regression]** Using todays Alpha and todays alpha Demos: cannot open Outlook Mail Clone Form in the designer
+* Tested [#1188](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1188), **[Regression]** Duplicate window titles when window maximized
+* Resolved [#1361](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1361), Opening an existing (Or creating a new) RibbonBar creates incorrect designer code for new `ToolBarImages` object(s)
+* Implemented [#1355](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1355), Ability to merge `KryptonRibbon`s
+ - **Note:** This feature is activated via the `KryptonRibbonMerger` API
+* Resolved issue whereby `CustomFormatMinimumColorButtonText` was assigned `null`, therefore flagging `KryptonOutlookGridStrings` as 'modified'
+* Resolved [#1351](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1351), **[Regression]** KryptonFolderBrowserDialog display and runtime errors
+* Implemented [#1343](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1343), Extend palette to accept `AppButton` colours
+* Resolved [#1337](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1337), ViewManager is visible in the designer as a readonly field, when it should be invisible!
+* Resolved [#1244](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1244), Should `IsDefault` set to be `internal`
+* Implemented [#1329](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1329), Adjust Ribbon colours for tab row
+* Resolved [#1322](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1322), Exception at design time When Assigning CustomPalette to PropertyGrid / TreeGrid
+* Resolved [#1340](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1340), `KryptonPropertyGrid` Category header text colours
+* Resolved [#1331](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1331), Fix white menu text in White themes (2010, 2013, 365); fixes to `KryptonPropertyGrid` and `KryptonThemeComboBox` with regard to theme switching
+* Resolved [#1313](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1313), White background in tabs area
+* Implement [#1309](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1309), Is it time to bring over `KryptonOutlookGrid`
+* Resolved [#1316](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1316), `KryptonCustomPaletteBase` Import fails if XML contains images (fix courtesy of [tobitege](https://github.com/tobitege))
+* Resolved [#876](https://github.com/Krypton-Suite/Standard-Toolkit/issues/876), **[Regression]** `Office 365 - Black` does not display text correctly
+* Resolved [#1308](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1308), `RibbonAppButton.cs` - **FormCloseBoxVisible**: null reference exception
+* Resolved [#1266](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1266), **[Regression]** **[Breaking Change]** Since V 5.400, the QAT button is supposed to perform the close, therefore the Close Form button should not be visible
+* Resolved [#313](https://github.com/Krypton-Suite/Standard-Toolkit/issues/313), **[Regression]** `KryptonMessagebox` is not RTL compliant
+* Resolved [#1269](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1269), **[Breaking Change]** Remove AllowFormIntegrate to give consistent experience on all supported OS's
+* Resolved [#1268](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1268), **[Breaking Change]** Many Krypton Controls have a CornerRoundingRadius that overrides the State#### Node Rounding values. Please remove!
+* Resolved [#1245](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1245), Visual Studio do not open Form after Nuget-Package-Update
+* Resolved [#1243](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1243), Krypton Navigator - Outlook Full Nav Mode
+* Resolved / Implemented [#215](https://github.com/Krypton-Suite/Standard-Toolkit/issues/215), **[Breaking Change]** `KryptonTreeView` Multi Node Select
+* Resolved [#1249](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1249), Ribbon Form Bars are no longer Drawn with the theme colouring
+* Resolved [#1255](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1255), **[Breaking Change]** Why does `CornerRoundingRadius` override the KRyptonForm StateCommon.Border.Rounding value
+* Resolved [#1252](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1252),Using V80, Setting a "Fat" Form border leads to poor layout
+* Implemented [#327](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1220), (Name) and other Standard-Properties in KryptonContextMenu Items Editor
+* Resolved [#1247](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1247),`VisualMessageBoxForm` Throws Exception when run from Example Code
+* Implemented [#1220](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1220), Is it time to bring over `KryptonToast`s
+ - [#1237](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1237), Core 'Toast' UI
+ - [#1238](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1238), New `KryptonToastManager`
+ - [#1239](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1239), Toasts should behave like a `KryptonMessageBox`
+ - [#1240](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1240), New fade in/out ability for `KryptonForm`s
+ - **Note:** The developer must explicitly enable this feature, as it is turned off by default
+ - [#1281](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1281), Implement User Input Types
+ - [#1291](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1291), Make `KryptonToastNotification` RTL Aware
+ - [#1292](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1292), `KryptonToastNotification`: Add support for border colouring
+* Resolved [#238](https://github.com/Krypton-Suite/Standard-Toolkit/issues/238), Dark / light Mode themes do not modify the calendar control background
+* Implemented [#139](https://github.com/Krypton-Suite/Standard-Toolkit/issues/139), Themes (via KryptonManager design option) should have option to respect Current Metrics for Form Border widths
+* Implemented [#124](https://github.com/Krypton-Suite/Standard-Toolkit/issues/124), **[Breaking Change]** When setting AllowFormChrome = false, then the Form Bar should still be Theme rendered
+* Implemented [#1224](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1224), **[Breaking Change]** Move `GlobalPaletteMode` into `GlobalPalette` and rename
+* Implemented [#1223](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1223), Move `UseKryptonFileDialogs` to a better designer location
+* Implemented [#1222](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1222), Remove `CustomPalette` (Should be part of the palette definition)
+* Implemented [#1204](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1204), Build on `KryptonCommandLinkButtons`
+ - [#1218](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1218), Default 'arrow' images, depending on OS version
+ - [#1217](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1217), Add support for text alignment
+ - [#1216](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1216), Add support for fonts
+* Resolved [#996](https://github.com/Krypton-Suite/Standard-Toolkit/issues/996), DataGridView ComboBox Adding list over and over
+* Resolved [#1207](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1207), Microsoft 365 - Black (Dark Mode) Drop button is not visible
+* Resolved [#1206](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1206), **[Breaking Change]** Remove the Font Size (as it is already covered by the actual font !)
+* Resolved [#1197](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1197), `KryptonTaskDialog` Footer Images
+* Resolved [#1189](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1189), The Context and Next/Previous buttons of the `KryptonDockableNavigator` cannot be used
+* Implemented [#1187](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1187), Bring over the `KryptonCommandLinkButtons`
+* Resolved [#1176](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1176), KryptonProgressBar: small values escape drawing area
+* Resolved [#1169](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1169), Button Spec Krypton Context Menu (Canary)
+* Implemented [#1166](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1166), Use a struct to contain `KryptonMessageBox` data
+* Implemented [#1161](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1161), A proper about box
+* Resolved [#1091](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1091), Krypton File Dialogs Missing Buttons
+* Implemented [#1009](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1009), Powered by Krypton Toolkit button
+ - Use `KryptonAboutToolkit.Show();` to invoke
+* New `KryptonLanguageManager` is now integrated into `KryptonManager` as `ToolkitStrings`
+* Removed support for .NET 6 and 7, in accordance with their official release cadences
+* Support for .NET 9
+* Version bump `85.xx.xx.xx` -> `90.xx.xx.xx`
+
+=======
+
+# 2024-10-14 - Build 2410 (Patch 3) - October 2024
+* Implemented [#1792](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1792), Enable 'SourceLink' for NuGet packages
+* Resolved [#66](https://github.com/Krypton-Suite/Standard-Toolkit/issues/66), Cannot Add Ribbon-Buttons-Container (KryptonRibbonGroupTripple) when using .netcore onwards [Returns error due to abstract class]
+* Resolved [#297](https://github.com/Krypton-Suite/Standard-Toolkit/issues/297), Office 2k7 colour usages are wrong
+* Resolved [#1772](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1772), `KryptonDataGridViewComboBoxCell` properties, `AutoCompleteMode` and `AutoCompleteSource` have incorrect default values.
+
+=======
+
+## 2024-08-26 - Build 2408 (Patch 2) - August 2024
+* Resolved [#1697](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1697), `KryptonComboBox` change in DropDownStyle cripples the control while the control is disabled en reenabled again.
+* Resolved [#1755](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1755), Ribbon `GalleryButtonController` timer component causes an exception on mouse movements.
+* Resolved [#1548](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1548), KComboBox DropDown arrow is illegible in certain themes
+* Resolved [#1659](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1659), Solves `KryptonMessageBox` selected text issue, usage of diverse line breaks and sizing issues.
+* Resolved [#1675](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1675), Catastrophic failure wherever `KryptonGroupPanel` is used.
+* Resolved [#1677](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1677), `KryptonComboBox` cuts of text on high DPI.
+
+=======
+
+## 2024-07-22 - Build 2407 (Version 85 - Patch 1) - July 2024
+* Resolved [#1373](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1373), `KT.CommonHelper.CheckContextMenuForShortcut()` handles direct type casts differently from .NET 8.0 onward. Solution courtesy of @Tape-Worm
+* Resolved [#1583](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1583), `KryptonThemeComboBox` and `KrpytonThemeListBox` have the wrong designer assigned. Adds the `KryptonStubDesigner` internal class.
+* Resolved [#1614](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1614), `KryptonMessageBox` throws an exception after Esc key is pressed.
+* Resolved [#1613](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1613), `KryptonMessageBox` text is not centered vertically.
+* Resolved [#1599](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1599), `KryptonMessageBox` cuts off the last line.
+* Resolved [#1600](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1600), `KryptonMessageBox` stays on top of other windows.
+* Resolved [#1580](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1580), Changing to certain modes in `KryptonNavigator` can cause a System.NullReferenceException
+
+=======
+
+## 2024-06-24 - Build 2406 - June 2024
+* Resolved [#1561](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1561), KryptonRibbonGroup Controls remain enabled at runtime when set to disabled in the designer.
+* Resolved [#1302](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1302), **[Breaking Change]** Font being used by "Professional" theme is pants !
+* Resolved [#1528](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1528), Tracking colours need reviewing
+* Resolved [#982](https://github.com/Krypton-Suite/Standard-Toolkit/issues/982), Double click on the Form1 file in the Krypton toolkit test project results in a designer error
+* Resolved [#1455](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1455), **[Regression]** KryptonComboBox text is clipped; as height is incorrect.
+* Resolved [#1381](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1502), Docking Persistence broken since build `##.23.10.303`
+* Resolved [#1508](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1508), **[Breaking Change]** ButtonSpec does not open assigned context menu when clicked.
+ - Added property `ShowDrop`, which displays a drop down arrow on the button.
+ - When a `KryptonContextMenu` is connected the menu is shown when the button is clicked.
+ - When a WinForms `ContextMenuStrip` is connected the menu is shown when the button is clicked.
+ - When both type of the above ContextMenus are connected the `KryptonContextMenu` takes precedence.
+ - The ButtonSpec's `Type` property does not need setting to "Context" to display the menu.
+* Resolved [#619](https://github.com/Krypton-Suite/Standard-Toolkit/issues/619), KButton and KListbox unclear text color in certain scenarios
+* Resolved [#1516](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1516), Theme Office 2010 Black Dark Mode causes a crash
+* Resolved [#1328](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1328), Tentative adjustment to bring PaletteMode and the theme dictionary in line.
+* Resolved [#1388](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1388), `KryptonButton` and `KryptonDropButton` Dropdown arrow color does not react to theme changes and is not visible.
+* Resolved [#1424](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1424), **[Breaking Change]** `KryptonMessageBox` does not obey tab characters like `MessageBox`
+* Resolved [#1383](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1383), Closing last Page in undocked page group prevents addition of further Pages via `KryptonDockingManager.AddToWorkspace`
+* Resolved [#1381](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1381), **[Regression]** Docking Persistence broken since build ##.23.10.303
+* Version bump `80.xx.xx.xxx` -> `85.xx.xx.xx`
+
+=======
+
+## 2024-03-04 - Build 2403 (Version 80 - Patch 2) - March 2024
+* Resolved [#1314](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1314), **[Regression]** CheckedListBox CheckedIndices NullRef
+
+=======
+
+## 2023-11-17 - Build 2311 (Version 80 - Patch 1) - November 2023
* Resolved issue where an assertion is made when using `KryptonThemeComboBox` or `KryptonRibbonGroupThemeComboBox`
* Resolved issue where `Sparkle` themes would crash when using certain `ButtonSpecs`
* Resolved [#1174](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1174), Unable to adjust height of `KryptonForm` when `KryptonRibbon` is added
- - _Note:_ This disables features from [#1117](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1117), until further testing is completed
+ - _Note:_ This disables features from [#1117](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1117), until further testing is completed
+ * Backed-out [#1117](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1117), Is it possible to have the KForm back colour as the KPanel colour
=======
## 2023-11-14 - Build 2311 - November 2023
-* Implemented [#1117](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1117), Is it possible to have the KForm back colour as the KPanel colour
+* Resolved [#1093](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1093), `KryptonManager` - Setting the `GlobalPaletteMode` to 'Global' throws a error
+* Implemented [#1117](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1117), Is it possible to have the KForm back colour as the KPanel colour
* Resolved [#1153](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1153), Whilst investigating #1152 found that "Start drag" in certain application causes an exception.
* Resolved [#1152](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1152), Unable to resize control dragged from Navigator via KryptonDockingManager.FloatingWindowAdding event.
* Resolved [#1146](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1146), Krypton.Navigator throws exception in Initialise when attempting to EndInit().
@@ -21,7 +237,7 @@
* Resolved [#1037](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1037), Borderless Krypton Form, Maximized, Top Most = True > Fullscreen does not overlap on task bar.
* Implemented [#956](https://github.com/Krypton-Suite/Standard-Toolkit/issues/956), Update `Readme.md` images to reflect the toolkit
* Added the ability to specify the message text alignment in a `KryptonMessagebox`
- - Default value is `MiddleLeft`
+ - Default value is `MiddleLeft`
* Implemented [#1126](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1126), `KryptonRibbonGroupThemeComboBox` needs to be part of the ribbon designer
* Resolved [#1125](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1072), KryptonThemeCombox displays extra string (Todays alpha)
* Implemented [#1089](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1089), `KryptonProgressBar` in StatusStrips
@@ -50,15 +266,15 @@
* Implemented [#1023](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1023), Please remove "sealed" from `KryptonWrapLabel` and `KryptonLinkWrapLabel`
* Resolved [#1020](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1020), Cannot add a `KryptonPage` to a `KryptonNavigator`
* Added ability to embed links into the `KryptonMessageBox` content. The new options are:-
- - `ContentAreaType` - Defines content area type of a `KryptonMessageBox`, default is normal
- - `LinkLabelCommand` - Specifies a `KryptonCommand` if using the `MessageBoxContentAreaType.LinkLabel` type.
- - `LinkLaunchArgument` - Specifies the `ProcessStartInfo` if a `LinkLabelCommand` has not been defined.
- - `ContentLinkArea` - Specifies the area of a link, if using the `MessageBoxContentAreaType.LinkLabel` type.
+ - `ContentAreaType` - Defines content area type of a `KryptonMessageBox`, default is normal
+ - `LinkLabelCommand` - Specifies a `KryptonCommand` if using the `MessageBoxContentAreaType.LinkLabel` type.
+ - `LinkLaunchArgument` - Specifies the `ProcessStartInfo` if a `LinkLabelCommand` has not been defined.
+ - `ContentLinkArea` - Specifies the area of a link, if using the `MessageBoxContentAreaType.LinkLabel` type.
* Added `KryptonLanguageManager` to the `KryptonManager` action list
* Resolved [#1008](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1008), Krypton Save/Open file dialogs are not accessible from the toolbox
* Implemented [#1007](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1007), A way to alter all of the strings in the toolkit to language specific strings
* Implemented [#1006](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1006), Make converter strings localisable
- - **Note:** Components that use these strings may need to be 'refreshed' once changes have been made
+ - **Note:** Components that use these strings may need to be 'refreshed' once changes have been made
* Implemented [#602](https://github.com/Krypton-Suite/Standard-Toolkit/issues/602), ToolStrip embedded into the non client area
* Implemented [#894](https://github.com/Krypton-Suite/Standard-Toolkit/issues/894), `KryptonPropertyGrid` needs to have full Krypton support
* Resolved [#999](https://github.com/Krypton-Suite/Standard-Toolkit/issues/999), Incorrect project file names while building
@@ -73,7 +289,7 @@ Cannot add items to KryptonGroupBox in WinForms Designer
* Add action list options to `KryptonCommand`
* Implemented [#686](https://github.com/Krypton-Suite/Standard-Toolkit/issues/686), Extend ToolTipManager designer to also allow "open/close" interval properties.
* Implemented [#950](https://github.com/Krypton-Suite/Standard-Toolkit/issues/950), Please add `-t:rebuild` to the msbuild command line
- - **Note:** This option is _only_ available for building `nightly` binaries
+ - **Note:** This option is _only_ available for building `nightly` binaries
* Removed .NET Core 3.1 and .NET 5 references from NuGet package descriptions
* Add `AllowFormIntegrate` option to `KryptonRibbon`s action list, for easier access
* Resolved [#929](https://github.com/Krypton-Suite/Standard-Toolkit/issues/929), `KryptonRibbon` 'disappears' while running the application
@@ -85,7 +301,7 @@ Cannot add items to KryptonGroupBox in WinForms Designer
* Implemented [#904](https://github.com/Krypton-Suite/Standard-Toolkit/issues/904), `*.Nightly` builds are no longer visible in Visual Studio
* Resolved [#905](https://github.com/Krypton-Suite/Standard-Toolkit/issues/905), NuGet description for `Lite` versions is incorrect
* Implemented [#813](https://github.com/Krypton-Suite/Standard-Toolkit/issues/813), Border colours need to match the themes
-* Complete [#827](https://github.com/Krypton-Suite/Standard-Toolkit/issues/827), Expose IPalette / PaletteBase as a public interface in KryptonManager
+* Complete [#827](https://github.com/Krypton-Suite/Standard-Toolkit/issues/827), **[Breaking Change]** Expose IPalette / PaletteBase as a public interface in KryptonManager
* Resolved [#891](https://github.com/Krypton-Suite/Standard-Toolkit/issues/891), `LabelStyle` does not appear to have a default designer value
* Implemented [#887](https://github.com/Krypton-Suite/Standard-Toolkit/issues/887), A 'LinkLabel' version of the `KryptonWrapLabel`
* Fixed the display of the initial selected theme in the "ThemeSelection ComboBox"
@@ -132,8 +348,8 @@ Cannot add items to KryptonGroupBox in WinForms Designer
* Resolved [#764](https://github.com/Krypton-Suite/Standard-Toolkit/issues/764), `Development-Workflow.md` needs to state what the builds are (i.e. nightly)
* Implemented [#761](https://github.com/Krypton-Suite/Standard-Toolkit/issues/761), Can TFM also include .NET Framework 4.8.1?
* Resolved `ArgumentNullException` when saving `palette.xml` files with serialized Image objects (thanks to [hopla](https://github.com/hopla))
- - When the deserialized Image class is of type Bitmap, keep this bitmap, as opposed to painting it on a new in-memory bitmap. This keeps the original Format (as opposed, changing it to MemoryBMP.
- - When the format of an Image is of Format MemoryBMP, save the image as format BMP.
+ - When the deserialized Image class is of type Bitmap, keep this bitmap, as opposed to painting it on a new in-memory bitmap. This keeps the original Format (as opposed, changing it to MemoryBMP.
+ - When the format of an Image is of Format MemoryBMP, save the image as format BMP.
* Implemented [#756](https://github.com/Krypton-Suite/Standard-Toolkit/issues/756), Add `[AllowNull]` to a controls `Text` field
* Resolved [#738](https://github.com/Krypton-Suite/Standard-Toolkit/issues/738), "Office 2010 - Blue (Dark Mode)": Form title text cannot be read
* Implemented [#728](https://github.com/Krypton-Suite/Standard-Toolkit/issues/728), Bring MessageBox `States` inline with latest .Net 6
@@ -163,8 +379,8 @@ Cannot add items to KryptonGroupBox in WinForms Designer
* Improvements to all 'Black/Blue (Dark Mode)' themes
* Silver dark/light mode themes are now implemented
* Full/Lite NuGet packages - as support for .NET 5 ended in May, there are now 2 types of NuGet package.
- - Full - Supports every framework from .NET Framework 4.6.2 to .NET 6
- - Lite - Supports .NET Framework 4.8, .NET Core 3.1 and .NET 6
+ - Full - Supports every framework from .NET Framework 4.6.2 to .NET 6
+ - Lite - Supports .NET Framework 4.8, .NET Core 3.1 and .NET 6
* Fixed grid cell selection colours for dark/light mode themes
* Blue dark mode themes now have a darker alternate colour
* Added new `GetPaletteModeManager()` method to the `ThemeManager` API, to return the current `PaletteModeManager` of the selected `KryptonManager`
@@ -191,7 +407,7 @@ Cannot add items to KryptonGroupBox in WinForms Designer
* Resolved [#611](https://github.com/Krypton-Suite/Standard-Toolkit/issues/611), `KryptonContextMenu`: Cannot add `ComboBoxItem`
* Implemented [#610](https://github.com/Krypton-Suite/Standard-Toolkit/issues/610), `KryptonContextMenuRadioButton` - no way to assign a method/event through the item editor
* Resolved [#609](https://github.com/Krypton-Suite/Standard-Toolkit/issues/609), `KryptonContextMenu`: Item text unreadable with certain themes
- - At the moment, only the 'Black/Blue (Dark Mode)' themes are being worked on
+ - At the moment, only the 'Black/Blue (Dark Mode)' themes are being worked on
* Resolved [#607](https://github.com/Krypton-Suite/Standard-Toolkit/issues/607), `KryptonMessageBox` Certain length of the first line of text can push the text on the following out of the visible area (thanks to [giduac](https://github.com/giduac))
* Some fixes for [#603](https://github.com/Krypton-Suite/Standard-Toolkit/issues/603), Title Bar Images Stretched/Cropped
* Resolved [#596](https://github.com/Krypton-Suite/Standard-Toolkit/issues/596), ActionLists do not reflect the recommended or possible settings in the designer properties
@@ -306,14 +522,14 @@ Cannot add items to KryptonGroupBox in WinForms Designer
* Resolved [#320](https://github.com/Krypton-Suite/Standard-Toolkit/issues/320), `KryptonColorButton` "SelectedRect" will not do anything but a "Square"
* Implemented [#304](https://github.com/Krypton-Suite/Standard-Toolkit/issues/304), [Feature Request]: Track Bar "Back Color" needed in State#### Designer control(s)
* Implemented [#304](https://github.com/Krypton-Suite/Standard-Toolkit/issues/304),[Feature Request]: Track Bar "Back Color" needed in State#### Designer control(s)
- - Add "DrawBackground" as a visible Designer element
+ - Add "DrawBackground" as a visible Designer element
* Implemented [#227](https://github.com/Krypton-Suite/Standard-Toolkit/issues/227), [Bug]: OverrideFocus Designer settings do not work or Prevent Ribbon MouseOver Highlighting
- - The Fix works in "All Themes" apart from `Office2k7` and `Sparkle`, where it is diminished but still highlights with white!
+ - The Fix works in "All Themes" apart from `Office2k7` and `Sparkle`, where it is diminished but still highlights with white!
* Implemented [#291](https://github.com/Krypton-Suite/Standard-Toolkit/issues/291), Build: can the echo time have a time zone, so that when used for PR's it can be checked against the user locale
* Implemented [#290](https://github.com/Krypton-Suite/Standard-Toolkit/issues/290), Should V6 only support "MS Supported" Net Frameworks?
- - The toolkit will only work with projects using .NET Framework 4.6.2 or higher
- - `lite` NuGet packages are no longer being supported or maintained for the forseeable future
- - For more information, please visit [here](https://dotnet.microsoft.com/platform/support/policy/dotnet-framework)
+ - The toolkit will only work with projects using .NET Framework 4.6.2 or higher
+ - `lite` NuGet packages are no longer being supported or maintained for the forseeable future
+ - For more information, please visit [here](https://dotnet.microsoft.com/platform/support/policy/dotnet-framework)
* Implemented [#282](https://github.com/Krypton-Suite/Standard-Toolkit/issues/282), `KryptonScrollbars` need to have smart tags
* Resolved [#245](https://github.com/Krypton-Suite/Standard-Toolkit/issues/245), `TableLayoutPanel` should be "Kryptonised"
* Implemented [#269](https://github.com/Krypton-Suite/Standard-Toolkit/issues/269), "Print Dialog" is in the Main Forms elements - Where is Kryptons' Standard themed equivalent
@@ -336,8 +552,8 @@ Cannot add items to KryptonGroupBox in WinForms Designer
* Resolved [#159](https://github.com/Krypton-Suite/Standard-Toolkit/issues/159), Office 365 tracking colours are wrong
* Resolved [#120](https://github.com/Krypton-Suite/Standard-Toolkit/issues/120), `ButtonSpec` thinks that the default of `inherit` on Style is not the default
* Resolved [#92](https://github.com/Krypton-Suite/Standard-Toolkit/issues/92), **Many** Items cannot be Dragged and dropped onto a Form in Designer (Second patch)
- - As the "Designers" use text based references, then only need to include dlls derived from `ParentControlDesigner`
- - Resolves [Bug]: **Many** Items cannot be Dragged and dropped onto a Form in Designer
+ - As the "Designers" use text based references, then only need to include dlls derived from `ParentControlDesigner`
+ - Resolves [Bug]: **Many** Items cannot be Dragged and dropped onto a Form in Designer
* Resolved [#64](https://github.com/Krypton-Suite/Standard-Toolkit/issues/64), `KryptonContextMenu` Designer has layout issues
* Resolved [#51](https://github.com/Krypton-Suite/Standard-Toolkit/issues/51), Minimize icon in form titlebar is not disabled
* Remove the `Typeof` in the designer attributes and use text to prevent "Pre-Loading" of the wrong `System.Designer.dll` in Multi-Target projects
@@ -359,20 +575,20 @@ Cannot add items to KryptonGroupBox in WinForms Designer
## 2021-08-02 Build 2108 - August 2021 (Canary)
* Implement [#207](https://github.com/Krypton-Suite/Standard-Toolkit/issues/207), 'DarkMode' for `KryptonRichTextBox`/`KryptonTextBox` (Sparkle theme updates to come)
* Resolved [#150](https://github.com/Krypton-Suite/Standard-Toolkit/issues/150), Change the Default type of Theme for A KryptonLabel to be "Normal- Panel"
- - Make sure that the `NormalPanel` is the default style
- - Also Resolved the WrapLabel Style not being set correctly
+ - Make sure that the `NormalPanel` is the default style
+ - Also Resolved the WrapLabel Style not being set correctly
* Resolved [#202](https://github.com/Krypton-Suite/Standard-Toolkit/issues/202), `KryptonGroup` transparency
* Remove the internal class Called `KryptonDataGridViewIconColumn` from design use [#27](https://github.com/Krypton-Suite/Standard-Toolkit/issues/27)
- - Put back the removed `CLSCompliant` and `ComVisible` assembly flags for backwards compatibility
- - Update the projects to comply/use the latest analysers
+ - Put back the removed `CLSCompliant` and `ComVisible` assembly flags for backwards compatibility
+ - Update the projects to comply/use the latest analysers
* RichTextBox now allows CueHint Text
* ComboBox now allows CueHint Text
* Implement [#197](https://github.com/Krypton-Suite/Standard-Toolkit/issues/197), Rounding should use `float` or `double` instead of `int`. Rounding now accepts `float` values
* New logo for both canary and stable builds
* Resolved [#138](https://github.com/Krypton-Suite/Standard-Toolkit/issues/138), `KryptonListView` throws a `System.Resources.MissingManifestResourceException`
- - If you want a standard List then use ListBox or CheckedListBox
- - If you want a Details view then use a `DataGrid`
- - This implements LargeIcons / Small Icons / Tiles with and without checkboxes as allowed
+ - If you want a standard List then use ListBox or CheckedListBox
+ - If you want a Details view then use a `DataGrid`
+ - This implements LargeIcons / Small Icons / Tiles with and without checkboxes as allowed
* New `KryptonMessageBoxIcon` to replace the default `MessageBoxIcon` option
* Updated `KryptonMessageBox` icons
* Implement [#162](https://github.com/Krypton-Suite/Standard-Toolkit/issues/162), Default rounding of control corners
@@ -467,7 +683,7 @@ Cannot add items to KryptonGroupBox in WinForms Designer
* Implemented [#8](https://github.com/Krypton-Suite/Standard-Toolkit/issues/8), Is it possible to only minimize FloatingWindow in DockingManager?
* Resolved [#9](https://github.com/Krypton-Suite/Standard-Toolkit/issues/9), Cannot place `KryptonStatusStrip` on a Form
* Resolved [#12](https://github.com/Krypton-Suite/Standard-Toolkit/issues/12), AllowButtonSpecToolTipPriority
- - If the parent Item has tooltips, and the button spec has tooltips, then the default is show both when hovering over the button spec. This can be disabled by setting AllowButtonSpecTooltipPriority to true, so that only 1 tooltip is displayed when hovering over any part of the control.
+ - If the parent Item has tooltips, and the button spec has tooltips, then the default is show both when hovering over the button spec. This can be disabled by setting AllowButtonSpecTooltipPriority to true, so that only 1 tooltip is displayed when hovering over any part of the control.
=======
@@ -492,3 +708,4 @@ Cannot add items to KryptonGroupBox in WinForms Designer
* Support for .NET Core LTS (currently 3.1)
* Changed `490` to `500`
* Builds from now on will be labelled as `YYMM`
+
diff --git a/Documents/Help/Designer-Fix.md b/Documents/Help/Designer-Fix.md
deleted file mode 100644
index cfc76c400..000000000
--- a/Documents/Help/Designer-Fix.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# How To: Fix the components in the designer
-
-If you are experiencing issues while using the components in the designer, you might need to replace `net[##Current-Version##]-windows ` with `net48;net[##Current-Version##]-windows ` in your project configuration files.
-
-To learn more about the `TargetFrameworks` attribute, [click here](https://docs.microsoft.com/en-us/dotnet/standard/frameworks).
-
-## N.B: This action will produce binaries for multiple frameworks.
\ No newline at end of file
diff --git a/Documents/License/License.md b/Documents/License/License.md
index a598afcb9..ece1d298c 100644
--- a/Documents/License/License.md
+++ b/Documents/License/License.md
@@ -1,6 +1,6 @@
BSD 3-Clause License
-Copyright (c) 2017 - 2023, Krypton Suite
+Copyright (c) 2017 - 2024, Krypton Suite
All rights reserved.
diff --git a/LICENSE b/LICENSE
index a598afcb9..ece1d298c 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
BSD 3-Clause License
-Copyright (c) 2017 - 2023, Krypton Suite
+Copyright (c) 2017 - 2024, Krypton Suite
All rights reserved.
diff --git a/README.md b/README.md
index ab354015c..e62168007 100644
--- a/README.md
+++ b/README.md
@@ -1,15 +1,14 @@
-
# Standard Toolkit
-
* [NuGet Information](#nuget-information)
* [Nightly](#nightly)
* [Canary](#canary)
* [Stable](#stable)
* [Documentation](#documentation)
+ * [Contributing to the Standard Toolkit](#contributing-to-the-standard-toolkit)
* [Package Support Information](#package-support-information)
* [Release Cadence](#release-cadence)
* [Package Descriptions](#package-descriptions)
@@ -19,22 +18,22 @@
* [Discord Server](#discord-server)
* [Version History](#version-history)
* [Breaking Changes](#breaking-changes)
- * [V80.## (2023-11-14 - Build 2311 - November 2023)](#v80-2023-11-14---build-2311---november-2023)
+ * [V90.00 (2024-11-12 - Build 2411 - November 2024)](v90-24-11-12--build-2411---november-2024)
+ * [Support for .NET 6/7](#support-for-net-67)
+ * [`KryptonButton` Properties](#kryptonbutton-properties)
+ * [API Changes](#api-changes)
+ * [`KryptonInputBox`](#kryptoninputbox)
+ * [Building the Toolkit](#building-the-toolkit)
+ * [V85.00 (2024-06-24 - Build 2406 - June 2024)](#v85-2024-06-24---build-2406---june-2024)
+ * [V80.00 (2023-11-14 - Build 2311 - November 2023)](#v80-2023-11-14---build-2311---november-2023)
* [Support for .NET Core 3.1 and .NET 5](#support-for-net-core-31-and-net-5)
* [KryptonMessageBoxButtons](#kryptonmessageboxbuttons)
* [Palette usages](#palette-usages)
* [Depreciation of `KryptonManager.Strings`](#depreciation-of-kryptonmanagerstrings)
- * [V70.## (2022-11-08 - Build 2211 - November 2022)](#v70-2022-11-08---build-2211---november-2022)
- * [Ribbon Tooltips](#ribbon-tooltips)
- * [`dpiAware`](#dpiaware)
- * [`KryptonTaskDialog`](#kryptontaskdialog)
- * [`KryptonPalette`](#kryptonpalette)
- * [`KryptonMessageBox`](#kryptonmessagebox)
- * [Strong Named Assemblies](#strong-named-assemblies)
- * [Management of `using` Statements](#management-of-using-statements)
* [Known Issues & Workarounds](#known-issues--workarounds)
* [Introduction](#introduction)
* [What is this Repository About?](#what-is-this-repository-about)
+ * [Contributing to this project](#contributing-to-this-project)
* [Individual Components](#individual-components)
* [Krypton Toolkit](#krypton-toolkit)
* [Krypton Ribbon](#krypton-ribbon)
@@ -98,23 +97,27 @@ If you require the full API reference, you can download the latest version by cl
+#### Contributing to the Standard Toolkit
+
+If you are interested in contributing to the Standard Toolkit, please read this [article](https://krypton-suite.github.io/Standard-Toolkit-Online-Help/Source/Help/Output/articles/Contributing/Contributing-Guidelines.html) first.
+
=======
## Package Support Information
-Full information about support can be found [here](https://github.com/Krypton-Suite/Documentation/blob/main/Documents/Development/Package-Support-Information.md)
+Full information about support can be found [here](https://krypton-suite.github.io/Standard-Toolkit-Online-Help/Source/Help/Output/articles/Support/Package%20Support%20Information.html)
### Release Cadence
-See [Krypton Toolkit release cadence](https://github.com/Krypton-Suite/Documentation/blob/main/Documents/Packages/Package-Version-Descriptions.md)
+See [Krypton Toolkit release cadence](https://krypton-suite.github.io/Standard-Toolkit-Online-Help/Source/Help/Output/articles/Support/Package%20Version%20Descriptions.html)
### Package Descriptions
-To find out more about the differences between `Nightly`, `Canary` and `Stable` packages, please read this [article](https://github.com/Krypton-Suite/Documentation/blob/main/Documents/Packages/Package-Version-Descriptions.md).
+To find out more about the differences between `Nightly`, `Canary` and `Stable` packages, please read this [article](https://krypton-suite.github.io/Standard-Toolkit-Online-Help/Source/Help/Output/articles/Support/Package%20Version%20Descriptions.html).
### Installing Pre-Release Versions
-To find out how to install either `Canary` or `Nightly` versions, please check out this [article](https://github.com/Krypton-Suite/Documentation/blob/main/Documents/Packages/How-to-Install-Pre-Release-Packages.md).
+To find out how to install either `Canary` or `Nightly` versions, please check out this [article](https://krypton-suite.github.io/Standard-Toolkit-Online-Help/Source/Help/Output/articles/Support/How%20to%20Install%20Pre%20Release%20Packages.html).
=======
@@ -166,17 +169,83 @@ Follow the links to see the different objects and layouts that this framework al
# Version History
-
+
=======
# Breaking Changes
-## V80.## (2023-11-14 - Build 2311 - November 2023)
-There are list of changes that have occurred during the development of the V80.## version
+## V90.00 (2024-11-12 - Build 2411 - November 2024)
+There are list of changes that have occurred during the development of the V90.00 version
+- [#632](https://github.com/Krypton-Suite/Standard-Toolkit/issues/632), **[Breaking Change]** `KryptonPropertyGrid` should have a customisable back colour.
+ - `KryptonPropertyGrid` now uses the State### sets like the rest of the controls.
+ - Any build breaks in the designers can just be deleted, as the the colouring will be done by the `State####` equivalents
+- [#1435](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1435), **Breaking Change** Take KMB back to the Winform override (Remove Checkbox etc)
+- and [#1432](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1432), **Breaking Change placeholder** Copy `KryptonMessageBox` to `KryptonMessageBoxDep`
+ - The introduction of new Parameters elements to the `KryptonMessageBox` is now supported in the `KryptonMessageBoxDep` class
+ - This is so that the `KryptonMessageBox` gets back to being a drop in replacement for the WinForm `MessageBox`
+ - And a start of the introduction of the `KryptonMessageDialog` implementation of the UWP `MessageDialog`
+- [#1424](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1424), **Breaking Change** `KryptonMessageBox` does not obey tab characters like `MessageBox`
+ - The optional `ContentAlignment` for a `KryptonMessageBox.Show` command is no longer possible.
+- [#1356](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1356), AppButton colours don't change while switching themes
+ - See https://github.com/Krypton-Suite/Standard-Toolkit/issues/1356#issuecomment-2039412890
+ - `RibbonAppButton` has become `RibbonFileAppButton`
+ - Addition `RibbonFileAppTab` to hold the tab text (Defaults to `File`)
+ - Colours for the `FileAppTab` have been moved into the `StateCommon` area
+- [#1206](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1206), Remove the `Font Size` (as it is already covered by the actual font !)
+- [#1224](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1224), Move `GlobalPaletteMode` into `GlobalPalette` and rename
+ - BaseFont is now part of the KryptonManager class, and will override the applied palette font(s)
+ - `CustomPalette` must be derived from the `KryptonCustomPaletteBase` class
+ - `BasePaletteMode` has been removed from `KryptonCustomPaletteBase` class
+- [#124](https://github.com/Krypton-Suite/Standard-Toolkit/issues/124), When setting AllowFormChrome = false, then the Form Bar should still be Theme rendered
+ - `AllowFormChrome` has been removed and replaced with `UseThemeFormChromeBorderWidth` to better explain what it is doing
+ - It means that a theme can get closer to "Material Design", and that the Title bar can still be themed (And rounded)
+- [#215](https://github.com/Krypton-Suite/Standard-Toolkit/issues/215), `KryptonTreeView` Multi Node Select
+ - Designer values named `State####Pressed` have changed to `State#####MultiSelect` to reflect usage
+ - New ReeView Designer value `MultiSelect` allows drawing of selected items and retrieval via `CheckedNodes`
+- [#1268](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1268), Many Krypton Controls have a `CornerRoundingRadius` that overrides the State#### Node Rounding values. Please remove!
+ - `CornerRoundingRadius` overrides **ONLY** the `StateCommon.Border.Rounding` which is incorrect.
+ - All `CornerRoundingRadius` have been removed
+- [#1269](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1269), Remove AllowFormIntegrate to give consistent experience on all supported OS's
+ - Please check the images in the issue.
+ - To fix: just remove `AllowFormIntegrate` from your deisgner files
+- [#1266](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1266), Since V 5.400, the QAT button is supposed to perform the close, therefore the Close Form button should not be visible
+ - The RibbonAppButton has a new Designer field for setting the "Form Close Visible" to off by default
+
+### Support for .NET 6/7
+As of V90.00, support for .NET 6 and 7 has been removed due to their release cadences.
+
+
+### `KryptonButton` Properties
+Some properties previously found in the root such as, `ShowSplitOption`, `UseAsADialogButton`, `UseAsUACElevationButton` and `UACShieldIconSize` are now located in the `Values` section.
+
+### API Changes
+If using `KryptonAboutToolkit`, please note that this has been superceded by `KryptonAboutBox`. Or if you use `KryptonThemeBrowserForm`, it has now been moved to `KryptonThemeBrowser` as the public facing API.
+
+### `KryptonInputBox`
+The `KryptonInputBox` now uses the new `KryptonInputBoxData` API, to handle data.
+
+### Building the Toolkit
+As of V90.00 support for longer path names **will** need to be enabled if you want to build the toolkit yourself. For more details on how to do this, please follow the instructions [here](https://krypton-suite.github.io/Standard-Toolkit-Online-Help/Source/Help/Output/articles/Contributing/Allowing-for-Longer-Path-and-File-Names.html).
+
+## V85.00 (2024-06-24 - Build 2406 - June 2024)
+There are a list of changes that have occurred during the development of the V85.00 version
+
+* [#1302](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1302), **[Breaking Change]** Font being used by "Professional" theme is pants !
+ - The Option to use `SystemDefault` no longer exists a font rendering hint
+* [#1508](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1508), **[Breaking Change]** ButtonSpec does not open assigned context menu when clicked.
+ - Added property `ShowDrop`, which displays a drop down arrow on the button.
+ - When a `KryptonContextMenu` is connected the menu is shown when the button is clicked.
+ - When a WinForms `ContextMenuStrip` is connected the menu is shown when the button is clicked.
+ - When both type of the above ContextMenus are connected the `KryptonContextMenu` takes precedence.
+ - The ButtonSpec's `Type` property does not need setting to "Context" to display the menu.
+* [#1424](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1424), **[Breaking Change]** `KryptonMessageBox` does not obey tab characters like `MessageBox`
+
+## V80.00 (2023-11-14 - Build 2311 - November 2023)
+There are list of changes that have occurred during the development of the V80.00 version
### Support for .NET Core 3.1 and .NET 5
-As of V80.##, support for .NET Core 3.1 and .NET 5 has been removed due to their release cadences. It is strongly advised that you migrate your application to .NET 8, as the latest LTS version, or the slightly older .NET 6, if you require a more supported version. If you do not make these mitigations, the packages **will** fail to install when upgrading, if your project is configured to use either .NET Core 3.1 and .NET 5.
+As of V80.00, support for .NET Core 3.1 and .NET 5 has been removed due to their release cadences. It is strongly advised that you migrate your application to .NET 8, as the latest LTS version, or the slightly older .NET 6, if you require a more supported version. If you do not make these mitigations, the packages **will** fail to install when upgrading, if your project is configured to use either .NET Core 3.1 and .NET 5.
### KryptonMessageBoxButtons
- https://github.com/Krypton-Suite/Standard-Toolkit/issues/728:
@@ -189,33 +258,6 @@ Bring MessageBox States inline with latest .Net 6 by using a new `KryptonMessage
### Depreciation of `KryptonManager.Strings`
In a effort to support translations, `KryptonManager.Strings` is now obsolete. As such, the new `KryptonLanguageManager` will handle such strings.
-## V70.## (2022-11-08 - Build 2211 - November 2022)
-There are list of changes that have occurred during the development of the V70.## version
-
-### Ribbon Tooltips
-- https://github.com/Krypton-Suite/Standard-Toolkit/issues/382
-- https://github.com/Krypton-Suite/Standard-Toolkit/issues/511
-![][image_ref_tnqwpvc0]### Ribbon Tooltips
-
-### `dpiAware`
-If you are getting scaling problems in high dpi monitors, then please add an application manifest to your MainForm application, and uncomment the section that covers the `dpiAware` setting.
-
-## `KryptonTaskDialog`
-As of v70.xx, the `KryptonTaskDialog` now uses the built-in `KryptonMessageBoxIcon` instead of the standard `System.Windows.Forms.MessageBoxIcon`. This will cause errors within your project. To resolve, simply replace `MessageBoxIcon` with the `KryptonMessageBoxIcon` equivalent.
-
-## `KryptonPalette`
-Both ***Font1*** & ***Font2*** have been removed from `Cargo`, as they were not used.
-
-## `KryptonMessageBox`
-The standard `MessageBoxIcon` option has been removed in favour of the built-in `KryptonMessageBoxIcon`. In addition, the `MessageBoxDefaultButton` has also been removed in favour of the built-in `KryptonMessageBoxDefaultButton`.
-
-## Strong Named Assemblies
-After updating to v70, you may need to sign your assemblies for a successful build. To find out how to do this, click [here](https://learn.microsoft.com/en-us/dotnet/standard/assembly/strong-named).
-
-## Management of `using` Statements
-
-As of version 60, all `using` statements are contained in one file per project unless otherwise. For details, please read this [article](https://github.com/Krypton-Suite/Documentation/blob/main/Documents/Development/How-to-Manage-Using-Statements.md).
-
=======
# Known Issues & Workarounds
@@ -225,7 +267,7 @@ As of version 60, all `using` statements are contained in one file per project u
- [#665](https://github.com/Krypton-Suite/Standard-Toolkit/issues/665) - Workaround add `net48` or `net481` to your `` if using .NET 6 or 7
-- .NET 6/7 Designer issues - If you are experiencing designer issues with your project, please refer to [this](https://github.com/Krypton-Suite/Documentation/blob/main/Documents/Development/Designer-Fix.md) for more information
+- .NET 6/7 Designer issues - If you are experiencing designer issues with your project, please refer to [this](https://krypton-suite.github.io/Standard-Toolkit-Online-Help/Source/Help/Output/articles/Support/Designer%20Fix.html) for more information
- ***URGENT:*** If anyone experiences "Double events" such as the one found [here](https://github.com/Krypton-Suite/Standard-Toolkit/issues/666), please can you report it ASAP, so that they can be investigated. Thanks!
@@ -235,12 +277,17 @@ As of version 60, all `using` statements are contained in one file per project u
The Krypton Suite contains user interface components designed to make it quick and easy for developers to create professional looking applications. It provides the essential building blocks needed to create a consistent look and feel across all your products. You can use the built-in palettes to achieve the same appearance as industry standard applications such as Microsoft Office `2007/2010/2013` & Microsoft 365, Visual Studio 2010. Alternatively you can create your own custom palettes to create a completely unique user interface. The Krypton Suite consists of five products called ***Krypton Toolkit***, ***Krypton Ribbon***, ***Krypton Navigator***, ***Krypton Workspace*** and ***Krypton Docking***.
## What is this Repository About?
-- Modifications by Peter Wagner (aka Wagnerp) & Simon Coghlan (aka Smurf-IV) have been fixing and adding more capabilities to this toolkit.
+- Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac &
+Ahmed-Abdelhameed have been fixing and adding more capabilities to this toolkit.
- There is also an Extensions project, which takes these base controls and add more useful complete controls (Currently outside the scope of this help). To find out more, please head to this [link](https://github.com/Krypton-Suite/Extended-Toolkit)
- All .Net Versions from 4.6.2 are catered for (interim releases, i.e. releases in-between Long Term Support (LTS) versions of .NET will **only** be supported for the duration of that particular version, usually 24 months.)
- New versions of NuGet packages can be obtained via this [link](https://www.nuget.org/profiles/Krypton_Suite), or via your package manager by searching `Krypton.`.
-- New, major versions are released annually, with patches if needed released throughout that period. Version 80 is expected to release in November 2023.
-- For tips on how to build the toolkit for yourself, please read the following [article](https://github.com/Krypton-Suite/Documentation/blob/main/Documents/Development/How-to-Build.md).
+- New, major versions are released annually, with patches if needed released throughout that period. Version 90 is expected to release in November 2024.
+- For tips on how to build the toolkit for yourself, please read the following [article](https://krypton-suite.github.io/Standard-Toolkit-Online-Help/Source/Help/Output/articles/Contributing/How-to-Build.html).
+
+## Contributing to this project
+
+If you want to contribute to this project, please follow [these](https://krypton-suite.github.io/Standard-Toolkit-Online-Help/Source/Help/Output/articles/Contributing.html) guidelines. All contributions are welcome!
## Individual Components
@@ -271,6 +318,4 @@ The Krypton Workspace allows a document area to be created that the user can cus
### Krypton Docking
The Krypton Docking set of components allow the user to drag and drop docking pages into new locations in order to customise the organisation of the application content. It allows this in a way similar to that of Visual Studio 2008/2010. Each docking area uses an instance of the Krypton Workspace allowing a wide range of options for organising and displaying pages. It integrates with the Krypton Toolkit architecture to ensure a consistent look and feel.
-
-
-[image_ref_tnqwpvc0]: data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAeAB4AAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABQBvYDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD0Dxdf3Ol+E9SvbOXyriGLdG+0Ng5HY5FW01qxOqLpQmZ74RCV40jZhGp6F2A2pnBxuIz2rD8QyXuufDO6kGnXNve3VmG+x7S0iMcHbjGSR9PwqPwzbXfh3UrrRru3nuY7p2uoNUERYyk9UnYDCuvQE4BGAMEYrBq10em5aprY0Lbxt4euzEbe/MkcriITLbyeUrk4CM+3ajE/wsQeR6itGDWtPuLW9uY7geTZO8dyzIy+WyctkEA8DnPftWJ4H0zZ4E0+y1Kx2spdnguYcEHzWYEqw69CPwNZHiGzli8UyaNboxtvEwRpiOkflEecTz/FHtX602teVf1/WoczUeZ7f1/wDppfF2iQ/ZQ125ku4FuLeFLeRpJUPQqgUsT3IAyByRiqOv8AjO1sPCkmsabvuS0bNARaSugZTgiTaPkwcjDFeRjtVXUL210v4j28k0NwyjSGRBbWkk7L+9HaNWIHHXpUDaLqNx8PdehFq6XeoS3F1DasRuUO25VPOAxA6diaWlr+v52C8r8vX/gX/M6e116xubOa6Y3FtDAoaWS8tZbZVHrmVVyPpTdP8R6Zqdz9mt5ZlnMfmrHcW0kDOn95RIq7h7jOMj1FY2tTN4m8JzRWFnfCeFoJntrm1lt2kCOrlAZFUEkKRwSM4pZJG8Q+J9FurSzvYYNOEss811aPBy6bRGBIoLZzkkZA2jnkUNbgpOyNC18ZaDevbrb3zSLcOI45RBJ5W8/wGTbtV+Pukg9OORWffeLdRtpdbkt9Ht57PR3Andr0pK48tXJVPLI4DdCwzism30y8j+HGg2gsZ1uI7+2kkh8kh1AuAzMRjI45J/Go9U8LXepy+LLiJLtLr7XHNbRPJILe6CRRnY0ZOyRWIK5IP14p2Wvz/T/Ng3LS39b/AOSOi8Ra7HH4ehuINSudLN0iSx3i6a9ysakqcOApVcg4+Yjr7VJ4q1iTRYdJnF0sEMl/HFcyMBgxlWLZz06DpzWX4s1H7d4EMEWm6kt1eW6MltHp8ztGQykq21CFIweDjpU/iWddR0/Rb+Czvpbe21SKWVDYzCRVUMC3lFd5AJHRaLar1/VC5m0/T9GT6t4ogl8K65d6TcSR3tjau+2a3eKSNthKkpIoOD2JGDg1d0rxNpmoywWkdyzXMkRdS0Loku3G4o5UK+CedpNczrFld64vifVLSxulhm0c2VuksLRy3DjexIjYBgBuAGQM84q2VbXtR8PpZWd5BDpm6Wee4tJLcJmJkVFDqpYknPAwAvUZFHT+vP8Ar8Acnf8AryNz/hK9F+2C2+1tzL5Am8iTyPM/uedt8vdnjG7OeOvFJe+LNFsLu5tJrqRrm1AaeGG3kleNSu7cQikhcH73TtnNcl9nuZPACeDv7NvhqgVbVnNs/kjD5M3nEbCMDd1znjGa3LGxnj13xZK1vJidIVikMZHm4hwdp74Pp3pS0Tf9MqMm2l/SL994jAurSx0i3TUby7h+0RgTBIkhyB5jvgkA54wpJP4mpZdbXStMN54hWDTlWVYy6TGWLLEBTu2qQMnBJUY57c1yGi2F3oY0TUruxvmtZtDisLpYInaa2kXkEovz4OSMqCQQM461DNZ393oF/HFBq09sddtntUvFneQQgxFjiX5woIY8+9Vyrmt5/rb8tSOeVrvt+l/z0O3svEmlahLNFDcsjxRecwuIXhzH/fG9RuTj7wyPem2XijSNQu4ra3uZPMmUtAZbeSNJwOpjZlCyDHPyk8c9Ki8VaKdY8P6lDbQxfb5rR4IpCAGIPOzd1AJH0rJuZn8RXWgQ2mn39s1ldJdXL3No8IgVUYbAzgByS235CRjJzjFSrNlycl/X4G+3iDS10u41M3X+h28jRSyeW3ysrbCMYyfm44FQXvivRtPvZrKe6c3UCh5IIbeSV1UjO7aik7cdW6DgE81xd+L+DwfrWgx6PqM9/JfzSAR2zeX5TTbw4kxtb5SPlUls9uDjWi1S30zxx4lL2l5cTSQ2oRbazkl3YRvlLKpVck/xECi2l/66C53e39dTXvfEdx/aWmWejWlpffb7aS5SaW7MSbF2dCsb5zvFPsPFFvNp8lxqEf2KWG9+wSxhjKvnbgoCsByDuXBIHXnFcguiyaXJ4Vh1aDVPKttPuEmfTRcMY5GaMhC1v82Oo9Dip/7M1BPCc4hsbo2cGsRXdpC8X+kG3WRHZmX7zNnecN8575NVZX/r+a35f5k80t/6+G/5/wCR29zrNla3ctrI8rXEUAuGiigeRvLLbcgKCTz2HNYvhnxgmtxus9vdpP8AapokK6dcLHsR2C7nK7Q2AMgkc8YB4qPTJ7jUfH9xqC6dewWP9mrDFPcwNF5jCQk/KwDL16MAT1xjBK+FrhtLkvNHvLS+juDqFxJHJ9kkaF0dy6sJQpQcHHJByMVKWmv9alOTvptf9P8AMS18bwzeItRsZLa/+zwRwmIppV0ZMtu3bhs4HAwSBnnrWzqHiHTdMnFvcSzNOY/NMVvbSTuif3mWNWKj3OBwfSshp20XxvqV1dWl89rfWsAimtrSSdQyFwyt5asVPzA8gA/hTUnbw/4o1m6vLO/mh1ARSwTWtpJP9xNpjIQEqQeRnAO72NAJtN3Ne58T6LaQWc8t/GY70E2rRgv52BnC7Qcn0A5PQZNLF4gs7vTpryxS5uzFJ5TW8cDLMJOPlKOFKnkHLYGDknHNcrpOh31ld+FftNm4Mdxe3Eihdy23mBmVSRwMbsfXpWvpTPpeqeKLy6trpYHvY3jMdtJIZF8mNcqqglhnI4B6H0p2X9eqBSk/68maHhzW5Nds7qaW0FrJb3cts0Yl8wEocZzgVY1z/kDXH0H8xXO+BbraNTtpbTUIJJtRuLmP7RYTRK0bNkHcyAZPpnPtVu81e8u7jXNOm0i4trazWIw3rn5Ljdgnbx29iffFTNe78v0NsNL95G/836nOtq+sW+oWWnDSNPdrmN3ic37gbUxnd+54JyOBn61p3OsWlgYor3Iu3TeYLWJ7hgO5wi7tueNxAFUp4Jn8T6FOsUjQx2s4eQKSqkhMAntnBqN3bR/FV/e3Ntdy297BEIpbe3ebaU3AoQgJH3gQcY61irWR3ylJSlr1/wAjSfWtLTTob/7TG9vOQsJjUu0hP8KqoLMevAGeD6Utve2us2s62NzJE6nY5EWyWFvdJF4P+8tcvZ6deaZLpurXNpcGFbq6lkt4kMjwLMflO1ck47gAkbj6GtXT3I1jVtee3uorOWOGKNDbP5smzdl/LC7/AOLAyM8Z6YpuKJjVm2k/68yXw7c3tzpV4ZpRd3EF3PDG0wWPcFYhQxRcD6hfwpltq+sXGsXGnHSNPV7ZY3lcX7kbXzjb+55PB64qPwjdDZe27217DJJeTzr59nLEpRnyDuZQMnPTOatWMEyeMNYnaKRYZILcJIVIViN+QD3xkU7d+wKUmlZ9X+oXV8p8T2Nml/Lb43h7ZrBilyduRiUjA29eD7VZvdc0vT7xbO4mIumQSJBHC8juuSMqqgluhzjp1NZGtX6DxRpEgtdQeOzebznj0+d1XdHgYKoQ3Ppmm3WoW9n48E8sVy+7SwF8m0klYZkJ5CqSv44pJXt/XcHUa5teq/Rdy9eeIF8rS30qCC9/tGUxxmSUxKuFZjn5GIPykYxkGpbDWllOoR6jBDZS6ew88+cHiCldwYOQvGPUDFcxPpk8VrpMt7a3yRPqlxdSpaLKZIUdXK5MPzA8jOPXFPbSbu503WU0+2ujYPNBcQR3Sss07IwaQEv85BCgDfz6cYp8q/r5Ee1qX/T5M6qx1vTdQuPs8DyLMU8xUnt5IS6/3l3qNw9xnqPWsrWPEsCm1i02WVne/igeVLV2iKlwHUSFdmeo4Oc+9Jcl/EGtabLZ293BHZrK8s1xbPDguhUIA4BPJySOBt68ispPtjeHdC0lNKvRcWV1bi7LQMqR7HALBiMOD1yuRjkkU4xXMvVfmE6s+VpPo9fl+f8AkdjBqVjcpdvHKCtpI0c+5CuxlGTnI9CDnpWj4QuYb3RjdW7FoZZN6MVIyCBg4PNcL4gtpYfELafbq3l+IkWOUqeEMePMb8YzjjuBXfeF0WPTZEQAKspAA7DAqYpXT/rz/wCAXUnJ05xfS3/A/Dc26Kytf0f+2bOODytMk2Sb8ajY/ak6EcLvXB5659areH/D39iTTP5GiR+YoGdO0v7Kxx/ePmNuHtxWqPPbd9Eb1c5AniX7XbmaX9z9vm80Yj/498fu+nPXHTnnmujopW1uWpWVrBRRRTJM3V9Tm04WawWyTy3VwIFEkpjUEqxySFb+76VHZ6y76hc2F/bLa3MEQnJWXfG0Z/iDEA8EEEEDp3qDxJa3F3JpC25nQpfqzSwoGMY2P83IIA5HUd6kmsJtMsr++svMvtVeL5ZLggs2B8q4UAAD0AGT71N2rv8ArY2SjypdX/n/AJFq11mxu7oW0bypMVLqk0EkRcDqV3gbvwzSLrdg921sssjMsnlM6wuYw/8AdMmNuc8Yz1461ztqt5c+IdGnZ9VuUiWTzZLqzWFI2KdAAinr65Hoc5qV0uLHUgNFOoo8t3vuLOe2Jt8E/OwkIwvduHIzxjmi7uhunH8P66F6fxKkPiJbAw3JgEDuxWymZ94YDjC8rgnkAjpzWlcaraWsUDzPIDP/AKuNYXaRuMn5AN3HfjjvWdqJey8UWeoPBcSWxtZIGaCFpSjFlYZVQTg4POKq6tFOdds9USXUIrR7Vot9rbCSSNiQw3IyMwBHouQQM4ou7f15hyRbR0NneW9/bLcW0gkjYkZwQQRwQQeQR6HmnXFwlrA00iyMq9RFE0jfgqgk/lVDQrWC3tp5IZryX7RM0rtdxeU5YgA/LsXA49K1KroZNJSsYXh/xCNWtYzLFOs7vIvy2kqx4ViB8xG0HA9evHtVfRvE1vJbsl9dFrgXUkJYQnYn7wqisyjapxjqQTx61J4blaxtjpVzb3Udwk82GNu5jZS7MGDgbeQfX2rONjdDwTdwC1m89713EYjO4j7RnOOvTnPpUpvR+X+Rs4xu1br/AJ/gdHe6zY6fL5U8knmBPMZYoXlKL/ebYDtHucdD6VciljmiSWJ1eN1DK6nIYHoQa5ae3uLLxFqU8t1qkEN35bxPZ2qzqQqhSrfu3KkHnsOfXNb+j2kFhpFtbWzTNDGmEMy7Xx15GBg+2BTi2zOcFFJoszzw2sDz3EqRRIMs7nAUe5qtaaraXqM0TSqqrvJmgeLK+o3gZHuKq+JbW4utIxbRGZ4popjCCMyKjhivPsKjv5Tr2hahZ2cV1HJLbsoNxA8I3EcL8wGfwyKTb1CMU0r/APDFm217Tbu4jginbdLnymeJ0SXHXYzAK/r8pPHNRt4l0hXdftRPlymGVhC5WJ923DsBhee5IrNmd9XGj2sFldwPbXEc0zTQNGsIQHIDMMMSTj5Se56VVlsbn/hDtfhW0l86a7uGRBGdzgycEDqcii7v/XkWqcdL6bfqauoeIlstcs7HyZ2jkEnmlbOZzkAEbCFw3XnGfwrQm1W0t7SO5meRElIWNGhfzGPoI8bifbHTms7VxJb6to+oeRPLBB5scvkxNIyblGDtUEkZHYd6r63HNc3uk6pA9/HbRCRZDBb5lTdgBvLdCexB+XPPpmi7QoxjJR9DVOvaYLBr57oR26SCKRpEZTG+QMMpGV5I6gdc9KIdcsLjzhG8xeJBI0ZtpA5U8BlUrlhx1ANc/eacs2k3U1s2o3k1zeWzTfarUxsdrqMhdi8bRycdq2DDL/wmaz+U/k/2eU8zadu7zM4z0zjtQm/69Lg4RSItE8RrqZlSWG4WQXMkSFbOYLtViBuYrgHHXJHPYVek1qwju2tjLI0iELIUhdkjJ6BnAKr+JFZ2hytYXF9YXNvdJJJfSyxuLd2jdXO4HeAVHXHJFVNRSezvrmbRTqMV/NKrPatbF7ac9NxcjamR1IcdORmhPRDcIubS+X9djrKrXuoW2nxq9zIV3ttRVUu7n0VVBLH6CrIzjnrWHqySW+uabqZhmmt4ElikEKF2QvjDbVySOMcDvTZlBJvUuJrmmNavctexQxI/lubg+UUb+6wfBB9jWR4Z1YawsdzLrkclxJvc6fE0W1FyQOMb+BjnNW9Iikm1fVNT8mWGC5EaRLKhRn2AgsVPIznAyAePpUnhaGW38NWUU8TxSKp3I6lSPmPUGkr3NHyqLS8jYrnv+EnjHiCaxaC6+zpbq4K2M5feWYHgL93AGDjHXmuhrAunbT/FhvZbe5e2nsliEkEDy7XVycEICRkN1x2oe6/roTBJ3TQXGurZ+JhazzOLd7JZI4VhLOzlznCgFjwOR2xWidYsBp0d/wDaAbaQgIwUksScBQuNxbPbGappC7+Mjd+S/lHTlRZWQgZ8wnGT3xjisAadfJp2n3Gy8hW11G4klEMQaVVZnAcIyndjI6AnBJFCbS/ruXyRf4fkdZDfw6lbT/YZmEsfykPGUdGxkblYAj8RU9pP9ptY5e7Dkeh7isvRbaD7Xd3yXWozzSqiSNeW3k8LnGB5aZ6nnmrtv/o+oTQdFl/fJ/Jh+fP41vBKVNrqtf8AP/MxmkpaDl1K0fBWXIJxu2nAPoTjA/GlWV01B4ZGyjqHi4HGOCP61FpkGNMjimi7klXX3PY0/UVKxJcqPmt23/Vf4h+X8q2cKftHTj5r/InWxLLdwQyCN3IkIyFCkkj2AqSGaOeMSRNuU98VV2l9WjmVSY/s5w+OOvrS6cjpFMHVlJmcjIxkZqJ04KF1vp+NwuXKCQBk8AUVHPF59vJETjehXPpkYrmd7aFLcyrLV7zUlF1Z6fG2ns+ElkuNskijgsqbSMemWGfamapNd2mt6UYr2XyLq4MUluUQpgRseDt3ZyB3qDQLyXTtLttJvbK7W7tgIf3du7xyAdGEgG3BHqRjnNJr12v9saSFt72QWt0ZJmjs5XVVMbDIIUg8kdM0aaamyj7zSXR/loXfEN99j05gt9LYSNgi5SzadUwRnIAIGenOOtXL3UrPTLeOa+uUhjdggd+BuI/TpWT4ruRN4dnt4be7lluIwY1jtJWPUHnC/KfY4qHxBeQTWWkXHlz+WuoxZV7aQPwD0QruP4Cle34CULpadyzqWvRPoGqT6dM6XVrAXxJCyOhxlTtcA4/DFW7DW7G9kjt452adk3LuiZVkxjcUYgBsH+6TWFqltc6qmu3tta3Aik077NEskTI8zAsxIQgN3xyOe1WWR9Xv9IFrb3MMdiGeWaaB4dpKFQqhgCeTnjgY96Lv+vmNwjy/f+S/XQ1P+Eg0z7QIftJ5k8oS+U/lF/7vmY2Z7Yz1461Je6zZaezLcPKNi7nZIJJFQerFVIX8cVzPkzyeEIvDgsbpb4BIGYwN5a7WBMnmEbSMDI5z2xmrOqT6nJeajayNqUcQjCWsdnaq6zgr8xZ2RgDnIwSvA75pOTSGqUXKxuXet6bYvAlxdKGuFLQhVLmQDH3doOTyMAcntQmt6c9jLefaNsMT+W+9GV1f+6UI3buRgYycjFYOm2Vyl34VZ7aVRBp7pKWjI8ttqDDeh69a0NetPLaxvLe1LrDfJPcrDHl3G0ruwOWIyPU4HtVO6f8AXcnljoh2m6u9/wCI763RphaxW8TIk1u0RDEtk4ZQ3Ye1blc9pbT3PinUbxrS4ht3toUieWMrvwXycHkdeh56etaGm6jc3t1fRT6dNapbS+XHJIeJh/eHHT86E9F/XUmpH3nby/JGa6eJTdvtlxD/AGku3iP/AI9dvPv1/GujlnuooUEEIdSzZO0n0oolgupYUMEwRQzZG4j0qoprRGVWSa96xB9s1H/n1H/fB/xo+2aj/wA+o/74P+NH2PUf+fof99n/AAo+x6j/AM/Q/wC+z/hV+95mP7r+7+IfbNR/59R/3wf8a1T1NZX2PUf+fof99n/CtU9TVwv1Oevy6ctvkJXPeNf+Ram/30/nXQ1z3jX/AJFqb/fT+dWc5paN/wAgLT/+vaP/ANBFXqo6N/yAtP8A+vaP/wBBFXqQg71sVj962KQwooooAKKKKAMiTWnTWbWx+xSLHOzoJpG25KjJwuMke5x7ZFOuNTuxrB060tIZWWATM8twYxgsRjhG9Kz9VugfEWlyrb3rR2rS+a6WcrAZXAwQvPPpmrmqjSZjuvNLe7lMXykWDyNg9Bu2/KfYkY9q0stHY5+d3kubZl6WTURDEYrW1aQj94r3LKFPsfLOfyFVdM1OfUHvo5baOIW0nlb4pjIrtjJAyq9OKqwnU9K8IojRSz6gFKIi5kKlj8oJGc7QRk9OK0dN09NM0qK0U7ii/O/d2PLH8TmhpJMqLk2vTX+v62PnrwZ/yOmj/wDX0n86+iLr/Wj/AHa+d/Bn/I6aP/19J/Ovoi6/1o/3a8vCfw36nJl3wP1IKKKK6D0Armtd8VrpGt6ZYCC5dZ52SdlsZ5Pl8tmHllVwxyBkDdgZ4GOOlrnPFMc0V5oWpJbTzw2V6XnWCMyOqNG6bgq5JwWGQATiuvBRpyq8tRXun5a2dvx28xSvZ2Idc8SrZDQrtLiS1srm+MVx9ot2iYoI5Dja6hgSyjGBk8Yzmti01ywvra5nt2nYWpxNE1tKsqHAbHllQ+SCCOOe1ZGsE6td+Gbq2tbl4Y9SMj+ZbSRmMCKQbmVlBUZxgkDqPUVJZiSx8UeJL6eC4Fu0dsUdIHffhGztCgliPQZrpnRoyorRqSV+n89rPS97P8Nibvm/rzLPhq9a+tr2VtUkvwLyRV8yyNs0A4xEVYAnbnqRzmp4PEWmXN6bSGaV2Ehi80W8nklx1US7dhOeMbuvHWsfwheKbvV4XtdQha41CW4iM9hNErRkLg7mQAdDwTn2qlbx3Wm6xbw6A2rrDLelrvTryzb7PEjf6xkmZQBg5YBXYEngYNVPCQlWqJ3VldbJbdbK34Jd2hczSv5s7mueudWnt/HMNjJcLHp/9ly3MisFADLIo3FjyAAT3xVjUtZvbLxDpOnQaNc3VtemTzr2M/Ja7RkbuO/Tkj2z0rlvG3hnUPEPimAWjSRpHprkF0Jt53EyMIZjjlWxyAQfqOK8lbr5/kzW2jXp+aOlbxloEekwarNf+RYTzCGK4nheNHYgkEFlHykA4b7p9aT/AITPQha3VxJdTQpa7DOs9pNE6BzhWKMgbaT/ABYxweeKwdWnu/EOleGZho17azW+tW5urWS3b9xsDbjnGCg4w446V1mpaLYaraXkFxbRE3lubaWUIN5Q543dcAkke9Nqyb8/0Qluv66skudUsrS+srKabbcXpYW6BSd+1dzdBwAO5xWVb+OPDt3LClvqBkEsohWVYJPKEhOBG0m3ark/wsQeRxyM4fgU3er30uoaijebpEP9kRs38ciN++kHs2Ix/wABNYujudX+Hll4f0+yvGu5bzc8ps5EhiVbku0nmsoRsAdFJJJ+uHZXt/X9W1Dp/X9b6HU3XjeK18YrpLW18bUWskjsml3TyeYrqo27UO5ME/MAR05rZvPEWm2CWxnkn8y5XfFbx2ssk7LjJPlKpcAcZJHGQDisjWHk0vxzp+ry2l5NYtYS2ryWts85jcujLlUBbBAPOMZHvTJ5zpvjM67NaX82n32nRwRvBZyyvC6uzbWjVS67gw5K8FcHBxSWy+f6/wDAB7v5foa0nizQodKttTl1KJLK5l8mOVgQN+D8rcZVvlIIbBBGOvFVrrxjp6aDq+pWayzS6ZC0strPFJbScLuGVkUMAR0bBHX0rmF0a+kSyvH0+dUvPE41AW7RZaCLYQGcD7ucBjnoWwean8S6dfT3Xjgw2VxILnRIYoCkTHzXAmyq4HzHkcD1FFvdv/Wyf/AGrc1v63a/LU3LLxNf/wBu2Ol6tpcFs+oQPNbS2t2Z1OwAsr7o0KnBGOop9nqv2zxpcW0eq3AjitDnTJtNeL5g+DMsrqNw7YGR3rHsNFm8PeMtNu4oL28sr+z+zPJO0ly9lIvzDDuWZI35BGcZAp/9rRH4kLefYtX+zf2cbTzf7KudvmeaDjPl9Mc7unvVWXMkvP8AX/gEXfK36fp/wf8AhidfGEGneJ/EFnql1KYbVomgihtXlaNPKDOxEaltuTyzcDIGak1XxTHYeKNGX7aDpd5ZTyhYY/NMzhotmwKCzHDHAXrn2qot0dF8WeKJptL1Cd70QG2+z2MsizbYtu3zFUqvzZHzMMdelZ2n6bceFrzwg2oWd1KllplxBK9payXIilYxkL+7ViBgMAcY4qY20/ro/wCvUt/1+B2aeJtHfR21X7aq2aOY2Z0ZXDg42FCA2/PG3GSccc0238UaRc297MtxLH9hjMtzHcW0kMsaYzuMbqHxgHBAwcHHSuN/sjUAx8RHT7kQNrw1I2SoTN5Hk+UH8vrvz8+z72OMZ4qzq0Fxr97rWrWVjepbpoU9innWrxSXMr5bCxuofC464wS3GcGk9Ff+tr/noNJN2/re35anT2Pi3RNSvIbW0vGke4UtA5gkWKYAZPlyFQjkdwpJGD6Gqln4j1LWPMutG0eG40tJGRbm4vPKefaSGMSBGBHHBZkyfQc1n3Gm3B/4QaNLSYR2zEThYyBCPsrr8393kgc9656eC90v4fyeHWtdei1vT0kjsZdOS68ufJOx/Mh+XBBGRIRg5yO5txSlZERd0r9TvL3xXo2n6i2m3FzIb9Y1kNrDbyTSlWzghUUlh8pyRnHGcZFOfxToyadaX4vPNhvP+PZYInlkm9QsaguSOcgDjBzjFZml2dzH8RtXu5beUQvptrGszIdrMGk3AN0JGRn6io9Ss00PxZpmrRafK2mx2s9s6WNs0hgd3V9/lxgkhtpBIB5xnrU6af13/Ma/r8DYTxRo8mm/2gt5/o4uFtm3ROHSUsECMhG5WyRwQMZz0qxc6zp9pdy2s9xsmitmu3XYxxEpwWyBjr26+1cJqOl6he2Gv6xBYXSxXWpWdzDbGIrM8UBj3v5eNwZgpwpG7AHGTiptRuLjVNf1fUE02/g09fD00Mdxc27RCR92SNrAMv8AwIAnBIGOaUtFf1/9Jv8AnoNK7+787fkdRYeMNC1S6t7ezvjK1yCYJPJkEU2BkhJCuxmAzlQSRg5HBrG/4TbUU0661eTRLb+yba8e2kkS/JnAWUxlxGYgp55xv6Vn6W513S/Blnp1leImnmC5uJ5rOSCONUhK4UuqhyxbA25GMk8dcVdLY6RqNvBYa8fEH9p3E1nG8Nz9k3eezRuRIPs+3GDk89x82K0cUpW/rdf8ElO8b/11/wCAeqRalaTalcafHLm6t40llj2n5VfO05xg52np6VzXiDx3a2GhWeo6as1yt1NCI3FjO8ZjaUI3Krw2M4BOScYB7slnudF8a6nez6dfXS31hbR25tLZpFeVDJuQsOI/vry5UYPXg1lx6XqQ+D+nQHT7j7daSQ3EloE/ekRzh2UDucA4HftUJK6fS6/PUfl/Wx1N54ptIdEudRit9R/dhlVZNLuQ24KSMoUDbfVsY96b4X8URa/pNnNJDdRXMlqk0xexnhhBIGdruoUjJ4wx49ati8i17RrxLSO6jLxvEBdWktuclfSRVJHPUcVzujtNqnw//wCEcFtf2OqJpZtX+0WcsaI4TZxIVCMM9NrHI5pbKWnb9Rqza/rsblp4t0S+vIbaC7ctOxWCVreRIZyOojlZQkh4P3WOcEiop/G3h+2muIpL5i1tKYrkpbyutuwOP3jKpEY54ZiAecHg1z8zTa5pGg6JbaVqFpdWlzbSXBntHjjtlhILYkYBHzjaNhOc56Zps+mXn/CF+PIVsZ/tF3dXbQoITumBjUKVGMtnGBiqaSb+f6f5v7hLW3nb5b/5G/4n8UyeH7fzodLmu0UxeZKX8uJQ7hBhiDubnOADwOSMjPR1wnju4ZvCEelxWWoz3jfZpAlvYTyjCyIWyyoVBAU8E5rprjWSPD1zqthYXl08UTvHavBJBLKy/wAIV1DDP0+maT0T9QV3bzMHxIbtfF2nmyt7e4n8g4juJjEh+9nLBWP6VH4f1fU9aeSSbRtPtrWG4lt5HS9aR9yEqSFMKggkf3hx+VAvZ9S1/Qb25spbGeey8yS2l+9ESGJU8DkfQfQVFoGnXR8Pa1aOkltNcXt55bSKVOHdtrD25yDXNtKd1t/wBKzXz/zL0PibQbi7jt4rgHzpDFFMbdxDK/8AdSUrsY8HgMehpb3xHoen3MtvcTHdDjz2jtpJEgz08x1UrHxz8xHHPSuZKXGo+E9J8NRaXfW9/bvbJMZLZ1igELqWcSkbH+7xtJJyPfFmCSXRbXXdLuNMv7q5u7qea3MNq8kdwJfugyAFEx907yMYz0q3FK9vP57Al3/4bcv+L5Lmz0qHU9O1CSALNAnlxxxPHKryqpJ3IT0JxtIrU1me+sbVriw06yuUjRnlE9y0JAAz8uI3z364rldchl0vwHpmgvBfXd9AlpuNtZTTKRHIhb5kUgYCngnP511txcLqXh66lto7jEkEioksDxOTgjGxwG/TmlNcsXbo2OOrVylouqXd/pCarf6Xa21rLbrcRi1me5kIIzgoIlOcdl3Zo8MXC39rezNqLagBeSKvm2BtWtxxiIqwBJXPUjJzUmgM2m+C9LN1DOjQWMQkjWF3kUhACNigsT7AZrL8HXqm51iF7TUIWuNQmuYjcWE8StGQuDudAAeOhOfaqmkpSS6f5kK/Kn/WxetfF3hu9kt1trtZFncRxyi3k8reeiGTbtV/9kkHpxyKfo+u2+pWepS3FqlpJp1zLBcRlg23ZyGzgcFcHp3rjdEf+1/AOj6HYWd2bg3EUkkrWkkcMapNvZ/MZQrHjgKSST9au+KdN1NfEdxZ6fZ3Eln4ihigupokJW3KNh2Y/wAOYiQPcChwV+Ven5a/mW7L5HQ2PiS0n0Kw1K8spYHvU8yO3ggkuZAnZiI0Jxgrk4wCQM1b8y113RFutK1B4Y5BuS4t40LcdVIkRgDnggjIxjg1la/d6laazZWkL6jZaR9mY/aNNshcyGUEARkbH2Lt5zt59Riq3hSSXRfCt02pWuppJJf3JCNZtJMdzsQzLCpHPqo2+napkk02v61Ela1zQ8Pash8B2et6xKpxaefcz+UOgySdqj9AK15L7T4rqztnZBNehjbr5Z+faNx7cceuK43S4bjUfhNPokNnex6immtCYbm1kgy5U4ALqA34E1YS6uNW8S+GXt9L1KO1tY5hPcXFq8IRzFgLhwD/AMCxt7Ak1Uormf8AXcXRf12N0+I9DW/+xmb5/O8jzfs7+T5v9zzduzdnjG7OeOvFSX2uaTp159kn8x7gIJGS3tJJzGp6F/LU7QcHlsdD6VxGm6M66Mvh7WdR8SRMsxV4YNOWSB/3m5XEywNwTg5L5BznFbPiaD7NqdxfaZPrdlrD24jVrSya5guccoHGxkGDkZJQjJ5xg0uVaDtq0diqQuiuixsrDIIAIIrI1/U5NJ/s+O00+C6nvboWyLLN5SqSrNksEY/w+nek1LVtU0rwkNSOjyX2ppFGZLG1PJc4DBSAxwMnpnpVHxTJMR4cvjZ3bJDfpNOkMDzPEvlODlUBPBIHApcuvzEtr+T/ACLVhre7VZ9K1awhsb2KH7SpSXzYZYuhZXKqcqeCCoxkdRU9h4g0XU7pLa1kJkkQvF5ls8azKOrRsygSDkHKk8EHpXLa5pOo+LrvUr2ytri1gTSZbK0e5QwvcSOQW+RgGVRtAywGc8cc1b0m1h1DUdKa7v8AxI1xZEyR295pqwxRvsKkGRIFU4BI4fB7ZqlFNa/1v/wBvy/rY3hr+jNqD2Ss7yJL5LyJayNCsnHyGULsDZIGC2cnHWpNQ1nStMuY7W4LNcyKXWC3tnnk2jjcUjVmC54yRjNcvcR3Wm6yR4cfWI5574SXOn3Fkz2jhj+8cTFcJkZf5ZMZ425OK0TNJoXjLVLy8s72W0v4YfJuLa2kuNhjBDRssYLL97cCRg5PNLlVkDWrNO/8QaHpgtDeXMcf2xSbYeUzGXAHCgAktyML1JOACaWHW9KutPuLu3EzrA/lyxrZSmaNuODFt355B+7056VnapBPeeMfCt4lpP5Ma3TSM0Z/dboxjcRwpPSty4ks9KjnvTbODIwMrW1q0skh6AlY1LNgYGccCk0rf13AzPD13C3hZL+61MakiCR5LxrL7OSFZs5jxkbcY6ZOKfY+J9A1G5ggtLkSG4BMEn2dxHNgZISQrtZgOqgkjB44Nc/oNxj4falYy2t9b3EcN3Iy3NlLCNrM5GGdQDwRwDmm6Y51rTPCFpYWd2iWBhuJ55bSSGNFSIrhS6jeWLYG3Ixk9Otcqbfy/G/+QPRff+H+ZftPGVpN4i1Gxksr37PBHCYimkXJky27duGzgcDBIGeetXfEN/Fb3em2seoS6dJJdRbnGmPNHOpOPKL7dqFj3zkVWM7aL431K6urS+e1vraDypra0knXchcMreWrFT8wPOAfwpnjW9BXTraO01CaSK/trh/IsJ5VEavkncqEZAHTOfakkrx9QfX0/Q39S1HTdJjje8YKZW2RRxxNJJIfRUUFmOOeAcDmqv8AwkegjSpdTe6jjtIZRDM0sTI0LkgbXVgGQ5I+8Bwc9OaztSlZfEWj+IVtb2awW2mt3VLWUyws5Uq5i278HYVPy5GR2rE1TTbvUrLXtRisLkQ6heWQht3gIkdI3QNIyEblB54YA4XJojFPf+tbf8ENDWvdb0zUtX0u3s3cTR3CSFJLd4iyFsBl3qNy5B+ZcivQq818RQTf8LH0G4ET+QIdhk2nbu81TjPTOO1elUqVrths2FFcVd+BPtV7PcfY/CDebIz5m8OeY5yc/M3njcfU4Ga7KJPLhSPCDaoGEXavHoOw9q26De5n6wNVMmnf2Y21ftafauFP7nB3fe98dOaNCXVF09xq77rnz5Np+X/V7js+7x0x71p0Uki3P3eWy/Xr/n+QUUUUyDmG8TX62moX66TE9jYzyxSlbs+aVjbDMEKBegzjdWtNrljBBDMzTss0YlUQ20kpCkcEhFJUfX3rC0rw/LeQapFfXN/FaTahcM1nhUSVC5IOdu/afZsEe1T6ncahDrX2VG1C109LdfIOn2iymWTOCrFkYIAAMZ2jnk1Cb5Vfrb8jslTpynyx6X77fjqbEutadFp0N+blWt5yohaNS5kJ6BVUEsfYDPB9KhuNdtY9KmvYluG2ZXZ9klLq2Mjcm3co6HJAGCPUVz2naag8FadFqMGp280E7yJJbxEzwPvbB2qDnIOPukc+nNa2jHVL3StQivnllRndLWeeDyZJIyOrJgYIOR0GQM45obdnYTpU469nb8emn9difw/ryazp1pI8U6XElussmbSWOPJAztZhtIyeME1NB4h0u5ukt4rhi0jFI3MTiORh1CSEbWPB4BPQ+lZmhSST+FotGaG8tL6Ky8hvNtpEVWC7chyu088jBPFZmk2Als9L0/ULrXYprR4z9mNkohWSPp+9WHBXjrv5B61TfvaA6MLyb0t/V9tv6udzXP6v4lXTNa0+yEM7LNIyzEWcz8BCw2FVwxzjOM456V0FYHiJJY7/AEXUFgmmhtLljMIYzIyq0bLu2jJIBI6A0MyoqLlaSvo/vtoR6x4gWzfRrlZpLezuLlkm86BkZlCOQNrLuB3AYwMnjHWtW21iwura4uEn2R25In89GiMXGfmDgEcHPNZeqZ1K/wDD1zb29w0KXjO/mW7oUAjcZZWAK845I9KzdW0m/vm8UR28UoaZrVojgAShACwUtwehHpnrUttX/rsbKnTkop6f/tW187HR2OuWGozmC3kkEuwSBJoJIiyf3lDqNw9xnqPWtGuY0yGC91e1u5L7W5ri2jfy0vbHyEUMAGBIhQE8DjJ6V09WjCrBRlZf1+C/Iz7vW7Cyuvssskj3G3eY4IHmZF9WCA7R7nFLd6zY2RhWWVneYbo44Inmdl/vBUBOPfGKybWZ9G13V/tlpdul5Ms8E8Fu8wYbFXYdgO0gjvjg06Zn07xVJqdxa3T211ZxxK0MDTGJlZiVZUBIzu69ODUp6I09lG/Xb79tv6ZoP4i0mKwt7576Nba4fy45CDgvgnaeODweDjnjrRFr9hNDPJGbljbsFli+yS+apPI/d7d+D64xXNJpd2Vsbh7OVVuNeN75JTJhjKsAWA+7ngnPQt61uWNvMvjDWJ2ikWGS3t1SQqdrEb8gHvjI/OhNtf12THOlTinbW3n52GeG/EY1rT7Z5oZ0uZAxbbZyrFwT0dht6D1q3/wkOl/bBa/aG3GXyRJ5T+V5n9zzMbN3bGc5461n+FZWtNLi0e5t7uG7gMiEtbP5ZG4kMJMbOQfWsTTtLZdJi0TVb3XY2SQK8UVkHhYh9wYSrCeCcHJbI5zihN6FujTc5dEn+Guu239XOoufE2k2k9zBLcuZbb/XrHBI5iGA25tqnC4P3jx78VW1rxNHps+mpCksq3Nwiu62ssimNlY5RlGC3A4GTjPFV4bOdZfFrG2kBuG/dHYf3g8gD5fXnI471FdW1zF4a8NzfZZ3axlt5Z4kjJkVQhU/L1JG7oBnild/l+Io06Skuvz629O501pdx3kAmiWZVJxiaF4m/wC+XAP6UUWl3HeQCaJZlUnGJoXib/vlwD+lFWcjVnYqUVgeNrie08F6rPbTSQzJDlJI2KspyOhHIqxba9BdavJpltBcXDW6j7TcIF8qFiMhGYkEtjsoOMjOKD1nJJ2Nesy00SK21SbUprq5vLt1MaPcFf3MZOdiBVUAZxknJOBknArItPHtheWcF/Hp2prp0sqwteSRIscbltoBBbcRnA3KGXnrwcaUXiWxkstWupFmhXSpJI7lZQNw2LuyME5BBBH1p6rX+v61FdN2/r+tC0dKgOujV98n2gWxttuRs2lt2cYznI9avVzsni+3S6srNNM1KW+vLQXcVskSbwhOCGJYKpGeckDsCTgVn+IPF048FXWq6PZ3nmqrqzlYgbSRG2sJFduTnI+UN+WKLPb+t/8AMXNHf+tv8jsqKx118QabcX2qafeabBAoJa4MTl88fKInck5wMdTkYptn4kjuNRisLvTr7TrieMyW63Yj/fAfe2lHYAgYJDYPPTrgsPmVrm1RXL2fjqwvYLO7jsNRSwuphbreSRosayk7QpG7d97jcFK5PXrihqfiTXLf/hJLuCfS47PRpABDPbvvmHlo5HmCQBSd2B8p7UW/r+vUOZdP6/qx29Fcp4o1TPhWK4nt9atreZI5ZZ9NmijltuVOCWYHknB2g8ZqTxlqMmlwaLOs1wiHU4kkEO4tIpV/lwvLZOOO5xRbWz72Fzqza7XOnorj9c8Sm48MeIoY4b3TNTs7F5fLmZVkVSp2yK0bMMZBGQcgjtV/TPFEFxPYWc9pe25u4ibW4uFUJcFQCdvzFgcZI3BcgEiiw+dHQ0Vzh8Z2SoLo2d9/ZRl8r+09ieRnO3ON2/bu43bNvfOOaddeLreDUdQsLfTdRvbmwVXuFt40wqMu4MGd1B9MZ3egI5pD5kdDRXNTeJJtSvbGw8Pm3eS6tRetdXKsY4oSQFOwEFmbnAyuMZJ7Gxfa1L4b0f7ZrrJOBOkQksYGGd7AA+WWYjBPQFiccDnFO3f+uguZf195u0Vgw+K7Tz7iG/tLvTGhtjeZvFQB4QcFhsZsY4yDhuRxRbeKYJry0gudOv7Fb0kWk10iBJjjOPlYspIyQHCng9+KLMOZG9VG20qC11a+1FHkM16IxIrEbRsBAxx7+pqi3iqxTQLzWTFcfZ7WZ4XXau8sknlnAzjGffpUd14sgg1a80y303Ub68tEWWVLaNMBGGQdzMq9sYzuPYHBIQXR0FFcrceIb3UdT0a30K5s47bUbOW68+5tXlOFKYAUOmPvnOfSnaf4rYaQ9zqcSu8epf2d5loP3crFwgdQx4XJ5GTjB60+V/162/MXOv69L/kdRRWXc63HDqkumxWlzc3cdqLoJFsG9SxXALMBnI74HvWN4S8RarqlvKLzSb9v9MuI/tJNuEjVZGCqQsm4kABchTz3PWhK5Tkk7f13OtorjbLxPq8virVbR9B1OSCGKAxwBrUNEW3ZYnzRkHA7np0FbN74hS2v5LG106+1G6hjEk8doqfuVP3dxd1GTg4AJPHTpRYSkmbNFc9L4z0xYNLlgS6u/wC0y62qQRZZnUZKkEjaeo5wBg5IHNT2uvPqNldtZadP9vtZvIls7l0jKOcH5mUsu3awbK7uOgJ4osw5kbVZ+uf8ga4+g/8AQhVLwrq97rFjevfLAJra+mtv3ClVIRsA8knNXdc/5A1x9B/MVM/h+Rth3erH1/U5yK9kWFFFrIQFAyO/6U/7dJ/z6Sfr/hWHJd6/Bq2n6dHe6Zsu4pJFZrGQlAgXAP77n73Xjp0rTn1k2twtittPqF+sQkmS0RVCg8bjvcAZIOBuJ/nWHK7bnqOtDmacdiz9uk/59JP1/wAKPt0n/PpJ+v8AhVP/AISaxewtrm3Se4kunMUNtGmJWdc7lIYgLtwckkAY69KltNQt9aS7s3iurW4hws8Dv5cqA8gho26EdCrUcsgVak9l+JP9uk/59JP1/wAKPt0n/PpJ+v8AhWX4XNw+k30a3MjyRXtxFE9y7TFQGIUElskD6/jUdpd+IJ9fvNOe90zZapFIzrYSAuH3cD99xjb1560+V9yfbwsnyfibH26T/n0k/X/CqexRrB1T7NceebcW+3Py7d27PTOcn1qG9ugfFmmwSrqsB/eCExyxi2n+TJ3qGLHHbIHNWL7xBDZ6sulpZ3d1ePD56RwIvK5IPzMwAxjuR2xk8Ucr0sxurTd7x29fItfbpP8An0k/X/Cj7dJ/z6Sfr/hWLqHi2NNN0+4tDFb/AGy4Nu018MJasudwkAI5ypAG4AnvitXz9StLCR7iFb+YH5fsSCPcPXbI+Bj/AHjmk4tK7YKtTbsokv26T/n0k/X/AAo+3Sf8+kn6/wCFZHhfXNQ1HQ7We8028Z2hLtckwhZCOwCvnJ91FXB4lsm0K01ZEneK6dI4olUeYXZtu3GcZBznnsabhJO1xRr0nHm5fPqRQW/lanJqEy3l1cFSkZm24hQnJVAqgenJyTgc1raVqbafbyRvaTOWkL5A9h/hWHrEbW/ibQ54bi6Q3Fy0csYuZPLZRE5A8vdt6gHpWnf6vHY3MNrHbXF3dzKXSC3C7to6sSzKoHIHJ78UWejuJzptSi46erOi0/V1v7h4RA8bIu47q0a5PwpqMOqX91cQrImF2PHIuHjdSAysPUH8PTIrp7m5gs7eS4up44IIxueWVwqqPUk8CtYt21OHERhGfubWRLUc8ogt5JiCRGhYgd8DNZ1p4n0C/uktbPXNMubh87IobuN3bAzwAcnirmo/8gy6/wCuLfyNU7pGVO0pJGYPEasMrZTkHuKX/hIh/wA+M/5VxUPiS6T7fYwwRS3qXC29lEMjeTGrln5+6u4kkY4wOprTvNeGlXFjYXcM91f3UbMgs4fldlxkYLfL97qTgY5IrFObS13/AMrnfKOHTa5dvN97HRf8JEP+fGf8qP8AhIh/z4z/AJVzaeKbRvKEttdQu959ikSRVzDKRkBiGIwRjBUnqKnvNftbO5voHinc2Vp9qmZFBULzheT947ScfrRefcFHDv7P4s3f+EiH/PjP+VH/AAkQ/wCfGf8AKuctPE9vdz2qCyvYo7xSbWaaNVWcgbsAbtwOMkbgM44qhp3iDU59e1S3k0fUHiiaIJHutwYcpk7j5nOevBP9Kfv7XJ/2bS0b39Tsv+EiH/PjP+VH/CRD/nxn/KsG715ILua2trC8vpLdQ04tlTEWRkAl2XJI5wuT+YzDL4qsF/s/7OlxdnUY2e1EEeS+3GQckbTz3wBg5IpXmU44dbr8WdJ/wkQ/58Z/yo/4SIf8+M/5Vk6XqkWqwyukUsMkMrQzQzAB43HY4JB4IOQSOatTiZoHFvJHHMR8jyIXUH3AIz+YobkupSp0GrqP4suf8JEP+fGf8qP+EiH/AD4z/lXJ6Zea9d6xf2s15pvlWMqI5SycNIGUMcEzHaecdDU8/iq1hWacWl5JYW8hjmvkRfKQg4bgtvYA9SqkdeeDT97uRaha7jb5nS/8JEP+fGf8qP8AhIh/z4z/AJVg3Wuxw3bWtpZ3WoTxxiSVbUJiNT93JdlGTzgAk8dKpa3c22r+DrrU7O5uVEdvJLC8M8kLKwU/eCkHgjofSk3JK9x8lBuyjr6s6v8A4SIf8+M/5Uf8JEP+fGf8q5PXbq4h8GwTxTypMTbZkVyGOXQHn3ya0rXWYb3UrmztYJ5ltvlluVC+UH/uAk5LDvgEDuQab5lfUSVB293e3V9b/wCRtf8ACRD/AJ8Z/wAqP+EiH/PjP+Vcxolytxrer7l1SG4HlGS2vJY2jiBU48sIzAZxk89aqQeIdUbxPf2p0bUJIIoIWSBWtgUJL5YnzBkHA7np0Hc97uK1C1+Xrbqdl/wkQ/58Z/yo/wCEiH/PjP8AlVccjOMe1ZOt6pPpsulpCsbC7vUt5N4JwpDHIwevFJOTdrlyp0IrmcfxZvf8JEP+fGf8qP8AhIh/z4z/AJVUmk8mF5CjvtGdqLlj7AVlQa4txdy2E1nd2N4IDMkdxsO9OhKlGYcHGRnPIpc0rbj9nQTScfxZ0H/CRD/nxn/Kj/hIh/z4z/lXD+GvE6/2Bo/22G+ZZ1SE38oBjaUjoSW3nJ43YxnvWtd+JLe1luglneXMNmQLqeBFKQ8ZOcsGbAOTtDY+vFW1NO1zOH1eUVLl/FnRf8JEP+fGf8qP+EiH/PjP+Vcl4twdFi1K2urlJElh8t4LmRFZWkUHKqwVsg9was+I9bfR0skRreFrufyftN1nyYeCSW5GemAMjJPWl73cbVBXvHRK+7Ok/wCEiH/PjP8AlR/wkQ/58Z/yrF8/UrSwke4hW/mB+X7Egj3D12yPgY/3jmszwzruoX+gW1xeaZeu5gMjXGYAspGeFCvnJ7ZUfhSvKzd9h8tC6jyb+p1v/CRD/nxn/Kj/AISIf8+M/wCVc/8A8JHZHRrHU0SaSK9eOOGNVG8s5xgjOOOc88YNVNVjNt4q0SWK4ul+0zSJNH9pkMbARMR8mdo5APAp+/ezYmqFrqN9ur6nV/8ACRD/AJ8Z/wAqP+EiH/PjP+VY1/q8dldRWkdtcXl3IpkEFuF3BBwWJdlUDJA5OT271NpuowapZrcwb1G4o6SLho2BwysOxBpXla9yuShfl5fxZp/8JEP+fGf8qadfRmVjp8xZfukjkVla3qX9j6Jeaj5LTfZ4i/lqcZx79h6n0qDRrjULqCO6nvtNvLaVMq9nGyhT6Al2DDqM/L0/JqU97g4UFLl5fxN7/hIh/wA+M/5Uh8QqQQbCcg9QRWAPEdmdEi1by5/IkmEIXaN24yeX0zjGffpUVx4ogivr6zh0+/u5rEBpxBGuFUruByzAH6D5uDxRefcXLh/5fxf9dDpF8QIihV0+ZVAwABgCl/4SIf8APjP+VYMviC1EdkbSKe+lvY/Ngitwu5kwCWJYqFHI6kdcVDN4q0+30kahLHcqguBbSRCLMkUhONpUHnHtnPbNF5hbDW2/F+v5HSf8JEP+fGf8qP8AhIh/z4z/AJVz0OsyX881hFbzadfiITRi9iV1ZCcbsI/4YJBGRxVXR7zXL7Ub6K4u9O8myufIcR2Tq0g2K2QTKdv3sdD0o97uJqhpaP4nV/8ACRD/AJ8Z/wAqP+EiH/PjP+VcxFdCTxl5Uq6rBKLRtkUksZtpFDj5wqsTu5HJxxUlz4lhh1O606Cwvru6tkWSRIEXAVgSDuZgO2MZyewPNF5W3Hy0Nbx8t2djp2orqMbusbJsbaQxp17p8V+bbzWcfZ51nTaRyy5xnjpzXLad4n0/TPCN34gkE81kHVwIY8uQxAHBx3POa7NGDorjOGGRkYNXG7V2clbljVahsLRRRVGIUUUUAFFFFABRRRQAVHcSXEcUYhlRAWYkMyjsPWpKbNFayQxm4kKsGbHOPSmiZNLdX+Vyr9ovf+fmH/vtKPtF7/z8w/8AfaU/7Ppv/Pc/99f/AFqPs+m/89z/AN9f/WqrPv8AiTzU/wCX/wAlGfaL3/n5h/77Stk9TWT9n03/AJ7n/vr/AOtWsepq4X6nNiXF2srfKwVz3jX/AJFqb/fT+ddDXPeNf+Ram/30/nWhymlo3/IC0/8A69o//QRV6qOjf8gLT/8Ar2j/APQRV6kIO9bFY/etikMKKKKACiiigAorFm1S/i16xtHt4Y7a5eRQWO6Q7Vzu4OAD6c/h0qLUtaltdc+w/btPsofs4lEl2hO5ixGB86+lUoN28zN1Yq/kb9I33D9KyNQ1K4sk0+IS23mXcmw3ToREvGfu7u/QDd+NO0vULm7l1C3uPJkNrIEE8ClUfIyRgk4I78mjkdrh7RX5TwTwaoHjPRzvU/6UnAz619DXX+tH+7Xzv4M/5HTR/wDr6T+dfRF1/rR/u15uE/hv1OLLvgfqQUUUV0HoBRRXK+Ide1LTtf0a0tdNvZIJrlkkMZgxcDynbau5wQQQDzt+6eT0O1ChKvPkjbZvV22VxN2VzqqK5HxHrVxaHw7dPb39oJdRKS2oIaSQeVJhSI2ZWyQp646E4xxs2OuLfJfIun3cV5ZECSzkMfmHK7lwQ5Q5HQ7uxzitJ4OpGmqnR/52/p7aoOZXsatFYHhSeOe31FkfVC638qyx6jKjtE/BKIUJAQZ4GT3qax8QpqNxi206+ez81ohe7U8ospIPG7fjIIztx745qZ4acZSS15f6/ruHMjZoorlNT1ddM8dRveXrQabFo808wZyIwRKg3EdM4JHrziufrb+trj6f13sdXVa/tZby0aCG+uLJ2/5bW4QuPpvVh+lYdz40tLHRrPVL3TdUtoby5W3hjeANKxYEq2xWLYOOmN3+zTJ/HFrZ22oSX2l6laTWMUc81vIsTP5TttEgKuVKgg55yMHinYDc0zTLXR9OisbNCsMYONzFmYk5LMTyWJJJJ6k0zRtJg0PSodOtnkeGIsVaUgt8zFjnAHcmmXOt21tq2nabsllnv1keMxAFURACWY54HKjjPJFYtr4/0+8t4byPT9TXTpJxbNevCqxRyltgU/NuI3YG5VK5PXg4NWw6HWUVxl34n1iDx3Hp0eh6lLafYpJPJRrXMrCRQJAWlBC4OMEg8/d9Nm88RJa3FvZx6bfXWozReebKDy98SdCXZnEY54+9yemcGlbRPv8A1+gdbG1RXMy+OdJh0m21B47zbNefYWgWHdLFPzlGUHqCMcZ6gjI5qLUPGLRaFr80VhPZ6ppVqbg2t8qHIKko2Y3YFSVI4bPB6UW0uNK7sdXRXI2Wvazb+KNN0jUpNPvF1C0e4V7SB4Xg24+8rSPlTnAPHIqazvFn8fzxSprVrcLYkpbzzRG0kjEmPMVUdiHJPU4OO1O2tvX8P+GJvpf+tTqKK4eLxJcWHi/xPb/Y9T1MQGCRYLbawhTyQWI3sqjJ/hByTnAODRf+J1Pirw7dae93e2V9p9xJFbWv/Ldt0W0kMQoIBbliMc8ihK9v66XG9P6/rudxRXPJ4x05tKkvHiuo5o7k2bWJjBn+0do8KSCSMEHO3BznHNCeLrVU1FbyxvbG7sLY3clpOIzI8IBO9CjsjDII+9weuOKXmNK50NFc5YeMrO/udPT7Df29vqKFrK6njVY5yF3EAbi6nbkjcoBwcE8Zr6Vq2v8AiO3/ALV01tNtdMd2FtFcwSSS3CKxG4sHURhscDa+Byc9KdmnqI6uiufu/FkNvrs2iQaZqN7qEUKTtHbRptKNu53uyqMbf4iM5GM84anjKwuLHT57K2vLu4vw5gsoo1E3yHEm7cwVdp4JLAZ4BORSsB0VQXtql9Y3FnKWEc8TRMVPIDDBx781if8ACZaeNOmupILuKS3vI7K4tXRfNhldlVd3zbSPmU5UkEHjNXL3xDaWGoz2Msc5lhsXv2KqMGNTggc/e/T3oa01/rS/5DV76f1rb8y9YWcenadbWULM0VvEsSFzkkKABn34qxXNad41stRl04rYajBaalxZ3dxEqxzNt3bcbt4OAcFlAOOCcjOIfFfiCPRrrXGk0p7WDUZLQWItpFlkVZzEAsnmkbz1xs5PFU03LUlWS0/r+rHoFFZ8Gr28+t3mkqkouLSGKaRiBtIk3Ywc5z8hzx6Vyuv+NLs+FrDVtE0+/Md3cQATYg+VTMqMhDPncwyAQCBkcjqEld2Gd1RXP3+uajFoF3eJ4f1OKeNWCxM9sXX5SfM/1pXaD2zn2qHwr4gvNQ8PWd3qmnXlsPsSTy307QCOQ7QSwCOSM8nlRx6dKXfy/r9A7eZ01Fc5b+MrSaWzaXT9QtbK+cR2l9PGixTMfujAYuu4dN6rn6kVBP48sYf7SdNO1OaDTJmhvp44k2QbcZY5YFhg5wgYgDkDIy7PYDqqK5Xxd4h1XRdO+26daWzWyNDuuLhiQ/mSBNqopByAc7iQBxgNk46qi2lwOM8SXT2ni2xmS3edltziNOrZ3Cj/AISO7/6Al3+R/wDiaXxGl4/i/T1sZ4ILjyDteeEyqPv5+UMpP51X8NajrupLcXWoXumC1trqe3dIrJ0ZvLYru3mYgdM4wf61ycrcpWdv6RNnuT/8JHd/9AS7/I//ABNH/CR3f/QEu/yP/wATTYvGNnJ9lnayv4tOu5Fit9QkjUQyM3C8bt6hjwCygHjnkVJd+K7e2luxDp9/eW9kdt3c26IY4SBlh8zBnIHJ2BsdOvFPkn3CzG/8JHd/9AS7/I//ABNH/CR3f/QEu/yP/wATVLxk8c3h+21ixvbpGE1t5MlvdyRo6PKgOVVgrZB7g9a2tcfVIbKS5026s4fJjeR1ubVpt+BkAbZE29Pek4ySu5Ald6FL/hI7v/oCXf5H/wCJo/4SO7/6Al3+R/8Aiad4fvtZu9Bh1W/e1uvtFqk8dtZWxicErnbueUg9cc7ab4SuI57XUmR9VLrfyrLHqUqSPE/BKIUJAQZ4GTTdOSunLYXS5R0e/k0TSbfTrbRr94YFKq0nLHknnCgd/Sr3/CR3f/QEu/yP/wATVey8d2F9b2t5HYaimn3EogF5JEqxpITtCn5t33sDcFK5PXriXSPEkslnrbassUM+k3EqTeWCqmIDcj4JPVSPxzQ4T1bf9f0yrO9h/wDwkd3/ANAS7/I//E0f8JHd/wDQEu/yP/xNLp2t6m/h/T7y70i4uL66j817ezVVESnkZMrqMgEDGck5wMA4ngu7HxToJnia7ijLMrqkz28sUiEhkYowIIIIODg+4pShON7vYS1K/wDwkd3/ANAS7/I//E0f8JHd/wDQEu/yP/xNVfD2s/YfhpZ6xqElxceRZefMxbfI4AJPLHk8dzW1LrNvDfabaMkpk1AOYiAMLtXcd3Pp6ZpunNNq4amf/wAJHd/9AS7/ACP/AMTR/wAJHd/9AS7/ACP/AMTQfGFmH8z7HenTRP8AZzqQVPID52/3t+N3y7tu3PfHNWLzxCkGpyafa6dfX9xDGsk4thGBErZ25LuuScHhcnj6UuSfcLMr/wDCR3f/AEBLv8j/APE0f8JHd/8AQEu/yP8A8TXQKwdFYAgMMjIIP5HpWH4s1a80bR47ixEH2iS6htwZ0LqodwpOAyk4z6ijkne1wI/+Eju/+gJd/kf/AImj/hI7v/oCXf5H/wCJqw11qOjabfahrN3a3UFvCZdtnZtCwCgk/elYH26VFY+K7W9vbKD7FfW8d+jPZ3E8aqk+BuIADFlOOfmVc4OKfJPow1Gf8JHd/wDQEu/yP/xNH/CR3f8A0BLv8j/8TUt94mj02cfa9N1CKyMywm+Kp5QYnaMjf5gG7jOzHfOOayF1+4svGWv2wtdR1ERx28iW9ttIiXYdx+dlUZOOAcnsDg4XJPuFmaX/AAkd3/0BLv8AI/8AxNH/AAkd3/0BLv8AI/8AxNU/FN1bat8P7vWtPvLtAllJc20ttcywEHbkZCsM49Gzitu41W30rQ4r28dyuyNQFUs8jtgKqjuxJA/GnyT7h2Mq81q4vbKe0k0W9Ec8bRsVByARg4+WksdYn0/T7azi0W+aO3iWJC+ckKMDPy9eKvW2tyajLc6elvNpmqJEJUjv41kBQnAceXIQwzwQGBHfGRnO0e+8R3uualZ3F9pXk6fPHG/l6fIGlDIrnBM52nnHQ/0oUJ/zAWv+Eju/+gJd/kf/AImj/hI7v/oCXf5H/wCJps/jKzgSe5Flfy6bbyGKfUY418mNgdrcFg7BTwWVSOvPBqzeeI4oL17OzsL3U7iKMSzLZhMRKfu5Z3UEnnABJ46dKXJPuFnsQf8ACR3f/QEu/wAj/wDE0f8ACR3f/QEu/wAj/wDE1Drl1aa54Hu9Vsbu6VEtZZ4JLe4lt2V1VvvbSp4I5Vu46VoWv9o3PhzT2s7uCK5aCNnluoGnDfKM8B1Oc980+SWuuwdvP9P+HMfUNSvL64spP7Iu0FtMJSNhO7BHHT2rb/4S2X/oCX//AHwf8KzfCmoa7q9p9uv7rTjAJpoTDb2bo5KSMgO9pWHO3ONvfrS6Ddrc+JNa3rrEFyFhaS0vpo3iiBDBTEEZgM4JPPpQoSi3aQbXNH/hLZf+gJf/APfB/wAKP+Etl/6Al/8A98H/AArLk8c2Ki+dNP1KW30+doL24SJdkBU4LHLAsMc/IGIHUCtC+8QR2t/FYWtjd6hdyQ/aDFa+WNsecBiZHVeT0AOeOlV+87j1NPRtdTWJbiMW0sDwbdwk685/wrXrlPCcon1bWZQjoHaNtsi7WXO7gjsa6O9v7PTbVrq/u4LW3TG6WeQIi5OBknjrV023G7Baliquo3q6dp8126F1iXJUHk1VsPEug6rc/ZtO1vTbyfaW8q3ukkbA6nCknFM8Uf8AIt3v+4P/AEIVc7qLYzPXxe7orpot8ysMghcgj8qX/hLZf+gJf/8AfB/wrndH8Qap/apsv7H1Ca3i062ZIUa3BBO8F8mQcMAMDOeOg77t74jhs9XTSlsb25vntxcJFAikFdxU5YsFXGP4iB0AJJxWksFiYyUbpuyejTsrJ69t/T5EcxL/AMJbL/0BL/8A74P+FH/CWy/9AS//AO+D/hUVt4lsrn7AFiuFe8uJLYIygGKSMMWV+e2wjjPbtzUsmv2ML6oJ2eJdN2ee7LkHcoYbcZJ6gYxnPSoeFxSly2d/Tz5fz0DmEPjHy2QTaVdxB2ChnGBk/WunrzrXNbW7exs57C8sbh5lljS5CfvFGQSCjMMjIyDg8jiuvsfEFpqGv6po0UdwtzpojMzPHhG3gkbTnnp7fjUqFSE3Cfr/AFYadzWoooqigooooAKKKKACiiigAooooAKKKKACiiigAooooA4bWbPWNb+Hc9rc2kaavc2gElvFIAokOMgMTj9fxNM8P6TqHhnUJNKgt2uNCm3TQTeYu+1kJyyPuO51JOQ3J5weOa6qim3e/metybeRgeCdNu9I8I2NjfReVcxb96bg2MuxHIJHQisHxDp0kvja3022VTa63Gsl+M/dW3YEnHfeCqH8K72qFno9jYXdxdwRubm4/wBZLLM8rkAkhQXJIUEnCjAGelF/e5mJx93lRzuo3c9l8R4Wt9Nur5jpDDy7ZolKjzRyfMdRj6Gg+Gr+fwPrFhJ5SajqTz3Plh8pG7tuVN2OcYAJ+tdR/Z9r/aY1Lyv9LEPkCTcfuZ3YxnHXvjNWaS+G3r+dx8vvNv8ArSxy2pW+peJPDUtq+kz6feRNDNGl3JEySOjh9uY3bjK4yQOvSnfZ9R1zX9LvbnS59Nt9O8yQi4ljZ5ZHXYAojZhtAJJJIOccda6eim2LkOHh8P6ovgLRdMNri8try3llj8xflVZwzHOcHC88Gor/AMENqVz4kvGtIYdSkuo7jS77CmRWSNNvzDkLvUgg+9d7RRd6/wBdv8h8ie/9b/5nH+JjrWq+DfsKaDdPf3cCGVY5oNkLhgSpLSDPQ4xmrGux6jqdhpN3Bo92s1pqMdxJaPJCJSihgSCJNncfxV1FFF9b+dxcmm/SxxGpaHqmuReIb97I2k13pZsLS1lkQyH7xJcqxUZLAAZPA5x0qyLHUdc1DRzdaZPp1rpm6RzcSRM8rmMoAgjdsAbiSSR24POOuoovpYfJrf8Ar+tDgho+st4PTwcdLdEVRbNqPnR+SYQ2d4AbzN5Xttxu745ras9KvIdX8SzNDiK8WIW7bwd+2Lae/HPriujopSfMnfqEYqLTXQ4LTPD+p6LHo99/ZgvWGkR6dqFiske8bcEFSxCNglgQWHByM9Kqp4Xv/wCxb+K00UWCT63b3cNmGiXy4UMW44Rig+6xwDXo9FVzvm5v63v+ZPsla39bW/Iy/EelNrnhzUNMR1R7mFkVmGQG7Z9s9ax5bfVteudGiu9Jl06KwuFup5JJo2DsqkBY9jEkEnJLBeB0yeOsopJ2ZUopnnV/o/iEeGtW0C10jzWnvZZ1u2uI1iaN5fMwozu384wQBwTu6ZvxX17aeNvEq2WkXN9I8VrgxyRIiHY2N5dwcf7oau2qtDp9rb311exRbbi6CCZ9xO7aCF4zgYBPSjpYXJrdf1ucJJ4SlsW8ORXehLr1tY2U0U6KsLASuyEELMyjHDYPWrB8OasPDVxHFa+Xt1OK9s9M85T5MKOjeUGztUnaxCg7RnAOOa7yinzP+vW4ezX9eljltMt9XufGs+r3mmmys2sFt4leZHk3CQk7wpIHXjBIx3zwHeHYtS0a4u9Mn0q4e3kvp54r2KWIx7JGLjcC4cEEkYCmunopX/r53Hy9f62scxJDqWleL77UYdKnv7S+t4UzbSxBonjLD5hI68EMOQT0NJ5Oo6J4h1S9ttJn1G31IRyj7PLErxSIu0q3mMo2kAEEZ78dK6iii4cpxem+GdQ0+68OM6pIbea7nvHjf5Y2mDHC5wSMtjp2zWjp9tfaVqHiO9bT5rhbm8SW3jhePdKoiRSRuYAYIPUjpXR0UXBQS/r5HJ+DItTsv7Qt7/Rbu0FxfT3aSySQMu12yFOyRju/DHvUt5ca7Jca5DfWVvFpMaxfYZ0fLyk437hnsfYfjXT1n65/yBrj6D/0IVMn7vyNcPG1WOvVfmchLZXEviDRbxI828FtMsj7h8pYJjjqehqOWC90vxFeahb6fLfwXsMasIHjV43TI53soKkHsc5HStCKW9ESBYEK7Rg57fnTvOv/APn3T8//AK9YKWh60sPeTd+t9/kc5b6FqOmvY6oLcXN0lxcS3FrFIMgTHOELEAlcL1IB59q0bKC9j1HUtcn0+ZZJ444YrJZIzLtQnlju2ZJY/wAXQdc8Vpedf/8APun5/wD16POv/wDn3T8//r0+chYWz3/Fb9zL8Lrf2y3cF5pV1aiW6muFkkkiZcM2QPlcnOD6Y96tWdlcReKdUvHjxbzwwLG+4fMV3Z469xVrzr//AJ90/P8A+vR51/8A8+6fn/8AXo5/Iaw9la/W+6MfVzqMniLTLmDRL2aCxeUu6SQAOGTaNoaQHr6gVFdXk9t478yHTbq6ZtLXMcLRAp+8PXe6j8ia3fOv/wDn3T8//r1B9nn/ALQN/wDY0+0mLyS+4/cznGM460Ke39dyZYZu9pbtdV5f5FCzsLnT9Ekhu9LGom7nlmuLaJkYLvYttxIVVgOh569j2PDWkT6fcai4tmsNOuGU29g0gYxHne2FJVdxP3VJHHbpWt51/wD8+6fn/wDXo86//wCfdPz/APr0c+41htU77eaM3wwl/p2nwaTeabMn2YMgulkjaJwCdpHzb+RjqtZemWEn/CY3WnhVOnadKb2PHaWZeEx2wfMb/gQrpJGvpYmjaABWBUlXKnn0IOQfcVXsLSXTYGitbNVVmLuzSF2dj1LMzEsfcmnz63E8K7KN1Zef4FHXf7Rm1rS5LbRbyeGxuGleRJIAHBjZflDSA9W7gdDUer6TcT63bauLO+nja18iW3tb0280ZzuByJFVhyQRu9CM1uedf/8APun5/wD16POv/wDn3T8//r0lO1hvDc17vfzXQTwXZw2d5eCGyubTzP3jx3U3myFjjJLb3znH96utuYnnt5Io7iS3dhgSxBSye43Aj8wa5/QGlbV7gyqFYxcgduldLWkHdHHi4KFTlXZGVaaTe210ksviHU7pFzmGaO2CNx32RK35EVc1H/kGXX/XFv5GrNQXsbS2NxGgyzxsqj1JFXLY56dlNHllv4fv0vdS1myjSLUPPV7ZmYbbiIRqGjbHQEg4z0IBrXe1vrzxLoupvZvBHFazrOryITEzbMLwTnoeRmtmKz1WKJYxZAhR1Lj/ABp/2fVv+fEf99j/ABrFSdlpt/lY9KVGm5NqS1d913v/AF5Gf4iskv8AQLyFnEbKnmRyH+B1+ZW/AgVz0KzXHgDWNXu4hHdanbSXDr12L5eEXP8AugH8TXS6hol3qkaxXmntJEpyYxcFUf2ZQwDD2bIqa503ULuzltJ9OVoJUMbp5gGVIwRweKV3ytW3/r/L7gdNOalzLTzX9aa/ec/aQ3usPobyafNZ21gBOzzvGTK3llVChGbj5iSTjt+FlYr/AEzxLqFymmzXlrfCJg8EkYMbKNpDB2XjGDxnvW1FZ6pDEkUdgAiKFUbxwB070/7Pq3/PiP8Avsf41Up3d7ExoxUUnNX9UYCRaho2q6pLb6ZLfRX0gnRopI1KPsClX3svHyggjPU8esGmeH7zTb3QtwWRLWC4+0SK3yq8hVsAHkjOccdq6b7Pq3/PiP8Avsf40fZ9W/58R/32P8aSk+39bD9jC9+Zfeu9/wAzK0ayurOfWpJYgv2i9aaHLD5l2KAeOnIPWp9Bm1a40qOTW7WG1vizb4oWyoGeO57e/wDhV77Pq3/PiP8Avsf40fZ9W/58R/32P8aV3bbt+BShFbSXXqupl6XY3Fvret3E0e2K5mjaJtwO4CMA/Tkd6xhp2q23h+88ORacziUyxxX3moIhHIxO5hu37gGIwFOSOuDx1v2fVv8AnxH/AH2P8aPs+rf8+I/77H+NF32E6Uekl16rqc7b2d74f1O8ktdOm1C3uo4trRSRq6OiBMNvZeCACCM9+OlQS6ZqFh4LuNLjsZby8vEnL/Z5ECRvIWOMuy/KC2OAenSup+z6t/z4j/vsf40fZ9W/58R/32P8abk3uhKjCO0l96Oa1GyvtX8HCw/s64t7hWgQxySxgsFZCzBkcgDAPcHirGh2N9oMs2lLbtPpSAyWkysoaPJJMTAkEnPRuc55Nbv2fVv+fEf99j/Gj7Pq3/PiP++x/jQ5N303BUYJp8yutN0c7pR1FfE2o3c+iXsNveiFVd5IDs2AglgshPftmpZ4r/T/ABTcajBp017bXVrHE3kSRh43Rm6h2UYIbsT0rd+z6t/z4j/vsf40fZ9W/wCfEf8AfY/xo5n2BUo2tzrvujP1qfWIbe2bRrOC4ladFmWZ9uyI/eI5HI49foaqeJ7S8uP7Kms7SS6NrfJPJHG6K20KwON7Adx3rb+z6t/z4j/vsf40fZ9W/wCfEf8AfY/xpJtdCpU4yTTktVbdGLqk2sajoF4lhY3Vhe4AQTSRBnGfmCMrsFOMgE4wSKzdP0e8HiaO9Fhe29qLKWEm91A3Em8shHBdwo4PQn3xxXWfZ9W/58R/32P8aPs+rf8APiP++x/jTu+39WsS6UW03Naea6O5x1lpeq3Ph/SNCuNMltVtHhe4uJZI2VhGwbCBHLEkgdQOM/Sg6BJaXupJPpuq31vdzvOj2WpGJcP1V0MqDIOeQDkEV2P2fVv+fEf99j/Gj7Pq3/PiP++x/jTc3e9v6/pE/V6dkuZaW6rpf/M5zxHa3TaFDpWmaRczIvklCkkQVFR1O0l3BJwvv9a07q4muNNHnaDPcRy5WWzdoS4HbIL7CD/venHpofZ9W/58R/32P8aPs+rf8+I/77H+NLmbWqLVOKd1JbW3Rz/hrSJ9PuNRcWzWGnXDKbewaQMYjzvbCkqu4n7qkjjt0qTwwl/p2nwaReabMn2YMgulkjaJwCdpHzb+Rjqtbn2fVv8AnxH/AH2P8aZLZ6pNE8bWRCuCpKS7Tz6EHIPuKHJvoKNKEbWktPNdTktHsJP+EturHap07S5WuYe+JJhnb7bcv/32Kva0dRl17S5rfRbyeGxmd3kSSABw0ZUbQ0gPU9wK2LDR7zTbcwWmmhEZi7Fpd7Ox6szMxLH3JNWvs+rf8+I/77H+NHM9NCVRjytOS1d90czq2kTy69Fqws7+4iltRBJBaXxt5YyCWB4kVWHJB+bg4xmtLT7U6foc507T5re4fzJVgvJ/MZpT3Z97dSB/FWp9n1b/AJ8R/wB9j/Gj7Pq3/PiP++x/jSu7WsWqUFLm5l96KNhcaqdBhnv7GMalszLbQyDGc8hSSRnHqcZ4z3rEsdHl/wCEng1Gx0h9Ft1RheIzRgXROdvyRsy5BJO44PPft1P2fVv+fEf99j/Gj7Pq3/PiP++x/jT5ne9hOlFpJzWnmjiW0vXBoFvokel58i9WV7lp0CPGJ9+UGd2cdQwXoevGbUF1ew+IPEsNnpk11JJLEFkEkaxo3lKBu3MGx3+VTXWfZ9W/58R/32P8arwaVfW1zc3EWmhZblg0zebncQMDvxwO1HNdNNf1p/kT7FJpxmtPNdL/AOZyz+Fp9PfSJEiu76O1sfscyWd41vJnIIcHegIyCCCw6g84qe70J5NFgTT9NureVtThuZ47q5EkhCuu5yxkbPA6bs8dK6r7Pq3/AD4j/vsf40fZ9W/58R/32P8AGnzyvf8Are4fV6dmuZbW3Xa35ElY+i2NxaahrUs8exLm882I7gdy+Wgzx05B61qfZ9W/58R/32P8aPs+rf8APiP++x/jUptdDVxi7e8tPNf11OblfUj4vhv10K+NtHbPbFxLb8kupDAebnbgfX2qGO8u7bxfr62mmT3jvFb4MbxqqHa2NxZgcfQGuq+z6t/z4j/vsf41Xi0q+gvLi7j00LPcBRK/m/e2ggcZwOp6U76Wt/V7mbpLmupre+67WMnTpr7wd8M9Qntvs015YrvPnEiMtwW9CepwOM8V3mnXEt3plrczwGCaWFHeI9UYgEj8Ky9K0dCm/UbGB5Yp/OgMqK5jbH3lPOD7it2tYP3dTixCSqvleiCiiimZBRRRQAUUUUAFFFFABUN0jFY2CRuMsMOwHp61NTZ4LWWGMzzFGDNgbgPSmlcTly6lLa//AD72/wD32v8AjRtf/n3t/wDvtf8AGpvsen/8/R/77H+FH2PT/wDn6P8A32P8KfKyfax/pP8AzIWRypHkQDIxkOvH61uHrWT9j0//AJ+j/wB9j/Ctc9TWkFY5cTNStb8hK57xr/yLU3++n866Gue8a/8AItTf76fzrQ5TS0b/AJAWn/8AXtH/AOgir1UdG/5AWn/9e0f/AKCKvUhB3rYrH71sUhhRRRQAUUUUAc9qQvpdd0+5i0q6eG0aTewkiG/cuAVBf+eK0ru7uFQpHpVxcb0/vxBQT/C2Xz9cA/jV+iq5rpKxChZtp7nKtol9a6VpVmU+2W0Ds13axOFEgOSANxAKqT0JGcCr2h2V1ZtfloGtbJ2BtrV5Axj4O48EhQT2B/Ktykb7h+lN1G00+pCoxi010Pm3wZ/yOmj/APX0n86+iLr/AFo/3a+evBoi/wCEz0ja7k/ak4KAd/rX0Ldf60f7teZhP4b9Tky74H6kFFFFdB6AVgeJLK9luNH1CxtjdSafd+a9urqrOjIyHaWIGRuzgkdK36K1o1XSnzpX3/FWf4A1dWOd1K3vtWufD12unzW/2a/Ms8Uzx7o08qRcnaxBySOhPX60+2tbyx8Q6/qJs5Jop0t/IWN03SlFIYDcwA5Pcit+itfrcuXksrWt125ubv3/AA+8XLrc5fwsNRt7rVEvNGvLVLu9luklkkgZQrBcA7JGO7g9se9Uv7GvI9dgn0nS73SXN4Jb1xeIbOdMYfEQckswAwdiHPJIrtaK0+vz55TUV7ys1rb7r6/O4uRNWMbUrnX4vEOkw6dY202kymT+0J5Hw8WB8m0ZGcn2P4dawPFfg2fxL4otrndJBHb2LeRdq4IiuRKjoSmfnHB4II/HFdxRXCtGn2LucVf2viDXNN8Pte6ULe+stXhlu1SZChRAwMiHdnacjAPze3euvu7WG+s57S4QPDPG0cikcFSMEVNVa/sYdStGtbhp1jfr5Fw8Lf8AfSEN+tD1Vv6/rQS0af8AX9anF/D22urg3V/fEObFTpFpJnd5kcLENJn1Y4B/3KzNBg1LX/AVjocOlzw2z3RaW/mki8vy0uC52Krlyx24AKgd8+vpNpZ29hZxWlpCkNvCoSONBhVA7Cmadp1ppNjHZWUXlW8ZYqm4tjJJPJJPUmqctbisYWsWuo2ni6w1uz02XUIFs5bSaKCSNZEyysrDzGVSPlIPOeRTJ4NRsfFH/CQW+kXF5HeWMdvPbRyQrNAyMzD7zhCDvIOGPIGMiuqopJ2S8v8Ag/5j/r+vuOCTw1qpWyu5LcC5uPEA1O5hWUEW8ewqBknBIAXO3PJOMjmpdf8AD+qX1x4wa3td66hpEVta/vFHmSAS5Xk8feXk4HNdxRRfS39bJfoO+t/63ucZYeGJPDniewvdE06GGwvLf7PqdvBsjVHUZSULwCc7lOOeQaPM1c+PV1T/AIRrUhZiyNnv861+95obfjzs7cfj7V2dFF9b+v4/8OTbS3p+Bxxj1rSvEniC4tdDnvU1HyWt5kmhWNSsYQ+ZucMBkdlbjpnpVO18P6l4ZuvDL29hNqken6fPaz/ZHiRvMdo2yBI6jblW7+nFd7RQnb+vJr9RnAHwxq2P7dNrG2pHVxqf9niRc+X5XleXuzt8wLznO3dxnHNT6jpGq6/catqb6bLZMdHm0+0tZpYzJK78lm2MyAZCgfN65xxXcUUnqrf1tb8hptO/9b3/ADOTuNFvpX8Hj7PldPc/a/nX92Ps7p68/MQOM1zWoeFtRXwPP4Uk8NDU5LdZI9N1BGtyiKxJVj5jK6OAcHaD0yCeg9RoqnJt3FHRK3Q5rTdKvbfx1qeoyQ4tJrC2hjk3A7nQvuGM543DqO9GsWV9beKLDX7Kxe/WO2ktJ7eJ0WQKzKwdN7KpwVwQWHB46V0tFK+t/wCv61BLp/Wn/DHAX3hvV7/T9a1L7II769vrW6isWmXcI4ChClgdgdgp6HaMgZ70ahb6zearrGs3mlGxsf7CmtolkmR5d2dx3hCQM9sFuByQTiu/qK4t4ru1ltp13wyoY3XJGVIwRxUyu1Zf1pYpPXXy/O5w2j2+o6/pfhONtLnsbLT1hupLi4kiPnFYiqiNUdjyWyS23AHqeMlfCd79g1G1h8K/Z9bnvriW31zfbp5IaVmR/MVzLwp+7t56HjNen2ttDZWkNrbpshhjWONck4UDAGTz0qWtJS95tf1/ViIpqKT/AK3/AMzkZ7XWdL8WX2oWemNqKX1lBAkizRxrFJGX5k3EEKd4OUDHg8dM0I/DesL8K7HSjbxnVrRop/I80BXaOYSbQ3TkDAPuM4rvaKm4/wCv0MyOW41jSrqK4026055EaIJctExOVxkeW7jHPc59qwdJsNSvPBR8L6npVzYyLpxs2u/MheFyF2ZTa5fnr8yiuxopPZrv/X6jTaafY4h7HWtZ0/R9Gu9GewSynglubszxtE4hIIEQVi53FRjcq4Ge+BSTeH9Ufwl4ysVtc3Oo3F09qnmL+8DoApznAyR3xXcUU2738/1t/kJaWt0/S/8AmcV40ttWvvDMej2GiXd3Kfs7mWOWBY12SKzKd8inOF7Ajkc10Fxe6pL4eubqx0t4tTETmC0vHj5cfdDFHK4P+9+VatFDd0wWlvI4gS6hNr+gy6tBFb6g9lm4iibKo+GyAcnjPufqaXRNFuE0LVrC9Qwm8u7tlIYMdkjNtbg+hzin+JZLqLxbYvZwrLOLc7FY8H72e47Un2/xN/0C4P8Avof/ABVccprmlpv/AMAlNoyf7N1m/wDD2neG7jSmtVtngW4vfOjMLJCwOYwGL5baMBlGMnJ45nitNY0aHV9NtNIe8W8uJZ7a7WaNY183kiUMwcbST91WyMY54q/9v8Tf9AuD/vof/FUfb/E3/QLg/wC+h/8AFVTrXvdb+Xp/kCdtuhla1pOo2ng7T/DunaXd6g1ultm4jkhVP3bqSDvkU5IU4wMcjmumla41HQrkGymtp5YZEEE7JvBwQMlWZefr3rO+3+Jv+gXB/wB9D/4qj7f4m/6BcH/fQ/8AiqUqvMmmnr5Ana1uha0WK60nwjp8EtpJLdW1nGj28TJuLBQCASwX9cVmeFF1K2udVjvdEvLRLu9luklkkgZQrBcKdkjHdwe2PerP2/xN/wBAuD/vof8AxVH27xN/0C4P++v/ALKnKrdt238hKySXY5fw/BqGu+BdH0iPTJ4LYSxyS3s0kWwoku87ArlyxwAMqB1P10PFHhzVb3xGDp8CvpuqxRQao5kVfLWN92cE5bcpZOKv6eNc0uwisrLRoIreIYRPMLYGc9S5NWft/ib/AKBcH/fQ/wDiqftlzXS69ht7lbxFZ6rNrdo0dtqF1pC27KYNOvRayLNkYZ23oSu3IwG4PY8VH4btNT8P+GbiGfSbme5kvZ3EEF0krBXYkN5krruHuTu55FXft/ib/oFwf99D/wCKo+3+Jv8AoFwf99D/AOKqfaq1rMLmVpmk6rdfDWfw5c6bNY3i2DW6vPJE0bsQRwY3Y4HHUDrUsVvrmo+IPD9zPoz2NnYRypMZriNpN7R7cgIxG3PGc59gOTofb/E3/QLg/wC+h/8AFUfb/E3/AEC4P++h/wDFU3Wu27b+QXOd03wp9isk0bUtF1q+hSUr59vq7C2dN2VYxNOuMcZUIeRxmtTxRpD3l3JPaaNqP9pGAx2+padepAVBwQJMupIDDptcY6cnFXvt/ib/AKBcH/fQ/wDiqPt/ib/oFwf99D/4qh1r9/xC+tybUpPEVl4SDadDbX+vRxRgrIdscj8Bz1X3I5H9KpeMtMvtZ8LQW6WC3U4uLeWa1Vkwyq6s6jeQp4B6nmp/t/ib/oFwf99D/wCKo+3+Jv8AoFwf99D/AOKo9qr3t1vsCdlYoSaTFN4a1yz0rwl/Y9xc2jxqNltH57FWAGYnPTP8WOtXbnSr2TUPC0qw5SxL/aDuHyZhKjvzzxxmnfb/ABN/0C4P++h/8VR9v8Tf9AuD/vof/FUe28mF/wCvU5TUdA8Rahp1zBdWGo3OotdiQ3J1XZatEJQVCQiTGQoHDIOhOScZ6Fk1bS/E+tXdtotxex30cHkSRTQqisisCH3OGAyRyFPH5Va+3+Jv+gXB/wB9D/4qj7f4m/6BcH/fQ/8AiqPaq1rBfW5lXui6jpvw3Phy00+bULuazlhaS3aJI0kbJJPmOp25Y4wDwOgqxrOmX/iDwvaoNOurW7sriKdbaW5WJptnULJE7bcgnByOcdOtXft/ib/oFwf99D/4qj7f4m/6BcH/AH0P/iqPba3t57Bf+vUZoGmW8epSXp0bWLO5WHylm1HUPtOVJBKr+/kxyAegqxo2n3Vrr3iC5ni2Q3dxE8Dbgd6iJVJwDxyD1qL7f4m/6BcH/fQ/+KqG61nX7O3ae4063SNcZbOev0ak6q6phczBpWs23he98KQ6UzrMZootR82MQiKRidzDdv3AMQQFIJHXByL1tY6h4Z1a/ls9KuNTtb2OIq0MsSvG8aBMP5jLwQAQRk9cjpWgl34lkjV10eIqwBB8wc/+PU77R4m/6A0X/f0f/FVXtPJ/cx3MdtK1LSvAdxpMenzX99ex3PmfZpIwkUkpZusjL8oLY4yeOlb3h57r+xraG7064spYIkiKTtG27CgZGx2GPrg+1Q/aPE3/AEBov+/o/wDiqPtHib/oDRf9/R/8VR7TfR6+TE3e39bjPClhd6VoLwXcBSb7VcyhAyklWmdl5BxyCO/fms/SW1VfGGpX0/h7UILa+jgjWR5bY+XsDZLBZScfMOgNaf2jxN/0Bov+/o/+Ko+0eJv+gNF/39H/AMVR7TXZ/cwbvc5OzGo6jpHibRbLS5m+2aldw/bXkjEEYZsEkb95IGeAvJxz3rb1/RYpRaqui6jdTwW/lQX2m3iW88XGCCxkTjoQPmGc5HrPZQa5p6zra6DFGJ5mnk/f53Oxyx5bv6dKtfaPE3/QGi/7+j/4qj2miVn06PsO+rfm/wAWVfh9Df27ahDqkyzXyCJZ5FOQzfNk5wM/XArr723lurVoYb2ezkbGJoFQuvPberL+YrD8M2WoW97qVzf23kG4KMoDA9N2eh966StKV+XXz/MI6Iy7DSryzufNn8QalfJtI8m4jtwv1/dxK2fxpnij/kWr3/cH8xWvWdr1tNeaHdW8CF5XUBVBAzyPWqqaxYM5Gzhv9P1O31ODTpr62udLghYQSRq8boSRkOyggh+oJ6dK0VsLo+OTqZhItDpgg3lh/rPNLbcZz0PXpUds3iW2tYYF0iMrEgQEyrzgY/vVL9o8Tf8AQGi/7+j/AOKq1jp8tuXXl5W7PbTzt0IsJr9pdyXmkX9pbNdfYblpJIEdVdlaNk+XcQuQWB5IrEn0DVtXt/ELXNslpJfTW81snn9owvysy8qflwSM4J4Jxk7n2jxN/wBAaL/v6P8A4qj7R4m/6A0X/f0f/FVrRzOrRilCOqtZ2d7KXN3tv5A1d3OZ1CxjE1hcS6Pq9rPHKAst9qH2hVz1VR5z9cDnA6V1tj4g1G4+IWqaDLawfYLW0iniuI2JYM3G1+cAnkgY6Dvms2+tfEOpiCObS1jSOVZCVkXt+PvXYWdhZ6fG8dlaQWyO5kZYYwgZj1YgdSfWsXXnWqOc+1uvn3bZUVZNFiiiigoKKKKACiiigAooooAKKKKACiiigAooooAKKKKAOK8ff8iJrH/XD+oqbTNek1XUZIbC0WXTbcbJb9pcK0g6rGuDvweCcgA5Azg1DqOjarqvgKTSL25tpdUmtRHNNgrG0nGTwOn4fgKTSdAu9A1aSPTWg/sK4BdrRmKm1l7mIAEbG7rxg8jrim1a6PUd200U9L8Yapqml22rReHH+wSyiJ9tzvmHz7C6RqnzID1JZTweMAZvL4rjjsdenu7byJNHkdZIhJu8xQoZGBwPvAjjHX1qx4S0i40HwzZ6bdPE80O/c0RJU5dmGMgHofSsHXNON98QbG0tnUw3ECzapGOTshfdDn03MSPcA+lOycuVf1/VmF5KPN+BoyeJtS/tOx0uDQw9/c2Iu3D3W2KDkBldtpPGcAhTk9gMkZfiHxHql54C1C90+1S1ng8yG6zeMklvIjBTsKod/wBcrwR9KtajJqMfxIhOm2trcSHSW3Lc3LQgDzRyCqPk+2BVr/hFJJPB+paRNdJ9s1EzTTTqh2LLId3C5+6Dge+KWnLf1/N/oHvXcb/1b/Msy63e6To8+oa3ZW8SRhBElndNO0rMdoX5kQAkkAcnr2pLfXr6LVrXT9Y0yK0e9RjbSW90Z1LKMsj5RdrY5GMg4PPHMV1pmsa5oEthqcdjZ3K+VJBNbTvMvmIwYFlZEwNyjjJ4J5pY9L1XUtasNQ1iKxt009XaGK1mabfI67SxZkTaAM4ABzu68UPqC5rIo2Xja7utN0/VZdE8jTbu4S2LtdZlV2bYGCbcFN2BksD1O31yNX8SXcOo+JI08TtbXtlMiafpixwOZyY0YLsKGR9zEj5T39q2YvCt8ngzSdHMtv8AaLO6hmkYM2wqkwc4OM5x7dafd+EG1CDxJDcyRqNSuEuLWRCd0LrGiqx44IZM8dqemvz/AE/4INSdv67/APAGeMJpX8HLLqei215amOOS9t3vXgZG3KQF2od2G9SvTvT/ABxK1tDoEkUDzumrQ7IoyMudr4AJ4/E0uvab4j1bwoulCHTHupoVW5me7kRVcEElQIjuBx3xjNT6vp2s6rYabL9nsIr6yvkufI+1O0TqoYY8zywQfm/uUdV6/qhatP0/RmV4i1y4ufDfifSdRso7S+g0x5wsM5mjkjZWGQxVTkEEEY9Oua0bDxHdW9xpVrqWmLaW1/GVtZvtG99yruxIm0BCVBIwzdMHFQ3nhnUtXt9cuL6S1hvtQsDYwRRO0kUKYYjLlVLEs2T8owMdetTxaNquo3+my6xHZ29vpoLRw2tw0xmkKFNzFkTaACeADknqMcnT+vMHzXv/AF0/r0IT4yuP7MXXBpIOgFwPtP2n9/5ZO3zPK24255+/nbzjtU1x4n1BtV1aw07RkuDpqo7zTXflI4ZN2AQjHd7Yx3yOlUh4Z1hvD6+FpGsf7IXERuxKxmaAHOzy9m0Nj5d2/wB8dq17XRLi31PX7gvF5eoCMQgE5XbFsO7jjn0zSlZJ2KjzNq5lt4km16+srTTLz+zbaTTl1K5unRDIkbH5VXdlQeGySCABx6iWbxPBpHh039rqK+JIxdx24eGWHfl2UYJQBCw3ZAwvGMnvUVh4X1TRo9GvLF7OW/tNOSwuoJXZYplGCCrhSVIbOCVOQccdahl8Kateaff+ebKG6vNXgvzGkzuiInl5G4oCSQh/hHWqtHmstr/r/kRedr9bfp/maj+JLvThdya5pJs7aC0N0J4JjOhAOCjHaoWTpgDIPY8UR+Ir+C809NV0hLS21F/KgkjuvNZHI3Ksq7QFJAP3WYZGM961Na0uPWtFvNNldo1uYjHvUZKk9D+B5rH/ALJ1rVbnSxrK6fFb6fMLjNrK8jXEqqQpwyL5YBJbGW7DPcyrXLlzLYc/i3Z4W1DW/sOfslxLB5Pm/f2S+XndjjPXGKJ/EepPrmoaVpmircyWUccjzTXXlRsHUkKCEY7uOBjHqRwDk33hTxBLompaHaTaclnc3clytzI7mRg8nmGMptwvJI3bjwPu88SxPrA8beJE0q3sZC0VqGkubh08s7GwQqo2/wCmV6daOmn9bE80r2f9bkGoeK47y98PyjXm0PTdQs5p3dzAp3qUAUtKrDIy3A9Kt6b4nvLfw6t9df8AEwjfU1s7a5wIjPC8gRZeBg9T0ADYyMZpY/DGpaNc6FJpK2l2unWcttILq4aAuzlDuG1H7qePemt4Rvm0a9AmtU1C51JNSEKbvIR0ZDszjODs5faCSSdvaq92/l/9t9+39XF7/wA//tfu3/qxt3Gs3A16bSLSzilnSyF0jSzmNWJcrtOFYjpnOD9KxfBd/wCILq0mN3bWkkAv7lHmbUJHkTErDaqmLBUdB8w47DpV7TNK1j/hK59b1N7JEksxbJbWzM/lYct99lG7Oc5wuOmOMldE03V9Fu7q0EVjPpk13LcJN9odJkEhLFTHsIbDE87xxUrb+u/+RTu3fpf9P8zLsNR8Tv4y1mD7FYOscNufJfU5fLjzv5X9yeTjngdBya2bnXb2XVbrTtH06G8ms0Vrl57ryUVmGVRSEcs2OeQAMjnmo59N1ey8T3Wq6ZFY3MN5BHFNFc3DwsjIWwylUfIIboQOlJLpusadrV/f6RFY3EeoKjTRXU7xeXKq7QylUfcCMZGBjHXngBXTZXPjQzxaOdP0ua4m1N5olikkEZhkjB3Bzg8AggkZ6cA9KuWGsajqttqNvFa21pqllcC3kWSVpYRkK28EBSw2tnGF54yOtU7HwnNp9zoLpcRSixkuZrpyCpkeYHJVecDcTwTwPWrtnpmo6Zea9eW6Ws8l9dJNBHJM0YwI0Q7mCNg/KTwD2p6f16oFzdf60ZF4Ov76/sNQ+33RuZbfUZ7dZCiqdiNgcKAK09c/5A1x9B/MVkeE9M1vSGvYdQt9PENzdzXfmW928jKXbO3aYlBA9c/hReW+ux3GuTX17by6TIsX2GBEw8RGN+447n3P4VM/h+X6G2Gf7yP+L9Tlpo9Tj13S7GPX79ILuGWRgIrclNoXAUmLp83fJrTl1W7S/bStOt1vrq3hV7iW5nEKjdnbkqhyxwTgKB9OlOfTZp9Z0nUFaMQ21vIjgk7iXC4xx7Go57DUbPW7jUdMS1nF3EiTQ3MzRbWTO1lYK2eCQRgdBzWKasjvkpKUmu/4afqRJ4pW5trRbWydtQupZIRayyBBG0f+s3tg4UY6gHORxzxZs75dWkvtK1OwiS4gC+dAW86KRGztIJUbgcEcgcis+Lw1d2C2d5aS282pQzTTTCXMcc3mnLjIDFccYOD93nrVyz0/UYLm/wBWljtH1G5VI0gWZhEiJnA8zZkk5Jzt9BjjNU7ExdS6v/S8/MreErdI9H1G2t/9GRb+5SPyVUeWN5xtBBHH0xUdlFqcviW/sZPEF+0FrHDIoMVvlt27IYiLp8o6Yq34csdW077TFfQWSxTXEtwHguXdgXbO3aY14Hrn8KtWumzQeItR1BmjMNzFCiKCdwKbs54/2hRf8hKLaSXd+XcoagV/4THSPtemwuT5q2l0t0+9Pky2Y9oXnGOpqxfa3dxa8ukWWmi5ma2Fx5jz+XGo3FSGO0kdOMA5z261Bqlnrlzrtje21pp7Q2TSFPMvHVpAy7eQIiFx9TVa6k1FPHebK1tZZjpa71muGjVf3h6EI2efYUlrZev6sJNx5n5rp6ItfbbjWdCkvre7utNnt/NSWKIROPMTIIJdGyMjgjGQaf4e/tGTQLfUJdQmvrm5tUkEVx5ccYcrngpGCB9d1Tafo8lloVxZtMslzcGWSWQDapkkJJwOwGcfhU2m2l1pnh20s1WGW6t7dI8GQqjMAB97aSB74/Ci6s/l+tykpOUW+z/Sxn+GCgtNV+zabDaXK30oljW6eRJJcAltxXIBz2Xj0qpoN7r82q6ukttaPGl8FYNfyHyR5aEhB5XI5z/DyT9au+H7LV7C5vvttvYrDdXL3O6G6d2QkAbcGNc9Oufwp9vYapp2t381rHZz2V9Mkz+ZO0ckTbQrYARg3Cgjkdx701a/yX6EJS5Vvo306a+XoVdcsrSPxV4evEtYVupLt1eYRgOwEL4BbqRWnf6rNDqMOnWFqlzeSRmZhLN5UccYOMswVjkngAD16YqjrNlrV3q+n3Fra6e0NjOZVMt46tJlCuCBEQv3vU9Kj1jw62oanbao2naXezLB5E1re8x9cgo+xiCDkfd5B7Ul0uU+ZOXKtdP+CbPg/Uv7Tv72RoTBPFmGaItu2OpAIB7juDxwRwK6u5uEtbeSeRZGRBkiKJpGP0VQSfoBXK+D7NbK8uYhp9lYHbkw2ZzGDxznavP4V1VzbpdW8kEjSKjjBMUrRsPoykEfUGqjtoYYm/OubsjPtPENle3SW8UGpq75wZtMuYk6Z5Z4wo/E1q1lWnh6ysrpLiKfU2dM4E2p3MqdMcq8hU/iK1a0duhzK/U53VvCkeqz6lK115f22GKIjy87Njbs9ec8VJdNeTeJY9Oh1Ce0t1svNIhSMktvx/Grdq3qxrzQYdQ8QJfXlta3Nstr5QjmQOQ+7OcEY6VFrNW/rc2U7/F/W3+RFomp6hd6XcMUjvJobl4Ipg3lpOqnG8kA475wD04FTQa4wbUYr608mexjEzrDJ5iuhBIKkhTngjBA6Umu6RLf2Ftb2qweXBMjtaykrFMi/wABwDgdD0I46VX0jQ7nTtQv7tIdOtRcQoscNqh2Iy7uvA3dRyMZ9BRrt/Ww/cab/rf/AC8i5pepXuo20dybO3WCaLzIniuvM57BvlGPw3dDWZpV5rcmt6vG9vauqTxgo165EQManCfu+fXtz+dT6foc0OurqP2Sy08CNkkjs5WYTknILfKoGOecEnNWEsdRstbvbq1jtZre8MbuJZmjeNlXacYVgwwB6Ua3TH7qul/X4jrjV7pry6t9OsUuvsgHntJP5fzEZCr8pyceuByOfS9YXsOo2EF7BnypkDruGDg+tYd14bH9r3d6ml6VqCXRV2W9G1o2AA4bY+QcZxxg+tb9rEsFpFEsEUAVQPKh+4nsOBx+ApxvbUiajZcpFql8umaVdXrjcIImfb/eIHA/E1lKzeHPDF1qNxme9ZPPnZj/AKyUgAD2A4UegFaOtWJ1PRbyyU4eaJlUns3b9cVSiaDxT4Zlt5C0TSIYZ0xhoZB1BHqDz+VJ31sONrK+19f6+8sWVpqSLHPc6nJNKw3PAYkWIE9lwu4Y6ZLH8azNNvNck17Vo2trV1R4gUa+fbECg+5+75z17c/nWpYDWYxFDeJZMiDDTxyuWkx0OwqApPGfmNQ/YtRs9cu7yzS1mgvBGZFlmaNkZRjIwrZBGPSm99AT3TtcSXWrxtbudLstOWaSCNJDLJceWmGzwcKTnjjAPfp3p+IBDq3gm6vLvThHOlrI6x3EYLwtg5xkcdOo9q0rXTZofEWoagzRmG4iiRFBO4Fc5zx70niC1v7/AEq4sbKK2b7RE0bvNMybMjAIARs/pUyTcWVBxVSNvL/gl+0/484P+ua/yqaquni7W0VLyKGORAFAhlMgIA65Kr+WKmmgiuYWhniSWJxhkkUMrD3BrST1ujBK2jKtnqP2vUNQtPK2fY5ETduzv3IGzjHHXFXqwNO8LWFnqt9dtp9hsklR7bZCuYsKAccfL8wJ4rfqVe2pc+W/umJZajcRa9qtjfS5jjVbm3YgDERGCOPRgetV7OC71/w2Li6maO4mka5s3AAMAyfL6deMZz1yRS+JdBvNWlt5bCeKGQI9vOZCRuhfG4DA68cVq3t3b6PpbTMMRwoFjRerHoqgdyTgCp6a/wBf1oXdacu7/r8TPhLeKPB5SUiCS7gaKQgZ2Pyp4zzgg96m0zQk03Urm8WbeZ4YYtuzGPLXGc55zUnh6xl07QrW3nx5+C8mOgZiWI/M1p1dtbkOW8Vt/X+SMvTtUurzVtUs5tLntYbN0WG5kPy3IZckrx2PHf8ApWpXKaBq2p6n4w1sLdQ3egRpELSaJBtWTHzoHH38d+Tg4HHIrq6fRGUXe4UUUUigooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKhuUYrGwiVxlhyQPSpqbPb280MZmmEZDMANwHp600riclHVlPY//PrH/wB9ijY//PrH/wB9ipfsNj/z9j/vtaPsNj/z9j/vtafKyfax/pP/ADIWjcqQLaMEjrvHFbh61k/YbH/n7H/fa1rnqa0grHLiZqVrCVz3jX/kWpv99P510Nc941/5Fqb/AH0/nWhymlo3/IC0/wD69o//AEEVeqjo3/IC0/8A69o//QRV6kIO9bFY/etikMKKKKACiiigDBubrUoPEenQyTxrbXLyjyY0z8qrkEsec/TA7c9abql3dQ60Ue6v7awFsH32tp5o37jnJ8tscfSn39nq1zrNleRW9l5dozlQ9y4Lhlxz+7OP1q/cvqmNtrbWZynLS3DDa30CHI/EZ9q07HPq3JXe/mZ8+oSSSaVaWmoHyrwM323CMzbRnC8bdx+nY8VLpV9NLd6np884uGs2ULNgBmVgThsADIwRwBSJo5s9Fg05LW01BUJZxdtsUsSSSBtbuTx2qbStJXTYrhyIhNOQzrCmyNABgKo9Bzz3yTx0ptxs7f1r/kCU+ZX+f3f5ngHgz/kdNH/6+k/nX0Rdf60f7tfO/gz/AJHTR/8Ar6T+dfRF1/rR/u15WE/hv1ObLvgfqQUUUV0HoBXI+Jr7XLfxJoMVlBbGCS6dVDXzx+d+5clZFEZAAIyOW5A4HbrqxfEGl3l9Jpt5p5g+16fdeekc7FUkUqyMpYAleGJBweR0rrwU4Rq++k001rtdp2/EUtnYxvFFzfxSeGJ5rBHvRqZAtrafepJhlA+dlXjoSccc9e+zp2sXl5JqVlLYwQ6lY7f3S3JaJw67kPmbAQOoPy8Y71He6bqOpzaHczx2tvLZXhnnjjmaRdvlug2sUXJ+YHkDv+L4dNvrPWta1KFbeU3iQiCN5WTlFIO4hTgc9ga6ZyoyoqDS5ktNXvz7b2tZt/qTrzX/AK6lbwf5H2fVRFp0djMuoyi4SO5adXlwpZwzAHnPTA6VJo/iG71qaSW1sLc6fHcPbtJ9r/fqykglotuByM435wQcdqZ4bsNa0661D7fbaesN5dSXW+C7eRkLAALtMSg9OuR9KqXPhq8vtftNQex0uynt7hZX1G1kfz50AwUZNg4YYBy7YHrVTjQnVqc7Wq0d7209bv7212Ytbad2ddXEa7q1ponxBt769crGmjyhVUZeRjMgVFH8TE8ACt7UrbX5fEOkzadfW0OkxGT+0IJEy8uR8m04OMH3H49Ky/EPguLxJ4hivLvYLeKxeGORGIngmMisskZx8pG3rn26E15K3T9fyZrpZr0/NDtQ8V6lpOjadeX2gMLq+vEtUsobpXdd4JUkkKu7jBGcD+9SXvinWNK0/U59Q8PBZLGFLnNvdNJDLGSQ+JDGvzqASVx6c80y40LxBqem6JFqc9g95p2pxXEs8bsBPEmRu27flc55Xke9dZMkckEiSgGNlIcN0I75pvRP+uiEt1f+tWZM2vqNc0rTbWAXH26GS5eUSYEMSgYbGDnLMoA47ntWFa+O7240qDWpdB8jSGuBbyzPdgyqTJ5e9UC4ZN2OSynr8pwMx/DewmWxutRmkEsOfsOnSc/NZxMwjbnruyTnuAprO8M6Zq2v+CbDTJYrK30k3LSSTrcO80ipOz7PL2ALkgDO84Hbnh2V/wCv62F0/r+tzSvNR8Tp8RYrW3s7F4Tp8rpA+pyJG4EigOwEJAftjB6n5vXautevl1OHSLHTre51T7OLm4SS7McECEkD59hZiWBx8nQEnHdmr6Vqg8SWWuaStnNJFbSWs1vdTNEGRirBg6o+CCvTbyD1plzpmsQa6mu6dDYyXM9olteWk9y6J8pLKySCNjwWYYKDIIPGOUtkn5/r/wAAb3b9P0/4JUl8dGLTLaYaPPJevqQ0yezWVd0U2CeGPDLwCDxwc8dKi1XxVqcOieJ4ZLWKw1bS7H7TG8E32iMhlYowLIvIKNkFew65pyeEL0RWUzz2zXrayNVvSuQn3SuxOMnA2gE4zgnjOKk1rwrfajP4oeGW3UarpkdnBvZhtdRJktgcD5x0z34o05fP/gL9bjVuby/4L/Qo6Brt1c+J7G0sPEJ8QWEto0l9IVhYWjjGz54UUAscja2TxmtCzZT8SZ/tmj28OoHTiY72G9eTfAJcBWjKKqnJzxn0zVhvDt1b+KNM1mweBGFt9k1FGJHnRgZRlwOWVvXHBPNVvsHiY+M11k2GkeQLU2ez+0ZN23zA2/8A1GM4H3c/jVXXMref62/QnXlfy/S/6mfb3+qWnjXxaNL0pL11NvI5mufIQAQDCghWJY9hgD1I4zFca8+qeK/C2q6PZtdG80y6aKKWTygmWhzvbB2gYIOATnoDWvJpXiGy17WrvS49NeLU/KKy3Fw6PAVj2Z2CMh/XG5c9OOtQJ4V1HRLnQJdGFpeLpllLaOl5O0BfeUO8FY35yh4x361MbaX/AK0f/AKf9fgTp42H2KRJNPI1hL/+zhYpMCrT43DEhA+Qr827bkDPBPFPk8WXVi2p22q6XHBfWdi9/EkFyZYp4lHOHKKQwPBBXjIPNVP+EQvxb/2gLm3bXf7S/tMg7vI3bPL8rON23Z8u7Gc/NjtUl14b1XWX1S/1EWVvez6ZJp9pBBK0kcYfJZmkKKSSdvAXgL3zSe39dv8AMatfy/4P+RLZeLruW50g32jizs9WVjbObnfKrBPMxIm0BQVDYIZugyBnjNsdfl1LS4PEGpeLIdCtbx2Njan7OsbIrHHmNKCzsRgkIy4HAwea2JvD11K/hY+ZBjSWzcAk/MPIaP5eOeWHXHFY1z4U1+DwnfeFLD+zZ9NmWSO3ubi4kilgjck7SgjYPtyQDuXIxwOpt8vNoRG9lf5mvceJtQbxPc6Dpujx3U0FtFcG4lu/Jiw5YYOFZgfl4wGzk5xjlF8WXU66baW+jSLrF7HJK1ndy+SsCxsFdnfaTtyQFIU7sg4AyRZsdDubXxhqGrvJEbe4soLdFBO8NGXJJGMY+YY5o1fSr867Z65pItpLqCF7aW3upGjSWNiG4dVYqwZR/CcgkVOmn9d/+ANf1+F/1KT+NGt7C6a500x39nfQWVxbCfKjzXUK6Pt+Zdrg8qDwQQKv6l4k/s/V7mw+yeZ5GmPqG/zMbtrY2Yx39f0rHuvCGoXumarcTTWiaxf3cF3tUsYU8kqY4t2AxHycttB+Ynb2qLUNI1trrWNe1R7CONtFmtUtbZ3cxnO7O9lXdnnsuOBg9aUnaN/X/wBJ/wAyoq7+78/8i7p/jC9uP7Gub3RPsWn6uVS3ka6Dyo7IWUOgXChsHBDE9MgZIHMJ4rvmtrmaDxX5+tpqklvBom23YSIJygUoqCUDYM7t3GMnitvQdL1bWdK8LvqMVla2GnxQ3MYguHlkncRbU3ZRQgG4kgFsnA+sLeE9fn0DUfDssWlLZXt3PN9t+0SPJGrymQEReWBvGRg7+DzzjFaNJTt5/qv+CZp3gv67/wDAOqttZ+0eJNQ0f7Pt+x28M3m787/MLjGMcY2eveuQ17xNrWpeCtM1fTLSG2jurm23k37pIpNwq7PljOVboTkcE8HvuXOja1aeI7rUtIaxdb20itpGu5HDQGMthwFU+Zw5+UlOR154qJ4Qv1+HFr4f+1W51G18uSOYg+U0kcokXPfBIAPpnvUK10/NfnqV5f1t/maWpXfiJPDl7KdO06O7VHwI9SkKqmw/MG8kHcD0GPxFU/C2r6rH4Qs9Q1uG0js49OSdrtb15pXwgJZ1aNcEjJPzHn161uQJqF/p1xBq1ra2zyq0YFrctMCpGM5ZEwevGD9axtJ0TVv+EYPhrWYbE2S2RsxdW1y5kkXG0ExmMBTt54Y80apStvp+o1ZtX/rYSPxbfRrp15qGjLa6XqMqRQTLdeZNGZP9X5sewBQeB8rtgkfUV7jxvfRwa1eQ6EHsdGuJIrqWS72M6oASYl2HcQDkhio6AE84eNB17UbbTNM1f+zhY2E0Urz28rtJdGIgoDGUAjyQCcM3TA65DpfC19J4Z8VaaJbfztWnuJIGLNtUSKAN3GR05wDTdrv52/C36iXS/lf8b/oN8baprVhov9pabdw2tqrW+CIw8sheVVIO4bVXaewJJPVcc9hXI+LNG13V9Bj0fT7fTjHiFmnuLx4yGR1YgKImyDt65HXpWzcDW7nw9crELOx1h4nWEpKZ4o3/AISSUUnt/D+dJ2Sdu4K7tcwvEdvLdeL9PihvJ7NzAcTQBCw+/wD31Zf0qh4Xl1CW3vdR1LxBezQ2d3cwtHJFbrGUjYgFtsQbOBngirQi1CHX9Bi1aeK41BLLFxLEuFd8NkgYHGfYfQVY0fQntNJ1KwvWR1vLq5kPlMfuSsSByBzg1zaqU0v62ErNa9/8ykni67FnZarcaQIdGvJI0jn+07pkEhAR3j24CkkdHJGRx1xLN4mvZTqE2l6Sl5ZafI0U8rXXlu7Ly4iTaQ2OnzMuTx71UXw9rV1pNjoOoNYf2baPFvuYpGMtwkTAopjKAITtXJDN3wOeJf7G1zT11Ox0v7A1lfTPMk9xK6yWxk+/8gQiTBywyy9cds1o7a287fhb9QXn/W//AACn4yXTNY8JWetx2sErtLaSW1w8QMiI8yHgnkZB5xXRa/Bdvp01xaard2LwRO+IEiYOQMjd5iN6dsdaxdZ8PamfDVnoGjW9i1rbrBia6unjb906tjasbZzt65HXpXQPHe3uizw3UNvBdTROhSKZpEUkED5iqk9v4fzqZ/C+Xu7DjuuYy/DX9qS+G7XUptTn1G6urSOVYbryoo1crngxxAgZPfd9KZ4MNuLXVhDpsdhKuozC5SK5edXl4LOGYA856YFaOl2d5pPheyskSCa8tbWOLa0pSNmVQD820kDjrt/Cs7w1p+uabc6iNQtdPWC8upLrfb3jyMhYDC7TEoI465H0qptc0rbf8EhX5Vf+tCnZeN7y50uy1ibQ/s+lXEywPK10DKhZtgYIFwU3YGSwPU7fWXTfEVzY2niRNam8yfR5pJA5VVLwMN8ZwAB0+X6isbwvpuqa54K0exnjs7fS0kWZpUnZ5pQkm4Ls2AJkgZO48D341fEfhK91fxHa3lpcQRWMyRxanFJndLHHIJEC4GM5yDnsabSvy7f0tfzLdv6/I0NOn8Rp4e04y2sF5qUsfmXLXE4t0jJ52/IjEkZx93scnPV1ldWXi3w9I1/pkRCSPFPa3KLKqSxkqcZGGAI4OPyqp4i8O3Wqa5a3wtNN1Ozit2iNjqLlY0csCJVARwWxkcgex60aDomreHPDktjbwaZPcPdyyBEke2hVHYkbQEcjHHy4I96mVmm/63EtLFbw7qQ0X4S2mpCHzRaaeZvK3bd20E4zg4/Kt2fW/I1PR7P7Pn+0hId+/Hl7U3dMc56dqxtM8O6qfAk3hnUlsoP9DNtHcW07S7sggkqyJjGRxk/hToNF1+61zRb7UTpsNvpySRtBbyPIXLR7d+5lXv8Aw4465PQVKzk3/XUXRf12HHxhP9k/tcaYp0Hz/KN19p/e7d2zzBFtwU3f7ecc47VauvEN0fEU2i6ZY21xcW8Czy/abzyCVYkDYAjFunJOAMjnmsXTfA6aUVtT4a8N6hbxykpezjZcbCc/MvksGZc4zuGcDpWn4p0G415Ht20nR7yMoVhubqV45bYnqV2oxPIB4ZM9O2aWmlv6/r5D6s6dSWRWKlSRkqcZHtxXPeKtabRJNFla8itLWa/WK5klKhfLKOcEt05A54qbUrDXE8JCx0bU411eOKONLy6XIYjG5mGG5IB7HrS6ppN5qD6HJ5sJksbtbicnI34jZTtGDzluhpWV/mJba9n+RiyeNrH/AISqb7Pq9rdaRbaTJdTi2dJQrq47rznHbNalt4hvlv8AT4NU0pLOLUcrbOlz5rBwpcJIu0BWKg9CwyCM9M1te8Jvr2s3M0s0aWdxpUli2Ml1dnDBgMYIGPWm6F4bOn3lu8/hfw1bvCuPt1l8spOMbgnkjbn03nGepprlsv66v/gDfl/Wi/4Jb1bX9R0Y/a7nSYv7KEyxPMt1mZQzBQ/l7NuMkfx5wc4zxUeqa3e3Mup2Gk2EFyLOLbdTXFyYVVmTcFXajliFIJzgDI5POOcuvAGo3NrcQPa6HNdtd/aBq8+57mRfNDBT8nyELxkMwwMYGcjfn0TWYNR1j+zZbIW2rbXeaZm8y3cIEJVApDghVxllwc9alpcv9eX/AASlZSMd3KfBuwaXTLfULFdKje6hlu3gJRUB+UqjEnj1H1rpNX1tfD/h+1vIrGS4VpIIEt4nG75yFABPUjPfGfUVmXeg60Ph9b+G7SOwlmbT/sc80ty8aodgXKgRtuHXrtq3faTq2raFZ2tzFZW1xb3lvMRHcPKjJG6seTGp3HB4xjpzWkrObfS/4XIWkV6Mkg8STQ319aaxYx2clrZ/bd0FwZlaLLA5JVSGG3pgj3rm9f8AFWqzadpsc2i28Vpq2HhlF8WdFADjegjwGK9gxHbNbHiW0lsZ9Z8QNP5dsuitb5iXdKrBmbcFOARgjvXIXVsfD2haS9xo9qouRFawSJrE108W4BjsjkTaoO0Z2N09QKzaTg/67/8AAHJdv60X/BPZ7P8A48bf/rkv8qo33iGy0+6NvPBqbuACTb6ZczJz/tJGV/Wr1n/x42//AFyX+VUb7w9ZahdG4nn1NHIAIt9TuYU4/wBlJAv6VqtkNF6zu4761S5hWZY3zgTwPC/XHKOAw/EVV13ShreiXWmmXyvtCbfM27tvIOcZGenrVqztI7G1S2haZo0zgzzvM/XPLuSx/E1PTaT0HCUotSW6Obm0s6Da+IdWtrj99Pb+Yn7sfuzHEQOuc8jPNVhe6np8ugudUlvv7RdUltp44wQCu4uhRVI2985HPauh1a1kvtHvbOIqJJ4HiUseAWUgZ9uag0fRLHSLWIW9jaQXHlKkskESqXIHOSACefWpSd/u/U6FVjyXlq/TySWvkQarrN7pMcl3LpsbafEwEkguP3oUkAsE24I5z94HHbtRea3MmtR6TY20E1y1v9oP2i5MI25wNuFYseDngAcc81z994Nvru31CFrfSZ7i4maVNRuNzThSQQuNvy4HAIYjA+7zW7rulTanALdtL0y/h8sqpu5GjaJiMEqQje3TaRj8leVi+Wimlvv+lnv69UVfFl7q0Gk28tpAkO+eDeTdFHVjIo2fKpBB6E56E8GtG41W503TJLvUrSJJA6pFDazmUyMxAUZZUwSTVa70G6m8Jw6Wt4JbyARMk8wOHdGDDdyTg4x3/Gl1TSrzX9EktL+CzgnWRJIgshnjYqQRuBVeDyCPQ03dXJXs3GKdrX1/AsWmrXJ1QabqNnHbXEkJmiMM5lR1BAYZKqQRkcY79a1qw9H0kWdy0raDo1g2zAlsm3Mfb/VLgfia3KpbGNVRUvd/r8X+Zz9xnV/FIsnJ+x6ciTyIOkkzElAfZQN2PUj0pZLq91TxDd6ba3j2VvYohmliRGkkdwSFG8EBQMHpkk9RTGkXSfGLvN8tvq0aIkh6CZMjaT2ypGPXBqWbTNQs9en1TS/s8ou41S4t7iRoxlchXVgrc4OCMfjUrb+v6/pG+i+5W7X0v+pT8Uzavp+hRi3lWUiaJXuWnMMhzKoAwqYORwSCOp47Vf1DWL3SNCu9Sv7CDdBgrFb3LPvBIHUouDz6Gnatpt5q/h+S1doIbxisibSWjV1YMoJ4JHABOB647VDq1hqut+G7ywnhs7e5lChClw0iHBBJJKKR09DQ76hBwaipJb6+mhYtNT1CS+hhu9JaCGdGeOVJfM2Yx8smFAUkHjBYcHms7RrO1sfGmsxWdtDbxm2t22QxhBkmTJwO9dKAVjAGCwHrXP2VnrcXiO51Ge009YrqOKJ1S8dmQIW5GYhnO7px060+qIhK8JW0ul180+p0VZ+san/ZNitz5Pm7p4otu7b99wueh6ZzWhWB4j8MWmtQhlsrE3fnRM000Q3FFcFl3YJ5UEYod+hnSUHNc+xv1jeKLu+0/RHv7FyGtZEllQKD5kQPzjnpxk8c8VpWljaafD5NlawW0Wd2yGMIufXAqSaJJ4JIZFDRyKVYHuDwaHe2goSjGab1RjXepXE+uaTZWEuI5Ua6uGCg5hAwo56ZZh054NRQ7tH8VrZxk/YdTSSZUJ4jnXBbHswOceoPrUfhTw/e6N9ofUbiGeXYlvA0ZJ2wJnaDkdeTmpGb+1PGMJhOYNKjcSuBwZpABsz6hRk/7wpdV/X9f5m75U3FapLfz6fjp6EWseEI9XuNTla68v7dDDER5W7Z5bbs9ec9O1aGv6ndaLpSXFlpVxqcnmxxeRAcMFZgC3Q8Ac/4DmtauU+IGr6hpnhxk0S8ih1uZ1FnAUEkk+GG5UQ5zweTjgc8dapJJpLuYyqSmrN7f5Jfojq6KZCZDBGZgolKjeF6Bsc4p9DM1qgooooAKKKKACiiigBf7KX/AJ7H/vmj+yl/57H/AL5rRorblRt7ep3M7+yl/wCex/75qtaeGbDTzMbKCC2Mz+ZL5MCpvb+82Op9zW1RRyoPb1O5lf2DbfavtWE+0BPL83yxv25ztz1xnnFSf2Uv/PY/981o0UcqD29TuZ39lL/z2P8A3zR/ZS/89j/3zWjRRyoPb1O5nf2Uv/PY/wDfNH9lL/z2P/fNaNFHKg9vU7md/ZS/89j/AN80f2Uv/PY/981o0UcqD29TuZ39lL/z2P8A3zR/ZS/89j/3zWjRRyoPb1O5nf2Uv/PY/wDfNH9lL/z2P/fNaNFHKg9vU7md/ZS/89j/AN80f2Uv/PY/981o0UcqD29TuZ39lL/z2P8A3zR/ZS/89j/3zWjRRyoPb1O5nf2Uv/PY/wDfNRpoNtHPLOgRZpceZIsYDPjpk98Vq0UcqD29TuZ39lL/AM9j/wB80f2Uv/PY/wDfNaNFHKg9vU7md/ZS/wDPY/8AfNH9lL/z2P8A3zWjRRyoPb1O5nf2Uv8Az2P/AHzR/ZS/89j/AN81o0UcqD29TuZ39lL/AM9j/wB80f2Uv/PY/wDfNaNFHKg9vU7md/ZS/wDPY/8AfNVNT0F7vTpoIZl8xwNu8YHUema3KKHCLVio4mrGSknscMvhPW0RVFzZYAwPmb/4ml/4RXXP+fmy/Nv/AImu4orP2ETr/tWv5fccP/wiuuf8/Nl+bf8AxNH/AAiuuf8APzZfm3/xNdxRR7CIf2rX7L7jh/8AhFdc/wCfmy/Nv/iaP+EV1z/n5svzb/4mu4oo9hEP7Vr9l9xw/wDwiuuf8/Nl+bf/ABNR/wDCG6t9o+0eZp3n7NnmYO7bnOM7c4z2rvKKPYRD+1K/ZfccP/wiuuf8/Nl+bf8AxNH/AAiuuf8APzZfm3/xNdxRR7CIf2rX7L7jh/8AhFdc/wCfmy/Nv/iaP+EV1z/n5svzb/4mu4oo9hEP7Vr9l9xw/wDwiuuf8/Nl+bf/ABNH/CK65/z82X5t/wDE13FFHsIh/atfsvuOT0fwve2l7NPeTwEOm0eUSTnj1Arb/spf+ex/75rRoq404xVkc9XGVasuaTM7+yl/57H/AL5o/spf+ex/75rRop8qMvb1O5nf2Uv/AD2P/fNH9lL/AM9j/wB81o0UcqD29TuZ39lL/wA9j/3zR/ZS/wDPY/8AfNaNFHKg9vU7md/ZS/8APY/980f2Uv8Az2P/AHzWjRRyoPb1O5nf2Uv/AD2P/fNH9lL/AM9j/wB81o0UcqD29TuZ39lL/wA9j/3zTE0SGN5HQqryHc7KgBY4xk+vAArUoo5UP29TuZ39lL/z2P8A3zR/ZS/89j/3zWjRRyoXt6nczv7KX/nsf++aP7KX/nsf++a0aKOVB7ep3M7+yl/57H/vmj+yl/57H/vmtGijlQe3qdzO/spf+ex/75o/spf+ex/75rRoo5UHt6nczv7KX/nsf++aZJokMpQyFXMbbkLIDtb1Hoea1KKOVD9vU7md/ZS/89j/AN80f2Uv/PY/981o0UcqF7ep3M7+yl/57H/vmj+yl/57H/vmtGijlQe3qdzO/spf+ex/75o/spf+ex/75rRoo5UHt6nczv7KX/nsf++aP7KX/nsf++a0aKOVB7ep3M7+yl/57H/vmj+yl/57H/vmtGijlQe3qdzO/spf+ex/75o/spf+ex/75rRoo5UHt6nczv7KX/nsf++aP7KX/nsf++a0aKOVB7ep3M7+yl/57H/vmj+yl/57H/vmtGijlQe3qdzO/spf+ex/75o/spf+ex/75rRoo5UHt6nczv7KX/nsf++aP7KX/nsf++a0aKOVB7ep3M7+yl/57H/vmj+yl/57H/vmtGijlQe3qdzO/spf+ex/75o/spf+ex/75rRoo5UHt6nczv7KX/nsf++aP7KX/nsf++a0aKOVB7ep3M7+yl/57H/vmj+yl/57H/vmtGijlQe3qdzO/spf+ex/75o/spf+ex/75rRoo5UHt6nczv7KX/nsf++aP7KX/nsf++a0aKOVB7ep3M7+yl/57H/vmsrWYYbVoUdWkyCchtvp7GumqhqMMUhjLxoxGfvKD6UOC6F08RJSvLVHKb7b/ng//fz/AOtRvtv+eD/9/P8A61b32W3/AOeEX/fAo+y2/wDzwi/74FT7NnR9ch2f3mDvtv8Ang//AH8/+tXRnrUX2W3/AOeEX/fAqY9T9auEXE569aNS1kJXPeNf+Ram/wB9P510Nc941/5Fqb/fT+dWc5paN/yAtP8A+vaP/wBBFXqo6N/yAtP/AOvaP/0EVepCDvWxWP3rYpDCiiigAooooAKK568+1weKNK330zpO82YlO2MKEyBtHU+5z+HSmX17PdeIJrBYr2S3told47NxGzs2eS5ZcADsDznuBVqF7GTq2vps7HSUjfcP0rlbnV7addMgiu7i2sXWR52aRhL8hA8stktnccHByegPNWtCubj7dqNlKLgQoqTQLcyF5FVt3BJ5/hyASSM8+gbptK4lVTdv62ueIeDTF/wmekbUcH7UnJcHv9K+i5YBI2d2OMdK+cfBn/I6aP8A9fSfzr6TrzcErwdzky74H6lf7IP75/Kj7IP75/KrFFdnKj0Sv9kH98/lR9kH98/lVisnxHey2Wiy/ZT/AKZcEW9uOf8AWOcA/h1/ClJJK9hNpK7LMCQXMQlt7hJYySA8ZDDIODyPehEgklkijuEaSLAkRSCUyMjI7ZFNt4rbQNBSMti3soPmY9SFHJ+p61U8L200Wkfa7oEXd/IbuYH+Et0X8FCj8KOVc1v6/rf7iVJ6J7s0vsg/vn8qPsg/vn8qsUU+VFlf7IP75/Kj7IP75/KrFFHKgK/2Qf3z+VVr7RbHU7VrW/toLu3YgtFcRLIhI6cHitGijkQFVbJERUQhVUYChcAD0plvpdvZwLBbRxwQrnbHEgVRk5OAPck1doo5UFiv9kH98/lR9kH98/lViijlQFf7IP75/Kj7IP75/KrFFHKgK/2Qf3z+VH2Qf3z+VWKKOVAV/sg/vn8qPsg/vn8qsUUcqAr/AGQf3z+VH2Qf3z+VWKKOVAV/sg/vn8qPsg/vn8qsUUcqAr/ZB/fP5UfZB/fP5VYoo5UBX+yD++fypklhHNE8UuHjdSrIyghgeoI7irdFHJECpFp8UEKQwhY4o1CoiKAFA6ADsKf9kH98/lViijlQWK/2Qf3z+VH2Qf3z+VWKKOVAV/sg/vn8qPsg/vn8qsUUcqAr/ZB/fP5UfZB/fP5VYoo5UBX+yD++fyo+yD++fyqxRRyoDk9d8Oand6xbX+mz2yNDEU/fE9TnsAexqv8A2J4t/wCf7Tf/AB7/AOIrtKKyeHg3fUVji/7E8W/8/wBpv/j3/wARR/Yni3/n+03/AMe/+IrtKKX1aHd/eHKcX/Yni3/n+03/AMe/+Io/sTxb/wA/2m/+Pf8AxFdpRR9Wh3f3hynF/wBieLf+f7Tf/Hv/AIik/sPxb/z/AGm/+Pf/ABFdrRR9Wh3f3hynDW/hvxNaQJBbXGkwwoMLHGhVV+gCYFS/2J4t/wCf7Tf/AB7/AOIrtKKPq8e7+8OU4v8AsTxb/wA/2m/+Pf8AxFH9ieLf+f7Tf/Hv/iK7Sij6tDu/vDlOL/sTxb/z/ab/AOPf/EUf2J4t/wCf7Tf/AB7/AOIrtKKPq0O7+8OU4v8AsTxb/wA/2m/+Pf8AxFH9ieLf+f7Tf/Hv/iK7Sij6tDu/vDlOL/sTxb/z/ab/AOPf/EUf2J4t/wCf7Tf/AB7/AOIrtKKPq0O7+8OU4v8AsTxb/wA/2m/+Pf8AxFH9ieLf+f7Tf/Hv/iK7Sij6tDu/vDlOL/sTxb/z/ab/AOPf/EUf2J4t/wCf7Tf/AB7/AOIrtKKPq0O7+8OU4v8AsTxb/wA/2m/+Pf8AxFH9ieLf+f7Tf/Hv/iK7Sij6tDu/vDlOKOheLGBBvdNIPBBDf/EVjr8N72JX+zWnh61ZxtaS2thExGQcZWMHGQK9Noo+rQ7v7w5Slb2Jitoo2f5kQKcDjIFS/ZB/fP5VYorbkiMr/ZB/fP5UfZB/fP5VYoo5UBX+yD++fyo+yD++fyqxRRyoCv8AZB/fP5UfZB/fP5VYoo5UBX+yD++fyo+yD++fyqxRRyoCv9kH98/lR9kH98/lViijlQFOXToZ0CTKkihgwDoCAQcg89weak+yD++fyqxRRyoCv9kH98/lR9kH98/lViijlQFf7IP75/Kj7IP75/KrFFHKgK/2Qf3z+VH2Qf3z+VWKKOVAV/sg/vn8qPsg/vn8qsUUcqAr/ZB/fP5VHFp0MClYVSNWYsQiAAknJPHcmrlFHIgK/wBkH98/lR9kH98/lViijlQFf7IP75/Kj7IP75/KrFFHKgK/2Qf3z+VH2Qf3z+VWKKOVAV/sg/vn8qPsg/vn8qsUUcqAr/ZB/fP5UVYoo5UB/9k=
+
\ No newline at end of file
diff --git a/Scripts/Batch Files/build-canary.cmd b/Scripts/Batch Files/build-canary.cmd
new file mode 100644
index 000000000..6a06e0229
--- /dev/null
+++ b/Scripts/Batch Files/build-canary.cmd
@@ -0,0 +1,63 @@
+@echo off
+
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin" goto vs17prev
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin" goto vs17ent
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin" goto vs17pro
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin" goto vs17com
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin" goto vs17build
+
+echo "Unable to detect suitable environment. Check if VS 2022 is installed."
+
+pause
+goto exitbatch
+
+:vs17prev
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin
+goto build
+
+:vs17ent
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin
+goto build
+
+:vs17pro
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin
+goto build
+
+:vs17com
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin
+goto build
+
+:vs17build
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin
+goto build
+
+:build
+for /f "tokens=* usebackq" %%A in (`tzutil /g`) do (
+ set "zone=%%A"
+)
+
+@echo Started: %date% %time% %zone%
+@echo
+set targets=Build
+if not "%~1" == "" set targets=%~1
+"%msbuildpath%\msbuild.exe" /t:%targets% canary.proj /fl /flp:logfile=../Logs/build-log.log /bl:../Logs/build-log.binlog
+
+@echo Build Completed: %date% %time% %zone%
+
+pause
+
+@echo Do you want to return to complete another task? (Y/N)
+set /p answer="Enter input: "
+if %answer%==Y (goto run)
+if %answer%==y (goto run)
+if %answer%==N exit
+if %answer%==n exit
+
+@echo Invalid input, please try again.
+
+:run
+cd ..
+
+run.cmd
+
+:exitbatch
\ No newline at end of file
diff --git a/Scripts/Batch Files/build-installer.cmd b/Scripts/Batch Files/build-installer.cmd
new file mode 100644
index 000000000..73469c7e5
--- /dev/null
+++ b/Scripts/Batch Files/build-installer.cmd
@@ -0,0 +1,63 @@
+@echo off
+
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin" goto vs17prev
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin" goto vs17ent
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin" goto vs17pro
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin" goto vs17com
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin" goto vs17build
+
+echo "Unable to detect suitable environment. Check if VS 2022 is installed."
+
+pause
+goto exitbatch
+
+:vs17prev
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin
+goto build
+
+:vs17ent
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin
+goto build
+
+:vs17pro
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin
+goto build
+
+:vs17com
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin
+goto build
+
+:vs17build
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin
+goto build
+
+:build
+for /f "tokens=* usebackq" %%A in (`tzutil /g`) do (
+ set "zone=%%A"
+)
+
+@echo Started: %date% %time% %zone%
+@echo
+set targets=Build
+if not "%~1" == "" set targets=%~1
+"%msbuildpath%\msbuild.exe" /t:%targets% ../Project Files/installer.proj /fl /flp:logfile=build.log
+
+@echo Build Completed: %date% %time% %zone%
+
+pause
+
+@echo Do you want to return to complete another task? (Y/N)
+set /p answer="Enter input: "
+if %answer%==Y (goto run)
+if %answer%==y (goto run)
+if %answer%==N exit
+if %answer%==n exit
+
+@echo Invalid input, please try again.
+
+:run
+cd ..
+
+run.cmd
+
+:exitbatch
\ No newline at end of file
diff --git a/Scripts/Batch Files/build-nightly-custom.cmd b/Scripts/Batch Files/build-nightly-custom.cmd
new file mode 100644
index 000000000..4321af705
--- /dev/null
+++ b/Scripts/Batch Files/build-nightly-custom.cmd
@@ -0,0 +1,47 @@
+@echo off
+
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin" goto vs17prev
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin" goto vs17ent
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin" goto vs17pro
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin" goto vs17com
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin" goto vs17build
+
+echo "Unable to detect suitable environment. Check if VS 2022 is installed."
+
+pause
+goto exitbatch
+
+:vs17prev
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin
+goto build
+
+:vs17ent
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin
+goto build
+
+:vs17pro
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin
+goto build
+
+:vs17com
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin
+goto build
+
+:vs17build
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin
+goto build
+
+:build
+for /f "tokens=* usebackq" %%A in (`tzutil /g`) do (
+ set "zone=%%A"
+)
+
+@echo Started: %date% %time% %zone%
+@echo
+set targets=Build
+if not "%~1" == "" set targets=%~1
+"%msbuildpath%\msbuild.exe" /t:%targets% nightly.proj /fl /flp:logfile=build.log
+
+@echo Build Completed: %date% %time% %zone%
+
+:exitbatch
\ No newline at end of file
diff --git a/Scripts/Batch Files/build-nightly.cmd b/Scripts/Batch Files/build-nightly.cmd
new file mode 100644
index 000000000..c57aea853
--- /dev/null
+++ b/Scripts/Batch Files/build-nightly.cmd
@@ -0,0 +1,67 @@
+@echo off
+
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin" goto vs17prev
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin" goto vs17ent
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin" goto vs17pro
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin" goto vs17com
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin" goto vs17build
+
+echo "Unable to detect suitable environment. Check if VS 2022 is installed."
+
+pause
+goto exitbatch
+
+:vs17prev
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin
+goto build
+
+:vs17ent
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin
+goto build
+
+:vs17pro
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin
+goto build
+
+:vs17com
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin
+goto build
+
+:vs17build
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin
+goto build
+
+:build
+for /f "tokens=* usebackq" %%A in (`tzutil /g`) do (
+ set "zone=%%A"
+)
+
+@echo Started: %date% %time% %zone%
+@echo
+set targets=Build
+if not "%~1" == "" set targets=%~1
+"%msbuildpath%\msbuild.exe" -t:%targets% ../Project-Files/nightly.proj /fl /flp:logfile=../../Logs/build-log.log /bl:../../Logs/build-log.binlog
+
+:: -t:rebuild
+
+::-graphBuild:True
+
+@echo Build Completed: %date% %time% %zone%
+
+pause
+
+@echo Do you want to return to complete another task? (Y/N)
+set /p answer="Enter input: "
+if %answer%==Y (goto run)
+if %answer%==y (goto run)
+if %answer%==N exit
+if %answer%==n exit
+
+@echo Invalid input, please try again.
+
+:run
+cd ..
+
+run.cmd
+
+:exitbatch
\ No newline at end of file
diff --git a/Scripts/Batch Files/build-stable.cmd b/Scripts/Batch Files/build-stable.cmd
new file mode 100644
index 000000000..bea7049f8
--- /dev/null
+++ b/Scripts/Batch Files/build-stable.cmd
@@ -0,0 +1,66 @@
+@echo off
+
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin" goto vs17prev
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin" goto vs17ent
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin" goto vs17pro
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin" goto vs17com
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin" goto vs17build
+
+echo "Unable to detect suitable environment. Check if VS 2022 is installed."
+goto exitbatch
+
+goto end
+
+:vs17prev
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin
+goto build
+
+:vs17ent
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin
+goto build
+
+:vs17pro
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin
+goto build
+
+:vs17com
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin
+goto build
+
+:vs17build
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin
+goto build
+
+:build
+for /f "tokens=* usebackq" %%A in (`tzutil /g`) do (
+ set "zone=%%A"
+)
+
+echo Started: %date% %time% %zone%
+echo
+set targets=Build
+if not "%~1" == "" set targets=%~1
+"%msbuildpath%\msbuild.exe" /t:%targets% build.proj /fl /flp:logfile=../Logs/build-log.log /bl:../Logs/build-log.binlog
+
+echo Build Completed: %date% %time% %zone%
+
+pause
+
+@echo Do you want to return to complete another task? (Y/N)
+set /p answer="Enter input: "
+if %answer%==Y (goto run)
+if %answer%==y (goto run)
+if %answer%==N exit
+if %answer%==n exit
+
+@echo Invalid input, please try again.
+
+:run
+cd ..
+
+run.cmd
+
+:end
+pause
+
+:exitbatch
\ No newline at end of file
diff --git a/Scripts/Batch Files/buildsolution.cmd b/Scripts/Batch Files/buildsolution.cmd
new file mode 100644
index 000000000..45f76b461
--- /dev/null
+++ b/Scripts/Batch Files/buildsolution.cmd
@@ -0,0 +1,111 @@
+echo off
+
+echo Do you want to build using Visual Studio 2019 or 2022? (2019/2022)
+set INPUT=
+set /P INPUT=Type 2019 or 2022: %=%
+if /I "%INPUT%"=="2019" goto vs2019build
+if /I "%INPUT%"=="2022" goto vs2022build
+
+:vs2019build
+if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin" goto vs16prev
+if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin" goto vs16ent
+if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin" goto vs16pro
+if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin" goto vs16com
+if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin" goto vs16build
+
+echo "Unable to detect suitable environment. Check if VS 2019 is installed."
+goto exitbatch
+
+pause
+
+:vs16prev
+set msbuildpath=%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin
+goto build2019
+
+:vs16ent
+set msbuildpath=%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin
+goto build2019
+
+:vs16pro
+set msbuildpath=%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin
+goto build2019
+
+:vs16com
+set msbuildpath=%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin
+goto build2019
+
+:vs16build
+set msbuildpath=%ProgramFiles(x86)%\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin
+goto build2019
+
+:build2019
+@echo Started: %date% %time%
+@echo
+set targets=Build
+if not "%~1" == "" set targets=%~1
+"%msbuildpath%\msbuild.exe" /t:%targets% build.proj /fl /flp:logfile=build.log
+
+:vs2022build
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin" goto vs17prev
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin" goto vs17ent
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin" goto vs17pro
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin" goto vs17com
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin" goto vs17build
+
+echo "Unable to detect suitable environment. Check if VS 2022 is installed."
+goto exitbatch
+pause
+
+:vs17prev
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin
+goto build2022
+
+:vs17ent
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin
+goto build2022
+
+:vs17pro
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin
+goto build2022
+
+:vs17com
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin
+goto build2022
+
+:vs17build
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin
+goto build2022
+
+:build2022
+set targets=Build
+if not "%~1" == "" set targets=%~1
+"%msbuildpath%\msbuild.exe" /t:%targets% build.proj /fl /flp:logfile=build.log
+
+echo Do you now want to create NuGet packages? (y/n)
+set INPUT=
+set /PINPUT=Type input: %=%
+if /I "%INPUT%"=="y" goto createpackages
+if /I "%INPUT%"=="n" goto break
+
+:createpackages
+echo Do you want to pack using Visual Studio 2019 or 2022? (2019/2022)
+set INPUT=
+set /P INPUT=Type 2019 or 2022: %=%
+if /I "%INPUT%"=="2019" goto vs2019pack
+if /I "%INPUT%"=="2022" goto vs2022pack
+
+:vs2019pack
+build-2019.cmd Pack
+
+@echo Build Completed: %date% %time%
+
+:vs2022pack
+build-2022.cmd Pack
+
+@echo Build Completed: %date% %time%
+
+:break
+pause
+@echo Build Completed: %date% %time%
+
+:exitbatch
\ No newline at end of file
diff --git a/Scripts/Batch Files/createnightlyzip.cmd b/Scripts/Batch Files/createnightlyzip.cmd
new file mode 100644
index 000000000..b1365ee0e
--- /dev/null
+++ b/Scripts/Batch Files/createnightlyzip.cmd
@@ -0,0 +1 @@
+build.cmd CreateNightlyZip
\ No newline at end of file
diff --git a/Scripts/Batch Files/debug.cmd b/Scripts/Batch Files/debug.cmd
new file mode 100644
index 000000000..199738931
--- /dev/null
+++ b/Scripts/Batch Files/debug.cmd
@@ -0,0 +1,47 @@
+@echo off
+
+if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin" goto vs16prev
+if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin" goto vs16ent
+if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin" goto vs16pro
+if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin" goto vs16com
+if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin" goto vs16build
+
+echo "Unable to detect suitable environment. Check if VS 2019 is installed."
+goto exitbatch
+
+pause
+
+:vs16prev
+set msbuildpath=%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin
+goto build
+
+:vs16ent
+set msbuildpath=%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin
+goto build
+
+:vs16pro
+set msbuildpath=%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin
+goto build
+
+:vs16com
+set msbuildpath=%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin
+goto build
+
+:vs16build
+set msbuildpath=%ProgramFiles(x86)%\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin
+goto build
+
+:build
+@echo Started: %date% %time%
+@echo
+set targets=Build
+if not "%~1" == "" set targets=%~1
+"%msbuildpath%\msbuild.exe" /t:%targets% build.proj /fl /flp:logfile=../Logs/debug-log.log
+
+@echo Build Completed: %date% %time%
+@echo
+echo Plese alter file '{Path}\Directory.Build.props' before executing 'publish.cmd' script!
+
+pause
+
+:exitbatch
\ No newline at end of file
diff --git a/publish-to-github.cmd b/Scripts/Batch Files/publish-to-github.cmd
similarity index 100%
rename from publish-to-github.cmd
rename to Scripts/Batch Files/publish-to-github.cmd
diff --git a/publish.cmd b/Scripts/Batch Files/publish.cmd
similarity index 100%
rename from publish.cmd
rename to Scripts/Batch Files/publish.cmd
diff --git a/purge.cmd b/Scripts/Batch Files/purge.cmd
similarity index 78%
rename from purge.cmd
rename to Scripts/Batch Files/purge.cmd
index 471b15510..4abc81735 100644
--- a/purge.cmd
+++ b/Scripts/Batch Files/purge.cmd
@@ -25,13 +25,17 @@ echo Deleted the 'Krypton.Toolkit\obj' folder
echo Deleting the 'Krypton.Workspace\obj' folder
rd /s /q "Source\Krypton Components\Krypton.Workspace\obj"
echo Deleted the 'Krypton.Workspace\obj' folder
-if exist "Scripts\build.log" ( goto deletebuildfile )
+if exist "Logs\build-log.log" ( goto deletebuildfile )
+if exist "Logs\build-log.binlog" ( goto deletebuildfile)
if exist "Scripts\debug.log" ( goto deletedebugfile )
:deletebuildfile
-echo Deleting the 'build.log' file
-del /f "Scripts\build.log"
-echo Deleted the 'build.log' file
+echo Deleting the 'build-log.log' file
+del /f "Logs\build-log.log"
+echo Deleted the 'build-log.log' file
+echo Deleting the 'build-log.binlog' file
+del /f "Logs\build-log.binlog"
+echo Deleted the 'build-log.binlog' file
:deletedebugfile
echo Deleting the 'debug.log' file
diff --git a/Scripts/Batch Files/rebuild-build-nightly.cmd b/Scripts/Batch Files/rebuild-build-nightly.cmd
new file mode 100644
index 000000000..ed138f0ee
--- /dev/null
+++ b/Scripts/Batch Files/rebuild-build-nightly.cmd
@@ -0,0 +1,65 @@
+@echo off
+
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin" goto vs17prev
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin" goto vs17ent
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin" goto vs17pro
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin" goto vs17com
+if exist "%ProgramFiles%\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin" goto vs17build
+
+echo "Unable to detect suitable environment. Check if VS 2022 is installed."
+
+pause
+goto exitbatch
+
+:vs17prev
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin
+goto build
+
+:vs17ent
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin
+goto build
+
+:vs17pro
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin
+goto build
+
+:vs17com
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin
+goto build
+
+:vs17build
+set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin
+goto build
+
+:build
+for /f "tokens=* usebackq" %%A in (`tzutil /g`) do (
+ set "zone=%%A"
+)
+
+@echo Rebuild Started: %date% %time% %zone%
+@echo
+set targets=Rebuild
+if not "%~1" == "" set targets=%~1
+"%msbuildpath%\msbuild.exe" -t:%targets% nightly.proj /fl /flp:logfile=build.log -graphBuild:True
+
+:: -t:rebuild
+
+@echo Build Completed: %date% %time% %zone%
+
+pause
+
+@echo Do you want to return to complete another task? (Y/N)
+set /p answer="Enter input: "
+if %answer%==Y (goto run)
+if %answer%==y (goto run)
+if %answer%==N exit
+if %answer%==n exit
+
+@echo Invalid input, please try again.
+
+:run
+cd ..
+
+run.cmd
+
+:exitbatch
\ No newline at end of file
diff --git a/Scripts/Batch Files/update-nuget.cmd b/Scripts/Batch Files/update-nuget.cmd
new file mode 100644
index 000000000..d64ec95d1
--- /dev/null
+++ b/Scripts/Batch Files/update-nuget.cmd
@@ -0,0 +1,71 @@
+@echo off
+
+cls
+
+echo 1. Update NuGet client
+echo 2. Update NuGet client (use 'Self' switch)
+echo 3. Go back to main menu
+echo 4. End
+
+set /p answer="Enter number (1 - 4): "
+if %answer%==1 (goto updatenuget)
+if %answer%==2 (goto updatenugetself)
+if %answer%==3 (goto backtorun)
+if %answer%==4 (goto end)
+
+@echo Invalid input, please try again.
+
+pause
+
+goto setmenu
+
+:setmenu
+
+cls
+
+echo 1. Update NuGet client
+echo 2. Update NuGet client (use 'Self' switch)
+echo 3. Go back to main menu
+echo 4. End
+
+set /p answer="Enter number (1 - 4): "
+if %answer%==1 (goto updatenuget)
+if %answer%==2 (goto updatenugetself)
+if %answer%==3 (goto backtorun)
+if %answer%==4 (goto end)
+
+@echo Invalid input, please try again.
+
+pause
+
+goto setmenu
+
+:backtorun
+cd ..
+
+run.cmd
+
+:updatenuget
+cls
+
+nuget update
+
+pause
+
+goto setmenu
+
+:updatenugetself
+cls
+
+nuget update -Self
+
+pause
+
+goto setmenu
+
+:end
+@echo Exiting the build system, have a good day. Bye!
+
+pause
+
+exit
\ No newline at end of file
diff --git a/Scripts/Project-Files/build.proj b/Scripts/Project-Files/build.proj
new file mode 100644
index 000000000..370450156
--- /dev/null
+++ b/Scripts/Project-Files/build.proj
@@ -0,0 +1,77 @@
+
+
+
+
+ $(MSBuildProjectDirectory)
+ Release
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Scripts/Project-Files/canary.proj b/Scripts/Project-Files/canary.proj
new file mode 100644
index 000000000..804bae8ef
--- /dev/null
+++ b/Scripts/Project-Files/canary.proj
@@ -0,0 +1,75 @@
+
+
+
+
+ $(MSBuildProjectDirectory)
+ Canary
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $([System.DateTime]::Now.ToString('yyyyMMdd'))
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Scripts/Project-Files/debug.proj b/Scripts/Project-Files/debug.proj
new file mode 100644
index 000000000..9a6a430d1
--- /dev/null
+++ b/Scripts/Project-Files/debug.proj
@@ -0,0 +1,29 @@
+
+
+
+
+ $(MSBuildProjectDirectory)
+ Debug
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Scripts/Project-Files/installer.proj b/Scripts/Project-Files/installer.proj
new file mode 100644
index 000000000..c8f70dbbb
--- /dev/null
+++ b/Scripts/Project-Files/installer.proj
@@ -0,0 +1,75 @@
+
+
+
+
+ $(MSBuildProjectDirectory)
+ Installer
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $([System.DateTime]::Now.ToString('yyyyMMdd'))
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Scripts/Project-Files/nightly.proj b/Scripts/Project-Files/nightly.proj
new file mode 100644
index 000000000..821f6c7a8
--- /dev/null
+++ b/Scripts/Project-Files/nightly.proj
@@ -0,0 +1,77 @@
+
+
+
+
+ $(MSBuildProjectDirectory)
+ Nightly
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $([System.DateTime]::Now.ToString('yyyyMMdd'))
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Scripts/build-canary.cmd b/Scripts/build-canary.cmd
index 758a120ce..6733ce509 100644
--- a/Scripts/build-canary.cmd
+++ b/Scripts/build-canary.cmd
@@ -9,6 +9,7 @@ if exist "%ProgramFiles%\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current
echo "Unable to detect suitable environment. Check if VS 2022 is installed."
pause
+goto exitbatch
:vs17prev
set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin
@@ -35,17 +36,22 @@ for /f "tokens=* usebackq" %%A in (`tzutil /g`) do (
set "zone=%%A"
)
+@echo Started to build Canary release
+@echo:
@echo Started: %date% %time% %zone%
-@echo
+@echo:
set targets=Build
if not "%~1" == "" set targets=%~1
-"%msbuildpath%\msbuild.exe" /t:%targets% canary.proj /fl /flp:logfile=build.log
-
-@echo Build Completed: %date% %time% %zone%
-
+"%msbuildpath%\msbuild.exe" /t:%targets% canary.proj /fl /flp:logfile=../Logs/canary-build-log.log /bl:../Logs/canary-build-log.binlog /clp:Summary;ShowTimestamp /v:quiet
+@echo:
+@echo Canary release build completed: %date% %time% %zone%
+@echo:
+@echo You can find the build Logs in ../Logs
+@echo:
pause
@echo Do you want to return to complete another task? (Y/N)
+@echo:
set /p answer="Enter input: "
if %answer%==Y (goto run)
if %answer%==y (goto run)
@@ -55,6 +61,4 @@ if %answer%==n exit
@echo Invalid input, please try again.
:run
-cd ..
-
-run.cmd
\ No newline at end of file
+main-menu.cmd
\ No newline at end of file
diff --git a/Scripts/build-installer.cmd b/Scripts/build-installer.cmd
index a61724fe6..7ebb5a553 100644
--- a/Scripts/build-installer.cmd
+++ b/Scripts/build-installer.cmd
@@ -9,6 +9,7 @@ if exist "%ProgramFiles%\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current
echo "Unable to detect suitable environment. Check if VS 2022 is installed."
pause
+goto exitbatch
:vs17prev
set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin
@@ -39,7 +40,7 @@ for /f "tokens=* usebackq" %%A in (`tzutil /g`) do (
@echo
set targets=Build
if not "%~1" == "" set targets=%~1
-"%msbuildpath%\msbuild.exe" /t:%targets% installer.proj /fl /flp:logfile=build.log
+"%msbuildpath%\msbuild.exe" /t:%targets% ../Project Files/installer.proj /fl /flp:logfile=../Logs/installer-build-log.log /bl:../Logs/installer-build-log.binlog /clp:Summary;ShowTimestamp /v:quiet
@echo Build Completed: %date% %time% %zone%
@@ -55,6 +56,4 @@ if %answer%==n exit
@echo Invalid input, please try again.
:run
-cd ..
-
-run.cmd
\ No newline at end of file
+main-menu.cmd
\ No newline at end of file
diff --git a/Scripts/build-nightly-custom.cmd b/Scripts/build-nightly-custom.cmd
index 17ce9bb01..673601fa4 100644
--- a/Scripts/build-nightly-custom.cmd
+++ b/Scripts/build-nightly-custom.cmd
@@ -9,6 +9,7 @@ if exist "%ProgramFiles%\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current
echo "Unable to detect suitable environment. Check if VS 2022 is installed."
pause
+goto exitbatch
:vs17prev
set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin
@@ -41,4 +42,7 @@ set targets=Build
if not "%~1" == "" set targets=%~1
"%msbuildpath%\msbuild.exe" /t:%targets% nightly.proj /fl /flp:logfile=build.log
-@echo Build Completed: %date% %time% %zone%
\ No newline at end of file
+@echo Build Completed: %date% %time% %zone%
+
+:exitbatch
+main-menu.cmd
\ No newline at end of file
diff --git a/Scripts/build-nightly.cmd b/Scripts/build-nightly.cmd
index 1e768f5c9..e1f4d6533 100644
--- a/Scripts/build-nightly.cmd
+++ b/Scripts/build-nightly.cmd
@@ -9,6 +9,7 @@ if exist "%ProgramFiles%\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current
echo "Unable to detect suitable environment. Check if VS 2022 is installed."
pause
+goto exitbatch
:vs17prev
set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin
@@ -35,21 +36,26 @@ for /f "tokens=* usebackq" %%A in (`tzutil /g`) do (
set "zone=%%A"
)
+@echo Started to build Nightly release
+@echo:
@echo Started: %date% %time% %zone%
-@echo
+@echo:
set targets=Build
if not "%~1" == "" set targets=%~1
-"%msbuildpath%\msbuild.exe" -t:%targets% nightly.proj /fl /flp:logfile=build.log
-
+"%msbuildpath%\msbuild.exe" -t:%targets% nightly.proj /fl /flp:logfile=../Logs/nightly-build-log.log /bl:../Logs/nightly-build-log.binlog /clp:Summary;ShowTimestamp /v:quiet
+@echo:
:: -t:rebuild
::-graphBuild:True
-@echo Build Completed: %date% %time% %zone%
-
+@echo Nightly release build completed: %date% %time% %zone%
+@echo:
+@echo You can find the build Logs in ../Logs
+@echo:
pause
@echo Do you want to return to complete another task? (Y/N)
+@echo:
set /p answer="Enter input: "
if %answer%==Y (goto run)
if %answer%==y (goto run)
@@ -59,6 +65,4 @@ if %answer%==n exit
@echo Invalid input, please try again.
:run
-cd ..
-
-run.cmd
\ No newline at end of file
+main-menu.cmd
\ No newline at end of file
diff --git a/Scripts/build-stable.cmd b/Scripts/build-stable.cmd
index 653b1971b..db95a384f 100644
--- a/Scripts/build-stable.cmd
+++ b/Scripts/build-stable.cmd
@@ -35,17 +35,22 @@ for /f "tokens=* usebackq" %%A in (`tzutil /g`) do (
set "zone=%%A"
)
-echo Started: %date% %time% %zone%
-echo
+@echo Started to build Stable release
+@echo:
+@echo Started: %date% %time% %zone%
+@echo:
set targets=Build
if not "%~1" == "" set targets=%~1
-"%msbuildpath%\msbuild.exe" /t:%targets% build.proj /fl /flp:logfile=build.log
-
-echo Build Completed: %date% %time% %zone%
-
+"%msbuildpath%\msbuild.exe" /t:%targets% build.proj /fl /flp:logfile=../Logs/stable-build-log.log /bl:../Logs/stable-build-log.binlog /clp:Summary;ShowTimestamp /v:quiet
+@echo:
+@echo Stable release build completed: %date% %time% %zone%
+@echo:
+@echo You can find the build Logs in ../Logs
+@echo:
pause
@echo Do you want to return to complete another task? (Y/N)
+@echo:
set /p answer="Enter input: "
if %answer%==Y (goto run)
if %answer%==y (goto run)
@@ -55,9 +60,7 @@ if %answer%==n exit
@echo Invalid input, please try again.
:run
-cd ..
-
-run.cmd
+main-menu.cmd
:end
pause
\ No newline at end of file
diff --git a/Scripts/buildsolution.cmd b/Scripts/buildsolution.cmd
index 609e59267..85150f7cb 100644
--- a/Scripts/buildsolution.cmd
+++ b/Scripts/buildsolution.cmd
@@ -17,6 +17,8 @@ echo "Unable to detect suitable environment. Check if VS 2019 is installed."
pause
+goto exitbatch
+
:vs16prev
set msbuildpath=%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin
goto build2019
@@ -42,7 +44,7 @@ goto build2019
@echo
set targets=Build
if not "%~1" == "" set targets=%~1
-"%msbuildpath%\msbuild.exe" /t:%targets% build.proj /fl /flp:logfile=build.log
+"%msbuildpath%\msbuild.exe" /t:%targets% build.proj /fl /flp:logfile=../Logs/solution-build-log.log /bl:solution-build-log.binlog /clp:Summary;ShowTimestamp /v:quiet
:vs2022build
if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin" goto vs17prev
@@ -52,7 +54,7 @@ if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Community\MSBuild\Current\
if exist "%ProgramFiles%\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin" goto vs17build
echo "Unable to detect suitable environment. Check if VS 2022 is installed."
-
+goto exitbatch
pause
:vs17prev
@@ -105,4 +107,6 @@ build-2022.cmd Pack
:break
pause
-@echo Build Completed: %date% %time%
\ No newline at end of file
+@echo Build Completed: %date% %time%
+
+:exitbatch
\ No newline at end of file
diff --git a/Scripts/debug.cmd b/Scripts/debug.cmd
index 0b7ca5444..d7b3995f5 100644
--- a/Scripts/debug.cmd
+++ b/Scripts/debug.cmd
@@ -9,6 +9,7 @@ if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\BuildTools\MSBuild\Cu
echo "Unable to detect suitable environment. Check if VS 2019 is installed."
pause
+goto exitbatch
:vs16prev
set msbuildpath=%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin
@@ -35,10 +36,12 @@ goto build
@echo
set targets=Build
if not "%~1" == "" set targets=%~1
-"%msbuildpath%\msbuild.exe" /t:%targets% build.proj /fl /flp:logfile=build.log
+"%msbuildpath%\msbuild.exe" /t:%targets% build.proj /fl /flp:logfile=../Logs/debug-build-log.log /bl:../Logs/debug-build-log.binlog /clp:Summary;ShowTimestamp /v:quiet
@echo Build Completed: %date% %time%
@echo
echo Plese alter file '{Path}\Directory.Build.props' before executing 'publish.cmd' script!
-pause
\ No newline at end of file
+pause
+
+:exitbatch
\ No newline at end of file
diff --git a/Scripts/main-menu.cmd b/Scripts/main-menu.cmd
new file mode 100644
index 000000000..e5bb59c79
--- /dev/null
+++ b/Scripts/main-menu.cmd
@@ -0,0 +1,5 @@
+@echo off
+
+cd ..
+
+run.cmd
\ No newline at end of file
diff --git a/Scripts/publish-to-github.cmd b/Scripts/publish-to-github.cmd
new file mode 100644
index 000000000..7855b0267
--- /dev/null
+++ b/Scripts/publish-to-github.cmd
@@ -0,0 +1,3 @@
+@echo off
+
+dotnet nuget push "../bin/Release/*.nupkg" --source "github"
\ No newline at end of file
diff --git a/Scripts/publish.cmd b/Scripts/publish.cmd
new file mode 100644
index 000000000..557f9ab00
--- /dev/null
+++ b/Scripts/publish.cmd
@@ -0,0 +1,4 @@
+@REM This command build the toolkit, create nuget packages and tries to upload them on nuget.org
+@REM It requires that you have a valid NUGET API key saved on your environment
+build.cmd Pack
+build.cmd Push
\ No newline at end of file
diff --git a/Scripts/purge.cmd b/Scripts/purge.cmd
new file mode 100644
index 000000000..393a8fef0
--- /dev/null
+++ b/Scripts/purge.cmd
@@ -0,0 +1,35 @@
+@echo off
+
+echo You are about to delete the Bin folder; do you want to continue? (Y/N)
+set INPUT=
+set /P INPUT=Type input: %=%
+if /I "%INPUT%"=="y" goto yes
+if /I "%INPUT%"=="n" goto no
+
+:yes
+echo Deleting the 'Bin' folder
+rd /s /q "..\Bin"
+echo Deleted the 'Bin' folder
+echo Deleting the 'Krypton.Docking\obj' folder
+rd /s /q "..\Source\Krypton Components\Krypton.Docking\obj"
+echo Deleted the 'Krypton.Docking\obj' folder
+echo Deleting the 'Krypton.Navigator\obj' folder
+rd /s /q "..\Source\Krypton Components\Krypton.Navigator\obj"
+echo Deleted the 'Krypton.Navigator\obj' folder
+echo Deleting the 'Krypton.Ribbon\obj' folder
+rd /s /q "..\Source\Krypton Components\Krypton.Ribbon\obj"
+echo Deleted the 'Krypton.Ribbon\obj' folder
+echo Deleting the 'Krypton.Toolkit\obj' folder
+rd /s /q "..\Source\Krypton Components\Krypton.Toolkit\obj"
+echo Deleted the 'Krypton.Toolkit\obj' folder
+echo Deleting the 'Krypton.Workspace\obj' folder
+rd /s /q "..\Source\Krypton Components\Krypton.Workspace\obj"
+echo Deleted the 'Krypton.Workspace\obj' folder
+if exist "..\Logs" ( goto deletelogsdirectory ) else echo Directory 'Logs' not found
+
+:deletelogsdirectory
+echo Deleting the 'Logs' directory
+del /f "..\Logs"
+
+:no
+pause
\ No newline at end of file
diff --git a/Scripts/rebuild-build-nightly.cmd b/Scripts/rebuild-build-nightly.cmd
index 6c21f8e40..010454136 100644
--- a/Scripts/rebuild-build-nightly.cmd
+++ b/Scripts/rebuild-build-nightly.cmd
@@ -9,6 +9,7 @@ if exist "%ProgramFiles%\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current
echo "Unable to detect suitable environment. Check if VS 2022 is installed."
pause
+goto exitbatch
:vs17prev
set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin
@@ -39,7 +40,7 @@ for /f "tokens=* usebackq" %%A in (`tzutil /g`) do (
@echo
set targets=Rebuild
if not "%~1" == "" set targets=%~1
-"%msbuildpath%\msbuild.exe" -t:%targets% nightly.proj /fl /flp:logfile=build.log -graphBuild:True
+"%msbuildpath%\msbuild.exe" -t:%targets% nightly.proj /fl /flp:logfile=../Logs/nightly-build-log.log /bl:../Logs/nightly-build-log.binlog /clp:Summary;ShowTimestamp /v:quiet
:: -t:rebuild
@@ -59,4 +60,6 @@ if %answer%==n exit
:run
cd ..
-run.cmd
\ No newline at end of file
+run.cmd
+
+:exitbatch
\ No newline at end of file
diff --git a/Source/.editorconfig b/Source/.editorconfig
index 9707c8228..a4bcaec46 100644
--- a/Source/.editorconfig
+++ b/Source/.editorconfig
@@ -46,8 +46,106 @@ dotnet_diagnostic.CA1822.severity = None
dotnet_diagnostic.CS8073.severity = None
#Warning CS8618 Non-nullable field '_panelMessage' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.
-dotnet_diagnostic.CS8618.severity = None
+dotnet_diagnostic.CS8618.severity = suggestion
#Warning CS8622 Nullability of reference types in type of parameter 'sender' of ####
-dotnet_diagnostic.CS8622.severity = None
-
+dotnet_diagnostic.CS8622.severity = Warning
+csharp_indent_labels = one_less_than_current
+csharp_using_directive_placement = outside_namespace:silent
+csharp_prefer_simple_using_statement = true:suggestion
+csharp_prefer_braces = true:silent
+csharp_style_namespace_declarations = block_scoped:silent
+csharp_style_prefer_method_group_conversion = true:silent
+csharp_style_prefer_top_level_statements = true:silent
+csharp_style_prefer_primary_constructors = true:suggestion
+csharp_prefer_system_threading_lock = true:suggestion
+csharp_style_expression_bodied_methods = false:silent
+csharp_style_expression_bodied_constructors = false:silent
+csharp_style_expression_bodied_operators = false:silent
+csharp_style_expression_bodied_properties = true:silent
+csharp_style_expression_bodied_indexers = true:silent
+csharp_style_expression_bodied_accessors = true:silent
+csharp_style_expression_bodied_lambdas = true:silent
+csharp_style_expression_bodied_local_functions = false:silent
+csharp_style_throw_expression = true:suggestion
+csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
+csharp_style_prefer_tuple_swap = true:suggestion
+csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent
+csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true:silent
+csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent
+csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true:silent
+csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true:silent
+csharp_style_prefer_switch_expression = true:suggestion
+csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
+csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
+dotnet_diagnostic.WFO1000.severity = suggestion
+
+
+[*.{cs,vb}]
+#### Naming styles ####
+
+# Naming rules
+
+dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
+dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
+dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
+
+dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
+dotnet_naming_rule.types_should_be_pascal_case.symbols = types
+dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
+
+dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
+dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
+dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
+
+# Symbol specifications
+
+dotnet_naming_symbols.interface.applicable_kinds = interface
+dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
+dotnet_naming_symbols.interface.required_modifiers =
+
+dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
+dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
+dotnet_naming_symbols.types.required_modifiers =
+
+dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
+dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
+dotnet_naming_symbols.non_field_members.required_modifiers =
+
+# Naming styles
+
+dotnet_naming_style.begins_with_i.required_prefix = I
+dotnet_naming_style.begins_with_i.required_suffix =
+dotnet_naming_style.begins_with_i.word_separator =
+dotnet_naming_style.begins_with_i.capitalization = pascal_case
+
+dotnet_naming_style.pascal_case.required_prefix =
+dotnet_naming_style.pascal_case.required_suffix =
+dotnet_naming_style.pascal_case.word_separator =
+dotnet_naming_style.pascal_case.capitalization = pascal_case
+
+dotnet_naming_style.pascal_case.required_prefix =
+dotnet_naming_style.pascal_case.required_suffix =
+dotnet_naming_style.pascal_case.word_separator =
+dotnet_naming_style.pascal_case.capitalization = pascal_case
+dotnet_style_operator_placement_when_wrapping = beginning_of_line
+tab_width = 4
+indent_size = 4
+end_of_line = crlf
+dotnet_style_coalesce_expression = true:suggestion
+dotnet_style_null_propagation = true:suggestion
+dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
+dotnet_style_prefer_auto_properties = true:silent
+dotnet_style_object_initializer = true:suggestion
+dotnet_style_prefer_conditional_expression_over_assignment = true:silent
+dotnet_style_prefer_conditional_expression_over_return = true:silent
+dotnet_style_predefined_type_for_locals_parameters_members = true:silent
+dotnet_style_predefined_type_for_member_access = true:silent
+dotnet_style_allow_multiple_blank_lines_experimental = true:silent
+dotnet_style_allow_statement_immediately_after_block_experimental = true:silent
+dotnet_style_qualification_for_field = false:silent
+dotnet_style_qualification_for_property = false:silent
+dotnet_style_qualification_for_method = false:silent
+dotnet_style_collection_initializer = true:suggestion
+dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
+dotnet_style_qualification_for_event = false:silent
diff --git a/Source/Krypton Components/Directory.Build.props b/Source/Krypton Components/Directory.Build.props
index e1a3ad266..48fd53e8b 100644
--- a/Source/Krypton Components/Directory.Build.props
+++ b/Source/Krypton Components/Directory.Build.props
@@ -1,12 +1,18 @@
+
+
+
+ preview
+
+
true
en
Phil Wright (A.K.A ComponentFactory), Peter Wagner (A.K.A Wagnerp) and Simon Coghlan (A.K.A Smurf-IV)
- © Component Factory Pty Ltd, 2006 - 2016. Then modifications by Peter Wagner (aka Wagnerp) and Simon Coghlan (aka Smurf-IV) 2017 - 2023. All rights reserved.
+ © Component Factory Pty Ltd, 2006 - 2016. Then modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac and Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
@@ -36,12 +42,14 @@
https://github.com/Krypton-Suite/Standard-Toolkit
Krypton Canary.png
- Peter William Wagner & Simon Coghlan & Thomas Bolon
+ Peter William Wagner & Simon Coghlan & Giduac & Ahmed Abdelhameed & Thomas Bolon
License.md
True
Krypton ComponentFactory WinForms Themes Controls DataGrid Ribbon Workspace Tabs .NET Toolkit
Get updates here: https://github.com/Krypton-Suite/Standard-Toolkit
https://github.com/Krypton-Suite/Standard-Toolkit
+ true
+ true
@@ -66,12 +74,14 @@
https://github.com/Krypton-Suite/Standard-Toolkit
Krypton Nightly.png
- Peter William Wagner & Simon Coghlan & Thomas Bolon
+ Peter William Wagner & Simon Coghlan & Giduac & Ahmed Abdelhameed & Thomas Bolon
License.md
True
Krypton ComponentFactory WinForms Themes Controls DataGrid Ribbon Workspace Tabs .Net Toolkit
Get updates here: https://github.com/Krypton-Suite/Standard-Toolkit
https://github.com/Krypton-Suite/Standard-Toolkit
+ true
+ true
@@ -99,13 +109,15 @@
https://github.com/Krypton-Suite/Standard-Toolkit
Krypton Stable.png
- Peter William Wagner & Simon Coghlan & Thomas Bolon
+ Peter William Wagner & Simon Coghlan & Giduac & Ahmed Abdelhameed & Thomas Bolon
License.md
README.md
True
Krypton ComponentFactory WinForms Themes Controls DataGrid Ribbon Workspace Tabs .NET Toolkit
Get updates here: https://github.com/Krypton-Suite/Standard-Toolkit
https://github.com/Krypton-Suite/Standard-Toolkit
+ true
+ true
diff --git a/Source/Krypton Components/Directory.Build.targets b/Source/Krypton Components/Directory.Build.targets
index 6321644e4..64ab48f97 100644
--- a/Source/Krypton Components/Directory.Build.targets
+++ b/Source/Krypton Components/Directory.Build.targets
@@ -11,21 +11,21 @@
$([System.DateTime]::Now.get_DayOfYear().ToString())
- 80.$(Minor).$(Build).$(Revision)
+ 90.$(Minor).$(Build).$(Revision)
- 80.$(Minor).$(Build).$(Revision)-beta
+ 90.$(Minor).$(Build).$(Revision)-beta
- 80.$(Minor).$(Build).$(Revision)
+ 90.$(Minor).$(Build).$(Revision)
- 80.$(Minor).$(Build).$(Revision)
+ 90.$(Minor).$(Build).$(Revision)
preview
@@ -44,21 +44,21 @@
$([System.DateTime]::Now.get_DayOfYear().ToString())
- 80.$(Minor).$(Build).$(Revision)
+ 90.$(Minor).$(Build).$(Revision)
- 80.$(Minor).$(Build).$(Revision)-alpha
+ 90.$(Minor).$(Build).$(Revision)-alpha
- 80.$(Minor).$(Build).$(Revision)
+ 90.$(Minor).$(Build).$(Revision)
- 80.$(Minor).$(Build).$(Revision)
+ 90.$(Minor).$(Build).$(Revision)
preview
@@ -77,19 +77,19 @@
$([System.DateTime]::Now.get_DayOfYear().ToString())
- 80.$(Minor).$(Build).$(Revision)
+ 90.$(Minor).$(Build).$(Revision)
- 80.$(Minor).$(Build).$(Revision)
+ 90.$(Minor).$(Build).$(Revision)
- 80.$(Minor).$(Build).$(Revision)
+ 90.$(Minor).$(Build).$(Revision)
- 80.$(Minor).$(Build).$(Revision)
+ 90.$(Minor).$(Build).$(Revision)
preview
@@ -103,20 +103,20 @@
$([System.DateTime]::Now.get_DayOfYear().ToString())
- 80.$(Minor).$(Build).$(Revision)
+ 90.$(Minor).$(Build).$(Revision)
- 80.$(Minor).$(Build).$(Revision)
+ 90.$(Minor).$(Build).$(Revision)
- 80.$(Minor).$(Build).$(Revision)
+ 90.$(Minor).$(Build).$(Revision)
- 80.$(Minor).$(Build).$(Revision)
+ 90.$(Minor).$(Build).$(Revision)
preview
@@ -130,7 +130,7 @@
true
en
Peter Wagner (A.K.A Wagnerp) and Simon Coghlan (A.K.A Smurf-IV), Phil Wright (A.K.A ComponentFactory)
- © Krypton Suite (Peter Wagner (Wagnerp) and Simon Coghlan (Smurf-IV)), 2017 - 2023. Component Factory Pty Ltd (Phil Wright), 2006 - 2016. All rights reserved.
+ © Krypton Suite (Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac and Ahmed Abdelhameed) 2017 - 2024. Component Factory Pty Ltd (Phil Wright), 2006 - 2016. All rights reserved.
@@ -139,7 +139,7 @@
$(PackageId).Canary
- An update to Component factory's krypton toolkit to support .NET Framework 4.6.2 - 4.8.1 and .NET 6 - 8. $(Description) This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1 and .NET 6 - 7. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the standard toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Standard/Krypton-Toolkit-Suite-Standard-Modules.md To find out what's new, please visit: https://github.com/Krypton-Suite/Standard-Toolkit/blob/canary/Documents/Help/Changelog.md This package is for those who want to try out the latest features before deployment.
+ An update to Component factory's krypton toolkit to support .NET Framework 4.6.2 - 4.8.1 and .NET 8 - 9. $(Description) This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1 and .NET 8 - 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the standard toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Standard/Krypton-Toolkit-Suite-Standard-Modules.md To find out what's new, please visit: https://github.com/Krypton-Suite/Standard-Toolkit/blob/canary/Documents/Help/Changelog.md This package is for those who want to try out the latest features before deployment.
@@ -147,7 +147,7 @@
$(PackageId).Nightly
- An update to Component factory's krypton toolkit to support .NET Framework 4.6.2 - 4.8.1 and .NET 6 - 8. $(Description) This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1 and .NET 6 - 7. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the standard toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Standard/Krypton-Toolkit-Suite-Standard-Modules.md To find out what's new, please visit: https://github.com/Krypton-Suite/Standard-Toolkit/blob/alpha/Documents/Help/Changelog.md This package is for those who want to try out the latest cutting edge features before deployment.
+ An update to Component factory's krypton toolkit to support .NET Framework 4.6.2 - 4.8.1 and .NET 8 - 9. $(Description) This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1 and .NET 8 - 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the standard toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Standard/Krypton-Toolkit-Suite-Standard-Modules.md To find out what's new, please visit: https://github.com/Krypton-Suite/Standard-Toolkit/blob/alpha/Documents/Help/Changelog.md This package is for those who want to try out the latest cutting edge features before deployment.
@@ -155,17 +155,17 @@
$(PackageId).Installer
- An update to Component factory's krypton toolkit to support .NET Framework 4.6.2 - 4.8.1 and .NET 6 - 8. $(Description) This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1 and .NET 6 - 7. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the standard toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Standard/Krypton-Toolkit-Suite-Standard-Modules.md To find out what's new, please visit: https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/Documents/Help/Changelog.md FOR USE WITH DEMO INSTALLERS ONLY!
+ An update to Component factory's krypton toolkit to support .NET Framework 4.6.2 - 4.8.1 and .NET 8 - 9. $(Description) This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1 and .NET 8 - 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the standard toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Standard/Krypton-Toolkit-Suite-Standard-Modules.md To find out what's new, please visit: https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/Documents/Help/Changelog.md FOR USE WITH DEMO INSTALLERS ONLY!
$(PackageId).Lite
- An update to Component factory's krypton toolkit to support .NET Framework 4.8 - 4.8.1 and .NET 6 - 8. $(Description) This package supports all .NET Framework versions starting .NET Framework 4.8 - 4.8.1, .NET 6 - 8. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the standard toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Standard/Krypton-Toolkit-Suite-Standard-Modules.md To find out what's new, please visit: https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/Documents/Help/Changelog.md
+ An update to Component factory's krypton toolkit to support .NET Framework 4.8 - 4.8.1 and .NET 8 - 9. $(Description) This package supports all .NET Framework versions starting .NET Framework 4.8 - 4.8.1, .NET 6 - 8. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the standard toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Standard/Krypton-Toolkit-Suite-Standard-Modules.md To find out what's new, please visit: https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/Documents/Help/Changelog.md
$(PackageId)
- An update to Component factory's krypton toolkit to support .NET Framework 4.6.2 - 4.8.1 and .NET 6 - 8. $(Description) This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1 and .NET 6 - 7. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the standard toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Standard/Krypton-Toolkit-Suite-Standard-Modules.md
+ An update to Component factory's krypton toolkit to support .NET Framework 4.6.2 - 4.8.1 and .NET 8 - 9. $(Description) This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1 and .NET 8 - 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the standard toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Standard/Krypton-Toolkit-Suite-Standard-Modules.md
diff --git a/Source/Krypton Components/Krypton Toolkit Suite 2022 - VS2022.sln b/Source/Krypton Components/Krypton Toolkit Suite 2022 - VS2022.sln
index ccbb273b7..6fc7a0ea0 100644
--- a/Source/Krypton Components/Krypton Toolkit Suite 2022 - VS2022.sln
+++ b/Source/Krypton Components/Krypton Toolkit Suite 2022 - VS2022.sln
@@ -6,6 +6,9 @@ MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{56F1A41E-584B-4F91-9E98-7D8BF678210C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build System", "Build System", "{511519DD-C887-40E5-8961-658AE4CA5D46}"
+ ProjectSection(SolutionItems) = preProject
+ ..\.editorconfig = ..\.editorconfig
+ EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Documentation", "Documentation", "{405E4318-4C8A-4DC7-B624-8F7097CDFF60}"
ProjectSection(SolutionItems) = preProject
@@ -21,7 +24,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Development", "Development"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Help", "Help", "{C2B58A1A-4451-4A21-8487-14DBA720672D}"
ProjectSection(SolutionItems) = preProject
- ..\..\Documents\Help\Changelog.md = ..\..\Documents\Help\Changelog.md
..\..\Documents\Help\Designer-Fix.md = ..\..\Documents\Help\Designer-Fix.md
EndProjectSection
EndProject
@@ -30,6 +32,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configurat
..\.editorconfig = ..\.editorconfig
..\..\.gitattributes = ..\..\.gitattributes
..\..\.gitignore = ..\..\.gitignore
+ Krypton Toolkit Suite 2022 - VS2022.sln.DotSettings = Krypton Toolkit Suite 2022 - VS2022.sln.DotSettings
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Source", "Source", "{950EE50E-C0E8-4A28-96D3-4735F5313610}"
@@ -111,6 +114,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Issue Templates", "Issue Te
..\..\.github\ISSUE_TEMPLATE\post-a-question.md = ..\..\.github\ISSUE_TEMPLATE\post-a-question.md
EndProjectSection
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ChangeLog", "ChangeLog", "{F0BC3940-BAC0-40B9-AECB-2FC752486AD5}"
+ ProjectSection(SolutionItems) = preProject
+ ..\..\Documents\Changelog\Changelog.md = ..\..\Documents\Changelog\Changelog.md
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Canary|Any CPU = Canary|Any CPU
@@ -204,6 +212,7 @@ Global
{CAB40818-55B1-4E1D-AD8E-C94642EA5124} = {56F1A41E-584B-4F91-9E98-7D8BF678210C}
{FB5BC976-FCC7-4729-9331-C2420DE7ADB6} = {405E4318-4C8A-4DC7-B624-8F7097CDFF60}
{40B83627-BD68-488E-ACB0-5B83D0A8B69C} = {FB5BC976-FCC7-4729-9331-C2420DE7ADB6}
+ {F0BC3940-BAC0-40B9-AECB-2FC752486AD5} = {405E4318-4C8A-4DC7-B624-8F7097CDFF60}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C8204ACC-48AA-49AC-8236-6E9C162EC2FA}
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 5eac504b5..0cffb121a 100644
--- a/Source/Krypton Components/Krypton Toolkit Suite 2022 - VS2022.sln.DotSettings
+++ b/Source/Krypton Components/Krypton Toolkit Suite 2022 - VS2022.sln.DotSettings
@@ -1,10 +1,20 @@

DC
+ DTP
MI
PI
QAT
+ UAC
<Policy Inspect="True" Prefix="" Suffix="" Style="AA_BB" />
<Policy Inspect="False" Prefix="" Suffix="" Style="AaBb" />
+ <Policy><Descriptor Staticness="Instance" AccessRightKinds="Protected, ProtectedInternal, Internal, Public, PrivateProtected" Description="Instance fields (not private)"><ElementKinds><Kind Name="FIELD" /><Kind Name="READONLY_FIELD" /></ElementKinds></Descriptor><Policy Inspect="False" Prefix="" Suffix="" Style="AaBb" /></Policy>
+ <Policy><Descriptor Staticness="Static" AccessRightKinds="Protected, ProtectedInternal, Internal, Public, PrivateProtected" Description="Static fields (not private)"><ElementKinds><Kind Name="FIELD" /></ElementKinds></Descriptor><Policy Inspect="False" Prefix="" Suffix="" Style="AaBb" /></Policy>
+ <Policy><Descriptor Staticness="Any" AccessRightKinds="Any" Description="Local constants"><ElementKinds><Kind Name="LOCAL_CONSTANT" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AA_BB" /></Policy>
+ True
+ True
+ True
+ True
+ True
True
True
True
diff --git a/Source/Krypton Components/Krypton.Docking/Control Docking/KryptonAutoHiddenGroup.cs b/Source/Krypton Components/Krypton.Docking/Control Docking/KryptonAutoHiddenGroup.cs
index 620981d59..10c31f907 100644
--- a/Source/Krypton Components/Krypton.Docking/Control Docking/KryptonAutoHiddenGroup.cs
+++ b/Source/Krypton Components/Krypton.Docking/Control Docking/KryptonAutoHiddenGroup.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Control Docking/KryptonAutoHiddenPanel.cs b/Source/Krypton Components/Krypton.Docking/Control Docking/KryptonAutoHiddenPanel.cs
index aefd1b022..a721ae5ff 100644
--- a/Source/Krypton Components/Krypton.Docking/Control Docking/KryptonAutoHiddenPanel.cs
+++ b/Source/Krypton Components/Krypton.Docking/Control Docking/KryptonAutoHiddenPanel.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Control Docking/KryptonAutoHiddenProxyPage.cs b/Source/Krypton Components/Krypton.Docking/Control Docking/KryptonAutoHiddenProxyPage.cs
index 64aed4199..61205d3d5 100644
--- a/Source/Krypton Components/Krypton.Docking/Control Docking/KryptonAutoHiddenProxyPage.cs
+++ b/Source/Krypton Components/Krypton.Docking/Control Docking/KryptonAutoHiddenProxyPage.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -32,6 +32,10 @@ public KryptonAutoHiddenProxyPage(KryptonPage page)
// Text property was updated by the base class constructor, so now we update the actual referenced class
Page.Text = Text;
+
+ // Fix for 822: https://github.com/Krypton-Suite/Standard-Toolkit/issues/822#issuecomment-2228211126
+
+ Visible = page.Visible;
}
///
diff --git a/Source/Krypton Components/Krypton.Docking/Control Docking/KryptonAutoHiddenSlidePanel.cs b/Source/Krypton Components/Krypton.Docking/Control Docking/KryptonAutoHiddenSlidePanel.cs
index 1adc10190..a36ed0002 100644
--- a/Source/Krypton Components/Krypton.Docking/Control Docking/KryptonAutoHiddenSlidePanel.cs
+++ b/Source/Krypton Components/Krypton.Docking/Control Docking/KryptonAutoHiddenSlidePanel.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -121,21 +121,21 @@ public KryptonAutoHiddenSlidePanel(Control control, DockingEdge edge, KryptonAut
_edge = edge;
_panel = panel;
_state = DockingAutoHiddenShowState.Hidden;
- _checkMakeHidden = OnCheckMakeHidden!;
+ _checkMakeHidden = OnCheckMakeHidden;
// We need to a timer to automate sliding in and out
_slideTimer = new Timer
{
Interval = SLIDE_INTERVAL
};
- _slideTimer.Tick += OnSlideTimerTick!;
+ _slideTimer.Tick += OnSlideTimerTick;
// Timer used to delay between notification of need to slide inwards and performing actual slide
_dismissTimer = new Timer
{
Interval = DISMISS_INTERVAL
};
- _dismissTimer.Tick += OnDismissTimerTick!;
+ _dismissTimer.Tick += OnDismissTimerTick;
_dismissRunning = false;
// Create inner panel that holds the actual dockspace and separator
@@ -144,14 +144,14 @@ public KryptonAutoHiddenSlidePanel(Control control, DockingEdge edge, KryptonAut
Dock = DockStyle.Fill,
AutoHiddenHost = true
};
- _dockspaceSlide.PageCloseClicked += OnDockspacePageCloseClicked!;
- _dockspaceSlide.PageAutoHiddenClicked += OnDockspacePageAutoHiddenClicked!;
- _dockspaceSlide.PageDropDownClicked += OnDockspacePageDropDownClicked!;
+ _dockspaceSlide.PageCloseClicked += OnDockspacePageCloseClicked;
+ _dockspaceSlide.PageAutoHiddenClicked += OnDockspacePageAutoHiddenClicked;
+ _dockspaceSlide.PageDropDownClicked += OnDockspacePageDropDownClicked;
SeparatorControl = new KryptonDockspaceSeparator(edge, true);
- SeparatorControl.SplitterMoving += OnDockspaceSeparatorMoving!;
- SeparatorControl.SplitterMoved += OnDockspaceSeparatorMoved!;
- SeparatorControl.SplitterMoveRect += OnDockspaceSeparatorMoveRect!;
+ SeparatorControl.SplitterMoving += OnDockspaceSeparatorMoving;
+ SeparatorControl.SplitterMoved += OnDockspaceSeparatorMoved;
+ SeparatorControl.SplitterMoveRect += OnDockspaceSeparatorMoveRect;
_inner = new KryptonPanel();
_inner.Controls.AddRange(new Control[] { _dockspaceSlide, SeparatorControl });
@@ -169,7 +169,7 @@ public KryptonAutoHiddenSlidePanel(Control control, DockingEdge edge, KryptonAut
Controls.Add(_dummyTarget);
// Add ourselves into the target control for docking
- control.SizeChanged += OnControlSizeChanged!;
+ control.SizeChanged += OnControlSizeChanged;
control.Controls.Add(this);
// Need to peek at windows messages, so we can determine if mouse is over the slide out panel
@@ -211,13 +211,13 @@ protected override void Dispose(bool disposing)
_dockspaceSlide.ClearAllPages();
// Unhook from events/static references to allow garbage collection
- SeparatorControl.SplitterMoving -= OnDockspaceSeparatorMoving!;
- SeparatorControl.SplitterMoved -= OnDockspaceSeparatorMoved!;
- SeparatorControl.SplitterMoveRect -= OnDockspaceSeparatorMoveRect!;
- _dockspaceSlide.CellLosesFocus -= OnDockspaceCellLosesFocus!;
- _dockspaceSlide.PageCloseClicked -= OnDockspacePageCloseClicked!;
- _dockspaceSlide.PageAutoHiddenClicked -= OnDockspacePageAutoHiddenClicked!;
- _dockspaceSlide.PageDropDownClicked -= OnDockspacePageDropDownClicked!;
+ SeparatorControl.SplitterMoving -= OnDockspaceSeparatorMoving;
+ SeparatorControl.SplitterMoved -= OnDockspaceSeparatorMoved;
+ SeparatorControl.SplitterMoveRect -= OnDockspaceSeparatorMoveRect;
+ _dockspaceSlide.CellLosesFocus -= OnDockspaceCellLosesFocus;
+ _dockspaceSlide.PageCloseClicked -= OnDockspacePageCloseClicked;
+ _dockspaceSlide.PageAutoHiddenClicked -= OnDockspacePageAutoHiddenClicked;
+ _dockspaceSlide.PageDropDownClicked -= OnDockspacePageDropDownClicked;
Application.RemoveMessageFilter(this);
}
@@ -246,7 +246,7 @@ protected override void Dispose(bool disposing)
///
/// Gets and sets the drag page notify interface associated with the embedded dockspace.
///
- public IDragPageNotify DragPageNotify
+ public IDragPageNotify? DragPageNotify
{
get => _dockspaceSlide.DragPageNotify;
set => _dockspaceSlide.DragPageNotify = value;
@@ -308,7 +308,7 @@ public void SlideOut(KryptonPage? page, KryptonAutoHiddenGroup group, bool selec
if (select)
{
DockspaceControl.Select();
- DockspaceControl.CellLosesFocus += OnDockspaceCellLosesFocus!;
+ DockspaceControl.CellLosesFocus += OnDockspaceCellLosesFocus;
}
return;
}
@@ -328,7 +328,7 @@ public void SlideOut(KryptonPage? page, KryptonAutoHiddenGroup group, bool selec
if (select)
{
DockspaceControl.Select();
- DockspaceControl.CellLosesFocus += OnDockspaceCellLosesFocus!;
+ DockspaceControl.CellLosesFocus += OnDockspaceCellLosesFocus;
}
return;
}
@@ -365,7 +365,7 @@ public void SlideOut(KryptonPage? page, KryptonAutoHiddenGroup group, bool selec
CalculateStartAndEnd();
// Set initial positions of ourselves and the contained inner panel
- _inner.SetBounds(0, 0, _endRect.Width, _endRect.Height);
+ _inner!.SetBounds(0, 0, _endRect.Width, _endRect.Height);
SetBounds(_startRect.X, _startRect.Y, _startRect.Width, _startRect.Height);
// Make sure we are at the top of the z-order and visible
@@ -381,7 +381,7 @@ public void SlideOut(KryptonPage? page, KryptonAutoHiddenGroup group, bool selec
if (select)
{
DockspaceControl.Select();
- DockspaceControl.CellLosesFocus += OnDockspaceCellLosesFocus!;
+ DockspaceControl.CellLosesFocus += OnDockspaceCellLosesFocus;
}
// Raises event to indicate change in auto hidden showing state
@@ -432,7 +432,7 @@ public void UpdateSize(int width, int height)
{
case DockingEdge.Left:
_endRect.Width += width;
- _inner.SetBounds(0, 0, _inner.Width + width, _inner.Height);
+ _inner!.SetBounds(0, 0, _inner.Width + width, _inner.Height);
SetBounds(Left, Top, Width + width, Height);
// Update the page with the new size to use in the future
@@ -448,7 +448,7 @@ public void UpdateSize(int width, int height)
case DockingEdge.Right:
_endRect.X += width;
_endRect.Width -= width;
- _inner.SetBounds(0, 0, _inner.Width - width, _inner.Height);
+ _inner!.SetBounds(0, 0, _inner.Width - width, _inner.Height);
SetBounds(Left + width, Top, Width - width, Height);
// Update the page with the new size to use in the future
@@ -463,7 +463,7 @@ public void UpdateSize(int width, int height)
break;
case DockingEdge.Top:
_endRect.Height += width;
- _inner.SetBounds(0, 0, _inner.Width, _inner.Height + height);
+ _inner!.SetBounds(0, 0, _inner.Width, _inner.Height + height);
SetBounds(Left, Top, Width, Height + height);
// Update the page with the new size to use in the future
@@ -479,7 +479,7 @@ public void UpdateSize(int width, int height)
case DockingEdge.Bottom:
_endRect.Y += height;
_endRect.Height -= height;
- _inner.SetBounds(0, 0, _inner.Width, _inner.Height - height);
+ _inner!.SetBounds(0, 0, _inner.Width, _inner.Height - height);
SetBounds(Left, Top + height, Width, Height - height);
// Update the page with the new size to use in the future
@@ -653,7 +653,7 @@ private void MakeHidden()
// If the dockspace has the focus we need to push focus elsewhere
if (DockspaceControl.ContainsFocus)
{
- DockspaceControl.CellLosesFocus -= OnDockspaceCellLosesFocus!;
+ DockspaceControl.CellLosesFocus -= OnDockspaceCellLosesFocus;
_dummyTarget.Select();
}
@@ -679,7 +679,7 @@ private void MakeSlideIn()
// If the dockspace has the focus we need to push focus elsewhere
if (DockspaceControl.ContainsFocus)
{
- DockspaceControl.CellLosesFocus -= OnDockspaceCellLosesFocus!;
+ DockspaceControl.CellLosesFocus -= OnDockspaceCellLosesFocus;
_dummyTarget.Select();
}
@@ -691,7 +691,7 @@ private void MakeSlideIn()
private void CalculateStartAndEnd()
{
// Find the preferred size of the slider area by combining the separator and dockspace
- Size dockspacePreferred = Page.AutoHiddenSlideSize;
+ Size dockspacePreferred = Page!.AutoHiddenSlideSize;
Size separatorPreferred = SeparatorControl.GetPreferredSize(_control.Size);
var slideSize = new Size(separatorPreferred.Width + dockspacePreferred.Width,
separatorPreferred.Height + dockspacePreferred.Height);
@@ -758,7 +758,7 @@ private void ResetChildIndex()
_control.Controls.SetChildIndex(this, panelIndex);
}
- private void OnCheckMakeHidden(object sender, EventArgs e)
+ private void OnCheckMakeHidden(object? sender, EventArgs e)
{
// Do we still need to make ourselves hidden?
if (!ContainsFocus)
@@ -767,7 +767,7 @@ private void OnCheckMakeHidden(object sender, EventArgs e)
}
}
- private void OnSlideTimerTick(object sender, EventArgs e)
+ private void OnSlideTimerTick(object? sender, EventArgs e)
{
// Check to see if we allowed to perform operations
if (Disposing || IsDisposed)
@@ -796,7 +796,7 @@ private void OnSlideTimerTick(object sender, EventArgs e)
var finished = true;
Size newSlideSize = Size;
Point newSlideLocation = Location;
- Point newInnerLocation = _inner.Location;
+ Point newInnerLocation = _inner!.Location;
// Find the new size and location when sliding out from the edge
switch (_edge)
@@ -842,7 +842,7 @@ private void OnSlideTimerTick(object sender, EventArgs e)
var finished = true;
Size newSlideSize = Size;
Point newSlideLocation = Location;
- Point newInnerLocation = _inner.Location;
+ Point newInnerLocation = _inner!.Location;
// Find the new size and location when sliding inwards to the edge
switch (_edge)
@@ -882,7 +882,7 @@ private void OnSlideTimerTick(object sender, EventArgs e)
}
}
- private void OnDismissTimerTick(object sender, EventArgs e)
+ private void OnDismissTimerTick(object? sender, EventArgs e)
{
// Check to see if we allowed to perform operations
if (Disposing || IsDisposed)
@@ -923,7 +923,7 @@ private void OnDismissTimerTick(object sender, EventArgs e)
}
}
- private void OnDockspaceCellLosesFocus(object sender, WorkspaceCellEventArgs e)
+ private void OnDockspaceCellLosesFocus(object? sender, WorkspaceCellEventArgs e)
{
// Check to see if we allowed to perform operations
if (Disposing || IsDisposed)
@@ -932,7 +932,7 @@ private void OnDockspaceCellLosesFocus(object sender, WorkspaceCellEventArgs e)
}
// No longer need the lost focus because we have been notified
- DockspaceControl.CellLosesFocus -= OnDockspaceCellLosesFocus!;
+ DockspaceControl.CellLosesFocus -= OnDockspaceCellLosesFocus;
// Action depends on the current state
switch (_state)
@@ -949,15 +949,15 @@ private void OnDockspaceCellLosesFocus(object sender, WorkspaceCellEventArgs e)
}
}
- private void OnControlSizeChanged(object sender, EventArgs e) =>
+ private void OnControlSizeChanged(object? sender, EventArgs e) =>
// Change in parent control size means we always hide
MakeHidden();
- private void OnDockspaceSeparatorMoving(object sender, SplitterCancelEventArgs e) => SplitterMoving?.Invoke(sender, e);
+ private void OnDockspaceSeparatorMoving(object? sender, SplitterCancelEventArgs e) => SplitterMoving?.Invoke(sender, e);
- private void OnDockspaceSeparatorMoved(object sender, SplitterEventArgs e) => SplitterMoved?.Invoke(sender, e);
+ private void OnDockspaceSeparatorMoved(object? sender, SplitterEventArgs e) => SplitterMoved?.Invoke(sender, e);
- private void OnDockspaceSeparatorMoveRect(object sender, SplitterMoveRectMenuArgs e)
+ private void OnDockspaceSeparatorMoveRect(object? sender, SplitterMoveRectMenuArgs e)
{
if (!_dockspaceSlide.ContainsFocus)
{
@@ -968,11 +968,11 @@ private void OnDockspaceSeparatorMoveRect(object sender, SplitterMoveRectMenuArg
SplitterMoveRect?.Invoke(sender, e);
}
- private void OnDockspacePageCloseClicked(object sender, UniqueNameEventArgs e) => PageCloseClicked?.Invoke(sender, e);
+ private void OnDockspacePageCloseClicked(object? sender, UniqueNameEventArgs e) => PageCloseClicked?.Invoke(sender, e);
- private void OnDockspacePageAutoHiddenClicked(object sender, UniqueNameEventArgs e) => PageAutoHiddenClicked?.Invoke(sender, e);
+ private void OnDockspacePageAutoHiddenClicked(object? sender, UniqueNameEventArgs e) => PageAutoHiddenClicked?.Invoke(sender, e);
- private void OnDockspacePageDropDownClicked(object sender, CancelDropDownEventArgs e)
+ private void OnDockspacePageDropDownClicked(object? sender, CancelDropDownEventArgs e)
{
// Click the drop-down button should cause the slide out to be focused so that it
// does not slide back again if you move the mouse away from the slide out area
diff --git a/Source/Krypton Components/Krypton.Docking/Control Docking/KryptonDockableNavigator.cs b/Source/Krypton Components/Krypton.Docking/Control Docking/KryptonDockableNavigator.cs
index cdea7f9cc..cbe15eafa 100644
--- a/Source/Krypton Components/Krypton.Docking/Control Docking/KryptonDockableNavigator.cs
+++ b/Source/Krypton Components/Krypton.Docking/Control Docking/KryptonDockableNavigator.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -65,7 +65,7 @@ private void OnPagesInserting(object sender, TypedCollectionEventArgs UpdateCellSettings();
+ private void OnFloatspaceCellVisibleCountChanged(object? sender, EventArgs e) => UpdateCellSettings();
- private void OnTabVisibleCountChanged(object sender, EventArgs e) => UpdateCellSettings();
+ private void OnTabVisibleCountChanged(object? sender, EventArgs e) => UpdateCellSettings();
- private void OnFloatspaceCellAdding(object sender, WorkspaceCellEventArgs e)
+ private void OnFloatspaceCellAdding(object? sender, WorkspaceCellEventArgs e)
{
e.Cell.TabVisibleCountChanged += OnTabVisibleCountChanged;
var childMinSize = e.Cell.GetMinSize();
@@ -229,9 +229,9 @@ private void OnFloatspaceCellAdding(object sender, WorkspaceCellEventArgs e)
Math.Max(MinimumSize.Height, childMinSize.Height) + 20);
}
- private void OnFloatspaceCellRemoved(object sender, WorkspaceCellEventArgs e) => e.Cell.TabVisibleCountChanged -= OnTabVisibleCountChanged;
+ private void OnFloatspaceCellRemoved(object? sender, WorkspaceCellEventArgs e) => e.Cell.TabVisibleCountChanged -= OnTabVisibleCountChanged;
- private void OnLayoutWorkspace(object sender, EventArgs e) => FloatspaceControl?.PerformNeedPaint(true);
+ private void OnLayoutWorkspace(object? sender, EventArgs e) => FloatspaceControl?.PerformNeedPaint(true);
private void UpdateCellSettings()
{
diff --git a/Source/Krypton Components/Krypton.Docking/Control Docking/KryptonFloatspace.cs b/Source/Krypton Components/Krypton.Docking/Control Docking/KryptonFloatspace.cs
index 7f46e6de9..d08c222e8 100644
--- a/Source/Krypton Components/Krypton.Docking/Control Docking/KryptonFloatspace.cs
+++ b/Source/Krypton Components/Krypton.Docking/Control Docking/KryptonFloatspace.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Control Docking/KryptonSpace.cs b/Source/Krypton Components/Krypton.Docking/Control Docking/KryptonSpace.cs
index 8f11c7922..b92a268d1 100644
--- a/Source/Krypton Components/Krypton.Docking/Control Docking/KryptonSpace.cs
+++ b/Source/Krypton Components/Krypton.Docking/Control Docking/KryptonSpace.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -294,9 +294,9 @@ public override void WritePageElement(XmlWriter xmlWriter, KryptonPage page)
// Add recreated page to the looking dictionary
if (!string.IsNullOrWhiteSpace(page?.UniqueName)
- && !existingPages.ContainsKey(page.UniqueName))
+ && !existingPages.ContainsKey(page?.UniqueName!))
{
- existingPages.Add(page.UniqueName, page);
+ existingPages.Add(page?.UniqueName!, page!);
}
}
}
@@ -319,7 +319,7 @@ public override void WritePageElement(XmlWriter xmlWriter, KryptonPage page)
// Read past the page start element
if (!xmlReader.Read())
{
- throw new ArgumentException(@"An element was expected but could not be read in.", nameof(xmlReader));
+ throw new ArgumentException(@"An element was expected, but could not be read in.", nameof(xmlReader));
}
return page;
@@ -505,7 +505,7 @@ protected virtual void UpdateCellActions(KryptonWorkspaceCell cell, CachedCellSt
KryptonContextMenu = new KryptonContextMenu()
};
cellState.DropDownButtonSpec.KryptonContextMenu.Opening += OnCellDropDownOpening;
- cell.Button.ButtonSpecs.Add(cellState.DropDownButtonSpec);
+ cell.Button.ButtonSpecs?.Add(cellState.DropDownButtonSpec);
}
cellState.DropDownButtonSpec.Visible = cell.SelectedPage != null &&
@@ -524,7 +524,7 @@ protected virtual void UpdateCellActions(KryptonWorkspaceCell cell, CachedCellSt
ToolTipTitle = PinTooltip
};
cellState.PinButtonSpec.Click += OnCellAutoHiddenAction;
- cell.Button.ButtonSpecs.Add(cellState.PinButtonSpec);
+ cell.Button.ButtonSpecs?.Add(cellState.PinButtonSpec);
}
if (cell.SelectedPage == null)
@@ -550,7 +550,7 @@ protected virtual void UpdateCellActions(KryptonWorkspaceCell cell, CachedCellSt
ToolTipTitle = CloseTooltip
};
cellState.CloseButtonSpec.Click += OnCellCloseAction;
- cell.Button.ButtonSpecs.Add(cellState.CloseButtonSpec);
+ cell.Button.ButtonSpecs?.Add(cellState.CloseButtonSpec);
}
cellState.CloseButtonSpec.Visible = cell.SelectedPage != null &&
@@ -560,19 +560,19 @@ protected virtual void UpdateCellActions(KryptonWorkspaceCell cell, CachedCellSt
#endregion
#region Implementation
- private void FocusMonitorControl(Control c, bool adding)
+ private void FocusMonitorControl(Control? c, bool adding)
{
// Hook/Unhook this control
if (adding)
{
- c.GotFocus += OnFocusChanged;
+ c!.GotFocus += OnFocusChanged;
c.LostFocus += OnFocusChanged;
c.ControlAdded += OnFocusControlAdded;
c.ControlRemoved += OnFocusControlRemoved;
}
else
{
- c.GotFocus -= OnFocusChanged;
+ c!.GotFocus -= OnFocusChanged;
c.LostFocus -= OnFocusChanged;
c.ControlAdded -= OnFocusControlAdded;
c.ControlRemoved -= OnFocusControlRemoved;
@@ -585,15 +585,15 @@ private void FocusMonitorControl(Control c, bool adding)
}
}
- private void OnFocusControlAdded(object sender, ControlEventArgs e) =>
+ private void OnFocusControlAdded(object? sender, ControlEventArgs e) =>
// Add focus monitoring to the control
FocusMonitorControl(e.Control, true);
- private void OnFocusControlRemoved(object sender, ControlEventArgs e) =>
+ private void OnFocusControlRemoved(object? sender, ControlEventArgs e) =>
// Remove focus monitoring from the control
FocusMonitorControl(e.Control, true);
- private void OnFocusChanged(object sender, EventArgs e)
+ private void OnFocusChanged(object? sender, EventArgs e)
{
// No point requesting the update more than once
if (!_awaitingFocusUpdate && IsHandleCreated)
@@ -606,7 +606,7 @@ private void OnFocusChanged(object sender, EventArgs e)
}
}
- private void OnFocusUpdate(object sender, EventArgs e)
+ private void OnFocusUpdate(object? sender, EventArgs e)
{
// Should we apply docking specific appearance changes to reflect changes in focus?
if (ApplyDockingAppearance)
@@ -645,7 +645,7 @@ private void OnFocusUpdate(object sender, EventArgs e)
_awaitingFocusUpdate = false;
}
- private void OnVisibleUpdate(object sender, EventArgs e)
+ private void OnVisibleUpdate(object? sender, EventArgs e)
{
if (ApplyDockingVisibility)
{
@@ -698,7 +698,7 @@ private void OnVisibleUpdate(object sender, EventArgs e)
}
}
- private void OnCellShowContextMenu(object sender, ShowContextMenuArgs e)
+ private void OnCellShowContextMenu(object? sender, ShowContextMenuArgs e)
{
// Make sure we have a menu for displaying
e.KryptonContextMenu ??= new KryptonContextMenu();
@@ -712,18 +712,20 @@ private void OnCellShowContextMenu(object sender, ShowContextMenuArgs e)
e.Cancel = args.Cancel;
}
- private void OnCellPrimaryHeaderLeftClicked(object sender, EventArgs e)
+ private void OnCellPrimaryHeaderLeftClicked(object? sender, EventArgs e)
{
// Should we apply docking specific change of focus when the primary header is clicked?
if (ApplyDockingAppearance)
{
// Set the focus into the active page
- var cell = (KryptonWorkspaceCell)sender;
- cell.SelectedPage?.SelectNextControl(cell.SelectedPage, true, true, true, false);
+ if (sender is KryptonWorkspaceCell cell)
+ {
+ cell.SelectedPage?.SelectNextControl(cell.SelectedPage, true, true, true, false);
+ }
}
}
- private void OnCellPrimaryHeaderRightClicked(object sender, EventArgs e)
+ private void OnCellPrimaryHeaderRightClicked(object? sender, EventArgs e)
{
// Should we apply docking specific change of focus when the primary header is clicked?
if (ApplyDockingAppearance)
@@ -748,7 +750,7 @@ private void OnCellPrimaryHeaderRightClicked(object sender, EventArgs e)
}
}
- private void OnCellPrimaryHeaderDoubleClicked(object sender, EventArgs e)
+ private void OnCellPrimaryHeaderDoubleClicked(object? sender, EventArgs e)
{
// Should we apply docking specific change of focus when the primary header is clicked?
if (ApplyDockingAppearance)
@@ -756,12 +758,14 @@ private void OnCellPrimaryHeaderDoubleClicked(object sender, EventArgs e)
var uniqueNames = new List();
// Create list of visible pages that are not placeholders
- var cell = (KryptonWorkspaceCell)sender;
- foreach (KryptonPage page in cell.Pages)
+ if (sender is KryptonWorkspaceCell cell)
{
- if (page.LastVisibleSet && page is not KryptonStorePage)
+ foreach (KryptonPage page in cell.Pages)
{
- uniqueNames.Add(page.UniqueName);
+ if (page.LastVisibleSet && page is not KryptonStorePage)
+ {
+ uniqueNames.Add(page.UniqueName);
+ }
}
}
@@ -772,7 +776,7 @@ private void OnCellPrimaryHeaderDoubleClicked(object sender, EventArgs e)
}
}
- private void OnCellTabDoubleClicked(object sender, KryptonPageEventArgs e)
+ private void OnCellTabDoubleClicked(object? sender, KryptonPageEventArgs e)
{
if (e.Item != null)
{
@@ -780,7 +784,7 @@ private void OnCellTabDoubleClicked(object sender, KryptonPageEventArgs e)
}
}
- private void OnCellTabVisibleCountChanged(object sender, EventArgs e)
+ private void OnCellTabVisibleCountChanged(object? sender, EventArgs e)
{
if (ApplyDockingAppearance)
{
@@ -810,13 +814,12 @@ private void OnCellTabVisibleCountChanged(object sender, EventArgs e)
UpdateVisible(_setFocus);
}
- private void OnCellSelectedPageChanged(object sender, EventArgs e)
+ private void OnCellSelectedPageChanged(object? sender, EventArgs e)
{
if (ApplyDockingCloseAction || ApplyDockingPinAction)
{
// Get access to the cached state for this cell
- var cell = sender as KryptonWorkspaceCell;
- if (cell != null)
+ if (sender is KryptonWorkspaceCell cell)
{
CachedCellState cellState = _lookupCellState[cell];
@@ -853,12 +856,13 @@ private void OnCellSelectedPageFlagsChanged(object sender, KryptonPageFlagsEvent
}
}
- private void OnCellCloseAction(object sender, EventArgs e)
+ private void OnCellCloseAction(object? sender, EventArgs e)
{
if (ApplyDockingCloseAction)
{
// Find the page associated with the cell that fired this button spec
- var buttonSpec = (ButtonSpec)sender;
+ var buttonSpec = sender as ButtonSpec ?? throw new ArgumentNullException(nameof(sender));
+
foreach (CachedCellState cellState in _lookupCellState.Values.Where(cellState => cellState.CloseButtonSpec == buttonSpec))
{
if (cellState.Cell?.SelectedPage != null)
@@ -871,12 +875,13 @@ private void OnCellCloseAction(object sender, EventArgs e)
}
}
- private void OnCellAutoHiddenAction(object sender, EventArgs e)
+ private void OnCellAutoHiddenAction(object? sender, EventArgs e)
{
if (ApplyDockingPinAction)
{
// Find the page associated with the cell that fired this button spec
- var buttonSpec = (ButtonSpec)sender;
+ var buttonSpec = sender as ButtonSpec ?? throw new ArgumentNullException(nameof(sender));
+
foreach (CachedCellState cellState in _lookupCellState.Values.Where(cellState => cellState.PinButtonSpec == buttonSpec))
{
if (cellState.Cell?.SelectedPage != null)
@@ -889,12 +894,12 @@ private void OnCellAutoHiddenAction(object sender, EventArgs e)
}
}
- private void OnCellDropDownOpening(object sender, CancelEventArgs e)
+ private void OnCellDropDownOpening(object? sender, CancelEventArgs e)
{
if (ApplyDockingDropDownAction)
{
// Search for the cell that contains the button spec that has this context menu
- var kcm = (KryptonContextMenu)sender;
+ var kcm = sender as KryptonContextMenu ?? throw new ArgumentNullException(nameof(sender));
foreach (CachedCellState cellState in _lookupCellState.Values.Where(cellState => (cellState.DropDownButtonSpec != null)
&& (cellState.DropDownButtonSpec.KryptonContextMenu == kcm))
)
diff --git a/Source/Krypton Components/Krypton.Docking/Control Docking/KryptonStorePage.cs b/Source/Krypton Components/Krypton.Docking/Control Docking/KryptonStorePage.cs
index 00d5bc41e..cc91a7c28 100644
--- a/Source/Krypton Components/Krypton.Docking/Control Docking/KryptonStorePage.cs
+++ b/Source/Krypton Components/Krypton.Docking/Control Docking/KryptonStorePage.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -47,7 +47,7 @@ public override bool LastVisibleSet
}
///
- /// Gets the storgate name associated with this page.
+ /// Gets the storage name associated with this page.
///
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Advanced)]
diff --git a/Source/Krypton Components/Krypton.Docking/Dragging/DockingDragManager.cs b/Source/Krypton Components/Krypton.Docking/Dragging/DockingDragManager.cs
index c60b0f8f5..1c7f1a199 100644
--- a/Source/Krypton Components/Krypton.Docking/Dragging/DockingDragManager.cs
+++ b/Source/Krypton Components/Krypton.Docking/Dragging/DockingDragManager.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -116,7 +116,7 @@ public override void DragMove(Point screenPt)
base.DragMove(screenPt);
}
- private void OnFloatingWindowMove(object sender, EventArgs e)
+ private void OnFloatingWindowMove(object? sender, EventArgs e)
{
_moveTimer.Stop();
diff --git a/Source/Krypton Components/Krypton.Docking/Dragging/DockingDragTargetProvider.cs b/Source/Krypton Components/Krypton.Docking/Dragging/DockingDragTargetProvider.cs
index 3a446b4bf..01b44af86 100644
--- a/Source/Krypton Components/Krypton.Docking/Dragging/DockingDragTargetProvider.cs
+++ b/Source/Krypton Components/Krypton.Docking/Dragging/DockingDragTargetProvider.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Dragging/DragTargetControlEdge.cs b/Source/Krypton Components/Krypton.Docking/Dragging/DragTargetControlEdge.cs
index 39ef634de..7db485c6b 100644
--- a/Source/Krypton Components/Krypton.Docking/Dragging/DragTargetControlEdge.cs
+++ b/Source/Krypton Components/Krypton.Docking/Dragging/DragTargetControlEdge.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Dragging/DragTargetNull.cs b/Source/Krypton Components/Krypton.Docking/Dragging/DragTargetNull.cs
index 074647c0e..504a128e0 100644
--- a/Source/Krypton Components/Krypton.Docking/Dragging/DragTargetNull.cs
+++ b/Source/Krypton Components/Krypton.Docking/Dragging/DragTargetNull.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Elements Base/DockingElement.cs b/Source/Krypton Components/Krypton.Docking/Elements Base/DockingElement.cs
index 855c705b2..7c2110fad 100644
--- a/Source/Krypton Components/Krypton.Docking/Elements Base/DockingElement.cs
+++ b/Source/Krypton Components/Krypton.Docking/Elements Base/DockingElement.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -149,11 +149,13 @@ public virtual IDockingElement? Parent
///
public virtual void PropogateAction(DockingPropogateAction action, string[]? uniqueNames)
{
- // Propagate the action request to all the child elements
+ // Propagate the action request to all the child elements (Even the null ones !!)
// (use reverse order so if element removes itself we still have a valid loop)
for (var i = Count - 1; i >= 0; i--)
{
- this[i]?.PropogateAction(action, uniqueNames);
+ {
+ this[i]!.PropogateAction(action, uniqueNames);
+ }
}
}
@@ -539,11 +541,8 @@ public virtual void LoadElementFromXml(XmlReader xmlReader, KryptonPageCollectio
// Find a child docking element with the matching name
IDockingElement? child = this[xmlReader.GetAttribute(@"N")!];
- if (child != null)
- {
- // Let derived class perform child element specific processing
- LoadChildDockingElement(xmlReader, pages, child);
- }
+ // Let derived class perform child element specific processing
+ LoadChildDockingElement(xmlReader, pages, child);
}
}
diff --git a/Source/Krypton Components/Krypton.Docking/Elements Base/DockingElementClosedCollection.cs b/Source/Krypton Components/Krypton.Docking/Elements Base/DockingElementClosedCollection.cs
index 24fc8c5a5..27170db9a 100644
--- a/Source/Krypton Components/Krypton.Docking/Elements Base/DockingElementClosedCollection.cs
+++ b/Source/Krypton Components/Krypton.Docking/Elements Base/DockingElementClosedCollection.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Elements Base/DockingElementOpenCollection.cs b/Source/Krypton Components/Krypton.Docking/Elements Base/DockingElementOpenCollection.cs
index 3f25dc371..3eeddc66a 100644
--- a/Source/Krypton Components/Krypton.Docking/Elements Base/DockingElementOpenCollection.cs
+++ b/Source/Krypton Components/Krypton.Docking/Elements Base/DockingElementOpenCollection.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingAutoHiddenGroup.cs b/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingAutoHiddenGroup.cs
index 056d7bd85..c4b8a7cea 100644
--- a/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingAutoHiddenGroup.cs
+++ b/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingAutoHiddenGroup.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -121,7 +121,7 @@ public void Append(KryptonPage[]? pages)
///
/// Action that is requested to be performed.
/// Array of unique names of the pages the action relates to.
- public override void PropogateAction(DockingPropogateAction action, string[] uniqueNames)
+ public override void PropogateAction(DockingPropogateAction action, string[]? uniqueNames)
{
switch (action)
{
@@ -643,33 +643,31 @@ private void AppendPagesToControl(KryptonPage[] pages)
AutoHiddenGroupControl.Pages.AddRange(pages);
}
- private void OnAutoHiddenGroupStoringPage(object sender, UniqueNameEventArgs e) =>
+ private void OnAutoHiddenGroupStoringPage(object? sender, UniqueNameEventArgs e) =>
// We only allow a single 'store' page in this docking location at a time
DockingManager?.PropogateAction(DockingPropogateAction.ClearAutoHiddenStoredPages, new[] { e.UniqueName });
- private void OnAutoHiddenGroupTabClicked(object sender, KryptonPageEventArgs e)
+ private void OnAutoHiddenGroupTabClicked(object? sender, KryptonPageEventArgs e)
{
// The auto hidden group contains proxy pages and not the real pages
- var proxyPage = e.Item as KryptonAutoHiddenProxyPage;
- if (proxyPage != null)
+ if (e.Item is KryptonAutoHiddenProxyPage proxyPage)
{
OnPageClicked(new KryptonPageEventArgs(proxyPage.Page, e.Index));
}
}
- private void OnAutoHiddenGroupHoverStart(object sender, KryptonPageEventArgs e)
+ private void OnAutoHiddenGroupHoverStart(object? sender, KryptonPageEventArgs e)
{
// The auto hidden group contains proxy pages and not the real pages
- var proxyPage = e.Item as KryptonAutoHiddenProxyPage;
- if (proxyPage != null)
+ if (e.Item is KryptonAutoHiddenProxyPage proxyPage)
{
OnPageHoverStart(new KryptonPageEventArgs(proxyPage.Page, e.Index));
}
}
- private void OnAutoHiddenGroupHoverEnd(object sender, EventArgs e) => OnPageHoverEnd(e);
+ private void OnAutoHiddenGroupHoverEnd(object? sender, EventArgs e) => OnPageHoverEnd(e);
- private void OnAutoHiddenGroupTabVisibleCountChanged(object sender, EventArgs e)
+ private void OnAutoHiddenGroupTabVisibleCountChanged(object? sender, EventArgs e)
{
if (AutoHiddenGroupControl.Pages.VisibleCount == 0)
{
@@ -688,7 +686,7 @@ private void OnAutoHiddenGroupTabVisibleCountChanged(object sender, EventArgs e)
}
}
}
- private void OnAutoHiddenGroupDisposed(object sender, EventArgs e)
+ private void OnAutoHiddenGroupDisposed(object? sender, EventArgs e)
{
// Unhook from events so the control can be garbage collected
AutoHiddenGroupControl.StoringPage -= OnAutoHiddenGroupStoringPage;
diff --git a/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingControl.cs b/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingControl.cs
index 8a84f48e1..47443051b 100644
--- a/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingControl.cs
+++ b/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingControl.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -367,14 +367,14 @@ private void Construct(Control control, IDockingElement? innerElement)
Add(new KryptonDockingEdge(@"Right", control, DockingEdge.Right));
}
- private void OnControlDisposed(object sender, EventArgs e)
+ private void OnControlDisposed(object? sender, EventArgs e)
{
// Unhook events to allow garbage collection
Control.SizeChanged -= OnControlSizeChanged;
Control.Disposed -= OnControlDisposed;
}
- private void OnControlSizeChanged(object sender, EventArgs e)
+ private void OnControlSizeChanged(object? sender, EventArgs e)
{
if (!Control.Size.IsEmpty)
{
diff --git a/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingDockspace.cs b/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingDockspace.cs
index 55ba6cad3..e7f83f359 100644
--- a/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingDockspace.cs
+++ b/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingDockspace.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -312,13 +312,13 @@ protected override void RaiseCellRemoved(KryptonWorkspaceCell cell)
///
/// Source of the event.
/// A PageDropEventArgs containing the event data.
- protected override void RaiseSpacePageDrop(object sender, PageDropEventArgs e)
+ protected override void RaiseSpacePageDrop(object? sender, PageDropEventArgs e)
{
// Use event to indicate the page is moving to a workspace and allow it to be cancelled
KryptonDockingManager? dockingManager = DockingManager;
if (dockingManager != null)
{
- var args = new CancelUniqueNameEventArgs(e.Page.UniqueName, false);
+ var args = new CancelUniqueNameEventArgs(e.Page?.UniqueName!, false);
dockingManager.RaisePageDockedRequest(args);
// Pass back the result of the event
@@ -419,13 +419,13 @@ public override void LoadElementFromXml(XmlReader xmlReader, KryptonPageCollecti
{
DockspaceControl.Dispose();
// TODO: Is this safe ?. It means that whatever uses this afterwards could be accessing null things !
- SpaceControl = null;
+ SpaceControl = null!;
}
}
#endregion
#region Implementation
- private void OnDockspaceCellVisibleCountChanged(object sender, EventArgs e)
+ private void OnDockspaceCellVisibleCountChanged(object? sender, EventArgs e)
{
if (DockspaceControl.CellVisibleCount == 0)
{
@@ -445,7 +445,7 @@ private void OnDockspaceCellVisibleCountChanged(object sender, EventArgs e)
}
}
- private void OnDockspaceCellCountChanged(object sender, EventArgs e)
+ private void OnDockspaceCellCountChanged(object? sender, EventArgs e)
{
// When all the cells (and so pages) have been removed we kill ourself
if (DockspaceControl.CellCount == 0)
@@ -454,38 +454,38 @@ private void OnDockspaceCellCountChanged(object sender, EventArgs e)
}
}
- private void OnDockspacePageCloseClicked(object sender, UniqueNameEventArgs e)
+ private void OnDockspacePageCloseClicked(object? sender, UniqueNameEventArgs e)
{
// Generate event so that the close action is handled for the named page
KryptonDockingManager? dockingManager = DockingManager;
dockingManager?.CloseRequest(new[] { e.UniqueName });
}
- private void OnDockspacePageAutoHiddenClicked(object sender, UniqueNameEventArgs e)
+ private void OnDockspacePageAutoHiddenClicked(object? sender, UniqueNameEventArgs e)
{
// Generate event so that the switch from docked to auto hidden is handled for cell that contains the named page
KryptonDockingManager? dockingManager = DockingManager;
dockingManager?.SwitchDockedCellToAutoHiddenGroupRequest(e.UniqueName);
}
- private void OnDockspacePagesDoubleClicked(object sender, UniqueNamesEventArgs e)
+ private void OnDockspacePagesDoubleClicked(object? sender, UniqueNamesEventArgs e)
{
// Generate event so that the switch from docked to floating is handled for the provided list of named pages
KryptonDockingManager? dockingManager = DockingManager;
dockingManager?.SwitchDockedToFloatingWindowRequest(e.UniqueNames);
}
- private void OnDockspaceDropDownClicked(object sender, CancelDropDownEventArgs e)
+ private void OnDockspaceDropDownClicked(object? sender, CancelDropDownEventArgs e)
{
// Generate event so that the appropriate context menu options are presented and actioned
KryptonDockingManager? dockingManager = DockingManager;
if (dockingManager != null)
{
- e.Cancel = !dockingManager.ShowPageContextMenuRequest(e.Page, e.KryptonContextMenu);
+ e.Cancel = !dockingManager.ShowPageContextMenuRequest(e.Page!, e.KryptonContextMenu!);
}
}
- private void OnDockspaceBeforePageDrag(object sender, PageDragCancelEventArgs e)
+ private void OnDockspaceBeforePageDrag(object? sender, PageDragCancelEventArgs e)
{
// Validate the list of names to those that are still present in the dockspace
var pages = new List();
diff --git a/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingEdge.cs b/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingEdge.cs
index 10361f24a..162b9a0c8 100644
--- a/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingEdge.cs
+++ b/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingEdge.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingEdgeAutoHidden.cs b/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingEdgeAutoHidden.cs
index f2755a427..2a7645782 100644
--- a/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingEdgeAutoHidden.cs
+++ b/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingEdgeAutoHidden.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -297,10 +297,10 @@ private KryptonDockingAutoHiddenGroup CreateAndInsertAutoHiddenGroup(int index,
return groupElement;
}
- private void OnDockingAutoHiddenGroupDisposed(object sender, EventArgs e)
+ private void OnDockingAutoHiddenGroupDisposed(object? sender, EventArgs e)
{
// Cast to correct type and unhook event handlers so garbage collection can occur
- var groupElement = (KryptonDockingAutoHiddenGroup)sender;
+ var groupElement = sender as KryptonDockingAutoHiddenGroup ?? throw new ArgumentNullException(nameof(sender));
groupElement.PageClicked -= OnDockingAutoHiddenGroupClicked;
groupElement.PageHoverStart -= OnDockingAutoHiddenGroupHoverStart;
groupElement.PageHoverEnd -= OnDockingAutoHiddenGroupHoverEnd;
@@ -310,7 +310,7 @@ private void OnDockingAutoHiddenGroupDisposed(object sender, EventArgs e)
InternalRemove(groupElement);
}
- private void OnPanelDisposed(object sender, EventArgs e)
+ private void OnPanelDisposed(object? sender, EventArgs e)
{
// Unhook from events so the control can be garbage collected
_panel.Disposed -= OnPanelDisposed;
@@ -334,7 +334,7 @@ private void OnPanelDisposed(object sender, EventArgs e)
}
}
- private void OnSlidePanelDisposed(object sender, EventArgs e)
+ private void OnSlidePanelDisposed(object? sender, EventArgs e)
{
// Unhook from events so the control can be garbage collected
_slidePanel.SplitterMoveRect -= OnSlidePanelSeparatorMoveRect;
@@ -366,36 +366,36 @@ private void OnSlidePanelDisposed(object sender, EventArgs e)
}
}
- private void OnDockingAutoHiddenGroupClicked(object sender, KryptonPageEventArgs e)
+ private void OnDockingAutoHiddenGroupClicked(object? sender, KryptonPageEventArgs e)
{
// Request the sliding panel slide itself into view with the provided page
- var dockingGroup = (KryptonDockingAutoHiddenGroup)sender;
+ var dockingGroup = sender as KryptonDockingAutoHiddenGroup ?? throw new ArgumentNullException(nameof(sender));
_slidePanel.SlideOut(e.Item, dockingGroup.AutoHiddenGroupControl, true);
}
- private void OnDockingAutoHiddenGroupHoverStart(object sender, KryptonPageEventArgs e)
+ private void OnDockingAutoHiddenGroupHoverStart(object? sender, KryptonPageEventArgs e)
{
// Request the sliding panel slide itself into view with the provided page
- var dockingGroup = (KryptonDockingAutoHiddenGroup)sender;
+ var dockingGroup = sender as KryptonDockingAutoHiddenGroup ?? throw new ArgumentNullException(nameof(sender));
_slidePanel.SlideOut(e.Item, dockingGroup.AutoHiddenGroupControl, false);
}
- private void OnDockingAutoHiddenGroupHoverEnd(object sender, EventArgs e) =>
+ private void OnDockingAutoHiddenGroupHoverEnd(object? sender, EventArgs e) =>
// Request the sliding panel slide itself out of view when appropriate
// (will not retract whilst the mouse is over the slide out dockspace)
// (will not retract whilst slide out dockspace has the focus)
_slidePanel.SlideIn();
- private void OnSlidePanelSeparatorMoved(object sender, SplitterEventArgs e) => _slidePanel.UpdateSize(e.SplitX, e.SplitY);
+ private void OnSlidePanelSeparatorMoved(object? sender, SplitterEventArgs e) => _slidePanel.UpdateSize(e.SplitX, e.SplitY);
- private void OnSlidePanelSeparatorMoving(object sender, SplitterCancelEventArgs e)
+ private void OnSlidePanelSeparatorMoving(object? sender, SplitterCancelEventArgs e)
{
}
- private void OnSlidePanelSeparatorMoveRect(object sender, SplitterMoveRectMenuArgs e)
+ private void OnSlidePanelSeparatorMoveRect(object? sender, SplitterMoveRectMenuArgs e)
{
// Cast to correct type and grab associated dockspace control
- var separatorControl = (KryptonDockspaceSeparator)sender;
+ var separatorControl = sender as KryptonDockspaceSeparator ?? throw new ArgumentNullException(nameof(sender));
KryptonDockspace dockspaceControl = _slidePanel.DockspaceControl;
KryptonPage? page = _slidePanel.Page;
@@ -411,21 +411,21 @@ private void OnSlidePanelSeparatorMoveRect(object sender, SplitterMoveRectMenuAr
}
}
- private void OnSlidePanelPageCloseClicked(object sender, UniqueNameEventArgs e)
+ private void OnSlidePanelPageCloseClicked(object? sender, UniqueNameEventArgs e)
{
// Generate event so that the close action is handled for the named page
KryptonDockingManager? dockingManager = DockingManager;
dockingManager?.CloseRequest(new[] { e.UniqueName });
}
- private void OnSlidePanelPageAutoHiddenClicked(object sender, UniqueNameEventArgs e)
+ private void OnSlidePanelPageAutoHiddenClicked(object? sender, UniqueNameEventArgs e)
{
// Generate event so that the auto hidden is switched to docked is handled for the group that contains the named page
KryptonDockingManager? dockingManager = DockingManager;
dockingManager?.SwitchAutoHiddenGroupToDockedCellRequest(e.UniqueName);
}
- private void OnSlidePanelPageDropDownClicked(object sender, CancelDropDownEventArgs e)
+ private void OnSlidePanelPageDropDownClicked(object? sender, CancelDropDownEventArgs e)
{
// Generate event so that the appropriate context menu options are presented and actioned
KryptonDockingManager? dockingManager = DockingManager;
@@ -437,7 +437,7 @@ private void OnSlidePanelPageDropDownClicked(object sender, CancelDropDownEventA
}
}
- private void OnSlidePanelAutoHiddenShowingStateChanged(object sender, AutoHiddenShowingStateEventArgs e)
+ private void OnSlidePanelAutoHiddenShowingStateChanged(object? sender, AutoHiddenShowingStateEventArgs e)
{
// Generate event so that the appropriate context menu options are presented and actioned
KryptonDockingManager? dockingManager = DockingManager;
diff --git a/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingEdgeDocked.cs b/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingEdgeDocked.cs
index bb1a96e58..e52c5c258 100644
--- a/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingEdgeDocked.cs
+++ b/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingEdgeDocked.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -214,10 +214,10 @@ private KryptonDockingDockspace CreateAndInsertDockspace(int index, string name,
return dockspaceElement;
}
- private void OnDockingDockspaceHasNoVisibleCells(object sender, EventArgs e)
+ private void OnDockingDockspaceHasNoVisibleCells(object? sender, EventArgs e)
{
// Cast to correct type and grab associated separator control
- var dockspaceElement = (KryptonDockingDockspace)sender;
+ var dockspaceElement = sender as KryptonDockingDockspace ?? throw new ArgumentNullException(nameof(sender));
KryptonDockspaceSeparator separatorControl = _lookupDockspace[dockspaceElement];
// No more visible cells so we hide the controls
@@ -225,10 +225,10 @@ private void OnDockingDockspaceHasNoVisibleCells(object sender, EventArgs e)
separatorControl.Visible = false;
}
- private void OnDockspaceSeparatorMoveRect(object sender, SplitterMoveRectMenuArgs e)
+ private void OnDockspaceSeparatorMoveRect(object? sender, SplitterMoveRectMenuArgs e)
{
// Cast to correct type and grab associated dockspace element
- var separatorControl = (KryptonDockspaceSeparator)sender;
+ var separatorControl = sender as KryptonDockspaceSeparator ?? throw new ArgumentNullException(nameof(sender));
KryptonDockingDockspace dockspaceElement = _lookupSeparator[separatorControl];
// Events are generated from the parent docking manager
@@ -250,10 +250,10 @@ private void OnDockspaceSeparatorMoveRect(object sender, SplitterMoveRectMenuArg
}
}
- private void OnDockspaceSeparatorMoved(object sender, SplitterEventArgs e)
+ private void OnDockspaceSeparatorMoved(object? sender, SplitterEventArgs e)
{
// Cast to correct type and grab associated dockspace element
- var separatorControl = (KryptonDockspaceSeparator)sender;
+ var separatorControl = sender as KryptonDockspaceSeparator ?? throw new ArgumentNullException(nameof(sender));
KryptonDockingDockspace dockspaceElement = _lookupSeparator[separatorControl];
// Update with delta change
@@ -282,7 +282,7 @@ private void OnDockspaceSeparatorMoved(object sender, SplitterEventArgs e)
}
}
- private void OnDockspaceSeparatorNotMoved(object sender, EventArgs e)
+ private void OnDockspaceSeparatorNotMoved(object? sender, EventArgs e)
{
if (_update)
{
@@ -293,10 +293,10 @@ private void OnDockspaceSeparatorNotMoved(object sender, EventArgs e)
}
}
- private void OnDockingDockspaceHasVisibleCells(object sender, EventArgs e)
+ private void OnDockingDockspaceHasVisibleCells(object? sender, EventArgs e)
{
// Cast to correct type and grab associated separator control
- var dockspaceElement = (KryptonDockingDockspace)sender;
+ var dockspaceElement = sender as KryptonDockingDockspace ?? throw new ArgumentNullException(nameof(sender));
KryptonDockspaceSeparator separatorControl = _lookupDockspace[dockspaceElement];
// Now have a visible cell so we show the controls
@@ -304,10 +304,10 @@ private void OnDockingDockspaceHasVisibleCells(object sender, EventArgs e)
separatorControl.Visible = true;
}
- private void OnDockingDockspaceDisposed(object sender, EventArgs e)
+ private void OnDockingDockspaceDisposed(object? sender, EventArgs e)
{
// Cast to correct type and unhook event handlers so garbage collection can occur
- var dockspaceElement = (KryptonDockingDockspace)sender;
+ var dockspaceElement = sender as KryptonDockingDockspace ?? throw new ArgumentNullException(nameof(sender));
dockspaceElement.HasVisibleCells -= OnDockingDockspaceHasVisibleCells;
dockspaceElement.HasNoVisibleCells -= OnDockingDockspaceHasNoVisibleCells;
dockspaceElement.Disposed -= OnDockingDockspaceDisposed;
@@ -326,10 +326,10 @@ private void OnDockingDockspaceDisposed(object sender, EventArgs e)
_lookupDockspace.Remove(dockspaceElement);
}
- private void OnDockspaceSeparatorDisposed(object sender, EventArgs e)
+ private void OnDockspaceSeparatorDisposed(object? sender, EventArgs e)
{
// Unhook from events so the control can be garbage collected
- var separatorControl = (KryptonDockspaceSeparator)sender;
+ var separatorControl = sender as KryptonDockspaceSeparator ?? throw new ArgumentNullException(nameof(sender));
separatorControl.SplitterMoveRect -= OnDockspaceSeparatorMoveRect;
separatorControl.SplitterMoved -= OnDockspaceSeparatorMoved;
separatorControl.SplitterNotMoved -= OnDockspaceSeparatorNotMoved;
diff --git a/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingFloating.cs b/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingFloating.cs
index 3dbf38bc1..c76b8bea0 100644
--- a/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingFloating.cs
+++ b/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingFloating.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -142,10 +142,10 @@ private KryptonDockingFloatingWindow CreateFloatingWindow(string? name)
return floatingWindowElement;
}
- private void OnDockingFloatingWindowDisposed(object sender, EventArgs e)
+ private void OnDockingFloatingWindowDisposed(object? sender, EventArgs e)
{
// Cast to correct type and unhook event handlers so garbage collection can occur
- var floatingWindowElement = (KryptonDockingFloatingWindow)sender;
+ var floatingWindowElement = sender as KryptonDockingFloatingWindow ?? throw new ArgumentNullException(nameof(sender));
floatingWindowElement.Disposed -= OnDockingFloatingWindowDisposed;
// Remove the element from our child collection as it is no longer valid
diff --git a/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingFloatingWindow.cs b/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingFloatingWindow.cs
index 8acc943a7..351bdc122 100644
--- a/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingFloatingWindow.cs
+++ b/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingFloatingWindow.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -185,7 +185,7 @@ public override void SaveElementToXml(XmlWriter xmlWriter)
xmlWriter.WriteStartElement(XmlElementName);
xmlWriter.WriteAttributeString(@"N", Name);
xmlWriter.WriteAttributeString(@"C", Count.ToString());
- xmlWriter.WriteAttributeString(@"L", CommonHelper.PointToString(FloatingWindow.Location)!);
+ xmlWriter.WriteAttributeString(@"L", CommonHelper.PointToString(FloatingWindow.Location));
xmlWriter.WriteAttributeString(@"S", CommonHelper.SizeToString(FloatingWindow.ClientSize));
// Output an element per child
@@ -214,7 +214,7 @@ protected override void LoadDockingElement(XmlReader xmlReader, KryptonPageColle
{
// Grab the requested size and location
Point location = CommonHelper.StringToPoint(xmlReader.GetAttribute(@"L"));
- Size clientSize = CommonHelper.StringToSize(xmlReader.GetAttribute(@"S")!);
+ Size clientSize = CommonHelper.StringToSize(xmlReader.GetAttribute(@"S"));
// Find the size of the floating window borders
var hBorders = FloatingWindow.Width - FloatingWindow.ClientSize.Width;
@@ -260,24 +260,24 @@ protected override void LoadDockingElement(XmlReader xmlReader, KryptonPageColle
#endregion
#region Implementation
- private void OnFloatingWindowCloseClicked(object sender, UniqueNamesEventArgs e)
+ private void OnFloatingWindowCloseClicked(object? sender, UniqueNamesEventArgs e)
{
// Events are generated from the parent docking manager
KryptonDockingManager? dockingManager = DockingManager;
dockingManager?.CloseRequest(e.UniqueNames);
}
- private void OnFloatingWindowCaptionDragging(object sender, ScreenAndOffsetEventArgs e)
+ private void OnFloatingWindowCaptionDragging(object? sender, ScreenAndOffsetEventArgs e)
{
// Events are generated from the parent docking manager
KryptonDockingManager? dockingManager = DockingManager;
dockingManager?.DoDragDrop(e.ScreenPoint, e.ElementOffset, null, this);
}
- private void OnDockingFloatspaceDisposed(object sender, EventArgs e)
+ private void OnDockingFloatspaceDisposed(object? sender, EventArgs e)
{
// Cast to correct type and unhook event handlers so garbage collection can occur
- var floatspaceElement = (KryptonDockingFloatspace)sender;
+ var floatspaceElement = sender as KryptonDockingFloatspace ?? throw new ArgumentNullException(nameof(sender));
floatspaceElement.Disposed -= OnDockingFloatspaceDisposed;
// Kill the floatspace window
@@ -287,7 +287,7 @@ private void OnDockingFloatspaceDisposed(object sender, EventArgs e)
}
}
- private void OnFloatingWindowDisposed(object sender, EventArgs e)
+ private void OnFloatingWindowDisposed(object? sender, EventArgs e)
{
// Unhook from events so the control can be garbage collected
FloatingWindow.Disposed -= OnFloatingWindowDisposed;
diff --git a/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingFloatspace.cs b/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingFloatspace.cs
index eb8bf00e1..d53d82e5f 100644
--- a/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingFloatspace.cs
+++ b/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingFloatspace.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -147,7 +147,7 @@ public override DockingLocation FindPageLocation(string uniqueName)
///
/// Source of the event.
/// A KryptonPageEventArgs containing the event data.
- protected override void OnSpaceCellPageInserting(object sender, KryptonPageEventArgs e)
+ protected override void OnSpaceCellPageInserting(object? sender, KryptonPageEventArgs e)
{
// Remove any store page for the unique name of this page being added. In either case of adding a store
// page or a regular page we want to ensure there does not exist a store page for that same unique name.
@@ -225,7 +225,7 @@ protected override void RaiseCellRemoved(KryptonWorkspaceCell cell)
///
/// Source of the event.
/// A PageDropEventArgs containing the event data.
- protected override void RaiseSpacePageDrop(object sender, PageDropEventArgs e)
+ protected override void RaiseSpacePageDrop(object? sender, PageDropEventArgs e)
{
// Use event to indicate the page is moving to a workspace and allow it to be cancelled
KryptonDockingManager? dockingManager = DockingManager;
@@ -266,14 +266,14 @@ public override void LoadElementFromXml(XmlReader xmlReader, KryptonPageCollecti
#endregion
#region Implementation
- private void OnFloatspacePageCloseClicked(object sender, UniqueNameEventArgs e)
+ private void OnFloatspacePageCloseClicked(object? sender, UniqueNameEventArgs e)
{
// Generate event so that the close action is handled for the named page
KryptonDockingManager? dockingManager = DockingManager;
dockingManager?.CloseRequest(new[] { e.UniqueName });
}
- private void OnFloatspacePagesDoubleClicked(object sender, UniqueNamesEventArgs e)
+ private void OnFloatspacePagesDoubleClicked(object? sender, UniqueNamesEventArgs e)
{
// If the number of pages to be converted into a separate floating window is less than the
// total number of visible pages then we allow the change to occur. Otherwise it would cause
@@ -285,7 +285,7 @@ private void OnFloatspacePagesDoubleClicked(object sender, UniqueNamesEventArgs
}
}
- private void OnFloatspaceDropDownClicked(object sender, CancelDropDownEventArgs e)
+ private void OnFloatspaceDropDownClicked(object? sender, CancelDropDownEventArgs e)
{
// Generate event so that the appropriate context menu options are presented and actioned
KryptonDockingManager? dockingManager = DockingManager;
@@ -298,7 +298,7 @@ private void OnFloatspaceDropDownClicked(object sender, CancelDropDownEventArgs
}
}
- private void OnFloatspaceBeforePageDrag(object sender, PageDragCancelEventArgs e)
+ private void OnFloatspaceBeforePageDrag(object? sender, PageDragCancelEventArgs e)
{
// Validate the list of names to those that are still present in the floatspace
var pages = e.Pages.Where(page => page is not KryptonStorePage && (FloatspaceControl.CellForPage(page) != null)).ToList();
diff --git a/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingManager.cs b/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingManager.cs
index 26889edff..05d7dc779 100644
--- a/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingManager.cs
+++ b/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingManager.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -1836,7 +1836,7 @@ public virtual bool ShowPageContextMenuRequest([DisallowNull] KryptonPage? page,
throw new ArgumentNullException(nameof(kcm));
}
- // By default there is nothing to display
+ // By default, there is nothing to display
var retDisplay = false;
// If the page is not located in the hierarchy then there are no options we can provide
@@ -4093,13 +4093,19 @@ private static void RemoveControlStorePages(DockingElement element, string[] uni
}
}
- private void OnStringPropertyChanged(object sender, PropertyChangedEventArgs e) =>
- // Piggy back the name of the changed property in the unique name parameter
- PropogateAction(DockingPropogateAction.StringChanged, new[] { e.PropertyName });
+ private void OnStringPropertyChanged(object? sender, PropertyChangedEventArgs e)
+ {
+ // Piggyback the name of the changed property in the unique name parameter
+ string[]? uniqueNames = e.PropertyName is null
+ ? null
+ : new string[] { e.PropertyName };
+
+ PropogateAction(DockingPropogateAction.StringChanged, uniqueNames);
+ }
- private void OnDropDownWorkspaceClicked(object sender, EventArgs e)
+ private void OnDropDownWorkspaceClicked(object? sender, EventArgs e)
{
- var workspaceItem = (KryptonContextMenuItem)sender;
+ var workspaceItem = sender as KryptonContextMenuItem ?? throw new ArgumentNullException(nameof(sender));
// Action depends on the current location
if (workspaceItem.Tag is string uniqueName)
@@ -4120,9 +4126,9 @@ private void OnDropDownWorkspaceClicked(object sender, EventArgs e)
}
}
- private void OnDropDownNavigatorClicked(object sender, EventArgs e)
+ private void OnDropDownNavigatorClicked(object? sender, EventArgs e)
{
- var workspaceItem = (KryptonContextMenuItem)sender;
+ var workspaceItem = sender as KryptonContextMenuItem ?? throw new ArgumentNullException(nameof(sender));
if (workspaceItem.Tag is string uniqueName)
{
@@ -4143,9 +4149,9 @@ private void OnDropDownNavigatorClicked(object sender, EventArgs e)
}
}
- private void OnDropDownAutoHiddenClicked(object sender, EventArgs e)
+ private void OnDropDownAutoHiddenClicked(object? sender, EventArgs e)
{
- var autoHiddenItem = (KryptonContextMenuItem)sender;
+ var autoHiddenItem = sender as KryptonContextMenuItem ?? throw new ArgumentNullException(nameof(sender));
if (autoHiddenItem.Tag is string uniqueName)
{
@@ -4166,9 +4172,9 @@ private void OnDropDownAutoHiddenClicked(object sender, EventArgs e)
}
}
- private void OnDropDownDockedClicked(object sender, EventArgs e)
+ private void OnDropDownDockedClicked(object? sender, EventArgs e)
{
- var dockedItem = (KryptonContextMenuItem)sender;
+ var dockedItem = sender as KryptonContextMenuItem ?? throw new ArgumentNullException(nameof(sender));
if (dockedItem.Tag is string uniqueName)
{
@@ -4189,10 +4195,10 @@ private void OnDropDownDockedClicked(object sender, EventArgs e)
}
}
- private void OnDropDownFloatingClicked(object sender, EventArgs e)
+ private void OnDropDownFloatingClicked(object? sender, EventArgs e)
{
// Get the unique name of the page that needs to be converted to floating
- var floatingItem = (KryptonContextMenuItem)sender;
+ var floatingItem = sender as KryptonContextMenuItem ?? throw new ArgumentNullException(nameof(sender));
if (floatingItem.Tag is string uniqueName)
{
@@ -4213,10 +4219,10 @@ private void OnDropDownFloatingClicked(object sender, EventArgs e)
}
}
- private void OnDropDownCloseClicked(object sender, EventArgs e)
+ private void OnDropDownCloseClicked(object? sender, EventArgs e)
{
- var closeItem = (KryptonContextMenuItem)sender;
- CloseRequest(new[] { (string)closeItem.Tag! });
+ var closeItem = sender as KryptonContextMenuItem ?? throw new ArgumentNullException(nameof(sender));
+ CloseRequest(new[] { (closeItem.Tag as string) ?? string.Empty});
}
private static KryptonPage[] ArrayFromCollection(KryptonPageCollection pages)
diff --git a/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingNavigator.cs b/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingNavigator.cs
index 301d0fb51..5397155bd 100644
--- a/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingNavigator.cs
+++ b/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingNavigator.cs
@@ -5,13 +5,14 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
// ReSharper disable MemberCanBeInternal
+// ReSharper disable RedundantNullableFlowAttribute
namespace Krypton.Docking
{
///
@@ -79,7 +80,7 @@ public override IDockingElement? Parent
if (dockingManager != null)
{
var args = new DockableNavigatorEventArgs(DockableNavigatorControl, this);
- dockingManager?.RaiseDockableNavigatorAdded(args);
+ dockingManager.RaiseDockableNavigatorAdded(args);
}
}
}
@@ -446,7 +447,7 @@ public void RemoveAllPages(bool disposePage)
///
/// Action that is requested to be performed.
/// Array of unique names of the pages the action relates to.
- public override void PropogateAction(DockingPropogateAction action, string[] uniqueNames)
+ public override void PropogateAction(DockingPropogateAction action, string[]? uniqueNames)
{
KryptonPageCollection pageCollection = DockableNavigatorControl.Pages;
switch (action)
@@ -926,7 +927,7 @@ public override void LoadElementFromXml(XmlReader xmlReader, KryptonPageCollecti
#endregion
#region Implementation
- private void OnDockableNavigatorDisposed(object sender, EventArgs e)
+ private void OnDockableNavigatorDisposed(object? sender, EventArgs e)
{
// Unhook from events to prevent memory leaking
DockableNavigatorControl.Disposed -= OnDockableNavigatorDisposed;
@@ -943,7 +944,7 @@ private void OnDockableNavigatorDisposed(object sender, EventArgs e)
}
}
- private void OnDockableNavigatorPageInserting(object sender, KryptonPageEventArgs e)
+ private void OnDockableNavigatorPageInserting(object? sender, KryptonPageEventArgs e)
{
// Remove any store page for the unique name of this page being added. In either case of adding a store
// page or a regular page we want to ensure there does not exist a store page for that same unique name.
@@ -955,7 +956,7 @@ private void OnDockableNavigatorPageInserting(object sender, KryptonPageEventArg
}
}
- private void OnDockableNavigatorBeforePageDrag(object sender, PageDragCancelEventArgs e)
+ private void OnDockableNavigatorBeforePageDrag(object? sender, PageDragCancelEventArgs e)
{
// Validate the list of names to those that are still present in the navigator
var pages = e.Pages.Where(page => page is not KryptonStorePage && DockableNavigatorControl.Pages.Contains(page)).ToList();
@@ -972,7 +973,7 @@ private void OnDockableNavigatorBeforePageDrag(object sender, PageDragCancelEven
e.Cancel = true;
}
- private void OnDockableNavigatorPageDrop(object sender, PageDropEventArgs e)
+ private void OnDockableNavigatorPageDrop(object? sender, PageDropEventArgs e)
{
// Use event to indicate the page is moving to a navigator and allow it to be cancelled
KryptonDockingManager? dockingManager = DockingManager;
diff --git a/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingSpace.cs b/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingSpace.cs
index 29597df51..8d518ab4a 100644
--- a/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingSpace.cs
+++ b/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingSpace.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -63,10 +63,16 @@ public void Append(KryptonPage[]? pages)
if (pages != null)
{
ObserveAutoHiddenSlideSize(pages);
- // If there is no active cell...
+ // If there is no active cell, or cell is page-less...
KryptonWorkspaceCell? cell = SpaceControl?.ActiveCell;
- if (cell == null)
+ if (cell == null || cell.Pages.Count == 0)
{
+ // Remove the page-less cell if exists...
+ if (cell?.Pages.Count == 0)
+ {
+ SpaceControl!.Root.Children!.Remove(cell);
+ }
+
// ...create a new cell and place at the end of the root collection
cell = new KryptonWorkspaceCell();
SpaceControl!.Root.Children!.Add(cell);
@@ -811,7 +817,7 @@ protected KryptonSpace? SpaceControl
///
/// Source of the event.
/// A KryptonPageEventArgs containing the event data.
- protected virtual void OnSpaceCellPageInserting(object sender, KryptonPageEventArgs e)
+ protected virtual void OnSpaceCellPageInserting(object? sender, KryptonPageEventArgs e)
{
KryptonDockingManager? dockingManager = DockingManager;
if (dockingManager != null)
@@ -871,7 +877,7 @@ protected virtual void OnSpaceCellPageInserting(object sender, KryptonPageEventA
///
/// Source of the event.
/// A PageDropEventArgs containing the event data.
- protected abstract void RaiseSpacePageDrop(object sender, PageDropEventArgs e);
+ protected abstract void RaiseSpacePageDrop(object? sender, PageDropEventArgs e);
///
/// Perform docking element specific actions based on the loading xml.
@@ -899,7 +905,7 @@ protected override void LoadDockingElement(XmlReader xmlReader, KryptonPageColle
#endregion
#region Implementation
- private void OnSpaceDisposed(object sender, EventArgs e)
+ private void OnSpaceDisposed(object? sender, EventArgs e)
{
// Unhook from events to prevent memory leaking
if (SpaceControl != null)
@@ -913,7 +919,7 @@ private void OnSpaceDisposed(object sender, EventArgs e)
RaiseRemoved();
}
- private void OnSpaceCellAdding(object sender, WorkspaceCellEventArgs e)
+ private void OnSpaceCellAdding(object? sender, WorkspaceCellEventArgs e)
{
var childMinSize = e.Cell.GetMinSize();
if (SpaceControl != null)
@@ -928,16 +934,17 @@ private void OnSpaceCellAdding(object sender, WorkspaceCellEventArgs e)
e.Cell.Disposed += OnSpaceCellRemoved;
}
- private void OnSpaceCellRemoved(object sender, EventArgs e)
+ private void OnSpaceCellRemoved(object? sender, EventArgs e)
{
// Remove event hooks so cell can be garbage collected
- var cell = (KryptonWorkspaceCell)sender;
- cell.Disposed -= OnSpaceCellRemoved;
-
- RaiseCellRemoved(cell);
+ if (sender is KryptonWorkspaceCell cell)
+ {
+ cell.Disposed -= OnSpaceCellRemoved;
+ RaiseCellRemoved(cell);
+ }
}
- private void OnSpaceControlPageLoading(object sender, PageLoadingEventArgs e)
+ private void OnSpaceControlPageLoading(object? sender, PageLoadingEventArgs e)
{
KryptonDockingManager? dockingManager = DockingManager;
if (dockingManager != null)
@@ -947,7 +954,7 @@ private void OnSpaceControlPageLoading(object sender, PageLoadingEventArgs e)
}
}
- private void OnSpaceControlPageSaving(object sender, PageSavingEventArgs e)
+ private void OnSpaceControlPageSaving(object? sender, PageSavingEventArgs e)
{
KryptonDockingManager? dockingManager = DockingManager;
if (dockingManager != null)
@@ -957,7 +964,7 @@ private void OnSpaceControlPageSaving(object sender, PageSavingEventArgs e)
}
}
- private void OnSpaceControlRecreateLoadingPage(object sender, RecreateLoadingPageEventArgs e)
+ private void OnSpaceControlRecreateLoadingPage(object? sender, RecreateLoadingPageEventArgs e)
{
KryptonDockingManager? dockingManager = DockingManager;
dockingManager?.RaiseRecreateLoadingPage(e);
diff --git a/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingWorkspace.cs b/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingWorkspace.cs
index eca36952a..9d92f7619 100644
--- a/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingWorkspace.cs
+++ b/Source/Krypton Components/Krypton.Docking/Elements Impl/KryptonDockingWorkspace.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -567,7 +567,7 @@ protected override void RaiseCellRemoved(KryptonWorkspaceCell cell)
///
/// Source of the event.
/// A PageDropEventArgs containing the event data.
- protected override void RaiseSpacePageDrop(object sender, PageDropEventArgs e)
+ protected override void RaiseSpacePageDrop(object? sender, PageDropEventArgs e)
{
// Use event to indicate the page is moving to a workspace and allow it to be cancelled
KryptonDockingManager? dockingManager = DockingManager;
@@ -592,7 +592,7 @@ protected override void RaiseSpacePageDrop(object sender, PageDropEventArgs e)
#endregion
#region Implementation
- private void OnDockableWorkspaceBeforePageDrag(object sender, PageDragCancelEventArgs e)
+ private void OnDockableWorkspaceBeforePageDrag(object? sender, PageDragCancelEventArgs e)
{
// Validate the list of names to those that are still present in the dockspace
var pages = new List();
diff --git a/Source/Krypton Components/Krypton.Docking/Event Args/AutoHiddenGroupEventArgs.cs b/Source/Krypton Components/Krypton.Docking/Event Args/AutoHiddenGroupEventArgs.cs
index 08e234066..8661894c6 100644
--- a/Source/Krypton Components/Krypton.Docking/Event Args/AutoHiddenGroupEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Docking/Event Args/AutoHiddenGroupEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Event Args/AutoHiddenGroupPanelEventArgs.cs b/Source/Krypton Components/Krypton.Docking/Event Args/AutoHiddenGroupPanelEventArgs.cs
index 6a16ab8c2..d9f3b6f85 100644
--- a/Source/Krypton Components/Krypton.Docking/Event Args/AutoHiddenGroupPanelEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Docking/Event Args/AutoHiddenGroupPanelEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Event Args/AutoHiddenSeparatorResizeEventArgs.cs b/Source/Krypton Components/Krypton.Docking/Event Args/AutoHiddenSeparatorResizeEventArgs.cs
index 50100aef9..15129af4f 100644
--- a/Source/Krypton Components/Krypton.Docking/Event Args/AutoHiddenSeparatorResizeEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Docking/Event Args/AutoHiddenSeparatorResizeEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Event Args/AutoHiddenShowingStateEventArgs.cs b/Source/Krypton Components/Krypton.Docking/Event Args/AutoHiddenShowingStateEventArgs.cs
index d6083e227..8aea5dcbc 100644
--- a/Source/Krypton Components/Krypton.Docking/Event Args/AutoHiddenShowingStateEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Docking/Event Args/AutoHiddenShowingStateEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Event Args/CancelDropDownEventArgs.cs b/Source/Krypton Components/Krypton.Docking/Event Args/CancelDropDownEventArgs.cs
index ab7095786..9380ec2e9 100644
--- a/Source/Krypton Components/Krypton.Docking/Event Args/CancelDropDownEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Docking/Event Args/CancelDropDownEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Event Args/CancelUniqueNameEventArgs.cs b/Source/Krypton Components/Krypton.Docking/Event Args/CancelUniqueNameEventArgs.cs
index 445206b7c..1f82f4e2d 100644
--- a/Source/Krypton Components/Krypton.Docking/Event Args/CancelUniqueNameEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Docking/Event Args/CancelUniqueNameEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Event Args/CloseRequestEventArgs.cs b/Source/Krypton Components/Krypton.Docking/Event Args/CloseRequestEventArgs.cs
index 23b9e0d1d..7511386c3 100644
--- a/Source/Krypton Components/Krypton.Docking/Event Args/CloseRequestEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Docking/Event Args/CloseRequestEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Event Args/ContextPageEventArgs.cs b/Source/Krypton Components/Krypton.Docking/Event Args/ContextPageEventArgs.cs
index a5139dfbf..6eb018388 100644
--- a/Source/Krypton Components/Krypton.Docking/Event Args/ContextPageEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Docking/Event Args/ContextPageEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Event Args/DockGlobalLoadingEventArgs.cs b/Source/Krypton Components/Krypton.Docking/Event Args/DockGlobalLoadingEventArgs.cs
index 19033cada..62f4aee07 100644
--- a/Source/Krypton Components/Krypton.Docking/Event Args/DockGlobalLoadingEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Docking/Event Args/DockGlobalLoadingEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Event Args/DockGlobalSavingEventArgs.cs b/Source/Krypton Components/Krypton.Docking/Event Args/DockGlobalSavingEventArgs.cs
index e83aae093..6c9d77137 100644
--- a/Source/Krypton Components/Krypton.Docking/Event Args/DockGlobalSavingEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Docking/Event Args/DockGlobalSavingEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Event Args/DockPageLoadingEventArgs.cs b/Source/Krypton Components/Krypton.Docking/Event Args/DockPageLoadingEventArgs.cs
index 6253c7096..a7365f6e8 100644
--- a/Source/Krypton Components/Krypton.Docking/Event Args/DockPageLoadingEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Docking/Event Args/DockPageLoadingEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Event Args/DockPageSavingEventArgs.cs b/Source/Krypton Components/Krypton.Docking/Event Args/DockPageSavingEventArgs.cs
index c6a18c6f7..2cad29fb2 100644
--- a/Source/Krypton Components/Krypton.Docking/Event Args/DockPageSavingEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Docking/Event Args/DockPageSavingEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Event Args/DockableNavigatorEventArgs.cs b/Source/Krypton Components/Krypton.Docking/Event Args/DockableNavigatorEventArgs.cs
index 78ab03f33..1cc00b59a 100644
--- a/Source/Krypton Components/Krypton.Docking/Event Args/DockableNavigatorEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Docking/Event Args/DockableNavigatorEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Event Args/DockableWorkspaceCellEventArgs.cs b/Source/Krypton Components/Krypton.Docking/Event Args/DockableWorkspaceCellEventArgs.cs
index 0c35de172..f3edd913a 100644
--- a/Source/Krypton Components/Krypton.Docking/Event Args/DockableWorkspaceCellEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Docking/Event Args/DockableWorkspaceCellEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Event Args/DockableWorkspaceEventArgs.cs b/Source/Krypton Components/Krypton.Docking/Event Args/DockableWorkspaceEventArgs.cs
index 5c95ace3d..ddf3026ae 100644
--- a/Source/Krypton Components/Krypton.Docking/Event Args/DockableWorkspaceEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Docking/Event Args/DockableWorkspaceEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Event Args/DockspaceCellEventArgs.cs b/Source/Krypton Components/Krypton.Docking/Event Args/DockspaceCellEventArgs.cs
index 5928c4d92..eec7daf90 100644
--- a/Source/Krypton Components/Krypton.Docking/Event Args/DockspaceCellEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Docking/Event Args/DockspaceCellEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Event Args/DockspaceEventArgs.cs b/Source/Krypton Components/Krypton.Docking/Event Args/DockspaceEventArgs.cs
index 7a482a40f..e0beb3c69 100644
--- a/Source/Krypton Components/Krypton.Docking/Event Args/DockspaceEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Docking/Event Args/DockspaceEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Event Args/DockspaceSeparatorEventArgs.cs b/Source/Krypton Components/Krypton.Docking/Event Args/DockspaceSeparatorEventArgs.cs
index bd20c5e8a..a57ba34b5 100644
--- a/Source/Krypton Components/Krypton.Docking/Event Args/DockspaceSeparatorEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Docking/Event Args/DockspaceSeparatorEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Event Args/DockspaceSeparatorResizeEventArgs.cs b/Source/Krypton Components/Krypton.Docking/Event Args/DockspaceSeparatorResizeEventArgs.cs
index 568caa46a..da7f2e8ee 100644
--- a/Source/Krypton Components/Krypton.Docking/Event Args/DockspaceSeparatorResizeEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Docking/Event Args/DockspaceSeparatorResizeEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Event Args/FloatingWindowEventArgs.cs b/Source/Krypton Components/Krypton.Docking/Event Args/FloatingWindowEventArgs.cs
index aea62eee4..aa3d45660 100644
--- a/Source/Krypton Components/Krypton.Docking/Event Args/FloatingWindowEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Docking/Event Args/FloatingWindowEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Event Args/FloatspaceCellEventArgs.cs b/Source/Krypton Components/Krypton.Docking/Event Args/FloatspaceCellEventArgs.cs
index f36ef7c4e..29c275c6f 100644
--- a/Source/Krypton Components/Krypton.Docking/Event Args/FloatspaceCellEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Docking/Event Args/FloatspaceCellEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Event Args/FloatspaceEventArgs.cs b/Source/Krypton Components/Krypton.Docking/Event Args/FloatspaceEventArgs.cs
index 62ea9f462..3346532c7 100644
--- a/Source/Krypton Components/Krypton.Docking/Event Args/FloatspaceEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Docking/Event Args/FloatspaceEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Event Args/PagesEventArgs.cs b/Source/Krypton Components/Krypton.Docking/Event Args/PagesEventArgs.cs
index db38e1e88..926abb7f0 100644
--- a/Source/Krypton Components/Krypton.Docking/Event Args/PagesEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Docking/Event Args/PagesEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Event Args/ScreenAndOffsetEventArgs.cs b/Source/Krypton Components/Krypton.Docking/Event Args/ScreenAndOffsetEventArgs.cs
index df4c8e9b1..ab5b35e94 100644
--- a/Source/Krypton Components/Krypton.Docking/Event Args/ScreenAndOffsetEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Docking/Event Args/ScreenAndOffsetEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Event Args/StorePageEventArgs.cs b/Source/Krypton Components/Krypton.Docking/Event Args/StorePageEventArgs.cs
index a5e2e83be..0ce4e7b92 100644
--- a/Source/Krypton Components/Krypton.Docking/Event Args/StorePageEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Docking/Event Args/StorePageEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Event Args/UniqueNameEventArgs.cs b/Source/Krypton Components/Krypton.Docking/Event Args/UniqueNameEventArgs.cs
index 1ccbcf775..b7667795d 100644
--- a/Source/Krypton Components/Krypton.Docking/Event Args/UniqueNameEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Docking/Event Args/UniqueNameEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Event Args/UniqueNamesEventArgs.cs b/Source/Krypton Components/Krypton.Docking/Event Args/UniqueNamesEventArgs.cs
index 3833640a5..4f328fdad 100644
--- a/Source/Krypton Components/Krypton.Docking/Event Args/UniqueNamesEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Docking/Event Args/UniqueNamesEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/General/Definitions.cs b/Source/Krypton Components/Krypton.Docking/General/Definitions.cs
index 4e086be22..46942a04e 100644
--- a/Source/Krypton Components/Krypton.Docking/General/Definitions.cs
+++ b/Source/Krypton Components/Krypton.Docking/General/Definitions.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/General/DockingHelper.cs b/Source/Krypton Components/Krypton.Docking/General/DockingHelper.cs
index d717f5cb3..b64dea714 100644
--- a/Source/Krypton Components/Krypton.Docking/General/DockingHelper.cs
+++ b/Source/Krypton Components/Krypton.Docking/General/DockingHelper.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -37,8 +37,9 @@ public static DockStyle DockStyleFromDockEdge(DockingEdge edge, bool opposite)
case DockingEdge.Right:
return (opposite ? DockStyle.Left : DockStyle.Right);
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(edge.ToString());
return DockStyle.Top;
}
}
diff --git a/Source/Krypton Components/Krypton.Docking/General/DockingMultiUpdate.cs b/Source/Krypton Components/Krypton.Docking/General/DockingMultiUpdate.cs
index 7425f103f..70977f618 100644
--- a/Source/Krypton Components/Krypton.Docking/General/DockingMultiUpdate.cs
+++ b/Source/Krypton Components/Krypton.Docking/General/DockingMultiUpdate.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/General/ObscureControl.cs b/Source/Krypton Components/Krypton.Docking/General/ObscureControl.cs
index b34345ce8..297369c65 100644
--- a/Source/Krypton Components/Krypton.Docking/General/ObscureControl.cs
+++ b/Source/Krypton Components/Krypton.Docking/General/ObscureControl.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Global/GlobalDeclarations.cs b/Source/Krypton Components/Krypton.Docking/Global/GlobalDeclarations.cs
index 3beadadbb..be26716ac 100644
--- a/Source/Krypton Components/Krypton.Docking/Global/GlobalDeclarations.cs
+++ b/Source/Krypton Components/Krypton.Docking/Global/GlobalDeclarations.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Krypton.Docking 2022.csproj b/Source/Krypton Components/Krypton.Docking/Krypton.Docking 2022.csproj
index 7bb865a3a..4083dd575 100644
--- a/Source/Krypton Components/Krypton.Docking/Krypton.Docking 2022.csproj
+++ b/Source/Krypton Components/Krypton.Docking/Krypton.Docking 2022.csproj
@@ -1,126 +1,120 @@

-
-
-
- net462;net47;net471;net472;net48;net481;net6.0-windows;net7.0-windows;net8.0-windows
-
-
-
-
-
-
- net462;net47;net471;net472;net48;net481;net6.0-windows;net7.0-windows;net8.0-windows
-
-
-
-
- net48;net481;net6.0-windows;net7.0-windows
+
+
+
+ net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows
+
+
+
+
+ net48;net481;net8.0-windows;net9.0-windows
- net462;net47;net471;net472;net48;net481;net6.0-windows;net7.0-windows;net8.0-windows
-
-
-
-
-
+ net462;net47;net471;net472;net48;net481;net8.0-windows
+
+
+
-
- Library
- Krypton.Docking
- Krypton.Docking
-
- false
- Krypton.ico
- false
- true
- AnyCPU
- true
- en
- true
- Debug;Release;Installer;Nightly;Canary
- preview
- enable
- 6
- true
-
+
+ Library
+ Krypton.Docking
+ Krypton.Docking
+
+ false
+ Krypton.ico
+ false
+ true
+ AnyCPU
+ true
+ en
+ true
+ Debug;Release;Installer;Nightly;Canary
+ enable
+
+ 8
+ latest
+ true
+
+ true
+
-
- Krypton.Docking
- This is the docking module.
-
+
+ Krypton.Docking
+ This is the docking module.
+
-
-
- True
- 4.0.0.0
-
-
-
+
+
+ True
+ 4.0.0.0
+
+
+
-
- True
-
+
+ True
+
-
- build$([System.DateTime]::UtcNow.ToString("yyyy-MM-ddTHH:mm:ss:fffZ"))
-
+
+ build$([System.DateTime]::UtcNow.ToString("yyyy-MM-ddTHH:mm:ss:fffZ"))
+
-
-
-
- General\PlatformInvoke.cs
-
-
-
- Component
-
-
- Component
-
-
- Component
-
-
- Component
-
-
- True
- True
- GenericImageResources.resx
-
-
-
-
-
-
-
-
+
+
+
+ General\PlatformInvoke.cs
+
+
+
+ Component
+
+
+ Component
+
+
+ Component
+
+
+ Component
+
+
+ True
+ True
+ GenericImageResources.resx
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
- ResXFileCodeGenerator
- GenericImageResources.Designer.cs
-
-
-
- ..\..\..\Bin\$(Configuration)\Krypton.Docking.xml
- ..\..\..\Bin\$(Configuration)\
-
-
- 1701;1702
- True
- StrongKrypton.snk
- License.md
- True
-
+
+
+
+
+
+
+
+ ResXFileCodeGenerator
+ GenericImageResources.Designer.cs
+
+
+
+ true
+ ..\..\..\Bin\$(Configuration)\
+
+
+ 1701;1702
+ True
+ StrongKrypton.snk
+ License.md
+ True
+
-
- True
-
+
+ True
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Docking/Krypton.Docking.licenseheader b/Source/Krypton Components/Krypton.Docking/Krypton.Docking.licenseheader
index 2be35dedf..4a5f245b6 100644
--- a/Source/Krypton Components/Krypton.Docking/Krypton.Docking.licenseheader
+++ b/Source/Krypton Components/Krypton.Docking/Krypton.Docking.licenseheader
@@ -6,7 +6,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/Palette/DockingManagerStrings.cs b/Source/Krypton Components/Krypton.Docking/Palette/DockingManagerStrings.cs
index 6423860f5..78f22a9cc 100644
--- a/Source/Krypton Components/Krypton.Docking/Palette/DockingManagerStrings.cs
+++ b/Source/Krypton Components/Krypton.Docking/Palette/DockingManagerStrings.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -72,13 +72,14 @@ public DockingManagerStrings(KryptonDockingManager docking)
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => (_textAutoHide.Equals(DEFAULT_TEXT_AUTO_HIDE) &&
- _textClose.Equals(DEFAULT_TEXT_CLOSE) &&
- _textDock.Equals(DEFAULT_TEXT_DOCK) &&
- _textFloat.Equals(DEFAULT_TEXT_FLOAT) &&
- _textHide.Equals(DEFAULT_TEXT_HIDE) &&
- _textTabbedDocument.Equals(DEFAULT_TEXT_TABBED_DOCUMENT) &&
- _textWindowLocation.Equals(DEFAULT_TEXT_WINDOW_LOCATION));
+ _textClose.Equals(DEFAULT_TEXT_CLOSE) &&
+ _textDock.Equals(DEFAULT_TEXT_DOCK) &&
+ _textFloat.Equals(DEFAULT_TEXT_FLOAT) &&
+ _textHide.Equals(DEFAULT_TEXT_HIDE) &&
+ _textTabbedDocument.Equals(DEFAULT_TEXT_TABBED_DOCUMENT) &&
+ _textWindowLocation.Equals(DEFAULT_TEXT_WINDOW_LOCATION));
#endregion
diff --git a/Source/Krypton Components/Krypton.Docking/ViewDraw/ViewDrawAutoHiddenTab.cs b/Source/Krypton Components/Krypton.Docking/ViewDraw/ViewDrawAutoHiddenTab.cs
index c9a672260..599b092a8 100644
--- a/Source/Krypton Components/Krypton.Docking/ViewDraw/ViewDrawAutoHiddenTab.cs
+++ b/Source/Krypton Components/Krypton.Docking/ViewDraw/ViewDrawAutoHiddenTab.cs
@@ -5,11 +5,12 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
+// ReSharper disable RedundantNullableFlowAttribute
namespace Krypton.Docking
{
///
@@ -31,9 +32,9 @@ internal class ViewDrawAutoHiddenTab : ViewDrawButton,
/// Visual orientation used for drawing the tab.
public ViewDrawAutoHiddenTab([DisallowNull] KryptonPage page,
VisualOrientation orientation)
- : base(page.StateDisabled.CheckButton,
+ : base(page.StateDisabled.CheckButton,
page.StateNormal.CheckButton,
- page.StateTracking.CheckButton,
+ page.StateTracking.CheckButton,
page.StatePressed.CheckButton,
null, null, orientation, false)
{
diff --git a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavClose.cs b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavClose.cs
index f67174e5f..417329791 100644
--- a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavClose.cs
+++ b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavClose.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -34,7 +34,7 @@ public ButtonSpecNavClose(KryptonNavigator navigator)
///
/// Palette to use for inheriting values.
/// Button visibility.
- public override bool GetVisible(PaletteBase? palette)
+ public override bool GetVisible(PaletteBase palette)
{
switch (Navigator.Button.CloseButtonDisplay)
{
@@ -48,8 +48,9 @@ public override bool GetVisible(PaletteBase? palette)
case ButtonDisplay.Logic:
return true;
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(Navigator.Button.CloseButtonDisplay.ToString());
return false;
}
}
@@ -59,7 +60,7 @@ public override bool GetVisible(PaletteBase? palette)
///
/// Palette to use for inheriting values.
/// Button enabled state.
- public override ButtonEnabled GetEnabled(PaletteBase? palette)
+ public override ButtonEnabled GetEnabled(PaletteBase palette)
{
switch (Navigator.Button.CloseButtonDisplay)
{
@@ -74,8 +75,9 @@ public override ButtonEnabled GetEnabled(PaletteBase? palette)
// Only enabled if a page is selected
return (Navigator.SelectedPage != null) ? ButtonEnabled.True : ButtonEnabled.False;
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(Navigator.Button.CloseButtonDisplay.ToString());
return ButtonEnabled.False;
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavContext.cs b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavContext.cs
index f5e8a895b..694771b71 100644
--- a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavContext.cs
+++ b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavContext.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -38,7 +38,7 @@ public ButtonSpecNavContext(KryptonNavigator navigator)
///
/// Palette to use for inheriting values.
/// Button visibiliy.
- public override bool GetVisible(PaletteBase? palette)
+ public override bool GetVisible(PaletteBase palette)
{
switch (Navigator.Button.ContextButtonDisplay)
{
@@ -49,6 +49,7 @@ public override bool GetVisible(PaletteBase? palette)
case ButtonDisplay.ShowEnabled:
// Always show
return true;
+
case ButtonDisplay.Logic:
// Use button display logic to determine actual operation
switch (Navigator.Button.ButtonDisplayLogic)
@@ -60,13 +61,16 @@ public override bool GetVisible(PaletteBase? palette)
case ButtonDisplayLogic.ContextNextPrevious:
return true;
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(Navigator.Button.ButtonDisplayLogic.ToString());
return false;
}
+
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(Navigator.Button.ContextButtonDisplay.ToString());
return false;
}
}
@@ -76,7 +80,7 @@ public override bool GetVisible(PaletteBase? palette)
///
/// Palette to use for inheriting values.
/// Button enabled state.
- public override ButtonEnabled GetEnabled(PaletteBase? palette)
+ public override ButtonEnabled GetEnabled(PaletteBase palette)
{
switch (Navigator.Button.ContextButtonDisplay)
{
@@ -91,8 +95,9 @@ public override ButtonEnabled GetEnabled(PaletteBase? palette)
// Only enabled if there is a selected page
return (Navigator.SelectedPage != null ? ButtonEnabled.True : ButtonEnabled.False);
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(Navigator.Button.ContextButtonDisplay.ToString());
return ButtonEnabled.False;
}
diff --git a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavFixed.cs b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavFixed.cs
index 9895250a4..b8c4421a0 100644
--- a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavFixed.cs
+++ b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavFixed.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -35,7 +35,7 @@ protected ButtonSpecNavFixed([DisallowNull] KryptonNavigator navigator,
Debug.Assert(navigator != null);
// Remember back reference to owning navigator.
- Navigator = navigator;
+ Navigator = navigator ?? throw new ArgumentNullException(nameof(navigator));
// Fix the type
ProtectedType = fixedStyle;
@@ -50,8 +50,9 @@ protected ButtonSpecNavFixed([DisallowNull] KryptonNavigator navigator,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => (base.IsDefault &&
- (HeaderLocation == HeaderLocation.PrimaryHeader));
+ (HeaderLocation == HeaderLocation.PrimaryHeader));
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavFixedConverter.cs b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavFixedConverter.cs
index c1d1cb7ea..a196e12ed 100644
--- a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavFixedConverter.cs
+++ b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavFixedConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavFormClose.cs b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavFormClose.cs
index 744253fa1..01532bbef 100644
--- a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavFormClose.cs
+++ b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavFormClose.cs
@@ -2,7 +2,7 @@
/*
*
* 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. 2023 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2024. All rights reserved.
*
*/
#endregion
@@ -15,7 +15,7 @@ public class ButtonSpecNavFormClose : ButtonSpecNavFixed
private bool _enabled = true;
- private KryptonNavigator _navigator;
+ private readonly KryptonNavigator _navigator;
#endregion
@@ -59,22 +59,15 @@ public bool Enabled
#region ButtonSpecNavFixed Implementation
- 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
- if (_navigator.Owner!.ApplyComposition && _navigator.Owner.ApplyCustomChrome)
- {
- return false;
- }
-
+ ///
+ public override bool GetVisible(PaletteBase palette) =>
// Have all buttons been turned off?
- return _navigator.Owner.ControlBox && _navigator.Owner.CloseBox;
- }
+ _navigator.Owner!.ControlBox && _navigator.Owner.CloseBox;
+
public override ButtonCheckState GetChecked(PaletteBase? palette) => ButtonCheckState.NotCheckButton;
- public override ButtonEnabled GetEnabled(PaletteBase? palette) => _navigator.Owner!.CloseBox && Enabled ? ButtonEnabled.True : ButtonEnabled.False;
+ public override ButtonEnabled GetEnabled(PaletteBase palette) => _navigator.Owner!.CloseBox && Enabled ? ButtonEnabled.True : ButtonEnabled.False;
#endregion
@@ -88,7 +81,7 @@ protected override void OnClick(EventArgs e)
{
var mea = (MouseEventArgs)e;
- if (GetView()!.ClientRectangle.Contains(mea.Location))
+ if (GetView().ClientRectangle.Contains(mea.Location))
{
PropertyInfo? propertyInfo = typeof(Form).GetProperty(nameof(CloseReason),
BindingFlags.Instance | BindingFlags.SetProperty | BindingFlags.NonPublic);
diff --git a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavFormMaximize.cs b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavFormMaximize.cs
index 5b08f8429..6b7fd4537 100644
--- a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavFormMaximize.cs
+++ b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavFormMaximize.cs
@@ -2,7 +2,7 @@
/*
*
* 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. 2023 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2024. All rights reserved.
*
*/
#endregion
@@ -13,7 +13,7 @@ public class ButtonSpecNavFormMaximize : ButtonSpecNavFixed
{
#region Instance Fields
- private KryptonNavigator _navigator;
+ private readonly KryptonNavigator _navigator;
#endregion
@@ -30,15 +30,8 @@ public ButtonSpecNavFormMaximize(KryptonNavigator navigator) : base(navigator, P
#region ButtonSpecNavFixed Implementation
- public override bool GetVisible(PaletteBase? 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
- if (_navigator.Owner!.ApplyComposition && _navigator.Owner!.ApplyCustomChrome)
- {
- return false;
- }
-
// The maximize button is never present on tool windows
switch (_navigator.Owner!.FormBorderStyle)
{
@@ -59,7 +52,7 @@ public override bool GetVisible(PaletteBase? palette)
public override ButtonCheckState GetChecked(PaletteBase? palette) => ButtonCheckState.NotCheckButton;
- public override ButtonEnabled GetEnabled(PaletteBase? palette) =>
+ public override ButtonEnabled GetEnabled(PaletteBase palette) =>
// Has the maximize buttons been turned off?
_navigator.Owner!.MaximizeBox ? ButtonEnabled.True : ButtonEnabled.False;
@@ -77,7 +70,7 @@ protected override void OnClick(EventArgs e)
{
// Only if the mouse is still within the button bounds do we perform action
var mea = (MouseEventArgs)e;
- if (GetView()!.ClientRectangle.Contains(mea.Location))
+ if (GetView().ClientRectangle.Contains(mea.Location))
{
// Toggle between maximized and restored
/*_navigator.Owner!.SendSysCommand(_navigator.Owner!.WindowState == FormWindowState.Maximized
diff --git a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavFormMinimize.cs b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavFormMinimize.cs
index 9bd624fe4..a2f48b6ca 100644
--- a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavFormMinimize.cs
+++ b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavFormMinimize.cs
@@ -2,7 +2,7 @@
/*
*
* 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. 2023 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2024. All rights reserved.
*
*/
#endregion
@@ -15,10 +15,10 @@ public ButtonSpecNavFormMinimize(KryptonNavigator navigator) : base(navigator, P
{
}
- public override bool GetVisible(PaletteBase? palette) => throw new NotImplementedException();
+ public override bool GetVisible(PaletteBase palette) => throw new NotImplementedException();
public override ButtonCheckState GetChecked(PaletteBase? palette) => throw new NotImplementedException();
- public override ButtonEnabled GetEnabled(PaletteBase? palette) => throw new NotImplementedException();
+ public override ButtonEnabled GetEnabled(PaletteBase palette) => throw new NotImplementedException();
}
}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavManagerLayoutBar.cs b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavManagerLayoutBar.cs
index 61a10a304..765c75409 100644
--- a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavManagerLayoutBar.cs
+++ b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavManagerLayoutBar.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -32,15 +32,15 @@ internal class ButtonSpecNavManagerLayoutBar : ButtonSpecManagerLayout
/// Delegate for returning a tool strip renderer.
/// Delegate for notifying paint requests.
public ButtonSpecNavManagerLayoutBar(Control control,
- PaletteRedirect? redirector,
- ButtonSpecCollectionBase variableSpecs,
+ PaletteRedirect redirector,
+ ButtonSpecCollectionBase? variableSpecs,
ViewLayoutDocker[] viewDockers,
IPaletteMetric[] viewMetrics,
PaletteMetricInt[] viewMetricIntOutside,
PaletteMetricInt[] viewMetricIntInside,
PaletteMetricPadding[] viewMetricPaddings,
GetToolStripRenderer getRenderer,
- NeedPaintHandler needPaint)
+ NeedPaintHandler? needPaint)
: this(control, redirector, variableSpecs,
null, viewDockers, viewMetrics,
viewMetricIntOutside, viewMetricIntInside,
@@ -63,8 +63,8 @@ public ButtonSpecNavManagerLayoutBar(Control control,
/// Delegate for returning a tool strip renderer.
/// Delegate for notifying paint requests.
public ButtonSpecNavManagerLayoutBar(Control control,
- PaletteRedirect? redirector,
- ButtonSpecCollectionBase variableSpecs,
+ PaletteRedirect redirector,
+ ButtonSpecCollectionBase? variableSpecs,
ButtonSpecCollectionBase? fixedSpecs,
ViewLayoutDocker[] viewDockers,
IPaletteMetric[] viewMetrics,
@@ -72,11 +72,11 @@ public ButtonSpecNavManagerLayoutBar(Control control,
PaletteMetricInt[] viewMetricIntInside,
PaletteMetricPadding[] viewMetricPaddings,
GetToolStripRenderer getRenderer,
- NeedPaintHandler needPaint)
+ NeedPaintHandler? needPaint)
: base(control, redirector, variableSpecs, fixedSpecs,
viewDockers, viewMetrics, viewMetricIntOutside,
viewMetricIntInside, viewMetricPaddings, getRenderer,
- needPaint) =>
+ needPaint!) =>
RemapTarget = ButtonSpecNavRemap.ButtonSpecRemapTarget.LabelPanel;
#endregion
@@ -205,7 +205,7 @@ public void SetRemapTarget(ButtonStyle style)
/// Base palette class.
/// ButtonSpec instance.
/// Palette redirector for the button spec instance.
- public override PaletteRedirect CreateButtonSpecRemap(PaletteRedirect? redirector,
+ public override PaletteRedirect CreateButtonSpecRemap(PaletteRedirect redirector,
ButtonSpec buttonSpec) =>
new ButtonSpecNavRemap(redirector, buttonSpec, RemapTarget);
diff --git a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavManagerLayoutHeaderBar.cs b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavManagerLayoutHeaderBar.cs
index ed8ac85e4..6ea965582 100644
--- a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavManagerLayoutHeaderBar.cs
+++ b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavManagerLayoutHeaderBar.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -40,8 +40,8 @@ internal class ButtonSpecNavManagerLayoutHeaderBar : ButtonSpecManagerLayout
/// Palette source for color remapping.
/// Palette state for color remapping.
public ButtonSpecNavManagerLayoutHeaderBar(Control control,
- PaletteRedirect? redirector,
- ButtonSpecCollectionBase variableSpecs,
+ PaletteRedirect redirector,
+ ButtonSpecCollectionBase? variableSpecs,
ButtonSpecCollectionBase? fixedSpecs,
ViewLayoutDocker[] viewDockers,
IPaletteMetric[] viewMetrics,
@@ -80,7 +80,7 @@ public void UpdateRemapping(IPaletteContent? paletteContent,
foreach (ButtonSpecView view in ButtonSpecViews)
{
// Cast the remapping palette to the correct type
- var remapPalette = (ButtonSpecRemapByContentCache)view.RemapPalette!;
+ var remapPalette = (ButtonSpecRemapByContentCache)view.RemapPalette;
remapPalette.SetPaletteContent(_paletteContent);
remapPalette.SetPaletteState(_paletteState);
}
@@ -92,7 +92,7 @@ public void UpdateRemapping(IPaletteContent? paletteContent,
/// Base palette class.
/// ButtonSpec instance.
/// Palette redirector for the button spec instance.
- public override PaletteRedirect CreateButtonSpecRemap(PaletteRedirect? redirector,
+ public override PaletteRedirect CreateButtonSpecRemap(PaletteRedirect redirector,
ButtonSpec buttonSpec) =>
new ButtonSpecRemapByContentCache(redirector, buttonSpec);
@@ -111,11 +111,11 @@ public override PaletteRedirect CreateButtonSpecRemap(PaletteRedirect? redirecto
/// Associated ButtonSpecView instance.
/// Index of view docker button is placed onto.
protected override void ButtonSpecCreated(ButtonSpec buttonSpec,
- ButtonSpecView buttonView,
+ ButtonSpecView? buttonView,
int viewDockerIndex)
{
// Cast the remapping palette to the correct type
- var remapPalette = (ButtonSpecRemapByContentCache)buttonView.RemapPalette!;
+ var remapPalette = (ButtonSpecRemapByContentCache)buttonView?.RemapPalette!;
// Update button with the foreground used for color mapping
remapPalette.SetPaletteContent(_paletteContent);
diff --git a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavNext.cs b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavNext.cs
index 8557d41a6..c2e10a8b0 100644
--- a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavNext.cs
+++ b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavNext.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -34,7 +34,7 @@ public ButtonSpecNavNext(KryptonNavigator navigator)
///
/// Palette to use for inheriting values.
/// Button visibiliy.
- public override bool GetVisible(PaletteBase? palette)
+ public override bool GetVisible(PaletteBase palette)
{
switch (Navigator.Button.NextButtonDisplay)
{
@@ -56,13 +56,15 @@ public override bool GetVisible(PaletteBase? palette)
case ButtonDisplayLogic.ContextNextPrevious:
return true;
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(Navigator.Button.ButtonDisplayLogic.ToString());
return false;
}
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(Navigator.Button.NextButtonDisplay.ToString());
return false;
}
}
@@ -72,7 +74,7 @@ public override bool GetVisible(PaletteBase? palette)
///
/// Palette to use for inheriting values.
/// Button enabled state.
- public override ButtonEnabled GetEnabled(PaletteBase? palette)
+ public override ButtonEnabled GetEnabled(PaletteBase palette)
{
switch (Navigator.Button.NextButtonDisplay)
{
@@ -86,8 +88,9 @@ public override ButtonEnabled GetEnabled(PaletteBase? palette)
case ButtonDisplay.Logic:
return Navigator.ViewBuilder!.NextActionEnabled(Navigator.Button.NextButtonAction);
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(Navigator.Button.NextButtonDisplay.ToString());
return ButtonEnabled.False;
}
diff --git a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavPrevious.cs b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavPrevious.cs
index 9a6dd1c78..3bcbba8ab 100644
--- a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavPrevious.cs
+++ b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavPrevious.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -33,18 +33,20 @@ public ButtonSpecNavPrevious(KryptonNavigator navigator)
/// Gets the button visible value.
///
/// Palette to use for inheriting values.
- /// Button visibiliy.
- public override bool GetVisible(PaletteBase? palette)
+ /// Button visibility.
+ public override bool GetVisible(PaletteBase palette)
{
switch (Navigator.Button.PreviousButtonDisplay)
{
case ButtonDisplay.Hide:
// Always hide
return false;
+
case ButtonDisplay.ShowDisabled:
case ButtonDisplay.ShowEnabled:
// Always show
return true;
+
case ButtonDisplay.Logic:
// Use button display logic to determine actual operation
switch (Navigator.Button.ButtonDisplayLogic)
@@ -56,13 +58,16 @@ public override bool GetVisible(PaletteBase? palette)
case ButtonDisplayLogic.ContextNextPrevious:
return true;
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(Navigator.Button.ButtonDisplayLogic.ToString());
return false;
}
+
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(Navigator.Button.PreviousButtonDisplay.ToString());
return false;
}
}
@@ -72,7 +77,7 @@ public override bool GetVisible(PaletteBase? palette)
///
/// Palette to use for inheriting values.
/// Button enabled state.
- public override ButtonEnabled GetEnabled(PaletteBase? palette)
+ public override ButtonEnabled GetEnabled(PaletteBase palette)
{
switch (Navigator.Button.PreviousButtonDisplay)
{
@@ -86,8 +91,9 @@ public override ButtonEnabled GetEnabled(PaletteBase? palette)
case ButtonDisplay.Logic:
return Navigator.ViewBuilder!.PreviousActionEnabled(Navigator.Button.PreviousButtonAction);
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(Navigator.Button.PreviousButtonDisplay.ToString());
return ButtonEnabled.False;
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavRemap.cs b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavRemap.cs
index f06ed1843..0971eeb40 100644
--- a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavRemap.cs
+++ b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavRemap.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -127,14 +127,14 @@ public enum ButtonSpecRemapTarget
/// Initial palette target for redirection.
/// Reference to button specification.
/// Target for remapping the color onto.
- public ButtonSpecNavRemap(PaletteBase? target,
- [DisallowNull] ButtonSpec buttonSpec,
+ public ButtonSpecNavRemap(PaletteBase target,
+ [DisallowNull] ButtonSpec buttonSpec,
ButtonSpecRemapTarget remapTarget)
: base(target)
{
Debug.Assert(buttonSpec != null);
- _buttonSpec = buttonSpec;
+ _buttonSpec = buttonSpec!;
_remapTarget = remapTarget;
}
#endregion
@@ -319,8 +319,9 @@ private Color GetRemapTarget(PaletteState state)
case ButtonSpecRemapTarget.TabCustom3:
return base.GetContentShortTextColor1(PaletteContentStyle.TabCustom3, state);
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(_remapTarget.ToString());
return Color.Black;
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavigator.cs b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavigator.cs
index 6993b7589..fced334fb 100644
--- a/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavigator.cs
+++ b/Source/Krypton Components/Krypton.Navigator/ButtonSpecs/ButtonSpecNavigator.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -110,8 +110,9 @@ private PaletteButtonSpecStyle NavigatorToPaletteType(PaletteNavButtonSpecStyle
case PaletteNavButtonSpecStyle.RibbonExpand:
return PaletteButtonSpecStyle.RibbonExpand;
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(type.ToString());
return PaletteButtonSpecStyle.Generic;
}
}
@@ -161,8 +162,9 @@ private PaletteNavButtonSpecStyle PaletteTypeToNavigator(PaletteButtonSpecStyle
case PaletteButtonSpecStyle.RibbonExpand:
return PaletteNavButtonSpecStyle.RibbonExpand;
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(type.ToString());
return PaletteNavButtonSpecStyle.Generic;
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/Controller/DragViewController.cs b/Source/Krypton Components/Krypton.Navigator/Controller/DragViewController.cs
index 0b610fca9..42cf60f1a 100644
--- a/Source/Krypton Components/Krypton.Navigator/Controller/DragViewController.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Controller/DragViewController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -77,7 +77,7 @@ public DragViewController([DisallowNull] ViewBase target)
MousePoint = CommonHelper.NullPoint;
AllowDragging = true;
_dragging = false;
- Target = target;
+ Target = target ?? throw new ArgumentNullException(nameof(target));
_lastClick = DateTime.Now.AddDays(-1);
}
#endregion
@@ -301,7 +301,7 @@ public virtual bool KeyUp([DisallowNull] Control c, [DisallowNull] KeyEventArgs
// Recalculate if the mouse is over the button area
// TODO: What is this doing ? i.e. should the return value be used ?
- Target.ClientRectangle.Contains(c.PointToClient(Control.MousePosition));
+ return Target.ClientRectangle.Contains(c.PointToClient(Control.MousePosition));
}
}
@@ -412,7 +412,7 @@ protected virtual void OnLeftMouseDown(EventArgs e)
protected virtual void OnDragStart(Point mousePt, Point offset, Control c)
{
// Convert point from client to screen coordinates
- mousePt = Target.OwningControl.PointToScreen(mousePt);
+ mousePt = Target.OwningControl!.PointToScreen(mousePt);
var ce = new DragStartEventCancelArgs(mousePt, offset, c);
DragStart?.Invoke(this, ce);
@@ -430,7 +430,7 @@ protected virtual void OnDragMove(Point mousePt)
if (DragMove != null)
{
// Convert point from client to screen coordinates
- mousePt = Target.OwningControl.PointToScreen(mousePt);
+ mousePt = Target.OwningControl!.PointToScreen(mousePt);
DragMove(this, new PointEventArgs(mousePt));
}
}
@@ -445,7 +445,7 @@ protected virtual void OnDragEnd(Point mousePt)
if (DragEnd != null)
{
// Convert point from client to screen coordinates
- mousePt = Target.OwningControl.PointToScreen(mousePt);
+ mousePt = Target.OwningControl!.PointToScreen(mousePt);
DragEnd(this, new PointEventArgs(mousePt));
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/Controller/OutlookMiniController.cs b/Source/Krypton Components/Krypton.Navigator/Controller/OutlookMiniController.cs
index 73ee78421..df4e647d4 100644
--- a/Source/Krypton Components/Krypton.Navigator/Controller/OutlookMiniController.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Controller/OutlookMiniController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -352,7 +352,7 @@ protected void UpdateTargetState(Control? c)
/// Mouse point.
protected void UpdateTargetState(Point pt)
{
- // By default the button is in the normal state
+ // By default, the button is in the normal state
PaletteState newState;
// When disabled the button itself is shown as normal, the
diff --git a/Source/Krypton Components/Krypton.Navigator/Controller/PageButtonController.cs b/Source/Krypton Components/Krypton.Navigator/Controller/PageButtonController.cs
index 969505c93..f82e5737c 100644
--- a/Source/Krypton Components/Krypton.Navigator/Controller/PageButtonController.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Controller/PageButtonController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/Controls Navigator/KryptonNavigator.cs b/Source/Krypton Components/Krypton.Navigator/Controls Navigator/KryptonNavigator.cs
index a300935c2..95afdaaeb 100644
--- a/Source/Krypton Components/Krypton.Navigator/Controls Navigator/KryptonNavigator.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Controls Navigator/KryptonNavigator.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -638,9 +638,9 @@ public bool ControlKryptonFormFeatures
[Category(@"Visuals")]
[Description(@"Overrides for defining disabled navigator appearance.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public PaletteNavigator? StateDisabled { get; private set; }
+ public PaletteNavigator StateDisabled { get; private set; }
- private bool ShouldSerializeStateDisabled() => !StateDisabled!.IsDefault;
+ private bool ShouldSerializeStateDisabled() => !StateDisabled.IsDefault;
///
/// Gets access to the normal navigator appearance entries.
@@ -648,9 +648,9 @@ public bool ControlKryptonFormFeatures
[Category(@"Visuals")]
[Description(@"Overrides for defining normal navigator appearance.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public PaletteNavigator? StateNormal { get; private set; }
+ public PaletteNavigator StateNormal { get; private set; }
- private bool ShouldSerializeStateNormal() => !StateNormal!.IsDefault;
+ private bool ShouldSerializeStateNormal() => !StateNormal.IsDefault;
///
/// Gets access to the tracking navigator appearance entries.
@@ -716,7 +716,7 @@ public NavigatorMode NavigatorMode
// Ask the view builder to create new view based on new mode
ViewBuilder = ViewBuilderBase.CreateViewBuilder(_mode);
- ViewBuilder.Construct(this, ViewManager!, Redirector!);
+ ViewBuilder.Construct(this, ViewManager!, Redirector);
// Need to layout the new view
if (!IsInitializing)
@@ -860,7 +860,7 @@ public bool AllowTabSelect
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public ToolTipManager ToolTipManager { get; private set; }
+ public ToolTipManager? ToolTipManager { get; private set; }
#endregion
@@ -1125,7 +1125,7 @@ protected override void OnInitialized(EventArgs e)
// Ask the view builder to create new view based on new mode
ViewBuilder = ViewBuilderBase.CreateViewBuilder(_mode);
- ViewBuilder.Construct(this, ViewManager!, Redirector!);
+ ViewBuilder.Construct(this, ViewManager!, Redirector);
if (LayoutOnInitialized)
{
@@ -1619,14 +1619,15 @@ protected virtual CloseButtonAction OnCloseAction(KryptonPage? page)
case CloseButtonAction.None:
// Do nothing
break;
+
case CloseButtonAction.RemovePage:
// If the page still exists after the event then remove it
if (Pages.Contains(e.Item))
{
Pages.Remove(e.Item);
}
-
break;
+
case CloseButtonAction.RemovePageAndDispose:
// If the page still exists after the event
if (Pages.Contains(e.Item))
@@ -1637,19 +1638,20 @@ protected virtual CloseButtonAction OnCloseAction(KryptonPage? page)
// Dispose of its resources
e.Item.Dispose();
}
-
break;
+
case CloseButtonAction.HidePage:
// If the page still exists after the event then hide it
if (Pages.Contains(e.Item))
{
e.Item.Hide();
}
-
break;
+
default:
// Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(e.Action.ToString());
break;
}
}
@@ -1830,11 +1832,11 @@ protected virtual void OnNeedPagePaint(object sender, NeedLayoutEventArgs e)
internal ButtonSpecCollectionBase? FixedSpecs => Button.FixedSpecs;
- internal PaletteRedirect? InternalRedirector => Redirector;
+ internal PaletteRedirect InternalRedirector => Redirector;
internal void InternalForceViewLayout() => ForceViewLayout();
- internal ToolTipManager HoverManager { get; private set; }
+ internal ToolTipManager? HoverManager { get; private set; }
internal bool InternalDesignMode => DesignMode;
@@ -1906,41 +1908,48 @@ internal bool NextActionValid
internal KryptonPage? PreviousActionPage([DisallowNull] KryptonPage page)
{
- Debug.Assert(page != null);
-
- // Get the index of the page
- var pos = Pages.IndexOf(page);
+ Debug.Assert(page is not null);
- // Search backwards towards start of pages collection
- for (var i = pos - 1; i >= 0; i--)
+ if (page is not null)
{
- if (Pages[i].LastVisibleSet && Pages[i].Enabled)
+ // Get the index of the page
+ var pos = Pages.IndexOf(page);
+
+ // Search backwards towards start of pages collection
+ for (var i = pos - 1; i >= 0; i--)
{
- return Pages[i];
+ if (Pages[i].LastVisibleSet && Pages[i].Enabled)
+ {
+ return Pages[i];
+ }
}
}
- // Nothing visible before provided page
+ // Nothing visible before provided page, or page is null
return null;
}
internal KryptonPage? NextActionPage([DisallowNull] KryptonPage page)
{
- Debug.Assert(page != null);
+ Debug.Assert(page is not null);
- // Get the index of the page
- var pos = Pages.IndexOf(page);
-
- // Search towards end of pages collection
- for (var i = pos + 1; i < Pages.Count; i++)
+ if (page is not null)
{
- if (Pages[i].LastVisibleSet && Pages[i].Enabled)
+ // Get the index of the page
+ var pos = Pages.IndexOf(page);
+
+ // Search towards end of pages collection
+ for (var i = pos + 1; i < Pages.Count; i++)
{
- return Pages[i];
+ if (Pages[i].LastVisibleSet && Pages[i].Enabled)
+ {
+ return Pages[i];
+ }
}
+
}
- // Nothing visible after provided page
+ // Nothing visible before provided page, or page is null
return null;
}
@@ -2024,7 +2033,7 @@ internal void ReturnChildPanel()
{
// Must cast to the correct type in order to access the
// internal method that allows a child control to be added
- ((KryptonReadOnlyControls)Controls).AddInternal(ChildPanel);
+ ((KryptonReadOnlyControls)Controls).AddInternal(ChildPanel!);
IsChildPanelBorrowed = false;
}
}
@@ -2327,7 +2336,7 @@ private void OnPageRemoved(object sender, TypedCollectionEventArgs
}
}
- private void OnPageClearing(object sender, EventArgs e)
+ private void OnPageClearing(object? sender, EventArgs e)
{
// If there is a page currently selected
if (SelectedPage != null)
@@ -2358,7 +2367,7 @@ private void OnPageClearing(object sender, EventArgs e)
}
}
- private void OnPageCleared(object sender, EventArgs e)
+ private void OnPageCleared(object? sender, EventArgs e)
{
// Ignore call as view builder is already destructed
if (!IsDisposed
@@ -2375,7 +2384,7 @@ private void OnPageCleared(object sender, EventArgs e)
}
}
- private void OnPageVisibleChanged(object sender, EventArgs e)
+ private void OnPageVisibleChanged(object? sender, EventArgs e)
{
// Ignore call as view builder is already destructed
if (!IsDisposed
@@ -2423,7 +2432,7 @@ private void OnPageVisibleChanged(object sender, EventArgs e)
}
}
- private void OnPageEnabledChanged(object sender, EventArgs e)
+ private void OnPageEnabledChanged(object? sender, EventArgs e)
{
// Ignore call as view builder is already destructed
if (!IsDisposed
@@ -2442,7 +2451,7 @@ private void OnPageEnabledChanged(object sender, EventArgs e)
}
}
- private void OnPageAppearanceChanged(object sender, PropertyChangedEventArgs e)
+ private void OnPageAppearanceChanged(object? sender, PropertyChangedEventArgs e)
{
// Ignore call as view builder is already destructed
if (!IsDisposed
@@ -2456,7 +2465,7 @@ private void OnPageAppearanceChanged(object sender, PropertyChangedEventArgs e)
if (SelectedPage == page)
{
// And a change in a palette setting has occurred...
- if (e.PropertyName == nameof(Palette))
+ if (e.PropertyName == @"Palette")
{
// ...then need to repaint and layout to effect change
if (page != null)
@@ -2467,7 +2476,7 @@ private void OnPageAppearanceChanged(object sender, PropertyChangedEventArgs e)
}
// Inform the current view builder of possible appearance change
- ViewBuilder.PageAppearanceChanged(page, e.PropertyName);
+ ViewBuilder.PageAppearanceChanged(page!, e?.PropertyName!);
}
}
@@ -2755,7 +2764,7 @@ private void UpdateAllPagesVisible(bool visible, Type? excludeType)
#endregion
#region Private
- private void OnOpeningContextMenu(object sender, CancelEventArgs e)
+ private void OnOpeningContextMenu(object? sender, CancelEventArgs e)
{
// Ignore call as view builder is already destructed
if (!IsDisposed && (ViewBuilder != null))
@@ -2768,7 +2777,7 @@ private void OnOpeningContextMenu(object sender, CancelEventArgs e)
else
{
// Get access to the menu items for selecting a page
- var contextMenu = (KryptonContextMenu)sender;
+ var contextMenu = sender as KryptonContextMenu ?? throw new ArgumentNullException(nameof(sender));
// Kill any existing contents and add a items collection for the page entries
contextMenu.Items.Clear();
@@ -2786,7 +2795,7 @@ private void OnOpeningContextMenu(object sender, CancelEventArgs e)
|| page is { LastVisibleSet: true, Enabled: true })
{
// Add a vertical break after every 20 items
- if ((menuItems > 0)
+ if ((menuItems > 0)
&& ((menuItems % 20) == 0)
)
{
@@ -2842,7 +2851,7 @@ private void OnOpeningContextMenu(object sender, CancelEventArgs e)
}
}
- private void OnShowToolTip(object sender, ToolTipEventArgs e)
+ private void OnShowToolTip(object? sender, ToolTipEventArgs e)
{
if (!IsDisposed && (ViewBuilder != null))
{
@@ -2919,7 +2928,7 @@ private void OnShowToolTip(object sender, ToolTipEventArgs e)
_visualPopupToolTip?.Dispose();
// Create the actual tooltip popup object
- _visualPopupToolTip = new VisualPopupToolTip(Redirector,
+ _visualPopupToolTip = new VisualPopupToolTip(Redirector!,
sourceContent,
Renderer,
PaletteBackStyle.ControlToolTip,
@@ -2936,11 +2945,11 @@ private void OnShowToolTip(object sender, ToolTipEventArgs e)
}
}
- private void OnCancelToolTip(object sender, EventArgs e) =>
+ private void OnCancelToolTip(object? sender, EventArgs e) =>
// Remove any currently showing tooltip
_visualPopupToolTip?.Dispose();
- private void OnStartHover(object sender, ToolTipEventArgs e)
+ private void OnStartHover(object? sender, ToolTipEventArgs e)
{
if (!IsDisposed
&& (ViewBuilder != null)
@@ -2967,7 +2976,7 @@ private void OnStartHover(object sender, ToolTipEventArgs e)
}
}
- private void OnEndHover(object sender, EventArgs e)
+ private void OnEndHover(object? sender, EventArgs e)
{
// Only notify the end of the hover if we have generated a start
if (_tabHoverStarted)
@@ -2977,27 +2986,27 @@ private void OnEndHover(object sender, EventArgs e)
}
}
- private void OnVisualPopupToolTipDisposed(object sender, EventArgs e)
+ private void OnVisualPopupToolTipDisposed(object? sender, EventArgs e)
{
// Unhook events from the specific instance that generated event
- var popupToolTip = (VisualPopupToolTip)sender;
+ var popupToolTip = sender as VisualPopupToolTip ?? throw new ArgumentNullException(nameof(sender));
popupToolTip.Disposed -= OnVisualPopupToolTipDisposed;
// Not showing a popup page any more
_visualPopupToolTip = null;
}
- private void OnVisualPopupPageDisposed(object sender, EventArgs e)
+ private void OnVisualPopupPageDisposed(object? sender, EventArgs e)
{
// Unhook events from the specific instance that generated event
- var popupPage = (VisualPopupPage)sender;
+ var popupPage = sender as VisualPopupPage ?? throw new ArgumentNullException(nameof(sender));
popupPage.Disposed -= OnVisualPopupPageDisposed;
// Not showing a popup page any more
_visualPopupPage = null;
}
- private void OnChildPanelControlRemoved(object sender, ControlEventArgs e)
+ private void OnChildPanelControlRemoved(object? sender, ControlEventArgs e)
{
// Cast to correct type
// If a krypton page is being removed
@@ -3179,11 +3188,11 @@ private bool NextOnUnselectedKryptonPage(Control? next)
return false;
}
- private void OnViewManagerLayoutBefore(object sender, EventArgs e) =>
+ private void OnViewManagerLayoutBefore(object? sender, EventArgs e) =>
// Tell the view to perform pre layout actions
ViewBuilder?.PreLayout();
- private void OnViewManagerLayoutAfter(object sender, EventArgs e) =>
+ private void OnViewManagerLayoutAfter(object? sender, EventArgs e) =>
// Tell the view to perform post layout actions
ViewBuilder?.PostLayout();
@@ -3196,7 +3205,7 @@ private void ResetCachedKryptonContextMenu()
_kcm.Items.Clear();
}
- private void OnContextMenuClick(object sender, EventArgs e)
+ private void OnContextMenuClick(object? sender, EventArgs e)
{
// Cast to correct type
var menuItem = sender as KryptonContextMenuItem;
diff --git a/Source/Krypton Components/Krypton.Navigator/Controls Navigator/KryptonNavigatorControlCollection.cs b/Source/Krypton Components/Krypton.Navigator/Controls Navigator/KryptonNavigatorControlCollection.cs
index 2b5133b3e..bfdde795c 100644
--- a/Source/Krypton Components/Krypton.Navigator/Controls Navigator/KryptonNavigatorControlCollection.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Controls Navigator/KryptonNavigatorControlCollection.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -35,17 +35,15 @@ public KryptonNavigatorControlCollection([DisallowNull] KryptonNavigator owner)
/// Adds the specified control to the control collection.
///
/// The KryptonPage to add to the control collection.
- public override void Add([DisallowNull] Control value)
+ public override void Add(Control? value)
{
- Debug.Assert(value != null);
+ Debug.Assert(value is not null);
- if (value == null)
+ if (value is null)
{
throw new ArgumentNullException(nameof(value));
}
- // Cast to correct type
-
// We only allow KryptonPage controls to be added
if (value is not KryptonPage)
{
diff --git a/Source/Krypton Components/Krypton.Navigator/Controls Visuals/VisualPopupPage.cs b/Source/Krypton Components/Krypton.Navigator/Controls Visuals/VisualPopupPage.cs
index 0b665313f..8076d0bd5 100644
--- a/Source/Krypton Components/Krypton.Navigator/Controls Visuals/VisualPopupPage.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Controls Visuals/VisualPopupPage.cs
@@ -5,12 +5,13 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
// ReSharper disable RedundantNullableFlowAttribute
+
namespace Krypton.Navigator
{
internal class VisualPopupPage : VisualPopup
@@ -38,19 +39,19 @@ static VisualPopupPage() =>
/// Reference to page for display.
/// Drawing renderer.
public VisualPopupPage([DisallowNull] KryptonNavigator navigator,
- [DisallowNull] KryptonPage page,
- IRenderer? renderer)
+ [DisallowNull] KryptonPage page,
+ IRenderer renderer)
: base(renderer, true)
{
Debug.Assert(navigator != null);
Debug.Assert(page != null);
// Remember references needed later
- _navigator = navigator;
- _page = page;
+ _navigator = navigator ?? throw new ArgumentNullException(nameof(navigator));
+ _page = page ?? throw new ArgumentNullException(nameof(page));
// Always var the layout that positions the actual page
- var layoutPage = new ViewLayoutPopupPage(_navigator, _page);
+ var layoutPage = new ViewLayoutPopupPage(_navigator, _page!);
// Create the internal panel used for containing content
if (_navigator.StateNormal?.HeaderGroup != null)
@@ -141,20 +142,19 @@ protected override void OnLayout(LayoutEventArgs levent)
Rectangle borderRect = ClientRectangle;
if (_navigator.StateNormal?.HeaderGroup != null)
{
- if (Renderer != null)
- {
- GraphicsPath borderPath1 = Renderer.RenderStandardBorder.GetOutsideBorderPath(context, borderRect, _navigator.StateNormal.HeaderGroup.Border, VisualOrientation.Top, PaletteState.Normal);
- borderRect.Inflate(-1, -1);
- GraphicsPath borderPath2 = Renderer.RenderStandardBorder.GetOutsideBorderPath(context, borderRect, _navigator.StateNormal.HeaderGroup.Border, VisualOrientation.Top, PaletteState.Normal);
- borderRect.Inflate(-1, -1);
- GraphicsPath borderPath3 = Renderer.RenderStandardBorder.GetOutsideBorderPath(context, borderRect, _navigator.StateNormal.HeaderGroup.Border, VisualOrientation.Top, PaletteState.Normal);
-
- // Update the region of the popup to be the border path
- Region = new Region(borderPath1);
-
- // Inform the shadow to use the same paths for drawing the shadow
- DefineShadowPaths(borderPath1, borderPath2, borderPath3);
- }
+ using var gh = new GraphicsHint(context.Graphics,
+ _navigator.StateNormal.HeaderGroup.Border.GetBorderGraphicsHint(PaletteState.Normal));
+ GraphicsPath borderPath1 = Renderer.RenderStandardBorder.GetOutsideBorderPath(context, borderRect, _navigator.StateNormal.HeaderGroup.Border, VisualOrientation.Top, PaletteState.Normal);
+ borderRect.Inflate(-1, -1);
+ GraphicsPath borderPath2 = Renderer.RenderStandardBorder.GetOutsideBorderPath(context, borderRect, _navigator.StateNormal.HeaderGroup.Border, VisualOrientation.Top, PaletteState.Normal);
+ borderRect.Inflate(-1, -1);
+ GraphicsPath borderPath3 = Renderer.RenderStandardBorder.GetOutsideBorderPath(context, borderRect, _navigator.StateNormal.HeaderGroup.Border, VisualOrientation.Top, PaletteState.Normal);
+
+ // Update the region of the popup to be the border path
+ Region = new Region(borderPath1);
+
+ // Inform the shadow to use the same paths for drawing the shadow
+ DefineShadowPaths(borderPath1, borderPath2, borderPath3);
}
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/Converters/BarItemSizingConverter.cs b/Source/Krypton Components/Krypton.Navigator/Converters/BarItemSizingConverter.cs
index 68402ae86..e88bc74b0 100644
--- a/Source/Krypton Components/Krypton.Navigator/Converters/BarItemSizingConverter.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Converters/BarItemSizingConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -18,21 +18,21 @@ namespace Krypton.Navigator
public class BarItemSizingConverter : StringLookupConverter
{
[Localizable(true)]
- private static readonly IReadOnlyDictionary _pairs = new Dictionary
+ private static readonly BiDictionary _pairs = new BiDictionary(
+ new Dictionary
{
- {BarItemSizing.Individual, "Individual Sizing"},
- {BarItemSizing.SameHeight, "All Same Height"},
- {BarItemSizing.SameWidth, "All Same Width"},
- {BarItemSizing.SameWidthAndHeight, "All Same Width & Height"}
- };
+ {BarItemSizing.Individual, @"Individual Sizing"},
+ {BarItemSizing.SameHeight, @"All Same Height"},
+ {BarItemSizing.SameWidth, @"All Same Width"},
+ {BarItemSizing.SameWidthAndHeight, @"All Same Width & Height"}
+ });
#region Protected
-
///
/// Gets an array of lookup pairs.
///
- protected override IReadOnlyDictionary Pairs => _pairs;
-
+ protected override IReadOnlyDictionary PairsStringToEnum => _pairs.SecondToFirst;
+ protected override IReadOnlyDictionary PairsEnumToString => _pairs.FirstToSecond;
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/Converters/ButtonDisplayConverter.cs b/Source/Krypton Components/Krypton.Navigator/Converters/ButtonDisplayConverter.cs
index f30e31927..3b36536f3 100644
--- a/Source/Krypton Components/Krypton.Navigator/Converters/ButtonDisplayConverter.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Converters/ButtonDisplayConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -17,20 +17,21 @@ namespace Krypton.Navigator
///
public class ButtonDisplayConverter : StringLookupConverter
{
- private static readonly IReadOnlyDictionary _pairs = new Dictionary
+ private static readonly BiDictionary _pairs = new BiDictionary(
+ new Dictionary
{
- {ButtonDisplay.Hide, "Hide"},
- {ButtonDisplay.ShowDisabled, "Show Disabled"},
- {ButtonDisplay.ShowEnabled, "Show Enabled"},
- {ButtonDisplay.Logic, "Logic"}
- };
+ {ButtonDisplay.Hide, @"Hide"},
+ {ButtonDisplay.ShowDisabled, @"Show Disabled"},
+ {ButtonDisplay.ShowEnabled, @"Show Enabled"},
+ {ButtonDisplay.Logic, @"Logic"}
+ });
#region Protected
///
/// Gets an array of lookup pairs.
///
- protected override IReadOnlyDictionary Pairs => _pairs;
-
+ protected override IReadOnlyDictionary PairsStringToEnum => _pairs.SecondToFirst;
+ protected override IReadOnlyDictionary PairsEnumToString => _pairs.FirstToSecond;
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/Converters/ButtonDisplayLogicConverter.cs b/Source/Krypton Components/Krypton.Navigator/Converters/ButtonDisplayLogicConverter.cs
index 98f064934..b529dab87 100644
--- a/Source/Krypton Components/Krypton.Navigator/Converters/ButtonDisplayLogicConverter.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Converters/ButtonDisplayLogicConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -17,20 +17,21 @@ namespace Krypton.Navigator
///
public class ButtonDisplayLogicConverter : StringLookupConverter
{
- private static readonly IReadOnlyDictionary _pairs = new Dictionary
+ private static readonly BiDictionary _pairs = new BiDictionary(
+ new Dictionary
{
- {ButtonDisplayLogic.None, "None"},
- {ButtonDisplayLogic.Context, "Context"},
- {ButtonDisplayLogic.NextPrevious, "Next/Previous"},
- {ButtonDisplayLogic.ContextNextPrevious, "Context & Next/Previous"}
- };
+ {ButtonDisplayLogic.None, @"None"},
+ {ButtonDisplayLogic.Context, @"Context"},
+ {ButtonDisplayLogic.NextPrevious, @"Next/Previous"},
+ {ButtonDisplayLogic.ContextNextPrevious, @"Context & Next/Previous"}
+ });
#region Protected
///
/// Gets an array of lookup pairs.
///
- protected override IReadOnlyDictionary Pairs => _pairs;
-
+ protected override IReadOnlyDictionary PairsStringToEnum => _pairs.SecondToFirst;
+ protected override IReadOnlyDictionary PairsEnumToString => _pairs.FirstToSecond;
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/Converters/CloseButtonActionConverter.cs b/Source/Krypton Components/Krypton.Navigator/Converters/CloseButtonActionConverter.cs
index 49485312a..8b569545d 100644
--- a/Source/Krypton Components/Krypton.Navigator/Converters/CloseButtonActionConverter.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Converters/CloseButtonActionConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,21 +20,22 @@ public class CloseButtonActionConverter : StringLookupConverter _pairs = new Dictionary
- {
- {CloseButtonAction.None, "None (Do nothing)"},
- {CloseButtonAction.RemovePage, "RemovePage"},
- {CloseButtonAction.RemovePageAndDispose, "RemovePage & Dispose"},
- { CloseButtonAction.HidePage, "Hide Page"}
- };
+ private static readonly BiDictionary _pairs = new BiDictionary(
+ new Dictionary
+ {
+ {CloseButtonAction.None, @"None (Do nothing)"},
+ {CloseButtonAction.RemovePage, @"Remove Page"},
+ {CloseButtonAction.RemovePageAndDispose, @"Remove Page & Dispose"},
+ { CloseButtonAction.HidePage, @"Hide Page"}
+ });
#endregion
#region Protected
///
/// Gets an array of lookup pairs.
///
- protected override IReadOnlyDictionary Pairs => _pairs;
-
+ protected override IReadOnlyDictionary PairsStringToEnum => _pairs.SecondToFirst;
+ protected override IReadOnlyDictionary PairsEnumToString => _pairs.FirstToSecond;
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/Converters/ContextButtonActionConverter.cs b/Source/Krypton Components/Krypton.Navigator/Converters/ContextButtonActionConverter.cs
index 8141c8ab2..d0d3834f4 100644
--- a/Source/Krypton Components/Krypton.Navigator/Converters/ContextButtonActionConverter.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Converters/ContextButtonActionConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -19,19 +19,21 @@ public class ContextButtonActionConverter : StringLookupConverter _pairs =
+ [Localizable(true)]
+ private static readonly BiDictionary _pairs = new BiDictionary(
new Dictionary
{
- { ContextButtonAction.None, "None (Do nothing)" },
- { ContextButtonAction.SelectPage, "Select Page" }
- };
+ { ContextButtonAction.None, @"None (Do nothing)" },
+ { ContextButtonAction.SelectPage, @"Select Page" }
+ });
#endregion
#region Protected
///
/// Gets an array of lookup pairs.
///
- protected override IReadOnlyDictionary Pairs => _pairs;
+ protected override IReadOnlyDictionary PairsStringToEnum => _pairs.SecondToFirst;
+ protected override IReadOnlyDictionary PairsEnumToString => _pairs.FirstToSecond;
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/Converters/DirectionButtonActionConverter.cs b/Source/Krypton Components/Krypton.Navigator/Converters/DirectionButtonActionConverter.cs
index 61030b988..5eb2cc6b0 100644
--- a/Source/Krypton Components/Krypton.Navigator/Converters/DirectionButtonActionConverter.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Converters/DirectionButtonActionConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,20 +20,22 @@ public class DirectionButtonActionConverter : StringLookupConverter _pairs = new Dictionary
+ private static readonly BiDictionary _pairs = new BiDictionary(
+ new Dictionary
{
- {DirectionButtonAction.None, "None (Do nothing)"},
- {DirectionButtonAction.SelectPage, "Select Page"},
- {DirectionButtonAction.MoveBar, "Move Bar"},
- {DirectionButtonAction.ModeAppropriateAction, "Mode Appropriate Action"}
- };
+ {DirectionButtonAction.None, @"None (Do nothing)"},
+ {DirectionButtonAction.SelectPage, @"Select Page"},
+ {DirectionButtonAction.MoveBar, @"Move Bar"},
+ {DirectionButtonAction.ModeAppropriateAction, @"Mode Appropriate Action"}
+ });
#endregion
+
#region Protected
///
/// Gets an array of lookup pairs.
///
- protected override IReadOnlyDictionary Pairs => _pairs;
-
+ protected override IReadOnlyDictionary PairsStringToEnum => _pairs.SecondToFirst;
+ protected override IReadOnlyDictionary PairsEnumToString => _pairs.FirstToSecond;
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/Converters/MapKryptonPageImageConverter.cs b/Source/Krypton Components/Krypton.Navigator/Converters/MapKryptonPageImageConverter.cs
index 9385c8a1c..07178da2e 100644
--- a/Source/Krypton Components/Krypton.Navigator/Converters/MapKryptonPageImageConverter.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Converters/MapKryptonPageImageConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,23 +20,29 @@ public class MapKryptonPageImageConverter : StringLookupConverter _pairs = new Dictionary
+ private static readonly BiDictionary _pairs = new BiDictionary(
+ new Dictionary
{
- {MapKryptonPageImage.None, "None (Null image)"},
- {MapKryptonPageImage.Small, "Small"},
- {MapKryptonPageImage.SmallMedium, "Small - Medium"},
- {MapKryptonPageImage.SmallMediumLarge, "Small - Medium - Large"},
- {MapKryptonPageImage.Medium, "Medium"},
- {MapKryptonPageImage.MediumSmall, "Medium - Small"},
- {MapKryptonPageImage.MediumLarge, "Medium - Large"},
- {MapKryptonPageImage.Large, "Large"},
- {MapKryptonPageImage.LargeMedium, "Large - Medium"},
- {MapKryptonPageImage.LargeMediumSmall, "Large - Medium - Small"},
+ {MapKryptonPageImage.None, @"None (Null image)"},
+ {MapKryptonPageImage.Small, @"Small"},
+ {MapKryptonPageImage.SmallMedium, @"Small - Medium"},
+ {MapKryptonPageImage.SmallMediumLarge, @"Small - Medium - Large"},
+ {MapKryptonPageImage.Medium, @"Medium"},
+ {MapKryptonPageImage.MediumSmall, @"Medium - Small"},
+ {MapKryptonPageImage.MediumLarge, @"Medium - Large"},
+ {MapKryptonPageImage.Large, @"Large"},
+ {MapKryptonPageImage.LargeMedium, @"Large - Medium"},
+ {MapKryptonPageImage.LargeMediumSmall, @"Large - Medium - Small"},
{MapKryptonPageImage.ToolTip, nameof(ToolTip)}
- };
+ });
#endregion
- protected override IReadOnlyDictionary Pairs => _pairs;
-
+ #region Protected
+ ///
+ /// Gets an array of lookup pairs.
+ ///
+ protected override IReadOnlyDictionary PairsStringToEnum => _pairs.SecondToFirst;
+ protected override IReadOnlyDictionary PairsEnumToString => _pairs.FirstToSecond;
+ #endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/Converters/MapKryptonPageTextConverter.cs b/Source/Krypton Components/Krypton.Navigator/Converters/MapKryptonPageTextConverter.cs
index afad34da9..916b4b4e0 100644
--- a/Source/Krypton Components/Krypton.Navigator/Converters/MapKryptonPageTextConverter.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Converters/MapKryptonPageTextConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,26 +20,33 @@ public class MapKryptonPageTextConverter : StringLookupConverter _pairs = new Dictionary
+ private static readonly BiDictionary _pairs = new BiDictionary(
+ new Dictionary
{
- {MapKryptonPageText.None, "None (Empty string)"},
- {MapKryptonPageText.Text, "Text"},
- {MapKryptonPageText.TextTitle, "Text - Title"},
- {MapKryptonPageText.TextTitleDescription, "Text - Title - Description"},
- {MapKryptonPageText.TextDescription, "Text - Description"},
- {MapKryptonPageText.Title, "Title"},
- {MapKryptonPageText.TitleText, "Title - Text"},
- {MapKryptonPageText.TitleDescription, "Title - Description"},
- {MapKryptonPageText.Description, "Description"},
- {MapKryptonPageText.DescriptionText, "Description - Text"},
- {MapKryptonPageText.DescriptionTitle, "Description - Title"},
- {MapKryptonPageText.DescriptionTitleText, "Description - Title - Text"},
- {MapKryptonPageText.ToolTipTitle, "ToolTipTitle"},
- {MapKryptonPageText.ToolTipBody, "ToolTipBody"}
- };
+ {MapKryptonPageText.None, @"None (Empty string)"},
+ {MapKryptonPageText.Text, @"Text"},
+ {MapKryptonPageText.TextTitle, @"Text - Title"},
+ {MapKryptonPageText.TextTitleDescription, @"Text - Title - Description"},
+ {MapKryptonPageText.TextDescription, @"Text - Description"},
+ {MapKryptonPageText.Title, @"Title"},
+ {MapKryptonPageText.TitleText, @"Title - Text"},
+ {MapKryptonPageText.TitleDescription, @"Title - Description"},
+ {MapKryptonPageText.Description, @"Description"},
+ {MapKryptonPageText.DescriptionText, @"Description - Text"},
+ {MapKryptonPageText.DescriptionTitle, @"Description - Title"},
+ {MapKryptonPageText.DescriptionTitleText, @"Description - Title - Text"},
+ {MapKryptonPageText.ToolTipTitle, @"ToolTipTitle"},
+ {MapKryptonPageText.ToolTipBody, @"ToolTipBody"}
+ });
#endregion
- protected override IReadOnlyDictionary Pairs => _pairs;
+ #region Protected
+ ///
+ /// Gets an array of lookup pairs.
+ ///
+ protected override IReadOnlyDictionary PairsStringToEnum => _pairs.SecondToFirst;
+ protected override IReadOnlyDictionary PairsEnumToString => _pairs.FirstToSecond;
+ #endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/Converters/NavigatorModeConverter.cs b/Source/Krypton Components/Krypton.Navigator/Converters/NavigatorModeConverter.cs
index e8bc8a531..e5b6a5f6e 100644
--- a/Source/Krypton Components/Krypton.Navigator/Converters/NavigatorModeConverter.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Converters/NavigatorModeConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,31 +20,38 @@ public class NavigatorModeConverter : StringLookupConverter
#region Static Fields
[Localizable(true)]
- private static readonly IReadOnlyDictionary _pairs = new Dictionary
+ private static readonly BiDictionary _pairs = new BiDictionary(
+ new Dictionary
{
- {NavigatorMode.BarTabGroup, "Bar - Tab - Group"},
- {NavigatorMode.BarTabOnly, "Bar - Tab - Only"},
- {NavigatorMode.BarRibbonTabGroup, "Bar - RibbonTab - Group"},
- {NavigatorMode.BarRibbonTabOnly, "Bar - RibbonTab - Only"},
- {NavigatorMode.BarCheckButtonGroupOutside, "Bar - CheckButton - Group - Outside"},
- {NavigatorMode.BarCheckButtonGroupInside, "Bar - CheckButton - Group - Inside"},
- {NavigatorMode.BarCheckButtonGroupOnly, "Bar - CheckButton - Group - Only"},
- {NavigatorMode.BarCheckButtonOnly, "Bar - CheckButton - Only"},
- {NavigatorMode.HeaderBarCheckButtonGroup, "HeaderBar - CheckButton - Group"},
- {NavigatorMode.HeaderBarCheckButtonHeaderGroup, "HeaderBar - CheckButton - HeaderGroup"},
- {NavigatorMode.HeaderBarCheckButtonOnly, "HeaderBar - CheckButton - Only"},
- {NavigatorMode.StackCheckButtonGroup, "Stack - CheckButton - Group"},
- {NavigatorMode.StackCheckButtonHeaderGroup, "Stack - CheckButton - HeaderGroup"},
- {NavigatorMode.OutlookFull, "Outlook - Full"},
- {NavigatorMode.OutlookMini, "Outlook - Mini"},
+ {NavigatorMode.BarTabGroup, @"Bar - Tab - Group"},
+ {NavigatorMode.BarTabOnly, @"Bar - Tab - Only"},
+ {NavigatorMode.BarRibbonTabGroup, @"Bar - RibbonTab - Group"},
+ {NavigatorMode.BarRibbonTabOnly, @"Bar - RibbonTab - Only"},
+ {NavigatorMode.BarCheckButtonGroupOutside, @"Bar - CheckButton - Group - Outside"},
+ {NavigatorMode.BarCheckButtonGroupInside, @"Bar - CheckButton - Group - Inside"},
+ {NavigatorMode.BarCheckButtonGroupOnly, @"Bar - CheckButton - Group - Only"},
+ {NavigatorMode.BarCheckButtonOnly, @"Bar - CheckButton - Only"},
+ {NavigatorMode.HeaderBarCheckButtonGroup, @"HeaderBar - CheckButton - Group"},
+ {NavigatorMode.HeaderBarCheckButtonHeaderGroup, @"HeaderBar - CheckButton - HeaderGroup"},
+ {NavigatorMode.HeaderBarCheckButtonOnly, @"HeaderBar - CheckButton - Only"},
+ {NavigatorMode.StackCheckButtonGroup, @"Stack - CheckButton - Group"},
+ {NavigatorMode.StackCheckButtonHeaderGroup, @"Stack - CheckButton - HeaderGroup"},
+ {NavigatorMode.OutlookFull, @"Outlook - Full"},
+ {NavigatorMode.OutlookMini, @"Outlook - Mini"},
{NavigatorMode.Panel, nameof(Panel)},
- {NavigatorMode.Group, "Group"},
- {NavigatorMode.HeaderGroup, "HeaderGroup"},
- {NavigatorMode.HeaderGroupTab, "HeaderGroup - Tab"}
- };
+ {NavigatorMode.Group, @"Group"},
+ {NavigatorMode.HeaderGroup, @"HeaderGroup"},
+ {NavigatorMode.HeaderGroupTab, @"HeaderGroup - Tab"}
+ });
#endregion
- protected override IReadOnlyDictionary Pairs => _pairs;
+ #region Protected
+ ///
+ /// Gets an array of lookup pairs.
+ ///
+ protected override IReadOnlyDictionary PairsStringToEnum => _pairs.SecondToFirst;
+ protected override IReadOnlyDictionary PairsEnumToString => _pairs.FirstToSecond;
+ #endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/Converters/PaletteButtonSpecStyleConverter.cs b/Source/Krypton Components/Krypton.Navigator/Converters/PaletteButtonSpecStyleConverter.cs
index 1dfd3c6a9..35710c14b 100644
--- a/Source/Krypton Components/Krypton.Navigator/Converters/PaletteButtonSpecStyleConverter.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Converters/PaletteButtonSpecStyleConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,33 +20,40 @@ internal class PaletteNavButtonSpecStyleConverter : StringLookupConverter _pairs = new Dictionary
+ private static readonly BiDictionary _pairs = new BiDictionary(
+ new Dictionary
{
- {PaletteNavButtonSpecStyle.Generic, "Generic"},
- {PaletteNavButtonSpecStyle.ArrowLeft, "Arrow Left"},
- {PaletteNavButtonSpecStyle.ArrowRight, "Arrow Right"},
- {PaletteNavButtonSpecStyle.ArrowUp, "Arrow Up"},
- {PaletteNavButtonSpecStyle.ArrowDown, "Arrow Down"},
- {PaletteNavButtonSpecStyle.DropDown, "Drop Down"},
- {PaletteNavButtonSpecStyle.PinVertical, "Pin Vertical"},
- {PaletteNavButtonSpecStyle.PinHorizontal, "Pin Horizontal"},
- {PaletteNavButtonSpecStyle.FormClose, "Form Close"},
- {PaletteNavButtonSpecStyle.FormMax, "Form Max"},
- {PaletteNavButtonSpecStyle.FormMin, "Form Min"},
- {PaletteNavButtonSpecStyle.FormRestore, "Form Restore"},
- {PaletteNavButtonSpecStyle.FormHelp, "Form Help"},
- {PaletteNavButtonSpecStyle.PendantClose, "Pendant Close"},
- {PaletteNavButtonSpecStyle.PendantMin, "Pendant Min"},
- {PaletteNavButtonSpecStyle.PendantRestore, "Pendant Restore"},
- {PaletteNavButtonSpecStyle.WorkspaceMaximize, "Workspace Maximize"},
- {PaletteNavButtonSpecStyle.WorkspaceRestore, "Workspace Restore"},
- {PaletteNavButtonSpecStyle.RibbonMinimize, "Ribbon Minimize"},
- {PaletteNavButtonSpecStyle.RibbonExpand, "Ribbon Expand" }
- };
+ {PaletteNavButtonSpecStyle.Generic, @"Generic"},
+ {PaletteNavButtonSpecStyle.ArrowLeft, @"Arrow Left"},
+ {PaletteNavButtonSpecStyle.ArrowRight, @"Arrow Right"},
+ {PaletteNavButtonSpecStyle.ArrowUp, @"Arrow Up"},
+ {PaletteNavButtonSpecStyle.ArrowDown, @"Arrow Down"},
+ {PaletteNavButtonSpecStyle.DropDown, @"Drop Down"},
+ {PaletteNavButtonSpecStyle.PinVertical, @"Pin Vertical"},
+ {PaletteNavButtonSpecStyle.PinHorizontal, @"Pin Horizontal"},
+ {PaletteNavButtonSpecStyle.FormClose, @"Form Close"},
+ {PaletteNavButtonSpecStyle.FormMax, @"Form Max"},
+ {PaletteNavButtonSpecStyle.FormMin, @"Form Min"},
+ {PaletteNavButtonSpecStyle.FormRestore, @"Form Restore"},
+ {PaletteNavButtonSpecStyle.FormHelp, @"Form Help"},
+ {PaletteNavButtonSpecStyle.PendantClose, @"Pendant Close"},
+ {PaletteNavButtonSpecStyle.PendantMin, @"Pendant Min"},
+ {PaletteNavButtonSpecStyle.PendantRestore, @"Pendant Restore"},
+ {PaletteNavButtonSpecStyle.WorkspaceMaximize, @"Workspace Maximize"},
+ {PaletteNavButtonSpecStyle.WorkspaceRestore, @"Workspace Restore"},
+ {PaletteNavButtonSpecStyle.RibbonMinimize, @"Ribbon Minimize"},
+ {PaletteNavButtonSpecStyle.RibbonExpand, @"Ribbon Expand" }
+ });
#endregion
- protected override IReadOnlyDictionary Pairs => _pairs;
+ #region Protected
+ ///
+ /// Gets an array of lookup pairs.
+ ///
+ protected override IReadOnlyDictionary PairsStringToEnum => _pairs.SecondToFirst;
+ protected override IReadOnlyDictionary PairsEnumToString => _pairs.FirstToSecond;
+ #endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/Converters/PopupPageAllowConverter.cs b/Source/Krypton Components/Krypton.Navigator/Converters/PopupPageAllowConverter.cs
index 71bcf78a8..cf56d4fe5 100644
--- a/Source/Krypton Components/Krypton.Navigator/Converters/PopupPageAllowConverter.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Converters/PopupPageAllowConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,16 +20,22 @@ public class PopupPageAllowConverter : StringLookupConverter
#region Static Fields
[Localizable(true)]
- private static readonly IReadOnlyDictionary _pairs = new Dictionary
+ private static readonly BiDictionary _pairs = new BiDictionary(
+ new Dictionary
{
- {PopupPageAllow.Never, "Never"},
- {PopupPageAllow.OnlyCompatibleModes, "Only Compatible Modes"},
- {PopupPageAllow.OnlyOutlookMiniMode, "Only Outlook Mini Mode"}
- };
+ {PopupPageAllow.Never, @"Never"},
+ {PopupPageAllow.OnlyCompatibleModes, @"Only Compatible Modes"},
+ {PopupPageAllow.OnlyOutlookMiniMode, @"Only Outlook Mini Mode"}
+ });
#endregion
- protected override IReadOnlyDictionary Pairs => _pairs;
-
+ #region Protected
+ ///
+ /// Gets an array of lookup pairs.
+ ///
+ protected override IReadOnlyDictionary PairsStringToEnum => _pairs.SecondToFirst;
+ protected override IReadOnlyDictionary PairsEnumToString => _pairs.FirstToSecond;
+ #endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/Converters/PopupPagePositionConverter.cs b/Source/Krypton Components/Krypton.Navigator/Converters/PopupPagePositionConverter.cs
index 7571960b2..d9968718b 100644
--- a/Source/Krypton Components/Krypton.Navigator/Converters/PopupPagePositionConverter.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Converters/PopupPagePositionConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,26 +20,31 @@ public class PopupPagePositionConverter : StringLookupConverter _pairs = new Dictionary
+ private static readonly BiDictionary _pairs = new BiDictionary(
+ new Dictionary
{
- {PopupPagePosition.ModeAppropriate, "Mode Appropriate"},
- {PopupPagePosition.AboveFar, "Above Element - Far Aligned"},
- {PopupPagePosition.AboveMatch, "Above Element - Element Width"},
- {PopupPagePosition.AboveNear, "Above Element - Near Aligned"},
- {PopupPagePosition.BelowFar, "Below Element - Far Aligned"},
- {PopupPagePosition.BelowMatch, "Below Element - Element Width"},
- {PopupPagePosition.BelowNear, "Below Element - Near Aligned"},
- {PopupPagePosition.FarBottom, "Far Side of Element - Bottom Aligned"},
- {PopupPagePosition.FarMatch, "Far Side of Element - Element Height"},
- {PopupPagePosition.FarTop, "Far Side of Element - Top Aligned"},
- {PopupPagePosition.NearBottom, "Near Side of Element - Bottom Aligned"},
- {PopupPagePosition.NearMatch, "Near Side of Element - Element Height"},
- {PopupPagePosition.NearTop, "Near Side of Element - Top Aligned"}
- };
+ {PopupPagePosition.ModeAppropriate, @"Mode Appropriate"},
+ {PopupPagePosition.AboveFar, @"Above Element - Far Aligned"},
+ {PopupPagePosition.AboveMatch, @"Above Element - Element Width"},
+ {PopupPagePosition.AboveNear, @"Above Element - Near Aligned"},
+ {PopupPagePosition.BelowFar, @"Below Element - Far Aligned"},
+ {PopupPagePosition.BelowMatch, @"Below Element - Element Width"},
+ {PopupPagePosition.BelowNear, @"Below Element - Near Aligned"},
+ {PopupPagePosition.FarBottom, @"Far Side of Element - Bottom Aligned"},
+ {PopupPagePosition.FarMatch, @"Far Side of Element - Element Height"},
+ {PopupPagePosition.FarTop, @"Far Side of Element - Top Aligned"},
+ {PopupPagePosition.NearBottom, @"Near Side of Element - Bottom Aligned"},
+ {PopupPagePosition.NearMatch, @"Near Side of Element - Element Height"},
+ {PopupPagePosition.NearTop, @"Near Side of Element - Top Aligned"}
+ });
#endregion
- protected override IReadOnlyDictionary Pairs => _pairs;
-
-
+ #region Protected
+ ///
+ /// Gets an array of lookup pairs.
+ ///
+ protected override IReadOnlyDictionary PairsStringToEnum => _pairs.SecondToFirst;
+ protected override IReadOnlyDictionary PairsEnumToString => _pairs.FirstToSecond;
+ #endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/Dragging/DragFeedback.cs b/Source/Krypton Components/Krypton.Navigator/Dragging/DragFeedback.cs
index f95992647..fd9d89e7f 100644
--- a/Source/Krypton Components/Krypton.Navigator/Dragging/DragFeedback.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Dragging/DragFeedback.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -77,20 +77,20 @@ protected virtual void Dispose(bool disposing)
/// Drawing renderer.
/// Drag data associated with drag operation.
/// List of all drag targets.
- public virtual void Start([DisallowNull] IPaletteDragDrop paletteDragDrop,
- [DisallowNull] IRenderer renderer,
- [DisallowNull] PageDragEndData pageDragEndData,
- [DisallowNull] DragTargetList dragTargets)
+ public virtual void Start([DisallowNull] IPaletteDragDrop? paletteDragDrop,
+ [DisallowNull] IRenderer? renderer,
+ [DisallowNull] PageDragEndData? pageDragEndData,
+ [DisallowNull] DragTargetList? dragTargets)
{
- Debug.Assert(paletteDragDrop != null);
- Debug.Assert(renderer != null);
- Debug.Assert(pageDragEndData != null);
- Debug.Assert(dragTargets != null);
+ Debug.Assert(paletteDragDrop is not null);
+ Debug.Assert(renderer is not null);
+ Debug.Assert(pageDragEndData is not null);
+ Debug.Assert(dragTargets is not null);
- PaletteDragDrop = paletteDragDrop;
- Renderer = renderer;
- PageDragEndData = pageDragEndData;
- DragTargets = dragTargets;
+ PaletteDragDrop = paletteDragDrop ?? throw new ArgumentNullException(nameof(paletteDragDrop));
+ Renderer = renderer ?? throw new ArgumentNullException(nameof(renderer));
+ PageDragEndData = pageDragEndData ?? throw new ArgumentNullException(nameof(pageDragEndData));
+ DragTargets = dragTargets ?? throw new ArgumentNullException(nameof(dragTargets));
}
///
@@ -120,7 +120,7 @@ public virtual void Quit()
///
/// Gets access to the cached drawing renderer.
///
- protected IRenderer? Renderer { get; private set; }
+ protected IRenderer Renderer { get; private set; }
///
/// Gets access to the cached drag data.
diff --git a/Source/Krypton Components/Krypton.Navigator/Dragging/DragFeedbackDocking.cs b/Source/Krypton Components/Krypton.Navigator/Dragging/DragFeedbackDocking.cs
index e9c8a2778..00a3499a3 100644
--- a/Source/Krypton Components/Krypton.Navigator/Dragging/DragFeedbackDocking.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Dragging/DragFeedbackDocking.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -26,7 +26,7 @@ private class HintToTarget : Dictionary { }
#region Instance Fields
private readonly IPaletteDragDrop _paletteDragDrop;
- private readonly IRenderer? _renderer;
+ private readonly IRenderer _renderer;
private HintToTarget? _hintToTarget;
private IDropDockingIndicator? _indicators;
#endregion
@@ -39,7 +39,7 @@ private class HintToTarget : Dictionary { }
/// Drawing renderer.
/// Initial target for the cluster.
public DockCluster(IPaletteDragDrop paletteDragDrop,
- IRenderer? renderer,
+ IRenderer renderer,
DragTarget target)
{
_paletteDragDrop = paletteDragDrop;
diff --git a/Source/Krypton Components/Krypton.Navigator/Dragging/DragFeedbackSolid.cs b/Source/Krypton Components/Krypton.Navigator/Dragging/DragFeedbackSolid.cs
index 573dbb024..553645fcd 100644
--- a/Source/Krypton Components/Krypton.Navigator/Dragging/DragFeedbackSolid.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Dragging/DragFeedbackSolid.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/Dragging/DragManager.cs b/Source/Krypton Components/Krypton.Navigator/Dragging/DragManager.cs
index 8dd04e546..95af1b401 100644
--- a/Source/Krypton Components/Krypton.Navigator/Dragging/DragManager.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Dragging/DragManager.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -29,9 +29,9 @@ public class DragManager : IDragPageNotify,
#endregion
#region Instance Fields
- private PaletteBase? _dragPalette;
- private PaletteBase? _localPalette;
- private IRenderer? _dragRenderer;
+ private PaletteBase _dragPalette;
+ private PaletteBase _localPalette;
+ private IRenderer _dragRenderer;
private PaletteMode _paletteMode;
private readonly PaletteRedirect _redirector;
private PageDragEndData? _pageDragEndData;
@@ -62,10 +62,10 @@ static DragManager()
///
/// Initialize a new instance of the DragManager class.
///
- public DragManager()
+ public DragManager(PaletteBase? target = null)
{
- _redirector = new PaletteRedirect();
- StateCommon = new PaletteDragDrop(null, null);
+ _redirector = new PaletteRedirect(target);
+ StateCommon = new PaletteDragDrop(target!, null);
_paletteMode = PaletteMode.Global;
DragTargetProviders = new DragTargetProviderCollection();
_dragTargets = new DragTargetList();
@@ -158,7 +158,7 @@ public PaletteMode PaletteMode
///
/// Gets and sets the custom palette implementation.
///
- public PaletteBase? Palette
+ public PaletteBase Palette
{
get => _localPalette;
@@ -247,7 +247,7 @@ public virtual bool DragStart(Point screenPt, PageDragEndData? dragEndData)
// Create correct drag feedback class and start it up
ResolveDragFeedback();
- _dragFeedback?.Start(StateCommon, _dragRenderer!, _pageDragEndData, _dragTargets!);
+ _dragFeedback?.Start(StateCommon, _dragRenderer, _pageDragEndData, _dragTargets!);
}
else
{
@@ -427,7 +427,7 @@ private void ResolvePaletteRenderer()
StateCommon.SetInherit(_dragPalette);
// Get the renderer associated with the palette
- _dragRenderer = _dragPalette?.GetRenderer();
+ _dragRenderer = _dragPalette?.GetRenderer()!;
}
private void ResolveDragFeedback()
@@ -488,8 +488,8 @@ private void ClearTargets()
private void EndDragging()
{
- _dragPalette = null;
- _dragRenderer = null;
+ _dragPalette = null!;
+ _dragRenderer = null!;
_pageDragEndData = null;
IsDragging = false;
}
diff --git a/Source/Krypton Components/Krypton.Navigator/Dragging/DragTarget.cs b/Source/Krypton Components/Krypton.Navigator/Dragging/DragTarget.cs
index 9b9bb03a8..000803f1b 100644
--- a/Source/Krypton Components/Krypton.Navigator/Dragging/DragTarget.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Dragging/DragTarget.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -171,11 +171,11 @@ public virtual bool IsMatch(Point screenPt, PageDragEndData? dragEndData) =>
// Use event to allow decision on if the page should be dropped
// (or even swap the page for a different page to be dropped)
var e = new PageDropEventArgs(page);
- target.OnPageDrop(e);
+ target?.OnPageDrop(e);
if (e is { Cancel: false, Page: not null })
{
- target.Pages.Add(e.Page);
+ target?.Pages.Add(e.Page);
ret = e.Page;
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/Dragging/DragTargetNavigatorTransfer.cs b/Source/Krypton Components/Krypton.Navigator/Dragging/DragTargetNavigatorTransfer.cs
index 77e6a0a14..2e7184e02 100644
--- a/Source/Krypton Components/Krypton.Navigator/Dragging/DragTargetNavigatorTransfer.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Dragging/DragTargetNavigatorTransfer.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/Dragging/DropDockingIndicatorsRounded.cs b/Source/Krypton Components/Krypton.Navigator/Dragging/DropDockingIndicatorsRounded.cs
index b85eec416..80f67d374 100644
--- a/Source/Krypton Components/Krypton.Navigator/Dragging/DropDockingIndicatorsRounded.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Dragging/DropDockingIndicatorsRounded.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -21,7 +21,7 @@ public class DropDockingIndicatorsRounded : NativeWindow,
IDropDockingIndicator
{
#region Instance Fields
- private readonly IRenderer? _renderer;
+ private readonly IRenderer _renderer;
private readonly IPaletteDragDrop _paletteDragDrop;
private readonly RenderDragDockingData _dragData;
private Rectangle _showRect;
@@ -39,7 +39,7 @@ public class DropDockingIndicatorsRounded : NativeWindow,
/// Show bottom hot area.
/// Show middle hot area.
public DropDockingIndicatorsRounded(IPaletteDragDrop paletteDragDrop,
- IRenderer? renderer,
+ IRenderer renderer,
bool showLeft, bool showRight,
bool showTop, bool showBottom,
bool showMiddle)
diff --git a/Source/Krypton Components/Krypton.Navigator/Dragging/DropDockingIndicatorsSquare.cs b/Source/Krypton Components/Krypton.Navigator/Dragging/DropDockingIndicatorsSquare.cs
index 8086dea05..f67f5c252 100644
--- a/Source/Krypton Components/Krypton.Navigator/Dragging/DropDockingIndicatorsSquare.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Dragging/DropDockingIndicatorsSquare.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,7 +20,7 @@ public class DropDockingIndicatorsSquare : KryptonForm,
IDropDockingIndicator
{
#region Instance Fields
- private readonly IRenderer? _renderer;
+ private readonly IRenderer _renderer;
private readonly IPaletteDragDrop _paletteDragDrop;
private readonly RenderDragDockingData _dragData;
#endregion
@@ -37,7 +37,7 @@ public class DropDockingIndicatorsSquare : KryptonForm,
/// Show bottom hot area.
/// Show middle hot area.
public DropDockingIndicatorsSquare(IPaletteDragDrop paletteDragDrop,
- IRenderer? renderer,
+ IRenderer renderer,
bool showLeft, bool showRight,
bool showTop, bool showBottom,
bool showMiddle)
@@ -173,7 +173,7 @@ public void MouseReset()
#endregion
#region Implementation
- private void DropIndicators_Paint(object sender, PaintEventArgs e)
+ private void DropIndicators_Paint(object? sender, PaintEventArgs e)
{
using var context = new RenderContext(this, e.Graphics, e.ClipRectangle, _renderer);
_renderer?.RenderGlyph.DrawDragDropDockingGlyph(context, _dragData, _paletteDragDrop, PaletteDragFeedback.Square);
diff --git a/Source/Krypton Components/Krypton.Navigator/Dragging/DropSolidWindow.cs b/Source/Krypton Components/Krypton.Navigator/Dragging/DropSolidWindow.cs
index 41feb570a..882a995ae 100644
--- a/Source/Krypton Components/Krypton.Navigator/Dragging/DropSolidWindow.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Dragging/DropSolidWindow.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -19,7 +19,7 @@ public class DropSolidWindow : KryptonForm
{
#region Instance Fields
private readonly IPaletteDragDrop _paletteDragDrop;
- private readonly IRenderer? _renderer;
+ private readonly IRenderer _renderer;
private Rectangle _solidRect;
#endregion
@@ -29,7 +29,7 @@ public class DropSolidWindow : KryptonForm
///
/// Drawing palette.
/// Drawing renderer.
- public DropSolidWindow(IPaletteDragDrop paletteDragDrop, IRenderer? renderer)
+ public DropSolidWindow(IPaletteDragDrop paletteDragDrop, IRenderer renderer)
{
_paletteDragDrop = paletteDragDrop;
_renderer = renderer;
diff --git a/Source/Krypton Components/Krypton.Navigator/Dragging/PageDragEndData.cs b/Source/Krypton Components/Krypton.Navigator/Dragging/PageDragEndData.cs
index 7de6cdb7e..1798f8d18 100644
--- a/Source/Krypton Components/Krypton.Navigator/Dragging/PageDragEndData.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Dragging/PageDragEndData.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/EventArgs/CloseActionEventArgs.cs b/Source/Krypton Components/Krypton.Navigator/EventArgs/CloseActionEventArgs.cs
index 03c654dbb..eb7699417 100644
--- a/Source/Krypton Components/Krypton.Navigator/EventArgs/CloseActionEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Navigator/EventArgs/CloseActionEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/EventArgs/ContextActionEventArgs.cs b/Source/Krypton Components/Krypton.Navigator/EventArgs/ContextActionEventArgs.cs
index 06c29ba18..3ff9aad5b 100644
--- a/Source/Krypton Components/Krypton.Navigator/EventArgs/ContextActionEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Navigator/EventArgs/ContextActionEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/EventArgs/CtrlTabCancelEventArgs.cs b/Source/Krypton Components/Krypton.Navigator/EventArgs/CtrlTabCancelEventArgs.cs
index 7bb362c4e..9ee5117e5 100644
--- a/Source/Krypton Components/Krypton.Navigator/EventArgs/CtrlTabCancelEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Navigator/EventArgs/CtrlTabCancelEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/EventArgs/DirectionActionEventArgs.cs b/Source/Krypton Components/Krypton.Navigator/EventArgs/DirectionActionEventArgs.cs
index 45c3096bf..9af41ea1f 100644
--- a/Source/Krypton Components/Krypton.Navigator/EventArgs/DirectionActionEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Navigator/EventArgs/DirectionActionEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/EventArgs/KryptonContextMenuStripEventArgs.cs b/Source/Krypton Components/Krypton.Navigator/EventArgs/KryptonContextMenuStripEventArgs.cs
index 64a824bcf..e6aeef1e4 100644
--- a/Source/Krypton Components/Krypton.Navigator/EventArgs/KryptonContextMenuStripEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Navigator/EventArgs/KryptonContextMenuStripEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/EventArgs/KryptonPageCancelEventArgs.cs b/Source/Krypton Components/Krypton.Navigator/EventArgs/KryptonPageCancelEventArgs.cs
index ad60b75fe..eb97f8e2d 100644
--- a/Source/Krypton Components/Krypton.Navigator/EventArgs/KryptonPageCancelEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Navigator/EventArgs/KryptonPageCancelEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/EventArgs/KryptonPageFlagsEventArgs.cs b/Source/Krypton Components/Krypton.Navigator/EventArgs/KryptonPageFlagsEventArgs.cs
index 5303a78f6..071736704 100644
--- a/Source/Krypton Components/Krypton.Navigator/EventArgs/KryptonPageFlagsEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Navigator/EventArgs/KryptonPageFlagsEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/EventArgs/PageDragCancelEventArgs.cs b/Source/Krypton Components/Krypton.Navigator/EventArgs/PageDragCancelEventArgs.cs
index 4354fe7c2..3be55679f 100644
--- a/Source/Krypton Components/Krypton.Navigator/EventArgs/PageDragCancelEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Navigator/EventArgs/PageDragCancelEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/EventArgs/PageDragEndEventArgs.cs b/Source/Krypton Components/Krypton.Navigator/EventArgs/PageDragEndEventArgs.cs
index a143978dc..afa15efff 100644
--- a/Source/Krypton Components/Krypton.Navigator/EventArgs/PageDragEndEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Navigator/EventArgs/PageDragEndEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/EventArgs/PageDragEventArgs.cs b/Source/Krypton Components/Krypton.Navigator/EventArgs/PageDragEventArgs.cs
index 88c37ef2d..6370dea88 100644
--- a/Source/Krypton Components/Krypton.Navigator/EventArgs/PageDragEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Navigator/EventArgs/PageDragEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/EventArgs/PageDropEventArgs.cs b/Source/Krypton Components/Krypton.Navigator/EventArgs/PageDropEventArgs.cs
index 75c4e6ec5..0208773ef 100644
--- a/Source/Krypton Components/Krypton.Navigator/EventArgs/PageDropEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Navigator/EventArgs/PageDropEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/EventArgs/PageMovedEventArgs.cs b/Source/Krypton Components/Krypton.Navigator/EventArgs/PageMovedEventArgs.cs
index 1f8b09174..335d64d80 100644
--- a/Source/Krypton Components/Krypton.Navigator/EventArgs/PageMovedEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Navigator/EventArgs/PageMovedEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/EventArgs/PageReorderEventArgs.cs b/Source/Krypton Components/Krypton.Navigator/EventArgs/PageReorderEventArgs.cs
index d429590e7..ba0c9d73a 100644
--- a/Source/Krypton Components/Krypton.Navigator/EventArgs/PageReorderEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Navigator/EventArgs/PageReorderEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/EventArgs/PopupPageEventArgs.cs b/Source/Krypton Components/Krypton.Navigator/EventArgs/PopupPageEventArgs.cs
index d8aff74ed..2f4ae803a 100644
--- a/Source/Krypton Components/Krypton.Navigator/EventArgs/PopupPageEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Navigator/EventArgs/PopupPageEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/EventArgs/ShowContextMenuArgs.cs b/Source/Krypton Components/Krypton.Navigator/EventArgs/ShowContextMenuArgs.cs
index 92a749a0a..9e55558f5 100644
--- a/Source/Krypton Components/Krypton.Navigator/EventArgs/ShowContextMenuArgs.cs
+++ b/Source/Krypton Components/Krypton.Navigator/EventArgs/ShowContextMenuArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/General/Definitions.cs b/Source/Krypton Components/Krypton.Navigator/General/Definitions.cs
index d51219455..b607e0fc8 100644
--- a/Source/Krypton Components/Krypton.Navigator/General/Definitions.cs
+++ b/Source/Krypton Components/Krypton.Navigator/General/Definitions.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/General/PageToToolTipMapping.cs b/Source/Krypton Components/Krypton.Navigator/General/PageToToolTipMapping.cs
index d8452e07f..b7a564714 100644
--- a/Source/Krypton Components/Krypton.Navigator/General/PageToToolTipMapping.cs
+++ b/Source/Krypton Components/Krypton.Navigator/General/PageToToolTipMapping.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -39,7 +39,7 @@ public PageToToolTipMapping([DisallowNull] KryptonPage page,
{
Debug.Assert(page != null);
- _page = page;
+ _page = page ?? throw new ArgumentNullException(nameof(page));
_mapImage = mapImage;
_mapText = mapText;
_mapExtraText = mapExtraText;
diff --git a/Source/Krypton Components/Krypton.Navigator/Global/GlobalDeclarations.cs b/Source/Krypton Components/Krypton.Navigator/Global/GlobalDeclarations.cs
index 4a099e832..02529a623 100644
--- a/Source/Krypton Components/Krypton.Navigator/Global/GlobalDeclarations.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Global/GlobalDeclarations.cs
@@ -1,7 +1,7 @@
#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. 2021 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2021 - 2024. All rights reserved.
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/Krypton.Navigator 2022.csproj b/Source/Krypton Components/Krypton.Navigator/Krypton.Navigator 2022.csproj
index 22acab150..9a7a80969 100644
--- a/Source/Krypton Components/Krypton.Navigator/Krypton.Navigator 2022.csproj
+++ b/Source/Krypton Components/Krypton.Navigator/Krypton.Navigator 2022.csproj
@@ -1,26 +1,17 @@

-
+
- net462;net47;net471;net472;net48;net481;net6.0-windows;net7.0-windows;net8.0-windows
+ net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows
-
-
-
- net462;net47;net471;net472;net48;net481;net6.0-windows;net7.0-windows;net8.0-windows
-
-
-
-
- net48;net481;net6.0-windows;net7.0-windows
+
+ net48;net481;net8.0-windows;net9.0-windows
- net462;net47;net471;net472;net48;net481;net6.0-windows;net7.0-windows;net8.0-windows
-
-
-
+ net462;net47;net471;net472;net48;net481;net8.0-windows
+
@@ -40,10 +31,13 @@
en
true
Debug;Release;Installer;Nightly;Canary
- preview
enable
- 6
+
+ 8
+ latest
true
+
+ true
@@ -106,7 +100,7 @@
- ..\..\..\Bin\$(Configuration)\Krypton.Navigator.xml
+ true
..\..\..\Bin\$(Configuration)\
diff --git a/Source/Krypton Components/Krypton.Navigator/Krypton.Navigator.licenseheader b/Source/Krypton Components/Krypton.Navigator/Krypton.Navigator.licenseheader
index 93ab4f9da..eca455ed4 100644
--- a/Source/Krypton Components/Krypton.Navigator/Krypton.Navigator.licenseheader
+++ b/Source/Krypton Components/Krypton.Navigator/Krypton.Navigator.licenseheader
@@ -6,7 +6,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/Navigator/KryptonNavigatorActionList.cs b/Source/Krypton Components/Krypton.Navigator/Navigator/KryptonNavigatorActionList.cs
index e6f0d4e6b..fe7a854b3 100644
--- a/Source/Krypton Components/Krypton.Navigator/Navigator/KryptonNavigatorActionList.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Navigator/KryptonNavigatorActionList.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,8 +20,8 @@ public class KryptonNavigatorActionList : DesignerActionList
#region Instance Fields
private readonly KryptonNavigator _navigator;
private readonly KryptonNavigatorDesigner _designer;
- private readonly IComponentChangeService _serviceComponentChange;
- private readonly DesignerActionUIService _serviceDesignerAction;
+ private readonly IComponentChangeService? _serviceComponentChange;
+ private readonly DesignerActionUIService? _serviceDesignerAction;
private DesignerVerb _headerBarVisible;
private DesignerVerb _headerPrimaryVisible;
private DesignerVerb _headerSecondaryVisible;
@@ -40,11 +40,11 @@ public KryptonNavigatorActionList(KryptonNavigatorDesigner owner)
{
// Remember designer and actual component instance being designed
_designer = owner;
- _navigator = (KryptonNavigator)owner.Component;
+ _navigator = (owner.Component as KryptonNavigator)!;
// Cache service used to notify when a property has changed
- _serviceComponentChange = (IComponentChangeService)GetService(typeof(IComponentChangeService));
- _serviceDesignerAction = (DesignerActionUIService)GetService(typeof(DesignerActionUIService));
+ _serviceComponentChange = GetService(typeof(IComponentChangeService)) as IComponentChangeService;
+ _serviceDesignerAction = GetService(typeof(DesignerActionUIService)) as DesignerActionUIService;
}
#endregion
@@ -60,9 +60,9 @@ public NavigatorMode NavigatorMode
{
if (_navigator.NavigatorMode != value)
{
- _serviceComponentChange.OnComponentChanged(_navigator, null, _navigator.NavigatorMode, value);
+ _serviceComponentChange?.OnComponentChanged(_navigator, null, _navigator.NavigatorMode, value);
_navigator.NavigatorMode = value;
- _serviceDesignerAction.Refresh(_navigator);
+ _serviceDesignerAction?.Refresh(_navigator);
}
}
}
@@ -78,7 +78,7 @@ public PaletteBackStyle PageBackStyle
{
if (_navigator.PageBackStyle != value)
{
- _serviceComponentChange.OnComponentChanged(_navigator, null, _navigator.PageBackStyle, value);
+ _serviceComponentChange?.OnComponentChanged(_navigator, null, _navigator.PageBackStyle, value);
_navigator.PageBackStyle = value;
}
}
@@ -95,7 +95,7 @@ public VisualOrientation BarOrientation
{
if (_navigator.Bar.BarOrientation != value)
{
- _serviceComponentChange.OnComponentChanged(_navigator, null, _navigator.Bar.BarOrientation, value);
+ _serviceComponentChange?.OnComponentChanged(_navigator, null, _navigator.Bar.BarOrientation, value);
_navigator.Bar.BarOrientation = value;
}
}
@@ -112,7 +112,7 @@ public ButtonOrientation ItemOrientationBar
{
if (_navigator.Bar.ItemOrientation != value)
{
- _serviceComponentChange.OnComponentChanged(_navigator, null, _navigator.Bar.ItemOrientation, value);
+ _serviceComponentChange?.OnComponentChanged(_navigator, null, _navigator.Bar.ItemOrientation, value);
_navigator.Bar.ItemOrientation = value;
}
}
@@ -129,7 +129,7 @@ public ButtonOrientation ItemOrientationStack
{
if (_navigator.Stack.ItemOrientation != value)
{
- _serviceComponentChange.OnComponentChanged(_navigator, null, _navigator.Stack.ItemOrientation, value);
+ _serviceComponentChange?.OnComponentChanged(_navigator, null, _navigator.Stack.ItemOrientation, value);
_navigator.Stack.ItemOrientation = value;
}
}
@@ -146,7 +146,7 @@ public ButtonOrientation ItemOrientationOutlook
{
if (_navigator.Outlook.ItemOrientation != value)
{
- _serviceComponentChange.OnComponentChanged(_navigator, null, _navigator.Outlook.ItemOrientation, value);
+ _serviceComponentChange?.OnComponentChanged(_navigator, null, _navigator.Outlook.ItemOrientation, value);
_navigator.Outlook.ItemOrientation = value;
}
}
@@ -163,7 +163,7 @@ public RelativePositionAlign ItemAlignment
{
if (_navigator.Bar.ItemAlignment != value)
{
- _serviceComponentChange.OnComponentChanged(_navigator, null, _navigator.Bar.ItemAlignment, value);
+ _serviceComponentChange?.OnComponentChanged(_navigator, null, _navigator.Bar.ItemAlignment, value);
_navigator.Bar.ItemAlignment = value;
}
}
@@ -180,7 +180,7 @@ public BarItemSizing ItemSizing
{
if (_navigator.Bar.ItemSizing != value)
{
- _serviceComponentChange.OnComponentChanged(_navigator, null, _navigator.Bar.ItemSizing, value);
+ _serviceComponentChange?.OnComponentChanged(_navigator, null, _navigator.Bar.ItemSizing, value);
_navigator.Bar.ItemSizing = value;
}
}
@@ -197,7 +197,7 @@ public TabBorderStyle TabBorderStyle
{
if (_navigator.Bar.TabBorderStyle != value)
{
- _serviceComponentChange.OnComponentChanged(_navigator, null, _navigator.Bar.TabBorderStyle, value);
+ _serviceComponentChange?.OnComponentChanged(_navigator, null, _navigator.Bar.TabBorderStyle, value);
_navigator.Bar.TabBorderStyle = value;
}
}
@@ -214,7 +214,7 @@ public TabStyle TabStyle
{
if (_navigator.Bar.TabStyle != value)
{
- _serviceComponentChange.OnComponentChanged(_navigator, null, _navigator.Bar.TabStyle, value);
+ _serviceComponentChange?.OnComponentChanged(_navigator, null, _navigator.Bar.TabStyle, value);
_navigator.Bar.TabStyle = value;
}
}
@@ -231,7 +231,7 @@ public ButtonStyle CheckButtonStyleBar
{
if (_navigator.Bar.CheckButtonStyle != value)
{
- _serviceComponentChange.OnComponentChanged(_navigator, null, _navigator.Bar.CheckButtonStyle, value);
+ _serviceComponentChange?.OnComponentChanged(_navigator, null, _navigator.Bar.CheckButtonStyle, value);
_navigator.Bar.CheckButtonStyle = value;
}
}
@@ -248,7 +248,7 @@ public ButtonStyle CheckButtonStyleStack
{
if (_navigator.Stack.CheckButtonStyle != value)
{
- _serviceComponentChange.OnComponentChanged(_navigator, null, _navigator.Stack.CheckButtonStyle, value);
+ _serviceComponentChange?.OnComponentChanged(_navigator, null, _navigator.Stack.CheckButtonStyle, value);
_navigator.Stack.CheckButtonStyle = value;
}
}
@@ -265,7 +265,7 @@ public ButtonStyle CheckButtonStyleOutlook
{
if (_navigator.Outlook.CheckButtonStyle != value)
{
- _serviceComponentChange.OnComponentChanged(_navigator, null, _navigator.Outlook.CheckButtonStyle, value);
+ _serviceComponentChange?.OnComponentChanged(_navigator, null, _navigator.Outlook.CheckButtonStyle, value);
_navigator.Outlook.CheckButtonStyle = value;
}
}
@@ -282,7 +282,7 @@ public ButtonDisplayLogic ButtonDisplayLogic
{
if (_navigator.Button.ButtonDisplayLogic != value)
{
- _serviceComponentChange.OnComponentChanged(_navigator, null, _navigator.Button.ButtonDisplayLogic, value);
+ _serviceComponentChange?.OnComponentChanged(_navigator, null, _navigator.Button.ButtonDisplayLogic, value);
_navigator.Button.ButtonDisplayLogic = value;
}
}
@@ -299,7 +299,7 @@ public ButtonDisplay CloseButtonDisplay
{
if (_navigator.Button.CloseButtonDisplay != value)
{
- _serviceComponentChange.OnComponentChanged(_navigator, null, _navigator.Button.CloseButtonDisplay, value);
+ _serviceComponentChange?.OnComponentChanged(_navigator, null, _navigator.Button.CloseButtonDisplay, value);
_navigator.Button.CloseButtonDisplay = value;
}
}
@@ -316,7 +316,7 @@ public CloseButtonAction CloseButtonAction
{
if (_navigator.Button.CloseButtonAction != value)
{
- _serviceComponentChange.OnComponentChanged(_navigator, null, _navigator.Button.CloseButtonAction, value);
+ _serviceComponentChange?.OnComponentChanged(_navigator, null, _navigator.Button.CloseButtonAction, value);
_navigator.Button.CloseButtonAction = value;
}
}
@@ -333,7 +333,7 @@ public PaletteBackStyle GroupBackStyle
{
if (_navigator.Group.GroupBackStyle != value)
{
- _serviceComponentChange.OnComponentChanged(_navigator, null, _navigator.Group.GroupBackStyle, value);
+ _serviceComponentChange?.OnComponentChanged(_navigator, null, _navigator.Group.GroupBackStyle, value);
_navigator.Group.GroupBackStyle = value;
}
}
@@ -350,7 +350,7 @@ public PaletteBorderStyle GroupBorderStyle
{
if (_navigator.Group.GroupBorderStyle != value)
{
- _serviceComponentChange.OnComponentChanged(_navigator, null, _navigator.Group.GroupBorderStyle, value);
+ _serviceComponentChange?.OnComponentChanged(_navigator, null, _navigator.Group.GroupBorderStyle, value);
_navigator.Group.GroupBorderStyle = value;
}
}
@@ -367,7 +367,7 @@ public HeaderStyle BarHeaderStyle
{
if (_navigator.Header.HeaderStyleBar != value)
{
- _serviceComponentChange.OnComponentChanged(_navigator, null, _navigator.Header.HeaderStyleBar, value);
+ _serviceComponentChange?.OnComponentChanged(_navigator, null, _navigator.Header.HeaderStyleBar, value);
_navigator.Header.HeaderStyleBar = value;
}
}
@@ -384,7 +384,7 @@ public VisualOrientation BarHeaderPosition
{
if (_navigator.Header.HeaderPositionBar != value)
{
- _serviceComponentChange.OnComponentChanged(_navigator, null, _navigator.Header.HeaderPositionBar, value);
+ _serviceComponentChange?.OnComponentChanged(_navigator, null, _navigator.Header.HeaderPositionBar, value);
_navigator.Header.HeaderPositionBar = value;
}
}
@@ -401,7 +401,7 @@ public HeaderStyle PrimaryHeaderStyle
{
if (_navigator.Header.HeaderStylePrimary != value)
{
- _serviceComponentChange.OnComponentChanged(_navigator, null, _navigator.Header.HeaderStylePrimary, value);
+ _serviceComponentChange?.OnComponentChanged(_navigator, null, _navigator.Header.HeaderStylePrimary, value);
_navigator.Header.HeaderStylePrimary = value;
}
}
@@ -418,7 +418,7 @@ public VisualOrientation PrimaryHeaderPosition
{
if (_navigator.Header.HeaderPositionPrimary != value)
{
- _serviceComponentChange.OnComponentChanged(_navigator, null, _navigator.Header.HeaderPositionPrimary, value);
+ _serviceComponentChange?.OnComponentChanged(_navigator, null, _navigator.Header.HeaderPositionPrimary, value);
_navigator.Header.HeaderPositionPrimary = value;
}
}
@@ -435,7 +435,7 @@ public HeaderStyle SecondaryHeaderStyle
{
if (_navigator.Header.HeaderStyleSecondary != value)
{
- _serviceComponentChange.OnComponentChanged(_navigator, null, _navigator.Header.HeaderStyleSecondary, value);
+ _serviceComponentChange?.OnComponentChanged(_navigator, null, _navigator.Header.HeaderStyleSecondary, value);
_navigator.Header.HeaderStyleSecondary = value;
}
}
@@ -452,7 +452,7 @@ public VisualOrientation SecondaryHeaderPosition
{
if (_navigator.Header.HeaderPositionSecondary != value)
{
- _serviceComponentChange.OnComponentChanged(_navigator, null, _navigator.Header.HeaderPositionSecondary, value);
+ _serviceComponentChange?.OnComponentChanged(_navigator, null, _navigator.Header.HeaderPositionSecondary, value);
_navigator.Header.HeaderPositionSecondary = value;
}
}
@@ -469,7 +469,7 @@ public InheritBool SecondaryHeaderOutlookVisible
{
if (_navigator.Outlook.HeaderSecondaryVisible != value)
{
- _serviceComponentChange.OnComponentChanged(_navigator, null, _navigator.Outlook.HeaderSecondaryVisible, value);
+ _serviceComponentChange?.OnComponentChanged(_navigator, null, _navigator.Outlook.HeaderSecondaryVisible, value);
_navigator.Outlook.HeaderSecondaryVisible = value;
}
}
@@ -486,7 +486,7 @@ public Orientation OutlookOrientation
{
if (_navigator.Outlook.Orientation != value)
{
- _serviceComponentChange.OnComponentChanged(_navigator, null, _navigator.Outlook.Orientation, value);
+ _serviceComponentChange?.OnComponentChanged(_navigator, null, _navigator.Outlook.Orientation, value);
_navigator.Outlook.Orientation = value;
}
}
@@ -503,7 +503,7 @@ public PaletteBackStyle PanelBackStyle
{
if (_navigator.Panel.PanelBackStyle != value)
{
- _serviceComponentChange.OnComponentChanged(_navigator, null, _navigator.Panel.PanelBackStyle, value);
+ _serviceComponentChange?.OnComponentChanged(_navigator, null, _navigator.Panel.PanelBackStyle, value);
_navigator.Panel.PanelBackStyle = value;
}
}
@@ -520,7 +520,7 @@ public Orientation StackOrientation
{
if (_navigator.Stack.StackOrientation != value)
{
- _serviceComponentChange.OnComponentChanged(_navigator, null, _navigator.Stack.StackOrientation, value);
+ _serviceComponentChange?.OnComponentChanged(_navigator, null, _navigator.Stack.StackOrientation, value);
_navigator.Stack.StackOrientation = value;
}
}
@@ -537,7 +537,7 @@ public RelativePositionAlign StackAlignment
{
if (_navigator.Stack.StackAlignment != value)
{
- _serviceComponentChange.OnComponentChanged(_navigator, null, _navigator.Stack.StackAlignment, value);
+ _serviceComponentChange?.OnComponentChanged(_navigator, null, _navigator.Stack.StackAlignment, value);
_navigator.Stack.StackAlignment = value;
}
}
@@ -657,7 +657,7 @@ public override DesignerActionItemCollection GetSortedActionItems()
public void AddPage()
{
_designer.AddPage();
- _serviceDesignerAction.Refresh(_navigator);
+ _serviceDesignerAction?.Refresh(_navigator);
}
///
@@ -666,7 +666,7 @@ public void AddPage()
public void RemovePage()
{
_designer.RemovePage();
- _serviceDesignerAction.Refresh(_navigator);
+ _serviceDesignerAction?.Refresh(_navigator);
}
///
@@ -675,7 +675,7 @@ public void RemovePage()
public void ClearPages()
{
_designer.ClearPages();
- _serviceDesignerAction.Refresh(_navigator);
+ _serviceDesignerAction?.Refresh(_navigator);
}
#endregion
@@ -811,7 +811,7 @@ private void AddConstantActions(DesignerActionItemCollection actions)
}
}
- private void OnVisibleClick(object sender, EventArgs e)
+ private void OnVisibleClick(object? sender, EventArgs e)
{
// Cast to the correct type
var verb = sender as DesignerVerb;
@@ -844,7 +844,7 @@ private void OnVisibleClick(object sender, EventArgs e)
}
// Refersh view to reflect the change
- _serviceDesignerAction.Refresh(_navigator);
+ _serviceDesignerAction?.Refresh(_navigator);
}
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Navigator/Navigator/KryptonNavigatorDesigner.cs b/Source/Krypton Components/Krypton.Navigator/Navigator/KryptonNavigatorDesigner.cs
index db98ba625..d7056f46c 100644
--- a/Source/Krypton Components/Krypton.Navigator/Navigator/KryptonNavigatorDesigner.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Navigator/KryptonNavigatorDesigner.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -54,7 +54,7 @@ public override void Initialize([DisallowNull] IComponent component)
// Must enable the child panel so that copy and paste of navigator
// correctly copies across copies of the child pages. Also allows the
// child panel to be viewed in the document outline and modified.
- EnableDesignMode(Navigator.ChildPanel, "PageContainer");
+ EnableDesignMode(Navigator.ChildPanel!, "PageContainer");
// Make sure that all the pages in control can be designed
foreach (KryptonPage page in Navigator.Pages)
@@ -72,9 +72,9 @@ public override void Initialize([DisallowNull] IComponent component)
}
// Get access to the services
- _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
- _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
- _selectionService = (ISelectionService)GetService(typeof(ISelectionService));
+ _designerHost = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_designerHost)));
+ _changeService = (IComponentChangeService?)GetService(typeof(IComponentChangeService)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_changeService)));
+ _selectionService = (ISelectionService?)GetService(typeof(ISelectionService)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_selectionService)));
// We need to know when we are being removed
_changeService.ComponentRemoving += OnComponentRemoving;
@@ -162,7 +162,7 @@ public override ICollection AssociatedComponents
// Add all the navigator components
if (Navigator != null)
{
- compound.AddRange(Navigator.Button.ButtonSpecs);
+ compound.AddRange(Navigator.Button.ButtonSpecs!);
compound.AddRange(Navigator.Pages);
}
@@ -312,18 +312,18 @@ protected override void OnMouseLeave()
///
/// Source of the event.
/// A ComponentEventArgs containing event data.
- protected virtual void OnComponentRemoving(object sender, ComponentEventArgs e)
+ protected virtual void OnComponentRemoving(object? sender, ComponentEventArgs e)
{
// If our control is being removed
if (e.Component == Navigator)
{
// Need access to host in order to delete a component
- var host = (IDesignerHost)GetService(typeof(IDesignerHost));
+ var host = (IDesignerHost)GetService(typeof(IDesignerHost))!;
// We need to remove all the button spec instances
if (Navigator != null)
{
- for (var i = Navigator.Button.ButtonSpecs.Count - 1; i >= 0; i--)
+ for (var i = Navigator.Button.ButtonSpecs!.Count - 1; i >= 0; i--)
{
ButtonSpec spec = Navigator.Button.ButtonSpecs[i];
_changeService.OnComponentChanging(Navigator, null);
@@ -348,7 +348,7 @@ protected virtual void OnComponentRemoving(object sender, ComponentEventArgs e)
#endregion
#region Implementation
- private void OnAddPage(object sender, EventArgs e)
+ private void OnAddPage(object? sender, EventArgs e)
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonNavigator AddPage");
@@ -405,7 +405,7 @@ private void OnAddPage(object sender, EventArgs e)
}
}
- private void OnRemovePage(object sender, EventArgs e)
+ private void OnRemovePage(object? sender, EventArgs e)
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonNavigator RemovePage");
@@ -439,7 +439,7 @@ private void OnRemovePage(object sender, EventArgs e)
}
}
- private void OnClearPages(object sender, EventArgs e)
+ private void OnClearPages(object? sender, EventArgs e)
{
if (KryptonMessageBox.Show(@"Are you sure that all pages should be removed?",
@"Clear Pages",
@@ -488,15 +488,15 @@ private void OnPageInserted(object sender, TypedCollectionEventArgs
private void OnPageRemoved(object sender, TypedCollectionEventArgs e) => UpdateVerbStatus();
- private void OnPagesCleared(object sender, EventArgs e) => UpdateVerbStatus();
+ private void OnPagesCleared(object? sender, EventArgs e) => UpdateVerbStatus();
- private void OnSelectedPageChanged(object sender, EventArgs e)
+ private void OnSelectedPageChanged(object? sender, EventArgs e)
{
MarkSelectionAsChanged();
UpdateVerbStatus();
}
- private void OnNavigatorMouseUp(object sender, MouseEventArgs e)
+ private void OnNavigatorMouseUp(object? sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
@@ -506,7 +506,7 @@ private void OnNavigatorMouseUp(object sender, MouseEventArgs e)
if (component != null)
{
// Force the layout to be update for any change in selection
- Navigator.PerformLayout();
+ Navigator?.PerformLayout();
// Select the component
var selectionList = new ArrayList
diff --git a/Source/Krypton Components/Krypton.Navigator/Navigator/KryptonPageActionList.cs b/Source/Krypton Components/Krypton.Navigator/Navigator/KryptonPageActionList.cs
index 6d7f14b14..1a166539f 100644
--- a/Source/Krypton Components/Krypton.Navigator/Navigator/KryptonPageActionList.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Navigator/KryptonPageActionList.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -16,7 +16,7 @@ internal class KryptonPageActionList : DesignerActionList
{
#region Instance Fields
private readonly KryptonPage _page;
- private readonly IComponentChangeService _serviceComponentChange;
+ private readonly IComponentChangeService? _serviceComponentChange;
private DesignerActionItemCollection _actions;
#endregion
@@ -29,10 +29,10 @@ public KryptonPageActionList(KryptonPageDesigner owner)
: base(owner.Component)
{
// Remember designer and actual component instance being designed
- _page = (KryptonPage)owner.Component;
+ _page = (owner.Component as KryptonPage)!;
// Cache service used to notify when a property has changed
- _serviceComponentChange = (IComponentChangeService)GetService(typeof(IComponentChangeService));
+ _serviceComponentChange = GetService(typeof(IComponentChangeService)) as IComponentChangeService;
}
#endregion
@@ -48,7 +48,7 @@ public string TextShort
{
if (!_page.Text.Equals(value))
{
- _serviceComponentChange.OnComponentChanged(_page, null, _page.Text, value);
+ _serviceComponentChange?.OnComponentChanged(_page, null, _page.Text, value);
_page.Text = value;
}
}
@@ -65,7 +65,7 @@ public string TextTitle
{
if (!_page.TextTitle.Equals(value))
{
- _serviceComponentChange.OnComponentChanged(_page, null, _page.TextTitle, value);
+ _serviceComponentChange?.OnComponentChanged(_page, null, _page.TextTitle, value);
_page.TextTitle = value;
}
}
@@ -82,7 +82,7 @@ public string TextDescription
{
if (!_page.TextDescription.Equals(value))
{
- _serviceComponentChange.OnComponentChanged(_page, null, _page.TextDescription, value);
+ _serviceComponentChange?.OnComponentChanged(_page, null, _page.TextDescription, value);
_page.TextDescription = value;
}
}
@@ -99,7 +99,7 @@ public string ToolTipTitle
{
if (!_page.ToolTipTitle.Equals(value))
{
- _serviceComponentChange.OnComponentChanged(_page, null, _page.ToolTipTitle, value);
+ _serviceComponentChange?.OnComponentChanged(_page, null, _page.ToolTipTitle, value);
_page.ToolTipTitle = value;
}
}
@@ -116,7 +116,7 @@ public string ToolTipBody
{
if (!_page.ToolTipBody.Equals(value))
{
- _serviceComponentChange.OnComponentChanged(_page, null, _page.ToolTipBody, value);
+ _serviceComponentChange?.OnComponentChanged(_page, null, _page.ToolTipBody, value);
_page.ToolTipBody = value;
}
}
@@ -133,7 +133,7 @@ public Bitmap? ToolTipImage
{
if (_page.ToolTipImage != value)
{
- _serviceComponentChange.OnComponentChanged(_page, null, _page.ToolTipImage, value);
+ _serviceComponentChange?.OnComponentChanged(_page, null, _page.ToolTipImage, value);
_page.ToolTipImage = value;
}
}
@@ -150,7 +150,7 @@ public Bitmap? ImageSmall
{
if (_page.ImageSmall != value)
{
- _serviceComponentChange.OnComponentChanged(_page, null, _page.ImageSmall, value);
+ _serviceComponentChange?.OnComponentChanged(_page, null, _page.ImageSmall, value);
_page.ImageSmall = value;
}
}
@@ -167,7 +167,7 @@ public Bitmap? ImageMedium
{
if (_page.ImageMedium != value)
{
- _serviceComponentChange.OnComponentChanged(_page, null, _page.ImageMedium, value);
+ _serviceComponentChange?.OnComponentChanged(_page, null, _page.ImageMedium, value);
_page.ImageMedium = value;
}
}
@@ -184,7 +184,7 @@ public Bitmap? ImageLarge
{
if (_page.ImageLarge != value)
{
- _serviceComponentChange.OnComponentChanged(_page, null, _page.ImageLarge, value);
+ _serviceComponentChange?.OnComponentChanged(_page, null, _page.ImageLarge, value);
_page.ImageLarge = value;
}
}
@@ -199,7 +199,7 @@ public bool PageInOverflowBarForOutlookMode
set
{
- _serviceComponentChange.OnComponentChanged(_page, null, _page.AreFlagsSet(KryptonPageFlags.PageInOverflowBarForOutlookMode), value);
+ _serviceComponentChange?.OnComponentChanged(_page, null, _page.AreFlagsSet(KryptonPageFlags.PageInOverflowBarForOutlookMode), value);
if (value)
{
diff --git a/Source/Krypton Components/Krypton.Navigator/Navigator/KryptonPageDesigner.cs b/Source/Krypton Components/Krypton.Navigator/Navigator/KryptonPageDesigner.cs
index 351c6cc9e..d742ba009 100644
--- a/Source/Krypton Components/Krypton.Navigator/Navigator/KryptonPageDesigner.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Navigator/KryptonPageDesigner.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -50,8 +50,8 @@ public override void Initialize([DisallowNull] IComponent component)
}
// Acquire service interfaces
- _selectionService = (ISelectionService)GetService(typeof(ISelectionService));
- _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
+ _selectionService = (ISelectionService?)GetService(typeof(ISelectionService)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_selectionService)));
+ _changeService = (IComponentChangeService?)GetService(typeof(IComponentChangeService)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_changeService)));
// We need to know when we are being removed
_changeService.ComponentRemoving += OnComponentRemoving;
@@ -210,7 +210,7 @@ protected override void OnPaintAdornments(PaintEventArgs pe)
#endregion
#region Implementation
- private void OnEditFlags(object sender, EventArgs e)
+ private void OnEditFlags(object? sender, EventArgs e)
{
var editFlags = new KryptonPageFormEditFlags(_page);
editFlags.ShowDialog();
@@ -274,16 +274,16 @@ private void DrawBorder(Graphics graphics)
graphics.DrawRectangle(borderPen, clientRect);
}
- private void OnComponentRemoving(object sender, ComponentEventArgs e)
+ private void OnComponentRemoving(object? sender, ComponentEventArgs e)
{
// If our control is being removed
if ((_page != null) && (e.Component == _page))
{
// Need access to host in order to delete a component
- var host = (IDesignerHost)GetService(typeof(IDesignerHost));
+ var host = (IDesignerHost)GetService(typeof(IDesignerHost))!;
// We need to remove all the button spec instances
- for (var i = _page.ButtonSpecs.Count - 1; i >= 0; i--)
+ for (var i = _page.ButtonSpecs!.Count - 1; i >= 0; i--)
{
// Get access to the indexed button spec
ButtonSpec spec = _page.ButtonSpecs[i];
diff --git a/Source/Krypton Components/Krypton.Navigator/Navigator/KryptonPageFormEditFlags.Designer.cs b/Source/Krypton Components/Krypton.Navigator/Navigator/KryptonPageFormEditFlags.Designer.cs
index 2113e4f92..5f0aa82db 100644
--- a/Source/Krypton Components/Krypton.Navigator/Navigator/KryptonPageFormEditFlags.Designer.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Navigator/KryptonPageFormEditFlags.Designer.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -53,158 +53,188 @@ private void InitializeComponent()
this.checkBoxDockingAllowDropDown = new Krypton.Toolkit.KryptonCheckBox();
this.checkBoxAllowPageReorder = new Krypton.Toolkit.KryptonCheckBox();
this.checkBoxAllowConfigSave = new Krypton.Toolkit.KryptonCheckBox();
+ this.kpnlButtons = new Krypton.Toolkit.KryptonPanel();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit();
+ this.kpnlButtons.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
+ this.kryptonPanel1.SuspendLayout();
this.SuspendLayout();
//
// buttonOK
//
- this.buttonOK.Anchor = ((AnchorStyles)((AnchorStyles.Bottom | AnchorStyles.Right)));
- this.buttonOK.DialogResult = DialogResult.OK;
- this.buttonOK.Location = new System.Drawing.Point(261, 203);
+ this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.buttonOK.Location = new System.Drawing.Point(261, 15);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 23);
this.buttonOK.TabIndex = 12;
- this.buttonOK.Text = "OK";
+ this.buttonOK.Values.Text = "OK";
this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);
//
// buttonCancel
//
- this.buttonCancel.Anchor = ((AnchorStyles)((AnchorStyles.Bottom | AnchorStyles.Right)));
- this.buttonCancel.DialogResult = DialogResult.Cancel;
- this.buttonCancel.Location = new System.Drawing.Point(342, 203);
+ this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this.buttonCancel.Location = new System.Drawing.Point(342, 15);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 23);
this.buttonCancel.TabIndex = 0;
- this.buttonCancel.Text = "Cancel";
+ this.buttonCancel.Values.Text = "Cancel";
//
// checkBoxPageInOverflowBarForOutlookMode
//
- this.checkBoxPageInOverflowBarForOutlookMode.AutoSize = true;
- this.checkBoxPageInOverflowBarForOutlookMode.Location = new System.Drawing.Point(15, 18);
+ this.checkBoxPageInOverflowBarForOutlookMode.Location = new System.Drawing.Point(12, 12);
this.checkBoxPageInOverflowBarForOutlookMode.Name = "checkBoxPageInOverflowBarForOutlookMode";
- this.checkBoxPageInOverflowBarForOutlookMode.Size = new System.Drawing.Size(210, 17);
+ this.checkBoxPageInOverflowBarForOutlookMode.Size = new System.Drawing.Size(239, 20);
this.checkBoxPageInOverflowBarForOutlookMode.TabIndex = 0;
- this.checkBoxPageInOverflowBarForOutlookMode.Text = "Page in Overflow Bar for Outlook mode";
+ this.checkBoxPageInOverflowBarForOutlookMode.Values.Text = "Page in Overflow Bar for Outlook mode";
//
// checkBoxAllowPageDrag
//
- this.checkBoxAllowPageDrag.AutoSize = true;
- this.checkBoxAllowPageDrag.Location = new System.Drawing.Point(15, 41);
+ this.checkBoxAllowPageDrag.Location = new System.Drawing.Point(12, 35);
this.checkBoxAllowPageDrag.Name = "checkBoxAllowPageDrag";
- this.checkBoxAllowPageDrag.Size = new System.Drawing.Size(105, 17);
+ this.checkBoxAllowPageDrag.Size = new System.Drawing.Size(114, 20);
this.checkBoxAllowPageDrag.TabIndex = 1;
- this.checkBoxAllowPageDrag.Text = "Allow Page Drag";
+ this.checkBoxAllowPageDrag.Values.Text = "Allow Page Drag";
//
// checkBoxDockingAllowClose
//
- this.checkBoxDockingAllowClose.AutoSize = true;
- this.checkBoxDockingAllowClose.Location = new System.Drawing.Point(256, 18);
+ this.checkBoxDockingAllowClose.Location = new System.Drawing.Point(253, 12);
this.checkBoxDockingAllowClose.Name = "checkBoxDockingAllowClose";
- this.checkBoxDockingAllowClose.Size = new System.Drawing.Size(123, 17);
+ this.checkBoxDockingAllowClose.Size = new System.Drawing.Size(135, 20);
this.checkBoxDockingAllowClose.TabIndex = 4;
- this.checkBoxDockingAllowClose.Text = "Docking Allow Close";
+ this.checkBoxDockingAllowClose.Values.Text = "Docking Allow Close";
//
// checkBoxDockingAllowAutoHidden
//
- this.checkBoxDockingAllowAutoHidden.AutoSize = true;
- this.checkBoxDockingAllowAutoHidden.Location = new System.Drawing.Point(256, 64);
+ this.checkBoxDockingAllowAutoHidden.Location = new System.Drawing.Point(253, 58);
this.checkBoxDockingAllowAutoHidden.Name = "checkBoxDockingAllowAutoHidden";
- this.checkBoxDockingAllowAutoHidden.Size = new System.Drawing.Size(153, 17);
+ this.checkBoxDockingAllowAutoHidden.Size = new System.Drawing.Size(172, 20);
this.checkBoxDockingAllowAutoHidden.TabIndex = 6;
- this.checkBoxDockingAllowAutoHidden.Text = "Docking Allow AutoHidden";
+ this.checkBoxDockingAllowAutoHidden.Values.Text = "Docking Allow AutoHidden";
//
// checkBoxDockingAllowDocked
//
- this.checkBoxDockingAllowDocked.AutoSize = true;
- this.checkBoxDockingAllowDocked.Location = new System.Drawing.Point(256, 87);
+ this.checkBoxDockingAllowDocked.Location = new System.Drawing.Point(253, 81);
this.checkBoxDockingAllowDocked.Name = "checkBoxDockingAllowDocked";
- this.checkBoxDockingAllowDocked.Size = new System.Drawing.Size(135, 17);
+ this.checkBoxDockingAllowDocked.Size = new System.Drawing.Size(147, 20);
this.checkBoxDockingAllowDocked.TabIndex = 7;
- this.checkBoxDockingAllowDocked.Text = "Docking Allow Docked";
+ this.checkBoxDockingAllowDocked.Values.Text = "Docking Allow Docked";
//
// checkBoxDockingAllowFloating
//
- this.checkBoxDockingAllowFloating.AutoSize = true;
- this.checkBoxDockingAllowFloating.Location = new System.Drawing.Point(256, 110);
+ this.checkBoxDockingAllowFloating.Location = new System.Drawing.Point(253, 104);
this.checkBoxDockingAllowFloating.Name = "checkBoxDockingAllowFloating";
- this.checkBoxDockingAllowFloating.Size = new System.Drawing.Size(134, 17);
+ this.checkBoxDockingAllowFloating.Size = new System.Drawing.Size(149, 20);
this.checkBoxDockingAllowFloating.TabIndex = 8;
- this.checkBoxDockingAllowFloating.Text = "Docking Allow Floating";
+ this.checkBoxDockingAllowFloating.Values.Text = "Docking Allow Floating";
//
// checkBoxDockingAllowWorkspace
//
- this.checkBoxDockingAllowWorkspace.AutoSize = true;
- this.checkBoxDockingAllowWorkspace.Location = new System.Drawing.Point(256, 133);
+ this.checkBoxDockingAllowWorkspace.Location = new System.Drawing.Point(253, 127);
this.checkBoxDockingAllowWorkspace.Name = "checkBoxDockingAllowWorkspace";
- this.checkBoxDockingAllowWorkspace.Size = new System.Drawing.Size(152, 17);
+ this.checkBoxDockingAllowWorkspace.Size = new System.Drawing.Size(166, 20);
this.checkBoxDockingAllowWorkspace.TabIndex = 9;
- this.checkBoxDockingAllowWorkspace.Text = "Docking Allow Workspace";
+ this.checkBoxDockingAllowWorkspace.Values.Text = "Docking Allow Workspace";
//
// checkBoxDockingAllowNavigator
//
- this.checkBoxDockingAllowNavigator.AutoSize = true;
- this.checkBoxDockingAllowNavigator.Location = new System.Drawing.Point(256, 156);
+ this.checkBoxDockingAllowNavigator.Location = new System.Drawing.Point(253, 150);
this.checkBoxDockingAllowNavigator.Name = "checkBoxDockingAllowNavigator";
- this.checkBoxDockingAllowNavigator.Size = new System.Drawing.Size(143, 17);
+ this.checkBoxDockingAllowNavigator.Size = new System.Drawing.Size(159, 20);
this.checkBoxDockingAllowNavigator.TabIndex = 10;
- this.checkBoxDockingAllowNavigator.Text = "Docking Allow Navigator";
+ this.checkBoxDockingAllowNavigator.Values.Text = "Docking Allow Navigator";
//
// checkBoxDockingAllowDropDown
//
- this.checkBoxDockingAllowDropDown.AutoSize = true;
- this.checkBoxDockingAllowDropDown.Location = new System.Drawing.Point(256, 41);
+ this.checkBoxDockingAllowDropDown.Location = new System.Drawing.Point(253, 35);
this.checkBoxDockingAllowDropDown.Name = "checkBoxDockingAllowDropDown";
- this.checkBoxDockingAllowDropDown.Size = new System.Drawing.Size(148, 17);
+ this.checkBoxDockingAllowDropDown.Size = new System.Drawing.Size(165, 20);
this.checkBoxDockingAllowDropDown.TabIndex = 5;
- this.checkBoxDockingAllowDropDown.Text = "Docking Allow DropDown";
+ this.checkBoxDockingAllowDropDown.Values.Text = "Docking Allow DropDown";
//
// checkBoxAllowPageReorder
//
- this.checkBoxAllowPageReorder.AutoSize = true;
- this.checkBoxAllowPageReorder.Location = new System.Drawing.Point(15, 64);
+ this.checkBoxAllowPageReorder.Location = new System.Drawing.Point(12, 58);
this.checkBoxAllowPageReorder.Name = "checkBoxAllowPageReorder";
- this.checkBoxAllowPageReorder.Size = new System.Drawing.Size(120, 17);
+ this.checkBoxAllowPageReorder.Size = new System.Drawing.Size(131, 20);
this.checkBoxAllowPageReorder.TabIndex = 2;
- this.checkBoxAllowPageReorder.Text = "Allow Page Reorder";
+ this.checkBoxAllowPageReorder.Values.Text = "Allow Page Reorder";
//
// checkBoxAllowConfigSave
//
- this.checkBoxAllowConfigSave.AutoSize = true;
- this.checkBoxAllowConfigSave.Location = new System.Drawing.Point(15, 87);
+ this.checkBoxAllowConfigSave.Location = new System.Drawing.Point(12, 81);
this.checkBoxAllowConfigSave.Name = "checkBoxAllowConfigSave";
- this.checkBoxAllowConfigSave.Size = new System.Drawing.Size(112, 17);
+ this.checkBoxAllowConfigSave.Size = new System.Drawing.Size(122, 20);
this.checkBoxAllowConfigSave.TabIndex = 3;
- this.checkBoxAllowConfigSave.Text = "Allow Config Save";
+ this.checkBoxAllowConfigSave.Values.Text = "Allow Config Save";
+ //
+ // kpnlButtons
+ //
+ this.kpnlButtons.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlButtons.Controls.Add(this.buttonOK);
+ this.kpnlButtons.Controls.Add(this.buttonCancel);
+ this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlButtons.Location = new System.Drawing.Point(0, 188);
+ this.kpnlButtons.Name = "kpnlButtons";
+ this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlButtons.Size = new System.Drawing.Size(429, 50);
+ this.kpnlButtons.TabIndex = 13;
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(429, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kryptonPanel1
+ //
+ this.kryptonPanel1.Controls.Add(this.checkBoxPageInOverflowBarForOutlookMode);
+ this.kryptonPanel1.Controls.Add(this.checkBoxAllowPageDrag);
+ this.kryptonPanel1.Controls.Add(this.checkBoxAllowConfigSave);
+ this.kryptonPanel1.Controls.Add(this.checkBoxDockingAllowClose);
+ this.kryptonPanel1.Controls.Add(this.checkBoxAllowPageReorder);
+ this.kryptonPanel1.Controls.Add(this.checkBoxDockingAllowAutoHidden);
+ this.kryptonPanel1.Controls.Add(this.checkBoxDockingAllowDropDown);
+ this.kryptonPanel1.Controls.Add(this.checkBoxDockingAllowDocked);
+ this.kryptonPanel1.Controls.Add(this.checkBoxDockingAllowNavigator);
+ this.kryptonPanel1.Controls.Add(this.checkBoxDockingAllowFloating);
+ this.kryptonPanel1.Controls.Add(this.checkBoxDockingAllowWorkspace);
+ this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonPanel1.Name = "kryptonPanel1";
+ this.kryptonPanel1.Size = new System.Drawing.Size(429, 188);
+ this.kryptonPanel1.TabIndex = 14;
//
// KryptonPageFormEditFlags
//
this.AcceptButton = this.buttonOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = AutoScaleMode.Font;
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.buttonCancel;
this.ClientSize = new System.Drawing.Size(429, 238);
this.ControlBox = false;
- this.Controls.Add(this.checkBoxAllowConfigSave);
- this.Controls.Add(this.checkBoxAllowPageReorder);
- this.Controls.Add(this.checkBoxDockingAllowDropDown);
- this.Controls.Add(this.checkBoxDockingAllowNavigator);
- this.Controls.Add(this.checkBoxDockingAllowWorkspace);
- this.Controls.Add(this.checkBoxDockingAllowFloating);
- this.Controls.Add(this.checkBoxDockingAllowDocked);
- this.Controls.Add(this.checkBoxDockingAllowAutoHidden);
- this.Controls.Add(this.checkBoxDockingAllowClose);
- this.Controls.Add(this.checkBoxAllowPageDrag);
- this.Controls.Add(this.checkBoxPageInOverflowBarForOutlookMode);
- this.Controls.Add(this.buttonCancel);
- this.Controls.Add(this.buttonOK);
- this.FormBorderStyle = FormBorderStyle.FixedDialog;
+ this.Controls.Add(this.kryptonPanel1);
+ this.Controls.Add(this.kpnlButtons);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "KryptonPageFormEditFlags";
- this.StartPosition = FormStartPosition.CenterParent;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Krypton Page - Edit Flags";
this.Load += new System.EventHandler(this.OnLoad);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit();
+ this.kpnlButtons.ResumeLayout(false);
+ this.kpnlButtons.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
+ this.kryptonPanel1.ResumeLayout(false);
+ this.kryptonPanel1.PerformLayout();
this.ResumeLayout(false);
- this.PerformLayout();
}
@@ -223,5 +253,8 @@ private void InitializeComponent()
private Krypton.Toolkit.KryptonCheckBox checkBoxDockingAllowDropDown;
private Krypton.Toolkit.KryptonCheckBox checkBoxAllowPageReorder;
private Krypton.Toolkit.KryptonCheckBox checkBoxAllowConfigSave;
+ private KryptonPanel kpnlButtons;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private KryptonPanel kryptonPanel1;
}
}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Navigator/Navigator/KryptonPageFormEditFlags.cs b/Source/Krypton Components/Krypton.Navigator/Navigator/KryptonPageFormEditFlags.cs
index 95b592c76..3115bd3c2 100644
--- a/Source/Krypton Components/Krypton.Navigator/Navigator/KryptonPageFormEditFlags.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Navigator/KryptonPageFormEditFlags.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -41,118 +41,122 @@ public KryptonPageFormEditFlags(KryptonPage? page)
#region Implementation
private void OnLoad(object sender, EventArgs e)
{
- checkBoxPageInOverflowBarForOutlookMode.Checked = _page.AreFlagsSet(KryptonPageFlags.PageInOverflowBarForOutlookMode);
- checkBoxAllowPageDrag.Checked = _page.AreFlagsSet(KryptonPageFlags.AllowPageDrag);
- checkBoxAllowPageReorder.Checked = _page.AreFlagsSet(KryptonPageFlags.AllowPageReorder);
- checkBoxAllowConfigSave.Checked = _page.AreFlagsSet(KryptonPageFlags.AllowConfigSave);
- checkBoxDockingAllowClose.Checked = _page.AreFlagsSet(KryptonPageFlags.DockingAllowClose);
- checkBoxDockingAllowDropDown.Checked = _page.AreFlagsSet(KryptonPageFlags.DockingAllowDropDown);
- checkBoxDockingAllowAutoHidden.Checked = _page.AreFlagsSet(KryptonPageFlags.DockingAllowAutoHidden);
- checkBoxDockingAllowDocked.Checked = _page.AreFlagsSet(KryptonPageFlags.DockingAllowDocked);
- checkBoxDockingAllowFloating.Checked = _page.AreFlagsSet(KryptonPageFlags.DockingAllowFloating);
- checkBoxDockingAllowWorkspace.Checked = _page.AreFlagsSet(KryptonPageFlags.DockingAllowWorkspace);
- checkBoxDockingAllowNavigator.Checked = _page.AreFlagsSet(KryptonPageFlags.DockingAllowNavigator);
+ if (_page != null)
+ {
+ checkBoxPageInOverflowBarForOutlookMode.Checked =
+ _page.AreFlagsSet(KryptonPageFlags.PageInOverflowBarForOutlookMode);
+ checkBoxAllowPageDrag.Checked = _page.AreFlagsSet(KryptonPageFlags.AllowPageDrag);
+ checkBoxAllowPageReorder.Checked = _page.AreFlagsSet(KryptonPageFlags.AllowPageReorder);
+ checkBoxAllowConfigSave.Checked = _page.AreFlagsSet(KryptonPageFlags.AllowConfigSave);
+ checkBoxDockingAllowClose.Checked = _page.AreFlagsSet(KryptonPageFlags.DockingAllowClose);
+ checkBoxDockingAllowDropDown.Checked = _page.AreFlagsSet(KryptonPageFlags.DockingAllowDropDown);
+ checkBoxDockingAllowAutoHidden.Checked = _page.AreFlagsSet(KryptonPageFlags.DockingAllowAutoHidden);
+ checkBoxDockingAllowDocked.Checked = _page.AreFlagsSet(KryptonPageFlags.DockingAllowDocked);
+ checkBoxDockingAllowFloating.Checked = _page.AreFlagsSet(KryptonPageFlags.DockingAllowFloating);
+ checkBoxDockingAllowWorkspace.Checked = _page.AreFlagsSet(KryptonPageFlags.DockingAllowWorkspace);
+ checkBoxDockingAllowNavigator.Checked = _page.AreFlagsSet(KryptonPageFlags.DockingAllowNavigator);
+ }
}
-
+
private void buttonOK_Click(object sender, EventArgs e)
{
if (checkBoxPageInOverflowBarForOutlookMode.Checked)
{
- _page.SetFlags(KryptonPageFlags.PageInOverflowBarForOutlookMode);
+ _page?.SetFlags(KryptonPageFlags.PageInOverflowBarForOutlookMode);
}
else
{
- _page.ClearFlags(KryptonPageFlags.PageInOverflowBarForOutlookMode);
+ _page?.ClearFlags(KryptonPageFlags.PageInOverflowBarForOutlookMode);
}
if (checkBoxAllowPageDrag.Checked)
{
- _page.SetFlags(KryptonPageFlags.AllowPageDrag);
+ _page?.SetFlags(KryptonPageFlags.AllowPageDrag);
}
else
{
- _page.ClearFlags(KryptonPageFlags.AllowPageDrag);
+ _page?.ClearFlags(KryptonPageFlags.AllowPageDrag);
}
if (checkBoxAllowPageReorder.Checked)
{
- _page.SetFlags(KryptonPageFlags.AllowPageReorder);
+ _page?.SetFlags(KryptonPageFlags.AllowPageReorder);
}
else
{
- _page.ClearFlags(KryptonPageFlags.AllowPageReorder);
+ _page?.ClearFlags(KryptonPageFlags.AllowPageReorder);
}
if (checkBoxAllowConfigSave.Checked)
{
- _page.SetFlags(KryptonPageFlags.AllowConfigSave);
+ _page?.SetFlags(KryptonPageFlags.AllowConfigSave);
}
else
{
- _page.ClearFlags(KryptonPageFlags.AllowConfigSave);
+ _page?.ClearFlags(KryptonPageFlags.AllowConfigSave);
}
if (checkBoxDockingAllowClose.Checked)
{
- _page.SetFlags(KryptonPageFlags.DockingAllowClose);
+ _page?.SetFlags(KryptonPageFlags.DockingAllowClose);
}
else
{
- _page.ClearFlags(KryptonPageFlags.DockingAllowClose);
+ _page?.ClearFlags(KryptonPageFlags.DockingAllowClose);
}
if (checkBoxDockingAllowDropDown.Checked)
{
- _page.SetFlags(KryptonPageFlags.DockingAllowDropDown);
+ _page?.SetFlags(KryptonPageFlags.DockingAllowDropDown);
}
else
{
- _page.ClearFlags(KryptonPageFlags.DockingAllowDropDown);
+ _page?.ClearFlags(KryptonPageFlags.DockingAllowDropDown);
}
if (checkBoxDockingAllowAutoHidden.Checked)
{
- _page.SetFlags(KryptonPageFlags.DockingAllowAutoHidden);
+ _page?.SetFlags(KryptonPageFlags.DockingAllowAutoHidden);
}
else
{
- _page.ClearFlags(KryptonPageFlags.DockingAllowAutoHidden);
+ _page?.ClearFlags(KryptonPageFlags.DockingAllowAutoHidden);
}
if (checkBoxDockingAllowDocked.Checked)
{
- _page.SetFlags(KryptonPageFlags.DockingAllowDocked);
+ _page?.SetFlags(KryptonPageFlags.DockingAllowDocked);
}
else
{
- _page.ClearFlags(KryptonPageFlags.DockingAllowDocked);
+ _page?.ClearFlags(KryptonPageFlags.DockingAllowDocked);
}
if (checkBoxDockingAllowFloating.Checked)
{
- _page.SetFlags(KryptonPageFlags.DockingAllowFloating);
+ _page?.SetFlags(KryptonPageFlags.DockingAllowFloating);
}
else
{
- _page.ClearFlags(KryptonPageFlags.DockingAllowFloating);
+ _page?.ClearFlags(KryptonPageFlags.DockingAllowFloating);
}
if (checkBoxDockingAllowWorkspace.Checked)
{
- _page.SetFlags(KryptonPageFlags.DockingAllowWorkspace);
+ _page?.SetFlags(KryptonPageFlags.DockingAllowWorkspace);
}
else
{
- _page.ClearFlags(KryptonPageFlags.DockingAllowWorkspace);
+ _page?.ClearFlags(KryptonPageFlags.DockingAllowWorkspace);
}
if (checkBoxDockingAllowNavigator.Checked)
{
- _page.SetFlags(KryptonPageFlags.DockingAllowNavigator);
+ _page?.SetFlags(KryptonPageFlags.DockingAllowNavigator);
}
else
{
- _page.ClearFlags(KryptonPageFlags.DockingAllowNavigator);
+ _page?.ClearFlags(KryptonPageFlags.DockingAllowNavigator);
}
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/Navigator/KryptonPageFormEditFlags.resx b/Source/Krypton Components/Krypton.Navigator/Navigator/KryptonPageFormEditFlags.resx
index 19dc0dd8b..d58980a38 100644
--- a/Source/Krypton Components/Krypton.Navigator/Navigator/KryptonPageFormEditFlags.resx
+++ b/Source/Krypton Components/Krypton.Navigator/Navigator/KryptonPageFormEditFlags.resx
@@ -112,9 +112,9 @@
2.0
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Navigator/Navigator/NavigatorPageCollectionEditor.cs b/Source/Krypton Components/Krypton.Navigator/Navigator/NavigatorPageCollectionEditor.cs
index 063339ec6..b7a9aea20 100644
--- a/Source/Krypton Components/Krypton.Navigator/Navigator/NavigatorPageCollectionEditor.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Navigator/NavigatorPageCollectionEditor.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -34,10 +34,10 @@ public NavigatorPageCollectionEditor()
/// The collection to edit.
/// An array of objects to set as the collection items.
/// The newly created collection object.
- protected override object SetItems(object editValue, object[] value)
+ protected override object? SetItems(object? editValue, object[]? value)
{
// Cast the context into the expected control type
- var navigator = (KryptonNavigator)Context.Instance;
+ var navigator = Context!.Instance as KryptonNavigator;
// Suspend changes until collection has been updated
navigator?.SuspendLayout();
diff --git a/Source/Krypton Components/Krypton.Navigator/Page/KryptonPage.cs b/Source/Krypton Components/Krypton.Navigator/Page/KryptonPage.cs
index d27a76e05..392715950 100644
--- a/Source/Krypton Components/Krypton.Navigator/Page/KryptonPage.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Page/KryptonPage.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -27,23 +27,23 @@ public class KryptonPage : VisualPanel
{
#region Instance Fields
private readonly ViewDrawPanel _drawPanel;
- private readonly PaletteRedirectDoubleMetric? _redirectNavigator;
- private readonly PaletteRedirectDoubleMetric? _redirectNavigatorHeaderGroup;
- private readonly PaletteRedirectTripleMetric? _redirectNavigatorHeaderPrimary;
- private readonly PaletteRedirectTripleMetric? _redirectNavigatorHeaderSecondary;
- private readonly PaletteRedirectTripleMetric? _redirectNavigatorHeaderBar;
- private readonly PaletteRedirectTripleMetric? _redirectNavigatorHeaderOverflow;
- private readonly PaletteRedirectTriple? _redirectNavigatorCheckButton;
- private readonly PaletteRedirectTriple? _redirectNavigatorOverflowButton;
- private readonly PaletteRedirectTriple? _redirectNavigatorMiniButton;
- private readonly PaletteRedirectTriple? _redirectNavigatorTab;
- private readonly PaletteRedirectRibbonTabContent? _redirectNavigatorRibbonTab;
- private readonly PaletteRedirectMetric? _redirectNavigatorBar;
- private readonly PaletteRedirectDouble? _redirectNavigatorPage;
- private readonly PaletteRedirectDoubleMetric? _redirectNavigatorSeparator;
+ private readonly PaletteRedirectDoubleMetric _redirectNavigator;
+ private readonly PaletteRedirectDoubleMetric _redirectNavigatorHeaderGroup;
+ private readonly PaletteRedirectTripleMetric _redirectNavigatorHeaderPrimary;
+ private readonly PaletteRedirectTripleMetric _redirectNavigatorHeaderSecondary;
+ private readonly PaletteRedirectTripleMetric _redirectNavigatorHeaderBar;
+ private readonly PaletteRedirectTripleMetric _redirectNavigatorHeaderOverflow;
+ private readonly PaletteRedirectTriple _redirectNavigatorCheckButton;
+ private readonly PaletteRedirectTriple _redirectNavigatorOverflowButton;
+ private readonly PaletteRedirectTriple _redirectNavigatorMiniButton;
+ private readonly PaletteRedirectTriple _redirectNavigatorTab;
+ private readonly PaletteRedirectRibbonTabContent _redirectNavigatorRibbonTab;
+ private readonly PaletteRedirectMetric _redirectNavigatorBar;
+ private readonly PaletteRedirectDouble _redirectNavigatorPage;
+ private readonly PaletteRedirectDoubleMetric _redirectNavigatorSeparator;
private readonly PaletteNavigatorRedirect? _stateCommon;
- private readonly PaletteNavigator? _stateDisabled;
- private readonly PaletteNavigator? _stateNormal;
+ private readonly PaletteNavigator _stateDisabled;
+ private readonly PaletteNavigator _stateNormal;
private readonly NeedPaintHandler? _needDisabledPaint;
private readonly NeedPaintHandler? _needNormalPaint;
private BoolFlags31 _flags;
@@ -150,8 +150,8 @@ public KryptonPage(string text)
///
/// Initial text.
/// Initial unique name.
- public KryptonPage(string text, string uniqueName)
- : this(text, null, uniqueName)
+ public KryptonPage(string text, string? uniqueName)
+ : this(text, null, uniqueName ?? string.Empty)
{
}
@@ -165,7 +165,7 @@ public KryptonPage(string text, string uniqueName)
///
/// If Min Size not set in the Embedded control, then will default to 150, 50
///
- public KryptonPage(string text, Bitmap? imageSmall, string uniqueName)
+ public KryptonPage(string text, Bitmap? imageSmall, string? uniqueName)
: this(text, imageSmall, uniqueName, new Size(150, 50))
{
@@ -178,7 +178,7 @@ public KryptonPage(string text, Bitmap? imageSmall, string uniqueName)
/// Initial small image.
/// Initial unique name.
/// Min Size of dragged docked control, if not set by Embedded
- public KryptonPage(string text, Bitmap? imageSmall, string uniqueName, Size minSize)
+ public KryptonPage(string text, Bitmap? imageSmall, string? uniqueName, Size minSize)
{
// Default properties
Text = text;
@@ -193,7 +193,7 @@ public KryptonPage(string text, Bitmap? imageSmall, string uniqueName, Size minS
_imageSmall = imageSmall;
_setVisible = true;
_autoHiddenSlideSize = new Size(200, 200);
- _uniqueName = string.IsNullOrEmpty(uniqueName) ? CommonHelper.UniqueString : uniqueName;
+ _uniqueName = string.IsNullOrEmpty(uniqueName) ? CommonHelper.UniqueString : uniqueName ?? string.Empty;
_flags.Flags = (int)KryptonPageFlags.All;
_flags.ClearFlags((int)KryptonPageFlags.PageInOverflowBarForOutlookMode);
@@ -201,6 +201,11 @@ public KryptonPage(string text, Bitmap? imageSmall, string uniqueName, Size minS
_needDisabledPaint = OnNeedDisabledPaint!;
_needNormalPaint = OnNeedNormalPaint!;
+ if (Redirector is null)
+ {
+ throw new ArgumentNullException(nameof(Redirector));
+ }
+
// Create redirector for inheriting from owning navigator
_redirectNavigator = new PaletteRedirectDoubleMetric(Redirector);
_redirectNavigatorPage = new PaletteRedirectDouble(Redirector);
@@ -300,7 +305,7 @@ public KryptonPage(string text, Bitmap? imageSmall, string uniqueName, Size minS
[Category(@"Visuals")]
[Description(@"Collection of button specifications.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public virtual PageButtonSpecCollection ButtonSpecs { get; }
+ public virtual PageButtonSpecCollection? ButtonSpecs { get; }
///
/// Gets access to the common page appearance entries.
@@ -322,13 +327,13 @@ public virtual PaletteNavigatorRedirect? StateCommon
[Category(@"Visuals")]
[Description(@"Overrides for defining disabled page appearance.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public virtual PaletteNavigator? StateDisabled
+ public virtual PaletteNavigator StateDisabled
{
[DebuggerStepThrough]
get => _stateDisabled;
}
- private bool ShouldSerializeStateDisabled() => !StateDisabled!.IsDefault;
+ private bool ShouldSerializeStateDisabled() => !StateDisabled.IsDefault;
///
/// Gets access to the normal page appearance entries.
@@ -336,13 +341,13 @@ public virtual PaletteNavigator? StateDisabled
[Category(@"Visuals")]
[Description(@"Overrides for defining normal page appearance.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public virtual PaletteNavigator? StateNormal
+ public virtual PaletteNavigator StateNormal
{
[DebuggerStepThrough]
get => _stateNormal;
}
- private bool ShouldSerializeStateNormal() => !StateNormal!.IsDefault;
+ private bool ShouldSerializeStateNormal() => !StateNormal.IsDefault;
///
/// Gets access to the tracking page appearance entries.
@@ -781,8 +786,8 @@ public virtual Size AutoHiddenSlideSize
/// State palette for inheriting focus values.
public virtual void SetInherit(Control alignControl,
PaletteNavigatorRedirect? common,
- PaletteNavigator? disabled,
- PaletteNavigator? normal,
+ PaletteNavigator disabled,
+ PaletteNavigator normal,
PaletteNavigatorOtherEx tracking,
PaletteNavigatorOtherEx pressed,
PaletteNavigatorOther selected,
@@ -796,53 +801,52 @@ public virtual void SetInherit(Control alignControl,
// Setup the redirection states
_redirectNavigator?.SetRedirectStates(disabled, disabled, normal, normal);
- _redirectNavigatorPage?.SetRedirectStates(disabled!.PalettePage, normal!.PalettePage);
+ _redirectNavigatorPage?.SetRedirectStates(disabled.PalettePage, normal.PalettePage);
- _redirectNavigatorHeaderGroup?.SetRedirectStates(disabled!.HeaderGroup, disabled.HeaderGroup,
- normal!.HeaderGroup, normal.HeaderGroup);
+ _redirectNavigatorHeaderGroup?.SetRedirectStates(disabled.HeaderGroup, disabled.HeaderGroup,
+ normal.HeaderGroup, normal.HeaderGroup);
- _redirectNavigatorHeaderPrimary?.SetRedirectStates(disabled!.HeaderGroup!.HeaderPrimary,
- disabled.HeaderGroup.HeaderPrimary, normal!.HeaderGroup!.HeaderPrimary,
+ _redirectNavigatorHeaderPrimary?.SetRedirectStates(disabled.HeaderGroup.HeaderPrimary,
+ disabled.HeaderGroup.HeaderPrimary, normal.HeaderGroup.HeaderPrimary,
normal.HeaderGroup.HeaderPrimary);
- _redirectNavigatorHeaderSecondary?.SetRedirectStates(disabled!.HeaderGroup!.HeaderSecondary,
- disabled.HeaderGroup.HeaderSecondary, normal!.HeaderGroup!.HeaderSecondary,
+ _redirectNavigatorHeaderSecondary?.SetRedirectStates(disabled.HeaderGroup.HeaderSecondary,
+ disabled.HeaderGroup.HeaderSecondary, normal.HeaderGroup.HeaderSecondary,
normal.HeaderGroup.HeaderSecondary);
- _redirectNavigatorHeaderBar?.SetRedirectStates(disabled!.HeaderGroup!.HeaderBar,
- disabled.HeaderGroup.HeaderBar, normal!.HeaderGroup!.HeaderBar, normal.HeaderGroup.HeaderBar);
+ _redirectNavigatorHeaderBar?.SetRedirectStates(disabled.HeaderGroup.HeaderBar,
+ disabled.HeaderGroup.HeaderBar, normal.HeaderGroup.HeaderBar, normal.HeaderGroup.HeaderBar);
- _redirectNavigatorHeaderOverflow?.SetRedirectStates(disabled!.HeaderGroup!.HeaderOverflow,
- disabled.HeaderGroup.HeaderOverflow, normal!.HeaderGroup!.HeaderOverflow,
+ _redirectNavigatorHeaderOverflow?.SetRedirectStates(disabled.HeaderGroup.HeaderOverflow,
+ disabled.HeaderGroup.HeaderOverflow, normal.HeaderGroup.HeaderOverflow,
normal.HeaderGroup.HeaderOverflow);
- _redirectNavigatorCheckButton?.SetRedirectStates(disabled!.CheckButton, normal!.CheckButton,
+ _redirectNavigatorCheckButton?.SetRedirectStates(disabled.CheckButton, normal.CheckButton,
pressed.CheckButton, tracking.CheckButton, selected.CheckButton, selected.CheckButton,
- selected.CheckButton, focus.CheckButton, null);
+ selected.CheckButton, focus.CheckButton, null!);
- _redirectNavigatorOverflowButton?.SetRedirectStates(disabled!.OverflowButton, normal!.OverflowButton,
+ _redirectNavigatorOverflowButton?.SetRedirectStates(disabled.OverflowButton, normal.OverflowButton,
pressed.OverflowButton, tracking.OverflowButton, selected.OverflowButton, selected.OverflowButton,
- selected.OverflowButton, focus.OverflowButton, null);
+ selected.OverflowButton, focus.OverflowButton, null!);
- _redirectNavigatorMiniButton?.SetRedirectStates(disabled!.MiniButton, normal!.MiniButton,
+ _redirectNavigatorMiniButton?.SetRedirectStates(disabled.MiniButton, normal.MiniButton,
pressed.MiniButton, tracking.MiniButton, selected.MiniButton, selected.MiniButton,
- selected.MiniButton, focus.MiniButton, null);
+ selected.MiniButton, focus.MiniButton, null!);
_redirectNavigatorBar?.SetRedirectStates(common!.Bar, common.Bar);
- _redirectNavigatorSeparator?.SetRedirectStates(disabled!.Separator, disabled.Separator, normal!.Separator,
+ _redirectNavigatorSeparator?.SetRedirectStates(disabled.Separator, disabled.Separator, normal.Separator,
normal.Separator, pressed.Separator, pressed.Separator, tracking.Separator, tracking.Separator);
- _redirectNavigatorTab?.SetRedirectStates(disabled!.Tab, normal!.Tab, pressed.Tab, tracking.Tab,
- selected.Tab, selected.Tab, selected.Tab, focus.Tab, null);
+ _redirectNavigatorTab?.SetRedirectStates(disabled.Tab, normal.Tab, pressed.Tab, tracking.Tab,
+ selected.Tab, selected.Tab, selected.Tab, focus.Tab, null!);
- _redirectNavigatorRibbonTab?.SetRedirectStates(disabled!.RibbonTab, normal!.RibbonTab, pressed.RibbonTab,
+ _redirectNavigatorRibbonTab?.SetRedirectStates(disabled.RibbonTab, normal.RibbonTab, pressed.RibbonTab,
tracking.RibbonTab, selected.RibbonTab, focus.RibbonTab);
- if (_stateCommon != null)
+ if (_stateCommon is not null && Redirector is not null)
{
- _stateCommon.RedirectBorderEdge =
- new PaletteRedirectBorderEdge(Redirector, disabled!.BorderEdge, normal!.BorderEdge);
+ _stateCommon.RedirectBorderEdge = new PaletteRedirectBorderEdge(Redirector, disabled.BorderEdge, normal.BorderEdge);
_stateCommon.RedirectRibbonGeneral = new PaletteRedirectRibbonGeneral(Redirector);
}
}
@@ -886,7 +890,7 @@ public virtual void ResetInherit(Control alignControl)
_redirectNavigatorRibbonTab?.ResetRedirectStates();
- if (_stateCommon != null)
+ if (_stateCommon is not null && Redirector is not null)
{
_stateCommon.RedirectBorderEdge = new PaletteRedirectBorder(Redirector);
_stateCommon.RedirectRibbonGeneral = new PaletteRedirectRibbonGeneral(Redirector);
diff --git a/Source/Krypton Components/Krypton.Navigator/Page/KryptonPageCollection.cs b/Source/Krypton Components/Krypton.Navigator/Page/KryptonPageCollection.cs
index 11114face..1a6dca893 100644
--- a/Source/Krypton Components/Krypton.Navigator/Page/KryptonPageCollection.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Page/KryptonPageCollection.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/HeaderGroupMappingBase.cs b/Source/Krypton Components/Krypton.Navigator/Palette/HeaderGroupMappingBase.cs
index 62525080d..9dd0b9d0c 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/HeaderGroupMappingBase.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/HeaderGroupMappingBase.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -35,7 +35,12 @@ protected HeaderGroupMappingBase([DisallowNull] KryptonNavigator navigator,
NeedPaintHandler needPaint)
: base(needPaint)
{
- Debug.Assert(navigator != null);
+ Debug.Assert(navigator is not null);
+
+ if (navigator is null)
+ {
+ throw new ArgumentNullException(nameof(navigator));
+ }
// Remember back reference to owning control
_navigator = navigator;
@@ -78,10 +83,11 @@ protected HeaderGroupMappingBase([DisallowNull] KryptonNavigator navigator,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => (base.IsDefault &&
- (MapImage == GetMapImageDefault()) &&
- (MapHeading == GetMapHeadingDefault()) &&
- (MapDescription == GetMapDescriptionDefault()));
+ (MapImage == GetMapImageDefault()) &&
+ (MapHeading == GetMapHeadingDefault()) &&
+ (MapDescription == GetMapDescriptionDefault()));
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/HeaderGroupMappingPrimary.cs b/Source/Krypton Components/Krypton.Navigator/Palette/HeaderGroupMappingPrimary.cs
index 3b870075b..93b16d8bd 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/HeaderGroupMappingPrimary.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/HeaderGroupMappingPrimary.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/HeaderGroupMappingSecondary.cs b/Source/Krypton Components/Krypton.Navigator/Palette/HeaderGroupMappingSecondary.cs
index 053576874..a5fb04fdc 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/HeaderGroupMappingSecondary.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/HeaderGroupMappingSecondary.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorBar.cs b/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorBar.cs
index 11bc2fd27..f22497df1 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorBar.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorBar.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -56,7 +56,12 @@ public class NavigatorBar : Storage
public NavigatorBar([DisallowNull] KryptonNavigator navigator,
NeedPaintHandler needPaint)
{
- Debug.Assert(navigator != null);
+ Debug.Assert(navigator is not null);
+
+ if (navigator is null)
+ {
+ throw new ArgumentNullException(nameof(navigator));
+ }
// Remember back reference
_navigator = navigator;
@@ -90,23 +95,24 @@ public NavigatorBar([DisallowNull] KryptonNavigator navigator,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => ((CheckButtonStyle == ButtonStyle.Standalone) &&
- (TabStyle == TabStyle.HighProfile) &&
- (TabBorderStyle == TabBorderStyle.RoundedOutsizeMedium) &&
- (BarFirstItemInset == DEFAULT_BAR_FIRST_ITEM_INSET) &&
- (BarLastItemInset == DEFAULT_BAR_LAST_ITEM_INSET) &&
- (BarMapImage == MapKryptonPageImage.Small) &&
- (BarMapText == MapKryptonPageText.TextTitle) &&
- (BarMapExtraText == MapKryptonPageText.None) &&
- (BarOrientation == VisualOrientation.Top) &&
- (ItemSizing == BarItemSizing.SameHeight) &&
- (ItemMinimumSize == _defaultItemMinimumSize) &&
- (ItemMaximumSize == _defaultItemMaximumSize) &&
- (ItemOrientation == ButtonOrientation.Auto) &&
- (ItemAlignment == RelativePositionAlign.Near) &&
- (BarMinimumHeight == DEFAULT_BAR_MINIMUM_HEIGHT) &&
- BarAnimation &&
- (BarMultiline == BarMultiline.Singleline));
+ (TabStyle == TabStyle.HighProfile) &&
+ (TabBorderStyle == TabBorderStyle.RoundedOutsizeMedium) &&
+ (BarFirstItemInset == DEFAULT_BAR_FIRST_ITEM_INSET) &&
+ (BarLastItemInset == DEFAULT_BAR_LAST_ITEM_INSET) &&
+ (BarMapImage == MapKryptonPageImage.Small) &&
+ (BarMapText == MapKryptonPageText.TextTitle) &&
+ (BarMapExtraText == MapKryptonPageText.None) &&
+ (BarOrientation == VisualOrientation.Top) &&
+ (ItemSizing == BarItemSizing.SameHeight) &&
+ (ItemMinimumSize == _defaultItemMinimumSize) &&
+ (ItemMaximumSize == _defaultItemMaximumSize) &&
+ (ItemOrientation == ButtonOrientation.Auto) &&
+ (ItemAlignment == RelativePositionAlign.Near) &&
+ (BarMinimumHeight == DEFAULT_BAR_MINIMUM_HEIGHT) &&
+ BarAnimation &&
+ (BarMultiline == BarMultiline.Singleline));
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorButton.cs b/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorButton.cs
index 9ee4d62ba..0700262e7 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorButton.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorButton.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -49,10 +49,10 @@ public class NavigatorButton : Storage
public NavigatorButton([DisallowNull] KryptonNavigator navigator,
NeedPaintHandler needPaint)
{
- Debug.Assert(navigator != null);
+ Debug.Assert(navigator is not null);
// Remember back reference
- _navigator = navigator;
+ _navigator = navigator ?? throw new ArgumentNullException(nameof(navigator));
// Store the provided paint notification delegate
NeedPaint = needPaint;
@@ -109,25 +109,26 @@ public NavigatorButton([DisallowNull] KryptonNavigator navigator,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
- public override bool IsDefault => ((ButtonSpecs.Count == 0) &&
- PreviousButton.IsDefault &&
- (PreviousButtonAction == DirectionButtonAction.ModeAppropriateAction) &&
- (PreviousButtonDisplay == ButtonDisplay.Logic) &&
- (PreviousButtonShortcut == DEFAULT_SHORTCUT_PREVIOUS) &&
- NextButton.IsDefault &&
- (NextButtonAction == DirectionButtonAction.ModeAppropriateAction) &&
- (NextButtonDisplay == ButtonDisplay.Logic) &&
- (NextButtonShortcut == DEFAULT_SHORTCUT_NEXT) &&
- ContextButton.IsDefault &&
- (ContextButtonDisplay == ButtonDisplay.Logic) &&
- (ContextButtonShortcut == DEFAULT_SHORTCUT_CONTEXT) &&
- (ContextMenuMapText == MapKryptonPageText.TextTitle) &&
- (ContextMenuMapImage == MapKryptonPageImage.Small) &&
- CloseButton.IsDefault &&
- (CloseButtonAction == CloseButtonAction.RemovePageAndDispose) &&
- (CloseButtonDisplay == ButtonDisplay.Logic) &&
- (CloseButtonShortcut == DEFAULT_SHORTCUT_CLOSE) &&
- (ButtonDisplayLogic == ButtonDisplayLogic.Context));
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public override bool IsDefault => ((ButtonSpecs!.Count == 0) &&
+ PreviousButton.IsDefault &&
+ (PreviousButtonAction == DirectionButtonAction.ModeAppropriateAction) &&
+ (PreviousButtonDisplay == ButtonDisplay.Logic) &&
+ (PreviousButtonShortcut == DEFAULT_SHORTCUT_PREVIOUS) &&
+ NextButton.IsDefault &&
+ (NextButtonAction == DirectionButtonAction.ModeAppropriateAction) &&
+ (NextButtonDisplay == ButtonDisplay.Logic) &&
+ (NextButtonShortcut == DEFAULT_SHORTCUT_NEXT) &&
+ ContextButton.IsDefault &&
+ (ContextButtonDisplay == ButtonDisplay.Logic) &&
+ (ContextButtonShortcut == DEFAULT_SHORTCUT_CONTEXT) &&
+ (ContextMenuMapText == MapKryptonPageText.TextTitle) &&
+ (ContextMenuMapImage == MapKryptonPageImage.Small) &&
+ CloseButton.IsDefault &&
+ (CloseButtonAction == CloseButtonAction.RemovePageAndDispose) &&
+ (CloseButtonDisplay == ButtonDisplay.Logic) &&
+ (CloseButtonShortcut == DEFAULT_SHORTCUT_CLOSE) &&
+ (ButtonDisplayLogic == ButtonDisplayLogic.Context));
#endregion
@@ -139,7 +140,7 @@ public NavigatorButton([DisallowNull] KryptonNavigator navigator,
[Description(@"Collection of button specifications.")]
[MergableProperty(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public NavigatorButtonSpecCollection ButtonSpecs { get; }
+ public NavigatorButtonSpecCollection? ButtonSpecs { get; }
#endregion
@@ -540,19 +541,19 @@ public ButtonDisplayLogic ButtonDisplayLogic
#endregion
#region Implementation
- private void OnPreviousClick(object sender, EventArgs e) => _navigator.PerformPreviousAction();
+ private void OnPreviousClick(object? sender, EventArgs e) => _navigator.PerformPreviousAction();
- private void OnNextClick(object sender, EventArgs e) => _navigator.PerformNextAction();
+ private void OnNextClick(object? sender, EventArgs e) => _navigator.PerformNextAction();
- private void OnContextClick(object sender, EventArgs e) => _navigator.PerformContextAction();
+ private void OnContextClick(object? sender, EventArgs e) => _navigator.PerformContextAction();
- private void OnCloseClick(object sender, EventArgs e) => _navigator.PerformCloseAction();
+ private void OnCloseClick(object? sender, EventArgs e) => _navigator.PerformCloseAction();
- private void OnMaximizeButtonClick(object sender, EventArgs e) => throw new NotImplementedException();
+ private void OnMaximizeButtonClick(object? sender, EventArgs e) => throw new NotImplementedException();
- private void OnMinimizeButtonClick(object sender, EventArgs e) => throw new NotImplementedException();
+ private void OnMinimizeButtonClick(object? sender, EventArgs e) => throw new NotImplementedException();
- private void OnCloseButtonClick(object sender, EventArgs e) => throw new NotImplementedException();
+ private void OnCloseButtonClick(object? sender, EventArgs e) => throw new NotImplementedException();
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorGroup.cs b/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorGroup.cs
index 740461c30..ee3a771fa 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorGroup.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorGroup.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -33,10 +33,10 @@ public class NavigatorGroup : Storage
public NavigatorGroup([DisallowNull] KryptonNavigator navigator,
NeedPaintHandler needPaint)
{
- Debug.Assert(navigator != null);
+ Debug.Assert(navigator is not null);
// Remember back reference
- _navigator = navigator;
+ _navigator = navigator ?? throw new ArgumentNullException(nameof(navigator));
// Store the provided paint notification delegate
NeedPaint = needPaint;
@@ -52,8 +52,9 @@ public NavigatorGroup([DisallowNull] KryptonNavigator navigator,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => ((GroupBackStyle == PaletteBackStyle.ControlClient) &&
- (GroupBorderStyle == PaletteBorderStyle.ControlClient));
+ (GroupBorderStyle == PaletteBorderStyle.ControlClient));
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorHeader.cs b/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorHeader.cs
index 8e9498347..9c22a8cd1 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorHeader.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorHeader.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -41,10 +41,10 @@ public class NavigatorHeader : Storage
public NavigatorHeader([DisallowNull] KryptonNavigator navigator,
NeedPaintHandler needPaint)
{
- Debug.Assert(navigator != null);
-
+ Debug.Assert(navigator is not null);
+
// Remember back reference
- _navigator = navigator;
+ _navigator = navigator ?? throw new ArgumentNullException(nameof(navigator));
// Store the provided paint notification delegate
NeedPaint = needPaint;
@@ -69,17 +69,18 @@ public NavigatorHeader([DisallowNull] KryptonNavigator navigator,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => ((HeaderStylePrimary == HeaderStyle.Primary) &&
- (HeaderStyleSecondary == HeaderStyle.Secondary) &&
- (HeaderStyleBar == HeaderStyle.Secondary) &&
- (HeaderPositionPrimary == VisualOrientation.Top) &&
- (HeaderPositionSecondary == VisualOrientation.Bottom) &&
- (HeaderPositionBar == VisualOrientation.Top) &&
- HeaderVisiblePrimary &&
- HeaderVisibleSecondary &&
- HeaderVisibleBar &&
- HeaderValuesPrimary.IsDefault &&
- HeaderValuesSecondary.IsDefault);
+ (HeaderStyleSecondary == HeaderStyle.Secondary) &&
+ (HeaderStyleBar == HeaderStyle.Secondary) &&
+ (HeaderPositionPrimary == VisualOrientation.Top) &&
+ (HeaderPositionSecondary == VisualOrientation.Bottom) &&
+ (HeaderPositionBar == VisualOrientation.Top) &&
+ HeaderVisiblePrimary &&
+ HeaderVisibleSecondary &&
+ HeaderVisibleBar &&
+ HeaderValuesPrimary.IsDefault &&
+ HeaderValuesSecondary.IsDefault);
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorOutlook.cs b/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorOutlook.cs
index a151b2511..d92b73068 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorOutlook.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorOutlook.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -46,10 +46,10 @@ public class NavigatorOutlook : Storage
public NavigatorOutlook([DisallowNull] KryptonNavigator navigator,
NeedPaintHandler needPaint)
{
- Debug.Assert(navigator != null);
-
+ Debug.Assert(navigator is not null);
+
// Remember back reference
- _navigator = navigator;
+ _navigator = navigator ?? throw new ArgumentNullException(nameof(navigator));
// Store the provided paint notification delegate
NeedPaint = needPaint;
@@ -77,18 +77,19 @@ public NavigatorOutlook([DisallowNull] KryptonNavigator navigator,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => (Full.IsDefault &&
- Mini.IsDefault &&
- (CheckButtonStyle == ButtonStyle.NavigatorStack) &&
- (OverflowButtonStyle == ButtonStyle.NavigatorOverflow) &&
- (BorderEdgeStyle == PaletteBorderStyle.ControlClient) &&
- (Orientation == Orientation.Vertical) &&
- (ItemOrientation == ButtonOrientation.Auto) &&
- (HeaderSecondaryVisible == InheritBool.False) &&
- (TextMoreButtons.Equals(DEFAULT_MORE_BUTTONS)) &&
- (TextFewerButtons.Equals(DEFAULT_FEWER_BUTTONS)) &&
- (TextAddRemoveButtons.Equals(DEFAULT_ADD_REMOVE_BUTTONS)) &&
- ShowDropDownButton);
+ Mini.IsDefault &&
+ (CheckButtonStyle == ButtonStyle.NavigatorStack) &&
+ (OverflowButtonStyle == ButtonStyle.NavigatorOverflow) &&
+ (BorderEdgeStyle == PaletteBorderStyle.ControlClient) &&
+ (Orientation == Orientation.Vertical) &&
+ (ItemOrientation == ButtonOrientation.Auto) &&
+ (HeaderSecondaryVisible == InheritBool.False) &&
+ (TextMoreButtons.Equals(DEFAULT_MORE_BUTTONS)) &&
+ (TextFewerButtons.Equals(DEFAULT_FEWER_BUTTONS)) &&
+ (TextAddRemoveButtons.Equals(DEFAULT_ADD_REMOVE_BUTTONS)) &&
+ ShowDropDownButton);
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorOutlookFull.cs b/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorOutlookFull.cs
index f9bb9910a..9ab2e2eb2 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorOutlookFull.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorOutlookFull.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -37,10 +37,10 @@ public class NavigatorOutlookFull : Storage
public NavigatorOutlookFull([DisallowNull] KryptonNavigator navigator,
NeedPaintHandler needPaint)
{
- Debug.Assert(navigator != null);
-
+ Debug.Assert(navigator is not null);
+
// Remember back reference
- _navigator = navigator;
+ _navigator = navigator ?? throw new ArgumentNullException(nameof(navigator));
// Store the provided paint notification delegate
NeedPaint = needPaint;
@@ -60,12 +60,13 @@ public NavigatorOutlookFull([DisallowNull] KryptonNavigator navigator,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => ((OverflowMapImage == MapKryptonPageImage.Small) &&
- (OverflowMapText == MapKryptonPageText.None) &&
- (OverflowMapExtraText == MapKryptonPageText.None) &&
- (StackMapImage == MapKryptonPageImage.MediumSmall) &&
- (StackMapText == MapKryptonPageText.TextTitle) &&
- (StackMapExtraText == MapKryptonPageText.None));
+ (OverflowMapText == MapKryptonPageText.None) &&
+ (OverflowMapExtraText == MapKryptonPageText.None) &&
+ (StackMapImage == MapKryptonPageImage.MediumSmall) &&
+ (StackMapText == MapKryptonPageText.TextTitle) &&
+ (StackMapExtraText == MapKryptonPageText.None));
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorOutlookMini.cs b/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorOutlookMini.cs
index b38a42b74..a32953b39 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorOutlookMini.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorOutlookMini.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -38,10 +38,10 @@ public class NavigatorOutlookMini : Storage
public NavigatorOutlookMini([DisallowNull] KryptonNavigator navigator,
NeedPaintHandler needPaint)
{
- Debug.Assert(navigator != null);
+ Debug.Assert(navigator is not null);
// Remember back reference
- _navigator = navigator;
+ _navigator = navigator ?? throw new ArgumentNullException(nameof(navigator));
// Store the provided paint notification delegate
NeedPaint = needPaint;
@@ -62,13 +62,14 @@ public NavigatorOutlookMini([DisallowNull] KryptonNavigator navigator,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => ((MiniButtonStyle == ButtonStyle.NavigatorMini) &&
- (MiniMapImage == MapKryptonPageImage.None) &&
- (MiniMapText == MapKryptonPageText.TextTitle) &&
- (MiniMapExtraText == MapKryptonPageText.None) &&
- (StackMapImage == MapKryptonPageImage.MediumSmall) &&
- (StackMapText == MapKryptonPageText.None) &&
- (StackMapExtraText == MapKryptonPageText.None));
+ (MiniMapImage == MapKryptonPageImage.None) &&
+ (MiniMapText == MapKryptonPageText.TextTitle) &&
+ (MiniMapExtraText == MapKryptonPageText.None) &&
+ (StackMapImage == MapKryptonPageImage.MediumSmall) &&
+ (StackMapText == MapKryptonPageText.None) &&
+ (StackMapExtraText == MapKryptonPageText.None));
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorPanel.cs b/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorPanel.cs
index 53913d8ee..6c369a544 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorPanel.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorPanel.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -32,10 +32,10 @@ public class NavigatorPanel : Storage
public NavigatorPanel([DisallowNull] KryptonNavigator navigator,
NeedPaintHandler needPaint)
{
- Debug.Assert(navigator != null);
+ Debug.Assert(navigator is not null);
// Remember back reference
- _navigator = navigator;
+ _navigator = navigator ?? throw new ArgumentNullException(nameof(navigator));
// Store the provided paint notification delegate
NeedPaint = needPaint;
@@ -50,6 +50,7 @@ public NavigatorPanel([DisallowNull] KryptonNavigator navigator,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => (PanelBackStyle == PaletteBackStyle.PanelClient);
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorPopupPages.cs b/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorPopupPages.cs
index a18abb489..c6d753d0e 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorPopupPages.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorPopupPages.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -38,13 +38,13 @@ public class NavigatorPopupPages : Storage
/// Reference to owning navigator instance.
/// Delegate for notifying paint requests.
public NavigatorPopupPages([DisallowNull] KryptonNavigator navigator,
- [DisallowNull] NeedPaintHandler needPaint)
+ [DisallowNull] NeedPaintHandler needPaint)
{
- Debug.Assert(navigator != null);
- Debug.Assert(needPaint != null);
-
+ Debug.Assert(navigator is not null);
+ Debug.Assert(needPaint is not null);
+
// Remember back reference
- _navigator = navigator;
+ _navigator = navigator ?? throw new ArgumentNullException(nameof(navigator));
// Store the provided paint notification delegate
NeedPaint = needPaint;
@@ -63,11 +63,12 @@ public NavigatorPopupPages([DisallowNull] KryptonNavigator navigator,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => ((AllowPopupPages == PopupPageAllow.OnlyOutlookMiniMode) &&
- (Border == DEFAULT_BORDER) &&
- (Element == DEFAULT_ELEMENT) &&
- (Gap == DEFAULT_GAP) &&
- (Position == DEFAULT_POSITION));
+ (Border == DEFAULT_BORDER) &&
+ (Element == DEFAULT_ELEMENT) &&
+ (Gap == DEFAULT_GAP) &&
+ (Position == DEFAULT_POSITION));
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorStack.cs b/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorStack.cs
index dfa8f1835..e820320ac 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorStack.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorStack.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -39,10 +39,10 @@ public class NavigatorStack : Storage
public NavigatorStack([DisallowNull] KryptonNavigator navigator,
NeedPaintHandler needPaint)
{
- Debug.Assert(navigator != null);
-
+ Debug.Assert(navigator is not null);
+
// Remember back reference
- _navigator = navigator;
+ _navigator = navigator ?? throw new ArgumentNullException(nameof(navigator));
// Store the provided paint notification delegate
NeedPaint = needPaint;
@@ -65,15 +65,16 @@ public NavigatorStack([DisallowNull] KryptonNavigator navigator,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => ((CheckButtonStyle == ButtonStyle.NavigatorStack) &&
- (BorderEdgeStyle == PaletteBorderStyle.ControlClient) &&
- StackAnimation &&
- (StackOrientation == Orientation.Vertical) &&
- (StackAlignment == RelativePositionAlign.Center) &&
- (ItemOrientation == ButtonOrientation.Auto) &&
- (StackMapImage == MapKryptonPageImage.Small) &&
- (StackMapText == MapKryptonPageText.TextTitle) &&
- (StackMapExtraText == MapKryptonPageText.None));
+ (BorderEdgeStyle == PaletteBorderStyle.ControlClient) &&
+ StackAnimation &&
+ (StackOrientation == Orientation.Vertical) &&
+ (StackAlignment == RelativePositionAlign.Center) &&
+ (ItemOrientation == ButtonOrientation.Auto) &&
+ (StackMapImage == MapKryptonPageImage.Small) &&
+ (StackMapText == MapKryptonPageText.TextTitle) &&
+ (StackMapExtraText == MapKryptonPageText.None));
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorToolTips.cs b/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorToolTips.cs
index 29a0047a9..3b37926e0 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorToolTips.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/NavigatorToolTips.cs
@@ -5,108 +5,109 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
namespace Krypton.Navigator
{
- ///
- /// Storage for tooltip related properties.
- ///
- public class NavigatorToolTips : Storage
- {
- #region Instance Fields
- private readonly KryptonNavigator _navigator;
- private MapKryptonPageImage _mapImage;
- #endregion
-
- #region Identity
- ///
- /// Initialize a new instance of the NavigatorPopupPage class.
- ///
- /// Reference to owning navigator instance.
- /// Delegate for notifying paint requests.
- public NavigatorToolTips([DisallowNull] KryptonNavigator navigator,
+ ///
+ /// Storage for tooltip related properties.
+ ///
+ public class NavigatorToolTips : Storage
+ {
+ #region Instance Fields
+ private readonly KryptonNavigator _navigator;
+ private MapKryptonPageImage _mapImage;
+ #endregion
+
+ #region Identity
+ ///
+ /// Initialize a new instance of the NavigatorPopupPage class.
+ ///
+ /// Reference to owning navigator instance.
+ /// Delegate for notifying paint requests.
+ public NavigatorToolTips([DisallowNull] KryptonNavigator navigator,
[DisallowNull] NeedPaintHandler needPaint)
- {
- Debug.Assert(navigator != null);
- Debug.Assert(needPaint != null);
-
- // Remember back reference
- _navigator = navigator;
-
- // Store the provided paint notification delegate
- NeedPaint = needPaint;
-
- // Default values
- AllowPageToolTips = false;
- AllowButtonSpecToolTips = false;
- AllowButtonSpecToolTipPriority = false;
- _mapImage = MapKryptonPageImage.ToolTip;
- MapText = MapKryptonPageText.ToolTipTitle;
- MapExtraText = MapKryptonPageText.ToolTipBody;
- }
- #endregion
-
- #region IsDefault
- ///
- /// Gets a value indicating if all values are default.
- ///
- [Browsable(false)]
- public override bool IsDefault => (!AllowPageToolTips &&
- !AllowButtonSpecToolTips &&
- !AllowButtonSpecToolTipPriority &&
- (MapImage == MapKryptonPageImage.ToolTip) &&
- (MapText == MapKryptonPageText.ToolTipTitle) &&
- (MapExtraText == MapKryptonPageText.ToolTipBody));
-
- #endregion
-
- #region AllowPageToolTips
- ///
- /// Gets and sets a value indicating if tooltips should be Displayed for page headers.
- ///
- [Category(@"Visuals")]
- [Description(@"Should tooltips be Displayed for page headers.")]
- [DefaultValue(false)]
- public bool AllowPageToolTips { get; set; }
-
- #endregion
-
- #region AllowButtonSpecToolTips
- ///
- /// Gets and sets a value indicating if tooltips should be Displayed for button specs.
- ///
- [Category(@"Visuals")]
- [Description(@"Should tooltips be Displayed for button specs.")]
- [DefaultValue(false)]
- public bool AllowButtonSpecToolTips { get; set; }
-
- ///
- /// Gets and sets a value indicating if button spec tooltips should remove the parent tooltip.
- ///
- [Category(@"Visuals")]
- [Description(@"Should button spec tooltips should remove the parent tooltip")]
- [DefaultValue(false)]
- public bool AllowButtonSpecToolTipPriority { get; set; }
- #endregion
-
- #region MapImage
- ///
- /// Gets and sets the mapping used for the tooltip image.
- ///
- [Localizable(true)]
- [Category(@"Visuals")]
- [Description(@"Mapping used for the tooltip image.")]
- [RefreshProperties(RefreshProperties.All)]
- //[DefaultValue(typeof(MapKryptonPageImage), "ToolTip")]
- public virtual MapKryptonPageImage MapImage
- {
- get => _mapImage;
- set => _mapImage = value;
- }
+ {
+ Debug.Assert(navigator is not null);
+ Debug.Assert(needPaint is not null);
+
+ // Remember back reference
+ _navigator = navigator ?? throw new ArgumentNullException(nameof(navigator));
+
+ // Store the provided paint notification delegate
+ NeedPaint = needPaint;
+
+ // Default values
+ AllowPageToolTips = false;
+ AllowButtonSpecToolTips = false;
+ AllowButtonSpecToolTipPriority = false;
+ _mapImage = MapKryptonPageImage.ToolTip;
+ MapText = MapKryptonPageText.ToolTipTitle;
+ MapExtraText = MapKryptonPageText.ToolTipBody;
+ }
+ #endregion
+
+ #region IsDefault
+ ///
+ /// Gets a value indicating if all values are default.
+ ///
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public override bool IsDefault => (!AllowPageToolTips &&
+ !AllowButtonSpecToolTips &&
+ !AllowButtonSpecToolTipPriority &&
+ (MapImage == MapKryptonPageImage.ToolTip) &&
+ (MapText == MapKryptonPageText.ToolTipTitle) &&
+ (MapExtraText == MapKryptonPageText.ToolTipBody));
+
+ #endregion
+
+ #region AllowPageToolTips
+ ///
+ /// Gets and sets a value indicating if tooltips should be Displayed for page headers.
+ ///
+ [Category(@"Visuals")]
+ [Description(@"Should tooltips be Displayed for page headers.")]
+ [DefaultValue(false)]
+ public bool AllowPageToolTips { get; set; }
+
+ #endregion
+
+ #region AllowButtonSpecToolTips
+ ///
+ /// Gets and sets a value indicating if tooltips should be Displayed for button specs.
+ ///
+ [Category(@"Visuals")]
+ [Description(@"Should tooltips be Displayed for button specs.")]
+ [DefaultValue(false)]
+ public bool AllowButtonSpecToolTips { get; set; }
+
+ ///
+ /// Gets and sets a value indicating if button spec tooltips should remove the parent tooltip.
+ ///
+ [Category(@"Visuals")]
+ [Description(@"Should button spec tooltips should remove the parent tooltip")]
+ [DefaultValue(false)]
+ public bool AllowButtonSpecToolTipPriority { get; set; }
+ #endregion
+
+ #region MapImage
+ ///
+ /// Gets and sets the mapping used for the tooltip image.
+ ///
+ [Localizable(true)]
+ [Category(@"Visuals")]
+ [Description(@"Mapping used for the tooltip image.")]
+ [RefreshProperties(RefreshProperties.All)]
+ //[DefaultValue(typeof(MapKryptonPageImage), "ToolTip")]
+ public virtual MapKryptonPageImage MapImage
+ {
+ get => _mapImage;
+ set => _mapImage = value;
+ }
///
/// Resets the MapImage property to its default value.
@@ -119,10 +120,10 @@ public virtual MapKryptonPageImage MapImage
/// Gets and sets the mapping used for the tooltip text.
///
[Category(@"Visuals")]
- [Description(@"Mapping used for the tooltip text.")]
- [RefreshProperties(RefreshProperties.All)]
- //[DefaultValue(typeof(MapKryptonPageText), "ToolTipTitle")]
- public MapKryptonPageText MapText { get; set; }
+ [Description(@"Mapping used for the tooltip text.")]
+ [RefreshProperties(RefreshProperties.All)]
+ //[DefaultValue(typeof(MapKryptonPageText), "ToolTipTitle")]
+ public MapKryptonPageText MapText { get; set; }
///
/// Resets the MapText property to its default value.
@@ -135,10 +136,10 @@ public virtual MapKryptonPageImage MapImage
/// Gets and sets the mapping used for the tooltip description.
///
[Category(@"Visuals")]
- [Description(@"Mapping used for the tooltip description.")]
- [RefreshProperties(RefreshProperties.All)]
- //[DefaultValue(typeof(MapKryptonPageText), "ToolTipBody")]
- public MapKryptonPageText MapExtraText { get; set; }
+ [Description(@"Mapping used for the tooltip description.")]
+ [RefreshProperties(RefreshProperties.All)]
+ //[DefaultValue(typeof(MapKryptonPageText), "ToolTipBody")]
+ public MapKryptonPageText MapExtraText { get; set; }
///
/// Resets the MapExtraText property to its default value.
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteBarRedirect.cs b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteBarRedirect.cs
index 07d4784f8..8e47f2b6b 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteBarRedirect.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteBarRedirect.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -66,16 +66,17 @@ public PaletteBarRedirect([DisallowNull] PaletteRedirect redirect,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => (base.IsDefault &&
- BarPaddingTabs.Equals(CommonHelper.InheritPadding) &&
- BarPaddingInside.Equals(CommonHelper.InheritPadding) &&
- BarPaddingOutside.Equals(CommonHelper.InheritPadding) &&
- BarPaddingOnly.Equals(CommonHelper.InheritPadding) &&
- ButtonPadding.Equals(CommonHelper.InheritPadding) &&
- (ButtonEdgeOutside == -1) &&
- (ButtonEdgeInside == -1) &&
- (CheckButtonGap == -1) &&
- (RibbonTabGap == -1));
+ BarPaddingTabs.Equals(CommonHelper.InheritPadding) &&
+ BarPaddingInside.Equals(CommonHelper.InheritPadding) &&
+ BarPaddingOutside.Equals(CommonHelper.InheritPadding) &&
+ BarPaddingOnly.Equals(CommonHelper.InheritPadding) &&
+ ButtonPadding.Equals(CommonHelper.InheritPadding) &&
+ (ButtonEdgeOutside == -1) &&
+ (ButtonEdgeInside == -1) &&
+ (CheckButtonGap == -1) &&
+ (RibbonTabGap == -1));
#endregion
@@ -370,7 +371,7 @@ public override int GetMetricInt(PaletteState state, PaletteMetricInt metric)
}
// Pass onto the inheritance
- return _redirect.GetMetricInt(state, metric);
+ return _redirect!.GetMetricInt(state, metric);
}
///
@@ -381,7 +382,7 @@ public override int GetMetricInt(PaletteState state, PaletteMetricInt metric)
/// InheritBool value.
public override InheritBool GetMetricBool(PaletteState state, PaletteMetricBool metric) =>
// Always pass onto the inheritance
- _redirect.GetMetricBool(state, metric);
+ _redirect!.GetMetricBool(state, metric);
///
/// Gets a padding metric value.
@@ -426,7 +427,7 @@ public override Padding GetMetricPadding(PaletteState state, PaletteMetricPaddin
}
// Pass onto the inheritance
- return _redirect.GetMetricPadding(state, metric);
+ return _redirect!.GetMetricPadding(state, metric);
}
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteMetrics.cs b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteMetrics.cs
index c8b429a79..2d090d2b0 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteMetrics.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteMetrics.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -48,8 +48,9 @@ public PaletteMetrics(KryptonNavigator? navigator,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => ((PageButtonSpecInset == -1) &&
- PageButtonSpecPadding.Equals(CommonHelper.InheritPadding));
+ PageButtonSpecPadding.Equals(CommonHelper.InheritPadding));
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavContent.cs b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavContent.cs
index 6c9ead960..241e03a55 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavContent.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavContent.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -83,6 +83,7 @@ public PaletteNavContent([DisallowNull] IPaletteContent inherit,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => (Image!.IsDefault &&
ShortText.IsDefault &&
LongText.IsDefault &&
@@ -300,7 +301,7 @@ public Color GetContentImageColorTo(PaletteState state) => Image!.ImageColorTo !
///
/// Palette value should be applicable to this state.
/// Font value.
- public Font GetContentShortTextFont(PaletteState state) =>
+ public Font? GetContentShortTextFont(PaletteState state) =>
ShortText.Font ?? _inherit!.GetContentShortTextFont(state);
///
@@ -308,7 +309,7 @@ public Font GetContentShortTextFont(PaletteState state) =>
///
/// Palette value should be applicable to this state.
/// Font value.
- public Font GetContentShortTextNewFont(PaletteState state) =>
+ public Font? GetContentShortTextNewFont(PaletteState state) =>
ShortText.Font ?? _inherit!.GetContentShortTextNewFont(state);
///
@@ -469,7 +470,7 @@ public PaletteRectangleAlign GetContentShortTextImageAlign(PaletteState state) =
///
/// Font value.
/// Palette value should be applicable to this state.
- public Font GetContentLongTextFont(PaletteState state) =>
+ public Font? GetContentLongTextFont(PaletteState state) =>
LongText.Font ?? _inherit!.GetContentLongTextFont(state);
///
@@ -477,7 +478,7 @@ public Font GetContentLongTextFont(PaletteState state) =>
///
/// Palette value should be applicable to this state.
/// Font value.
- public Font GetContentLongTextNewFont(PaletteState state) =>
+ public Font? GetContentLongTextNewFont(PaletteState state) =>
LongText.Font ?? _inherit!.GetContentLongTextNewFont(state);
///
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavContentText.cs b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavContentText.cs
index 809abfec7..4429b5825 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavContentText.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavContentText.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavigator.cs b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavigator.cs
index 4f513d456..4f7a699a9 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavigator.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavigator.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -19,22 +19,22 @@ public class PaletteNavigator : PaletteDoubleMetric
{
#region Identity
///
- /// Initialize a new instance of the PaletteNavigatorNormabled class.
+ /// Initialize a new instance of the PaletteNavigator class.
///
/// inheritance redirection instance.
/// Delegate for notifying paint requests.
public PaletteNavigator(PaletteNavigatorRedirect? redirect,
NeedPaintHandler needPaint)
- : base(redirect, needPaint)
+ : base(redirect!, needPaint)
{
// Create the palette storage
- PalettePage = new PalettePage(redirect.PalettePage, needPaint);
+ PalettePage = new PalettePage(redirect!.PalettePage, needPaint);
HeaderGroup = new PaletteNavigatorHeaderGroup(redirect.HeaderGroup, redirect.HeaderGroup.HeaderPrimary, redirect.HeaderGroup.HeaderSecondary, redirect.HeaderGroup.HeaderBar, redirect.HeaderGroup.HeaderOverflow, needPaint);
CheckButton = new PaletteTriple(redirect.CheckButton, needPaint);
OverflowButton = new PaletteTriple(redirect.OverflowButton, needPaint);
MiniButton = new PaletteTriple(redirect.MiniButton, needPaint);
BorderEdge = new PaletteBorderEdge(redirect.BorderEdge, needPaint);
- Separator = new PaletteSeparatorPadding(redirect.Separator, redirect.Separator, needPaint);
+ Separator = new PaletteSeparatorPadding(redirect.Separator!, redirect.Separator!, needPaint);
Tab = new PaletteTabTriple(redirect.Tab, needPaint);
RibbonTab = new PaletteRibbonTabContent(redirect.RibbonTab.TabDraw, redirect.RibbonTab.TabDraw, redirect.RibbonTab.Content, needPaint);
}
@@ -45,16 +45,17 @@ public PaletteNavigator(PaletteNavigatorRedirect? redirect,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => (base.IsDefault &&
- PalettePage.IsDefault &&
- HeaderGroup.IsDefault &&
- CheckButton.IsDefault &&
- OverflowButton.IsDefault &&
- MiniButton.IsDefault &&
- BorderEdge.IsDefault &&
- Separator.IsDefault &&
- Tab.IsDefault &&
- RibbonTab.IsDefault);
+ PalettePage.IsDefault &&
+ HeaderGroup.IsDefault &&
+ CheckButton.IsDefault &&
+ OverflowButton.IsDefault &&
+ MiniButton.IsDefault &&
+ BorderEdge.IsDefault &&
+ Separator.IsDefault &&
+ Tab.IsDefault &&
+ RibbonTab.IsDefault);
#endregion
@@ -63,17 +64,21 @@ public PaletteNavigator(PaletteNavigatorRedirect? redirect,
/// Sets the inheritance parent.
///
/// Source for inheriting.
- public void SetInherit(PaletteNavigator? inheritNavigator)
+ public void SetInherit(PaletteNavigator inheritNavigator)
{
+ if ( inheritNavigator is null)
+ {
+ throw new ArgumentNullException(nameof(inheritNavigator));
+ }
// Setup inheritance references for storage objects
base.SetInherit(inheritNavigator);
- PalettePage.SetInherit(inheritNavigator.PalettePage);
- HeaderGroup.SetInherit(inheritNavigator.HeaderGroup);
+ PalettePage?.SetInherit(inheritNavigator.PalettePage);
+ HeaderGroup?.SetInherit(inheritNavigator.HeaderGroup);
CheckButton.SetInherit(inheritNavigator.CheckButton);
OverflowButton.SetInherit(inheritNavigator.OverflowButton);
MiniButton.SetInherit(inheritNavigator.MiniButton);
BorderEdge.SetInherit(inheritNavigator.BorderEdge);
- Separator.SetInherit(inheritNavigator.Separator);
+ Separator?.SetInherit(inheritNavigator.Separator);
Tab.SetInherit(inheritNavigator.Tab);
RibbonTab.SetInherit(inheritNavigator.RibbonTab.TabDraw, inheritNavigator.RibbonTab.TabDraw, inheritNavigator.RibbonTab.Content);
}
@@ -177,7 +182,7 @@ public void SetInherit(PaletteNavigator? inheritNavigator)
[Category(@"Visuals")]
[Description(@"Overrides for defining header group appearance entries.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public PaletteNavigatorHeaderGroup? HeaderGroup { get; }
+ public PaletteNavigatorHeaderGroup HeaderGroup { get; }
private bool ShouldSerializeHeaderGroup() => !HeaderGroup.IsDefault;
@@ -216,7 +221,7 @@ public void SetInherit(PaletteNavigator? inheritNavigator)
[Category(@"Visuals")]
[Description(@"Overrides for defining separator appearance.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public PaletteSeparatorPadding? Separator { get; }
+ public PaletteSeparatorPadding Separator { get; }
private bool ShouldSerializeSeparator() => !Separator.IsDefault;
@@ -249,7 +254,7 @@ public void SetInherit(PaletteNavigator? inheritNavigator)
#endregion
#region Internal
- internal PalettePage? PalettePage { get; }
+ internal PalettePage PalettePage { get; }
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavigatorHeaderGroup.cs b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavigatorHeaderGroup.cs
index cfde78f5f..ba865fa9a 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavigatorHeaderGroup.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavigatorHeaderGroup.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -27,7 +27,7 @@ public class PaletteNavigatorHeaderGroup : PaletteHeaderGroup
/// Source for inheriting bar header defaulted values.
/// Source for inheriting overflow header defaulted values.
/// Delegate for notifying paint requests.
- public PaletteNavigatorHeaderGroup(PaletteHeaderGroupRedirect? inheritHeaderGroup,
+ public PaletteNavigatorHeaderGroup(PaletteHeaderGroupRedirect inheritHeaderGroup,
PaletteHeaderPaddingRedirect inheritHeaderPrimary,
PaletteHeaderPaddingRedirect inheritHeaderSecondary,
[DisallowNull] PaletteHeaderPaddingRedirect inheritHeaderBar,
@@ -36,8 +36,13 @@ public PaletteNavigatorHeaderGroup(PaletteHeaderGroupRedirect? inheritHeaderGrou
: base(inheritHeaderGroup, inheritHeaderPrimary,
inheritHeaderSecondary, needPaint)
{
- Debug.Assert(inheritHeaderBar != null);
+ Debug.Assert(inheritHeaderBar is not null);
+ if (inheritHeaderBar is null)
+ {
+ throw new ArgumentNullException(nameof(inheritHeaderBar));
+ }
+
// Create the palette storage
HeaderBar = new PaletteTripleMetric(inheritHeaderBar, needPaint);
HeaderOverflow = new PaletteTripleMetric(inheritHeaderOverflow, needPaint);
@@ -49,9 +54,10 @@ public PaletteNavigatorHeaderGroup(PaletteHeaderGroupRedirect? inheritHeaderGrou
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => (base.IsDefault &&
- HeaderBar.IsDefault &&
- HeaderOverflow.IsDefault);
+ HeaderBar.IsDefault &&
+ HeaderOverflow.IsDefault);
#endregion
@@ -60,7 +66,7 @@ public PaletteNavigatorHeaderGroup(PaletteHeaderGroupRedirect? inheritHeaderGrou
/// Sets the inheritance parent.
///
/// Source for inheriting.
- public void SetInherit(PaletteNavigatorHeaderGroup? inheritHeaderGroup)
+ public void SetInherit(PaletteNavigatorHeaderGroup inheritHeaderGroup)
{
base.SetInherit(inheritHeaderGroup);
HeaderBar.SetInherit(inheritHeaderGroup.HeaderBar);
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavigatorHeaderGroupRedirect.cs b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavigatorHeaderGroupRedirect.cs
index c8ea9c798..0ffd921ff 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavigatorHeaderGroupRedirect.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavigatorHeaderGroupRedirect.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -23,7 +23,7 @@ public class PaletteNavigatorHeaderGroupRedirect : PaletteHeaderGroupRedirect
///
/// inheritance redirection instance.
/// Delegate for notifying paint requests.
- public PaletteNavigatorHeaderGroupRedirect(PaletteRedirect? redirect,
+ public PaletteNavigatorHeaderGroupRedirect(PaletteRedirect redirect,
NeedPaintHandler needPaint)
: this(redirect, redirect, redirect, redirect, redirect, needPaint)
{
@@ -38,17 +38,27 @@ public PaletteNavigatorHeaderGroupRedirect(PaletteRedirect? redirect,
/// inheritance redirection for bar header.
/// inheritance redirection for overflow header.
/// Delegate for notifying paint requests.
- public PaletteNavigatorHeaderGroupRedirect(PaletteRedirect? redirectHeaderGroup,
- PaletteRedirect? redirectHeaderPrimary,
- PaletteRedirect? redirectHeaderSecondary,
+ public PaletteNavigatorHeaderGroupRedirect(PaletteRedirect redirectHeaderGroup,
+ PaletteRedirect redirectHeaderPrimary,
+ PaletteRedirect redirectHeaderSecondary,
[DisallowNull] PaletteRedirect redirectHeaderBar,
[DisallowNull] PaletteRedirect redirectHeaderOverflow,
NeedPaintHandler needPaint)
: base(redirectHeaderGroup, redirectHeaderPrimary,
redirectHeaderSecondary, needPaint)
{
- Debug.Assert(redirectHeaderBar != null);
- Debug.Assert(redirectHeaderOverflow != null);
+ Debug.Assert(redirectHeaderBar is not null);
+ Debug.Assert(redirectHeaderOverflow is not null);
+
+ if (redirectHeaderBar is null)
+ {
+ throw new ArgumentNullException(nameof(redirectHeaderBar));
+ }
+
+ if (redirectHeaderOverflow is null)
+ {
+ throw new ArgumentNullException(nameof(redirectHeaderOverflow));
+ }
// Create the palette storage
HeaderBar = new PaletteHeaderPaddingRedirect(redirectHeaderBar, PaletteBackStyle.HeaderSecondary, PaletteBorderStyle.HeaderSecondary, PaletteContentStyle.HeaderSecondary, needPaint);
@@ -61,9 +71,10 @@ public PaletteNavigatorHeaderGroupRedirect(PaletteRedirect? redirectHeaderGroup,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => (base.IsDefault &&
- HeaderBar.IsDefault &&
- HeaderOverflow.IsDefault);
+ HeaderBar.IsDefault &&
+ HeaderOverflow.IsDefault);
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavigatorOther.cs b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavigatorOther.cs
index db2fea4bb..aa58117e7 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavigatorOther.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavigatorOther.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -24,10 +24,10 @@ public class PaletteNavigatorOther : Storage
/// inheritance redirection instance.
/// Delegate for notifying paint requests.
public PaletteNavigatorOther(PaletteNavigatorRedirect? redirect,
- NeedPaintHandler needPaint)
+ NeedPaintHandler needPaint)
{
// Create the palette storage
- CheckButton = new PaletteTriple(redirect.CheckButton, needPaint);
+ CheckButton = new PaletteTriple(redirect!.CheckButton, needPaint);
OverflowButton = new PaletteTriple(redirect.OverflowButton, needPaint);
MiniButton = new PaletteTriple(redirect.MiniButton, needPaint);
Tab = new PaletteTabTriple(redirect.Tab, needPaint);
@@ -40,11 +40,12 @@ public PaletteNavigatorOther(PaletteNavigatorRedirect? redirect,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => (CheckButton.IsDefault &&
- OverflowButton.IsDefault &&
- MiniButton.IsDefault &&
- Tab.IsDefault &&
- RibbonTab.IsDefault);
+ OverflowButton.IsDefault &&
+ MiniButton.IsDefault &&
+ Tab.IsDefault &&
+ RibbonTab.IsDefault);
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavigatorOtherEx.cs b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavigatorOtherEx.cs
index db73656b2..afd715dd0 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavigatorOtherEx.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavigatorOtherEx.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -27,7 +27,7 @@ public PaletteNavigatorOtherEx(PaletteNavigatorRedirect? redirect,
NeedPaintHandler needPaint)
: base(redirect, needPaint) =>
// Create the palette storage
- Separator = new PaletteSeparatorPadding(redirect.Separator, redirect.Separator, needPaint);
+ Separator = new PaletteSeparatorPadding(redirect!.Separator!, redirect.Separator!, needPaint);
#endregion
@@ -36,8 +36,9 @@ public PaletteNavigatorOtherEx(PaletteNavigatorRedirect? redirect,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
- public override bool IsDefault => base.IsDefault &&
- Separator.IsDefault;
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public override bool IsDefault => base.IsDefault &&
+ Separator.IsDefault;
#endregion
@@ -48,7 +49,7 @@ public PaletteNavigatorOtherEx(PaletteNavigatorRedirect? redirect,
/// Source for inheriting.
public override void SetInherit(PaletteNavigator inheritNavigator)
{
- Separator.SetInherit(inheritNavigator.Separator);
+ Separator?.SetInherit(inheritNavigator.Separator);
base.SetInherit(inheritNavigator);
}
#endregion
@@ -60,7 +61,7 @@ public override void SetInherit(PaletteNavigator inheritNavigator)
[Category(@"Visuals")]
[Description(@"Overrides for defining separator appearance.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public PaletteSeparatorPadding? Separator { get; }
+ public PaletteSeparatorPadding Separator { get; }
private bool ShouldSerializeSeparator() => !Separator.IsDefault;
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavigatorOtherRedirect.cs b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavigatorOtherRedirect.cs
index 1c1c01075..f71ac524c 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavigatorOtherRedirect.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavigatorOtherRedirect.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -27,15 +27,15 @@ public class PaletteNavigatorOtherRedirect : Storage
/// inheritance redirection instance for the tab.
/// inheritance redirection instance for the ribbon tab.
/// Delegate for notifying paint requests.
- public PaletteNavigatorOtherRedirect(PaletteRedirect? redirectCheckButton,
- PaletteRedirect? redirectOverflowButton,
- PaletteRedirect? redirectMiniButton,
- PaletteRedirect? redirectTab,
- PaletteRedirect? redirectRibbonTab,
- NeedPaintHandler needPaint)
+ public PaletteNavigatorOtherRedirect(PaletteRedirect redirectCheckButton,
+ PaletteRedirect redirectOverflowButton,
+ PaletteRedirect redirectMiniButton,
+ PaletteRedirect redirectTab,
+ PaletteRedirect redirectRibbonTab,
+ NeedPaintHandler needPaint)
{
// Create the palette storage
- CheckButton = new PaletteTripleRedirect(redirectCheckButton,
+ CheckButton = new PaletteTripleRedirect(redirectCheckButton,
PaletteBackStyle.ButtonStandalone,
PaletteBorderStyle.ButtonStandalone,
PaletteContentStyle.ButtonStandalone,
@@ -68,11 +68,12 @@ public PaletteNavigatorOtherRedirect(PaletteRedirect? redirectCheckButton,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => (CheckButton.IsDefault &&
- OverflowButton.IsDefault &&
- MiniButton.IsDefault &&
- RibbonTab.IsDefault &&
- Tab.IsDefault);
+ OverflowButton.IsDefault &&
+ MiniButton.IsDefault &&
+ RibbonTab.IsDefault &&
+ Tab.IsDefault);
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavigatorRedirect.cs b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavigatorRedirect.cs
index bd5161247..c1ce13be8 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavigatorRedirect.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteNavigatorRedirect.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -31,9 +31,9 @@ public class PaletteNavigatorRedirect : PaletteDoubleMetricRedirect
/// inheritance redirection instance.
/// Delegate for notifying paint requests.
public PaletteNavigatorRedirect(KryptonNavigator navigator,
- PaletteRedirect? redirect,
+ PaletteRedirect redirect,
NeedPaintHandler needPaint)
- : this(navigator, redirect, redirect, redirect,
+ : this(navigator, redirect, redirect, redirect,
redirect, redirect, redirect,
redirect, redirect, redirect,
redirect, redirect, redirect,
@@ -64,22 +64,22 @@ public PaletteNavigatorRedirect(KryptonNavigator navigator,
/// inheritance redirection for ribbon general.
/// Delegate for notifying paint requests.
public PaletteNavigatorRedirect(KryptonNavigator? navigator,
- PaletteRedirect? redirectNavigator,
- PaletteRedirect? redirectNavigatorPage,
- PaletteRedirect? redirectNavigatorHeaderGroup,
- PaletteRedirect? redirectNavigatorHeaderPrimary,
- PaletteRedirect? redirectNavigatorHeaderSecondary,
- PaletteRedirect? redirectNavigatorHeaderBar,
- PaletteRedirect? redirectNavigatorHeaderOverflow,
- PaletteRedirect? redirectNavigatorCheckButton,
- PaletteRedirect? redirectNavigatorOverflowButton,
- PaletteRedirect? redirectNavigatorMiniButton,
- PaletteRedirect? redirectNavigatorBar,
- PaletteRedirect? redirectNavigatorBorderEdge,
- PaletteRedirect? redirectNavigatorSeparator,
- PaletteRedirect? redirectNavigatorTab,
- PaletteRedirect? redirectNavigatorRibbonTab,
- PaletteRedirect? redirectNavigatorRibbonGeneral,
+ PaletteRedirect redirectNavigator,
+ PaletteRedirect redirectNavigatorPage,
+ PaletteRedirect redirectNavigatorHeaderGroup,
+ PaletteRedirect redirectNavigatorHeaderPrimary,
+ PaletteRedirect redirectNavigatorHeaderSecondary,
+ PaletteRedirect redirectNavigatorHeaderBar,
+ PaletteRedirect redirectNavigatorHeaderOverflow,
+ PaletteRedirect redirectNavigatorCheckButton,
+ PaletteRedirect redirectNavigatorOverflowButton,
+ PaletteRedirect redirectNavigatorMiniButton,
+ PaletteRedirect redirectNavigatorBar,
+ PaletteRedirect redirectNavigatorBorderEdge,
+ PaletteRedirect redirectNavigatorSeparator,
+ PaletteRedirect redirectNavigatorTab,
+ PaletteRedirect redirectNavigatorRibbonTab,
+ PaletteRedirect redirectNavigatorRibbonGeneral,
NeedPaintHandler needPaint)
: base(redirectNavigator, PaletteBackStyle.PanelClient,
PaletteBorderStyle.ControlClient, needPaint)
@@ -105,7 +105,7 @@ public PaletteNavigatorRedirect(KryptonNavigator? navigator,
///
/// Update the redirector for the border edge.
///
- public PaletteRedirect? RedirectBorderEdge
+ public PaletteRedirect RedirectBorderEdge
{
set => _paletteBorderEdgeInheritRedirect.SetRedirector(value);
}
@@ -115,7 +115,7 @@ public PaletteRedirect? RedirectBorderEdge
///
/// Update the redirector for the ribbon general.
///
- public PaletteRedirect? RedirectRibbonGeneral
+ public PaletteRedirect RedirectRibbonGeneral
{
set => RibbonGeneral.SetRedirector(value);
}
@@ -126,19 +126,20 @@ public PaletteRedirect? RedirectRibbonGeneral
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => (base.IsDefault &&
- PalettePage.IsDefault &&
- HeaderGroup.IsDefault &&
- CheckButton.IsDefault &&
- OverflowButton.IsDefault &&
- MiniButton.IsDefault &&
- Bar.IsDefault &&
- BorderEdge.IsDefault &&
- Separator.IsDefault &&
- Tab.IsDefault &&
- RibbonTab.IsDefault &&
- RibbonGeneral.IsDefault &&
- Metrics.IsDefault);
+ PalettePage.IsDefault &&
+ HeaderGroup.IsDefault &&
+ CheckButton.IsDefault &&
+ OverflowButton.IsDefault &&
+ MiniButton.IsDefault &&
+ Bar.IsDefault &&
+ BorderEdge.IsDefault &&
+ Separator!.IsDefault &&
+ Tab.IsDefault &&
+ RibbonTab.IsDefault &&
+ RibbonGeneral.IsDefault &&
+ Metrics.IsDefault);
#endregion
@@ -253,7 +254,7 @@ public PaletteRedirect? RedirectRibbonGeneral
[Category(@"Visuals")]
[Description(@"Overrides for defining header group appearance entries.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public PaletteNavigatorHeaderGroupRedirect? HeaderGroup { get; }
+ public PaletteNavigatorHeaderGroupRedirect HeaderGroup { get; }
private bool ShouldSerializeHeaderGroup() => !HeaderGroup.IsDefault;
@@ -307,7 +308,7 @@ public PaletteRedirect? RedirectRibbonGeneral
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public PaletteSeparatorPaddingRedirect? Separator { get; }
- private bool ShouldSerializeSeparator() => !Separator.IsDefault;
+ private bool ShouldSerializeSeparator() => !Separator!.IsDefault;
#endregion
@@ -397,7 +398,7 @@ public override Padding GetMetricPadding(PaletteState state, PaletteMetricPaddin
#endregion
#region Internal
- internal PalettePageRedirect? PalettePage { get; }
+ internal PalettePageRedirect PalettePage { get; }
internal PaletteBorderStyle BorderEdgeStyle
{
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/PalettePage.cs b/Source/Krypton Components/Krypton.Navigator/Palette/PalettePage.cs
index 614350b45..92beafa04 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/PalettePage.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/PalettePage.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -23,7 +23,7 @@ public class PalettePage : PaletteDouble
///
/// Source for inheriting values.
/// Delegate for notifying paint requests.
- public PalettePage(IPaletteDouble? inherit,
+ public PalettePage(IPaletteDouble inherit,
NeedPaintHandler needPaint)
: base(inherit, needPaint)
{
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/PalettePageRedirect.cs b/Source/Krypton Components/Krypton.Navigator/Palette/PalettePageRedirect.cs
index b853e0a2e..d6cb58c58 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/PalettePageRedirect.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/PalettePageRedirect.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -23,7 +23,7 @@ public class PalettePageRedirect : PaletteDoubleRedirect
///
/// inheritance redirection instance.
/// Delegate for notifying paint requests.
- public PalettePageRedirect(PaletteRedirect? redirect,
+ public PalettePageRedirect(PaletteRedirect redirect,
NeedPaintHandler needPaint)
: base(redirect, PaletteBackStyle.ControlClient,
PaletteBorderStyle.ControlClient, needPaint)
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteRedirectRibbonTabContent.cs b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteRedirectRibbonTabContent.cs
index 80bf312fb..f170c0538 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteRedirectRibbonTabContent.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteRedirectRibbonTabContent.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -18,24 +18,24 @@ namespace Krypton.Navigator
public class PaletteRedirectRibbonTabContent : PaletteRedirect
{
#region Instance Fields
- private IPaletteRibbonBack _disabledBack;
- private IPaletteRibbonBack _normalBack;
- private IPaletteRibbonBack _pressedBack;
- private IPaletteRibbonBack _trackingBack;
- private IPaletteRibbonBack _selectedBack;
- private IPaletteRibbonBack _focusOverrideBack;
- private IPaletteRibbonText _disabledText;
- private IPaletteRibbonText _normalText;
- private IPaletteRibbonText _pressedText;
- private IPaletteRibbonText _trackingText;
- private IPaletteRibbonText _selectedText;
- private IPaletteRibbonText _focusOverrideText;
- private IPaletteContent _disabledContent;
- private IPaletteContent _normalContent;
- private IPaletteContent _pressedContent;
- private IPaletteContent _trackingContent;
- private IPaletteContent _selectedContent;
- private IPaletteContent _focusOverrideContent;
+ private IPaletteRibbonBack? _disabledBack;
+ private IPaletteRibbonBack? _normalBack;
+ private IPaletteRibbonBack? _pressedBack;
+ private IPaletteRibbonBack? _trackingBack;
+ private IPaletteRibbonBack? _selectedBack;
+ private IPaletteRibbonBack? _focusOverrideBack;
+ private IPaletteRibbonText? _disabledText;
+ private IPaletteRibbonText? _normalText;
+ private IPaletteRibbonText? _pressedText;
+ private IPaletteRibbonText? _trackingText;
+ private IPaletteRibbonText? _selectedText;
+ private IPaletteRibbonText? _focusOverrideText;
+ private IPaletteContent? _disabledContent;
+ private IPaletteContent? _normalContent;
+ private IPaletteContent? _pressedContent;
+ private IPaletteContent? _trackingContent;
+ private IPaletteContent? _selectedContent;
+ private IPaletteContent? _focusOverrideContent;
#endregion
#region Identity
@@ -43,7 +43,7 @@ public class PaletteRedirectRibbonTabContent : PaletteRedirect
/// Initialize a new instance of the PaletteRedirectRibbonDouble class.
///
/// Initial palette target for redirection.
- public PaletteRedirectRibbonTabContent(PaletteBase? target)
+ public PaletteRedirectRibbonTabContent(PaletteBase target)
: this(target,
null, null, null, null, null, null,
null, null, null, null, null, null,
@@ -73,25 +73,25 @@ public PaletteRedirectRibbonTabContent(PaletteBase? target)
/// Redirection for content tracking state requests.
/// Redirection for content selected states requests.
/// Redirection for content focus override state requests.
- public PaletteRedirectRibbonTabContent(PaletteBase? target,
- IPaletteRibbonBack disabledBack,
- IPaletteRibbonBack normalBack,
- IPaletteRibbonBack pressedBack,
- IPaletteRibbonBack trackingBack,
- IPaletteRibbonBack selectedBack,
- IPaletteRibbonBack focusOverrideBack,
- IPaletteRibbonText disabledText,
- IPaletteRibbonText normalText,
- IPaletteRibbonText pressedText,
- IPaletteRibbonText trackingText,
- IPaletteRibbonText selectedText,
- IPaletteRibbonText focusOverrideText,
- IPaletteContent disabledContent,
- IPaletteContent normalContent,
- IPaletteContent pressedContent,
- IPaletteContent trackingContent,
- IPaletteContent selectedContent,
- IPaletteContent focusOverrideContent)
+ public PaletteRedirectRibbonTabContent(PaletteBase target,
+ IPaletteRibbonBack? disabledBack,
+ IPaletteRibbonBack? normalBack,
+ IPaletteRibbonBack? pressedBack,
+ IPaletteRibbonBack? trackingBack,
+ IPaletteRibbonBack? selectedBack,
+ IPaletteRibbonBack? focusOverrideBack,
+ IPaletteRibbonText? disabledText,
+ IPaletteRibbonText? normalText,
+ IPaletteRibbonText? pressedText,
+ IPaletteRibbonText? trackingText,
+ IPaletteRibbonText? selectedText,
+ IPaletteRibbonText? focusOverrideText,
+ IPaletteContent? disabledContent,
+ IPaletteContent? normalContent,
+ IPaletteContent? pressedContent,
+ IPaletteContent? trackingContent,
+ IPaletteContent? selectedContent,
+ IPaletteContent? focusOverrideContent)
: base(target)
{
// Remember state specific inheritance
@@ -190,9 +190,9 @@ public virtual void ResetRedirectStates()
/// Color value.
public override PaletteRibbonColorStyle GetRibbonBackColorStyle(PaletteRibbonBackStyle style, PaletteState state)
{
- IPaletteRibbonBack inherit = GetBackInherit(state);
+ IPaletteRibbonBack? inherit = GetBackInherit(state);
- return inherit?.GetRibbonBackColorStyle(state) ?? Target.GetRibbonBackColorStyle(style, state);
+ return inherit?.GetRibbonBackColorStyle(state) ?? Target!.GetRibbonBackColorStyle(style, state);
}
///
@@ -203,9 +203,9 @@ public override PaletteRibbonColorStyle GetRibbonBackColorStyle(PaletteRibbonBac
/// Color value.
public override Color GetRibbonBackColor1(PaletteRibbonBackStyle style, PaletteState state)
{
- IPaletteRibbonBack inherit = GetBackInherit(state);
+ IPaletteRibbonBack? inherit = GetBackInherit(state);
- return inherit?.GetRibbonBackColor1(state) ?? Target.GetRibbonBackColor1(style, state);
+ return inherit?.GetRibbonBackColor1(state) ?? Target!.GetRibbonBackColor1(style, state);
}
///
@@ -216,9 +216,9 @@ public override Color GetRibbonBackColor1(PaletteRibbonBackStyle style, PaletteS
/// Color value.
public override Color GetRibbonBackColor2(PaletteRibbonBackStyle style, PaletteState state)
{
- IPaletteRibbonBack inherit = GetBackInherit(state);
+ IPaletteRibbonBack? inherit = GetBackInherit(state);
- return inherit?.GetRibbonBackColor2(state) ?? Target.GetRibbonBackColor2(style, state);
+ return inherit?.GetRibbonBackColor2(state) ?? Target!.GetRibbonBackColor2(style, state);
}
///
@@ -229,9 +229,9 @@ public override Color GetRibbonBackColor2(PaletteRibbonBackStyle style, PaletteS
/// Color value.
public override Color GetRibbonBackColor3(PaletteRibbonBackStyle style, PaletteState state)
{
- IPaletteRibbonBack inherit = GetBackInherit(state);
+ IPaletteRibbonBack? inherit = GetBackInherit(state);
- return inherit?.GetRibbonBackColor3(state) ?? Target.GetRibbonBackColor3(style, state);
+ return inherit?.GetRibbonBackColor3(state) ?? Target!.GetRibbonBackColor3(style, state);
}
///
@@ -242,9 +242,9 @@ public override Color GetRibbonBackColor3(PaletteRibbonBackStyle style, PaletteS
/// Color value.
public override Color GetRibbonBackColor4(PaletteRibbonBackStyle style, PaletteState state)
{
- IPaletteRibbonBack inherit = GetBackInherit(state);
+ IPaletteRibbonBack? inherit = GetBackInherit(state);
- return inherit?.GetRibbonBackColor4(state) ?? Target.GetRibbonBackColor4(style, state);
+ return inherit?.GetRibbonBackColor4(state) ?? Target!.GetRibbonBackColor4(style, state);
}
///
@@ -255,9 +255,9 @@ public override Color GetRibbonBackColor4(PaletteRibbonBackStyle style, PaletteS
/// Color value.
public override Color GetRibbonBackColor5(PaletteRibbonBackStyle style, PaletteState state)
{
- IPaletteRibbonBack inherit = GetBackInherit(state);
+ IPaletteRibbonBack? inherit = GetBackInherit(state);
- return inherit?.GetRibbonBackColor5(state) ?? Target.GetRibbonBackColor5(style, state);
+ return inherit?.GetRibbonBackColor5(state) ?? Target!.GetRibbonBackColor5(style, state);
}
#endregion
@@ -270,9 +270,9 @@ public override Color GetRibbonBackColor5(PaletteRibbonBackStyle style, PaletteS
/// Color value.
public override Color GetRibbonTextColor(PaletteRibbonTextStyle style, PaletteState state)
{
- IPaletteRibbonText inherit = GetTextInherit(state);
+ IPaletteRibbonText? inherit = GetTextInherit(state);
- return inherit?.GetRibbonTextColor(state) ?? Target.GetRibbonTextColor(style, state);
+ return inherit?.GetRibbonTextColor(state) ?? Target!.GetRibbonTextColor(style, state);
}
#endregion
@@ -285,9 +285,9 @@ public override Color GetRibbonTextColor(PaletteRibbonTextStyle style, PaletteSt
/// InheritBool value.
public override InheritBool GetContentDraw(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentDraw(state) ?? Target.GetContentDraw(style, state);
+ return inherit?.GetContentDraw(state) ?? Target!.GetContentDraw(style, state);
}
///
@@ -298,9 +298,9 @@ public override InheritBool GetContentDraw(PaletteContentStyle style, PaletteSta
/// InheritBool value.
public override InheritBool GetContentDrawFocus(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentDrawFocus(state) ?? Target.GetContentDrawFocus(style, state);
+ return inherit?.GetContentDrawFocus(state) ?? Target!.GetContentDrawFocus(style, state);
}
///
@@ -311,9 +311,9 @@ public override InheritBool GetContentDrawFocus(PaletteContentStyle style, Palet
/// RelativeAlignment value.
public override PaletteRelativeAlign GetContentImageH(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentImageH(state) ?? Target.GetContentImageH(style, state);
+ return inherit?.GetContentImageH(state) ?? Target!.GetContentImageH(style, state);
}
///
@@ -324,9 +324,9 @@ public override PaletteRelativeAlign GetContentImageH(PaletteContentStyle style,
/// RelativeAlignment value.
public override PaletteRelativeAlign GetContentImageV(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentImageV(state) ?? Target.GetContentImageV(style, state);
+ return inherit?.GetContentImageV(state) ?? Target!.GetContentImageV(style, state);
}
///
@@ -337,9 +337,9 @@ public override PaletteRelativeAlign GetContentImageV(PaletteContentStyle style,
/// PaletteImageEffect value.
public override PaletteImageEffect GetContentImageEffect(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentImageEffect(state) ?? Target.GetContentImageEffect(style, state);
+ return inherit?.GetContentImageEffect(state) ?? Target!.GetContentImageEffect(style, state);
}
///
@@ -350,9 +350,9 @@ public override PaletteImageEffect GetContentImageEffect(PaletteContentStyle sty
/// Font value.
public override Font GetContentShortTextFont(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentShortTextFont(state) ?? Target.GetContentShortTextFont(style, state);
+ return inherit?.GetContentShortTextFont(state) ?? Target!.GetContentShortTextFont(style, state) ?? throw new NullReferenceException("The result of GetContentShortTextFont() cannot be null.");
}
///
@@ -363,9 +363,9 @@ public override Font GetContentShortTextFont(PaletteContentStyle style, PaletteS
/// PaletteTextHint value.
public override PaletteTextHint GetContentShortTextHint(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentShortTextHint(state) ?? Target.GetContentShortTextHint(style, state);
+ return inherit?.GetContentShortTextHint(state) ?? Target!.GetContentShortTextHint(style, state);
}
///
@@ -376,9 +376,9 @@ public override PaletteTextHint GetContentShortTextHint(PaletteContentStyle styl
/// PaletteTextPrefix value.
public override PaletteTextHotkeyPrefix GetContentShortTextPrefix(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentShortTextPrefix(state) ?? Target.GetContentShortTextPrefix(style, state);
+ return inherit?.GetContentShortTextPrefix(state) ?? Target!.GetContentShortTextPrefix(style, state);
}
///
@@ -389,9 +389,9 @@ public override PaletteTextHotkeyPrefix GetContentShortTextPrefix(PaletteContent
/// InheritBool value.
public override InheritBool GetContentShortTextMultiLine(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentShortTextMultiLine(state) ?? Target.GetContentShortTextMultiLine(style, state);
+ return inherit?.GetContentShortTextMultiLine(state) ?? Target!.GetContentShortTextMultiLine(style, state);
}
///
@@ -402,9 +402,9 @@ public override InheritBool GetContentShortTextMultiLine(PaletteContentStyle sty
/// PaletteTextTrim value.
public override PaletteTextTrim GetContentShortTextTrim(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentShortTextTrim(state) ?? Target.GetContentShortTextTrim(style, state);
+ return inherit?.GetContentShortTextTrim(state) ?? Target!.GetContentShortTextTrim(style, state);
}
///
@@ -415,9 +415,9 @@ public override PaletteTextTrim GetContentShortTextTrim(PaletteContentStyle styl
/// RelativeAlignment value.
public override PaletteRelativeAlign GetContentShortTextH(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentShortTextH(state) ?? Target.GetContentShortTextH(style, state);
+ return inherit?.GetContentShortTextH(state) ?? Target!.GetContentShortTextH(style, state);
}
///
@@ -428,9 +428,9 @@ public override PaletteRelativeAlign GetContentShortTextH(PaletteContentStyle st
/// RelativeAlignment value.
public override PaletteRelativeAlign GetContentShortTextV(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentShortTextV(state) ?? Target.GetContentShortTextV(style, state);
+ return inherit?.GetContentShortTextV(state) ?? Target!.GetContentShortTextV(style, state);
}
///
@@ -441,9 +441,9 @@ public override PaletteRelativeAlign GetContentShortTextV(PaletteContentStyle st
/// RelativeAlignment value.
public override PaletteRelativeAlign GetContentShortTextMultiLineH(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentShortTextMultiLineH(state) ?? Target.GetContentShortTextMultiLineH(style, state);
+ return inherit?.GetContentShortTextMultiLineH(state) ?? Target!.GetContentShortTextMultiLineH(style, state);
}
///
@@ -454,9 +454,9 @@ public override PaletteRelativeAlign GetContentShortTextMultiLineH(PaletteConten
/// Color value.
public override Color GetContentShortTextColor1(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentShortTextColor1(state) ?? Target.GetContentShortTextColor1(style, state);
+ return inherit?.GetContentShortTextColor1(state) ?? Target!.GetContentShortTextColor1(style, state);
}
///
@@ -467,9 +467,9 @@ public override Color GetContentShortTextColor1(PaletteContentStyle style, Palet
/// Color value.
public override Color GetContentShortTextColor2(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentShortTextColor2(state) ?? Target.GetContentShortTextColor2(style, state);
+ return inherit?.GetContentShortTextColor2(state) ?? Target!.GetContentShortTextColor2(style, state);
}
///
@@ -480,9 +480,9 @@ public override Color GetContentShortTextColor2(PaletteContentStyle style, Palet
/// Color drawing style.
public override PaletteColorStyle GetContentShortTextColorStyle(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentShortTextColorStyle(state) ?? Target.GetContentShortTextColorStyle(style, state);
+ return inherit?.GetContentShortTextColorStyle(state) ?? Target!.GetContentShortTextColorStyle(style, state);
}
///
@@ -493,9 +493,9 @@ public override PaletteColorStyle GetContentShortTextColorStyle(PaletteContentSt
/// Color alignment style.
public override PaletteRectangleAlign GetContentShortTextColorAlign(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentShortTextColorAlign(state) ?? Target.GetContentShortTextColorAlign(style, state);
+ return inherit?.GetContentShortTextColorAlign(state) ?? Target!.GetContentShortTextColorAlign(style, state);
}
///
@@ -506,9 +506,9 @@ public override PaletteRectangleAlign GetContentShortTextColorAlign(PaletteConte
/// Angle used for color drawing.
public override float GetContentShortTextColorAngle(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentShortTextColorAngle(state) ?? Target.GetContentShortTextColorAngle(style, state);
+ return inherit?.GetContentShortTextColorAngle(state) ?? Target!.GetContentShortTextColorAngle(style, state);
}
///
@@ -519,9 +519,9 @@ public override float GetContentShortTextColorAngle(PaletteContentStyle style, P
/// Image instance.
public override Image? GetContentShortTextImage(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentShortTextImage(state) ?? Target.GetContentShortTextImage(style, state);
+ return inherit?.GetContentShortTextImage(state) ?? Target!.GetContentShortTextImage(style, state);
}
///
@@ -532,9 +532,9 @@ public override float GetContentShortTextColorAngle(PaletteContentStyle style, P
/// Image style value.
public override PaletteImageStyle GetContentShortTextImageStyle(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentShortTextImageStyle(state) ?? Target.GetContentShortTextImageStyle(style, state);
+ return inherit?.GetContentShortTextImageStyle(state) ?? Target!.GetContentShortTextImageStyle(style, state);
}
///
@@ -545,9 +545,9 @@ public override PaletteImageStyle GetContentShortTextImageStyle(PaletteContentSt
/// Image alignment style.
public override PaletteRectangleAlign GetContentShortTextImageAlign(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentShortTextImageAlign(state) ?? Target.GetContentShortTextImageAlign(style, state);
+ return inherit?.GetContentShortTextImageAlign(state) ?? Target!.GetContentShortTextImageAlign(style, state);
}
///
@@ -558,9 +558,9 @@ public override PaletteRectangleAlign GetContentShortTextImageAlign(PaletteConte
/// Font value.
public override Font GetContentLongTextFont(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentLongTextFont(state) ?? Target.GetContentLongTextFont(style, state);
+ return inherit?.GetContentLongTextFont(state) ?? Target!.GetContentLongTextFont(style, state) ?? throw new NullReferenceException("The result of GetContentLongTextFont() cannot be null.");
}
///
@@ -571,9 +571,9 @@ public override Font GetContentLongTextFont(PaletteContentStyle style, PaletteSt
/// PaletteTextHint value.
public override PaletteTextHint GetContentLongTextHint(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentLongTextHint(state) ?? Target.GetContentLongTextHint(style, state);
+ return inherit?.GetContentLongTextHint(state) ?? Target!.GetContentLongTextHint(style, state);
}
///
@@ -584,9 +584,9 @@ public override PaletteTextHint GetContentLongTextHint(PaletteContentStyle style
/// InheritBool value.
public override InheritBool GetContentLongTextMultiLine(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentLongTextMultiLine(state) ?? Target.GetContentLongTextMultiLine(style, state);
+ return inherit?.GetContentLongTextMultiLine(state) ?? Target!.GetContentLongTextMultiLine(style, state);
}
///
@@ -597,9 +597,9 @@ public override InheritBool GetContentLongTextMultiLine(PaletteContentStyle styl
/// PaletteTextTrim value.
public override PaletteTextTrim GetContentLongTextTrim(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentLongTextTrim(state) ?? Target.GetContentLongTextTrim(style, state);
+ return inherit?.GetContentLongTextTrim(state) ?? Target!.GetContentLongTextTrim(style, state);
}
///
@@ -610,9 +610,9 @@ public override PaletteTextTrim GetContentLongTextTrim(PaletteContentStyle style
/// PaletteTextPrefix value.
public override PaletteTextHotkeyPrefix GetContentLongTextPrefix(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentLongTextPrefix(state) ?? Target.GetContentLongTextPrefix(style, state);
+ return inherit?.GetContentLongTextPrefix(state) ?? Target!.GetContentLongTextPrefix(style, state);
}
///
@@ -623,9 +623,9 @@ public override PaletteTextHotkeyPrefix GetContentLongTextPrefix(PaletteContentS
/// RelativeAlignment value.
public override PaletteRelativeAlign GetContentLongTextH(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentLongTextH(state) ?? Target.GetContentLongTextH(style, state);
+ return inherit?.GetContentLongTextH(state) ?? Target!.GetContentLongTextH(style, state);
}
///
@@ -636,9 +636,9 @@ public override PaletteRelativeAlign GetContentLongTextH(PaletteContentStyle sty
/// RelativeAlignment value.
public override PaletteRelativeAlign GetContentLongTextV(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentLongTextV(state) ?? Target.GetContentLongTextV(style, state);
+ return inherit?.GetContentLongTextV(state) ?? Target!.GetContentLongTextV(style, state);
}
///
@@ -649,9 +649,9 @@ public override PaletteRelativeAlign GetContentLongTextV(PaletteContentStyle sty
/// RelativeAlignment value.
public override PaletteRelativeAlign GetContentLongTextMultiLineH(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentLongTextMultiLineH(state) ?? Target.GetContentLongTextMultiLineH(style, state);
+ return inherit?.GetContentLongTextMultiLineH(state) ?? Target!.GetContentLongTextMultiLineH(style, state);
}
///
@@ -662,9 +662,9 @@ public override PaletteRelativeAlign GetContentLongTextMultiLineH(PaletteContent
/// Color value.
public override Color GetContentLongTextColor1(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentLongTextColor1(state) ?? Target.GetContentLongTextColor1(style, state);
+ return inherit?.GetContentLongTextColor1(state) ?? Target!.GetContentLongTextColor1(style, state);
}
///
@@ -675,9 +675,9 @@ public override Color GetContentLongTextColor1(PaletteContentStyle style, Palett
/// Color value.
public override Color GetContentLongTextColor2(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentLongTextColor2(state) ?? Target.GetContentLongTextColor2(style, state);
+ return inherit?.GetContentLongTextColor2(state) ?? Target!.GetContentLongTextColor2(style, state);
}
///
@@ -688,9 +688,9 @@ public override Color GetContentLongTextColor2(PaletteContentStyle style, Palett
/// Color drawing style.
public override PaletteColorStyle GetContentLongTextColorStyle(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentLongTextColorStyle(state) ?? Target.GetContentLongTextColorStyle(style, state);
+ return inherit?.GetContentLongTextColorStyle(state) ?? Target!.GetContentLongTextColorStyle(style, state);
}
///
@@ -701,9 +701,9 @@ public override PaletteColorStyle GetContentLongTextColorStyle(PaletteContentSty
/// Color alignment style.
public override PaletteRectangleAlign GetContentLongTextColorAlign(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentLongTextColorAlign(state) ?? Target.GetContentLongTextColorAlign(style, state);
+ return inherit?.GetContentLongTextColorAlign(state) ?? Target!.GetContentLongTextColorAlign(style, state);
}
///
@@ -714,9 +714,9 @@ public override PaletteRectangleAlign GetContentLongTextColorAlign(PaletteConten
/// Image instance.
public override Image? GetContentLongTextImage(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentLongTextImage(state) ?? Target.GetContentLongTextImage(style, state);
+ return inherit?.GetContentLongTextImage(state) ?? Target!.GetContentLongTextImage(style, state);
}
///
@@ -727,9 +727,9 @@ public override PaletteRectangleAlign GetContentLongTextColorAlign(PaletteConten
/// Image style value.
public override PaletteImageStyle GetContentLongTextImageStyle(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentLongTextImageStyle(state) ?? Target.GetContentLongTextImageStyle(style, state);
+ return inherit?.GetContentLongTextImageStyle(state) ?? Target!.GetContentLongTextImageStyle(style, state);
}
///
@@ -740,9 +740,9 @@ public override PaletteImageStyle GetContentLongTextImageStyle(PaletteContentSty
/// Image alignment style.
public override PaletteRectangleAlign GetContentLongTextImageAlign(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentLongTextImageAlign(state) ?? Target.GetContentLongTextImageAlign(style, state);
+ return inherit?.GetContentLongTextImageAlign(state) ?? Target!.GetContentLongTextImageAlign(style, state);
}
///
@@ -753,9 +753,9 @@ public override PaletteRectangleAlign GetContentLongTextImageAlign(PaletteConten
/// Padding value.
public override Padding GetContentPadding(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentPadding(state) ?? Target.GetContentPadding(style, state);
+ return inherit?.GetContentPadding(state) ?? Target!.GetContentPadding(style, state);
}
///
@@ -766,9 +766,9 @@ public override Padding GetContentPadding(PaletteContentStyle style, PaletteStat
/// Integer value.
public override int GetContentAdjacentGap(PaletteContentStyle style, PaletteState state)
{
- IPaletteContent inherit = GetContentInherit(state);
+ IPaletteContent? inherit = GetContentInherit(state);
- return inherit?.GetContentAdjacentGap(state) ?? Target.GetContentAdjacentGap(style, state);
+ return inherit?.GetContentAdjacentGap(state) ?? Target!.GetContentAdjacentGap(style, state);
}
#endregion
@@ -794,7 +794,7 @@ public override int GetContentAdjacentGap(PaletteContentStyle style, PaletteStat
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
@@ -819,7 +819,7 @@ public override int GetContentAdjacentGap(PaletteContentStyle style, PaletteStat
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
@@ -844,7 +844,7 @@ public override int GetContentAdjacentGap(PaletteContentStyle style, PaletteStat
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteRibbonGeneralRedirect.cs b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteRibbonGeneralRedirect.cs
index 37ea20e86..901a8e137 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteRibbonGeneralRedirect.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteRibbonGeneralRedirect.cs
@@ -1,12 +1,10 @@
#region BSD License
/*
- *
* Original BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE)
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
- *
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*/
#endregion
@@ -39,7 +37,7 @@ public PaletteRibbonGeneralNavRedirect([DisallowNull] PaletteRedirect redirect,
NeedPaint = needPaint;
// Store the inherit instances
- _inherit = new PaletteRibbonGeneralInheritRedirect(redirect);
+ _inherit = new PaletteRibbonGeneralInheritRedirect(redirect!);
// Set default values
_textFont = null;
@@ -52,7 +50,7 @@ public PaletteRibbonGeneralNavRedirect([DisallowNull] PaletteRedirect redirect,
/// Update the redirector with new reference.
///
/// Target redirector.
- public void SetRedirector(PaletteRedirect? redirect) => _inherit.SetRedirector(redirect);
+ public void SetRedirector(PaletteRedirect redirect) => _inherit.SetRedirector(redirect);
#endregion
#region IsDefault
@@ -60,6 +58,7 @@ public PaletteRibbonGeneralNavRedirect([DisallowNull] PaletteRedirect redirect,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => (TextFont == null) && (TextHint == PaletteTextHint.Inherit);
#endregion
@@ -194,6 +193,45 @@ public PaletteRibbonGeneralNavRedirect([DisallowNull] PaletteRedirect redirect,
#endregion
+ #region RibbonTabRowBackgroundGradientRaftingDark
+
+ ///
+ public Color GetRibbonTabRowBackgroundGradientRaftingDark(PaletteState state) =>
+ _inherit.GetRibbonTabRowBackgroundGradientRaftingDark(state);
+
+ #endregion
+
+ #region RibbonTabRowBackgroundGradientRaftingLight
+
+ ///
+ public Color GetRibbonTabRowBackgroundGradientRaftingLight(PaletteState state) =>
+ _inherit.GetRibbonTabRowBackgroundGradientRaftingLight(state);
+
+ #endregion
+
+ #region RibbonTabRowBackgroundSolidColor
+
+ ///
+ public Color GetRibbonTabRowBackgroundSolidColor(PaletteState state) =>
+ _inherit.GetRibbonTabRowBackgroundSolidColor(state);
+
+ #endregion
+
+ #region RibbonTabRowGradientRaftingAngle
+
+ ///
+ public float GetRibbonTabRowGradientRaftingAngle(PaletteState state) =>
+ _inherit.GetRibbonTabRowGradientRaftingAngle(state);
+
+ #endregion
+
+ #region RibbonTabRowGradientColor1
+
+ ///
+ public Color GetRibbonTabRowGradientColor1(PaletteState state) => _inherit.GetRibbonTabRowGradientColor1(state);
+
+ #endregion
+
#region GetRibbonShape
///
/// Gets the ribbon shape.
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteRibbonTabContent.cs b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteRibbonTabContent.cs
index 44c1fd3c2..e37d41e84 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteRibbonTabContent.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteRibbonTabContent.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -31,13 +31,28 @@ public class PaletteRibbonTabContent : Storage
/// Source for inheriting palette content.
/// Delegate for notifying paint requests.
public PaletteRibbonTabContent([DisallowNull] IPaletteRibbonBack paletteBack,
- [DisallowNull] IPaletteRibbonText paletteText,
+ [DisallowNull] IPaletteRibbonText paletteText,
[DisallowNull] IPaletteContent paletteContent,
NeedPaintHandler needPaint)
{
- Debug.Assert(paletteBack != null);
- Debug.Assert(paletteText != null);
- Debug.Assert(paletteContent != null);
+ Debug.Assert(paletteBack is not null);
+ Debug.Assert(paletteText is not null);
+ Debug.Assert(paletteContent is not null);
+
+ if (paletteBack is null)
+ {
+ throw new ArgumentNullException(nameof(paletteBack));
+ }
+
+ if (paletteText is null)
+ {
+ throw new ArgumentNullException(nameof(paletteText));
+ }
+
+ if (paletteContent is null)
+ {
+ throw new ArgumentNullException(nameof(paletteContent));
+ }
// Store the provided paint notification delegate
NeedPaint = needPaint;
@@ -53,6 +68,7 @@ public PaletteRibbonTabContent([DisallowNull] IPaletteRibbonBack paletteBack,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => (TabDraw.IsDefault && Content.IsDefault);
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteRibbonTabContentInheritOverride.cs b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteRibbonTabContentInheritOverride.cs
index 7c8ea47ca..4f870d4d2 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteRibbonTabContentInheritOverride.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteRibbonTabContentInheritOverride.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -55,12 +55,12 @@ public PaletteRibbonTabContentInheritOverride([DisallowNull] IPaletteRibbonBack
Debug.Assert(backupContent != null);
// Remember values
- _primaryBack = primaryBack;
- _primaryText = primaryText;
- _primaryContent = primaryContent;
- _backupBack = backupBack;
- _backupText = backupText;
- _backupContent = backupContent;
+ _primaryBack = primaryBack ?? throw new ArgumentNullException(nameof(primaryBack));
+ _primaryText = primaryText ?? throw new ArgumentNullException(nameof(primaryText));
+ _primaryContent = primaryContent ?? throw new ArgumentNullException(nameof(primaryContent));
+ _backupBack = backupBack ?? throw new ArgumentNullException(nameof(backupBack));
+ _backupText = backupText ?? throw new ArgumentNullException(nameof(backupText));
+ _backupContent = backupContent ?? throw new ArgumentNullException(nameof(backupContent));
// Default state
Apply = false;
@@ -443,13 +443,14 @@ public virtual Font GetContentShortTextFont(PaletteState state)
{
if (Apply)
{
- Font ret = _primaryContent.GetContentShortTextFont(Override ? OverrideState : state) ?? _backupContent.GetContentShortTextFont(state);
+ Font ret = _primaryContent.GetContentShortTextFont(Override ? OverrideState : state) ?? _backupContent.GetContentShortTextFont(state)
+ ?? throw new NullReferenceException("The result of GetContentShortTextFont() cannot be null.");
return ret;
}
else
{
- return _backupContent.GetContentShortTextFont(state);
+ return _backupContent.GetContentShortTextFont(state) ?? throw new NullReferenceException("The result of GetContentShortTextFont() cannot be null.");
}
}
@@ -462,14 +463,14 @@ public virtual Font GetContentShortTextNewFont(PaletteState state)
{
if (Apply)
{
- Font ret = _primaryContent.GetContentShortTextNewFont(Override ? OverrideState : state) ??
- _backupContent.GetContentShortTextNewFont(state);
+ Font ret = _primaryContent.GetContentShortTextNewFont(Override ? OverrideState : state) ?? _backupContent.GetContentShortTextNewFont(state)
+ ?? throw new NullReferenceException("The result of GetContentShortTextNewFont() cannot be null.");
return ret;
}
else
{
- return _backupContent.GetContentShortTextNewFont(state);
+ return _backupContent.GetContentShortTextNewFont(state) ?? throw new NullReferenceException("The result of GetContentShortTextNewFont() cannot be null.");
}
}
@@ -770,7 +771,7 @@ public virtual float GetContentShortTextColorAngle(PaletteState state)
{
if (Apply)
{
- Image ret = _primaryContent.GetContentShortTextImage(Override ? OverrideState : state) ?? _backupContent.GetContentShortTextImage(state);
+ Image? ret = _primaryContent.GetContentShortTextImage(Override ? OverrideState : state) ?? _backupContent.GetContentShortTextImage(state);
return ret;
}
@@ -837,13 +838,15 @@ public virtual Font GetContentLongTextFont(PaletteState state)
{
if (Apply)
{
- Font ret = _primaryContent.GetContentLongTextFont(Override ? OverrideState : state) ?? _backupContent.GetContentLongTextFont(state);
+ Font ret = _primaryContent.GetContentLongTextFont(Override ? OverrideState : state) ?? _backupContent.GetContentLongTextFont(state)
+ ?? throw new NullReferenceException("The result of GetContentLongTextFont() cannot be null.");
return ret;
}
else
{
- return _backupContent.GetContentLongTextFont(state);
+ return _backupContent.GetContentLongTextFont(state)
+ ?? throw new NullReferenceException("The result of GetContentLongTextFont() cannot be null.");
}
}
@@ -856,13 +859,15 @@ public virtual Font GetContentLongTextNewFont(PaletteState state)
{
if (Apply)
{
- Font ret = _primaryContent.GetContentLongTextNewFont(Override ? OverrideState : state) ?? _backupContent.GetContentLongTextNewFont(state);
+ Font ret = _primaryContent.GetContentLongTextNewFont(Override ? OverrideState : state) ?? _backupContent.GetContentLongTextNewFont(state)
+ ?? throw new NullReferenceException("The result of GetContentLongTextNewFont() cannot be null.");
return ret;
}
else
{
- return _backupContent.GetContentLongTextNewFont(state);
+ return _backupContent.GetContentLongTextNewFont(state) ?? throw new NullReferenceException("The result of GetContentLongTextNewFont() cannot be null.");
+
}
}
@@ -1163,7 +1168,7 @@ public virtual float GetContentLongTextColorAngle(PaletteState state)
{
if (Apply)
{
- Image ret = _primaryContent.GetContentLongTextImage(Override ? OverrideState : state) ?? _backupContent.GetContentLongTextImage(state);
+ Image? ret = _primaryContent.GetContentLongTextImage(Override ? OverrideState : state) ?? _backupContent.GetContentLongTextImage(state);
return ret;
}
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteRibbonTabContentRedirect.cs b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteRibbonTabContentRedirect.cs
index 6cc0cb1a7..c9db2e269 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/PaletteRibbonTabContentRedirect.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/PaletteRibbonTabContentRedirect.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -32,8 +32,12 @@ public class PaletteRibbonTabContentRedirect : Storage
public PaletteRibbonTabContentRedirect([DisallowNull] PaletteRedirect redirect,
NeedPaintHandler needPaint)
{
- Debug.Assert(redirect != null);
+ Debug.Assert(redirect is not null);
+ if (redirect is null)
+ {
+ throw new ArgumentNullException(nameof(redirect));
+ }
// Store the provided paint notification delegate
NeedPaint = needPaint;
@@ -52,7 +56,7 @@ public PaletteRibbonTabContentRedirect([DisallowNull] PaletteRedirect redirect,
/// Update the redirector with new reference.
///
/// Target redirector.
- public void SetRedirector(PaletteRedirect? redirect)
+ public void SetRedirector(PaletteRedirect redirect)
{
_drawRedirect.SetRedirector(redirect);
_contentInherit.SetRedirector(redirect);
@@ -64,6 +68,7 @@ public void SetRedirector(PaletteRedirect? redirect)
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => (TabDraw.IsDefault && Content.IsDefault);
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/Palette/RibbonTabToContent.cs b/Source/Krypton Components/Krypton.Navigator/Palette/RibbonTabToContent.cs
index ce80d5901..7b6199fd8 100644
--- a/Source/Krypton Components/Krypton.Navigator/Palette/RibbonTabToContent.cs
+++ b/Source/Krypton Components/Krypton.Navigator/Palette/RibbonTabToContent.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -34,9 +34,9 @@ public RibbonTabToContent([DisallowNull] IPaletteRibbonGeneral ribbonGeneral,
Debug.Assert(ribbonTabText != null);
Debug.Assert(content != null);
- _ribbonGeneral = ribbonGeneral;
- PaletteRibbonText = ribbonTabText;
- PaletteContent = content;
+ _ribbonGeneral = ribbonGeneral ?? throw new ArgumentNullException(nameof(ribbonGeneral));
+ PaletteRibbonText = ribbonTabText ?? throw new ArgumentNullException(nameof(ribbonTabText));
+ PaletteContent = content ?? throw new ArgumentNullException(nameof(content));
}
#endregion
@@ -62,49 +62,49 @@ public RibbonTabToContent([DisallowNull] IPaletteRibbonGeneral ribbonGeneral,
///
/// Palette value should be applicable to this state.
/// InheritBool value.
- public InheritBool GetContentDraw(PaletteState state) => PaletteContent.GetContentDraw(state);
+ public InheritBool GetContentDraw(PaletteState state) => PaletteContent!.GetContentDraw(state);
///
/// Gets a value indicating if content should be drawn with focus indication.
///
/// Palette value should be applicable to this state.
/// InheritBool value.
- public InheritBool GetContentDrawFocus(PaletteState state) => PaletteContent.GetContentDrawFocus(state);
+ public InheritBool GetContentDrawFocus(PaletteState state) => PaletteContent!.GetContentDrawFocus(state);
///
/// Gets the horizontal relative alignment of the image.
///
/// Palette value should be applicable to this state.
/// RelativeAlignment value.
- public PaletteRelativeAlign GetContentImageH(PaletteState state) => PaletteContent.GetContentImageH(state);
+ public PaletteRelativeAlign GetContentImageH(PaletteState state) => PaletteContent!.GetContentImageH(state);
///
/// Gets the vertical relative alignment of the image.
///
/// Palette value should be applicable to this state.
/// RelativeAlignment value.
- public PaletteRelativeAlign GetContentImageV(PaletteState state) => PaletteContent.GetContentImageV(state);
+ public PaletteRelativeAlign GetContentImageV(PaletteState state) => PaletteContent!.GetContentImageV(state);
///
/// Gets the effect applied to drawing of the image.
///
/// Palette value should be applicable to this state.
/// PaletteImageEffect value.
- public PaletteImageEffect GetContentImageEffect(PaletteState state) => PaletteContent.GetContentImageEffect(state);
+ public PaletteImageEffect GetContentImageEffect(PaletteState state) => PaletteContent!.GetContentImageEffect(state);
///
/// Gets the image color to remap into another color.
///
/// Palette value should be applicable to this state.
/// Color value.
- public Color GetContentImageColorMap(PaletteState state) => PaletteContent.GetContentImageColorMap(state);
+ public Color GetContentImageColorMap(PaletteState state) => PaletteContent!.GetContentImageColorMap(state);
///
/// Gets the color to use in place of the image map color.
///
/// Palette value should be applicable to this state.
/// Color value.
- public Color GetContentImageColorTo(PaletteState state) => PaletteContent.GetContentImageColorTo(state);
+ public Color GetContentImageColorTo(PaletteState state) => PaletteContent!.GetContentImageColorTo(state);
///
/// Gets the font for the short text.
@@ -132,42 +132,42 @@ public RibbonTabToContent([DisallowNull] IPaletteRibbonGeneral ribbonGeneral,
///
/// Palette value should be applicable to this state.
/// PaletteTextPrefix value.
- public PaletteTextHotkeyPrefix GetContentShortTextPrefix(PaletteState state) => PaletteContent.GetContentShortTextPrefix(state);
+ public PaletteTextHotkeyPrefix GetContentShortTextPrefix(PaletteState state) => PaletteContent!.GetContentShortTextPrefix(state);
///
/// Gets the flag indicating if multiline text is allowed for short text.
///
/// Palette value should be applicable to this state.
/// InheritBool value.
- public InheritBool GetContentShortTextMultiLine(PaletteState state) => PaletteContent.GetContentShortTextMultiLine(state);
+ public InheritBool GetContentShortTextMultiLine(PaletteState state) => PaletteContent!.GetContentShortTextMultiLine(state);
///
/// Gets the text trimming to use for short text.
///
/// Palette value should be applicable to this state.
/// PaletteTextTrim value.
- public virtual PaletteTextTrim GetContentShortTextTrim(PaletteState state) => PaletteContent.GetContentShortTextTrim(state);
+ public virtual PaletteTextTrim GetContentShortTextTrim(PaletteState state) => PaletteContent!.GetContentShortTextTrim(state);
///
/// Gets the horizontal relative alignment of the short text.
///
/// Palette value should be applicable to this state.
/// RelativeAlignment value.
- public virtual PaletteRelativeAlign GetContentShortTextH(PaletteState state) => PaletteContent.GetContentShortTextH(state);
+ public virtual PaletteRelativeAlign GetContentShortTextH(PaletteState state) => PaletteContent!.GetContentShortTextH(state);
///
/// Gets the vertical relative alignment of the short text.
///
/// Palette value should be applicable to this state.
/// RelativeAlignment value.
- public PaletteRelativeAlign GetContentShortTextV(PaletteState state) => PaletteContent.GetContentShortTextV(state);
+ public PaletteRelativeAlign GetContentShortTextV(PaletteState state) => PaletteContent!.GetContentShortTextV(state);
///
/// Gets the horizontal relative alignment of multiline short text.
///
/// Palette value should be applicable to this state.
/// RelativeAlignment value.
- public PaletteRelativeAlign GetContentShortTextMultiLineH(PaletteState state) => PaletteContent.GetContentShortTextMultiLineH(state);
+ public PaletteRelativeAlign GetContentShortTextMultiLineH(PaletteState state) => PaletteContent!.GetContentShortTextMultiLineH(state);
///
/// Gets the first back color for the short text.
@@ -251,42 +251,42 @@ public RibbonTabToContent([DisallowNull] IPaletteRibbonGeneral ribbonGeneral,
///
/// Palette value should be applicable to this state.
/// InheritBool value.
- public InheritBool GetContentLongTextMultiLine(PaletteState state) => PaletteContent.GetContentLongTextMultiLine(state);
+ public InheritBool GetContentLongTextMultiLine(PaletteState state) => PaletteContent!.GetContentLongTextMultiLine(state);
///
/// Gets the text trimming to use for long text.
///
/// Palette value should be applicable to this state.
/// PaletteTextTrim value.
- public virtual PaletteTextTrim GetContentLongTextTrim(PaletteState state) => PaletteContent.GetContentLongTextTrim(state);
+ public virtual PaletteTextTrim GetContentLongTextTrim(PaletteState state) => PaletteContent!.GetContentLongTextTrim(state);
///
/// Gets the prefix drawing setting for long text.
///
/// Palette value should be applicable to this state.
/// PaletteTextPrefix value.
- public PaletteTextHotkeyPrefix GetContentLongTextPrefix(PaletteState state) => PaletteContent.GetContentLongTextPrefix(state);
+ public PaletteTextHotkeyPrefix GetContentLongTextPrefix(PaletteState state) => PaletteContent!.GetContentLongTextPrefix(state);
///
/// Gets the horizontal relative alignment of the long text.
///
/// Palette value should be applicable to this state.
/// RelativeAlignment value.
- public PaletteRelativeAlign GetContentLongTextH(PaletteState state) => PaletteContent.GetContentLongTextH(state);
+ public PaletteRelativeAlign GetContentLongTextH(PaletteState state) => PaletteContent!.GetContentLongTextH(state);
///
/// Gets the vertical relative alignment of the long text.
///
/// Palette value should be applicable to this state.
/// RelativeAlignment value.
- public PaletteRelativeAlign GetContentLongTextV(PaletteState state) => PaletteContent.GetContentLongTextV(state);
+ public PaletteRelativeAlign GetContentLongTextV(PaletteState state) => PaletteContent!.GetContentLongTextV(state);
///
/// Gets the horizontal relative alignment of multiline long text.
///
/// Palette value should be applicable to this state.
/// RelativeAlignment value.
- public PaletteRelativeAlign GetContentLongTextMultiLineH(PaletteState state) => PaletteContent.GetContentLongTextMultiLineH(state);
+ public PaletteRelativeAlign GetContentLongTextMultiLineH(PaletteState state) => PaletteContent!.GetContentLongTextMultiLineH(state);
///
/// Gets the first back color for the long text.
@@ -349,14 +349,14 @@ public RibbonTabToContent([DisallowNull] IPaletteRibbonGeneral ribbonGeneral,
///
/// Palette value should be applicable to this state.
/// Padding value.
- public Padding GetContentPadding(PaletteState state) => PaletteContent.GetContentPadding(state);
+ public Padding GetContentPadding(PaletteState state) => PaletteContent!.GetContentPadding(state);
///
/// Gets the padding between adjacent content items.
///
/// Palette value should be applicable to this state.
/// Integer value.
- public int GetContentAdjacentGap(PaletteState state) => PaletteContent.GetContentAdjacentGap(state);
+ public int GetContentAdjacentGap(PaletteState state) => PaletteContent!.GetContentAdjacentGap(state);
///
/// Gets the style appropriate for this content.
diff --git a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarCheckButtonGroupInside.cs b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarCheckButtonGroupInside.cs
index a5bd4c289..ed36bcd9d 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarCheckButtonGroupInside.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarCheckButtonGroupInside.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -26,7 +26,7 @@ internal class ViewBuilderBarCheckButtonGroupInside : ViewBuilderBarItemBase
/// Palette redirector.
public override void Construct(KryptonNavigator navigator,
ViewManager manager,
- PaletteRedirect? redirector) =>
+ PaletteRedirect redirector) =>
// Let base class perform common operations
base.Construct(navigator, manager, redirector);
@@ -50,7 +50,7 @@ public override void Destruct() =>
protected override void CreateCheckItemView()
{
// Create the view element that lays out the check buttons
- _layoutBar = new ViewLayoutBar(Navigator.StateCommon.Bar,
+ _layoutBar = new ViewLayoutBar(Navigator.StateCommon!.Bar,
PaletteMetricInt.CheckButtonGap,
Navigator.Bar.ItemSizing,
Navigator.Bar.ItemAlignment,
@@ -91,11 +91,15 @@ protected override void CreateCheckItemView()
};
// Create a canvas for containing the selected page and put old root inside it
- _drawGroup = new ViewDrawCanvas(Navigator.StateNormal.HeaderGroup.Back, Navigator.StateNormal.HeaderGroup.Border, VisualOrientation.Top)
+ if (Navigator.StateNormal != null)
{
- _layoutPanelDocker
- };
- _newRoot = _drawGroup;
+ _drawGroup = new ViewDrawCanvas(Navigator.StateNormal.HeaderGroup.Back,
+ Navigator.StateNormal.HeaderGroup.Border, VisualOrientation.Top)
+ {
+ _layoutPanelDocker
+ };
+ }
+ _newRoot = _drawGroup!;
// Must call the base class to perform common actions
base.CreateCheckItemView();
@@ -110,10 +114,10 @@ protected override void CreateButtonSpecManager()
base.CreateButtonSpecManager();
// Modify the way that button specs are remapped
- var barManager = (ButtonSpecNavManagerLayoutBar)_buttonManager;
+ var barManager = _buttonManager as ButtonSpecNavManagerLayoutBar;
// Remap the normal color onto the button text
- barManager.RemapTarget = ButtonSpecNavRemap.ButtonSpecRemapTarget.ButtonStandalone;
+ barManager!.RemapTarget = ButtonSpecNavRemap.ButtonSpecRemapTarget.ButtonStandalone;
}
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarCheckButtonGroupOnly.cs b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarCheckButtonGroupOnly.cs
index 30637c8ba..198eebbe5 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarCheckButtonGroupOnly.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarCheckButtonGroupOnly.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -26,7 +26,7 @@ internal class ViewBuilderBarCheckButtonGroupOnly : ViewBuilderBarItemBase
/// Palette redirector.
public override void Construct(KryptonNavigator navigator,
ViewManager manager,
- PaletteRedirect? redirector) =>
+ PaletteRedirect redirector) =>
// Let base class perform common operations
base.Construct(navigator, manager, redirector);
@@ -44,7 +44,7 @@ public override void KeyPressedPageView()
if (Navigator.SelectedPage != null)
{
// Grab the view for the page
- INavCheckItem checkItem = _pageLookup[Navigator.SelectedPage];
+ INavCheckItem? checkItem = _pageLookup![Navigator.SelectedPage];
// If the item also has the focus
if (checkItem.HasFocus)
@@ -70,7 +70,7 @@ public override void Destruct() =>
protected override void CreateCheckItemView()
{
// Create the view element that lays out the check buttons
- _layoutBar = new ViewLayoutBar(Navigator.StateCommon.Bar,
+ _layoutBar = new ViewLayoutBar(Navigator.StateCommon!.Bar,
PaletteMetricInt.CheckButtonGap,
Navigator.Bar.ItemSizing,
Navigator.Bar.ItemAlignment,
@@ -130,10 +130,10 @@ protected override void CreateButtonSpecManager()
base.CreateButtonSpecManager();
// Modify the way that button specs are remapped
- var barManager = (ButtonSpecNavManagerLayoutBar)_buttonManager;
+ var barManager = _buttonManager as ButtonSpecNavManagerLayoutBar;
// Remap the normal color onto the button text
- barManager.RemapTarget = ButtonSpecNavRemap.ButtonSpecRemapTarget.ButtonStandalone;
+ barManager!.RemapTarget = ButtonSpecNavRemap.ButtonSpecRemapTarget.ButtonStandalone;
}
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarCheckButtonGroupOutside.cs b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarCheckButtonGroupOutside.cs
index a2b361e06..b6e9d8ca3 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarCheckButtonGroupOutside.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarCheckButtonGroupOutside.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -26,7 +26,7 @@ internal class ViewBuilderBarCheckButtonGroupOutside : ViewBuilderBarItemBase
/// Palette redirector.
public override void Construct(KryptonNavigator navigator,
ViewManager manager,
- PaletteRedirect? redirector) =>
+ PaletteRedirect redirector) =>
// Let base class perform common operations
base.Construct(navigator, manager, redirector);
@@ -56,7 +56,7 @@ protected override void CreateCheckItemView()
};
// Create the view element that lays out the check buttons
- _layoutBar = new ViewLayoutBar(Navigator.StateCommon.Bar,
+ _layoutBar = new ViewLayoutBar(Navigator.StateCommon!.Bar,
PaletteMetricInt.CheckButtonGap,
Navigator.Bar.ItemSizing,
Navigator.Bar.ItemAlignment,
@@ -113,11 +113,11 @@ protected override void CreateCheckItemView()
protected override void DestructCheckItemView()
{
// Remove the old root from the canvas
- _drawPanel.Clear();
+ _drawPanel?.Clear();
// Must call the base class to perform common actions
base.CreateCheckItemView();
- }
+ }
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarCheckButtonOnly.cs b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarCheckButtonOnly.cs
index 56a31d05c..7cd9adcda 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarCheckButtonOnly.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarCheckButtonOnly.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -26,7 +26,7 @@ internal class ViewBuilderBarCheckButtonOnly : ViewBuilderBarItemBase
/// Palette redirector.
public override void Construct(KryptonNavigator navigator,
ViewManager manager,
- PaletteRedirect? redirector) =>
+ PaletteRedirect redirector) =>
// Let base class perform common operations
base.Construct(navigator, manager, redirector);
@@ -44,7 +44,7 @@ public override void KeyPressedPageView()
if (Navigator.SelectedPage != null)
{
// Grab the view for the page
- INavCheckItem checkItem = _pageLookup[Navigator.SelectedPage];
+ INavCheckItem? checkItem = _pageLookup![Navigator.SelectedPage];
// If the item also has the focus
if (checkItem.HasFocus)
@@ -70,7 +70,7 @@ public override void Destruct() =>
protected override void CreateCheckItemView()
{
// Create the view element that lays out the check buttons
- _layoutBar = new ViewLayoutBar(Navigator.StateCommon.Bar,
+ _layoutBar = new ViewLayoutBar(Navigator.StateCommon!.Bar,
PaletteMetricInt.CheckButtonGap,
Navigator.Bar.ItemSizing,
Navigator.Bar.ItemAlignment,
@@ -119,7 +119,7 @@ protected override void CreateCheckItemView()
// Must call the base class to perform common actions
base.CreateCheckItemView();
- }
+ }
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarItemBase.cs b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarItemBase.cs
index 4ba9ee8ad..47124f393 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarItemBase.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarItemBase.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -43,14 +43,14 @@ internal abstract class ViewBuilderBarItemBase : ViewBuilderItemBase
///
/// Source of the event.
/// Property changed details.
- protected override void OnViewBuilderPropertyChanged(object sender, PropertyChangedEventArgs e)
+ protected override void OnViewBuilderPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
switch (e.PropertyName)
{
case @"BarOrientation":
UpdateOrientation();
UpdateItemOrientation();
- _buttonManager.RecreateButtons();
+ _buttonManager?.RecreateButtons();
Navigator.PerformNeedPaint(true);
break;
case @"BarFirstItemInset":
diff --git a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarRibbonTabBase.cs b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarRibbonTabBase.cs
index 7ad31a3b8..5cc614b5a 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarRibbonTabBase.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarRibbonTabBase.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -27,7 +27,7 @@ protected override INavCheckItem CreateCheckItem(KryptonPage? page,
VisualOrientation orientation)
{
// Create a check button view element
- var ribbonTab = new ViewDrawNavRibbonTab(Navigator, page);
+ var ribbonTab = new ViewDrawNavRibbonTab(Navigator, page!);
// Convert the button orientation to the appropriate visual orientations
VisualOrientation orientBackBorder = ConvertButtonBorderBackOrientation();
@@ -40,7 +40,7 @@ protected override INavCheckItem CreateCheckItem(KryptonPage? page,
}
///
- /// Gets the visual orientation of the check buttton.
+ /// Gets the visual orientation of the check button.
///
/// Visual orientation.
protected override VisualOrientation ConvertButtonBorderBackOrientation()
@@ -49,8 +49,10 @@ protected override VisualOrientation ConvertButtonBorderBackOrientation()
{
case VisualOrientation.Top:
return VisualOrientation.Top;
+
case VisualOrientation.Bottom:
return VisualOrientation.Bottom;
+
case VisualOrientation.Left:
if (CommonHelper.GetRightToLeftLayout(Navigator) &&
(Navigator.RightToLeft == RightToLeft.Yes))
@@ -61,6 +63,7 @@ protected override VisualOrientation ConvertButtonBorderBackOrientation()
{
return VisualOrientation.Left;
}
+
case VisualOrientation.Right:
if (CommonHelper.GetRightToLeftLayout(Navigator) &&
(Navigator.RightToLeft == RightToLeft.Yes))
@@ -71,9 +74,11 @@ protected override VisualOrientation ConvertButtonBorderBackOrientation()
{
return VisualOrientation.Right;
}
+
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(Navigator.Bar.BarOrientation.ToString());
return VisualOrientation.Top;
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarRibbonTabGroup.cs b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarRibbonTabGroup.cs
index 1fe42e47a..00810e4f2 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarRibbonTabGroup.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarRibbonTabGroup.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -44,7 +44,7 @@ protected override void CreateCheckItemView()
};
// Create the view element that lays out the check buttons
- var layoutBar = new ViewLayoutBarForTabs(Navigator.StateCommon.Bar,
+ var layoutBar = new ViewLayoutBarForTabs(Navigator.StateCommon!.Bar,
PaletteMetricInt.RibbonTabGap, Navigator.Bar.ItemSizing, Navigator.Bar.ItemAlignment,
Navigator.Bar.BarMultiline, Navigator.Bar.ItemMinimumSize, Navigator.Bar.ItemMaximumSize,
Navigator.Bar.BarMinimumHeight, Navigator.Bar.TabBorderStyle, true);
diff --git a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarRibbonTabOnly.cs b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarRibbonTabOnly.cs
index d51190ca9..feb596fd2 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarRibbonTabOnly.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarRibbonTabOnly.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -32,7 +32,7 @@ public override void KeyPressedPageView()
if (Navigator.SelectedPage != null)
{
// Grab the view for the page
- INavCheckItem checkItem = _pageLookup[Navigator.SelectedPage];
+ INavCheckItem checkItem = _pageLookup![Navigator.SelectedPage];
// If the item also has the focus
if (checkItem.HasFocus)
@@ -51,7 +51,7 @@ public override void KeyPressedPageView()
protected override void CreateCheckItemView()
{
// Create the view element that lays out the check buttons
- _layoutBar = new ViewLayoutBar(Navigator.StateCommon.Bar,
+ _layoutBar = new ViewLayoutBar(Navigator.StateCommon!.Bar,
PaletteMetricInt.RibbonTabGap,
Navigator.Bar.ItemSizing,
Navigator.Bar.ItemAlignment,
diff --git a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarTabBase.cs b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarTabBase.cs
index 7830a2f42..5ed9773c8 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarTabBase.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarTabBase.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -70,8 +70,10 @@ protected override VisualOrientation ConvertButtonBorderBackOrientation()
{
case VisualOrientation.Top:
return VisualOrientation.Top;
+
case VisualOrientation.Bottom:
return VisualOrientation.Bottom;
+
case VisualOrientation.Left:
if (CommonHelper.GetRightToLeftLayout(Navigator) &&
(Navigator.RightToLeft == RightToLeft.Yes))
@@ -82,6 +84,7 @@ protected override VisualOrientation ConvertButtonBorderBackOrientation()
{
return VisualOrientation.Left;
}
+
case VisualOrientation.Right:
if (CommonHelper.GetRightToLeftLayout(Navigator) &&
(Navigator.RightToLeft == RightToLeft.Yes))
@@ -92,9 +95,11 @@ protected override VisualOrientation ConvertButtonBorderBackOrientation()
{
return VisualOrientation.Right;
}
+
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(Navigator.Bar.BarOrientation.ToString());
return VisualOrientation.Top;
}
}
@@ -110,7 +115,7 @@ protected override VisualOrientation ConvertButtonBorderBackOrientation()
///
/// Source of the event.
/// Property changed details.
- protected override void OnViewBuilderPropertyChanged(object sender, PropertyChangedEventArgs e)
+ protected override void OnViewBuilderPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
switch (e.PropertyName)
{
@@ -134,7 +139,7 @@ protected override void OnViewBuilderPropertyChanged(object sender, PropertyChan
///
protected void UpdateTabStyle()
{
- Navigator.StateCommon.Tab.SetStyles(Navigator.Bar.TabStyle);
+ Navigator.StateCommon!.Tab.SetStyles(Navigator.Bar.TabStyle);
Navigator.OverrideFocus.Tab.SetStyles(Navigator.Bar.TabStyle);
// Update each individual tab with the new style for remapping page level button specs
@@ -142,8 +147,8 @@ protected void UpdateTabStyle()
{
foreach (var pair in PageLookup)
{
- var tabHeader = (ViewDrawNavCheckButtonTab)pair.Value;
- tabHeader.ButtonSpecManager?.SetRemapTarget(Navigator.Bar.TabStyle);
+ var tabHeader = pair.Value as ViewDrawNavCheckButtonTab;
+ tabHeader!.ButtonSpecManager!.SetRemapTarget(Navigator.Bar.TabStyle);
}
}
}
@@ -156,7 +161,7 @@ private void UpdateTabBorderStyle()
TabBorderStyle tabBorderStyle = Navigator.Bar.TabBorderStyle;
// Update the border style of each check button
- foreach (ViewDrawNavCheckButtonTab tab in _pageLookup.Values)
+ foreach (ViewDrawNavCheckButtonTab tab in _pageLookup!.Values)
{
tab.TabBorderStyle = tabBorderStyle;
}
diff --git a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarTabGroup.cs b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarTabGroup.cs
index c70ba13c3..3a6fa4fb9 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarTabGroup.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarTabGroup.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -50,7 +50,7 @@ protected override void CreateCheckItemView()
_layoutBar = layoutBar;
// Create the scroll spacer that restricts display
- _layoutBarViewport = new ViewLayoutViewport(Navigator.StateCommon.Bar,
+ _layoutBarViewport = new ViewLayoutViewport(Navigator.StateCommon!.Bar,
PaletteMetricPadding.BarPaddingTabs,
PaletteMetricInt.CheckButtonGap,
Navigator.Bar.BarOrientation,
diff --git a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarTabOnly.cs b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarTabOnly.cs
index 0c3dcad28..4b41e97b3 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarTabOnly.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBarTabOnly.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -32,7 +32,7 @@ public override void KeyPressedPageView()
if (Navigator.SelectedPage != null)
{
// Grab the view for the page
- INavCheckItem checkItem = _pageLookup[Navigator.SelectedPage];
+ INavCheckItem checkItem = _pageLookup![Navigator.SelectedPage];
// If the item also has the focus
if (checkItem.HasFocus)
@@ -61,7 +61,7 @@ protected override void CreateCheckItemView()
true);
// Create the scroll spacer that restricts display
- _layoutBarViewport = new ViewLayoutViewport(Navigator.StateCommon.Bar,
+ _layoutBarViewport = new ViewLayoutViewport(Navigator.StateCommon!.Bar,
PaletteMetricPadding.BarPaddingTabs,
PaletteMetricInt.CheckButtonGap,
Navigator.Bar.BarOrientation,
diff --git a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBase.cs b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBase.cs
index fe99ba579..d2ad25fe2 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBase.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderBase.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -49,7 +49,7 @@ public KryptonNavigator Navigator
///
/// Gets access to the view manager instance.
///
- public ViewManager ViewManager
+ public ViewManager? ViewManager
{
[DebuggerStepThrough]
get;
@@ -79,19 +79,19 @@ public PaletteRedirect Redirector
/// Reference to navigator instance.
/// Reference to current manager.
/// Palette redirector.
- public virtual void Construct([DisallowNull] KryptonNavigator navigator,
- [DisallowNull] ViewManager manager,
- [DisallowNull] PaletteRedirect redirector)
+ public virtual void Construct([DisallowNull] KryptonNavigator navigator,
+ [DisallowNull] ViewManager manager,
+ [DisallowNull] PaletteRedirect redirector)
{
- Debug.Assert(navigator != null, $"{nameof(navigator)} != null");
- Debug.Assert(manager != null);
- Debug.Assert(redirector != null);
+ Debug.Assert(navigator is not null, $"{nameof(navigator)} != null");
+ Debug.Assert(manager is not null);
+ Debug.Assert(redirector is not null);
Debug.Assert(_constructed == false);
// Save provided references
- Navigator = navigator;
- ViewManager = manager;
- Redirector = redirector;
+ Navigator = navigator ?? throw new ArgumentNullException(nameof(navigator));
+ ViewManager = manager ?? throw new ArgumentNullException(nameof(manager));
+ Redirector = redirector ?? throw new ArgumentNullException(nameof(redirector));
_constructed = true;
// Hook into the navigator events
@@ -104,10 +104,10 @@ public virtual void Construct([DisallowNull] KryptonNavigator navigator,
public virtual void Destruct()
{
Debug.Assert(_constructed);
- Debug.Assert(Navigator != null, $"{nameof(Navigator)} != null");
+ Debug.Assert(Navigator is not null, $"{nameof(Navigator)} != null");
// Unhook from the navigator events
- Navigator.ViewBuilderPropertyChanged -= OnViewBuilderPropertyChanged;
+ Navigator!.ViewBuilderPropertyChanged -= OnViewBuilderPropertyChanged;
// No longer constructed
_constructed = false;
@@ -467,7 +467,7 @@ public virtual bool SelectNextPage(bool wrap) =>
/// Wrap around end of collection to the start.
/// Associated with a Ctrl+Tab action.
/// True if new page selected; otherwise false.
- public virtual bool SelectNextPage(KryptonPage? page,
+ public virtual bool SelectNextPage(KryptonPage? page,
bool wrap,
bool ctrlTab)
{
@@ -566,7 +566,7 @@ public virtual bool SelectPreviousPage(bool wrap) =>
/// Wrap around end of collection to the start.
/// Associated with a Ctrl+Tab action.
/// True if new page selected; otherwise false.
- public virtual bool SelectPreviousPage(KryptonPage? page,
+ public virtual bool SelectPreviousPage(KryptonPage? page,
bool wrap,
bool ctrlTab)
{
@@ -697,7 +697,7 @@ protected void OnNeedPagePaint(object sender, NeedLayoutEventArgs e) =>
///
/// Source of the event.
/// Property changed details.
- protected virtual void OnViewBuilderPropertyChanged(object sender, PropertyChangedEventArgs e)
+ protected virtual void OnViewBuilderPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
if (Navigator.StateCommon == null)
{
@@ -725,11 +725,11 @@ protected virtual void OnViewBuilderPropertyChanged(object sender, PropertyChang
}
Debug.Assert(Navigator.StateCommon.HeaderGroup != null, "Navigator.StateCommon.HeaderGroup != null");
- Navigator.StateCommon.HeaderGroup.BackStyle = Navigator.Group.GroupBackStyle;
+ Navigator.StateCommon!.HeaderGroup!.BackStyle = Navigator.Group.GroupBackStyle;
Navigator.PerformNeedPaint(true);
break;
case @"GroupBorderStyle":
- Navigator.StateCommon.HeaderGroup.BorderStyle = Navigator.Group.GroupBorderStyle;
+ Navigator.StateCommon!.HeaderGroup.BorderStyle = Navigator.Group.GroupBorderStyle;
Navigator.PerformNeedPaint(true);
break;
}
@@ -775,10 +775,10 @@ public static ViewBuilderBase CreateViewBuilder(NavigatorMode mode)
case NavigatorMode.HeaderBarCheckButtonHeaderGroup:
return new ViewBuilderHeaderBarCheckButtonHeaderGroup();
case NavigatorMode.OutlookFull:
- return new ViewBuilderOutlookFull();
- case NavigatorMode.OutlookMini:
- return new ViewBuilderOutlookMini();
- case NavigatorMode.HeaderGroup:
+ return new ViewBuilderOutlookFull();
+ case NavigatorMode.OutlookMini:
+ return new ViewBuilderOutlookMini();
+ case NavigatorMode.HeaderGroup:
return new ViewBuilderHeaderGroup();
case NavigatorMode.Group:
return new ViewBuilderGroup();
@@ -787,7 +787,7 @@ public static ViewBuilderBase CreateViewBuilder(NavigatorMode mode)
default:
// Should never happen!
Debug.Assert(false);
- throw new ArgumentOutOfRangeException(nameof(mode));
+ throw DebugTools.NotImplemented(mode.ToString());
}
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderGroup.cs b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderGroup.cs
index a88a190cc..d118993e6 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderGroup.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderGroup.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -29,15 +29,15 @@ internal class ViewBuilderGroup : ViewBuilderBase
/// Reference to navigator instance.
/// Reference to current manager.
/// Palette redirector.
- public override void Construct(KryptonNavigator navigator,
+ public override void Construct(KryptonNavigator navigator,
[DisallowNull] ViewManager manager,
- [DisallowNull] PaletteRedirect redirector)
+ PaletteRedirect redirector)
{
// Let base class perform common operations
base.Construct(navigator, manager, redirector);
// Get the current root element
- _oldRoot = ViewManager.Root;
+ _oldRoot = ViewManager!.Root;
// Create a canvas for the border and background using current enabled state
_drawCanvas = new ViewDrawCanvas(Navigator.StateNormal.HeaderGroup.Back,
@@ -45,7 +45,7 @@ public override void Construct(KryptonNavigator navigator,
VisualOrientation.Top)
{
- // Put the exising root into the canvas
+ // Put the existing root into the canvas
_oldRoot
};
@@ -145,12 +145,12 @@ public override void UpdateStatePalettes()
// Use states defined in the selected page
if (Navigator.SelectedPage.Enabled)
{
- back = Navigator.SelectedPage.StateNormal.HeaderGroup.Back;
+ back = Navigator.SelectedPage!.StateNormal.HeaderGroup.Back;
border = Navigator.SelectedPage.StateNormal.HeaderGroup.Border;
}
else
{
- back = Navigator.SelectedPage.StateDisabled.HeaderGroup.Back;
+ back = Navigator.SelectedPage!.StateDisabled.HeaderGroup.Back;
border = Navigator.SelectedPage.StateDisabled.HeaderGroup.Border;
// If page is disabled then all of view should look disabled
@@ -188,7 +188,7 @@ public override void Destruct()
_drawCanvas.Dispose();
// Put the old root back again
- ViewManager.Root = _oldRoot;
+ ViewManager!.Root = _oldRoot;
// Let base class perform common operations
base.Destruct();
@@ -196,7 +196,7 @@ public override void Destruct()
#endregion
#region Implementation
- private void OnEnabledChanged(object sender, EventArgs e) => UpdateStatePalettes();
+ private void OnEnabledChanged(object? sender, EventArgs e) => UpdateStatePalettes();
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderHeaderBarCheckButtonBase.cs b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderHeaderBarCheckButtonBase.cs
index ae1c1ac96..6c7803917 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderHeaderBarCheckButtonBase.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderHeaderBarCheckButtonBase.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -31,7 +31,7 @@ internal abstract class ViewBuilderHeaderBarCheckButtonBase : ViewBuilderItemBas
/// Palette redirector.
public override void Construct(KryptonNavigator navigator,
ViewManager manager,
- PaletteRedirect? redirector)
+ PaletteRedirect redirector)
{
// Let base class perform common operations
base.Construct(navigator, manager, redirector);
@@ -59,7 +59,7 @@ protected override void CreateButtonSpecManager() =>
// Create button specification collection manager
_buttonManager = new ButtonSpecNavManagerLayoutHeaderBar(Navigator, Redirector, Navigator.Button.ButtonSpecs, Navigator.FixedSpecs,
new[] { _layoutBarDocker },
- new IPaletteMetric[] { Navigator.StateCommon.Bar },
+ new IPaletteMetric[] { Navigator.StateCommon!.Bar },
new[] { PaletteMetricInt.BarButtonEdgeInside },
new[] { PaletteMetricInt.BarButtonEdgeOutside },
new[] { PaletteMetricPadding.BarButtonPadding },
@@ -78,7 +78,7 @@ protected override void CreateButtonSpecManager() =>
///
protected override void PostCreate()
{
- SetHeaderStyle(_viewHeadingBar, Navigator.StateCommon.HeaderGroup.HeaderBar, Navigator.Header.HeaderStyleBar);
+ SetHeaderStyle(_viewHeadingBar, Navigator.StateCommon!.HeaderGroup.HeaderBar, Navigator.Header.HeaderStyleBar);
_viewHeadingBar.Visible = Navigator.Header.HeaderVisibleBar;
base.PostCreate();
}
@@ -88,7 +88,7 @@ protected override void PostCreate()
///
public override void UpdateStatePalettes()
{
- PaletteNavigator? paletteState;
+ PaletteNavigator paletteState;
// If whole navigator is disabled then all views are disabled
var enabled = Navigator.Enabled;
@@ -132,12 +132,12 @@ public override void UpdateStatePalettes()
///
/// Source of the event.
/// Property changed details.
- protected override void OnViewBuilderPropertyChanged(object sender, PropertyChangedEventArgs e)
+ protected override void OnViewBuilderPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
switch (e.PropertyName)
{
case @"HeaderStyleBar":
- SetHeaderStyle(_viewHeadingBar, Navigator.StateCommon.HeaderGroup.HeaderBar, Navigator.Header.HeaderStyleBar);
+ SetHeaderStyle(_viewHeadingBar, Navigator.StateCommon!.HeaderGroup.HeaderBar, Navigator.Header.HeaderStyleBar);
UpdateStatePalettes();
Navigator.PerformNeedPaint(true);
break;
@@ -148,7 +148,7 @@ protected override void OnViewBuilderPropertyChanged(object sender, PropertyChan
case @"HeaderPositionBar":
UpdateOrientation();
UpdateItemOrientation();
- _buttonManager.RecreateButtons();
+ _buttonManager!.RecreateButtons();
Navigator.PerformNeedPaint(true);
break;
default:
@@ -239,15 +239,15 @@ private IPaletteContent GetRemappingPaletteContent() => Navigator.Enabled
private PaletteState GetRemappingPaletteState() =>
Navigator.Enabled ? PaletteState.Normal : PaletteState.Disabled;
- private void OnEnabledChanged(object sender, EventArgs e)
+ private void OnEnabledChanged(object? sender, EventArgs e)
{
if (_buttonManager != null)
{
// Cast button manager to correct type
- var headerBarBM = (ButtonSpecNavManagerLayoutHeaderBar)_buttonManager;
+ var headerBarBM = _buttonManager as ButtonSpecNavManagerLayoutHeaderBar;
// Update with newly calculated values
- headerBarBM.UpdateRemapping(GetRemappingPaletteContent(),
+ headerBarBM?.UpdateRemapping(GetRemappingPaletteContent(),
GetRemappingPaletteState());
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderHeaderBarCheckButtonGroup.cs b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderHeaderBarCheckButtonGroup.cs
index 153145ce2..686d9b7e6 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderHeaderBarCheckButtonGroup.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderHeaderBarCheckButtonGroup.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -32,7 +32,7 @@ internal class ViewBuilderHeaderBarCheckButtonGroup : ViewBuilderHeaderBarCheckB
protected override void CreateCheckItemView()
{
// Create the view element that lays out the check buttons
- _layoutBar = new ViewLayoutBar(Navigator.StateCommon.Bar,
+ _layoutBar = new ViewLayoutBar(Navigator.StateCommon!.Bar,
PaletteMetricInt.CheckButtonGap,
Navigator.Bar.ItemSizing,
Navigator.Bar.ItemAlignment,
diff --git a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderHeaderBarCheckButtonHeaderGroup.cs b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderHeaderBarCheckButtonHeaderGroup.cs
index 9d0007ead..3062931ad 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderHeaderBarCheckButtonHeaderGroup.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderHeaderBarCheckButtonHeaderGroup.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -33,10 +33,10 @@ internal class ViewBuilderHeaderBarCheckButtonHeaderGroup : ViewBuilderHeaderBar
///
/// Element to search against.
/// Reference to ButtonSpec; otherwise null.
- public override ButtonSpec? ButtonSpecFromView(ViewBase element)
+ public override ButtonSpec ButtonSpecFromView(ViewBase element)
{
// Always check base class first
- ButtonSpec bs = base.ButtonSpecFromView(element) ?? _headerGroup.ButtonSpecFromView(element);
+ ButtonSpec bs = base.ButtonSpecFromView(element) ?? _headerGroup!.ButtonSpecFromView(element)!;
// Call onto the contained header group implementation
@@ -51,7 +51,7 @@ internal class ViewBuilderHeaderBarCheckButtonHeaderGroup : ViewBuilderHeaderBar
protected override void CreateCheckItemView()
{
// Create the view element that lays out the check buttons
- _layoutBar = new ViewLayoutBar(Navigator.StateCommon.Bar,
+ _layoutBar = new ViewLayoutBar(Navigator.StateCommon!.Bar,
PaletteMetricInt.CheckButtonGap,
Navigator.Bar.ItemSizing,
Navigator.Bar.ItemAlignment,
@@ -99,7 +99,7 @@ protected override void CreateCheckItemView()
_viewGroup.Insert(0, _viewHeadingBar);
_viewGroup.SetDock(_viewHeadingBar, ViewDockStyle.Top);
- // Define the new root for the view hieararchy
+ // Define the new root for the view hierarchy
_newRoot = _viewGroup;
// Must call the base class to perform common actions
@@ -112,7 +112,7 @@ protected override void CreateCheckItemView()
protected override void PostCreate()
{
// Ask the header group to finish the create phase
- _headerGroup.PostCreate();
+ _headerGroup!.PostCreate();
// Let base class perform standard actions
base.PostCreate();
@@ -124,7 +124,7 @@ protected override void PostCreate()
protected override void DestructCheckItemView()
{
// Must remember to get the header group to destruct itself
- _headerGroup.Destruct();
+ _headerGroup!.Destruct();
// Must call the base class to perform common actions
base.DestructCheckItemView();
@@ -145,10 +145,10 @@ protected override void CreateButtonSpecManager()
///
/// Source of the event.
/// Property changed details.
- protected override void OnViewBuilderPropertyChanged(object sender, PropertyChangedEventArgs e)
+ protected override void OnViewBuilderPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
// Let the header group process the property
- _headerGroup.ViewBuilderPropertyChanged(e);
+ _headerGroup!.ViewBuilderPropertyChanged(e);
// Let the base process it as well
base.OnViewBuilderPropertyChanged(sender, e);
@@ -202,7 +202,7 @@ public override void SelectedPageChanged()
base.SelectedPageChanged();
// Ask the header group to update the
- _headerGroup.UpdateButtons();
+ _headerGroup!.UpdateButtons();
}
///
@@ -211,7 +211,7 @@ public override void SelectedPageChanged()
public override void PageCollectionChanged()
{
UpdateStatePalettes();
- _headerGroup.UpdateButtons();
+ _headerGroup!.UpdateButtons();
// Let base class do standard work
base.PageCollectionChanged();
diff --git a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderHeaderBarCheckButtonOnly.cs b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderHeaderBarCheckButtonOnly.cs
index 6509c6edf..0d32e46a4 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderHeaderBarCheckButtonOnly.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderHeaderBarCheckButtonOnly.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -36,7 +36,7 @@ public override void KeyPressedPageView()
if (Navigator.SelectedPage != null)
{
// Grab the view for the page
- INavCheckItem checkItem = _pageLookup[Navigator.SelectedPage];
+ INavCheckItem checkItem = _pageLookup![Navigator.SelectedPage];
// If the item also has the focus
if (checkItem.HasFocus)
@@ -55,7 +55,7 @@ public override void KeyPressedPageView()
protected override void CreateCheckItemView()
{
// Create the view element that lays out the check buttons
- _layoutBar = new ViewLayoutBar(Navigator.StateCommon.Bar,
+ _layoutBar = new ViewLayoutBar(Navigator.StateCommon!.Bar,
PaletteMetricInt.CheckButtonGap,
Navigator.Bar.ItemSizing,
Navigator.Bar.ItemAlignment,
@@ -121,7 +121,7 @@ protected override void DestructCheckItemView()
// Must call the base class to perform common actions
base.CreateCheckItemView();
- }
+ }
///
/// Update the bar orientation.
diff --git a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderHeaderBarTabGroup.cs b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderHeaderBarTabGroup.cs
index cb7998645..9550828e4 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderHeaderBarTabGroup.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderHeaderBarTabGroup.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -35,7 +35,7 @@ internal class ViewBuilderHeaderBarTabGroup : ViewBuilderBarTabBase
/// Palette redirector.
public override void Construct(KryptonNavigator navigator,
ViewManager manager,
- PaletteRedirect? redirector)
+ PaletteRedirect redirector)
{
// Let base class perform common operations
base.Construct(navigator, manager, redirector);
@@ -56,7 +56,7 @@ public override void Construct(KryptonNavigator navigator,
/// Reference to ButtonSpec; otherwise null.
public override ButtonSpec? ButtonSpecFromView(ViewBase element) =>
// Ask the button manager for the button spec for this element
- _buttonManager.ButtonSpecFromView(element);
+ _buttonManager!.ButtonSpecFromView(element);
///
/// Process a change in the selected page
@@ -116,7 +116,7 @@ public override void PageEnabledStateChanged(KryptonPage? page)
public override Point GetContextShowPoint()
{
// Get the display rectangle of the context button
- Rectangle rect = _buttonManager.GetButtonRectangle(Navigator.Button.ContextButton);
+ Rectangle rect = _buttonManager!.GetButtonRectangle(Navigator.Button.ContextButton);
// We want the context menu to show just below the button
var pt = new Point(rect.Left, rect.Bottom + 3);
@@ -198,7 +198,7 @@ public override void PerformPreviousAction(DirectionButtonAction action, Krypton
///
public void UpdateButtons() =>
// Ensure buttons are recreated to reflect different page
- _buttonManager.RecreateButtons();
+ _buttonManager!.RecreateButtons();
#endregion
#region Protected
@@ -207,9 +207,9 @@ public void UpdateButtons() =>
///
protected override void PostCreate()
{
- // Let base class perform standard actions
+ // Let base class perform standard actions
base.PostCreate();
-
+
UpdateStatePalettes();
UpdateHeaders();
UpdateButtons();
@@ -263,7 +263,7 @@ protected override void CreateCheckItemView()
_layoutBar = layoutBar;
// Create the scroll spacer that restricts display
- _layoutBarViewport = new ViewLayoutViewport(Navigator.StateCommon.Bar,
+ _layoutBarViewport = new ViewLayoutViewport(Navigator.StateCommon!.Bar,
PaletteMetricPadding.BarPaddingTabs,
PaletteMetricInt.CheckButtonGap,
Navigator.Bar.BarOrientation,
@@ -342,20 +342,20 @@ public override void UpdateStatePalettes()
if (Navigator.SelectedPage == null)
{
// Then use the states defined in the navigator itself
- SetPalettes(Navigator.Enabled
+ SetPalettes((Navigator.Enabled
? Navigator.StateNormal.HeaderGroup
- : Navigator.StateDisabled.HeaderGroup);
+ : Navigator.StateDisabled.HeaderGroup));
}
else
{
// Use states defined in the selected page
if (Navigator.SelectedPage.Enabled)
{
- SetPalettes(Navigator.SelectedPage.StateNormal.HeaderGroup);
+ SetPalettes(Navigator.SelectedPage!.StateNormal.HeaderGroup);
}
else
{
- SetPalettes(Navigator.SelectedPage.StateDisabled.HeaderGroup);
+ SetPalettes(Navigator.SelectedPage!.StateDisabled.HeaderGroup);
// If page is disabled then all of view should look disabled
enabled = false;
@@ -379,7 +379,7 @@ protected override void UpdateOrientation()
base.UpdateOrientation();
// The view group should always include the bar orientation edge when drawing
- _drawGroup.IncludeBorderEdge = Navigator.Bar.BarOrientation;
+ _drawGroup!.IncludeBorderEdge = Navigator.Bar.BarOrientation;
switch (Navigator.Bar.BarOrientation)
{
@@ -410,28 +410,28 @@ protected override void UpdateOrientation()
///
/// Source of the event.
/// Property changed details.
- protected override void OnViewBuilderPropertyChanged(object sender, PropertyChangedEventArgs e)
+ protected override void OnViewBuilderPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
switch (e.PropertyName)
{
case @"HeaderStylePrimary":
- SetHeaderStyle(_viewHeadingPrimary, Navigator.StateCommon.HeaderGroup.HeaderPrimary, Navigator.Header.HeaderStylePrimary);
+ SetHeaderStyle(_viewHeadingPrimary, Navigator.StateCommon!.HeaderGroup.HeaderPrimary, Navigator.Header.HeaderStylePrimary);
UpdateStatePalettes();
Navigator.PerformNeedPaint(true);
break;
case @"HeaderStyleSecondary":
- SetHeaderStyle(_viewHeadingSecondary, Navigator.StateCommon.HeaderGroup.HeaderSecondary, Navigator.Header.HeaderStyleSecondary);
+ SetHeaderStyle(_viewHeadingSecondary, Navigator.StateCommon!.HeaderGroup.HeaderSecondary, Navigator.Header.HeaderStyleSecondary);
UpdateStatePalettes();
Navigator.PerformNeedPaint(true);
break;
case @"HeaderPositionPrimary":
SetHeaderPosition(_viewHeadingPrimary, _viewContentPrimary, Navigator.Header.HeaderPositionPrimary);
- _buttonManager.RecreateButtons();
+ _buttonManager?.RecreateButtons();
Navigator.PerformNeedPaint(true);
break;
case @"HeaderPositionSecondary":
SetHeaderPosition(_viewHeadingSecondary, _viewContentSecondary, Navigator.Header.HeaderPositionSecondary);
- _buttonManager.RecreateButtons();
+ _buttonManager?.RecreateButtons();
Navigator.PerformNeedPaint(true);
break;
case @"HeaderVisiblePrimary":
@@ -449,12 +449,12 @@ protected override void OnViewBuilderPropertyChanged(object sender, PropertyChan
case @"ContextButtonDisplay":
case @"CloseButtonDisplay":
case nameof(ButtonDisplayLogic):
- _buttonManager.RecreateButtons();
+ _buttonManager?.RecreateButtons();
break;
}
base.OnViewBuilderPropertyChanged(sender, e);
- }
+ }
#endregion
#region Implementation
@@ -480,7 +480,7 @@ protected override void CreateButtonSpecManager() =>
// Create button specification collection manager
_buttonManager = new ButtonSpecManagerDraw(Navigator, Redirector, Navigator.Button.ButtonSpecs, Navigator.FixedSpecs,
new[] { _viewHeadingPrimary, _viewHeadingSecondary },
- new IPaletteMetric[] { Navigator.StateCommon.HeaderGroup.HeaderPrimary, Navigator.StateCommon.HeaderGroup.HeaderSecondary },
+ new IPaletteMetric[] { Navigator.StateCommon!.HeaderGroup.HeaderPrimary, Navigator.StateCommon.HeaderGroup.HeaderSecondary },
new[] { PaletteMetricInt.HeaderButtonEdgeInsetPrimary, PaletteMetricInt.HeaderButtonEdgeInsetSecondary },
new[] { PaletteMetricPadding.HeaderButtonPaddingPrimary, PaletteMetricPadding.HeaderButtonPaddingSecondary },
Navigator.CreateToolStripRenderer,
@@ -493,7 +493,7 @@ protected override void CreateButtonSpecManager() =>
private void UpdateHeaders()
{
- SetHeaderStyle(_viewHeadingPrimary, Navigator.StateCommon.HeaderGroup.HeaderPrimary, Navigator.Header.HeaderStylePrimary);
+ SetHeaderStyle(_viewHeadingPrimary, Navigator.StateCommon!.HeaderGroup.HeaderPrimary, Navigator.Header.HeaderStylePrimary);
SetHeaderStyle(_viewHeadingSecondary, Navigator.StateCommon.HeaderGroup.HeaderSecondary, Navigator.Header.HeaderStyleSecondary);
SetHeaderPosition(_viewHeadingPrimary, _viewContentPrimary, Navigator.Header.HeaderPositionPrimary);
SetHeaderPosition(_viewHeadingSecondary, _viewContentSecondary, Navigator.Header.HeaderPositionSecondary);
@@ -508,53 +508,55 @@ private void SetHeaderStyle(ViewDrawDocker drawDocker,
switch (style)
{
case HeaderStyle.Primary:
- _buttonManager.SetDockerMetrics(drawDocker, palette,
+ _buttonManager?.SetDockerMetrics(drawDocker, palette,
PaletteMetricInt.HeaderButtonEdgeInsetPrimary,
PaletteMetricPadding.HeaderButtonPaddingPrimary);
break;
+
case HeaderStyle.Secondary:
- _buttonManager.SetDockerMetrics(drawDocker, palette,
+ _buttonManager?.SetDockerMetrics(drawDocker, palette,
PaletteMetricInt.HeaderButtonEdgeInsetSecondary,
PaletteMetricPadding.HeaderButtonPaddingSecondary);
break;
+
case HeaderStyle.DockActive:
- _buttonManager.SetDockerMetrics(drawDocker, palette,
+ _buttonManager?.SetDockerMetrics(drawDocker, palette,
PaletteMetricInt.HeaderButtonEdgeInsetDockActive,
PaletteMetricPadding.HeaderButtonPaddingDockActive);
break;
+
case HeaderStyle.DockInactive:
- _buttonManager.SetDockerMetrics(drawDocker, palette,
+ _buttonManager?.SetDockerMetrics(drawDocker, palette,
PaletteMetricInt.HeaderButtonEdgeInsetDockInactive,
PaletteMetricPadding.HeaderButtonPaddingDockInactive);
break;
+
case HeaderStyle.Form:
- _buttonManager.SetDockerMetrics(drawDocker, palette,
+ _buttonManager?.SetDockerMetrics(drawDocker, palette,
PaletteMetricInt.HeaderButtonEdgeInsetForm,
PaletteMetricPadding.HeaderButtonPaddingForm);
break;
+
case HeaderStyle.Calendar:
- _buttonManager.SetDockerMetrics(drawDocker, palette,
- PaletteMetricInt.HeaderButtonEdgeInsetCalendar,
- PaletteMetricPadding.HeaderButtonPaddingCalendar);
+ _buttonManager?.SetDockerMetrics(drawDocker, palette, PaletteMetricInt.HeaderButtonEdgeInsetCalendar, PaletteMetricPadding.HeaderButtonPaddingCalendar);
break;
+
case HeaderStyle.Custom1:
- _buttonManager.SetDockerMetrics(drawDocker, palette,
- PaletteMetricInt.HeaderButtonEdgeInsetCustom1,
- PaletteMetricPadding.HeaderButtonPaddingCustom1);
+ _buttonManager?.SetDockerMetrics(drawDocker, palette, PaletteMetricInt.HeaderButtonEdgeInsetCustom1, PaletteMetricPadding.HeaderButtonPaddingCustom1);
break;
+
case HeaderStyle.Custom2:
- _buttonManager.SetDockerMetrics(drawDocker, palette,
- PaletteMetricInt.HeaderButtonEdgeInsetCustom2,
- PaletteMetricPadding.HeaderButtonPaddingCustom2);
+ _buttonManager?.SetDockerMetrics(drawDocker, palette, PaletteMetricInt.HeaderButtonEdgeInsetCustom2, PaletteMetricPadding.HeaderButtonPaddingCustom2);
break;
+
case HeaderStyle.Custom3:
- _buttonManager.SetDockerMetrics(drawDocker, palette,
- PaletteMetricInt.HeaderButtonEdgeInsetCustom3,
- PaletteMetricPadding.HeaderButtonPaddingCustom3);
+ _buttonManager?.SetDockerMetrics(drawDocker, palette, PaletteMetricInt.HeaderButtonEdgeInsetCustom3, PaletteMetricPadding.HeaderButtonPaddingCustom3);
break;
+
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(style.ToString());
break;
}
}
@@ -593,8 +595,8 @@ private void SetPalettes([DisallowNull] PaletteHeaderGroup palette)
_viewHeadingPrimary.SetPalettes(palette.HeaderPrimary.Back, palette.HeaderPrimary.Border, palette.HeaderPrimary);
_viewHeadingSecondary.SetPalettes(palette.HeaderSecondary.Back, palette.HeaderSecondary.Border, palette.HeaderSecondary);
- _buttonManager.SetDockerMetrics(_viewHeadingPrimary, palette.HeaderPrimary);
- _buttonManager.SetDockerMetrics(_viewHeadingSecondary, palette.HeaderSecondary);
+ _buttonManager?.SetDockerMetrics(_viewHeadingPrimary, palette.HeaderPrimary);
+ _buttonManager?.SetDockerMetrics(_viewHeadingSecondary, palette.HeaderSecondary);
_viewContentPrimary.SetPalette(palette.HeaderPrimary.Content);
_viewContentSecondary.SetPalette(palette.HeaderSecondary.Content);
@@ -607,22 +609,22 @@ private void SetEnabled(bool enabled)
_viewHeadingSecondary.Enabled = enabled;
_viewContentPrimary.Enabled = enabled;
_viewContentSecondary.Enabled = enabled;
- _buttonManager.RecreateButtons();
+ _buttonManager?.RecreateButtons();
}
- private void OnDragStart(object sender, DragStartEventCancelArgs e) => Navigator.InternalDragStart(e, null);
+ private void OnDragStart(object? sender, DragStartEventCancelArgs e) => Navigator.InternalDragStart(e, null);
- private void OnDragMove(object sender, PointEventArgs e) => Navigator.InternalDragMove(e);
+ private void OnDragMove(object? sender, PointEventArgs e) => Navigator.InternalDragMove(e);
- private void OnDragEnd(object sender, PointEventArgs e) => Navigator.InternalDragEnd(e);
+ private void OnDragEnd(object? sender, PointEventArgs e) => Navigator.InternalDragEnd(e);
- private void OnDragQuit(object sender, EventArgs e) => Navigator.InternalDragQuit();
+ private void OnDragQuit(object? sender, EventArgs e) => Navigator.InternalDragQuit();
- private void OnLeftMouseDown(object sender, EventArgs e) => Navigator.OnPrimaryHeaderLeftClicked(e);
+ private void OnLeftMouseDown(object? sender, EventArgs e) => Navigator.OnPrimaryHeaderLeftClicked(e);
- private void OnRightMouseDown(object sender, EventArgs e) => Navigator.OnPrimaryHeaderRightClicked(e);
+ private void OnRightMouseDown(object? sender, EventArgs e) => Navigator.OnPrimaryHeaderRightClicked(e);
- private void OnLeftDoubleClick(object sender, EventArgs e) => Navigator.OnPrimaryHeaderDoubleClicked(e);
+ private void OnLeftDoubleClick(object? sender, EventArgs e) => Navigator.OnPrimaryHeaderDoubleClicked(e);
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderHeaderGroup.cs b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderHeaderGroup.cs
index a04919071..cbcd8cf43 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderHeaderGroup.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderHeaderGroup.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -31,23 +31,23 @@ internal class ViewBuilderHeaderGroup : ViewBuilderBase
/// Palette redirector.
public override void Construct([DisallowNull] KryptonNavigator navigator,
[DisallowNull] ViewManager manager,
- [DisallowNull] PaletteRedirect redirector)
+ PaletteRedirect redirector)
{
// Let base class perform common operations
base.Construct(navigator, manager, redirector);
// Get the current root element
- _oldRoot = ViewManager.Root;
+ _oldRoot = ViewManager?.Root!;
// Construct the viewlet instance
_headerGroup = new ViewletHeaderGroup(navigator, redirector, NeedPaintDelegate);
// Create and initialize all objects
ViewBase newRoot = _headerGroup.Construct(_oldRoot);
- _headerGroup.PostCreate();
+ _headerGroup?.PostCreate();
// Assign the new root
- ViewManager.Root = newRoot;
+ ViewManager!.Root = newRoot;
// Need to monitor changes in the enabled state
Navigator.EnabledChanged += OnEnabledChanged;
@@ -62,10 +62,10 @@ public override void Destruct()
Navigator.EnabledChanged -= OnEnabledChanged;
// Pull down the header group view hierarchy
- _headerGroup.Destruct();
+ _headerGroup?.Destruct();
// Put the old root back again
- ViewManager.Root = _oldRoot;
+ ViewManager!.Root = _oldRoot;
// Let base class do standard work
base.Destruct();
@@ -92,7 +92,7 @@ public override void Destruct()
/// Reference to ButtonSpec; otherwise null.
public override ButtonSpec? ButtonSpecFromView(ViewBase element) =>
// Delegate lookup to the viewlet that has the button spec manager
- _headerGroup.ButtonSpecFromView(element);
+ _headerGroup?.ButtonSpecFromView(element);
///
/// Process a change in the selected page
@@ -100,7 +100,7 @@ public override void Destruct()
public override void SelectedPageChanged()
{
UpdateStatePalettes();
- _headerGroup.UpdateButtons();
+ _headerGroup?.UpdateButtons();
// Let base class do standard work
base.SelectedPageChanged();
@@ -112,7 +112,7 @@ public override void SelectedPageChanged()
public override void PageCollectionChanged()
{
UpdateStatePalettes();
- _headerGroup.UpdateButtons();
+ _headerGroup?.UpdateButtons();
// Let base class do standard work
base.PageCollectionChanged();
@@ -145,7 +145,7 @@ public override void PageEnabledStateChanged(KryptonPage? page)
{
// Update to use the correct enabled/disabled palette
UpdateStatePalettes();
- _headerGroup.UpdateButtons();
+ _headerGroup?.UpdateButtons();
// Need to repaint to show the change
Navigator.PerformNeedPaint(true);
@@ -161,10 +161,21 @@ public override void PageEnabledStateChanged(KryptonPage? page)
///
/// Page that has changed.
/// Name of property that has changed.
- public override void PageAppearanceChanged([DisallowNull] KryptonPage page, [DisallowNull] string property)
+ public override void PageAppearanceChanged([DisallowNull] KryptonPage page,
+ [DisallowNull] string property)
{
- Debug.Assert(page != null);
- Debug.Assert(property != null);
+ Debug.Assert(page is not null);
+ Debug.Assert(property is not null);
+
+ if (page is null)
+ {
+ throw new ArgumentNullException(nameof(page));
+ }
+
+ if (property is null)
+ {
+ throw new ArgumentNullException(nameof(property));
+ }
// We are only interested if the selected page has changed
if (page == Navigator.SelectedPage)
@@ -214,7 +225,7 @@ public override Point GetContextShowPoint() =>
/// True if the view wants the mouse position; otherwise false.
public override bool DesignerGetHitTest(Point pt) =>
// Check if the header group wants the mouse
- _headerGroup.DesignerGetHitTest(pt);
+ _headerGroup!.DesignerGetHitTest(pt);
///
/// Calculate the enabled state of the next button based on the required action.
@@ -224,7 +235,7 @@ public override bool DesignerGetHitTest(Point pt) =>
public override ButtonEnabled NextActionEnabled(DirectionButtonAction action)
{
// Ask the header group to update the action
- action = _headerGroup.NextActionEnabled(action);
+ action = _headerGroup!.NextActionEnabled(action);
// Let base class perform basic action calculations
return base.NextActionEnabled(action);
@@ -238,7 +249,7 @@ public override ButtonEnabled NextActionEnabled(DirectionButtonAction action)
public override void PerformNextAction(DirectionButtonAction action, KryptonPage? page)
{
// Ask the header group to update the action
- action = _headerGroup.NextActionEnabled(action);
+ action = _headerGroup!.NextActionEnabled(action);
// Let base class perform basic actions
base.PerformNextAction(action, page);
@@ -252,7 +263,7 @@ public override void PerformNextAction(DirectionButtonAction action, KryptonPage
public override ButtonEnabled PreviousActionEnabled(DirectionButtonAction action)
{
// Ask the header group to update the action
- action = _headerGroup.PreviousActionEnabled(action);
+ action = _headerGroup!.PreviousActionEnabled(action);
// Let base class perform basic action calculations
return base.PreviousActionEnabled(action);
@@ -266,7 +277,7 @@ public override ButtonEnabled PreviousActionEnabled(DirectionButtonAction action
public override void PerformPreviousAction(DirectionButtonAction action, KryptonPage? page)
{
// Ask the header group to update the action
- action = _headerGroup.PreviousActionEnabled(action);
+ action = _headerGroup!.PreviousActionEnabled(action);
// Let base class perform basic actions
base.PerformPreviousAction(action, page);
@@ -337,10 +348,10 @@ public override bool ProcessMnemonic(char charCode) =>
///
/// Source of the event.
/// Property changed details.
- protected override void OnViewBuilderPropertyChanged(object sender, PropertyChangedEventArgs e)
+ protected override void OnViewBuilderPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
// Let the header group process the property
- _headerGroup.ViewBuilderPropertyChanged(e);
+ _headerGroup?.ViewBuilderPropertyChanged(e);
// Let the base process it as well
base.OnViewBuilderPropertyChanged(sender, e);
@@ -348,7 +359,7 @@ protected override void OnViewBuilderPropertyChanged(object sender, PropertyChan
#endregion
#region Implementation
- private void OnEnabledChanged(object sender, EventArgs e) => UpdateStatePalettes();
+ private void OnEnabledChanged(object? sender, EventArgs e) => UpdateStatePalettes();
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderItemBase.cs b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderItemBase.cs
index 02c474f53..367150a9a 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderItemBase.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderItemBase.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -40,13 +40,13 @@ internal abstract class ViewBuilderItemBase : ViewBuilderBase
/// Palette redirector.
public override void Construct([DisallowNull] KryptonNavigator navigator,
[DisallowNull] ViewManager manager,
- [DisallowNull] PaletteRedirect redirector)
+ PaletteRedirect redirector)
{
// Let base class perform common operations
base.Construct(navigator, manager, redirector);
// Get the current root element
- _oldRoot = ViewManager.Root;
+ _oldRoot = ViewManager?.Root!;
// Create and initialize all objects
CreateCheckItemView();
@@ -61,7 +61,7 @@ public override void Construct([DisallowNull] KryptonNavigator navigator,
_buttonManager?.RecreateButtons();
// Canvas becomes the new root
- ViewManager.Root = _newRoot;
+ ViewManager!.Root = _newRoot;
// Need to monitor changes in the enabled state
Navigator.EnabledChanged += OnNavigatorEnabledChanged;
@@ -82,7 +82,7 @@ public override void Destruct()
Navigator.RightToLeftChanged -= OnNavigatorRightToLeftChanged;
// Put the old root back again
- ViewManager.Root = _oldRoot;
+ ViewManager!.Root = _oldRoot;
// Let base class perform common operations
base.Destruct();
@@ -118,11 +118,11 @@ public override void SelectedPageChanged()
// If we found a selected page
if (selected != null)
{
- // Make sure the layout is upto date
+ // Make sure the layout is up-to date
Navigator.CheckPerformLayout();
// Get the client rectangle of the check button
- Rectangle buttonRect = selected.ClientRectangle;
+ var buttonRect = selected.ClientRectangle;
// Ask the viewport to bring this rectangle into view
_layoutBarViewport.BringIntoView(buttonRect);
@@ -152,10 +152,10 @@ public override void PageVisibleStateChanged(KryptonPage? page)
{
// Sometimes the page is noticed as changed in visibility before the
// page has been processed and has a view added, so need to check lookup
- if (_pageLookup.ContainsKey(page))
+ if (_pageLookup.ContainsKey(page!))
{
// Reflect new state in the check button
- _pageLookup[page].View.Visible = page.LastVisibleSet;
+ _pageLookup[page!].View.Visible = page!.LastVisibleSet;
// Need to repaint to show the change
Navigator.PerformNeedPaint(true);
@@ -176,10 +176,10 @@ public override void PageEnabledStateChanged(KryptonPage? page)
{
// Sometimes the page is noticed as changed in enabled state before the
// page has been processed and has a view added, so need to check lookup
- if (_pageLookup.ContainsKey(page))
+ if (_pageLookup.ContainsKey(page!))
{
// Reflect new state in the check button
- _pageLookup[page].View.Enabled = page.Enabled;
+ _pageLookup[page!].View.Enabled = page!.Enabled;
// Need to repaint to show the change
Navigator.PerformNeedPaint(true);
@@ -211,7 +211,7 @@ public override void PageEnabledStateChanged(KryptonPage? page)
ButtonSpec? bs = (_buttonManager?.ButtonSpecFromView(element));
// Check each page level button spec
- if ((bs == null) && (_pageLookup != null))
+ if (bs == null && _pageLookup != null)
{
foreach (var pair in _pageLookup)
{
@@ -231,10 +231,21 @@ public override void PageEnabledStateChanged(KryptonPage? page)
///
/// Page that has changed.
/// Name of property that has changed.
- public override void PageAppearanceChanged([DisallowNull] KryptonPage page, [DisallowNull] string property)
+ public override void PageAppearanceChanged([DisallowNull] KryptonPage page,
+ [DisallowNull] string property)
{
- Debug.Assert(page != null);
- Debug.Assert(property != null);
+ Debug.Assert(page is not null);
+ Debug.Assert(property is not null);
+
+ if (page is null)
+ {
+ throw new ArgumentNullException(nameof(page));
+ }
+
+ if (property is null)
+ {
+ throw new ArgumentNullException(nameof(property));
+ }
switch (property)
{
@@ -257,7 +268,7 @@ public override void PageAppearanceChanged([DisallowNull] KryptonPage page, [Dis
///
public override void UpdateStatePalettes()
{
- PaletteNavigator? paletteState;
+ PaletteNavigator paletteState;
PaletteNavigatorRedirect? paletteCommon;
// If whole navigator is disabled then all views are disabled
@@ -307,8 +318,8 @@ public override void UpdateStatePalettes()
}
// Update metrics from state common
- _layoutBar.SetMetrics(paletteCommon.Bar);
- _layoutBarViewport.SetMetrics(paletteCommon.Bar);
+ _layoutBar.SetMetrics(paletteCommon?.Bar);
+ _layoutBarViewport.SetMetrics(paletteCommon!.Bar);
_buttonManager?.SetDockerMetrics(_layoutBarDocker, paletteCommon.Bar);
@@ -696,7 +707,7 @@ protected virtual void CreateButtonSpecManager() =>
// Create button specification collection manager
_buttonManager = new ButtonSpecNavManagerLayoutBar(Navigator, Redirector, Navigator.Button.ButtonSpecs, Navigator.FixedSpecs,
new[] { _layoutBarDocker },
- new IPaletteMetric[] { Navigator.StateCommon.Bar },
+ new IPaletteMetric[] { Navigator.StateCommon!.Bar },
new[] { PaletteMetricInt.BarButtonEdgeInside },
new[] { PaletteMetricInt.BarButtonEdgeOutside },
new[] { PaletteMetricPadding.BarButtonPadding },
@@ -763,7 +774,7 @@ protected virtual INavCheckItem CreateCheckItem(KryptonPage? page,
///
/// Gets access to the collection of pages.
///
- protected PageToNavCheckItem PageLookup => _pageLookup;
+ protected PageToNavCheckItem? PageLookup => _pageLookup;
///
/// Update the bar orientation.
@@ -817,6 +828,7 @@ protected VisualOrientation ResolveButtonContentOrientation(VisualOrientation or
case VisualOrientation.Top:
case VisualOrientation.Bottom:
return VisualOrientation.Top;
+
case VisualOrientation.Left:
if (CommonHelper.GetRightToLeftLayout(Navigator) &&
(Navigator.RightToLeft == RightToLeft.Yes))
@@ -827,6 +839,7 @@ protected VisualOrientation ResolveButtonContentOrientation(VisualOrientation or
{
return VisualOrientation.Left;
}
+
case VisualOrientation.Right:
if (CommonHelper.GetRightToLeftLayout(Navigator) &&
(Navigator.RightToLeft == RightToLeft.Yes))
@@ -837,22 +850,30 @@ protected VisualOrientation ResolveButtonContentOrientation(VisualOrientation or
{
return VisualOrientation.Right;
}
+
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(orientation.ToString());
return VisualOrientation.Top;
}
+
case ButtonOrientation.FixedTop:
return VisualOrientation.Top;
+
case ButtonOrientation.FixedBottom:
return VisualOrientation.Bottom;
+
case ButtonOrientation.FixedLeft:
return VisualOrientation.Left;
+
case ButtonOrientation.FixedRight:
return VisualOrientation.Right;
+
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(Navigator.Bar.ItemOrientation.ToString());
return VisualOrientation.Top;
}
}
@@ -862,7 +883,7 @@ protected VisualOrientation ResolveButtonContentOrientation(VisualOrientation or
///
/// Source of the event.
/// Property changed details.
- protected override void OnViewBuilderPropertyChanged(object sender, PropertyChangedEventArgs e)
+ protected override void OnViewBuilderPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
switch (e.PropertyName)
{
@@ -980,7 +1001,7 @@ private void DestructNavCheckItems()
private void UpdateCheckItemStyle()
{
- Navigator.StateCommon.CheckButton.SetStyles(Navigator.Bar.CheckButtonStyle);
+ Navigator.StateCommon!.CheckButton.SetStyles(Navigator.Bar.CheckButtonStyle);
Navigator.OverrideFocus.CheckButton.SetStyles(Navigator.Bar.CheckButtonStyle);
// Update each individual button with the new style for remapping page level button specs
@@ -1016,7 +1037,7 @@ private void UpdateSelectedPageFocus()
if (Navigator.SelectedPage != null)
{
// We should have a view for representing the page
- if (_pageLookup.ContainsKey(Navigator.SelectedPage))
+ if (_pageLookup!.ContainsKey(Navigator.SelectedPage))
{
// Get the associated view element for the page
INavCheckItem checkItem = _pageLookup[Navigator.SelectedPage];
@@ -1033,7 +1054,7 @@ private void UpdateSelectedPageFocus()
private void DestructCheckButtons()
{
// Must tell each check button it is no longer required
- foreach (ViewBase child in _layoutBar)
+ foreach (var child in _layoutBar)
{
var checkItem = (INavCheckItem)child;
@@ -1050,7 +1071,7 @@ private void DestructCheckButtons()
_layoutBar.Clear();
// Remove all associations from the lookup dictionary
- _pageLookup.Clear();
+ _pageLookup?.Clear();
}
private void RefreshButtons()
@@ -1072,7 +1093,7 @@ private void BringPageIntoView()
ViewBase? viewPage = null;
// Make sure only the selected page is checked
- foreach (ViewBase child in _layoutBar)
+ foreach (var child in _layoutBar)
{
var checkItem = (INavCheckItem)child;
@@ -1094,7 +1115,7 @@ private void BringPageIntoView()
private bool BarHorizontal => Navigator.Bar.BarOrientation is VisualOrientation.Top or VisualOrientation.Bottom;
- private void OnItemPagesCleared(object sender, EventArgs e)
+ private void OnItemPagesCleared(object? sender, EventArgs e)
{
if (!Navigator.IsDisposed && (_events > 0))
{
@@ -1111,7 +1132,7 @@ private void OnItemPageRemoved(object sender, TypedCollectionEventArgs 0))
{
// Get the associated check button view element
- INavCheckItem checkItem = _pageLookup[e.Item];
+ INavCheckItem? checkItem = _pageLookup![e.Item!];
// Must unhook from events
checkItem.ButtonDragRectangle -= OnCheckButtonDragRect;
@@ -1125,14 +1146,14 @@ private void OnItemPageRemoved(object sender, TypedCollectionEventArgs e)
+ private void OnItemPageInserted(object? sender, TypedCollectionEventArgs e)
{
if (!Navigator.IsDisposed && (_events > 0))
{
@@ -1147,12 +1168,15 @@ private void OnItemPageInserted(object sender, TypedCollectionEventArgs UpdateStatePalettes();
+ private void OnNavigatorEnabledChanged(object? sender, EventArgs e) => UpdateStatePalettes();
- private void OnNavigatorRightToLeftChanged(object sender, EventArgs e) => UpdateItemOrientation();
+ private void OnNavigatorRightToLeftChanged(object? sender, EventArgs e) => UpdateItemOrientation();
- private void OnViewportAnimation(object sender, EventArgs e) => Navigator.PerformNeedPaint(true);
+ private void OnViewportAnimation(object? sender, EventArgs e) => Navigator.PerformNeedPaint(true);
- private void OnCheckButtonDragRect(object sender, ButtonDragRectangleEventArgs e)
+ private void OnCheckButtonDragRect(object? sender, ButtonDragRectangleEventArgs e)
{
// Cast incoming reference to the actual button view
- var reorderItem = (INavCheckItem)sender;
+ var reorderItem = sender as INavCheckItem;
- e.PreDragOffset = (Navigator.AllowPageReorder && reorderItem.Page.AreFlagsSet(KryptonPageFlags.AllowPageReorder));
- Rectangle dragRect = Rectangle.Union(e.DragRect, _layoutBarViewport.ClientRectangle);
+ if (reorderItem!.Page != null)
+ {
+ e.PreDragOffset = (Navigator.AllowPageReorder &&
+ reorderItem.Page.AreFlagsSet(KryptonPageFlags.AllowPageReorder));
+ }
+ var dragRect = Rectangle.Union(e.DragRect, _layoutBarViewport.ClientRectangle);
dragRect.Inflate(new Size(10, 10));
e.DragRect = dragRect;
}
- private void OnCheckButtonDragOffset(object sender, ButtonDragOffsetEventArgs e)
+ private void OnCheckButtonDragOffset(object? sender, ButtonDragOffsetEventArgs e)
{
// Cast incoming reference to the actual button view
- var reorderItem = (INavCheckItem)sender;
- ViewBase reorderView = reorderItem.View;
+ var reorderItem = sender as INavCheckItem ?? throw new ArgumentNullException(nameof(sender));
+ var reorderView = reorderItem.View;
// Scan the collection of children
var foundReorderView = false;
- VisualOrientation orientation = ConvertButtonBorderBackOrientation();
- foreach (ViewBase childView in Navigator.Pages.Select(page => (ViewBase)_pageLookup[page]))
+ var orientation = ConvertButtonBorderBackOrientation();
+ foreach (var childView in Navigator.Pages.Select(page => _pageLookup![page] as ViewBase))
{
- if (childView.ClientRectangle.Contains(e.PointOffset))
+ if (childView!.ClientRectangle.Contains(e.PointOffset))
{
// Only interested if mouse over a different check button
if (childView != reorderView)
{
- Rectangle childRect = childView.ClientRectangle;
+ var childRect = childView.ClientRectangle;
if (foundReorderView)
{
@@ -1216,19 +1244,19 @@ private void OnCheckButtonDragOffset(object sender, ButtonDragOffsetEventArgs e)
// ourself as the moved button. Otherwise we just end up toggling back and forth.
if (childRect.Contains(e.PointOffset))
{
- KryptonPage movePage = PageFromView(reorderView);
- KryptonPage targetPage = PageFromView(childView);
- var reorder = new PageReorderEventArgs(movePage, targetPage, false);
+ KryptonPage? movePage = PageFromView(reorderView);
+ KryptonPage? targetPage = PageFromView(childView);
+ var reorder = new PageReorderEventArgs(movePage!, targetPage!, false);
// Give event handlers a chance to cancel this reorder
Navigator.OnBeforePageReorder(reorder);
if (!reorder.Cancel)
{
- Navigator.Pages.MoveAfter(movePage, targetPage);
+ Navigator.Pages.MoveAfter(movePage!, targetPage!);
RecreateView();
Navigator.PerformLayout();
Navigator.Refresh();
- Navigator.OnTabMoved(new TabMovedEventArgs(movePage, Navigator.Pages.IndexOf(movePage)));
+ Navigator.OnTabMoved(new TabMovedEventArgs(movePage!, Navigator.Pages.IndexOf(movePage!)));
}
}
}
@@ -1247,19 +1275,19 @@ private void OnCheckButtonDragOffset(object sender, ButtonDragOffsetEventArgs e)
// ourself as the moved button. Otherwise we just end up toggling back and forth.
if (childRect.Contains(e.PointOffset))
{
- KryptonPage movePage = PageFromView(reorderView);
- KryptonPage targetPage = PageFromView(childView);
- var reorder = new PageReorderEventArgs(movePage, targetPage, true);
+ KryptonPage? movePage = PageFromView(reorderView);
+ KryptonPage? targetPage = PageFromView(childView);
+ var reorder = new PageReorderEventArgs(movePage!, targetPage!, true);
// Give event handlers a chance to cancel this reorder
Navigator.OnBeforePageReorder(reorder);
if (!reorder.Cancel)
{
- Navigator.Pages.MoveBefore(movePage, PageFromView(childView));
+ Navigator.Pages.MoveBefore(movePage!, PageFromView(childView)!);
RecreateView();
Navigator.PerformLayout();
Navigator.Refresh();
- Navigator.OnTabMoved(new TabMovedEventArgs(movePage, Navigator.Pages.IndexOf(movePage)));
+ Navigator.OnTabMoved(new TabMovedEventArgs(movePage!, Navigator.Pages.IndexOf(movePage!)));
}
}
}
@@ -1278,7 +1306,7 @@ private void RecreateView()
_layoutBar.Clear();
// Reorder the layout bar children to match the pages ordering
- foreach (INavCheckItem checkItem in Navigator.Pages.Select(page => _pageLookup[page]))
+ foreach (var checkItem in Navigator.Pages.Select(page => _pageLookup![page]))
{
_layoutBar.Add(checkItem.View);
}
diff --git a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderOutlookBase.cs b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderOutlookBase.cs
index a2a3db4a2..caa33e58f 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderOutlookBase.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderOutlookBase.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -55,7 +55,7 @@ public OutlookButtonSpecCollection(KryptonNavigator owner)
private ViewDrawBorderEdge _viewSeparatorEdge;
private ViewDrawSeparator _viewSeparator;
private ButtonSpecAny _specDropDown;
- private OutlookButtonSpecCollection _buttons;
+ private OutlookButtonSpecCollection? _buttons;
private ButtonSpecNavManagerLayoutBar? _buttonManager;
private PageToButtonEdge? _buttonEdgeLookup;
private SeparatorController _separatorController;
@@ -78,7 +78,7 @@ static ViewBuilderOutlookBase()
var myAssembly = Assembly.GetAssembly(typeof(ViewBuilderOutlookBase));
// Get the resource streams containing the images
- Stream? streamBlueUp = myAssembly.GetManifestResourceStream(@"Krypton.Navigator.Resources.BlueUp.bmp");
+ Stream? streamBlueUp = myAssembly!.GetManifestResourceStream(@"Krypton.Navigator.Resources.BlueUp.bmp");
Stream? streamBlueDown = myAssembly.GetManifestResourceStream(@"Krypton.Navigator.Resources.BlueDown.bmp");
// Load the bitmap from stream
@@ -282,13 +282,13 @@ public void SeparatorNotMoved()
/// Palette redirector.
public override void Construct([DisallowNull] KryptonNavigator navigator,
[DisallowNull] ViewManager manager,
- [DisallowNull] PaletteRedirect redirector)
+ PaletteRedirect redirector)
{
// Let base class perform common operations
base.Construct(navigator, manager, redirector);
// Get the current root element
- _oldRoot = ViewManager.Root as ViewLayoutPageShow;
+ _oldRoot = ViewManager?.Root as ViewLayoutPageShow;
// Create and initialize all objects
if (ViewManager != null)
@@ -413,10 +413,10 @@ public override void PageCollectionChanged()
public override void PageVisibleStateChanged(KryptonPage? page)
{
// Sometimes the routine is called before the views have been fully setup
- if ((_pageStackLookup != null) && _pageStackLookup.ContainsKey(page) &&
- (_pageOverflowLookup != null) && _pageOverflowLookup.ContainsKey(page))
+ if ((_pageStackLookup != null) && _pageStackLookup.ContainsKey(page!) &&
+ (_pageOverflowLookup != null) && _pageOverflowLookup.ContainsKey(page!))
{
- var showPageStack = page.LastVisibleSet && !page.AreFlagsSet(KryptonPageFlags.PageInOverflowBarForOutlookMode);
+ var showPageStack = page!.LastVisibleSet && !page.AreFlagsSet(KryptonPageFlags.PageInOverflowBarForOutlookMode);
var showPageOverflow = page.LastVisibleSet && !showPageStack;
// Reflect new state in the check button
@@ -448,10 +448,10 @@ public override void PageEnabledStateChanged(KryptonPage? page)
UpdateStatePalettes();
// Sometimes the routine is called before the views have been fully setup
- if ((_pageStackLookup != null) && _pageStackLookup.ContainsKey(page) &&
- (_pageOverflowLookup != null) && _pageOverflowLookup.ContainsKey(page))
+ if ((_pageStackLookup != null) && _pageStackLookup.ContainsKey(page!) &&
+ (_pageOverflowLookup != null) && _pageOverflowLookup.ContainsKey(page!))
{
- _pageStackLookup[page].Enabled = page.Enabled;
+ _pageStackLookup[page!].Enabled = page!.Enabled;
_pageOverflowLookup[page].Enabled = page.Enabled;
}
@@ -470,10 +470,21 @@ public override void PageEnabledStateChanged(KryptonPage? page)
///
/// Page that has changed.
/// Name of property that has changed.
- public override void PageAppearanceChanged([DisallowNull] KryptonPage page, [DisallowNull] string property)
+ public override void PageAppearanceChanged([DisallowNull] KryptonPage page,
+ [DisallowNull] string property)
{
- Debug.Assert(page != null);
- Debug.Assert(property != null);
+ Debug.Assert(page is not null);
+ Debug.Assert(property is not null);
+
+ if (page is null)
+ {
+ throw new ArgumentNullException(nameof(page));
+ }
+
+ if (property is null)
+ {
+ throw new ArgumentNullException(nameof(property));
+ }
// We are only interested if the page is visible
if (page is { LastVisibleSet: true })
@@ -520,7 +531,7 @@ public override void UpdateStatePalettes()
{
if (_buttonEdgeLookup != null)
{
- PaletteBorderEdge buttonEdge;
+ PaletteBorderEdge? buttonEdge;
// If whole navigator is disabled then all of view is disabled
var enabled = Navigator.Enabled;
@@ -530,10 +541,10 @@ public override void UpdateStatePalettes()
if (Navigator.SelectedPage == null)
{
// Then use the states defined in the navigator itself
- buttonEdge = Navigator.Enabled ? Navigator.StateNormal.BorderEdge : Navigator.StateDisabled.BorderEdge;
+ buttonEdge = Navigator.Enabled ? Navigator.StateNormal?.BorderEdge : Navigator.StateDisabled?.BorderEdge;
// Update the separator view to use the navigator state objects
- _viewSeparator.SetPalettes(Navigator.StateDisabled.Separator, Navigator.StateNormal.Separator,
+ _viewSeparator.SetPalettes(Navigator.StateDisabled!.Separator, Navigator.StateNormal!.Separator,
Navigator.StateTracking.Separator, Navigator.StatePressed.Separator,
Navigator.StateDisabled.Separator, Navigator.StateNormal.Separator,
Navigator.StateTracking.Separator, Navigator.StatePressed.Separator);
@@ -561,10 +572,10 @@ public override void UpdateStatePalettes()
}
// Update each of the border edge palettes
- foreach (ViewDrawBorderEdge view in _buttonEdgeLookup.Values)
+ foreach (var view in _buttonEdgeLookup.Values)
{
view.Enabled = checkEnabled;
- view.SetPalettes(buttonEdge);
+ view.SetPalettes(buttonEdge!);
}
// Update the main view elements
@@ -573,7 +584,7 @@ public override void UpdateStatePalettes()
// Update the fixed separator view elements
_viewSeparatorEdge.Enabled = enabled;
- _viewSeparatorEdge.SetPalettes(buttonEdge);
+ _viewSeparatorEdge.SetPalettes(buttonEdge!);
_viewSeparator.Enabled = enabled;
// Update palettes for the header group
@@ -595,7 +606,7 @@ public override void Destruct()
// Unhook from monitoring the pages collection
_events = false;
- Navigator.Pages.Inserted -= OnPageInserted!;
+ Navigator.Pages.Inserted -= OnPageInserted;
Navigator.Pages.Removed -= OnPageRemoved;
Navigator.Pages.Cleared -= OnPagesCleared;
@@ -604,13 +615,13 @@ public override void Destruct()
DestructOverflowCheckButtons();
// Reset the preferred direction handling to original setting
- _oldRoot.SetMinimumAsPreferred(false);
+ _oldRoot?.SetMinimumAsPreferred(false);
// Destruct the header group viewlet
_headerGroup.Destruct();
// Put the old root back again
- ViewManager.Root = _oldRoot;
+ ViewManager!.Root = _oldRoot!;
// Dispose of the cached context menu
if (_kcm != null)
@@ -1042,7 +1053,7 @@ public string GetOverflowButtonStates()
if (_pageOverflowLookup != null)
{
// There swill be an overflow button per krypton page
- foreach (KryptonPage page in Navigator.Pages)
+ foreach (var page in Navigator.Pages)
{
// Double check that it exists in the lookup
if (_pageOverflowLookup.ContainsKey(page))
@@ -1059,7 +1070,7 @@ public string GetOverflowButtonStates()
///
/// Remove any shrinkage that has caused stacking items to be hidden from view.
///
- public void UnshrinkAppropriatePages()
+ public void UnShrinkAppropriatePages()
{
// Sometimes the routine is called before the views have been fully setup
if ((_pageStackLookup != null) && (_pageOverflowLookup != null))
@@ -1067,21 +1078,21 @@ public void UnshrinkAppropriatePages()
// Make each visible krypton page have its check button and border edge visible unless
// that page has the 'PageInOverflowBarForOutlookMode' flag set in which case it has
// specifically requested to be placed on the overflow bar area.
- foreach (KryptonPage page in Navigator.Pages)
+ foreach (var page in Navigator.Pages)
{
- if (_pageStackLookup.ContainsKey(page))
+ if (_pageStackLookup.TryGetValue(page, out ViewDrawNavCheckButtonBase? value))
{
var showPageStack = page.LastVisibleSet && !page.AreFlagsSet(KryptonPageFlags.PageInOverflowBarForOutlookMode);
- _pageStackLookup[page].Visible = showPageStack;
+ value.Visible = showPageStack;
if (_buttonEdgeLookup != null)
{
_buttonEdgeLookup[page].Visible = showPageStack;
}
- if (_pageOverflowLookup.ContainsKey(page))
+ if (_pageOverflowLookup.TryGetValue(page, out ViewDrawNavCheckButtonBase? value1))
{
var showPageOverflow = page.LastVisibleSet && !showPageStack;
- _pageOverflowLookup[page].Visible = showPageOverflow;
+ value1.Visible = showPageOverflow;
}
}
}
@@ -1155,7 +1166,7 @@ public bool ShrinkVertical(int shrinkage)
protected virtual ViewBase CreateView()
{
// Set the initial preferred direction for the selected page
- _oldRoot.SetMinimumAsPreferred(!Navigator.AutoSize);
+ _oldRoot?.SetMinimumAsPreferred(!Navigator.AutoSize);
// Create the header group and fill with the view layout
_headerGroup = new ViewletHeaderGroupOutlook(Navigator, Redirector, NeedPaintDelegate);
@@ -1212,7 +1223,7 @@ protected virtual ViewBase CreateView()
/// ViewBase derived instance.
protected virtual void SetLayoutFiller(ViewLayoutDocker viewLayout) =>
// Put the old root as the filler inside stack elements
- viewLayout.Add(_oldRoot, ViewDockStyle.Fill);
+ viewLayout.Add(_oldRoot!, ViewDockStyle.Fill);
///
/// Create an overflow check button.
@@ -1234,7 +1245,7 @@ protected virtual ViewDrawNavOutlookOverflow CreateOverflowItem(KryptonPage? pag
};
// Can we show the page as an overflow item?
- var showPage = page.LastVisibleSet && _pageStackLookup?[page].Visible == false;
+ var showPage = page!.LastVisibleSet && _pageStackLookup?[page].Visible == false;
// Set the initial state
checkButton.Visible = showPage;
@@ -1258,7 +1269,7 @@ protected virtual void ReorderCheckButtonsOverflow(KryptonPage page,
ref int overflowInsertIndex)
{
// Check that an overflow view element exists for the page
- if (_pageOverflowLookup.ContainsKey(page))
+ if (_pageOverflowLookup!.ContainsKey(page))
{
// Get the associated view element
ViewDrawNavCheckButtonBase checkButton = _pageOverflowLookup[page];
@@ -1347,7 +1358,7 @@ protected virtual void BringPageIntoView(KryptonPage page)
///
/// Source of the event.
/// Property changed details.
- protected override void OnViewBuilderPropertyChanged(object sender, PropertyChangedEventArgs e)
+ protected override void OnViewBuilderPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
// Let the header group process the property
_headerGroup.ViewBuilderPropertyChanged(e);
@@ -1359,7 +1370,7 @@ protected override void OnViewBuilderPropertyChanged(object sender, PropertyChan
Navigator.PerformNeedPaint(true);
break;
case @"BorderEdgeStyleOutlook":
- Navigator.StateCommon.BorderEdgeStyle = Navigator.Outlook.BorderEdgeStyle;
+ Navigator.StateCommon!.BorderEdgeStyle = Navigator.Outlook.BorderEdgeStyle;
Navigator.PerformNeedPaint(true);
break;
case @"CheckButtonStyleOutlook":
@@ -1379,7 +1390,7 @@ protected override void OnViewBuilderPropertyChanged(object sender, PropertyChan
break;
case @"OrientationOutlook":
// We only use minimum values if not calculating based on auto sizing
- _oldRoot.SetMinimumAsPreferred(!Navigator.AutoSize);
+ _oldRoot!.SetMinimumAsPreferred(!Navigator.AutoSize);
_specDropDown.Orientation = (Navigator.Outlook.Orientation == Orientation.Vertical ? PaletteButtonOrientation.FixedTop : PaletteButtonOrientation.FixedLeft);
_viewOverflowBar.Orientation = (Navigator.Outlook.Orientation == Orientation.Vertical ? VisualOrientation.Top : VisualOrientation.Left);
_viewOverflowLayout.Orientation = (Navigator.Outlook.Orientation == Orientation.Vertical ? VisualOrientation.Top : VisualOrientation.Left);
@@ -1415,7 +1426,7 @@ protected virtual void UpdateSelectedPageFocus()
if (Navigator.SelectedPage != null)
{
// We should have a stack view for the page
- if (_pageStackLookup.ContainsKey(Navigator.SelectedPage))
+ if (_pageStackLookup!.ContainsKey(Navigator.SelectedPage))
{
// Get the associated view element for the page
ViewDrawNavCheckButtonBase checkButton = _pageStackLookup[Navigator.SelectedPage];
@@ -1428,7 +1439,7 @@ protected virtual void UpdateSelectedPageFocus()
}
// We should have an overflow view for the page
- if (_pageOverflowLookup.ContainsKey(Navigator.SelectedPage))
+ if (_pageOverflowLookup!.ContainsKey(Navigator.SelectedPage))
{
// Get the associated view element for the page
ViewDrawNavCheckButtonBase checkButton = _pageOverflowLookup[Navigator.SelectedPage];
@@ -1742,7 +1753,7 @@ private void CreateButtonManager()
// Create button specification collection manager
_buttonManager = new ButtonSpecNavManagerLayoutBar(Navigator, Redirector, _buttons,
new[] { _viewOverflowLayout },
- new IPaletteMetric[] { Navigator.StateCommon.Bar },
+ new IPaletteMetric[] { Navigator.StateCommon!.Bar },
new[] { PaletteMetricInt.HeaderButtonEdgeInsetInputControl },
new[] { PaletteMetricInt.HeaderButtonEdgeInsetInputControl },
new[] { PaletteMetricPadding.None },
@@ -1864,7 +1875,7 @@ private void OnPageInserted(object sender, TypedCollectionEventArgs
// Can we show the page as a stacking item?
var showPageStack = e.Item is { LastVisibleSet: true } && !e.Item.AreFlagsSet(KryptonPageFlags.PageInOverflowBarForOutlookMode);
- var showPageOverflow = e.Item.LastVisibleSet && !showPageStack;
+ var showPageOverflow = e.Item!.LastVisibleSet && !showPageStack;
// Set the initial state
checkButtonStack.Visible = showPageStack;
@@ -1905,17 +1916,17 @@ private void OnPageRemoved(object sender, TypedCollectionEventArgs
)
{
// Get the associated check button view element
- ViewDrawNavCheckButtonBase? checkButtonStack = _pageStackLookup?[e.Item];
- ViewDrawNavCheckButtonBase? checkButtonOverflow = _pageOverflowLookup?[e.Item];
- ViewDrawBorderEdge? buttonEdge = _buttonEdgeLookup?[e.Item];
+ var checkButtonStack = _pageStackLookup?[e.Item];
+ var checkButtonOverflow = _pageOverflowLookup?[e.Item];
+ var buttonEdge = _buttonEdgeLookup?[e.Item];
// Remove event hooks
- checkButtonStack.ButtonDragRectangle -= OnCheckButtonDragRect;
+ checkButtonStack!.ButtonDragRectangle -= OnCheckButtonDragRect;
checkButtonStack.ButtonDragOffset -= OnCheckButtonDragOffset;
// Remove the paint delegate so objects can be garbage collected
checkButtonStack.NeedPaint = null;
- checkButtonOverflow.NeedPaint = null;
+ checkButtonOverflow!.NeedPaint = null;
// Remove the overflow entry, if it exists
if (_viewOverflowLayout.Contains(checkButtonOverflow))
@@ -1930,12 +1941,12 @@ private void OnPageRemoved(object sender, TypedCollectionEventArgs
// Tell the views they are no longer required
checkButtonStack.Dispose();
checkButtonOverflow.Dispose();
- buttonEdge.Dispose();
+ buttonEdge?.Dispose();
- // Remove associations from the lookup dictionarys
- _pageStackLookup.Remove(e.Item);
- _pageOverflowLookup.Remove(e.Item);
- _buttonEdgeLookup.Remove(e.Item);
+ // Remove associations from the lookup dictionaries
+ _pageStackLookup?.Remove(e.Item);
+ _pageOverflowLookup?.Remove(e.Item);
+ _buttonEdgeLookup?.Remove(e.Item);
// Set correct ordering and dock setting
ReorderCheckButtons();
@@ -1945,7 +1956,7 @@ private void OnPageRemoved(object sender, TypedCollectionEventArgs
}
}
- private void OnPagesCleared(object sender, EventArgs e)
+ private void OnPagesCleared(object? sender, EventArgs e)
{
if (!Navigator.IsDisposed && _events)
{
@@ -1999,11 +2010,11 @@ private void ReorderCheckButtons()
foreach (KryptonPage page in Navigator.Pages)
{
// Check that a stacking view element exists for the page
- if (_pageStackLookup.ContainsKey(page))
+ if (_pageStackLookup!.ContainsKey(page))
{
// Get the associated view elements
- ViewDrawNavCheckButtonBase checkButton = _pageStackLookup[page];
- ViewDrawBorderEdge buttonEdge = _buttonEdgeLookup[page];
+ var checkButton = _pageStackLookup[page];
+ var buttonEdge = _buttonEdgeLookup![page];
// Update checked state of the button
checkButton.Checked = (Navigator.SelectedPage == page);
@@ -2034,17 +2045,23 @@ private VisualOrientation ResolveStackButtonOrientation()
return Navigator.Outlook.Orientation == Orientation.Vertical
? VisualOrientation.Top
: VisualOrientation.Left;
+
case ButtonOrientation.FixedTop:
return VisualOrientation.Top;
+
case ButtonOrientation.FixedBottom:
return VisualOrientation.Bottom;
+
case ButtonOrientation.FixedLeft:
return VisualOrientation.Left;
+
case ButtonOrientation.FixedRight:
return VisualOrientation.Right;
+
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(Navigator.Outlook.ItemOrientation.ToString());
return VisualOrientation.Top;
}
}
@@ -2063,22 +2080,22 @@ private VisualOrientation ResolveOverflowButtonOrientation() =>
private bool PageInTheStack(KryptonPage page)
{
// Get the overflow check button for the page
- var checkButton = (ViewDrawNavOutlookOverflow)_pageOverflowLookup[page];
+ var checkButton = _pageOverflowLookup![page] as ViewDrawNavOutlookOverflow;
// If not visible on the overflow bar then must be in the stack
- return !checkButton.Visible;
+ return !checkButton!.Visible;
}
- private void OnEnabledChanged(object sender, EventArgs e)
+ private void OnEnabledChanged(object? sender, EventArgs e)
{
UpdateStatePalettes();
Navigator.PerformLayout();
Navigator.Invalidate();
}
- private void OnAutoSizeChanged(object sender, EventArgs e) =>
+ private void OnAutoSizeChanged(object? sender, EventArgs e) =>
// Only use minimum instead of preferred if not using AutoSize
- _oldRoot.SetMinimumAsPreferred(!Navigator.AutoSize);
+ _oldRoot?.SetMinimumAsPreferred(!Navigator.AutoSize);
private void OnViewportAnimation(object sender, EventArgs e) => Navigator.PerformNeedPaint(true);
@@ -2088,7 +2105,7 @@ private bool AreFewerButtons()
return _viewLayout.Any(child => child.Visible && (child is ViewDrawNavOutlookStack));
}
- private void OnDropDownClick(object sender, EventArgs e)
+ private void OnDropDownClick(object? sender, EventArgs e)
{
if (!Navigator.InternalDesignMode)
{
@@ -2112,11 +2129,11 @@ private void OnDropDownClick(object sender, EventArgs e)
fewerButtons.Enabled = AreFewerButtons();
// Add items into the context menu
- _kcm.Items.Add(new KryptonContextMenuItems(new KryptonContextMenuItemBase[] { moreButtons, fewerButtons, addRemoveButtons }));
+ _kcm?.Items.Add(new KryptonContextMenuItems(new KryptonContextMenuItemBase[] { moreButtons, fewerButtons, addRemoveButtons }));
// Add each page into the 'Add/Remove' item
var visibleAddRemove = 0;
- foreach (KryptonPage page in Navigator.Pages)
+ foreach (var page in Navigator.Pages)
{
// Create a menu item for the page
var pageMenuItem = new KryptonContextMenuItem(page.GetTextMapping(Navigator.Button.ContextMenuMapText),
@@ -2142,20 +2159,20 @@ private void OnDropDownClick(object sender, EventArgs e)
addRemoveButtons.Enabled = (visibleAddRemove > 0);
// Get the display rectangle of the drop down button
- Rectangle rect = _buttonManager.GetButtonRectangle(_specDropDown);
+ Rectangle rect = _buttonManager!.GetButtonRectangle(_specDropDown);
// Convert to screen coordinates
Point pt = Navigator.PointToScreen(new Point(rect.Right + 3, rect.Top));
// Let user modify the context menu before it is shown
- Navigator.OnOutlookDropDown(_kcm);
+ Navigator.OnOutlookDropDown(_kcm!);
// Give user a chance to select an item
- _kcm.Show(pt);
+ _kcm?.Show(pt);
}
}
- private void OnShowMoreClick(object sender, EventArgs e)
+ private void OnShowMoreClick(object? sender, EventArgs e)
{
// Cast to correct type
ViewDrawNavOutlookOverflow? checkButton = GetMoreOverflow();
@@ -2178,7 +2195,7 @@ private void OnShowMoreClick(object sender, EventArgs e)
}
}
- private void OnShowFewerClick(object sender, EventArgs e)
+ private void OnShowFewerClick(object? sender, EventArgs e)
{
// Find the last visible button on the stack bar
foreach (ViewBase child in _viewLayout.Reverse())
@@ -2206,7 +2223,7 @@ private void OnShowFewerClick(object sender, EventArgs e)
PerformNeedPaint(true);
}
- private void OnPageAddRemoveClick(object sender, EventArgs e)
+ private void OnPageAddRemoveClick(object? sender, EventArgs e)
{
// Cast to correct type
var menuItem = sender as KryptonContextMenuItem;
@@ -2229,12 +2246,12 @@ private void ResetCachedKryptonContextMenu()
_kcm.Items.Clear();
}
- private void OnCheckButtonDragRect(object sender, ButtonDragRectangleEventArgs e)
+ private void OnCheckButtonDragRect(object? sender, ButtonDragRectangleEventArgs e)
{
// Cast incoming reference to the actual check button view
- var reorderItem = (ViewDrawNavOutlookStack)sender;
+ var reorderItem = sender as ViewDrawNavOutlookStack ?? throw new ArgumentNullException(nameof(sender));
- e.PreDragOffset = (Navigator.AllowPageReorder && reorderItem.Page.AreFlagsSet(KryptonPageFlags.AllowPageReorder));
+ e.PreDragOffset = (Navigator.AllowPageReorder && reorderItem.Page!.AreFlagsSet(KryptonPageFlags.AllowPageReorder));
Rectangle dragRect = Rectangle.Union(e.DragRect, _viewLayout.ClientRectangle);
dragRect.Inflate(new Size(10, 10));
e.DragRect = dragRect;
@@ -2252,18 +2269,18 @@ private void OnCheckButtonDragRect(object sender, ButtonDragRectangleEventArgs e
}
}
- private void OnCheckButtonDragOffset(object sender, ButtonDragOffsetEventArgs e)
+ private void OnCheckButtonDragOffset(object? sender, ButtonDragOffsetEventArgs e)
{
// Cast incoming reference to the actual check button view
- var reorderView = (ViewDrawNavOutlookStack)sender;
+ var reorderView = sender as ViewDrawNavOutlookStack;
// Scan the collection of children
var foundReorderView = false;
foreach (KryptonPage page in Navigator.Pages)
{
// If the mouse is over this button
- var childView = (ViewDrawNavOutlookStack)_pageStackLookup[page];
- if (childView.Visible && childView.ClientRectangle.Contains(e.PointOffset))
+ var childView = _pageStackLookup![page] as ViewDrawNavOutlookStack;
+ if (childView!.Visible && childView.ClientRectangle.Contains(e.PointOffset))
{
// Only interested if mouse over a different check button
if (childView != reorderView)
@@ -2274,13 +2291,13 @@ private void OnCheckButtonDragOffset(object sender, ButtonDragOffsetEventArgs e)
{
if (SeparatorOrientation == Orientation.Horizontal)
{
- var shrink = childRect.Height - Math.Min(childRect.Height, reorderView.ClientHeight);
+ var shrink = childRect.Height - Math.Min(childRect.Height, reorderView!.ClientHeight);
childRect.Y += shrink;
childRect.Height -= shrink;
}
else
{
- var shrink = childRect.Width - Math.Min(childRect.Width, reorderView.ClientWidth);
+ var shrink = childRect.Width - Math.Min(childRect.Width, reorderView!.ClientWidth);
childRect.X += shrink;
childRect.Width -= shrink;
}
@@ -2291,17 +2308,17 @@ private void OnCheckButtonDragOffset(object sender, ButtonDragOffsetEventArgs e)
{
KryptonPage? movePage = PageFromView(reorderView);
KryptonPage? targetPage = PageFromView(childView);
- var reorder = new PageReorderEventArgs(movePage, targetPage, false);
+ var reorder = new PageReorderEventArgs(movePage!, targetPage!, false);
// Give event handlers a chance to cancel this reorder
Navigator.OnBeforePageReorder(reorder);
if (!reorder.Cancel)
{
- Navigator.Pages.MoveAfter(movePage, PageFromView(childView));
+ Navigator.Pages.MoveAfter(movePage!, PageFromView(childView)!);
RecreateView();
Navigator.PerformLayout();
Navigator.Refresh();
- Navigator.OnTabMoved(new TabMovedEventArgs(movePage, Navigator.Pages.IndexOf(movePage)));
+ Navigator.OnTabMoved(new TabMovedEventArgs(movePage!, Navigator.Pages.IndexOf(movePage!)));
}
}
}
@@ -2309,11 +2326,11 @@ private void OnCheckButtonDragOffset(object sender, ButtonDragOffsetEventArgs e)
{
if (SeparatorOrientation == Orientation.Horizontal)
{
- childRect.Height = Math.Min(childRect.Height, reorderView.ClientHeight);
+ childRect.Height = Math.Min(childRect.Height, reorderView!.ClientHeight);
}
else
{
- childRect.Width = Math.Min(childRect.Width, reorderView.ClientWidth);
+ childRect.Width = Math.Min(childRect.Width, reorderView!.ClientWidth);
}
// Ensure that when we are placed in the 'before' position the mouse is still over
@@ -2322,17 +2339,17 @@ private void OnCheckButtonDragOffset(object sender, ButtonDragOffsetEventArgs e)
{
KryptonPage? movePage = PageFromView(reorderView);
KryptonPage? targetPage = PageFromView(childView);
- var reorder = new PageReorderEventArgs(movePage, targetPage, true);
+ var reorder = new PageReorderEventArgs(movePage!, targetPage!, true);
// Give event handlers a chance to cancel this reorder
Navigator.OnBeforePageReorder(reorder);
if (!reorder.Cancel)
{
- Navigator.Pages.MoveBefore(movePage, PageFromView(childView));
+ Navigator.Pages.MoveBefore(movePage!, PageFromView(childView)!);
RecreateView();
Navigator.PerformLayout();
Navigator.Refresh();
- Navigator.OnTabMoved(new TabMovedEventArgs(movePage, Navigator.Pages.IndexOf(movePage)));
+ Navigator.OnTabMoved(new TabMovedEventArgs(movePage!, Navigator.Pages.IndexOf(movePage!)));
}
}
}
@@ -2364,8 +2381,15 @@ private void RecreateView()
ViewDrawBorderEdge? buttonEdge = _buttonEdgeLookup?[page];
// Add to the end of the collection
- if (buttonEdge != null) _viewLayout.Add(buttonEdge, dockFar);
- if (checkButton != null) _viewLayout.Add(checkButton, dockFar);
+ if (buttonEdge != null)
+ {
+ _viewLayout.Add(buttonEdge, dockFar);
+ }
+
+ if (checkButton != null)
+ {
+ _viewLayout.Add(checkButton, dockFar);
+ }
}
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderOutlookFull.cs b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderOutlookFull.cs
index 96a856905..95b30a4aa 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderOutlookFull.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderOutlookFull.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -25,12 +25,12 @@ internal class ViewBuilderOutlookFull : ViewBuilderOutlookBase
///
/// Gets the top level control of the source.
///
- public override Control SeparatorControl => _viewOutlook.ViewControl.ChildControl;
+ public override Control SeparatorControl => _viewOutlook.ViewControl.ChildControl!;
///
/// Gets the box representing the minimum and maximum allowed splitter movement.
///
- public override Rectangle SeparatorMoveBox => _viewOutlook.ViewControl.ChildControl.ClientRectangle;
+ public override Rectangle SeparatorMoveBox => _viewOutlook.ViewControl.ChildControl!.ClientRectangle;
///
/// Gets a value indicating if the mode is a tab strip style mode.
@@ -46,7 +46,7 @@ public override void SelectedPageChanged()
if (Navigator.SelectedPage != null)
{
// We should have a view for representing the page
- if (_pageStackLookup.ContainsKey(Navigator.SelectedPage))
+ if (_pageStackLookup!.ContainsKey(Navigator.SelectedPage))
{
// Get the check button used to represent the selected page
ViewDrawNavCheckButtonBase selected = _pageStackLookup[Navigator.SelectedPage];
@@ -113,10 +113,10 @@ public override bool DesignerGetHitTest(Point pt)
if (_viewOutlook.ClientRectangle.Contains(pt))
{
// Get the control that owns the view layout
- Control owningControl = _viewLayout.OwningControl;
+ Control? owningControl = _viewLayout.OwningControl;
// Convert incoming point from navigator to owning control
- pt = owningControl.PointToClient(Navigator.PointToScreen(pt));
+ pt = owningControl!.PointToClient(Navigator.PointToScreen(pt));
// Check if any of the stack check buttons want the point
foreach (ViewBase item in _viewLayout)
@@ -155,7 +155,7 @@ public override void Destruct()
_viewOutlook.AnimateStep -= OnViewportAnimation;
// Put the child panel back into the navigator
- _viewOutlook.RevertParent(Navigator, Navigator.ChildPanel);
+ _viewOutlook.RevertParent(Navigator, Navigator.ChildPanel!);
// Let base class perform common operations
base.Destruct();
@@ -164,7 +164,7 @@ public override void Destruct()
#region Protected
///
- /// Creates and returns the view element that laysout the main client area.
+ /// Creates and returns the view element that layout the main client area.
///
///
protected override ViewBase CreateMainLayout()
@@ -185,7 +185,7 @@ protected override ViewBase CreateMainLayout()
(Navigator.Outlook.Orientation == Orientation.Vertical), NeedPaintDelegate);
// Reparent the child panel that contains the actual pages, into the child control
- _viewOutlook.MakeParent(Navigator.ChildPanel);
+ _viewOutlook.MakeParent(Navigator.ChildPanel!);
return _viewOutlook;
}
@@ -197,7 +197,7 @@ protected override ViewBase CreateMainLayout()
/// Orientation of the check button.
/// Docking position of the check button.
///
- protected override ViewDrawNavOutlookOverflow CreateOverflowItem(KryptonPage? page,
+ protected override ViewDrawNavOutlookOverflow CreateOverflowItem(KryptonPage? page,
VisualOrientation checkButtonOrient,
ViewDockStyle dockFar)
{
@@ -230,7 +230,7 @@ protected override void BringPageIntoView(KryptonPage page)
ViewDrawNavCheckButtonBase? viewPage = null;
// Make sure only the selected page is checked
- foreach (ViewDrawNavCheckButtonBase child in _pageStackLookup.Values)
+ foreach (ViewDrawNavCheckButtonBase child in _pageStackLookup!.Values)
{
// Should this check button be selected
if (Navigator.SelectedPage == child.Page)
@@ -253,7 +253,7 @@ protected override void BringPageIntoView(KryptonPage page)
///
/// Source of the event.
/// Property changed details.
- protected override void OnViewBuilderPropertyChanged(object sender, PropertyChangedEventArgs e)
+ protected override void OnViewBuilderPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
switch (e.PropertyName)
{
@@ -268,7 +268,7 @@ protected override void OnViewBuilderPropertyChanged(object sender, PropertyChan
#endregion
#region Implementation
- private void OnViewportAnimation(object sender, EventArgs e) => Navigator.PerformNeedPaint(true);
+ private void OnViewportAnimation(object? sender, EventArgs e) => Navigator.PerformNeedPaint(true);
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderOutlookMini.cs b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderOutlookMini.cs
index 0457fe06f..e23395485 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderOutlookMini.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderOutlookMini.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -89,7 +89,7 @@ public override bool ProcessDialogKey(Keys keyData)
_selectedButton.HasFocus = false;
// We should have a stack view for the page
- if (_pageStackLookup.ContainsKey(Navigator.SelectedPage))
+ if (_pageStackLookup!.ContainsKey(Navigator.SelectedPage))
{
// Get the associated view element for the page
ViewDrawNavCheckButtonBase checkButton = _pageStackLookup[Navigator.SelectedPage];
@@ -118,7 +118,7 @@ public override bool ProcessDialogKey(Keys keyData)
if (Navigator.SelectedPage != null)
{
// We should have a stack view for the page
- if (_pageStackLookup.ContainsKey(Navigator.SelectedPage))
+ if (_pageStackLookup!.ContainsKey(Navigator.SelectedPage))
{
// Get the associated view element for the page
ViewDrawNavCheckButtonBase checkButton = _pageStackLookup[Navigator.SelectedPage];
@@ -239,7 +239,7 @@ protected override bool AreMoreButtons()
{
if (page.LastVisibleSet && page.AreFlagsSet(KryptonPageFlags.PageInOverflowBarForOutlookMode))
{
- return (ViewDrawNavOutlookOverflow)_pageOverflowLookup[page];
+ return _pageOverflowLookup![page] as ViewDrawNavOutlookOverflow;
}
}
@@ -277,7 +277,7 @@ protected override void UpdateSelectedPageFocus()
if (Navigator.SelectedPage != null)
{
// We should have a stack view for the page
- if (_pageStackLookup.ContainsKey(Navigator.SelectedPage))
+ if (_pageStackLookup!.ContainsKey(Navigator.SelectedPage))
{
// Get the associated view element for the page
ViewDrawNavCheckButtonBase checkButton = _pageStackLookup[Navigator.SelectedPage];
@@ -298,7 +298,7 @@ protected override void UpdateSelectedPageFocus()
///
/// Source of the event.
/// Property changed details.
- protected override void OnViewBuilderPropertyChanged(object sender, PropertyChangedEventArgs e)
+ protected override void OnViewBuilderPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
switch (e.PropertyName)
{
diff --git a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderPanel.cs b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderPanel.cs
index 2dc774e38..c82bb2554 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderPanel.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderPanel.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -18,7 +18,7 @@ namespace Krypton.Navigator
internal class ViewBuilderPanel : ViewBuilderBase
{
#region Instance Fields
- private ViewBase? _oldRoot;
+ private ViewBase _oldRoot;
private ViewDrawPanel _drawPanel;
#endregion
@@ -31,7 +31,7 @@ internal class ViewBuilderPanel : ViewBuilderBase
/// Palette redirector.
public override void Construct([DisallowNull] KryptonNavigator navigator,
[DisallowNull] ViewManager manager,
- [DisallowNull] PaletteRedirect? redirector)
+ PaletteRedirect redirector)
{
// Let base class perform common operations
if (redirector != null)
@@ -40,14 +40,14 @@ public override void Construct([DisallowNull] KryptonNavigator navigator,
}
// Get the current root element
- _oldRoot = ViewManager.Root;
+ _oldRoot = ViewManager!.Root;
// Create a canvas for the background
if (_oldRoot != null)
{
_drawPanel = new ViewDrawPanel(Navigator.StateNormal?.Back!)
{
- // Put the exisint root into the canvas
+ // Put the existing root into the canvas
_oldRoot
};
}
@@ -119,18 +119,18 @@ public override void UpdateStatePalettes()
if (Navigator.SelectedPage == null)
{
// Then use the state defined in the navigator itself
- back = (Navigator.Enabled ? Navigator.StateNormal?.Back : Navigator.StateDisabled!.Back)!;
+ back = (Navigator.Enabled ? Navigator.StateNormal?.Back : Navigator.StateDisabled.Back)!;
}
else
{
// Use state defined in the selected page
if (Navigator.SelectedPage.Enabled)
{
- back = Navigator.SelectedPage.StateNormal!.Back;
+ back = Navigator.SelectedPage.StateNormal.Back;
}
else
{
- back = Navigator.SelectedPage.StateDisabled!.Back;
+ back = Navigator.SelectedPage.StateDisabled.Back;
// If page is disabled then all of view should look disabled
enabled = false;
@@ -169,7 +169,7 @@ public override void Destruct()
_drawPanel.Clear();
// Put the old root back again
- ViewManager.Root = _oldRoot;
+ ViewManager!.Root = _oldRoot;
// Let base class perform common operations
base.Destruct();
@@ -182,7 +182,7 @@ public override void Destruct()
///
/// Source of the event.
/// Property changed details.
- protected override void OnViewBuilderPropertyChanged(object sender, PropertyChangedEventArgs e)
+ protected override void OnViewBuilderPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
switch (e.PropertyName)
{
@@ -194,7 +194,7 @@ protected override void OnViewBuilderPropertyChanged(object sender, PropertyChan
case @"GroupBackStyle":
if (Navigator.StateCommon != null)
{
- Navigator.StateCommon.HeaderGroup!.BackStyle = Navigator.Group.GroupBackStyle;
+ Navigator.StateCommon.HeaderGroup.BackStyle = Navigator.Group.GroupBackStyle;
}
Navigator.PerformNeedPaint(true);
break;
@@ -207,7 +207,7 @@ protected override void OnViewBuilderPropertyChanged(object sender, PropertyChan
#endregion
#region Implementation
- private void OnEnabledChanged(object sender, EventArgs e) => UpdateStatePalettes();
+ private void OnEnabledChanged(object? sender, EventArgs e) => UpdateStatePalettes();
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderStackCheckButtonBase.cs b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderStackCheckButtonBase.cs
index 00f3d1be6..724a0f440 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderStackCheckButtonBase.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderStackCheckButtonBase.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,7 +20,7 @@ internal abstract class ViewBuilderStackCheckButtonBase : ViewBuilderBase
#region Type Definitons
protected class PageToButtonEdge : Dictionary { }
#endregion
-
+
#region Instance Fields
protected ViewLayoutPageShow _oldRoot;
protected ViewLayoutDocker _viewLayout;
@@ -38,18 +38,18 @@ protected class PageToButtonEdge : Dictionary {
/// Reference to navigator instance.
/// Reference to current manager.
/// Palette redirector.
- public override void Construct([DisallowNull] KryptonNavigator navigator,
+ public override void Construct([DisallowNull] KryptonNavigator navigator,
[DisallowNull] ViewManager manager,
- [DisallowNull] PaletteRedirect redirector)
+ PaletteRedirect redirector)
{
// Let base class perform common operations
base.Construct(navigator, manager, redirector);
// Get the current root element
- _oldRoot = (ViewLayoutPageShow)ViewManager.Root;
+ _oldRoot = ViewManager!.Root as ViewLayoutPageShow ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(ViewManager.Root)));
// Create and initialize all objects
- ViewManager.Root = CreateStackCheckButtonView();
+ ViewManager.Root = CreateStackCheckButtonView()!;
CreateNavCheckButtons();
UpdateCheckButtonStyle();
PostConstruct();
@@ -106,12 +106,12 @@ public override void SelectedPageChanged()
if (Navigator.SelectedPage != null)
{
// We should have a view for representing the page
- if (_pageLookup.ContainsKey(Navigator.SelectedPage))
+ if (_pageLookup!.ContainsKey(Navigator.SelectedPage))
{
// Get the check button used to represent the selected page
ViewDrawNavCheckButtonBase selected = _pageLookup[Navigator.SelectedPage];
- // Make sure the layout is upto date
+ // Make sure the layout is up-to date
Navigator.CheckPerformLayout();
// Get the client rectangle of the check button
@@ -140,10 +140,10 @@ public override void PageVisibleStateChanged(KryptonPage? page)
{
// Sometimes the page is noticed as changed in visibility before the
// page has been processed and has a view added, so need to check lookup
- if (_pageLookup.ContainsKey(page))
+ if (_pageLookup.ContainsKey(page!))
{
// Reflect new state in the check button
- _pageLookup[page].Visible = page.LastVisibleSet;
+ _pageLookup[page!].Visible = page!.LastVisibleSet;
_buttonEdgeLookup[page].Visible = page.LastVisibleSet;
// Need to repaint to show the change
@@ -165,11 +165,11 @@ public override void PageEnabledStateChanged(KryptonPage? page)
{
// Sometimes the page is noticed as changed in enabled state before the
// page has been processed and has a view added, so need to check lookup
- if (_pageLookup.ContainsKey(page))
+ if (_pageLookup.ContainsKey(page!))
{
// Reflect new state in the check button
UpdateStatePalettes();
- _pageLookup[page].Enabled = page.Enabled;
+ _pageLookup[page!].Enabled = page!.Enabled;
// Need to repaint to show the change
Navigator.PerformNeedPaint(true);
@@ -185,10 +185,21 @@ public override void PageEnabledStateChanged(KryptonPage? page)
///
/// Page that has changed.
/// Name of property that has changed.
- public override void PageAppearanceChanged([DisallowNull] KryptonPage page, [DisallowNull] string property)
+ public override void PageAppearanceChanged([DisallowNull] KryptonPage page,
+ [DisallowNull] string property)
{
- Debug.Assert(page != null);
- Debug.Assert(property != null);
+ Debug.Assert(page is not null);
+ Debug.Assert(property is not null);
+
+ if (page is null)
+ {
+ throw new ArgumentNullException(nameof(page));
+ }
+
+ if (property is null)
+ {
+ throw new ArgumentNullException(nameof(property));
+ }
// We are only interested if the page is visible
if (page.LastVisibleSet)
@@ -277,7 +288,7 @@ public override void Destruct()
DestructStackCheckButtonView();
// Put the old root back again
- ViewManager.Root = _oldRoot;
+ ViewManager!.Root = _oldRoot;
// Let base class perform common operations
base.Destruct();
@@ -484,10 +495,10 @@ public override bool DesignerGetHitTest(Point pt)
if (_viewScrollViewport.ClientRectangle.Contains(pt))
{
// Get the control that owns the view layout
- Control owningControl = _viewLayout.OwningControl;
+ Control? owningControl = _viewLayout.OwningControl;
// Convert incoming point from navigator to owning control
- pt = owningControl.PointToClient(Navigator.PointToScreen(pt));
+ pt = owningControl!.PointToClient(Navigator.PointToScreen(pt));
// Check if any of the stack check buttons want the point
foreach (ViewBase item in _viewLayout)
@@ -543,12 +554,12 @@ protected virtual void PostConstruct()
///
/// Source of the event.
/// Property changed details.
- protected override void OnViewBuilderPropertyChanged(object sender, PropertyChangedEventArgs e)
+ protected override void OnViewBuilderPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
switch (e.PropertyName)
{
case @"BorderEdgeStyleStack":
- Navigator.StateCommon.BorderEdgeStyle = Navigator.Stack.BorderEdgeStyle;
+ Navigator.StateCommon!.BorderEdgeStyle = Navigator.Stack.BorderEdgeStyle;
Navigator.PerformNeedPaint(true);
break;
case @"CheckButtonStyleStack":
@@ -598,7 +609,7 @@ private void CreateNavCheckButtons()
ViewDockStyle dockFar = (stackOrient == Orientation.Vertical ? ViewDockStyle.Bottom : ViewDockStyle.Right);
// Cache the border edge palette to use
- PaletteBorderEdge buttonEdgePalette = (Navigator.Enabled ? Navigator.StateNormal.BorderEdge :
+ PaletteBorderEdge buttonEdgePalette = (Navigator.Enabled ? Navigator.StateNormal.BorderEdge :
Navigator.StateDisabled.BorderEdge);
// Start stacking from the top/left if not explicitly set to be far aligned
@@ -677,7 +688,7 @@ private void DestructNavCheckButtons()
private void DestructCheckButtons()
{
// Must tell each check button it is no longer required
- foreach (ViewDrawNavCheckButtonBase checkButton in _pageLookup.Values)
+ foreach (ViewDrawNavCheckButtonBase checkButton in _pageLookup!.Values)
{
// Must unhook from events
checkButton.ButtonDragRectangle -= OnCheckButtonDragRect;
@@ -701,14 +712,14 @@ private void DestructCheckButtons()
_viewLayout.Remove(buttonEdge);
}
- // Remove all associations from the lookup dictionarys
+ // Remove all associations from the lookup dictionaries
_pageLookup.Clear();
_buttonEdgeLookup.Clear();
}
private void UpdateCheckButtonStyle()
{
- Navigator.StateCommon.CheckButton.SetStyles(Navigator.Stack.CheckButtonStyle);
+ Navigator.StateCommon!.CheckButton.SetStyles(Navigator.Stack.CheckButtonStyle);
Navigator.OverrideFocus.CheckButton.SetStyles(Navigator.Stack.CheckButtonStyle);
// Update each individual button with the new style for remapping page level button specs
@@ -741,13 +752,14 @@ private void UpdateSelectedPageFocus()
}
}
+ // ToDo: What does 'page' do?
private void BringPageIntoView(KryptonPage page)
{
// Remember the view for the requested page
ViewDrawNavCheckButtonBase? viewPage = null;
// Make sure only the selected page is checked
- foreach (ViewDrawNavCheckButtonBase child in _pageLookup.Values)
+ foreach (ViewDrawNavCheckButtonBase child in _pageLookup!.Values)
{
// Should this check button be selected
if (Navigator.SelectedPage == child.Page)
@@ -780,7 +792,7 @@ private void OnPageInserted(object sender, TypedCollectionEventArgs
checkButton.NeedPaint = NeedPaintDelegate;
// Set the initial state
- checkButton.Visible = e.Item.LastVisibleSet;
+ checkButton.Visible = e.Item!.LastVisibleSet;
checkButton.Enabled = e.Item.Enabled;
checkButton.Checked = (Navigator.SelectedPage == e.Item);
@@ -795,7 +807,7 @@ private void OnPageInserted(object sender, TypedCollectionEventArgs
};
// Add to lookup dictionary
- _pageLookup.Add(e.Item, checkButton);
+ _pageLookup!.Add(e.Item, checkButton);
_buttonEdgeLookup.Add(e.Item, buttonEdge);
// Set correct ordering and dock setting
@@ -811,8 +823,8 @@ private void OnPageRemoved(object sender, TypedCollectionEventArgs
if (!Navigator.IsDisposed && _events)
{
// Get the associated check button view element
- ViewDrawNavCheckButtonBase checkButton = _pageLookup[e.Item];
- ViewDrawBorderEdge buttonEdge = _buttonEdgeLookup[e.Item];
+ ViewDrawNavCheckButtonBase checkButton = _pageLookup![e.Item!];
+ ViewDrawBorderEdge buttonEdge = _buttonEdgeLookup[e.Item!];
// Must unhook from events
checkButton.ButtonDragRectangle -= OnCheckButtonDragRect;
@@ -827,9 +839,9 @@ private void OnPageRemoved(object sender, TypedCollectionEventArgs
_viewLayout.Remove(checkButton);
_viewLayout.Remove(buttonEdge);
- // Remove associations from the lookup dictionarys
- _pageLookup.Remove(e.Item);
- _buttonEdgeLookup.Remove(e.Item);
+ // Remove associations from the lookup dictionaries
+ _pageLookup.Remove(e.Item!);
+ _buttonEdgeLookup.Remove(e.Item!);
// Set correct ordering and dock setting
ReorderCheckButtons();
@@ -839,7 +851,7 @@ private void OnPageRemoved(object sender, TypedCollectionEventArgs
}
}
- private void OnPagesCleared(object sender, EventArgs e)
+ private void OnPagesCleared(object? sender, EventArgs e)
{
if (!Navigator.IsDisposed && _events)
{
@@ -873,7 +885,7 @@ private void ReorderCheckButtons()
foreach (KryptonPage page in Navigator.Pages)
{
// Check that a view element exists for the page
- if (_pageLookup.ContainsKey(page))
+ if (_pageLookup!.ContainsKey(page))
{
// Get the associated view elements
ViewDrawNavCheckButtonBase checkButton = _pageLookup[page];
@@ -918,49 +930,55 @@ private VisualOrientation ResolveButtonOrientation()
return Navigator.Stack.StackOrientation == Orientation.Vertical
? VisualOrientation.Top
: VisualOrientation.Left;
+
case ButtonOrientation.FixedTop:
return VisualOrientation.Top;
+
case ButtonOrientation.FixedBottom:
return VisualOrientation.Bottom;
+
case ButtonOrientation.FixedLeft:
return VisualOrientation.Left;
+
case ButtonOrientation.FixedRight:
return VisualOrientation.Right;
+
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(Navigator.Stack.ItemOrientation.ToString());
return VisualOrientation.Top;
}
}
-
- private void OnEnabledChanged(object sender, EventArgs e)
+
+ private void OnEnabledChanged(object? sender, EventArgs e)
{
UpdateStatePalettes();
Navigator.PerformLayout();
Navigator.Invalidate();
}
- private void OnAutoSizeChanged(object sender, EventArgs e) =>
+ private void OnAutoSizeChanged(object? sender, EventArgs e) =>
// Only use minimum instead of preferred if not using AutoSize
_oldRoot.SetMinimumAsPreferred(!Navigator.AutoSize);
- private void OnViewportAnimation(object sender, EventArgs e) => Navigator.PerformNeedPaint(true);
+ private void OnViewportAnimation(object? sender, EventArgs e) => Navigator.PerformNeedPaint(true);
- private void OnCheckButtonDragRect(object sender, ButtonDragRectangleEventArgs e)
+ private void OnCheckButtonDragRect(object? sender, ButtonDragRectangleEventArgs e)
{
// Cast incoming reference to the actual check button view
- var reorderItem = (ViewDrawNavCheckButtonStack)sender;
+ var reorderItem = sender as ViewDrawNavCheckButtonStack ?? throw new ArgumentNullException(nameof(sender));
- e.PreDragOffset = (Navigator.AllowPageReorder && reorderItem.Page.AreFlagsSet(KryptonPageFlags.AllowPageReorder));
+ e.PreDragOffset = (Navigator.AllowPageReorder && reorderItem.Page!.AreFlagsSet(KryptonPageFlags.AllowPageReorder));
Rectangle dragRect = Rectangle.Union(e.DragRect, _viewScrollViewport.ClientRectangle);
dragRect.Inflate(new Size(15, 15));
e.DragRect = dragRect;
}
- private void OnCheckButtonDragOffset(object sender, ButtonDragOffsetEventArgs e)
+ private void OnCheckButtonDragOffset(object? sender, ButtonDragOffsetEventArgs e)
{
// Cast incoming reference to the actual check button view
- var reorderView = (ViewDrawNavCheckButtonStack)sender;
+ var reorderView = sender as ViewDrawNavCheckButtonStack ?? throw new ArgumentNullException(nameof(sender));
// Scan the collection of children
var foundReorderView = false;
@@ -968,8 +986,8 @@ private void OnCheckButtonDragOffset(object sender, ButtonDragOffsetEventArgs e)
foreach (KryptonPage page in Navigator.Pages)
{
// If the mouse is over this button
- var childView = (ViewDrawNavCheckButtonStack)_pageLookup[page];
- if (childView.ClientRectangle.Contains(e.PointOffset))
+ var childView = _pageLookup![page] as ViewDrawNavCheckButtonStack;
+ if (childView!.ClientRectangle.Contains(e.PointOffset))
{
// Only interested if mouse over a different check button
if (childView != reorderView)
@@ -995,19 +1013,19 @@ private void OnCheckButtonDragOffset(object sender, ButtonDragOffsetEventArgs e)
// ourself as the moved button. Otherwise we just end up toggling back and forth.
if (childRect.Contains(e.PointOffset))
{
- KryptonPage movePage = PageFromView(reorderView);
- KryptonPage targetPage = PageFromView(childView);
- var reorder = new PageReorderEventArgs(movePage, targetPage, false);
+ KryptonPage? movePage = PageFromView(reorderView);
+ KryptonPage? targetPage = PageFromView(childView);
+ var reorder = new PageReorderEventArgs(movePage!, targetPage!, false);
// Give event handlers a chance to cancel this reorder
Navigator.OnBeforePageReorder(reorder);
if (!reorder.Cancel)
{
- Navigator.Pages.MoveAfter(movePage, PageFromView(childView));
+ Navigator.Pages.MoveAfter(movePage!, PageFromView(childView)!);
RecreateView();
Navigator.PerformLayout();
Navigator.Refresh();
- Navigator.OnTabMoved(new TabMovedEventArgs(movePage, Navigator.Pages.IndexOf(movePage)));
+ Navigator.OnTabMoved(new TabMovedEventArgs(movePage!, Navigator.Pages.IndexOf(movePage!)));
}
}
}
@@ -1026,19 +1044,19 @@ private void OnCheckButtonDragOffset(object sender, ButtonDragOffsetEventArgs e)
// ourself as the moved button. Otherwise we just end up toggling back and forth.
if (childRect.Contains(e.PointOffset))
{
- KryptonPage movePage = PageFromView(reorderView);
- KryptonPage targetPage = PageFromView(childView);
- var reorder = new PageReorderEventArgs(movePage, targetPage, true);
+ KryptonPage? movePage = PageFromView(reorderView);
+ KryptonPage? targetPage = PageFromView(childView);
+ var reorder = new PageReorderEventArgs(movePage!, targetPage!, true);
// Give event handlers a chance to cancel this reorder
Navigator.OnBeforePageReorder(reorder);
if (!reorder.Cancel)
{
- Navigator.Pages.MoveBefore(movePage, PageFromView(childView));
+ Navigator.Pages.MoveBefore(movePage!, PageFromView(childView)!);
RecreateView();
Navigator.PerformLayout();
Navigator.Refresh();
- Navigator.OnTabMoved(new TabMovedEventArgs(movePage, Navigator.Pages.IndexOf(movePage)));
+ Navigator.OnTabMoved(new TabMovedEventArgs(movePage!, Navigator.Pages.IndexOf(movePage!)));
}
}
}
@@ -1053,8 +1071,8 @@ private void OnCheckButtonDragOffset(object sender, ButtonDragOffsetEventArgs e)
private void RecreateView()
{
- // Remove all the existing layout content except the old root at postiion 0
- ViewBase firstChild = _viewLayout[0];
+ // Remove all the existing layout content except the old root at position 0
+ ViewBase firstChild = _viewLayout[0]!;
_viewLayout.Clear();
_viewLayout.Add(firstChild);
@@ -1069,26 +1087,26 @@ private void RecreateView()
foreach (KryptonPage page in Navigator.Pages)
{
// Grab the page associated view elements
- var checkButton = (ViewDrawNavCheckButtonStack)_pageLookup[page];
+ var checkButton = _pageLookup![page] as ViewDrawNavCheckButtonStack;
ViewDrawBorderEdge buttonEdge = _buttonEdgeLookup[page];
// Add to the child collection with the correct docking style
if (dockTopLeft)
{
- _viewLayout.Insert(1, checkButton);
+ _viewLayout.Insert(1, checkButton!);
_viewLayout.Insert(1, buttonEdge);
_viewLayout.SetDock(buttonEdge, dockNear);
- _viewLayout.SetDock(checkButton, dockNear);
+ _viewLayout.SetDock(checkButton!, dockNear);
}
else
{
_viewLayout.Add(buttonEdge, dockFar);
- _viewLayout.Add(checkButton, dockFar);
+ _viewLayout.Add(checkButton!, dockFar);
}
// All entries after the selected page are docked at the bottom/right unless
// we have been set to stack near or far, in which case we do not change.
- if (checkButton.Checked && (alignment == RelativePositionAlign.Center))
+ if (checkButton!.Checked && (alignment == RelativePositionAlign.Center))
{
dockTopLeft = false;
}
diff --git a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderStackCheckButtonGroup.cs b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderStackCheckButtonGroup.cs
index 3cba7307e..16b490154 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderStackCheckButtonGroup.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderStackCheckButtonGroup.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -62,12 +62,12 @@ public override void UpdateStatePalettes()
// Use states defined in the selected page
if (Navigator.SelectedPage.Enabled)
{
- back = Navigator.SelectedPage.StateNormal.HeaderGroup.Back;
+ back = Navigator.SelectedPage!.StateNormal.HeaderGroup.Back;
border = Navigator.SelectedPage.StateNormal.HeaderGroup.Border;
}
else
{
- back = Navigator.SelectedPage.StateDisabled.HeaderGroup.Back;
+ back = Navigator.SelectedPage!.StateDisabled.HeaderGroup.Back;
border = Navigator.SelectedPage.StateDisabled.HeaderGroup.Border;
// If page is disabled then all of view should look disabled
@@ -102,15 +102,15 @@ public override void UpdateStatePalettes()
Navigator.StateDisabled.BorderEdge);
// Create the scrolling viewport and pass in the _viewLayout as the content to scroll
- _viewScrollViewport = new ViewLayoutScrollViewport(Navigator, _viewLayout, buttonEdgePalette, null,
+ _viewScrollViewport = new ViewLayoutScrollViewport(Navigator, _viewLayout, buttonEdgePalette, null,
PaletteMetricPadding.None, PaletteMetricInt.None,
VisualOrientation.Top, RelativePositionAlign.Near,
- Navigator.Stack.StackAnimation,
+ Navigator.Stack.StackAnimation,
(Navigator.Stack.StackOrientation == Orientation.Vertical),
NeedPaintDelegate);
// Reparent the child panel that contains the actual pages, into the child control
- _viewScrollViewport.MakeParent(Navigator.ChildPanel);
+ _viewScrollViewport.MakeParent(Navigator.ChildPanel!);
// Create the top level group view
_viewGroup = new ViewDrawDocker(Navigator.StateNormal.HeaderGroup.Back,
@@ -134,7 +134,7 @@ public override void UpdateStatePalettes()
protected override void DestructStackCheckButtonView()
{
// Put the child panel back into the navigator
- _viewScrollViewport.RevertParent(Navigator, Navigator.ChildPanel);
+ _viewScrollViewport.RevertParent(Navigator, Navigator.ChildPanel!);
// Dispose of resources
_viewGroup.Dispose();
diff --git a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderStackCheckButtonHeaderGroup.cs b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderStackCheckButtonHeaderGroup.cs
index 1c4c21229..48d18581c 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderStackCheckButtonHeaderGroup.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewBuilderStackCheckButtonHeaderGroup.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -18,7 +18,7 @@ namespace Krypton.Navigator
internal class ViewBuilderStackCheckButtonHeaderGroup : ViewBuilderStackCheckButtonBase
{
#region Instance Fields
- private ViewletHeaderGroup _headerGroup;
+ private ViewletHeaderGroup? _headerGroup;
#endregion
#region Public Overrides
@@ -30,7 +30,7 @@ internal class ViewBuilderStackCheckButtonHeaderGroup : ViewBuilderStackCheckBut
public override ButtonSpec? ButtonSpecFromView(ViewBase element)
{
// Check base class for page specific button specs
- ButtonSpec bs = base.ButtonSpecFromView(element) ?? _headerGroup.ButtonSpecFromView(element);
+ ButtonSpec? bs = base.ButtonSpecFromView(element) ?? _headerGroup?.ButtonSpecFromView(element);
// Delegate lookup to the viewlet that has the button spec manager
@@ -43,7 +43,7 @@ internal class ViewBuilderStackCheckButtonHeaderGroup : ViewBuilderStackCheckBut
public override void SelectedPageChanged()
{
// Ask the header group to update the
- _headerGroup.UpdateButtons();
+ _headerGroup?.UpdateButtons();
// Let base class perform common actions
base.SelectedPageChanged();
@@ -55,7 +55,7 @@ public override void SelectedPageChanged()
public override void PageCollectionChanged()
{
UpdateStatePalettes();
- _headerGroup.UpdateButtons();
+ _headerGroup?.UpdateButtons();
// Let base class do standard work
base.PageCollectionChanged();
@@ -69,13 +69,13 @@ public override void PageVisibleStateChanged(KryptonPage? page)
{
// If is possible the header group has not been created yet
// Ensure buttons are recreated to reflect different previous/next visibility
- _headerGroup.UpdateButtons();
+ _headerGroup?.UpdateButtons();
// Let base class do standard work
base.PageVisibleStateChanged(page);
}
- ///
+ ///
/// Process a change in the enabled state for a page.
///
/// Page that has changed enabled state.
@@ -88,7 +88,7 @@ public override void PageEnabledStateChanged(KryptonPage? page)
{
// Update to use the correct enabled/disabled palette
UpdateStatePalettes();
- _headerGroup.UpdateButtons();
+ _headerGroup?.UpdateButtons();
// Need to repaint to show the change
Navigator.PerformNeedPaint(true);
@@ -105,7 +105,7 @@ public override void PageEnabledStateChanged(KryptonPage? page)
public override void UpdateStatePalettes()
{
// Update palettes for the header group
- _headerGroup.UpdateStatePalettes();
+ _headerGroup?.UpdateStatePalettes();
// Let base class do standard work
base.UpdateStatePalettes();
@@ -117,7 +117,7 @@ public override void UpdateStatePalettes()
/// Point in screen coordinates.
public override Point GetContextShowPoint() =>
// Ask the header group for screen point of context button
- _headerGroup.GetContextShowPoint();
+ _headerGroup!.GetContextShowPoint();
///
/// Is the provided over a part of the view that wants the mouse.
@@ -126,7 +126,7 @@ public override Point GetContextShowPoint() =>
/// True if the view wants the mouse position; otherwise false.
public override bool DesignerGetHitTest(Point pt) =>
// Check if any of the button specs want the point
- _headerGroup.DesignerGetHitTest(pt) || base.DesignerGetHitTest(pt);
+ _headerGroup!.DesignerGetHitTest(pt) || base.DesignerGetHitTest(pt);
// Let base class search individual stack items
///
@@ -137,7 +137,7 @@ public override bool DesignerGetHitTest(Point pt) =>
public override ButtonEnabled NextActionEnabled(DirectionButtonAction action)
{
// Ask the header group to update the action
- action = _headerGroup.NextActionEnabled(action);
+ action = _headerGroup!.NextActionEnabled(action);
// Let base class perform basic action calculations
return base.NextActionEnabled(action);
@@ -151,7 +151,7 @@ public override ButtonEnabled NextActionEnabled(DirectionButtonAction action)
public override void PerformNextAction(DirectionButtonAction action, KryptonPage? page)
{
// Ask the header group to update the action
- action = _headerGroup.NextActionEnabled(action);
+ action = _headerGroup!.NextActionEnabled(action);
// Let base class perform basic actions
base.PerformNextAction(action, page);
@@ -165,7 +165,7 @@ public override void PerformNextAction(DirectionButtonAction action, KryptonPage
public override ButtonEnabled PreviousActionEnabled(DirectionButtonAction action)
{
// Ask the header group to update the action
- action = _headerGroup.PreviousActionEnabled(action);
+ action = _headerGroup!.PreviousActionEnabled(action);
// Let base class perform basic action calculations
return base.PreviousActionEnabled(action);
@@ -179,7 +179,7 @@ public override ButtonEnabled PreviousActionEnabled(DirectionButtonAction action
public override void PerformPreviousAction(DirectionButtonAction action, KryptonPage? page)
{
// Ask the header group to update the action
- action = _headerGroup.PreviousActionEnabled(action);
+ action = _headerGroup!.PreviousActionEnabled(action);
// Let base class perform basic actions
base.PerformPreviousAction(action, page);
@@ -192,10 +192,10 @@ public override void PerformPreviousAction(DirectionButtonAction action, Krypton
///
/// Source of the event.
/// Property changed details.
- protected override void OnViewBuilderPropertyChanged(object sender, PropertyChangedEventArgs e)
+ protected override void OnViewBuilderPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
// Let the header group process the property
- _headerGroup.ViewBuilderPropertyChanged(e);
+ _headerGroup?.ViewBuilderPropertyChanged(e);
// Let the base process it as well
base.OnViewBuilderPropertyChanged(sender, e);
@@ -205,7 +205,7 @@ protected override void OnViewBuilderPropertyChanged(object sender, PropertyChan
/// Create the mode specific view hierarchy.
///
/// View element to use as base of hierarchy.
- protected override ViewBase? CreateStackCheckButtonView()
+ protected override ViewBase CreateStackCheckButtonView()
{
// Let base class do common stuff first
base.CreateStackCheckButtonView();
@@ -221,12 +221,12 @@ protected override void OnViewBuilderPropertyChanged(object sender, PropertyChan
_viewScrollViewport = new ViewLayoutScrollViewport(Navigator, _viewLayout, buttonEdgePalette, null,
PaletteMetricPadding.None, PaletteMetricInt.None,
VisualOrientation.Top, RelativePositionAlign.Near,
- Navigator.Stack.StackAnimation,
+ Navigator.Stack.StackAnimation,
(Navigator.Stack.StackOrientation == Orientation.Vertical),
NeedPaintDelegate);
// Reparent the child panel that contains the actual pages, into the child control
- _viewScrollViewport.MakeParent(Navigator.ChildPanel);
+ _viewScrollViewport.MakeParent(Navigator.ChildPanel!);
// Create the header group and fill with the view layout
_headerGroup = new ViewletHeaderGroup(Navigator, Redirector, NeedPaintDelegate);
@@ -244,7 +244,7 @@ protected override void OnViewBuilderPropertyChanged(object sender, PropertyChan
protected override void PostConstruct()
{
// Ask the header group to finish the create phase
- _headerGroup.PostCreate();
+ _headerGroup?.PostCreate();
// Let base class perform standard actions
base.PostConstruct();
@@ -256,10 +256,10 @@ protected override void PostConstruct()
protected override void DestructStackCheckButtonView()
{
// Put the child panel back into the navigator
- _viewScrollViewport.RevertParent(Navigator, Navigator.ChildPanel);
+ _viewScrollViewport.RevertParent(Navigator, Navigator.ChildPanel!);
// Destruct the header group viewlet
- _headerGroup.Destruct();
+ _headerGroup?.Destruct();
// Let base class do common stuff
base.DestructStackCheckButtonView();
diff --git a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewletHeaderGroup.cs b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewletHeaderGroup.cs
index 56257d93f..2dce1255c 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewletHeaderGroup.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewletHeaderGroup.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -24,7 +24,7 @@ internal class ViewletHeaderGroup
private ViewDrawContent _viewContentPrimary;
private ViewDrawDocker _viewHeadingSecondary;
private ViewDrawContent _viewContentSecondary;
- private ButtonSpecManagerDraw _buttonManager;
+ private ButtonSpecManagerDraw? _buttonManager; // Can be null in the designer
private readonly NeedPaintHandler _needPaintDelegate;
#endregion
@@ -44,9 +44,9 @@ public ViewletHeaderGroup([DisallowNull] KryptonNavigator navigator,
Debug.Assert(needPaintDelegate != null);
// Remember references
- Navigator = navigator;
- Redirector = redirector;
- _needPaintDelegate = needPaintDelegate;
+ Navigator = navigator ?? throw new ArgumentNullException(nameof(navigator));
+ Redirector = redirector ?? throw new ArgumentNullException(nameof(redirector));
+ _needPaintDelegate = needPaintDelegate ?? throw new ArgumentNullException(nameof(needPaintDelegate));
}
#endregion
@@ -84,7 +84,7 @@ public void PostCreate()
UpdateStatePalettes();
// Force buttons to be recreated in the headers
- _buttonManager.RecreateButtons();
+ _buttonManager?.RecreateButtons();
}
///
@@ -92,11 +92,14 @@ public void PostCreate()
///
public void Destruct()
{
- // Remove paint delegate so we can be garbage collected
- _buttonManager.NeedPaint = null;
+ if (_buttonManager != null)
+ {
+ // Remove paint delegate so we can be garbage collected
+ _buttonManager.NeedPaint = null;
- // Cleanup the button manager events and processing
- _buttonManager.Destruct();
+ // Cleanup the button manager events and processing
+ _buttonManager.Destruct();
+ }
// Remove the old root from the canvas
_viewGroup.Dispose();
@@ -110,14 +113,14 @@ public void Destruct()
/// Reference to ButtonSpec; otherwise null.
public ButtonSpec? ButtonSpecFromView(ViewBase element) =>
// Ask the button manager for the button spec for this element
- _buttonManager.ButtonSpecFromView(element);
+ _buttonManager?.ButtonSpecFromView(element);
///
/// Recreate the buttons to reflect a change in selected page.
///
public void UpdateButtons() =>
// Ensure buttons are recreated to reflect different page
- _buttonManager.RecreateButtons();
+ _buttonManager?.RecreateButtons();
///
/// Ensure the correct state palettes are being used.
@@ -162,7 +165,7 @@ public void UpdateStatePalettes()
public Point GetContextShowPoint()
{
// Get the display rectangle of the context button
- Rectangle rect = _buttonManager.GetButtonRectangle(Navigator.Button.ContextButton);
+ Rectangle rect = _buttonManager!.GetButtonRectangle(Navigator.Button.ContextButton);
// We want the context menu to show just below the button
var pt = new Point(rect.Left, rect.Bottom + 3);
@@ -178,7 +181,7 @@ public Point GetContextShowPoint()
/// True if the view wants the mouse position; otherwise false.
public bool DesignerGetHitTest(Point pt) =>
// Check if any of the buttons want the point
- _buttonManager.DesignerGetHitTest(pt);
+ _buttonManager?.DesignerGetHitTest(pt) ?? false;
///
/// Get the appropriate action for the header group next action.
@@ -221,23 +224,23 @@ public virtual void ViewBuilderPropertyChanged(PropertyChangedEventArgs e)
switch (e.PropertyName)
{
case @"HeaderStylePrimary":
- SetHeaderStyle(_viewHeadingPrimary, Navigator.StateCommon.HeaderGroup.HeaderPrimary, Navigator.Header.HeaderStylePrimary);
+ SetHeaderStyle(_viewHeadingPrimary, Navigator.StateCommon!.HeaderGroup.HeaderPrimary, Navigator.Header.HeaderStylePrimary);
UpdateStatePalettes();
Navigator.PerformNeedPaint(true);
break;
case @"HeaderStyleSecondary":
- SetHeaderStyle(_viewHeadingSecondary, Navigator.StateCommon.HeaderGroup.HeaderSecondary, Navigator.Header.HeaderStyleSecondary);
+ SetHeaderStyle(_viewHeadingSecondary, Navigator.StateCommon!.HeaderGroup.HeaderSecondary, Navigator.Header.HeaderStyleSecondary);
UpdateStatePalettes();
Navigator.PerformNeedPaint(true);
break;
case @"HeaderPositionPrimary":
SetHeaderPosition(_viewHeadingPrimary, _viewContentPrimary, Navigator.Header.HeaderPositionPrimary);
- _buttonManager.RecreateButtons();
+ _buttonManager?.RecreateButtons();
Navigator.PerformNeedPaint(true);
break;
case @"HeaderPositionSecondary":
SetHeaderPosition(_viewHeadingSecondary, _viewContentSecondary, Navigator.Header.HeaderPositionSecondary);
- _buttonManager.RecreateButtons();
+ _buttonManager?.RecreateButtons();
Navigator.PerformNeedPaint(true);
break;
case @"HeaderVisiblePrimary":
@@ -255,7 +258,7 @@ public virtual void ViewBuilderPropertyChanged(PropertyChangedEventArgs e)
case @"ContextButtonDisplay":
case @"CloseButtonDisplay":
case nameof(ButtonDisplayLogic):
- _buttonManager.RecreateButtons();
+ _buttonManager?.RecreateButtons();
break;
}
}
@@ -353,7 +356,7 @@ private void CreateButtonSpecManager() =>
// Create button specification collection manager
_buttonManager = new ButtonSpecManagerDraw(Navigator, Redirector, Navigator.Button.ButtonSpecs, Navigator.FixedSpecs,
new[] { _viewHeadingPrimary, _viewHeadingSecondary },
- new IPaletteMetric[] { Navigator.StateCommon.HeaderGroup.HeaderPrimary, Navigator.StateCommon.HeaderGroup.HeaderSecondary },
+ new IPaletteMetric[] { Navigator.StateCommon!.HeaderGroup.HeaderPrimary, Navigator.StateCommon.HeaderGroup.HeaderSecondary },
new[] { PaletteMetricInt.HeaderButtonEdgeInsetPrimary, PaletteMetricInt.HeaderButtonEdgeInsetSecondary },
new[] { PaletteMetricPadding.HeaderButtonPaddingPrimary, PaletteMetricPadding.HeaderButtonPaddingSecondary },
Navigator.CreateToolStripRenderer,
@@ -366,7 +369,7 @@ private void CreateButtonSpecManager() =>
private void UpdateHeaders()
{
- SetHeaderStyle(_viewHeadingPrimary, Navigator.StateCommon.HeaderGroup.HeaderPrimary, Navigator.Header.HeaderStylePrimary);
+ SetHeaderStyle(_viewHeadingPrimary, Navigator.StateCommon!.HeaderGroup.HeaderPrimary, Navigator.Header.HeaderStylePrimary);
SetHeaderStyle(_viewHeadingSecondary, Navigator.StateCommon.HeaderGroup.HeaderSecondary, Navigator.Header.HeaderStyleSecondary);
SetHeaderPosition(_viewHeadingPrimary, _viewContentPrimary, Navigator.Header.HeaderPositionPrimary);
SetHeaderPosition(_viewHeadingSecondary, _viewContentSecondary, Navigator.Header.HeaderPositionSecondary);
@@ -381,53 +384,63 @@ private void SetHeaderStyle(ViewDrawDocker drawDocker,
switch (style)
{
case HeaderStyle.Primary:
- _buttonManager.SetDockerMetrics(drawDocker, palette,
+ _buttonManager?.SetDockerMetrics(drawDocker, palette,
PaletteMetricInt.HeaderButtonEdgeInsetPrimary,
PaletteMetricPadding.HeaderButtonPaddingPrimary);
break;
+
case HeaderStyle.Secondary:
- _buttonManager.SetDockerMetrics(drawDocker, palette,
+ _buttonManager?.SetDockerMetrics(drawDocker, palette,
PaletteMetricInt.HeaderButtonEdgeInsetSecondary,
PaletteMetricPadding.HeaderButtonPaddingSecondary);
break;
+
case HeaderStyle.DockActive:
- _buttonManager.SetDockerMetrics(drawDocker, palette,
+ _buttonManager?.SetDockerMetrics(drawDocker, palette,
PaletteMetricInt.HeaderButtonEdgeInsetDockActive,
PaletteMetricPadding.HeaderButtonPaddingDockActive);
break;
+
case HeaderStyle.DockInactive:
- _buttonManager.SetDockerMetrics(drawDocker, palette,
+ _buttonManager?.SetDockerMetrics(drawDocker, palette,
PaletteMetricInt.HeaderButtonEdgeInsetDockInactive,
PaletteMetricPadding.HeaderButtonPaddingDockInactive);
break;
+
case HeaderStyle.Form:
- _buttonManager.SetDockerMetrics(drawDocker, palette,
+ _buttonManager?.SetDockerMetrics(drawDocker, palette,
PaletteMetricInt.HeaderButtonEdgeInsetForm,
PaletteMetricPadding.HeaderButtonPaddingForm);
break;
+
case HeaderStyle.Calendar:
- _buttonManager.SetDockerMetrics(drawDocker, palette,
+ _buttonManager?.SetDockerMetrics(drawDocker, palette,
PaletteMetricInt.HeaderButtonEdgeInsetCalendar,
PaletteMetricPadding.HeaderButtonPaddingCalendar);
break;
+
case HeaderStyle.Custom1:
- _buttonManager.SetDockerMetrics(drawDocker, palette,
+ _buttonManager?.SetDockerMetrics(drawDocker, palette,
PaletteMetricInt.HeaderButtonEdgeInsetCustom1,
PaletteMetricPadding.HeaderButtonPaddingCustom1);
break;
+
case HeaderStyle.Custom2:
- _buttonManager.SetDockerMetrics(drawDocker, palette,
+ _buttonManager?.SetDockerMetrics(drawDocker, palette,
PaletteMetricInt.HeaderButtonEdgeInsetCustom2,
PaletteMetricPadding.HeaderButtonPaddingCustom2);
break;
+
case HeaderStyle.Custom3:
- _buttonManager.SetDockerMetrics(drawDocker, palette,
+ _buttonManager?.SetDockerMetrics(drawDocker, palette,
PaletteMetricInt.HeaderButtonEdgeInsetCustom3,
PaletteMetricPadding.HeaderButtonPaddingCustom3);
break;
+
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(style.ToString());
break;
}
}
@@ -461,15 +474,15 @@ private void SetHeaderPosition(ViewDrawCanvas canvas,
}
}
- private void SetPalettes(PaletteHeaderGroup? palette)
+ private void SetPalettes(PaletteHeaderGroup palette)
{
_viewGroup.SetPalettes(palette.Back, palette.Border, palette);
_viewHeadingPrimary.SetPalettes(palette.HeaderPrimary.Back, palette.HeaderPrimary.Border, palette.HeaderPrimary);
_viewHeadingSecondary.SetPalettes(palette.HeaderSecondary.Back, palette.HeaderSecondary.Border, palette.HeaderSecondary);
- _buttonManager.SetDockerMetrics(_viewHeadingPrimary, palette.HeaderPrimary);
- _buttonManager.SetDockerMetrics(_viewHeadingSecondary, palette.HeaderSecondary);
+ _buttonManager?.SetDockerMetrics(_viewHeadingPrimary, palette.HeaderPrimary);
+ _buttonManager?.SetDockerMetrics(_viewHeadingSecondary, palette.HeaderSecondary);
_viewContentPrimary.SetPalette(palette.HeaderPrimary.Content);
_viewContentSecondary.SetPalette(palette.HeaderSecondary.Content);
@@ -482,22 +495,22 @@ private void SetEnabled(bool enabled)
_viewHeadingSecondary.Enabled = enabled;
_viewContentPrimary.Enabled = enabled;
_viewContentSecondary.Enabled = enabled;
- _buttonManager.RecreateButtons();
+ _buttonManager?.RecreateButtons();
}
- private void OnDragStart(object sender, DragStartEventCancelArgs e) => Navigator.InternalDragStart(e, null);
+ private void OnDragStart(object? sender, DragStartEventCancelArgs e) => Navigator.InternalDragStart(e, null);
- private void OnDragMove(object sender, PointEventArgs e) => Navigator.InternalDragMove(e);
+ private void OnDragMove(object? sender, PointEventArgs e) => Navigator.InternalDragMove(e);
- private void OnDragEnd(object sender, PointEventArgs e) => Navigator.InternalDragEnd(e);
+ private void OnDragEnd(object? sender, PointEventArgs e) => Navigator.InternalDragEnd(e);
- private void OnDragQuit(object sender, EventArgs e) => Navigator.InternalDragQuit();
+ private void OnDragQuit(object? sender, EventArgs e) => Navigator.InternalDragQuit();
- private void OnLeftMouseDown(object sender, EventArgs e) => Navigator.OnPrimaryHeaderLeftClicked(e);
+ private void OnLeftMouseDown(object? sender, EventArgs e) => Navigator.OnPrimaryHeaderLeftClicked(e);
- private void OnRightMouseDown(object sender, EventArgs e) => Navigator.OnPrimaryHeaderRightClicked(e);
+ private void OnRightMouseDown(object? sender, EventArgs e) => Navigator.OnPrimaryHeaderRightClicked(e);
- private void OnLeftDoubleClick(object sender, EventArgs e) => Navigator.OnPrimaryHeaderDoubleClicked(e);
+ private void OnLeftDoubleClick(object? sender, EventArgs e) => Navigator.OnPrimaryHeaderDoubleClicked(e);
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewletHeaderGroupOutlook.cs b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewletHeaderGroupOutlook.cs
index b42df2cc3..88e8584a7 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Builder/ViewletHeaderGroupOutlook.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Builder/ViewletHeaderGroupOutlook.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -29,7 +29,7 @@ internal class ViewletHeaderGroupOutlook : ViewletHeaderGroup
/// Palette redirector.
/// Delegate for notifying paint requests.
public ViewletHeaderGroupOutlook(KryptonNavigator navigator,
- PaletteRedirect? redirector,
+ PaletteRedirect redirector,
NeedPaintHandler needPaintDelegate)
: base(navigator, redirector, needPaintDelegate) =>
// Are we using the full or mini outlook mode.
diff --git a/Source/Krypton Components/Krypton.Navigator/View Draw/ViewDrawNavCheckButtonBar.cs b/Source/Krypton Components/Krypton.Navigator/View Draw/ViewDrawNavCheckButtonBar.cs
index 1a4f424d1..c8d5d10c5 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Draw/ViewDrawNavCheckButtonBar.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Draw/ViewDrawNavCheckButtonBar.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -28,7 +28,7 @@ internal class ViewDrawNavCheckButtonBar : ViewDrawNavCheckButtonBase,
public ViewDrawNavCheckButtonBar(KryptonNavigator navigator,
KryptonPage? page,
VisualOrientation orientation)
- : base(navigator, page, orientation)
+ : base(navigator, page!, orientation)
{
}
@@ -53,8 +53,8 @@ public ViewDrawNavCheckButtonBar(KryptonNavigator navigator,
IPaletteTriple statePressed,
IPaletteTriple stateSelected,
IPaletteTriple stateFocused)
- : base(navigator, page, orientation, stateDisabled,
- stateNormal, stateTracking, statePressed,
+ : base(navigator, page, orientation, stateDisabled,
+ stateNormal, stateTracking, statePressed,
stateSelected, stateFocused)
{
}
@@ -83,19 +83,19 @@ public override string ToString() =>
///
/// The state for which the image is needed.
/// Image value.
- public override Image? GetImage(PaletteState state) => Page.GetImageMapping(Navigator.Bar.BarMapImage);
+ public override Image? GetImage(PaletteState state) => Page?.GetImageMapping(Navigator.Bar.BarMapImage);
///
/// Gets the content short text.
///
/// String value.
- public override string GetShortText() => Page.GetTextMapping(Navigator.Bar.BarMapText);
+ public override string GetShortText() => Page?.GetTextMapping(Navigator.Bar.BarMapText)!;
///
/// Gets the content long text.
///
/// String value.
- public override string GetLongText() => Page.GetTextMapping(Navigator.Bar.BarMapExtraText);
+ public override string GetLongText() => Page?.GetTextMapping(Navigator.Bar.BarMapExtraText)!;
#endregion
@@ -105,7 +105,7 @@ public override string ToString() =>
///
/// Source of the event.
/// An EventArgs containing the event data.
- protected override void OnClick(object sender, EventArgs e)
+ protected override void OnClick(object? sender, EventArgs e)
{
base.OnClick(sender, e);
@@ -120,7 +120,7 @@ protected override void OnClick(object sender, EventArgs e)
case NavigatorMode.BarTabOnly:
case NavigatorMode.HeaderBarCheckButtonOnly:
// Show popup for this page
- Navigator.ShowPopupPage(Page, this, null);
+ Navigator.ShowPopupPage(Page!, this, null);
break;
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/View Draw/ViewDrawNavCheckButtonBase.cs b/Source/Krypton Components/Krypton.Navigator/View Draw/ViewDrawNavCheckButtonBase.cs
index 6414682c6..74a7b6572 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Draw/ViewDrawNavCheckButtonBase.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Draw/ViewDrawNavCheckButtonBase.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -58,16 +58,16 @@ internal abstract class ViewDrawNavCheckButtonBase : ViewDrawButton,
/// Orientation for the check button.
/// Button is used on the overflow bar.
public ViewDrawNavCheckButtonBase(KryptonNavigator navigator,
- [DisallowNull] KryptonPage? page,
+ KryptonPage? page,
VisualOrientation orientation,
bool overflow)
: this(navigator, page, orientation,
- page.StateDisabled.OverflowButton,
- page.StateNormal.OverflowButton,
- page.StateTracking.OverflowButton,
- page.StatePressed.OverflowButton,
- page.StateSelected.OverflowButton,
- page.OverrideFocus.OverflowButton)
+ page?.StateDisabled?.OverflowButton!,
+ page?.StateNormal?.OverflowButton!,
+ page?.StateTracking.OverflowButton!,
+ page?.StatePressed.OverflowButton!,
+ page?.StateSelected.OverflowButton!,
+ page?.OverrideFocus?.OverflowButton!)
{
}
@@ -78,15 +78,15 @@ public ViewDrawNavCheckButtonBase(KryptonNavigator navigator,
/// Page this check button represents.
/// Orientation for the check button.
public ViewDrawNavCheckButtonBase(KryptonNavigator navigator,
- [DisallowNull] KryptonPage? page,
+ KryptonPage? page,
VisualOrientation orientation)
: this(navigator, page, orientation,
- page.StateDisabled.CheckButton,
- page.StateNormal.CheckButton,
- page.StateTracking.CheckButton,
- page.StatePressed.CheckButton,
- page.StateSelected.CheckButton,
- page.OverrideFocus.CheckButton)
+ page?.StateDisabled?.CheckButton!,
+ page?.StateNormal?.CheckButton!,
+ page?.StateTracking.CheckButton!,
+ page?.StatePressed.CheckButton!,
+ page?.StateSelected.CheckButton!,
+ page?.OverrideFocus.CheckButton!)
{
}
@@ -111,19 +111,19 @@ public ViewDrawNavCheckButtonBase([DisallowNull] KryptonNavigator navigator,
IPaletteTriple statePressed,
IPaletteTriple stateSelected,
IPaletteTriple stateFocused)
- : base(stateDisabled, stateNormal, stateTracking,
+ : base(stateDisabled, stateNormal, stateTracking,
statePressed, null, null, orientation, true)
{
- Debug.Assert(navigator != null);
+ Debug.Assert(navigator is not null);
- Navigator = navigator;
+ Navigator = navigator ?? throw new ArgumentNullException(nameof(navigator));
_page = page;
_lastClick = DateTime.Now.AddDays(-1);
// Associate the page component with this view element
Component = page;
- // Prevent user from unchecking the selected check button
+ // Prevent user from un-checking the selected check button
AllowUncheck = false;
// Set the source for values to ourself
@@ -148,9 +148,9 @@ public ViewDrawNavCheckButtonBase([DisallowNull] KryptonNavigator navigator,
if (AllowButtonSpecs)
{
// Create button specification collection manager
- ButtonSpecManager = new ButtonSpecNavManagerLayoutBar(Navigator, Navigator.InternalRedirector, Page.ButtonSpecs, null,
+ ButtonSpecManager = new ButtonSpecNavManagerLayoutBar(Navigator, Navigator.InternalRedirector, Page?.ButtonSpecs, null,
new[] { LayoutDocker },
- new IPaletteMetric[] { Navigator.StateCommon },
+ new IPaletteMetric[] { Navigator.StateCommon! },
new[] { PaletteMetricInt.PageButtonInset },
new[] { PaletteMetricInt.PageButtonInset },
new[] { PaletteMetricPadding.PageButtonPadding },
@@ -400,8 +400,9 @@ protected virtual IMouseController CreateMouseController()
KeyController = _buttonController;
// Create two decorators in order to support tooltips and hover events
- var toolTipController = new ToolTipController(Navigator.ToolTipManager, this, _buttonController);
- var hoverController = new ToolTipController(Navigator.HoverManager, this, toolTipController);
+ var toolTipController = new ToolTipController(Navigator.ToolTipManager!, this, _buttonController);
+ var hoverController = new ToolTipController(Navigator.HoverManager!, this, toolTipController);
+
return hoverController;
}
#endregion
@@ -421,21 +422,21 @@ protected virtual IMouseController CreateMouseController()
///
/// Source of the event.
/// An EventArgs containing the event data.
- protected virtual void OnClick(object sender, EventArgs e)
+ protected virtual void OnClick(object? sender, EventArgs e)
{
// Generate click event for the page header
- Navigator.OnTabClicked(new KryptonPageEventArgs(_page, Navigator.Pages.IndexOf(_page)));
+ Navigator.OnTabClicked(new KryptonPageEventArgs(_page, Navigator.Pages.IndexOf(_page!)));
// If this click is within the double click time of the last one, generate the double click event.
DateTime now = DateTime.Now;
if ((now - _lastClick).TotalMilliseconds < SystemInformation.DoubleClickTime)
{
// Tell button controller to abort any drag attempt
- _buttonController.ClearDragRect();
+ _buttonController!.ClearDragRect();
// Generate click event for the page header
- Navigator.OnTabDoubleClicked(new KryptonPageEventArgs(_page, Navigator.Pages.IndexOf(_page)));
-
+ Navigator.OnTabDoubleClicked(new KryptonPageEventArgs(_page, Navigator.Pages.IndexOf(_page!)));
+
// Prevent a third click causing another double click by resetting the now time backwards
now = now.AddDays(-1);
}
@@ -446,7 +447,7 @@ protected virtual void OnClick(object sender, EventArgs e)
if ((Navigator.SelectedPage != _page) && Navigator.AllowTabSelect)
{
// This event might have caused the page to be removed or hidden and so check the page is still present before selecting it
- if (Navigator.ChildPanel?.Controls.Contains(_page) == true && _page.LastVisibleSet)
+ if (Navigator.ChildPanel?.Controls.Contains(_page) == true && _page!.LastVisibleSet)
{
Navigator.SelectedPage = _page;
}
@@ -458,7 +459,7 @@ protected virtual void OnClick(object sender, EventArgs e)
///
/// Source of the event.
/// An EventArgs containing the event data.
- protected virtual void OnRightClick(object sender, MouseEventArgs e)
+ protected virtual void OnRightClick(object? sender, MouseEventArgs e)
{
// Can only select the page if not already selected and allowed to select a tab
if ((Navigator.SelectedPage != _page) && Navigator.AllowTabSelect)
@@ -467,7 +468,7 @@ protected virtual void OnRightClick(object sender, MouseEventArgs e)
}
// Generate event so user can decide what, if any, context menu to show
- var scma = new ShowContextMenuArgs(_page, Navigator.Pages.IndexOf(_page));
+ var scma = new ShowContextMenuArgs(_page, Navigator.Pages.IndexOf(_page!));
Navigator.OnShowContextMenu(scma);
// Do we need to show a context menu
@@ -475,13 +476,13 @@ protected virtual void OnRightClick(object sender, MouseEventArgs e)
{
if (CommonHelper.ValidKryptonContextMenu(scma.KryptonContextMenu))
{
- scma.KryptonContextMenu.Show(Navigator, Navigator.PointToScreen(new Point(e.X, e.Y)));
+ scma.KryptonContextMenu!.Show(Navigator, Navigator.PointToScreen(new Point(e.X, e.Y)));
}
- else
+ else
{
if (CommonHelper.ValidContextMenuStrip(scma.ContextMenuStrip))
{
- scma.ContextMenuStrip.Show(Navigator.PointToScreen(new Point(e.X, e.Y)));
+ scma.ContextMenuStrip!.Show(Navigator.PointToScreen(new Point(e.X, e.Y)));
}
}
}
@@ -489,17 +490,17 @@ protected virtual void OnRightClick(object sender, MouseEventArgs e)
#endregion
#region Implementation
- private void OnDragStart(object sender, DragStartEventCancelArgs e) => Navigator.InternalDragStart(e, _page);
+ private void OnDragStart(object? sender, DragStartEventCancelArgs e) => Navigator.InternalDragStart(e, _page);
- private void OnDragMove(object sender, PointEventArgs e) => Navigator.InternalDragMove(e);
+ private void OnDragMove(object? sender, PointEventArgs e) => Navigator.InternalDragMove(e);
- private void OnDragEnd(object sender, PointEventArgs e) => Navigator.InternalDragEnd(e);
+ private void OnDragEnd(object? sender, PointEventArgs e) => Navigator.InternalDragEnd(e);
- private void OnDragQuit(object sender, EventArgs e) => Navigator.InternalDragQuit();
+ private void OnDragQuit(object? sender, EventArgs e) => Navigator.InternalDragQuit();
- private void OnButtonDragRectangle(object sender, ButtonDragRectangleEventArgs e) => ButtonDragRectangle?.Invoke(this, e);
+ private void OnButtonDragRectangle(object? sender, ButtonDragRectangleEventArgs e) => ButtonDragRectangle?.Invoke(this, e);
- private void OnButtonDragOffset(object sender, ButtonDragOffsetEventArgs e) => ButtonDragOffset?.Invoke(this, e);
+ private void OnButtonDragOffset(object? sender, ButtonDragOffsetEventArgs e) => ButtonDragOffset?.Invoke(this, e);
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/View Draw/ViewDrawNavCheckButtonStack.cs b/Source/Krypton Components/Krypton.Navigator/View Draw/ViewDrawNavCheckButtonStack.cs
index 572d05824..abaf19378 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Draw/ViewDrawNavCheckButtonStack.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Draw/ViewDrawNavCheckButtonStack.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -48,8 +48,8 @@ public override string ToString() =>
public override void UpdateButtonSpecMapping()
{
// Define a default mapping for text color and recreate to use that new setting
- ButtonSpecManager.SetRemapTarget(Navigator.Stack.CheckButtonStyle);
- ButtonSpecManager.RecreateButtons();
+ ButtonSpecManager?.SetRemapTarget(Navigator.Stack.CheckButtonStyle);
+ ButtonSpecManager?.RecreateButtons();
}
#endregion
@@ -59,19 +59,19 @@ public override void UpdateButtonSpecMapping()
///
/// The state for which the image is needed.
/// Image value.
- public override Image? GetImage(PaletteState state) => Page.GetImageMapping(Navigator.Stack.StackMapImage);
+ public override Image? GetImage(PaletteState state) => Page?.GetImageMapping(Navigator.Stack.StackMapImage);
///
/// Gets the content short text.
///
/// String value.
- public override string GetShortText() => Page.GetTextMapping(Navigator.Stack.StackMapText);
+ public override string GetShortText() => Page?.GetTextMapping(Navigator.Stack.StackMapText)!;
///
/// Gets the content long text.
///
/// String value.
- public override string GetLongText() => Page.GetTextMapping(Navigator.Stack.StackMapExtraText);
+ public override string GetLongText() => Page?.GetTextMapping(Navigator.Stack.StackMapExtraText)!;
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Navigator/View Draw/ViewDrawNavCheckButtonTab.cs b/Source/Krypton Components/Krypton.Navigator/View Draw/ViewDrawNavCheckButtonTab.cs
index 4006c5d17..e1b24cb7f 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Draw/ViewDrawNavCheckButtonTab.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Draw/ViewDrawNavCheckButtonTab.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -28,9 +28,9 @@ public ViewDrawNavCheckButtonTab(KryptonNavigator navigator,
KryptonPage? page,
VisualOrientation orientation)
: base(navigator, page, orientation,
- page.StateDisabled.Tab,
+ page!.StateDisabled.Tab,
page.StateNormal.Tab,
- page.StateTracking.Tab,
+ page.StateTracking.Tab,
page.StatePressed.Tab,
page.StateSelected.Tab,
page.OverrideFocus.Tab)
@@ -54,8 +54,8 @@ public override string ToString() =>
public override void UpdateButtonSpecMapping()
{
// Update the button spec manager for this tab to use a tab style for remapping
- ButtonSpecManager.SetRemapTarget(Navigator.Bar.TabStyle);
- ButtonSpecManager.RecreateButtons();
+ ButtonSpecManager?.SetRemapTarget(Navigator.Bar.TabStyle);
+ ButtonSpecManager?.RecreateButtons();
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/View Draw/ViewDrawNavOutlookMini.cs b/Source/Krypton Components/Krypton.Navigator/View Draw/ViewDrawNavOutlookMini.cs
index 6d4b7b9b9..575c3da92 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Draw/ViewDrawNavOutlookMini.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Draw/ViewDrawNavOutlookMini.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -48,7 +48,7 @@ public ViewDrawNavOutlookMini(KryptonNavigator navigator,
/// User readable name of the instance.
public override string ToString() =>
// Return the class name and instance identifier
- $"ViewDrawNavOutlookMini:{Id} Text:{Page.Text}";
+ $"ViewDrawNavOutlookMini:{Id} Text:{Page!.Text}";
#endregion
@@ -64,11 +64,11 @@ public override KryptonPage? Page
if (Page != null)
{
- _overrideDisabled.SetPalettes(Page.OverrideFocus.MiniButton, Page.StateDisabled.MiniButton);
- _overrideNormal.SetPalettes(Page.OverrideFocus.MiniButton, Page.StateNormal.MiniButton);
- _overrideTracking.SetPalettes(Page.OverrideFocus.MiniButton, Page.StateTracking.MiniButton);
- _overridePressed.SetPalettes(Page.OverrideFocus.MiniButton, Page.StatePressed.MiniButton);
- _overrideSelected.SetPalettes(Page.OverrideFocus.MiniButton, Page.StateSelected.MiniButton);
+ _overrideDisabled.SetPalettes(Page!.OverrideFocus.MiniButton, Page!.StateDisabled.MiniButton);
+ _overrideNormal.SetPalettes(Page!.OverrideFocus.MiniButton, Page!.StateNormal.MiniButton);
+ _overrideTracking.SetPalettes(Page!.OverrideFocus.MiniButton, Page!.StateTracking.MiniButton);
+ _overridePressed.SetPalettes(Page!.OverrideFocus.MiniButton, Page!.StatePressed.MiniButton);
+ _overrideSelected.SetPalettes(Page!.OverrideFocus.MiniButton, Page!.StateSelected.MiniButton);
}
else
{
@@ -126,13 +126,13 @@ protected override IMouseController CreateMouseController()
#endregion
#region Implementation
- private void OnMiniClick(object sender, EventArgs e) =>
+ private void OnMiniClick(object? sender, EventArgs e) =>
// Ask the navigator to show the specified page as a popup window
// relative to our location as an element and firing the provided
// delegate when the popup is dismissed.
- Navigator.ShowPopupPage(Page, this, _finishDelegate);
+ Navigator.ShowPopupPage(Page!, this, _finishDelegate);
- private void OnPopupFinished(object sender, EventArgs e) =>
+ private void OnPopupFinished(object? sender, EventArgs e) =>
// Remove the fixed display of the button, now the associated popup has been removed
_controller.RemoveFixed();
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/View Draw/ViewDrawNavOutlookOverflow.cs b/Source/Krypton Components/Krypton.Navigator/View Draw/ViewDrawNavOutlookOverflow.cs
index a4c943688..fe3be0883 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Draw/ViewDrawNavOutlookOverflow.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Draw/ViewDrawNavOutlookOverflow.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -55,20 +55,19 @@ public override string ToString() =>
///
/// The state for which the image is needed.
/// Image value.
- public override Image? GetImage(PaletteState state) => Page.GetImageMapping(Navigator.Outlook.Full.OverflowMapImage);
+ public override Image? GetImage(PaletteState state) => Page?.GetImageMapping(Navigator.Outlook.Full.OverflowMapImage);
///
/// Gets the content short text.
///
/// String value.
- public override string GetShortText() => Page.GetTextMapping(Navigator.Outlook.Full.OverflowMapText);
+ public override string GetShortText() => Page?.GetTextMapping(Navigator.Outlook.Full.OverflowMapText)!;
///
/// Gets the content long text.
///
/// String value.
- public override string GetLongText() => Page.GetTextMapping(Navigator.Outlook.Full.OverflowMapExtraText);
-
+ public override string GetLongText() => Page?.GetTextMapping(Navigator.Outlook.Full.OverflowMapExtraText)!;
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/View Draw/ViewDrawNavOutlookStack.cs b/Source/Krypton Components/Krypton.Navigator/View Draw/ViewDrawNavOutlookStack.cs
index 1a0d62bee..4d682b972 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Draw/ViewDrawNavOutlookStack.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Draw/ViewDrawNavOutlookStack.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -41,7 +41,7 @@ public ViewDrawNavOutlookStack(KryptonNavigator navigator,
/// User readable name of the instance.
public override string ToString() =>
// Return the class name and instance identifier
- $"ViewDrawNavOutlookStack:{Id} Text:{Page.Text}";
+ $"ViewDrawNavOutlookStack:{Id} Text:{Page!.Text}";
#endregion
@@ -52,8 +52,8 @@ public override string ToString() =>
public override void UpdateButtonSpecMapping()
{
// Define a default mapping for text color and recreate to use that new setting
- ButtonSpecManager.SetRemapTarget(Navigator.Outlook.CheckButtonStyle);
- ButtonSpecManager.RecreateButtons();
+ ButtonSpecManager?.SetRemapTarget(Navigator.Outlook.CheckButtonStyle);
+ ButtonSpecManager?.RecreateButtons();
}
#endregion
@@ -72,7 +72,7 @@ public override void UpdateButtonSpecMapping()
/// The state for which the image is needed.
/// Image value.
public override Image? GetImage(PaletteState state) =>
- Page.GetImageMapping(_full ? Navigator.Outlook.Full.StackMapImage :
+ Page?.GetImageMapping(_full ? Navigator.Outlook.Full.StackMapImage :
Navigator.Outlook.Mini.StackMapImage);
///
@@ -80,7 +80,7 @@ public override void UpdateButtonSpecMapping()
///
/// String value.
public override string GetShortText() =>
- Page.GetTextMapping(_full ? Navigator.Outlook.Full.StackMapText :
+ Page!.GetTextMapping(_full ? Navigator.Outlook.Full.StackMapText :
Navigator.Outlook.Mini.StackMapText);
///
@@ -88,7 +88,7 @@ public override string GetShortText() =>
///
/// String value.
public override string GetLongText() =>
- Page.GetTextMapping(_full ? Navigator.Outlook.Full.StackMapExtraText :
+ Page!.GetTextMapping(_full ? Navigator.Outlook.Full.StackMapExtraText :
Navigator.Outlook.Mini.StackMapExtraText);
#endregion
diff --git a/Source/Krypton Components/Krypton.Navigator/View Draw/ViewDrawNavRibbonTab.cs b/Source/Krypton Components/Krypton.Navigator/View Draw/ViewDrawNavRibbonTab.cs
index edf339fff..d8422b04e 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Draw/ViewDrawNavRibbonTab.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Draw/ViewDrawNavRibbonTab.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -68,11 +68,11 @@ internal class ViewDrawNavRibbonTab : ViewComposite,
public ViewDrawNavRibbonTab([DisallowNull] KryptonNavigator navigator,
[DisallowNull] KryptonPage page)
{
- Debug.Assert(navigator != null);
- Debug.Assert(page != null);
+ Debug.Assert(navigator is not null);
+ Debug.Assert(page is not null);
- Navigator = navigator;
- Page = page;
+ Navigator = navigator ?? throw new ArgumentNullException(nameof(navigator));
+ Page = page ?? throw new ArgumentNullException(nameof(page));
_lastClick = DateTime.Now.AddDays(-1);
// Associate the page component with this view element
@@ -103,15 +103,15 @@ public ViewDrawNavRibbonTab([DisallowNull] KryptonNavigator navigator,
KeyController = _buttonController;
// Create a decorator to interface with the tooltip manager
- var toolTipController = new ToolTipController(Navigator.ToolTipManager, this, _buttonController);
- var hoverController = new ToolTipController(Navigator.HoverManager, this, toolTipController);
+ var toolTipController = new ToolTipController(Navigator.ToolTipManager!, this, _buttonController);
+ var hoverController = new ToolTipController(Navigator.HoverManager!, this, toolTipController);
// Assign controller for handing mouse input
MouseController = hoverController;
// Create overrides for handling a focus state
- _paletteGeneral = Navigator.StateCommon.RibbonGeneral;
- _overrideStateNormal = new PaletteRibbonTabContentInheritOverride(Page.OverrideFocus.RibbonTab.TabDraw, Page.OverrideFocus.RibbonTab.TabDraw, Page.OverrideFocus.RibbonTab.Content, Page.StateNormal.RibbonTab.TabDraw, Page.StateNormal.RibbonTab.TabDraw, Page.StateNormal.RibbonTab.Content, PaletteState.FocusOverride);
+ _paletteGeneral = Navigator.StateCommon!.RibbonGeneral;
+ _overrideStateNormal = new PaletteRibbonTabContentInheritOverride(Page!.OverrideFocus.RibbonTab.TabDraw, Page!.OverrideFocus.RibbonTab.TabDraw, Page.OverrideFocus.RibbonTab.Content, Page.StateNormal.RibbonTab.TabDraw, Page.StateNormal.RibbonTab.TabDraw, Page.StateNormal.RibbonTab.Content, PaletteState.FocusOverride);
_overrideStateTracking = new PaletteRibbonTabContentInheritOverride(Page.OverrideFocus.RibbonTab.TabDraw, Page.OverrideFocus.RibbonTab.TabDraw, Page.OverrideFocus.RibbonTab.Content, Page.StateTracking.RibbonTab.TabDraw, Page.StateTracking.RibbonTab.TabDraw, Page.StateTracking.RibbonTab.Content, PaletteState.FocusOverride);
_overrideStatePressed = new PaletteRibbonTabContentInheritOverride(Page.OverrideFocus.RibbonTab.TabDraw, Page.OverrideFocus.RibbonTab.TabDraw, Page.OverrideFocus.RibbonTab.Content, Page.StatePressed.RibbonTab.TabDraw, Page.StatePressed.RibbonTab.TabDraw, Page.StatePressed.RibbonTab.Content, PaletteState.FocusOverride);
_overrideStateSelected = new PaletteRibbonTabContentInheritOverride(Page.OverrideFocus.RibbonTab.TabDraw, Page.OverrideFocus.RibbonTab.TabDraw, Page.OverrideFocus.RibbonTab.Content, Page.StateSelected.RibbonTab.TabDraw, Page.StateSelected.RibbonTab.TabDraw, Page.StateSelected.RibbonTab.Content, PaletteState.FocusOverride);
@@ -172,7 +172,7 @@ protected override void Dispose(bool disposing)
{
if (disposing)
{
- if (_mementos is not null)
+ if (_mementos != null)
{
// Dispose of all the mementos in the array
foreach (IDisposable? memento in _mementos)
@@ -184,7 +184,7 @@ protected override void Dispose(bool disposing)
_mementos = null!;
}
- if (ButtonSpecManager is not null)
+ if (ButtonSpecManager != null)
{
ButtonSpecManager.Destruct();
ButtonSpecManager = null!;
@@ -223,7 +223,7 @@ public bool HasFocus
{
get => _overrideStateNormal.Apply;
- set
+ set
{
if (_overrideStateNormal.Apply != value)
{
@@ -304,10 +304,10 @@ public override void Layout(ViewLayoutContext context)
{
// Ensure we are using the correct palette
CheckPaletteState(context);
-
+
// Cache the ribbon shape
- _lastRibbonShape = Navigator.Palette?.GetRibbonShape() ?? PaletteRibbonShape.Office2007;
-
+ _lastRibbonShape = Navigator.GetResolvedPalette()?.GetRibbonShape() ?? PaletteRibbonShape.Office2007;
+
// We take on all the provided size
ClientRectangle = context.DisplayRectangle;
@@ -345,8 +345,13 @@ public override void Layout(ViewLayoutContext context)
/// Perform a render of the elements.
///
/// Rendering context.
- public override void Render(RenderContext context)
+ public override void Render([DisallowNull] RenderContext context)
{
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
// Ensure we are using the correct palette
CheckPaletteState(context);
@@ -358,7 +363,6 @@ public override void Render(RenderContext context)
State,
_currentBack,
_borderBackOrient,
- false,
_mementos[mementoIndex]);
// Let base class draw the child items
@@ -371,14 +375,14 @@ public override void Render(RenderContext context)
/// Gets the content short text.
///
/// String value.
- public string GetShortText() => Page.GetTextMapping(Navigator.Bar.BarMapText);
+ public string GetShortText() => Page!.GetTextMapping(Navigator.Bar.BarMapText);
///
/// Gets the content image.
///
/// The state for which the image is needed.
/// Image value.
- public Image? GetImage(PaletteState state) => Page.GetImageMapping(Navigator.Bar.BarMapImage);
+ public Image? GetImage(PaletteState state) => Page!.GetImageMapping(Navigator.Bar.BarMapImage);
///
/// Gets the image color that should be transparent.
@@ -391,7 +395,7 @@ public override void Render(RenderContext context)
/// Gets the content long text.
///
/// String value.
- public string GetLongText() => Page.GetTextMapping(Navigator.Bar.BarMapExtraText);
+ public string GetLongText() => Page!.GetTextMapping(Navigator.Bar.BarMapExtraText);
#endregion
@@ -401,7 +405,7 @@ public override void Render(RenderContext context)
///
/// Source of the event.
/// An EventArgs containing the event data.
- protected virtual void OnRightClick(object sender, MouseEventArgs e)
+ protected virtual void OnRightClick(object? sender, MouseEventArgs e)
{
// Can only select the page if not already selected and allowed to select a tab
if ((Navigator.SelectedPage != Page) && Navigator.AllowTabSelect)
@@ -410,7 +414,7 @@ protected virtual void OnRightClick(object sender, MouseEventArgs e)
}
// Generate event so user can decide what, if any, context menu to show
- var scma = new ShowContextMenuArgs(Page, Navigator.Pages.IndexOf(Page));
+ var scma = new ShowContextMenuArgs(Page, Navigator.Pages.IndexOf(Page!));
Navigator.OnShowContextMenu(scma);
// Do we need to show a context menu
@@ -418,11 +422,11 @@ protected virtual void OnRightClick(object sender, MouseEventArgs e)
{
if (CommonHelper.ValidKryptonContextMenu(scma.KryptonContextMenu))
{
- scma.KryptonContextMenu.Show(Navigator, Navigator.PointToScreen(new Point(e.X, e.Y)));
+ scma.KryptonContextMenu!.Show(Navigator, Navigator.PointToScreen(new Point(e.X, e.Y)));
}
else if (scma.ContextMenuStrip != null)
{
- if (CommonHelper.ValidContextMenuStrip(scma.ContextMenuStrip) )
+ if (CommonHelper.ValidContextMenuStrip(scma.ContextMenuStrip))
{
scma.ContextMenuStrip.Show(Navigator.PointToScreen(new Point(e.X, e.Y)));
}
@@ -443,9 +447,13 @@ private int StateIndex(PaletteState state)
{
Array stateValues = Enum.GetValues(typeof(PaletteState));
+ PaletteState? ps;
+
for (var i = 0; i < stateValues.Length; i++)
{
- if ((PaletteState)stateValues.GetValue(i) == state)
+ ps = stateValues.GetValue(i) as PaletteState?;
+
+ if (ps is not null && ps == state)
{
return i;
}
@@ -460,7 +468,7 @@ private void CheckPaletteState(ViewContext context)
PaletteState buttonState = State;
// If the actual control is not enabled, force to disabled state
- if (!IsFixed && !context.Control.Enabled)
+ if (!IsFixed && !context.Control!.Enabled)
{
buttonState = PaletteState.Disabled;
}
@@ -496,7 +504,7 @@ private void CheckPaletteState(ViewContext context)
case PaletteState.Normal:
case PaletteState.CheckedNormal:
buttonState = PaletteState.Normal;
- break;
+ break;
case PaletteState.Tracking:
case PaletteState.CheckedTracking:
buttonState = PaletteState.Tracking;
@@ -517,21 +525,25 @@ private void CheckPaletteState(ViewContext context)
_currentBack = Navigator.StateDisabled.RibbonTab.TabDraw;
_currentContent = Navigator.StateDisabled.RibbonTab.Content;
break;
+
case PaletteState.Normal:
_currentText = _overrideStateNormal;
_currentBack = _overrideStateNormal;
_currentContent = _overrideStateNormal;
break;
+
case PaletteState.Tracking:
_currentText = _overrideStateTracking;
_currentBack = _overrideStateTracking;
_currentContent = _overrideStateTracking;
break;
+
case PaletteState.Pressed:
_currentText = _overrideStatePressed;
_currentBack = _overrideStatePressed;
_currentContent = _overrideStatePressed;
break;
+
case PaletteState.CheckedNormal:
case PaletteState.CheckedTracking:
case PaletteState.CheckedPressed:
@@ -539,35 +551,37 @@ private void CheckPaletteState(ViewContext context)
_currentBack = _overrideStateSelected;
_currentContent = _overrideStateSelected;
break;
+
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(buttonState.ToString());
break;
}
// Switch the child elements over to correct state
ElementState = buttonState;
- this[0][0].ElementState = buttonState;
+ this[0]![0]!.ElementState = buttonState;
// Update content palette with the current ribbon text palette
_contentProvider.PaletteRibbonText = _currentText;
_contentProvider.PaletteContent = _currentContent;
}
- private void OnClick(object sender, EventArgs e)
+ private void OnClick(object? sender, EventArgs e)
{
// Generate click event for the page header
- Navigator.OnTabClicked(new KryptonPageEventArgs(Page, Navigator.Pages.IndexOf(Page)));
+ Navigator.OnTabClicked(new KryptonPageEventArgs(Page, Navigator.Pages.IndexOf(Page!)));
// If this click is within the double click time of the last one, generate the double click event.
DateTime now = DateTime.Now;
if ((now - _lastClick).TotalMilliseconds < SystemInformation.DoubleClickTime)
{
// Tell button controller to abort any drag attempt
- _buttonController.ClearDragRect();
+ _buttonController!.ClearDragRect();
// Generate click event for the page header
- Navigator.OnTabDoubleClicked(new KryptonPageEventArgs(Page, Navigator.Pages.IndexOf(Page)));
+ Navigator.OnTabDoubleClicked(new KryptonPageEventArgs(Page, Navigator.Pages.IndexOf(Page!)));
// Prevent a third click causing another double click by resetting the now time backwards
now = now.AddDays(-1);
@@ -587,22 +601,22 @@ private void OnClick(object sender, EventArgs e)
// If in a tabs only mode then show the popup for the page
if (Navigator.NavigatorMode == NavigatorMode.BarRibbonTabOnly)
{
- Navigator.ShowPopupPage(Page, this, null);
+ Navigator.ShowPopupPage(Page!, this, null);
}
}
}
- private void OnDragStart(object sender, DragStartEventCancelArgs e) => Navigator.InternalDragStart(e, Page);
+ private void OnDragStart(object? sender, DragStartEventCancelArgs e) => Navigator.InternalDragStart(e, Page);
- private void OnDragMove(object sender, PointEventArgs e) => Navigator.InternalDragMove(e);
+ private void OnDragMove(object? sender, PointEventArgs e) => Navigator.InternalDragMove(e);
- private void OnDragEnd(object sender, PointEventArgs e) => Navigator.InternalDragEnd(e);
+ private void OnDragEnd(object? sender, PointEventArgs e) => Navigator.InternalDragEnd(e);
- private void OnDragQuit(object sender, EventArgs e) => Navigator.InternalDragQuit();
+ private void OnDragQuit(object? sender, EventArgs e) => Navigator.InternalDragQuit();
- private void OnButtonDragRectangle(object sender, ButtonDragRectangleEventArgs e) => ButtonDragRectangle?.Invoke(this, e);
+ private void OnButtonDragRectangle(object? sender, ButtonDragRectangleEventArgs e) => ButtonDragRectangle?.Invoke(this, e);
- private void OnButtonDragOffset(object sender, ButtonDragOffsetEventArgs e) => ButtonDragOffset?.Invoke(this, e);
+ private void OnButtonDragOffset(object? sender, ButtonDragOffsetEventArgs e) => ButtonDragOffset?.Invoke(this, e);
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutBar.cs b/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutBar.cs
index 81d6a2dd3..31d760950 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutBar.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutBar.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -69,8 +69,8 @@ public ViewLayoutBar(BarItemSizing itemSizing,
int barMinimumHeight,
TabBorderStyle tabBorderStyle,
bool reorderSelectedLine)
- : this(null, PaletteMetricInt.None, itemSizing,
- itemAlignment, barMultiline, itemMinimumSize,
+ : this(null, PaletteMetricInt.None, itemSizing,
+ itemAlignment, barMultiline, itemMinimumSize,
itemMaximumSize, barMinimumHeight, tabBorderStyle,
reorderSelectedLine)
{
@@ -88,7 +88,7 @@ public ViewLayoutBar(BarItemSizing itemSizing,
/// Minimum allowed item size.
/// Minimum height of the bar.
/// Should line with selection be reordered.
- public ViewLayoutBar(IPaletteMetric paletteMetric,
+ public ViewLayoutBar(IPaletteMetric? paletteMetric,
PaletteMetricInt metricGap,
BarItemSizing itemSizing,
RelativePositionAlign itemAlignment,
@@ -97,9 +97,9 @@ public ViewLayoutBar(IPaletteMetric paletteMetric,
Size itemMaximumSize,
int barMinimumHeight,
bool reorderSelectedLine)
- : this(paletteMetric, metricGap, itemSizing,
- itemAlignment, barMultiline, itemMinimumSize,
- itemMaximumSize, barMinimumHeight,
+ : this(paletteMetric, metricGap, itemSizing,
+ itemAlignment, barMultiline, itemMinimumSize,
+ itemMaximumSize, barMinimumHeight,
TabBorderStyle.RoundedOutsizeMedium,
reorderSelectedLine)
{
@@ -118,7 +118,7 @@ public ViewLayoutBar(IPaletteMetric paletteMetric,
/// Minimum height of the bar.
/// Tab border style.
/// Should line with selection be reordered.
- public ViewLayoutBar(IPaletteMetric paletteMetric,
+ public ViewLayoutBar(IPaletteMetric? paletteMetric,
PaletteMetricInt metricGap,
BarItemSizing itemSizing,
RelativePositionAlign itemAlignment,
@@ -296,9 +296,19 @@ public void SetMetrics(IPaletteMetric paletteMetric,
/// Discover the preferred size of the element.
///
/// Layout context.
- public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
+ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext? context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
+
+ if (context is null)
+ {
+ throw new ArgumentNullException(nameof(context));
+ }
+
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
// Reset the largest child size to empty
_maximumItem = Size.Empty;
@@ -315,9 +325,9 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
// Line spacing gap can never be less than zero
var lineGap = (gap < 0 ? 0 : gap);
-
+
// Do we need to apply right to left by positioning children in reverse order?
- var reversed = (IsOneLine && !BarVertical && (context.Control.RightToLeft == RightToLeft.Yes));
+ var reversed = (IsOneLine && !BarVertical && (context.Control!.RightToLeft == RightToLeft.Yes));
// Allocate caching for size of each child element
_childSizes = new Size[Count];
@@ -326,17 +336,17 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
var selectedChildIndex = -1;
// Find the size of each child in turn
- for(var i=0; i 0) ? gap : 0;
- // Add on the heght of the child
+ // Add on the height of the child
yAdd += _childSizes[i].Height;
// Does this item extend beyond visible line?
@@ -771,10 +785,10 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
if (selectedChildIndex >= 0)
{
// Find the line details that contains this child index
- for(var i=0; i<_lineDetails.Count; i++)
+ for (var i = 0; i < _lineDetails.Count; i++)
{
// Is the selected item in the range of items for this line?
- if ((selectedChildIndex >= _lineDetails[i].StartIndex) &&
+ if ((selectedChildIndex >= _lineDetails[i].StartIndex) &&
(selectedChildIndex < (_lineDetails[i].StartIndex + _lineDetails[i].ItemCount)))
{
// Remove the line details
@@ -816,7 +830,17 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
/// Layout context.
public override void Layout([DisallowNull] ViewLayoutContext context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
+
+ if (context is null)
+ {
+ throw new ArgumentNullException(nameof(context));
+ }
+
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
// We take on all the available display area
ClientRectangle = context.DisplayRectangle;
@@ -837,7 +861,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
var reversePosition = false;
// Do we need to apply right to left by positioning children in reverse order?
- if (!BarVertical && (context.Control.RightToLeft == RightToLeft.Yes))
+ if (!BarVertical && (context.Control!.RightToLeft == RightToLeft.Yes))
{
if (IsOneLine)
{
@@ -879,7 +903,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
if (!_childSizes[itemIndex].IsEmpty)
{
// Get access to the indexed child
- ViewBase child = this[(reverseAccess ? (lineDetails.StartIndex + lineDetails.ItemCount) - 1 - i :
+ ViewBase? child = this[(reverseAccess ? (lineDetails.StartIndex + lineDetails.ItemCount) - 1 - i :
lineDetails.StartIndex + i)];
// Add on the height of the child
@@ -898,7 +922,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
context.DisplayRectangle = new Rectangle(new Point(xPosition, yPosition), _childSizes[itemIndex]);
// Ask the child to layout
- child.Layout(context);
+ child?.Layout(context);
// Move to next child position
if (reversePosition)
@@ -946,7 +970,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
if (!_childSizes[itemIndex].IsEmpty)
{
// Get access to the indexed child
- ViewBase child = this[(reverseAccess ? (lineDetails.StartIndex + lineDetails.ItemCount) - 1 - i :
+ ViewBase? child = this[(reverseAccess ? (lineDetails.StartIndex + lineDetails.ItemCount) - 1 - i :
lineDetails.StartIndex + i)];
// Add on the width of the child
@@ -965,7 +989,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
context.DisplayRectangle = new Rectangle(new Point(xPosition, yPosition), _childSizes[itemIndex]);
// Ask the child to layout
- child.Layout(context);
+ child?.Layout(context);
// Move to next child position
if (reversePosition)
@@ -997,14 +1021,14 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
private bool IsOneLine => BarMultiline is BarMultiline.Singleline or BarMultiline.Shrinkline or BarMultiline.Expandline or BarMultiline.Exactline;
- private int FindStartingXPosition(ViewLayoutContext context,
+ private int FindStartingXPosition(ViewLayoutContext context,
LineDetails lineDetails,
bool reversePosition)
{
RelativePositionAlign align = ItemAlignment;
// Do we need to apply right to left by aligning in opposite direction?
- if (IsOneLine && !BarVertical && (context.Control.RightToLeft == RightToLeft.Yes))
+ if (IsOneLine && !BarVertical && (context.Control!.RightToLeft == RightToLeft.Yes))
{
switch (align)
{
@@ -1021,17 +1045,21 @@ private int FindStartingXPosition(ViewLayoutContext context,
{
case RelativePositionAlign.Near:
return reversePosition ? ClientRectangle.Right : ClientLocation.X;
+
case RelativePositionAlign.Center:
return reversePosition
? ClientRectangle.Right - ((ClientRectangle.Width - lineDetails.InlineLength) / 2)
: ClientLocation.X + ((ClientRectangle.Width - lineDetails.InlineLength) / 2);
+
case RelativePositionAlign.Far:
return reversePosition
? ClientRectangle.Right - (ClientRectangle.Width - lineDetails.InlineLength)
: ClientLocation.X + (ClientRectangle.Width - lineDetails.InlineLength);
+
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(align.ToString());
return ClientLocation.X;
}
}
@@ -1043,7 +1071,7 @@ private int FindStartingYPosition(ViewLayoutContext context,
RelativePositionAlign align = ItemAlignment;
// Do we need to apply right to left by aligning in opposite direction?
- if (IsOneLine && !BarVertical && (context.Control.RightToLeft == RightToLeft.Yes))
+ if (IsOneLine && !BarVertical && (context.Control!.RightToLeft == RightToLeft.Yes))
{
switch (align)
{
@@ -1060,6 +1088,7 @@ private int FindStartingYPosition(ViewLayoutContext context,
{
case RelativePositionAlign.Near:
return reversePosition ? ClientRectangle.Bottom : ClientLocation.Y;
+
case RelativePositionAlign.Center:
if (reversePosition)
{
@@ -1069,6 +1098,7 @@ private int FindStartingYPosition(ViewLayoutContext context,
{
return ClientLocation.Y + ((ClientRectangle.Height - lineDetails.InlineLength) / 2);
}
+
case RelativePositionAlign.Far:
if (reversePosition)
{
@@ -1078,9 +1108,11 @@ private int FindStartingYPosition(ViewLayoutContext context,
{
return ClientLocation.Y + (ClientRectangle.Height - lineDetails.InlineLength);
}
+
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(align.ToString());
return ClientLocation.Y;
}
}
diff --git a/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutBarForTabs.cs b/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutBarForTabs.cs
index e1fbd8e07..20a43820e 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutBarForTabs.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutBarForTabs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -69,7 +69,7 @@ public ViewLayoutBarForTabs(IPaletteMetric paletteMetric,
int barMinimumHeight,
TabBorderStyle tabBorderStyle,
bool reorderSelectedLine)
- : base(paletteMetric, metricGap, itemSizing,
+ : base(paletteMetric, metricGap, itemSizing,
itemAlignment, barMultiline, itemMinimumSize,
itemMaximumSize, barMinimumHeight, tabBorderStyle,
reorderSelectedLine)
@@ -115,8 +115,13 @@ public override void Render(RenderContext context)
#endregion
#region Implementation
- private void RenderChildren(RenderContext context, bool drawChecked)
+ private void RenderChildren([DisallowNull] RenderContext context, bool drawChecked)
{
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
// Use tab style to decide what order the children are drawn in
var orderedChildren = context.Renderer.RenderTabBorder.GetTabBorderLeftDrawing(TabBorderStyle) ? this : Reverse();
@@ -132,7 +137,7 @@ private void RenderChildren(RenderContext context, bool drawChecked)
if ((buttonBar != null) ||
(tab != null))
{
- var itemChecked = buttonBar?.Checked ?? tab.Checked;
+ var itemChecked = buttonBar?.Checked ?? tab!.Checked;
// Are we allowed to draw the checked item?
if ((!itemChecked && !drawChecked) ||
diff --git a/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutDockerOverlap.cs b/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutDockerOverlap.cs
index 39fb02eaf..044d378dd 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutDockerOverlap.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutDockerOverlap.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -34,14 +34,14 @@ public ViewLayoutDockerOverlap([DisallowNull] ViewDrawCanvas drawCanvas,
[DisallowNull] ViewLayoutInsetOverlap layoutOverlap,
[DisallowNull] ViewLayoutBarForTabs layoutTabs)
{
- Debug.Assert(drawCanvas != null);
- Debug.Assert(layoutOverlap != null);
- Debug.Assert(layoutTabs != null);
+ Debug.Assert(drawCanvas is not null);
+ Debug.Assert(layoutOverlap is not null);
+ Debug.Assert(layoutTabs is not null);
// Remember provided references
- _drawCanvas = drawCanvas;
- _layoutOverlap = layoutOverlap;
- _layoutTabs = layoutTabs;
+ _drawCanvas = drawCanvas ?? throw new ArgumentNullException(nameof(_drawCanvas));
+ _layoutOverlap = layoutOverlap ?? throw new ArgumentNullException(nameof(_layoutOverlap));
+ _layoutTabs = layoutTabs ?? throw new ArgumentNullException(nameof(_layoutTabs));
}
///
@@ -58,7 +58,7 @@ public override string ToString() =>
///
/// Gets the rounding value to apply on the edges.
///
- public int BorderWidth => _drawCanvas.PaletteBorder.GetBorderWidth(_drawCanvas.State);
+ public int BorderWidth => _drawCanvas.PaletteBorder!.GetBorderWidth(_drawCanvas.State);
#endregion
@@ -67,7 +67,7 @@ public override string ToString() =>
/// Perform rendering after child elements are rendered.
///
/// Rendering context.
- public override void RenderAfter(RenderContext context)
+ public override void RenderAfter(RenderContext context)
{
// Ask for another draw of the child but this time only drawing the selected tab
_layoutTabs.DrawChecked = true;
@@ -112,7 +112,7 @@ protected override Size UpdatePreferredSize(Size preferredSize)
/// Original filler rectangle.
/// Owning control instance.
/// Modified rectangle.
- protected override Rectangle UpdateFillerRect(Rectangle fillerRect,
+ protected override Rectangle UpdateFillerRect(Rectangle fillerRect,
Control control)
{
var borderWidth = BorderWidth;
diff --git a/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutInsetOverlap.cs b/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutInsetOverlap.cs
index 5c7a06eaa..b5259d4d1 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutInsetOverlap.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutInsetOverlap.cs
@@ -5,11 +5,12 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
+// ReSharper disable PossibleLossOfFraction
namespace Krypton.Navigator
{
///
@@ -28,7 +29,12 @@ internal class ViewLayoutInsetOverlap : ViewComposite
///
public ViewLayoutInsetOverlap([DisallowNull] ViewDrawCanvas drawCanvas)
{
- Debug.Assert(drawCanvas != null);
+ Debug.Assert(drawCanvas is not null);
+
+ if (drawCanvas is null)
+ {
+ throw new ArgumentNullException(nameof(drawCanvas));
+ }
// Remember source of the rounding values
_drawCanvas = drawCanvas;
@@ -69,11 +75,11 @@ public float Rounding
get
{
// Get the rounding and width values for the border
- var rounding = _drawCanvas.PaletteBorder.GetBorderRounding(_drawCanvas.State);
+ var rounding = _drawCanvas.PaletteBorder!.GetBorderRounding(_drawCanvas.State);
var width = _drawCanvas.PaletteBorder.GetBorderWidth(_drawCanvas.State);
// We have to add half the width as that increases the rounding effect
- return rounding + (width / 2);
+ return rounding + width / 2;
}
}
#endregion
@@ -82,7 +88,7 @@ public float Rounding
///
/// Gets the rounding value to apply on the edges.
///
- public int BorderWidth => _drawCanvas.PaletteBorder.GetBorderWidth(_drawCanvas.State);
+ public int BorderWidth => _drawCanvas.PaletteBorder!.GetBorderWidth(_drawCanvas.State);
#endregion
@@ -93,7 +99,12 @@ public float Rounding
/// Layout context.
public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
+
+ if (context is null)
+ {
+ throw new ArgumentNullException(nameof(context));
+ }
// Get the preferred size requested by the children
Size size = base.GetPreferredSize(context);
@@ -101,12 +112,12 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
// Apply the rounding in the appropriate orientation
if (Orientation is VisualOrientation.Top or VisualOrientation.Bottom)
{
- size.Width += Convert.ToInt32(Rounding) * 2;
+ size.Width += Convert.ToInt32(Rounding * 2);
size.Height += BorderWidth;
}
else
{
- size.Height += Convert.ToInt32(Rounding) * 2;
+ size.Height += Convert.ToInt32(Rounding * 2);
size.Width += BorderWidth;
}
@@ -119,7 +130,12 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
/// Layout context.
public override void Layout([DisallowNull] ViewLayoutContext context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
+
+ if (context is null)
+ {
+ throw new ArgumentNullException(nameof(context));
+ }
// We take on all the available display area
ClientRectangle = context.DisplayRectangle;
diff --git a/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutOutlookFull.cs b/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutOutlookFull.cs
index e7eedd7c6..5d272abde 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutOutlookFull.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutOutlookFull.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -37,7 +37,7 @@ public ViewLayoutOutlookFull([DisallowNull] ViewBuilderOutlookBase viewBuilder,
VisualControl rootControl,
ViewBase viewportFiller,
PaletteBorderEdge paletteBorderEdge,
- IPaletteMetric paletteMetrics,
+ IPaletteMetric? paletteMetrics,
PaletteMetricPadding metricPadding,
PaletteMetricInt metricOvers,
VisualOrientation orientation,
@@ -45,12 +45,12 @@ public ViewLayoutOutlookFull([DisallowNull] ViewBuilderOutlookBase viewBuilder,
bool animateChange,
bool vertical,
NeedPaintHandler needPaintDelegate)
- : base(rootControl, viewportFiller, paletteBorderEdge, paletteMetrics,
- metricPadding, metricOvers, orientation, alignment, animateChange,
+ : base(rootControl, viewportFiller, paletteBorderEdge, paletteMetrics,
+ metricPadding, metricOvers, orientation, alignment, animateChange,
vertical, needPaintDelegate)
{
- Debug.Assert(viewBuilder != null);
- ViewBuilder = viewBuilder;
+ Debug.Assert(viewBuilder is not null);
+ ViewBuilder = viewBuilder ?? throw new ArgumentNullException(nameof(viewBuilder));
}
///
@@ -106,10 +106,10 @@ public override void Layout(ViewLayoutContext context)
var beforeOverflowState = ViewBuilder.GetOverflowButtonStates();
// Make all stacking items visible so all that can be shown will be
- ViewBuilder.UnshrinkAppropriatePages();
+ ViewBuilder.UnShrinkAppropriatePages();
// Do not actually change the layout of any child controls
- context.ViewManager.DoNotLayoutControls = true;
+ context.ViewManager!.DoNotLayoutControls = true;
do
{
diff --git a/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutOutlookMini.cs b/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutOutlookMini.cs
index 0a3c5a788..9e50281d3 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutOutlookMini.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutOutlookMini.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -24,8 +24,8 @@ internal class ViewLayoutOutlookMini : ViewLayoutDocker
/// View builder reference.
public ViewLayoutOutlookMini([DisallowNull] ViewBuilderOutlookBase viewBuilder)
{
- Debug.Assert(viewBuilder != null);
- ViewBuilder = viewBuilder;
+ Debug.Assert(viewBuilder is not null);
+ ViewBuilder = viewBuilder ?? throw new ArgumentNullException(nameof(viewBuilder));
}
///
@@ -58,7 +58,7 @@ public ViewBuilderOutlookBase ViewBuilder
public override void Layout(ViewLayoutContext context)
{
// Make all stacking items that should be visible are visible
- ViewBuilder.UnshrinkAppropriatePages();
+ ViewBuilder.UnShrinkAppropriatePages();
// Let base class continue with standard layout
base.Layout(context);
diff --git a/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutPageHide.cs b/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutPageHide.cs
index 345618674..a60520da9 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutPageHide.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutPageHide.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -33,10 +33,10 @@ internal class ViewLayoutPageHide : ViewLayoutNull
///
public ViewLayoutPageHide([DisallowNull] KryptonNavigator navigator)
{
- Debug.Assert(navigator != null);
+ Debug.Assert(navigator is not null);
// Remember back reference
- _navigator = navigator;
+ _navigator = navigator ?? throw new ArgumentNullException(nameof(navigator));
}
///
@@ -66,20 +66,25 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
/// Layout context.
public override void Layout([DisallowNull] ViewLayoutContext context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
+
+ if (context is null)
+ {
+ throw new ArgumentNullException(nameof(context));
+ }
// We take on all the available display area
ClientRectangle = context.DisplayRectangle;
// Are we allowed to layout child controls?
- if (!context.ViewManager.DoNotLayoutControls)
+ if (!context.ViewManager!.DoNotLayoutControls)
{
// Are we allowed to actually layout the pages?
if (_navigator is { InternalCanLayout: true, IsChildPanelBorrowed: false })
- // Do not position the child panel if it is borrowed
+ // Do not position the child panel if it is borrowed
{
// Position the child panel for showing page information
- _navigator.ChildPanel.SetBounds(HIDDEN_OFFSET,
+ _navigator.ChildPanel!.SetBounds(HIDDEN_OFFSET,
HIDDEN_OFFSET,
ClientWidth,
ClientHeight);
diff --git a/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutPageShow.cs b/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutPageShow.cs
index 777c92463..4408cc0da 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutPageShow.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutPageShow.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -28,10 +28,10 @@ internal class ViewLayoutPageShow : ViewLayoutNull
///
public ViewLayoutPageShow([DisallowNull] KryptonNavigator navigator)
{
- Debug.Assert(navigator != null);
+ Debug.Assert(navigator is not null);
// Remember back reference
- _navigator = navigator;
+ _navigator = navigator ?? throw new ArgumentNullException(nameof(navigator));
_minimumAsPreferred = false;
}
@@ -93,20 +93,25 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
/// Layout context.
public override void Layout([DisallowNull] ViewLayoutContext context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
+
+ if (context is null)
+ {
+ throw new ArgumentNullException(nameof(context));
+ }
// We take on all the available display area
ClientRectangle = context.DisplayRectangle;
// Are we allowed to layout child controls?
- if (!context.ViewManager.DoNotLayoutControls)
+ if (!context.ViewManager!.DoNotLayoutControls)
{
// Are we allowed to actually layout the pages?
if (_navigator is { InternalCanLayout: true, IsChildPanelBorrowed: false })
- // Do not position the child panel or pages if it is borrowed
+ // Do not position the child panel or pages if it is borrowed
{
// Position the child panel for showing page information
- _navigator.ChildPanel.SetBounds(ClientLocation.X,
+ _navigator.ChildPanel!.SetBounds(ClientLocation.X,
ClientLocation.Y,
ClientWidth,
ClientHeight);
diff --git a/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutPopupPage.cs b/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutPopupPage.cs
index 9d492c5d9..07147cef3 100644
--- a/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutPopupPage.cs
+++ b/Source/Krypton Components/Krypton.Navigator/View Layout/ViewLayoutPopupPage.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -31,11 +31,11 @@ internal class ViewLayoutPopupPage : ViewLayoutNull
public ViewLayoutPopupPage([DisallowNull] KryptonNavigator navigator,
[DisallowNull] KryptonPage page)
{
- Debug.Assert(navigator != null);
- Debug.Assert(page != null);
+ Debug.Assert(navigator is not null);
+ Debug.Assert(page is not null);
- _navigator = navigator;
- _page = page;
+ _navigator = navigator ?? throw new ArgumentNullException(nameof(navigator));
+ _page = page ?? throw new ArgumentNullException(nameof(page));
}
///
@@ -55,7 +55,13 @@ public override string ToString() =>
/// Layout context.
public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
+
+ if (context is null)
+ {
+ throw new ArgumentNullException(nameof(context));
+ }
+
return _page.GetPreferredSize(context.DisplayRectangle.Size);
}
@@ -65,13 +71,18 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
/// Layout context.
public override void Layout([DisallowNull] ViewLayoutContext context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
+ if (context is null)
+ {
+ throw new ArgumentNullException(nameof(context));
+ }
+
// We take on all the available display area
ClientRectangle = context.DisplayRectangle;
// Are we allowed to layout child controls?
- if (!context.ViewManager.DoNotLayoutControls)
+ if (!context.ViewManager!.DoNotLayoutControls)
{
// Are we allowed to actually layout the pages?
if (_navigator.InternalCanLayout)
@@ -85,7 +96,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
}
// Update position of child panel if not already in correct position
- if ((_navigator.ChildPanel.Location != ClientLocation) ||
+ if ((_navigator.ChildPanel!.Location != ClientLocation) ||
(_navigator.ChildPanel.Width != ClientWidth) ||
(_navigator.ChildPanel.Height != ClientHeight))
{
diff --git a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecAppMenu.cs b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecAppMenu.cs
index 817c1052a..a5ce630ce 100644
--- a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecAppMenu.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecAppMenu.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
diff --git a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecExpandRibbon.cs b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecExpandRibbon.cs
index 3a4c9623f..70965802a 100644
--- a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecExpandRibbon.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecExpandRibbon.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -30,8 +30,9 @@ public class ButtonSpecExpandRibbon : ButtonSpec
/// Reference to owning ribbon control.
public ButtonSpecExpandRibbon([DisallowNull] KryptonRibbon ribbon)
{
- Debug.Assert(ribbon != null);
- _ribbon = ribbon;
+ Debug.Assert(ribbon is not null);
+
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
// Fix the type
ProtectedType = PaletteButtonSpecStyle.RibbonExpand;
@@ -65,14 +66,14 @@ public PaletteButtonSpecStyle ButtonSpecType
///
/// Palette to use for inheriting values.
/// Button visibility.
- public override bool GetVisible(PaletteBase? palette) => _ribbon is { ShowMinimizeButton: true, MinimizedMode: true };
+ public override bool GetVisible(PaletteBase palette) => _ribbon is { ShowMinimizeButton: true, MinimizedMode: true };
///
/// Gets the button enabled state.
///
/// Palette to use for inheriting values.
/// Button enabled state.
- public override ButtonEnabled GetEnabled(PaletteBase? palette) => ButtonEnabled.True;
+ public override ButtonEnabled GetEnabled(PaletteBase palette) => ButtonEnabled.True;
///
/// Gets the button checked state.
diff --git a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecManagerLayoutAppButton.cs b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecManagerLayoutAppButton.cs
index 9cdfc8354..49bf8ce8f 100644
--- a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecManagerLayoutAppButton.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecManagerLayoutAppButton.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -36,7 +36,7 @@ public class ButtonSpecManagerLayoutAppButton : ButtonSpecManagerLayout
/// Delegate for notifying paint requests.
public ButtonSpecManagerLayoutAppButton(ViewContextMenuManager viewManager,
Control control,
- [DisallowNull] PaletteRedirect? redirector,
+ [DisallowNull] PaletteRedirect redirector,
ButtonSpecCollectionBase variableSpecs,
ButtonSpecCollectionBase? fixedSpecs,
ViewLayoutDocker[] viewDockers,
@@ -70,7 +70,7 @@ public ButtonSpecManagerLayoutAppButton(ViewContextMenuManager viewManager,
/// ButtonSpec instance.
/// ButtonSpecView derived class.
protected override ButtonSpecView CreateButtonSpecView(PaletteRedirect? redirector,
- IPaletteMetric? viewPaletteMetric,
+ IPaletteMetric viewPaletteMetric,
PaletteMetricPadding viewMetricPadding,
ButtonSpec buttonSpec) =>
new ButtonSpecViewAppButton(redirector, viewPaletteMetric,
diff --git a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecManagerLayoutRibbon.cs b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecManagerLayoutRibbon.cs
index 5a7339602..484ccdc40 100644
--- a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecManagerLayoutRibbon.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecManagerLayoutRibbon.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -34,7 +34,7 @@ public class ButtonSpecManagerLayoutRibbon : ButtonSpecManagerLayout
/// Delegate for returning a tool strip renderer.
/// Delegate for notifying paint requests.
public ButtonSpecManagerLayoutRibbon(KryptonRibbon ribbon,
- PaletteRedirect? redirector,
+ PaletteRedirect redirector,
ButtonSpecCollectionBase variableSpecs,
ButtonSpecCollectionBase fixedSpecs,
ViewLayoutDocker[] viewDockers,
@@ -59,11 +59,11 @@ public ButtonSpecManagerLayoutRibbon(KryptonRibbon ribbon,
/// Target metric padding.
/// ButtonSpec instance.
/// ButtonSpecView derived class.
- protected override ButtonSpecView CreateButtonSpecView(PaletteRedirect? redirector,
- IPaletteMetric? viewPaletteMetric,
- PaletteMetricPadding viewMetricPadding,
+ protected override ButtonSpecView CreateButtonSpecView(PaletteRedirect? redirector,
+ IPaletteMetric viewPaletteMetric,
+ PaletteMetricPadding viewMetricPadding,
ButtonSpec buttonSpec) =>
- new ButtonSpecViewRibbon(redirector, viewPaletteMetric,
+ new ButtonSpecViewRibbon(redirector, viewPaletteMetric,
viewMetricPadding, this, buttonSpec);
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMdiChildClose.cs b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMdiChildClose.cs
index 7039accc6..73bbfb13d 100644
--- a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMdiChildClose.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMdiChildClose.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -31,8 +31,8 @@ public class ButtonSpecMdiChildClose : ButtonSpecMdiChildFixed
public ButtonSpecMdiChildClose([DisallowNull] KryptonRibbon ribbon)
: base(PaletteButtonSpecStyle.PendantClose)
{
- Debug.Assert(ribbon != null);
- _ribbon = ribbon;
+ Debug.Assert(ribbon is not null);
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
}
#endregion
@@ -42,7 +42,7 @@ public ButtonSpecMdiChildClose([DisallowNull] KryptonRibbon ribbon)
///
/// Palette to use for inheriting values.
/// Button visibility.
- public override bool GetVisible(PaletteBase? 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,7 +60,7 @@ public override bool GetVisible(PaletteBase? palette)
///
/// Palette to use for inheriting values.
/// Button enabled state.
- public override ButtonEnabled GetEnabled(PaletteBase? palette) => ButtonEnabled.True;
+ public override ButtonEnabled GetEnabled(PaletteBase palette) => ButtonEnabled.True;
///
/// Gets the button checked state.
@@ -85,7 +85,7 @@ protected override void OnClick(EventArgs e)
{
if (!_ribbon.InDesignMode)
{
- MdiChild.Close();
+ MdiChild?.Close();
// Let base class fire any other attached events
base.OnClick(e);
diff --git a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMdiChildFixed.cs b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMdiChildFixed.cs
index dacf6695b..cdb4357c6 100644
--- a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMdiChildFixed.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMdiChildFixed.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
diff --git a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMdiChildMin.cs b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMdiChildMin.cs
index 48e2a9502..af76116c0 100644
--- a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMdiChildMin.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMdiChildMin.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -31,8 +31,8 @@ public class ButtonSpecMdiChildMin : ButtonSpecMdiChildFixed
public ButtonSpecMdiChildMin([DisallowNull] KryptonRibbon ribbon)
: base(PaletteButtonSpecStyle.PendantMin)
{
- Debug.Assert(ribbon != null);
- _ribbon = ribbon;
+ Debug.Assert(ribbon is not null);
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
}
#endregion
@@ -42,7 +42,7 @@ public ButtonSpecMdiChildMin([DisallowNull] KryptonRibbon ribbon)
///
/// Palette to use for inheriting values.
/// Button visibiliy.
- public override bool GetVisible(PaletteBase? 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(PaletteBase? palette)
///
/// Palette to use for inheriting values.
/// Button enabled state.
- public override ButtonEnabled GetEnabled(PaletteBase? 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)
@@ -109,7 +109,7 @@ protected override void OnClick(EventArgs e)
{
if (!_ribbon.InDesignMode)
{
- MdiChild.WindowState = FormWindowState.Minimized;
+ MdiChild!.WindowState = FormWindowState.Minimized;
// Let base class fire any other attached events
base.OnClick(e);
diff --git a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMdiChildRestore.cs b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMdiChildRestore.cs
index 82d2c0f0b..1291afe5e 100644
--- a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMdiChildRestore.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMdiChildRestore.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -31,8 +31,8 @@ public class ButtonSpecMdiChildRestore : ButtonSpecMdiChildFixed
public ButtonSpecMdiChildRestore([DisallowNull] KryptonRibbon ribbon)
: base(PaletteButtonSpecStyle.PendantRestore)
{
- Debug.Assert(ribbon != null);
- _ribbon = ribbon;
+ Debug.Assert(ribbon is not null);
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
}
#endregion
@@ -42,7 +42,7 @@ public ButtonSpecMdiChildRestore([DisallowNull] KryptonRibbon ribbon)
///
/// Palette to use for inheriting values.
/// Button visibiliy.
- public override bool GetVisible(PaletteBase? 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(PaletteBase? palette)
///
/// Palette to use for inheriting values.
/// Button enabled state.
- public override ButtonEnabled GetEnabled(PaletteBase? palette)
+ public override ButtonEnabled GetEnabled(PaletteBase palette)
{
// Cannot be enabled if not attached to an mdi child window
if (MdiChild == null)
@@ -109,7 +109,7 @@ protected override void OnClick(EventArgs e)
{
if (!_ribbon.InDesignMode)
{
- MdiChild.WindowState = FormWindowState.Normal;
+ MdiChild!.WindowState = FormWindowState.Normal;
// Let base class fire any other attached events
base.OnClick(e);
diff --git a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMinimizeRibbon.cs b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMinimizeRibbon.cs
index 554a6d1b5..5479788fd 100644
--- a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMinimizeRibbon.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecMinimizeRibbon.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -30,8 +30,8 @@ public class ButtonSpecMinimizeRibbon : ButtonSpec
/// Reference to owning ribbon control.
public ButtonSpecMinimizeRibbon([DisallowNull] KryptonRibbon ribbon)
{
- Debug.Assert(ribbon != null);
- _ribbon = ribbon;
+ Debug.Assert(ribbon is not null);
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
// Fix the type
ProtectedType = PaletteButtonSpecStyle.RibbonMinimize;
@@ -65,14 +65,14 @@ public PaletteButtonSpecStyle ButtonSpecType
///
/// Palette to use for inheriting values.
/// Button visibiliy.
- public override bool GetVisible(PaletteBase? palette) => _ribbon is { ShowMinimizeButton: true, MinimizedMode: false };
+ public override bool GetVisible(PaletteBase palette) => _ribbon is { ShowMinimizeButton: true, MinimizedMode: false };
///
/// Gets the button enabled state.
///
/// Palette to use for inheriting values.
/// Button enabled state.
- public override ButtonEnabled GetEnabled(PaletteBase? palette) => ButtonEnabled.True;
+ public override ButtonEnabled GetEnabled(PaletteBase palette) => ButtonEnabled.True;
///
/// Gets the button checked state.
diff --git a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecViewAppButton.cs b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecViewAppButton.cs
index 41e615b0e..04bd892a9 100644
--- a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecViewAppButton.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecViewAppButton.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -33,11 +33,11 @@ public class ButtonSpecViewAppButton : ButtonSpecView
/// Reference to owning manager.
/// Access
public ButtonSpecViewAppButton(PaletteRedirect? redirector,
- IPaletteMetric? paletteMetric,
+ IPaletteMetric paletteMetric,
PaletteMetricPadding metricPadding,
ButtonSpecManagerBase? manager,
ButtonSpec buttonSpec)
- : base(redirector, paletteMetric, metricPadding, manager, buttonSpec)
+ : base(redirector!, paletteMetric, metricPadding, manager!, buttonSpec)
{
}
#endregion
@@ -52,7 +52,7 @@ public ButtonSpecViewAppButton(PaletteRedirect? redirector,
/// Controller instance.
public override ButtonSpecViewControllers CreateController(ViewDrawButton viewButton,
NeedPaintHandler needPaint,
- MouseEventHandler clickHandler)
+ MouseEventHandler? clickHandler)
{
// Create a ribbon specific button controller
var managerAppButton = (ButtonSpecManagerLayoutAppButton)Manager;
@@ -78,9 +78,9 @@ public override ButtonSpecViewControllers CreateController(ViewDrawButton viewBu
///
/// Source of the event.
/// An EventArgs that contains the event data.
- protected override void OnFinishDelegate(object sender, EventArgs e) =>
+ protected override void OnFinishDelegate(object? sender, EventArgs? e) =>
// Ask the button to remove the fixed pressed appearance
- _controller.RemoveFixed();
+ _controller?.RemoveFixed();
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecViewRibbon.cs b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecViewRibbon.cs
index 51c8a01f0..327f2ae8b 100644
--- a/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecViewRibbon.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/ButtonSpec/ButtonSpecViewRibbon.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -33,11 +33,11 @@ public class ButtonSpecViewRibbon : ButtonSpecView
/// Reference to owning manager.
/// Access
public ButtonSpecViewRibbon(PaletteRedirect? redirector,
- IPaletteMetric? paletteMetric,
+ IPaletteMetric paletteMetric,
PaletteMetricPadding metricPadding,
ButtonSpecManagerBase? manager,
ButtonSpec buttonSpec)
- : base(redirector, paletteMetric, metricPadding, manager, buttonSpec)
+ : base(redirector!, paletteMetric, metricPadding, manager!, buttonSpec)
{
}
#endregion
@@ -52,7 +52,7 @@ public ButtonSpecViewRibbon(PaletteRedirect? redirector,
/// Controller instance.
public override ButtonSpecViewControllers CreateController(ViewDrawButton viewButton,
NeedPaintHandler needPaint,
- MouseEventHandler clickHandler)
+ MouseEventHandler? clickHandler)
{
// Create a ribbon specific button controller
_controller = new ButtonSpecRibbonController(viewButton, needPaint)
@@ -77,9 +77,9 @@ public override ButtonSpecViewControllers CreateController(ViewDrawButton viewBu
///
/// Source of the event.
/// An EventArgs that contains the event data.
- protected override void OnFinishDelegate(object sender, EventArgs e) =>
+ protected override void OnFinishDelegate(object? sender, EventArgs? e) =>
// Ask the button to remove the fixed pressed appearance
- _controller.RemoveFixed();
+ _controller?.RemoveFixed();
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/AppButtonController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/AppButtonController.cs
index 27d0049fe..86080e09b 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/AppButtonController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/AppButtonController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -251,14 +251,24 @@ public virtual void LostFocus([DisallowNull] Control c)
public void KeyDown(Control c, KeyEventArgs e)
{
ViewBase? newView = null;
- var ribbon = (KryptonRibbon)c;
+ var ribbon = c as KryptonRibbon;
+
+ if (ribbon is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(ribbon)));
+ }
+
+ if (ribbon.TabsArea is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.PropertyCannotBeNull(nameof(ribbon.TabsArea)));
+ }
switch (e.KeyData)
{
case Keys.Tab:
case Keys.Right:
// Ask the ribbon to get use the first view for the qat
- newView = ribbon.GetFirstQATView() ?? ribbon.TabsArea.ButtonSpecManager.GetLastVisibleViewButton(PaletteRelativeEdgeAlign.Near);
+ newView = ribbon.GetFirstQATView() ?? ribbon.TabsArea.ButtonSpecManager?.GetLastVisibleViewButton(PaletteRelativeEdgeAlign.Near);
// Get the first near edge button (the last near button is the leftmost one!)
@@ -277,16 +287,16 @@ public void KeyDown(Control c, KeyEventArgs e)
}
// Move across to any far defined buttons
- newView ??= ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far);
+ newView ??= ribbon.TabsArea.ButtonSpecManager?.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far);
// Move across to any inherit defined buttons
- newView ??= ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
+ newView ??= ribbon.TabsArea.ButtonSpecManager?.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
break;
case Keys.Tab | Keys.Shift:
case Keys.Left:
// Move across to any far defined buttons
- newView = ribbon.TabsArea.ButtonSpecManager.GetLastVisibleViewButton(PaletteRelativeEdgeAlign.Far) ??
- ribbon.TabsArea.ButtonSpecManager.GetLastVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
+ newView = ribbon.TabsArea.ButtonSpecManager?.GetLastVisibleViewButton(PaletteRelativeEdgeAlign.Far) ??
+ ribbon.TabsArea.ButtonSpecManager?.GetLastVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
// Move across to any inherit defined buttons
@@ -295,11 +305,11 @@ public void KeyDown(Control c, KeyEventArgs e)
if (e.KeyData != Keys.Left)
{
// Get the last control on the selected tab
- newView = ribbon.GroupsArea.ViewGroups.GetLastFocusItem() ??
+ newView = ribbon.GroupsArea.ViewGroups.GetLastFocusItem() ??
(ribbon.SelectedTab != null // Get the currently selected tab page
? ribbon.TabsArea.LayoutTabs.GetViewForRibbonTab(ribbon.SelectedTab)
: ribbon.TabsArea.LayoutTabs.GetViewForLastRibbonTab());
-
+
}
else
{
@@ -309,7 +319,7 @@ public void KeyDown(Control c, KeyEventArgs e)
}
// Get the last near edge button (the first near button is the rightmost one!)
- newView ??= ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Near);
+ newView ??= ribbon.TabsArea.ButtonSpecManager?.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Near);
// Get the last qat button
newView ??= ribbon.GetLastQATView();
@@ -330,9 +340,9 @@ public void KeyDown(Control c, KeyEventArgs e)
}
// If we have a new view to focus and it is not ourself...
- if ((newView != null)
- && (newView != Target1)
- && (newView != Target2)
+ if ((newView != null)
+ && (newView != Target1)
+ && (newView != Target2)
&& (newView != Target3)
)
{
@@ -371,8 +381,18 @@ public void KeyPress(Control c, KeyPressEventArgs e)
/// Perform actual selection of the item.
///
/// Reference to owning ribbon instance.
- public void KeyTipSelect(KryptonRibbon ribbon)
+ public void KeyTipSelect(KryptonRibbon? ribbon)
{
+ if (ribbon is null)
+ {
+ throw new ArgumentNullException(nameof(ribbon));
+ }
+
+ if (ribbon.TabsArea is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.PropertyCannotBeNull(nameof(ribbon.TabsArea)));
+ }
+
// We leave key tips usage whenever we use the application button
ribbon.KillKeyboardKeyTips();
@@ -383,7 +403,7 @@ public void KeyTipSelect(KryptonRibbon ribbon)
UpdateTargetState();
// Switch focus to ourself
- ribbon.FocusView = ribbon.TabsArea.LayoutAppButton.AppButton;
+ ribbon.FocusView = ribbon.TabsArea.LayoutAppButton.AppButton;
// Generate a click event
Keyboard = true;
@@ -397,7 +417,7 @@ public void KeyTipSelect(KryptonRibbon ribbon)
///
protected void UpdateTargetState()
{
- // By default the button is in the normal state
+ // By default, the button is in the normal state
var newState = PaletteState.Normal;
// Only allow another state if the ribbon is enabled
@@ -494,7 +514,7 @@ protected virtual void OnClick(MouseEventArgs e)
#endregion
#region Implementation
- private void OnUpdateTimer(object sender, EventArgs e)
+ private void OnUpdateTimer(object? sender, EventArgs e)
{
_updateTimer.Stop();
UpdateTargetState();
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/AppTabController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/AppTabController.cs
index 2df145e33..ddb789edf 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/AppTabController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/AppTabController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -29,7 +29,6 @@ internal class AppTabController : GlobalId,
private bool _mouseDown;
private bool _fixedPressed;
private bool _hasFocus;
-
#endregion
#region Events
@@ -70,7 +69,7 @@ public AppTabController(KryptonRibbon ribbon)
/// Gets and sets the second target element.
///
public ViewBase Target2 { get; set; }
-
+
///
/// Gets and sets the third target element.
///
@@ -246,14 +245,25 @@ public virtual void LostFocus([DisallowNull] Control c)
public void KeyDown(Control c, KeyEventArgs e)
{
ViewBase? newView = null;
- var ribbon = (KryptonRibbon)c;
+
+ var ribbon = c as KryptonRibbon;
+
+ if (ribbon is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(ribbon)));
+ }
+
+ if (ribbon.TabsArea is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.PropertyCannotBeNull(nameof(ribbon.TabsArea)));
+ }
switch (e.KeyData)
{
case Keys.Tab:
case Keys.Right:
// Ask the ribbon to get use the first view for the qat
- newView = ribbon.GetFirstQATView() ?? ribbon.TabsArea.ButtonSpecManager.GetLastVisibleViewButton(PaletteRelativeEdgeAlign.Near);
+ newView = ribbon.GetFirstQATView() ?? ribbon.TabsArea.ButtonSpecManager?.GetLastVisibleViewButton(PaletteRelativeEdgeAlign.Near);
// Get the first near edge button (the last near button is the leftmost one!)
@@ -272,16 +282,16 @@ public void KeyDown(Control c, KeyEventArgs e)
}
// Move across to any far defined buttons
- newView ??= ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far);
+ newView ??= ribbon.TabsArea.ButtonSpecManager?.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far);
// Move across to any inherit defined buttons
- newView ??= ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
+ newView ??= ribbon.TabsArea.ButtonSpecManager?.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
break;
case Keys.Tab | Keys.Shift:
case Keys.Left:
// Move across to any far defined buttons
- newView = ribbon.TabsArea.ButtonSpecManager.GetLastVisibleViewButton(PaletteRelativeEdgeAlign.Far) ??
- ribbon.TabsArea.ButtonSpecManager.GetLastVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
+ newView = ribbon.TabsArea.ButtonSpecManager?.GetLastVisibleViewButton(PaletteRelativeEdgeAlign.Far) ??
+ ribbon.TabsArea.ButtonSpecManager?.GetLastVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
// Move across to any inherit defined buttons
@@ -290,7 +300,7 @@ public void KeyDown(Control c, KeyEventArgs e)
if (e.KeyData != Keys.Left)
{
// Get the last control on the selected tab
- newView = ribbon.GroupsArea.ViewGroups.GetLastFocusItem() ??
+ newView = ribbon.GroupsArea.ViewGroups.GetLastFocusItem() ??
(ribbon.SelectedTab != null // Get the currently selected tab page
? ribbon.TabsArea.LayoutTabs.GetViewForRibbonTab(ribbon.SelectedTab)
: ribbon.TabsArea.LayoutTabs.GetViewForLastRibbonTab());
@@ -303,7 +313,7 @@ public void KeyDown(Control c, KeyEventArgs e)
}
// Get the last near edge button (the first near button is the rightmost one!)
- newView ??= ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Near);
+ newView ??= ribbon.TabsArea.ButtonSpecManager?.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Near);
// Get the last qat button
newView ??= ribbon.GetLastQATView();
@@ -324,7 +334,7 @@ public void KeyDown(Control c, KeyEventArgs e)
}
// If we have a new view to focus and it is not ourself...
- if ((newView != null) && (newView != Target1) &&
+ if ((newView != null) && (newView != Target1) &&
(newView != Target2) && (newView != Target3))
{
// If the new view is a tab then select that tab unless in minimized mode
@@ -362,8 +372,18 @@ public void KeyPress(Control c, KeyPressEventArgs e)
/// Perform actual selection of the item.
///
/// Reference to owning ribbon instance.
- public void KeyTipSelect(KryptonRibbon ribbon)
+ public void KeyTipSelect(KryptonRibbon? ribbon)
{
+ if (ribbon is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.ParameterCannotBeNull("ribbon"));
+ }
+
+ if (ribbon.TabsArea is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.PropertyCannotBeNull("ribbon.TabsArea"));
+ }
+
// We leave key tips usage whenever we use the application button
ribbon.KillKeyboardKeyTips();
@@ -374,7 +394,7 @@ public void KeyTipSelect(KryptonRibbon ribbon)
UpdateTargetState();
// Switch focus to ourself
- ribbon.FocusView = ribbon.TabsArea.LayoutAppButton.AppButton;
+ ribbon.FocusView = ribbon.TabsArea.LayoutAppButton.AppButton;
// Generate a click event
Keyboard = true;
@@ -388,7 +408,7 @@ public void KeyTipSelect(KryptonRibbon ribbon)
///
protected void UpdateTargetState()
{
- // By default the button is in the normal state
+ // By default, the button is in the normal state
var newState = PaletteState.Normal;
// Only allow another state if the ribbon is enabled
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/ButtonSpecAppButtonController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/ButtonSpecAppButtonController.cs
index 4a2f0f733..849a2af5e 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/ButtonSpecAppButtonController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/ButtonSpecAppButtonController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -48,17 +48,18 @@ public ButtonSpecAppButtonController(ViewContextMenuManager viewManager,
///
/// Reference to the source control instance.
/// A KeyEventArgs that contains the event data.
- public override void KeyDown([DisallowNull] Control c, [DisallowNull] KeyEventArgs e)
+ public override void KeyDown([DisallowNull] Control? c, [DisallowNull] KeyEventArgs? e)
{
- Debug.Assert(c != null);
- Debug.Assert(e != null);
+ Debug.Assert(c is not null);
+ Debug.Assert(e is not null);
// Validate incoming references
- if (c == null)
+ if (c is null)
{
throw new ArgumentNullException(nameof(c));
}
- if (e == null)
+
+ if (e is null)
{
throw new ArgumentNullException(nameof(e));
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/ButtonSpecRibbonController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/ButtonSpecRibbonController.cs
index 657e59921..319153264 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/ButtonSpecRibbonController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/ButtonSpecRibbonController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -45,14 +45,30 @@ public ButtonSpecRibbonController(ViewBase target,
public override void KeyDown(Control c, KeyEventArgs e)
{
ViewBase? newView = null;
- var ribbon = (KryptonRibbon)c;
+ var ribbon = c as KryptonRibbon;
+
+ if (ribbon is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(ribbon)));
+ }
+
+ if (ribbon.TabsArea is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.PropertyCannotBeNull(nameof(ribbon.TabsArea)));
+ }
+
+ if (ribbon.TabsArea.ButtonSpecManager is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.PropertyCannotBeNull(nameof(ribbon.TabsArea.ButtonSpecManager)));
+ }
// Get the button spec associated with this controller
- var viewButton = (ViewDrawButton)Target;
- ButtonSpec buttonSpec = ribbon.TabsArea.ButtonSpecManager.GetButtonSpecFromView(viewButton);
+ ViewDrawButton? viewButton = Target as ViewDrawButton ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(Target)));
+
+ ButtonSpec? buttonSpec = ribbon.TabsArea.ButtonSpecManager.GetButtonSpecFromView(viewButton) ?? throw new NullReferenceException( "ribbon.TabsArea.ButtonSpecManager.GetButtonSpecFromView(viewButton) returned null.");
- // Note if we are on the near edge
- var isNear = buttonSpec.Edge == PaletteRelativeEdgeAlign.Near;
+ // Note If we are on the near edge
+ var isNear = buttonSpec.Edge is PaletteRelativeEdgeAlign.Near;
switch (e.KeyData)
{
@@ -156,7 +172,7 @@ public override void KeyDown(Control c, KeyEventArgs e)
if (e.KeyData != Keys.Left)
{
// Get the last control on the selected tab
- newView = ribbon.GroupsArea.ViewGroups.GetLastFocusItem() ??
+ newView = ribbon.GroupsArea.ViewGroups.GetLastFocusItem() ??
(ribbon.SelectedTab != null // Get the currently selected tab page
? ribbon.TabsArea.LayoutTabs.GetViewForRibbonTab(ribbon.SelectedTab)
: ribbon.TabsArea.LayoutTabs.GetViewForLastRibbonTab());
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/CollapsedGroupController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/CollapsedGroupController.cs
index 501ff5270..4bc6f4d6c 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/CollapsedGroupController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/CollapsedGroupController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -45,16 +45,16 @@ internal class CollapsedGroupController : GlobalId,
/// View element that owns this controller.
/// Paint delegate for notifying visual changes.
public CollapsedGroupController([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull]ViewLayoutDocker target,
- [DisallowNull]NeedPaintHandler needPaint)
+ [DisallowNull] ViewLayoutDocker target,
+ [DisallowNull] NeedPaintHandler needPaint)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(target != null);
- Debug.Assert(needPaint != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(target is not null);
+ Debug.Assert(needPaint is not null);
- _ribbon = ribbon;
- _target = target;
- _needPaint = needPaint;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _target = target ?? throw new ArgumentNullException(nameof(target));
+ _needPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
}
#endregion
@@ -145,7 +145,7 @@ public virtual void DoubleClick(Point pt)
public virtual void KeyDown(Control c, KeyEventArgs e)
{
// Get the root control that owns the provided control
- c = _ribbon.GetControllerControl(c);
+ c = _ribbon.GetControllerControl(c)!;
switch (c)
{
@@ -242,10 +242,20 @@ protected virtual void OnNeedPaint(bool needLayout,
#endregion
#region Implementation
- private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
+ private void KeyDownRibbon(KryptonRibbon? ribbon, KeyEventArgs e)
{
ViewBase? newView = null;
+ if (ribbon is null)
+ {
+ throw new ArgumentNullException(nameof(ribbon));
+ }
+
+ if (ribbon.TabsArea is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.PropertyCannotBeNull(nameof(ribbon.TabsArea)));
+ }
+
switch (e.KeyData)
{
case Keys.Tab | Keys.Shift:
@@ -258,12 +268,12 @@ private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
case Keys.Tab:
case Keys.Right:
// Get the next focus item for the currently selected page
- newView = ribbon.GroupsArea.ViewGroups.GetNextFocusItem(_target) ?? ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far);
+ newView = ribbon.GroupsArea.ViewGroups.GetNextFocusItem(_target) ?? ribbon.TabsArea.ButtonSpecManager?.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far);
// Move across to any far defined buttons
// Move across to any inherit defined buttons
- newView ??= ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
+ newView ??= ribbon.TabsArea.ButtonSpecManager?.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
// Rotate around to application button
if (newView == null)
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/ComboBoxController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/ComboBoxController.cs
index 861b5d707..1a8ec1b19 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/ComboBoxController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/ComboBoxController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -39,13 +39,9 @@ public ComboBoxController([DisallowNull] KryptonRibbon ribbon,
[DisallowNull] KryptonRibbonGroupComboBox comboBox,
[DisallowNull] ViewDrawRibbonGroupComboBox target)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(comboBox != null);
- Debug.Assert(target != null);
-
- _ribbon = ribbon;
- _comboBox = comboBox;
- _target = target;
+ _ribbon = ribbon ?? throw new Exception( GlobalStaticValues.VariableCannotBeNull(nameof(_ribbon)));
+ _comboBox = comboBox ?? throw new Exception(GlobalStaticValues.VariableCannotBeNull(nameof(_comboBox)));
+ _target = target ?? throw new Exception(GlobalStaticValues.VariableCannotBeNull(nameof(_target)));
}
#endregion
@@ -56,7 +52,7 @@ public ComboBoxController([DisallowNull] KryptonRibbon ribbon,
/// Reference to the source control instance.
public void GotFocus(Control c)
{
- if (_comboBox.LastComboBox.ComboBox is { CanFocus: true })
+ if (_comboBox.LastComboBox!.ComboBox is { CanFocus: true })
{
_ribbon.LostFocusLosesKeyboard = false;
_comboBox.LastComboBox.ComboBox.Focus();
@@ -81,7 +77,7 @@ public void LostFocus([DisallowNull] Control c)
public void KeyDown(Control c, KeyEventArgs e)
{
// Get the root control that owns the provided control
- c = _ribbon.GetControllerControl(c);
+ c = _ribbon.GetControllerControl(c)!;
switch (c)
{
@@ -124,7 +120,7 @@ public void KeyPress(Control c, KeyPressEventArgs e)
public void KeyTipSelect(KryptonRibbon ribbon)
{
// Can the combobox take the focus
- if (_comboBox.LastComboBox.CanFocus)
+ if (_comboBox.LastComboBox!.CanFocus)
{
// Prevent the ribbon from killing keyboard mode when it loses the focus,
// as this causes the tracking windows to be killed and we want them kept
@@ -138,7 +134,7 @@ public void KeyTipSelect(KryptonRibbon ribbon)
ribbon.KillKeyboardMode();
// Push focus to the specified target control
- _comboBox.LastComboBox.ComboBox.Focus();
+ _comboBox.LastComboBox.ComboBox?.Focus();
// Ensure that the previous ribbon focus is restored when the popup window is dismissed
// If the textbox is inside a popup window
@@ -151,10 +147,20 @@ public void KeyTipSelect(KryptonRibbon ribbon)
#endregion
#region Implementation
- private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
+ private void KeyDownRibbon(KryptonRibbon? ribbon, KeyEventArgs e)
{
ViewBase? newView = null;
+ if (ribbon is null)
+ {
+ throw new ArgumentNullException(nameof(ribbon));
+ }
+
+ if (ribbon.TabsArea is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.PropertyCannotBeNull(nameof(ribbon.TabsArea)));
+ }
+
switch (e.KeyData)
{
case Keys.Tab | Keys.Shift:
@@ -167,12 +173,12 @@ private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
case Keys.Tab:
case Keys.Right:
// Get the next focus item for the currently selected page
- newView = ribbon.GroupsArea.ViewGroups.GetNextFocusItem(_target) ?? ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far);
+ newView = ribbon.GroupsArea.ViewGroups.GetNextFocusItem(_target) ?? ribbon.TabsArea.ButtonSpecManager!.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far);
// Move across to any far defined buttons
// Move across to any inherit defined buttons
- newView ??= ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
+ newView ??= ribbon.TabsArea.ButtonSpecManager!.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
// Rotate around to application button
if (newView == null)
@@ -185,7 +191,7 @@ private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
{
newView = ribbon.TabsArea.LayoutAppTab.AppTab;
}
- }
+ }
break;
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/ContextClickController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/ContextClickController.cs
index 1a907f3bd..3ac57eea2 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/ContextClickController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/ContextClickController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/ContextTitleController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/ContextTitleController.cs
index ec99310bb..b5f1adc32 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/ContextTitleController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/ContextTitleController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -30,10 +30,10 @@ internal class ContextTitleController : GlobalId,
/// Initialize a new instance of the ContextTitleController class.
///
/// Reference to owning ribbon instance.
- public ContextTitleController([DisallowNull] KryptonRibbon ribbon)
+ public ContextTitleController([DisallowNull] KryptonRibbon? ribbon)
{
Debug.Assert(ribbon != null);
- _ribbon = ribbon;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
}
#endregion
@@ -41,7 +41,7 @@ public ContextTitleController([DisallowNull] KryptonRibbon ribbon)
///
/// Gets and sets the associated context tab set.
///
- public ContextTabSet ContextTabSet { get; set; }
+ public ContextTabSet? ContextTabSet { get; set; }
#endregion
@@ -84,7 +84,7 @@ public virtual bool MouseDown(Control c, Point pt, MouseButtons button)
if (_ribbon is { InDesignMode: false, Enabled: true })
{
// Select the first tab in the context
- ContextTabSet.FirstTab.RibbonTab.Ribbon.SelectedTab = ContextTabSet.FirstTab.RibbonTab;
+ ContextTabSet.FirstTab.RibbonTab!.Ribbon!.SelectedTab = ContextTabSet.FirstTab.RibbonTab;
}
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/CustomControlController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/CustomControlController.cs
index 9a7fe1a84..856b86fec 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/CustomControlController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/CustomControlController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -35,17 +35,17 @@ internal class CustomControlController : GlobalId,
/// Reference to owning ribbon instance.
/// Source definition.
/// Target view element.
- public CustomControlController([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupCustomControl customControl,
- [DisallowNull] ViewDrawRibbonGroupCustomControl target)
+ public CustomControlController([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupCustomControl? customControl,
+ [DisallowNull] ViewDrawRibbonGroupCustomControl? target)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(customControl != null);
- Debug.Assert(customControl != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(customControl is not null);
+ Debug.Assert(customControl is not null);
- _ribbon = ribbon;
- _customControl = customControl;
- _target = target;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _customControl = customControl ?? throw new ArgumentNullException(nameof(customControl));
+ _target = target ?? throw new ArgumentNullException(nameof(target));
}
#endregion
@@ -81,7 +81,7 @@ public void LostFocus([DisallowNull] Control c)
public void KeyDown(Control c, KeyEventArgs e)
{
// Get the root control that owns the provided control
- c = _ribbon.GetControllerControl(c);
+ c = _ribbon.GetControllerControl(c)!;
switch (c)
{
@@ -124,7 +124,7 @@ public void KeyPress(Control c, KeyPressEventArgs e)
public void KeyTipSelect(KryptonRibbon ribbon)
{
// Can the custom control take the focus
- if (_customControl.LastCustomControl.CanFocus)
+ if (_customControl.LastCustomControl!.CanFocus)
{
// Prevent the ribbon from killing keyboard mode when it loses the focus,
// as this causes the tracking windows to be killed and we want them kept
@@ -151,10 +151,20 @@ public void KeyTipSelect(KryptonRibbon ribbon)
#endregion
#region Implementation
- private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
+ private void KeyDownRibbon(KryptonRibbon? ribbon, KeyEventArgs e)
{
ViewBase? newView = null;
+ if (ribbon is null)
+ {
+ throw new ArgumentNullException(GlobalStaticValues.ParameterCannotBeNull(nameof(ribbon)));
+ }
+
+ if (ribbon.TabsArea is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.ParameterCannotBeNull(nameof(ribbon.TabsArea)));
+ }
+
switch (e.KeyData)
{
case Keys.Tab | Keys.Shift:
@@ -167,12 +177,12 @@ private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
case Keys.Tab:
case Keys.Right:
// Get the next focus item for the currently selected page
- newView = ribbon.GroupsArea.ViewGroups.GetNextFocusItem(_target) ?? ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far);
+ newView = ribbon.GroupsArea.ViewGroups.GetNextFocusItem(_target) ?? ribbon.TabsArea.ButtonSpecManager!.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far);
// Move across to any far defined buttons
// Move across to any inherit defined buttons
- newView ??= ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
+ newView ??= ribbon.TabsArea.ButtonSpecManager!.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
// Rotate around to application button
if (newView == null)
@@ -185,7 +195,7 @@ private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
{
newView = ribbon.TabsArea.LayoutAppTab.AppTab;
}
- }
+ }
break;
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/DateTimePickerController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/DateTimePickerController.cs
index 308b5e58b..2dddb7607 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/DateTimePickerController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/DateTimePickerController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -18,7 +18,7 @@ namespace Krypton.Ribbon
/// Process mouse events for a ribbon group date time picker.
///
internal class DateTimePickerController : GlobalId,
- ISourceController,
+ ISourceController,
IKeyController,
IRibbonKeyTipTarget
{
@@ -35,17 +35,17 @@ internal class DateTimePickerController : GlobalId,
/// Reference to owning ribbon instance.
/// Source definition.
/// Target view element.
- public DateTimePickerController([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupDateTimePicker dateTimePicker,
- [DisallowNull] ViewDrawRibbonGroupDateTimePicker target)
+ public DateTimePickerController([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupDateTimePicker? dateTimePicker,
+ [DisallowNull] ViewDrawRibbonGroupDateTimePicker? target)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(dateTimePicker != null);
- Debug.Assert(target != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(dateTimePicker is not null);
+ Debug.Assert(target is not null);
- _ribbon = ribbon;
- _dateTimePicker = dateTimePicker;
- _target = target;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _dateTimePicker = dateTimePicker ?? throw new ArgumentNullException(nameof(dateTimePicker));
+ _target = target ?? throw new ArgumentNullException(nameof(target));
}
#endregion
@@ -81,7 +81,7 @@ public void LostFocus([DisallowNull] Control c)
public void KeyDown(Control c, KeyEventArgs e)
{
// Get the root control that owns the provided control
- c = _ribbon.GetControllerControl(c);
+ c = _ribbon.GetControllerControl(c)!;
switch (c)
{
@@ -124,7 +124,7 @@ public void KeyPress(Control c, KeyPressEventArgs e)
public void KeyTipSelect(KryptonRibbon ribbon)
{
// Can the date time picker take the focus
- if (_dateTimePicker.LastDateTimePicker.CanFocus)
+ if (_dateTimePicker.LastDateTimePicker!.CanFocus)
{
// Prevent the ribbon from killing keyboard mode when it loses the focus,
// as this causes the tracking windows to be killed and we want them kept
@@ -151,10 +151,20 @@ public void KeyTipSelect(KryptonRibbon ribbon)
#endregion
#region Implementation
- private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
+ private void KeyDownRibbon(KryptonRibbon? ribbon, KeyEventArgs e)
{
ViewBase? newView = null;
+ if (ribbon is null)
+ {
+ throw new ArgumentNullException(nameof(ribbon));
+ }
+
+ if (ribbon.TabsArea is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.PropertyCannotBeNull(nameof(ribbon.TabsArea)));
+ }
+
switch (e.KeyData)
{
case Keys.Tab | Keys.Shift:
@@ -167,12 +177,12 @@ private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
case Keys.Tab:
case Keys.Right:
// Get the next focus item for the currently selected page
- newView = ribbon.GroupsArea.ViewGroups.GetNextFocusItem(_target) ?? ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far);
+ newView = ribbon.GroupsArea.ViewGroups.GetNextFocusItem(_target) ?? ribbon.TabsArea.ButtonSpecManager!.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far);
// Move across to any far defined buttons
// Move across to any inherit defined buttons
- newView ??= ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
+ newView ??= ribbon.TabsArea.ButtonSpecManager!.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
// Rotate around to application button
if (newView == null)
@@ -185,7 +195,7 @@ private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
{
newView = ribbon.TabsArea.LayoutAppTab.AppTab;
}
- }
+ }
break;
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/DialogLauncherButtonController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/DialogLauncherButtonController.cs
index a98a63bf1..9a37085c7 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/DialogLauncherButtonController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/DialogLauncherButtonController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -25,7 +25,7 @@ internal class DialogLauncherButtonController : LeftUpButtonController,
#region Instance Fields
private bool _hasFocus;
#endregion
-
+
#region Identity
///
/// Initialize a new instance of the DialogLauncherButtonController class.
@@ -78,7 +78,7 @@ public virtual void LostFocus([DisallowNull] Control c)
public void KeyDown(Control c, KeyEventArgs e)
{
// Get the root control that owns the provided control
- c = Ribbon.GetControllerControl(c);
+ c = Ribbon.GetControllerControl(c)!;
switch (c)
{
@@ -158,6 +158,11 @@ private void KeyDownRibbon(KeyEventArgs e)
{
ViewBase? newView = null;
+ if (Ribbon.TabsArea is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.PropertyCannotBeNull(nameof(Ribbon.TabsArea)));
+ }
+
switch (e.KeyData)
{
case Keys.Tab | Keys.Shift:
@@ -170,12 +175,12 @@ private void KeyDownRibbon(KeyEventArgs e)
case Keys.Tab:
case Keys.Right:
// Get the next focus item for the currently selected page
- newView = Ribbon.GroupsArea.ViewGroups.GetNextFocusItem(Target) ?? Ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far);
+ newView = Ribbon.GroupsArea.ViewGroups.GetNextFocusItem(Target) ?? Ribbon.TabsArea.ButtonSpecManager!.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far);
// Move across to any far defined buttons
// Move across to any inherit defined buttons
- newView ??= Ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
+ newView ??= Ribbon.TabsArea.ButtonSpecManager!.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
// Rotate around to application button
if (newView == null)
@@ -188,7 +193,7 @@ private void KeyDownRibbon(KeyEventArgs e)
{
newView = Ribbon.TabsArea.LayoutAppTab.AppTab;
}
- }
+ }
break;
case Keys.Space:
case Keys.Enter:
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/DomainUpDownController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/DomainUpDownController.cs
index 92e3a471a..958726e41 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/DomainUpDownController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/DomainUpDownController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -35,17 +35,17 @@ internal class DomainUpDownController : GlobalId,
/// Reference to owning ribbon instance.
/// Source definition.
/// Target view element.
- public DomainUpDownController([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupDomainUpDown domainUpDown,
- [DisallowNull] ViewDrawRibbonGroupDomainUpDown target)
+ public DomainUpDownController([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupDomainUpDown? domainUpDown,
+ [DisallowNull] ViewDrawRibbonGroupDomainUpDown? target)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(domainUpDown != null);
- Debug.Assert(target != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(domainUpDown is not null);
+ Debug.Assert(target is not null);
- _ribbon = ribbon;
- _domainUpDown = domainUpDown;
- _target = target;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _domainUpDown = domainUpDown ?? throw new ArgumentNullException(nameof(domainUpDown));
+ _target = target ?? throw new ArgumentNullException(nameof(target));
}
#endregion
@@ -56,7 +56,7 @@ public DomainUpDownController([DisallowNull] KryptonRibbon ribbon,
/// Reference to the source control instance.
public void GotFocus(Control c)
{
- if (_domainUpDown.LastDomainUpDown.DomainUpDown is { CanFocus: true })
+ if (_domainUpDown.LastDomainUpDown!.DomainUpDown is { CanFocus: true })
{
_ribbon.LostFocusLosesKeyboard = false;
_domainUpDown.LastDomainUpDown.DomainUpDown.Focus();
@@ -81,7 +81,7 @@ public void LostFocus([DisallowNull] Control c)
public void KeyDown(Control c, KeyEventArgs e)
{
// Get the root control that owns the provided control
- c = _ribbon.GetControllerControl(c);
+ c = _ribbon.GetControllerControl(c)!;
switch (c)
{
@@ -124,7 +124,7 @@ public void KeyPress(Control c, KeyPressEventArgs e)
public void KeyTipSelect(KryptonRibbon ribbon)
{
// Can the numeric up-down take the focus
- if (_domainUpDown.LastDomainUpDown.CanFocus)
+ if (_domainUpDown.LastDomainUpDown!.CanFocus)
{
// Prevent the ribbon from killing keyboard mode when it loses the focus,
// as this causes the tracking windows to be killed and we want them kept
@@ -151,10 +151,20 @@ public void KeyTipSelect(KryptonRibbon ribbon)
#endregion
#region Implementation
- private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
+ private void KeyDownRibbon(KryptonRibbon? ribbon, KeyEventArgs e)
{
ViewBase? newView = null;
+ if (ribbon is null)
+ {
+ throw new ArgumentNullException(nameof(ribbon));
+ }
+
+ if (ribbon.TabsArea is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.PropertyCannotBeNull(nameof(ribbon.TabsArea)));
+ }
+
switch (e.KeyData)
{
case Keys.Tab | Keys.Shift:
@@ -167,8 +177,8 @@ private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
case Keys.Tab:
case Keys.Right:
// Get the next focus item for the currently selected page
- newView = (ribbon.GroupsArea.ViewGroups.GetNextFocusItem(_target) ?? ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far)) ??
- ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
+ newView = (ribbon.GroupsArea.ViewGroups.GetNextFocusItem(_target) ?? ribbon.TabsArea.ButtonSpecManager!.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far)) ??
+ ribbon.TabsArea.ButtonSpecManager!.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
// Move across to any far defined buttons
@@ -185,7 +195,7 @@ private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
{
newView = ribbon.TabsArea.LayoutAppTab.AppTab;
}
- }
+ }
break;
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/GalleryButtonController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/GalleryButtonController.cs
index 33b880ea3..29d6bb08b 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/GalleryButtonController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/GalleryButtonController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -25,7 +25,8 @@ internal class GalleryButtonController : GlobalId,
private bool _pressed;
private bool _mouseOver;
private NeedPaintHandler? _needPaint;
- private readonly Timer _repeatTimer;
+ private Timer? _repeatTimer;
+
#endregion
#region Events
@@ -48,7 +49,7 @@ public GalleryButtonController([DisallowNull] ViewBase target,
{
Debug.Assert(target != null);
- Target = target;
+ Target = target!;
NeedPaint = needPaint;
if (repeatTimer)
@@ -73,7 +74,7 @@ public void ForceLeave()
_pressed = false;
_mouseOver = false;
UpdateTargetState(new Point(int.MaxValue, int.MaxValue));
- _repeatTimer.Stop();
+ _repeatTimer?.Stop();
}
}
#endregion
@@ -116,7 +117,7 @@ public virtual bool MouseDown(Control c, Point pt, MouseButtons button)
if (Target.Enabled)
{
OnClick(new MouseEventArgs(MouseButtons.Left, 1, pt.X, pt.Y, 0));
- _repeatTimer.Start();
+ _repeatTimer?.Start();
}
}
@@ -136,7 +137,7 @@ public virtual void MouseUp(Control c, Point pt, MouseButtons button)
{
_pressed = false;
UpdateTargetState(pt);
- _repeatTimer.Stop();
+ _repeatTimer?.Stop();
}
}
@@ -153,7 +154,9 @@ public virtual void MouseLeave(Control c, ViewBase? next)
_pressed = false;
_mouseOver = false;
UpdateTargetState(c);
- _repeatTimer.Stop();
+ // Have to check for null Because:
+ // when moving from a gallery to the Expand tooltip button it would throw an exception !
+ _repeatTimer?.Stop();
}
}
@@ -219,7 +222,7 @@ protected void UpdateTargetState(Control c)
if (c is { IsDisposed: false })
{
// Ensure control is inside a visible top level form
- Form f = c.FindForm();
+ Form? f = c.FindForm();
if (f is { Visible: true })
{
UpdateTargetState(c.PointToClient(Control.MousePosition));
@@ -236,14 +239,18 @@ protected void UpdateTargetState(Control c)
/// Mouse point.
protected virtual void UpdateTargetState(Point pt)
{
- // By default the button is in the normal state
+ // By default, the button is in the normal state
PaletteState newState;
// If the button is disabled then show as disabled
if (!Target.Enabled)
{
newState = PaletteState.Disabled;
- _repeatTimer.Stop();
+ _repeatTimer?.Stop();
+
+ // Repeats will crash the application, below should solve this
+ _repeatTimer?.Dispose();
+ _repeatTimer = null;
}
else
{
@@ -275,7 +282,7 @@ protected virtual void UpdateTargetState(Point pt)
#endregion
#region Private
- private void OnRepeatTick(object sender, EventArgs e)
+ private void OnRepeatTick(object? sender, EventArgs e)
{
if (Target.Enabled)
{
@@ -283,10 +290,10 @@ private void OnRepeatTick(object sender, EventArgs e)
}
else
{
- _repeatTimer.Stop();
+ _repeatTimer?.Stop();
}
}
-
+
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/GalleryController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/GalleryController.cs
index eb1b904ea..97ce572aa 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/GalleryController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/GalleryController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -35,17 +35,17 @@ internal class GalleryController : GlobalId,
/// Reference to owning ribbon instance.
/// Source definition.
/// Target view element.
- public GalleryController([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupGallery gallery,
- [DisallowNull] ViewDrawRibbonGroupGallery target)
+ public GalleryController([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupGallery? gallery,
+ [DisallowNull] ViewDrawRibbonGroupGallery? target)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(gallery != null);
- Debug.Assert(target != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(gallery is not null);
+ Debug.Assert(target is not null);
- _ribbon = ribbon;
- _gallery = gallery;
- _target = target;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _gallery = gallery ?? throw new ArgumentNullException(nameof(gallery));
+ _target = target ?? throw new ArgumentNullException(nameof(target));
}
#endregion
@@ -81,7 +81,7 @@ public void LostFocus([DisallowNull] Control c)
public void KeyDown(Control c, KeyEventArgs e)
{
// Get the root control that owns the provided control
- c = _ribbon.GetControllerControl(c);
+ c = _ribbon.GetControllerControl(c)!;
switch (c)
{
@@ -136,10 +136,20 @@ public void KeyTipSelect(KryptonRibbon ribbon)
#endregion
#region Implementation
- private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
+ private void KeyDownRibbon(KryptonRibbon? ribbon, KeyEventArgs e)
{
ViewBase? newView = null;
+ if (ribbon is null)
+ {
+ throw new ArgumentNullException(nameof(ribbon));
+ }
+
+ if (ribbon.TabsArea is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.PropertyCannotBeNull(nameof(ribbon.TabsArea)));
+ }
+
switch (e.KeyData)
{
case Keys.Tab | Keys.Shift:
@@ -152,8 +162,8 @@ private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
case Keys.Tab:
case Keys.Right:
// Get the next focus item for the currently selected page
- newView = (ribbon.GroupsArea.ViewGroups.GetNextFocusItem(_target) ?? ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far)) ??
- ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
+ newView = (ribbon.GroupsArea.ViewGroups.GetNextFocusItem(_target) ?? ribbon.TabsArea.ButtonSpecManager!.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far)) ??
+ ribbon.TabsArea.ButtonSpecManager!.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
// Move across to any far defined buttons
@@ -170,7 +180,7 @@ private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
{
newView = ribbon.TabsArea.LayoutAppTab.AppTab;
}
- }
+ }
break;
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/GalleryItemController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/GalleryItemController.cs
index a9c622eec..50d6d34fc 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/GalleryItemController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/GalleryItemController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -43,17 +43,17 @@ internal class GalleryItemController : GlobalId,
/// Target for state changes.
/// Reference to layout of the image items.
/// Delegate for notifying paint requests.
- public GalleryItemController([DisallowNull] ViewDrawRibbonGalleryItem target,
- [DisallowNull] ViewLayoutRibbonGalleryItems layout,
- NeedPaintHandler needPaint)
+ public GalleryItemController([DisallowNull] ViewDrawRibbonGalleryItem? target,
+ [DisallowNull] ViewLayoutRibbonGalleryItems? layout,
+ [DisallowNull] NeedPaintHandler? needPaint)
{
- Debug.Assert(target != null);
- Debug.Assert(layout != null);
+ Debug.Assert(target is not null);
+ Debug.Assert(layout is not null);
MousePoint = CommonHelper.NullPoint;
- _target = target;
- _layout = layout;
- NeedPaint = needPaint;
+ _target = target ?? throw new ArgumentNullException(nameof(target));
+ _layout = layout ?? throw new ArgumentNullException(nameof(layout));
+ NeedPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
}
#endregion
@@ -191,7 +191,7 @@ public virtual void MouseLeave(Control c, ViewBase? next)
_mouseOver = false;
// Not tracking the mouse means a null value
- MousePoint = CommonHelper.NullPoint;
+ MousePoint = CommonHelper.NullPoint;
// If leaving the view then cannot be capturing mouse input anymore
Captured = false;
@@ -379,7 +379,7 @@ protected void UpdateTargetState(Control c)
if (c is { IsDisposed: false })
{
// Ensure control is inside a visible top level form
- Form f = c.FindForm();
+ Form? f = c.FindForm();
if (f is { Visible: true })
{
UpdateTargetState(c.PointToClient(Control.MousePosition));
@@ -396,7 +396,7 @@ protected void UpdateTargetState(Control c)
/// Mouse point.
protected virtual void UpdateTargetState(Point pt)
{
- // By default the button is in the normal state
+ // By default, the button is in the normal state
PaletteState newState;
// If the button is disabled then show as disabled
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/GroupButtonController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/GroupButtonController.cs
index 3041ff856..14fb9b293 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/GroupButtonController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/GroupButtonController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -59,17 +59,17 @@ internal class GroupButtonController : GlobalId,
/// Source control instance.
/// Target for state changes.
/// Delegate for notifying paint requests.
- public GroupButtonController([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] ViewDrawRibbonGroupButtonBackBorder target,
- [DisallowNull] NeedPaintHandler needPaint)
+ public GroupButtonController([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] ViewDrawRibbonGroupButtonBackBorder? target,
+ [DisallowNull] NeedPaintHandler? needPaint)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(target != null);
- Debug.Assert(needPaint != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(target is not null);
+ Debug.Assert(needPaint is not null);
- _ribbon = ribbon;
- _target = target;
- NeedPaint = needPaint;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _target = target ?? throw new ArgumentNullException(nameof(target));
+ NeedPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
// Default other fields
ButtonType = GroupButtonType.Push;
@@ -177,50 +177,50 @@ public virtual bool MouseDown(Control c, Point pt, MouseButtons button)
// Only interested in left mouse pressing down
// Can only click if enabled
case MouseButtons.Left when ClickOnDown(pt) && _target.Enabled:
- {
- Captured = true;
-
- // If already in fixed mode, then ignore mouse down
- if (!_fixedPressed)
{
- // Mouse is being pressed
- UpdateTargetState(pt);
+ Captured = true;
- // Show the button as pressed, until told otherwise
- _fixedPressed = true;
-
- // Raise the appropriate event
- switch (ButtonType)
+ // If already in fixed mode, then ignore mouse down
+ if (!_fixedPressed)
{
- case GroupButtonType.Split:
- // Track if the mouse is inside the split area
- if (ButtonType == GroupButtonType.Split)
- {
- MouseInSplit = _splitRectangle.Contains(pt);
- }
-
- if (_splitRectangle.Contains(pt))
- {
+ // Mouse is being pressed
+ UpdateTargetState(pt);
+
+ // Show the button as pressed, until told otherwise
+ _fixedPressed = true;
+
+ // Raise the appropriate event
+ switch (ButtonType)
+ {
+ case GroupButtonType.Split:
+ // Track if the mouse is inside the split area
+ if (ButtonType == GroupButtonType.Split)
+ {
+ MouseInSplit = _splitRectangle.Contains(pt);
+ }
+
+ if (_splitRectangle.Contains(pt))
+ {
+ OnDropDown(new MouseEventArgs(MouseButtons.Left, 1, pt.X, pt.Y, 0));
+ }
+ else
+ {
+ OnClick(new MouseEventArgs(MouseButtons.Left, 1, pt.X, pt.Y, 0));
+ }
+ break;
+ case GroupButtonType.DropDown:
OnDropDown(new MouseEventArgs(MouseButtons.Left, 1, pt.X, pt.Y, 0));
- }
- else
- {
+ break;
+ case GroupButtonType.Push:
+ case GroupButtonType.Check:
+ default:
OnClick(new MouseEventArgs(MouseButtons.Left, 1, pt.X, pt.Y, 0));
- }
- break;
- case GroupButtonType.DropDown:
- OnDropDown(new MouseEventArgs(MouseButtons.Left, 1, pt.X, pt.Y, 0));
- break;
- case GroupButtonType.Push:
- case GroupButtonType.Check:
- default:
- OnClick(new MouseEventArgs(MouseButtons.Left, 1, pt.X, pt.Y, 0));
- break;
+ break;
+ }
}
- }
- break;
- }
+ break;
+ }
case MouseButtons.Left:
// Capturing mouse input
Captured = true;
@@ -390,7 +390,7 @@ public virtual void LostFocus([DisallowNull] Control c)
public void KeyDown(Control c, KeyEventArgs e)
{
// Get the root control that owns the provided control
- c = _ribbon.GetControllerControl(c);
+ c = _ribbon.GetControllerControl(c)!;
switch (c)
{
@@ -507,7 +507,7 @@ public NeedPaintHandler? NeedPaint
/// Owning control.
protected void UpdateTargetState(Control c)
{
- if ((c == null) || c.IsDisposed)
+ if (c == null || c.IsDisposed)
{
UpdateTargetState(new Point(int.MaxValue, int.MaxValue));
}
@@ -523,7 +523,7 @@ protected void UpdateTargetState(Control c)
/// Mouse point.
protected void UpdateTargetState(Point pt)
{
- // By default the button is in the normal state
+ // By default, the button is in the normal state
PaletteState newState;
// When disabled the button itself is shown as normal, the
@@ -552,7 +552,7 @@ protected void UpdateTargetState(Point pt)
if (_mouseOver || _hasFocus)
{
newState = PaletteState.Tracking;
-
+
// We always show the button as being in the split when it has focus
if (_hasFocus)
{
@@ -604,10 +604,20 @@ protected void UpdateTargetState(Point pt)
#endregion
#region Implementation
- private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
+ private void KeyDownRibbon(KryptonRibbon? ribbon, KeyEventArgs e)
{
ViewBase? newView = null;
+ if (ribbon is null)
+ {
+ throw new ArgumentNullException(nameof(ribbon));
+ }
+
+ if (ribbon.TabsArea is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.PropertyCannotBeNull(nameof(ribbon.TabsArea)));
+ }
+
switch (e.KeyData)
{
case Keys.Tab | Keys.Shift:
@@ -620,8 +630,8 @@ private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
case Keys.Tab:
case Keys.Right:
// Get the next focus item for the currently selected page
- newView = (ribbon.GroupsArea.ViewGroups.GetNextFocusItem(_target) ?? ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far)) ??
- ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
+ newView = (ribbon.GroupsArea.ViewGroups.GetNextFocusItem(_target) ?? ribbon.TabsArea.ButtonSpecManager!.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far)) ??
+ ribbon.TabsArea.ButtonSpecManager!.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
// Move across to any far defined buttons
@@ -638,7 +648,7 @@ private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
{
newView = ribbon.TabsArea.LayoutAppTab.AppTab;
}
- }
+ }
break;
case Keys.Space:
case Keys.Enter:
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/GroupCheckBoxController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/GroupCheckBoxController.cs
index 17da05613..135ef8154 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/GroupCheckBoxController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/GroupCheckBoxController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -53,20 +53,20 @@ internal class GroupCheckBoxController : GlobalId,
/// Target for main element changes.
/// Target for image state changes.
/// Delegate for notifying paint requests.
- public GroupCheckBoxController([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] ViewBase targetMain,
- [DisallowNull] ViewDrawRibbonGroupCheckBoxImage targetImage,
- [DisallowNull] NeedPaintHandler needPaint)
+ public GroupCheckBoxController([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] ViewBase? targetMain,
+ [DisallowNull] ViewDrawRibbonGroupCheckBoxImage? targetImage,
+ [DisallowNull] NeedPaintHandler? needPaint)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(targetMain != null);
- Debug.Assert(targetImage != null);
- Debug.Assert(needPaint != null);
-
- _ribbon = ribbon;
- TargetMain = targetMain;
- _targetImage = targetImage;
- NeedPaint = needPaint;
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(targetMain is not null);
+ Debug.Assert(targetImage is not null);
+ Debug.Assert(needPaint is not null);
+
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ TargetMain = targetMain ?? throw new ArgumentNullException(nameof(targetMain));
+ _targetImage = targetImage ?? throw new ArgumentNullException(nameof(targetImage));
+ NeedPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
}
#endregion
@@ -269,7 +269,7 @@ public virtual void LostFocus([DisallowNull] Control c)
public void KeyDown(Control c, KeyEventArgs e)
{
// Get the root control that owns the provided control
- c = _ribbon.GetControllerControl(c);
+ c = _ribbon.GetControllerControl(c)!;
switch (c)
{
@@ -365,7 +365,7 @@ public NeedPaintHandler? NeedPaint
/// Owning control.
protected void UpdateTargetState(Control c)
{
- if ((c == null) || c.IsDisposed)
+ if (c == null || c.IsDisposed)
{
UpdateTargetState(new Point(int.MaxValue, int.MaxValue));
}
@@ -437,10 +437,20 @@ protected void UpdateTargetState(Point pt)
#endregion
#region Implementation
- private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
+ private void KeyDownRibbon(KryptonRibbon? ribbon, KeyEventArgs e)
{
ViewBase? newView = null;
+ if (ribbon is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.ParameterCannotBeNull(nameof(ribbon)));
+ }
+
+ if (ribbon.TabsArea is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.PropertyCannotBeNull(nameof(ribbon.TabsArea)));
+ }
+
switch (e.KeyData)
{
case Keys.Tab | Keys.Shift:
@@ -453,8 +463,8 @@ private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
case Keys.Tab:
case Keys.Right:
// Get the next focus item for the currently selected page
- newView = (ribbon.GroupsArea.ViewGroups.GetNextFocusItem(TargetMain) ?? ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far)) ??
- ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
+ newView = (ribbon.GroupsArea.ViewGroups.GetNextFocusItem(TargetMain) ?? ribbon.TabsArea.ButtonSpecManager!.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far)) ??
+ ribbon.TabsArea.ButtonSpecManager!.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
// Move across to any far defined buttons
@@ -471,7 +481,7 @@ private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
{
newView = ribbon.TabsArea.LayoutAppTab.AppTab;
}
- }
+ }
break;
case Keys.Space:
case Keys.Enter:
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/GroupRadioButtonController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/GroupRadioButtonController.cs
index 1526ee1ef..82ef25a2b 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/GroupRadioButtonController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/GroupRadioButtonController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -53,20 +53,20 @@ internal class GroupRadioButtonController : GlobalId,
/// Target for main element changes.
/// Target for image state changes.
/// Delegate for notifying paint requests.
- public GroupRadioButtonController([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] ViewBase targetMain,
- [DisallowNull] ViewDrawRibbonGroupRadioButtonImage targetImage,
- [DisallowNull] NeedPaintHandler needPaint)
+ public GroupRadioButtonController([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] ViewBase? targetMain,
+ [DisallowNull] ViewDrawRibbonGroupRadioButtonImage? targetImage,
+ [DisallowNull] NeedPaintHandler? needPaint)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(targetMain != null);
- Debug.Assert(targetImage != null);
- Debug.Assert(needPaint != null);
-
- _ribbon = ribbon;
- TargetMain = targetMain;
- _targetImage = targetImage;
- NeedPaint = needPaint;
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(targetMain is not null);
+ Debug.Assert(targetImage is not null);
+ Debug.Assert(needPaint is not null);
+
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ TargetMain = targetMain ?? throw new ArgumentNullException(nameof(targetMain));
+ _targetImage = targetImage ?? throw new ArgumentNullException(nameof(targetImage));
+ NeedPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
}
#endregion
@@ -269,7 +269,7 @@ public virtual void LostFocus([DisallowNull] Control c)
public void KeyDown(Control c, KeyEventArgs e)
{
// Get the root control that owns the provided control
- c = _ribbon.GetControllerControl(c);
+ c = _ribbon.GetControllerControl(c)!;
switch (c)
{
@@ -441,6 +441,16 @@ private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
{
ViewBase? newView = null;
+ if (ribbon is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.ParameterCannotBeNull(nameof(ribbon)));
+ }
+
+ if (ribbon.TabsArea is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.PropertyCannotBeNull(nameof(ribbon.TabsArea)));
+ }
+
switch (e.KeyData)
{
case Keys.Tab | Keys.Shift:
@@ -453,8 +463,8 @@ private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
case Keys.Tab:
case Keys.Right:
// Get the next focus item for the currently selected page
- newView = (ribbon.GroupsArea.ViewGroups.GetNextFocusItem(TargetMain) ?? ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far)) ??
- ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
+ newView = (ribbon.GroupsArea.ViewGroups.GetNextFocusItem(TargetMain) ?? ribbon.TabsArea.ButtonSpecManager!.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far)) ??
+ ribbon.TabsArea.ButtonSpecManager!.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
// Move across to any far defined buttons
@@ -471,7 +481,7 @@ private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
{
newView = ribbon.TabsArea.LayoutAppTab.AppTab;
}
- }
+ }
break;
case Keys.Space:
case Keys.Enter:
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/LeftDownButtonController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/LeftDownButtonController.cs
index c24ce68f2..af98f7af7 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/LeftDownButtonController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/LeftDownButtonController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -43,17 +43,17 @@ internal class LeftDownButtonController : GlobalId,
/// Reference to owning ribbon instance.
/// Target for state changes.
/// Delegate for notifying changes in display.
- public LeftDownButtonController([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] ViewBase target,
- [DisallowNull] NeedPaintHandler needPaint)
+ public LeftDownButtonController([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] ViewBase? target,
+ [DisallowNull] NeedPaintHandler? needPaint)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(target != null);
- Debug.Assert(needPaint != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(target is not null);
+ Debug.Assert(needPaint is not null);
- Ribbon = ribbon;
- Target = target;
- _needPaint = needPaint;
+ Ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ Target = target ?? throw new ArgumentNullException(nameof(target));
+ _needPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
_updateTimer = new Timer
{
@@ -135,7 +135,7 @@ public virtual void MouseEnter(Control c)
_mouseOver = true;
// Get the form we are inside
- KryptonForm ownerForm = Ribbon.FindKryptonForm();
+ KryptonForm? ownerForm = Ribbon.FindKryptonForm();
_active = ownerForm is { WindowActive: true } ||
VisualPopupManager.Singleton.IsTracking ||
Ribbon.InDesignMode ||
@@ -246,7 +246,7 @@ public virtual void DoubleClick(Point pt)
///
protected virtual void UpdateTargetState()
{
- // By default the button is in the normal state
+ // By default, the button is in the normal state
var newState = PaletteState.Normal;
// Only allow another state if the ribbon is enabled
@@ -304,7 +304,7 @@ protected virtual void OnNeedPaint(bool needLayout,
#endregion
#region Implementation
- private void OnUpdateTimer(object sender, EventArgs e)
+ private void OnUpdateTimer(object? sender, EventArgs e)
{
_updateTimer.Stop();
UpdateTargetState();
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/LeftUpButtonController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/LeftUpButtonController.cs
index b0b85d554..11edded76 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/LeftUpButtonController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/LeftUpButtonController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -41,19 +41,19 @@ internal class LeftUpButtonController : GlobalId,
/// Reference to owning ribbon instance.
/// Target for state changes.
/// Delegate for notifying paint requests.
- public LeftUpButtonController([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] ViewBase target,
- NeedPaintHandler needPaint)
+ public LeftUpButtonController([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] ViewBase? target,
+ [DisallowNull] NeedPaintHandler? needPaint)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(target != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(target is not null);
// Remember target for state changes
- Ribbon = ribbon;
- Target = target;
+ Ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ Target = target ?? throw new ArgumentNullException(nameof(target));
// Store the provided paint notification delegate
- NeedPaint = needPaint;
+ NeedPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
}
#endregion
@@ -84,7 +84,7 @@ public virtual void MouseEnter(Control c)
_mouseOver = true;
// Get the form we are inside
- KryptonForm ownerForm = Ribbon.FindKryptonForm();
+ KryptonForm? ownerForm = Ribbon.FindKryptonForm();
_active = ownerForm is { WindowActive: true } ||
VisualPopupManager.Singleton.IsTracking ||
Ribbon.InDesignMode ||
@@ -194,7 +194,7 @@ public virtual void MouseLeave(Control c, ViewBase? next)
UpdateTargetState(c);
}
}
-
+
///
/// Left mouse button double click.
///
@@ -266,7 +266,7 @@ protected void UpdateTargetState(Control c)
/// Mouse point.
protected virtual void UpdateTargetState(Point pt)
{
- // By default the button is in the normal state
+ // By default, the button is in the normal state
PaletteState newState;
// If the button is disabled then show as disabled
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/MaskedTextBoxController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/MaskedTextBoxController.cs
index aa74b7fe9..cab5da605 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/MaskedTextBoxController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/MaskedTextBoxController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -35,17 +35,17 @@ internal class MaskedTextBoxController : GlobalId,
/// Reference to owning ribbon instance.
/// Source definition.
/// Target view element.
- public MaskedTextBoxController([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupMaskedTextBox maskedTextBox,
- [DisallowNull] ViewDrawRibbonGroupMaskedTextBox target)
+ public MaskedTextBoxController([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupMaskedTextBox? maskedTextBox,
+ [DisallowNull] ViewDrawRibbonGroupMaskedTextBox? target)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(maskedTextBox != null);
- Debug.Assert(target != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(maskedTextBox is not null);
+ Debug.Assert(target is not null);
- _ribbon = ribbon;
- _maskedTextBox = maskedTextBox;
- _target = target;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _maskedTextBox = maskedTextBox ?? throw new ArgumentNullException(nameof(maskedTextBox));
+ _target = target ?? throw new ArgumentNullException(nameof(target));
}
#endregion
@@ -56,7 +56,7 @@ public MaskedTextBoxController([DisallowNull] KryptonRibbon ribbon,
/// Reference to the source control instance.
public void GotFocus(Control c)
{
- if (_maskedTextBox.LastMaskedTextBox.MaskedTextBox is { CanFocus: true })
+ if (_maskedTextBox.LastMaskedTextBox?.MaskedTextBox is { CanFocus: true })
{
_ribbon.LostFocusLosesKeyboard = false;
_maskedTextBox.LastMaskedTextBox.MaskedTextBox.Focus();
@@ -81,7 +81,7 @@ public void LostFocus([DisallowNull] Control c)
public void KeyDown(Control c, KeyEventArgs e)
{
// Get the root control that owns the provided control
- c = _ribbon.GetControllerControl(c);
+ c = _ribbon.GetControllerControl(c)!;
switch (c)
{
@@ -124,7 +124,7 @@ public void KeyPress(Control c, KeyPressEventArgs e)
public void KeyTipSelect(KryptonRibbon ribbon)
{
// Can the masked textbox take the focus
- if (_maskedTextBox.LastMaskedTextBox.CanFocus)
+ if (_maskedTextBox.LastMaskedTextBox!.CanFocus)
{
// Prevent the ribbon from killing keyboard mode when it loses the focus,
// as this causes the tracking windows to be killed and we want them kept
@@ -138,7 +138,7 @@ public void KeyTipSelect(KryptonRibbon ribbon)
ribbon.KillKeyboardMode();
// Push focus to the specified target control
- _maskedTextBox.LastMaskedTextBox.MaskedTextBox.Focus();
+ _maskedTextBox.LastMaskedTextBox.MaskedTextBox?.Focus();
// Ensure that the previous ribbon focus is restored when the popup window is dismissed
// If the masked textbox is inside a popup window
@@ -151,10 +151,20 @@ public void KeyTipSelect(KryptonRibbon ribbon)
#endregion
#region Implementation
- private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
+ private void KeyDownRibbon(KryptonRibbon? ribbon, KeyEventArgs e)
{
ViewBase? newView = null;
+ if (ribbon is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.ParameterCannotBeNull(nameof(ribbon)));
+ }
+
+ if (ribbon.TabsArea is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.PropertyCannotBeNull(nameof(ribbon.TabsArea)));
+ }
+
switch (e.KeyData)
{
case Keys.Tab | Keys.Shift:
@@ -167,8 +177,8 @@ private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
case Keys.Tab:
case Keys.Right:
// Get the next focus item for the currently selected page
- newView = (ribbon.GroupsArea.ViewGroups.GetNextFocusItem(_target) ?? ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far)) ??
- ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
+ newView = (ribbon.GroupsArea.ViewGroups.GetNextFocusItem(_target) ?? ribbon.TabsArea.ButtonSpecManager?.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far)) ??
+ ribbon.TabsArea.ButtonSpecManager?.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
// Move across to any far defined buttons
@@ -185,7 +195,7 @@ private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
{
newView = ribbon.TabsArea.LayoutAppTab.AppTab;
}
- }
+ }
break;
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/NullController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/NullController.cs
index b5657e816..a83572a1a 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/NullController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/NullController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/NumericUpDownController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/NumericUpDownController.cs
index 3e690b4ab..e2b252e10 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/NumericUpDownController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/NumericUpDownController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -35,17 +35,17 @@ internal class NumericUpDownController : GlobalId,
/// Reference to owning ribbon instance.
/// Source definition.
/// Target view element.
- public NumericUpDownController([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupNumericUpDown numericUpDown,
- [DisallowNull] ViewDrawRibbonGroupNumericUpDown target)
+ public NumericUpDownController([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupNumericUpDown? numericUpDown,
+ [DisallowNull] ViewDrawRibbonGroupNumericUpDown? target)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(numericUpDown != null);
- Debug.Assert(target != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(numericUpDown is not null);
+ Debug.Assert(target is not null);
- _ribbon = ribbon;
- _numericUpDown = numericUpDown;
- _target = target;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _numericUpDown = numericUpDown ?? throw new ArgumentNullException(nameof(numericUpDown));
+ _target = target ?? throw new ArgumentNullException(nameof(target));
}
#endregion
@@ -56,7 +56,7 @@ public NumericUpDownController([DisallowNull] KryptonRibbon ribbon,
/// Reference to the source control instance.
public void GotFocus(Control c)
{
- if (_numericUpDown.LastNumericUpDown.NumericUpDown is { CanFocus: true })
+ if (_numericUpDown.LastNumericUpDown?.NumericUpDown is { CanFocus: true })
{
_ribbon.LostFocusLosesKeyboard = false;
_numericUpDown.LastNumericUpDown.NumericUpDown.Focus();
@@ -81,7 +81,7 @@ public void LostFocus([DisallowNull] Control c)
public void KeyDown(Control c, KeyEventArgs e)
{
// Get the root control that owns the provided control
- c = _ribbon.GetControllerControl(c);
+ c = _ribbon.GetControllerControl(c)!;
switch (c)
{
@@ -124,7 +124,7 @@ public void KeyPress(Control c, KeyPressEventArgs e)
public void KeyTipSelect(KryptonRibbon ribbon)
{
// Can the numeric up-down take the focus
- if (_numericUpDown.LastNumericUpDown.CanFocus)
+ if (_numericUpDown.LastNumericUpDown!.CanFocus)
{
// Prevent the ribbon from killing keyboard mode when it loses the focus,
// as this causes the tracking windows to be killed and we want them kept
@@ -138,7 +138,7 @@ public void KeyTipSelect(KryptonRibbon ribbon)
ribbon.KillKeyboardMode();
// Push focus to the specified target control
- _numericUpDown.LastNumericUpDown.NumericUpDown.Focus();
+ _numericUpDown.LastNumericUpDown.NumericUpDown?.Focus();
// Ensure that the previous ribbon focus is restored when the popup window is dismissed
// If the numeric up-down is inside a popup window
@@ -151,10 +151,20 @@ public void KeyTipSelect(KryptonRibbon ribbon)
#endregion
#region Implementation
- private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
+ private void KeyDownRibbon(KryptonRibbon? ribbon, KeyEventArgs e)
{
ViewBase? newView = null;
+ if (ribbon is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.ParameterCannotBeNull(nameof(ribbon)));
+ }
+
+ if (ribbon.TabsArea is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.PropertyCannotBeNull(nameof(ribbon.TabsArea)));
+ }
+
switch (e.KeyData)
{
case Keys.Tab | Keys.Shift:
@@ -167,8 +177,8 @@ private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
case Keys.Tab:
case Keys.Right:
// Get the next focus item for the currently selected page
- newView = (ribbon.GroupsArea.ViewGroups.GetNextFocusItem(_target) ?? ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far)) ??
- ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
+ newView = (ribbon.GroupsArea.ViewGroups.GetNextFocusItem(_target) ?? ribbon.TabsArea.ButtonSpecManager?.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far)) ??
+ ribbon.TabsArea.ButtonSpecManager?.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
// Move across to any far defined buttons
@@ -185,7 +195,7 @@ private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
{
newView = ribbon.TabsArea.LayoutAppTab.AppTab;
}
- }
+ }
break;
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/QATButtonController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/QATButtonController.cs
index 03905c9c9..3bbeb8d48 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/QATButtonController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/QATButtonController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/QATExtraButtonController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/QATExtraButtonController.cs
index eee65ce63..a955c89a6 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/QATExtraButtonController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/QATExtraButtonController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -143,13 +143,14 @@ public void KeyTipSelect(KryptonRibbon ribbon)
OnClick(new MouseEventArgs(MouseButtons.Left, 1, 0, 0, 0));
// We should have a visual popup for showing the qat overflow group
- if (VisualPopupManager.Singleton is { IsTracking: true, CurrentPopup: VisualPopupQATOverflow popupOverflow }
- )
+ if (VisualPopupManager.Singleton is { IsTracking: true, CurrentPopup: VisualPopupQATOverflow popupOverflow })
{
// Grab the list of key tips from the popup group
Ribbon.KeyTipMode = KeyTipMode.PopupQATOverflow;
var keyTipList = new KeyTipInfoList();
- keyTipList.AddRange(popupOverflow.ViewQATContents.GetQATKeyTips(null));
+
+ // GetQATKeyTips() requires a valid reference to the KryptonForm the Ribbon belongs to.
+ keyTipList.AddRange(popupOverflow.ViewQATContents.GetQATKeyTips(ribbon.FindKryptonForm()!));
// Update key tips with those appropriate for this tab
Ribbon.SetKeyTips(keyTipList, KeyTipMode.PopupQATOverflow);
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/RecentDocController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/RecentDocController.cs
index f74538226..a09dd7ca6 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/RecentDocController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/RecentDocController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -37,17 +37,17 @@ internal class RecentDocController : GlobalId,
/// Owning view manager instance.
/// Target menu item view element.
/// Delegate for notifying paint requests.
- public RecentDocController([DisallowNull] ViewContextMenuManager viewManager,
- [DisallowNull] ViewDrawRibbonAppMenuRecentDec menuItem,
- [DisallowNull] NeedPaintHandler needPaint)
+ public RecentDocController([DisallowNull] ViewContextMenuManager? viewManager,
+ [DisallowNull] ViewDrawRibbonAppMenuRecentDec? menuItem,
+ [DisallowNull] NeedPaintHandler? needPaint)
{
- Debug.Assert(viewManager != null);
- Debug.Assert(menuItem != null);
- Debug.Assert(needPaint != null);
+ Debug.Assert(viewManager is not null);
+ Debug.Assert(menuItem is not null);
+ Debug.Assert(needPaint is not null);
- ViewManager = viewManager;
- _menuItem = menuItem;
- NeedPaint = needPaint;
+ ViewManager = viewManager ?? throw new ArgumentNullException(nameof(viewManager));
+ _menuItem = menuItem ?? throw new ArgumentNullException(nameof(menuItem));
+ NeedPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/RepeatButtonController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/RepeatButtonController.cs
index 6fc606bb0..1368b29ba 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/RepeatButtonController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/RepeatButtonController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -43,19 +43,19 @@ internal class RepeatButtonController : GlobalId,
/// Reference to owning control.
/// Delegate for notifying paint requests.
/// Target for state changes.
- public RepeatButtonController([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] ViewBase target,
- NeedPaintHandler needPaint)
+ public RepeatButtonController([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] ViewBase? target,
+ [DisallowNull] NeedPaintHandler? needPaint)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(target != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(target is not null);
// Remember incoming references
- _target = target;
- _ribbon = ribbon;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _target = target ?? throw new ArgumentNullException(nameof(target));
// Store the provided paint notification delegate
- NeedPaint = needPaint;
+ NeedPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
_repeatTimer = new Timer
{
@@ -253,7 +253,7 @@ protected void UpdateTargetState(Control c)
/// Mouse point.
protected void UpdateTargetState(Point pt)
{
- // By default the button is in the normal state
+ // By default, the button is in the normal state
PaletteState newState;
// If the button is disabled then show as disabled
@@ -323,9 +323,9 @@ private bool Active
}
else
{
- Form topForm = _ribbon.FindForm();
+ Form? topForm = _ribbon.FindForm();
return (CommonHelper.ActiveFloatingWindow != null) ||
- ((topForm != null) &&
+ ((topForm != null) &&
(topForm.ContainsFocus ||
((topForm.Parent != null) && topForm is { Visible: true, Enabled: true })));
}
@@ -333,7 +333,7 @@ private bool Active
}
}
- private void OnRepeatTick(object sender, EventArgs e) =>
+ private void OnRepeatTick(object? sender, EventArgs e) =>
// Keep generating clicks
OnClick(new MouseEventArgs(MouseButtons.Left, 1, 0, 0, 0));
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/RibbonTabController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/RibbonTabController.cs
index 2381372cb..2eb04c937 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/RibbonTabController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/RibbonTabController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -50,19 +50,19 @@ internal class RibbonTabController : GlobalId,
/// Reference to owning control.
/// Target for state changes.
/// Delegate for notifying paint requests.
- public RibbonTabController([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] ViewDrawRibbonTab target,
- NeedPaintHandler needPaint)
+ public RibbonTabController([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] ViewDrawRibbonTab? target,
+ [DisallowNull] NeedPaintHandler? needPaint)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(target != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(target is not null);
// Remember incoming references
- _target = target;
- _ribbon = ribbon;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _target = target ?? throw new ArgumentNullException(nameof(target));
// Store the provided paint notification delegate
- NeedPaint = needPaint;
+ NeedPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
}
#endregion
@@ -107,18 +107,18 @@ public virtual bool MouseDown(Control c, Point pt, MouseButtons button)
{
// Only interested in left mouse pressing down
case MouseButtons.Left:
- {
- // Can only click if enabled
- if (_target.Enabled)
{
- // Generate a click event
- OnClick(new MouseEventArgs(MouseButtons.Left, 1, pt.X, pt.Y, 0));
+ // Can only click if enabled
+ if (_target.Enabled)
+ {
+ // Generate a click event
+ OnClick(new MouseEventArgs(MouseButtons.Left, 1, pt.X, pt.Y, 0));
+ }
+
+ // Update the visual state
+ UpdateTargetState(c);
+ break;
}
-
- // Update the visual state
- UpdateTargetState(c);
- break;
- }
case MouseButtons.Right:
// Remember the user has pressed the right mouse button down
_rightButtonDown = true;
@@ -227,6 +227,11 @@ public void KeyDown(Control c, KeyEventArgs e)
ViewBase? newView = null;
Keys keyData = e.KeyData;
+ if (_ribbon.TabsArea is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.PropertyCannotBeNull(nameof(_ribbon.TabsArea)));
+ }
+
// When there is no selected tab then tab and shift+tab become right and left
if (_ribbon.SelectedTab == null)
{
@@ -245,9 +250,9 @@ public void KeyDown(Control c, KeyEventArgs e)
{
case Keys.Right:
// Get the next visible tab page
- newView = (_target.ViewLayoutRibbonTabs.GetViewForNextRibbonTab(_target.RibbonTab)
- ?? (ViewBase) _ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far))
- ?? _ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
+ newView = (_target.ViewLayoutRibbonTabs.GetViewForNextRibbonTab(_target.RibbonTab!)
+ ?? (ViewBase)_ribbon.TabsArea.ButtonSpecManager?.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far)!)
+ ?? _ribbon.TabsArea.ButtonSpecManager?.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
// Move across to any far defined buttons
@@ -264,12 +269,12 @@ public void KeyDown(Control c, KeyEventArgs e)
{
newView = _ribbon.TabsArea.LayoutAppTab.AppTab;
}
- }
+ }
break;
case Keys.Left:
// Get the previous visible tab page
- newView = (_target.ViewLayoutRibbonTabs.GetViewForPreviousRibbonTab(_target.RibbonTab)
- ?? (ViewBase) _ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Near))
+ newView = (_target.ViewLayoutRibbonTabs.GetViewForPreviousRibbonTab(_target.RibbonTab!)
+ ?? (ViewBase)_ribbon.TabsArea.ButtonSpecManager?.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Near)!)
?? _ribbon.GetLastQATView();
// Move across to any near defined buttons
@@ -287,11 +292,11 @@ public void KeyDown(Control c, KeyEventArgs e)
{
newView = _ribbon.TabsArea.LayoutAppTab.AppTab;
}
- }
+ }
break;
case Keys.Tab | Keys.Shift:
// Move across to any near defined buttons
- newView = _ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Near)
+ newView = _ribbon.TabsArea.ButtonSpecManager?.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Near)
?? _ribbon.GetLastQATView();
// Get the last qat button
@@ -307,7 +312,7 @@ public void KeyDown(Control c, KeyEventArgs e)
{
newView = _ribbon.TabsArea.LayoutAppTab.AppTab;
}
- }
+ }
break;
case Keys.Down:
// Get the first focus item for the currently selected page
@@ -315,8 +320,8 @@ public void KeyDown(Control c, KeyEventArgs e)
break;
case Keys.Tab:
// Get the first focus item for the currently selected page
- newView = (_ribbon.GroupsArea.ViewGroups.GetFirstFocusItem()
- ?? _ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Near))
+ newView = (_ribbon.GroupsArea.ViewGroups.GetFirstFocusItem()
+ ?? _ribbon.TabsArea.ButtonSpecManager?.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Near))
?? _ribbon.GetLastQATView();
// Move across to any near defined buttons
@@ -334,12 +339,12 @@ public void KeyDown(Control c, KeyEventArgs e)
{
newView = _ribbon.TabsArea.LayoutAppTab.AppTab;
}
- }
+ }
break;
case Keys.Enter:
case Keys.Space:
// When minimize, pressing enter will select the tab and pop it up
- if (_ribbon.RealMinimizedMode
+ if (_ribbon.RealMinimizedMode
&& (_ribbon.SelectedTab != _target.RibbonTab)
)
{
@@ -417,12 +422,12 @@ public void KeyTipSelect(KryptonRibbon ribbon)
///
public NeedPaintHandler NeedPaint
{
- get => _needPaint;
+ get => _needPaint!;
set
{
// Warn if multiple sources want to hook their single delegate
- Debug.Assert(((_needPaint == null) && (value != null))
+ Debug.Assert(((_needPaint == null) && (value != null))
|| ((_needPaint != null) && (value == null))
);
@@ -438,7 +443,7 @@ public NeedPaintHandler NeedPaint
/// Owning control.
protected void UpdateTargetState(Control c)
{
- if ((c == null) || c.IsDisposed)
+ if (c == null || c.IsDisposed)
{
UpdateTargetState(new Point(int.MaxValue, int.MaxValue));
}
@@ -454,7 +459,7 @@ protected void UpdateTargetState(Control c)
/// Mouse point.
protected void UpdateTargetState(Point pt)
{
- // By default the button is in the normal state
+ // By default, the button is in the normal state
PaletteState newState;
// If the button is disabled then show as disabled
@@ -502,7 +507,7 @@ protected void UpdateTargetState(Point pt)
///
/// Does the palette change require a layout.
/// Rectangle to invalidate.
- protected virtual void OnNeedPaint(bool needLayout,
+ protected virtual void OnNeedPaint(bool needLayout,
Rectangle invalidRect)
{
if (_needPaint != null)
@@ -531,9 +536,9 @@ private bool Active
}
else
{
- Form topForm = _ribbon.FindForm();
+ Form? topForm = _ribbon.FindForm();
return (CommonHelper.ActiveFloatingWindow != null) ||
- ((topForm != null) &&
+ ((topForm != null) &&
(topForm.ContainsFocus ||
((topForm.Parent != null) && topForm is { Visible: true, Enabled: true })));
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/RibbonTabsController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/RibbonTabsController.cs
index a794116ec..0770f9456 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/RibbonTabsController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/RibbonTabsController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -37,10 +37,10 @@ internal class RibbonTabsController : GlobalId,
/// Initialize a new instance of the RibbonTabsController class.
///
/// Reference to owning control.
- public RibbonTabsController([DisallowNull] KryptonRibbon ribbon)
+ public RibbonTabsController([DisallowNull] KryptonRibbon? ribbon)
{
- Debug.Assert(ribbon != null);
- _ribbon = ribbon;
+ Debug.Assert(ribbon is not null);
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/RichTextBoxController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/RichTextBoxController.cs
index 37d044906..d770b3646 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/RichTextBoxController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/RichTextBoxController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -35,17 +35,17 @@ internal class RichTextBoxController : GlobalId,
/// Reference to owning ribbon instance.
/// Source definition.
/// Target view element.
- public RichTextBoxController([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupRichTextBox richTextBox,
- [DisallowNull] ViewDrawRibbonGroupRichTextBox target)
+ public RichTextBoxController([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupRichTextBox? richTextBox,
+ [DisallowNull] ViewDrawRibbonGroupRichTextBox? target)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(richTextBox != null);
- Debug.Assert(target != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(richTextBox is not null);
+ Debug.Assert(target is not null);
- _ribbon = ribbon;
- _richTextBox = richTextBox;
- _target = target;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _richTextBox = richTextBox ?? throw new ArgumentNullException(nameof(richTextBox));
+ _target = target ?? throw new ArgumentNullException(nameof(target));
}
#endregion
@@ -56,10 +56,10 @@ public RichTextBoxController([DisallowNull] KryptonRibbon ribbon,
/// Reference to the source control instance.
public void GotFocus(Control c)
{
- if (_richTextBox.LastRichTextBox.RichTextBox is { CanFocus: true })
+ if (_richTextBox.LastRichTextBox?.RichTextBox is { CanFocus: true })
{
_ribbon.LostFocusLosesKeyboard = false;
- _richTextBox.LastRichTextBox.RichTextBox.Focus();
+ _richTextBox.LastRichTextBox.RichTextBox?.Focus();
}
}
@@ -81,7 +81,7 @@ public void LostFocus([DisallowNull] Control c)
public void KeyDown(Control c, KeyEventArgs e)
{
// Get the root control that owns the provided control
- c = _ribbon.GetControllerControl(c);
+ c = _ribbon.GetControllerControl(c)!;
switch (c)
{
@@ -124,7 +124,7 @@ public void KeyPress(Control c, KeyPressEventArgs e)
public void KeyTipSelect(KryptonRibbon ribbon)
{
// Can the richtextbox take the focus
- if (_richTextBox.LastRichTextBox.CanFocus)
+ if (_richTextBox.LastRichTextBox!.CanFocus)
{
// Prevent the ribbon from killing keyboard mode when it loses the focus,
// as this causes the tracking windows to be killed and we want them kept
@@ -138,7 +138,7 @@ public void KeyTipSelect(KryptonRibbon ribbon)
ribbon.KillKeyboardMode();
// Push focus to the specified target control
- _richTextBox.LastRichTextBox.RichTextBox.Focus();
+ _richTextBox.LastRichTextBox.RichTextBox?.Focus();
// Ensure that the previous ribbon focus is restored when the popup window is dismissed
// If the richtextbox is inside a popup window
@@ -151,24 +151,34 @@ public void KeyTipSelect(KryptonRibbon ribbon)
#endregion
#region Implementation
- private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
+ private void KeyDownRibbon(KryptonRibbon? ribbon, KeyEventArgs e)
{
ViewBase? newView = null;
+ if (ribbon is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.ParameterCannotBeNull(nameof(ribbon)));
+ }
+
+ if (ribbon.TabsArea is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.PropertyCannotBeNull(nameof(ribbon.TabsArea)));
+ }
+
switch (e.KeyData)
{
case Keys.Tab | Keys.Shift:
case Keys.Left:
// Get the previous focus item for the currently selected page
- newView = ribbon.GroupsArea.ViewGroups.GetPreviousFocusItem(_target) ?? ribbon.TabsArea.LayoutTabs.GetViewForRibbonTab(ribbon.SelectedTab);
+ newView = ribbon.GroupsArea.ViewGroups?.GetPreviousFocusItem(_target) ?? ribbon.TabsArea.LayoutTabs?.GetViewForRibbonTab(ribbon.SelectedTab);
// Got to the actual tab header
break;
case Keys.Tab:
case Keys.Right:
// Get the next focus item for the currently selected page
- newView = (ribbon.GroupsArea.ViewGroups.GetNextFocusItem(_target) ?? ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far)) ??
- ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
+ newView = (ribbon.GroupsArea.ViewGroups?.GetNextFocusItem(_target) ?? ribbon.TabsArea.ButtonSpecManager?.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far)) ??
+ ribbon.TabsArea.ButtonSpecManager?.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
// Move across to any far defined buttons
@@ -185,7 +195,7 @@ private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
{
newView = ribbon.TabsArea.LayoutAppTab.AppTab;
}
- }
+ }
break;
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/TextBoxController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/TextBoxController.cs
index 18d89d8c7..618f07f86 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/TextBoxController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/TextBoxController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -35,17 +35,17 @@ internal class TextBoxController : GlobalId,
/// Reference to owning ribbon instance.
/// Source definition.
/// Target view element.
- public TextBoxController([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupTextBox textBox,
- [DisallowNull] ViewDrawRibbonGroupTextBox target)
+ public TextBoxController([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupTextBox? textBox,
+ [DisallowNull] ViewDrawRibbonGroupTextBox? target)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(textBox != null);
- Debug.Assert(target != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(textBox is not null);
+ Debug.Assert(target is not null);
- _ribbon = ribbon;
- _textBox = textBox;
- _target = target;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _textBox = textBox ?? throw new ArgumentNullException(nameof(textBox));
+ _target = target ?? throw new ArgumentNullException(nameof(target));
}
#endregion
@@ -56,7 +56,7 @@ public TextBoxController([DisallowNull] KryptonRibbon ribbon,
/// Reference to the source control instance.
public void GotFocus(Control c)
{
- if (_textBox.LastTextBox.TextBox is { CanFocus: true })
+ if (_textBox.LastTextBox?.TextBox is { CanFocus: true })
{
_ribbon.LostFocusLosesKeyboard = false;
_textBox.LastTextBox.TextBox.Focus();
@@ -81,7 +81,7 @@ public void LostFocus([DisallowNull] Control c)
public void KeyDown(Control c, KeyEventArgs e)
{
// Get the root control that owns the provided control
- c = _ribbon.GetControllerControl(c);
+ c = _ribbon.GetControllerControl(c)!;
switch (c)
{
@@ -125,7 +125,7 @@ public void KeyPress(Control c, KeyPressEventArgs e)
public void KeyTipSelect(KryptonRibbon ribbon)
{
// Can the textbox take the focus
- if (_textBox.LastTextBox.CanFocus)
+ if (_textBox.LastTextBox!.CanFocus)
{
// Prevent the ribbon from killing keyboard mode when it loses the focus,
// as this causes the tracking windows to be killed and we want them kept
@@ -156,6 +156,16 @@ private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
{
ViewBase? newView = null;
+ if (ribbon is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.ParameterCannotBeNull(nameof(ribbon)));
+ }
+
+ if (ribbon.TabsArea is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.PropertyCannotBeNull(nameof(ribbon.TabsArea)));
+ }
+
switch (e.KeyData)
{
case Keys.Tab | Keys.Shift:
@@ -168,8 +178,8 @@ private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
case Keys.Tab:
case Keys.Right:
// Get the next focus item for the currently selected page
- newView = (ribbon.GroupsArea.ViewGroups.GetNextFocusItem(_target) ?? ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far)) ??
- ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
+ newView = (ribbon.GroupsArea.ViewGroups.GetNextFocusItem(_target) ?? ribbon.TabsArea.ButtonSpecManager?.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far)) ??
+ ribbon.TabsArea.ButtonSpecManager?.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
// Move across to any far defined buttons
@@ -186,7 +196,7 @@ private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
{
newView = ribbon.TabsArea.LayoutAppTab.AppTab;
}
- }
+ }
break;
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/TrackBarController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/TrackBarController.cs
index abac0c23f..595d793c8 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/TrackBarController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/TrackBarController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -35,17 +35,17 @@ internal class TrackBarController : GlobalId,
/// Reference to owning ribbon instance.
/// Source definition.
/// Target view element.
- public TrackBarController([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupTrackBar trackBar,
- [DisallowNull] ViewDrawRibbonGroupTrackBar target)
+ public TrackBarController([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupTrackBar? trackBar,
+ [DisallowNull] ViewDrawRibbonGroupTrackBar? target)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(trackBar != null);
- Debug.Assert(target != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(trackBar is not null);
+ Debug.Assert(target is not null);
- _ribbon = ribbon;
- _trackBar = trackBar;
- _target = target;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _trackBar = trackBar ?? throw new ArgumentNullException(nameof(trackBar));
+ _target = target ?? throw new ArgumentNullException(nameof(target));
}
#endregion
@@ -81,7 +81,7 @@ public void LostFocus([DisallowNull] Control c)
public void KeyDown(Control c, KeyEventArgs e)
{
// Get the root control that owns the provided control
- c = _ribbon.GetControllerControl(c);
+ c = _ribbon.GetControllerControl(c)!;
switch (c)
{
@@ -124,7 +124,7 @@ public void KeyPress(Control c, KeyPressEventArgs e)
public void KeyTipSelect(KryptonRibbon ribbon)
{
// Can the trackbar take the focus
- if (_trackBar.LastTrackBar.CanFocus)
+ if (_trackBar.LastTrackBar!.CanFocus)
{
// Prevent the ribbon from killing keyboard mode when it loses the focus,
// as this causes the tracking windows to be killed and we want them kept
@@ -151,10 +151,20 @@ public void KeyTipSelect(KryptonRibbon ribbon)
#endregion
#region Implementation
- private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
+ private void KeyDownRibbon(KryptonRibbon? ribbon, KeyEventArgs e)
{
ViewBase? newView = null;
+ if (ribbon is null)
+ {
+ throw new ArgumentNullException(nameof(ribbon));
+ }
+
+ if (ribbon.TabsArea is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.PropertyCannotBeNull(nameof(ribbon.TabsArea)));
+ }
+
switch (e.KeyData)
{
case Keys.Tab | Keys.Shift:
@@ -167,8 +177,8 @@ private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
case Keys.Tab:
case Keys.Right:
// Get the next focus item for the currently selected page
- newView = (ribbon.GroupsArea.ViewGroups.GetNextFocusItem(_target) ?? ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far)) ??
- ribbon.TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
+ newView = (ribbon.GroupsArea.ViewGroups.GetNextFocusItem(_target) ?? ribbon.TabsArea.ButtonSpecManager?.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far)) ??
+ ribbon.TabsArea.ButtonSpecManager?.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
// Move across to any far defined buttons
@@ -185,7 +195,7 @@ private void KeyDownRibbon(KryptonRibbon ribbon, KeyEventArgs e)
{
newView = ribbon.TabsArea.LayoutAppTab.AppTab;
}
- }
+ }
break;
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controller/ViewHighlightController.cs b/Source/Krypton Components/Krypton.Ribbon/Controller/ViewHighlightController.cs
index 92948d1f3..a29fc5196 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controller/ViewHighlightController.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controller/ViewHighlightController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -44,14 +44,14 @@ internal class ViewHightlightController : GlobalId,
///
/// Target for state changes.
/// Delegate for notifying paint requests.
- public ViewHightlightController([DisallowNull] ViewBase target,
- [DisallowNull] NeedPaintHandler needPaint)
+ public ViewHightlightController([DisallowNull] ViewBase? target,
+ [DisallowNull] NeedPaintHandler? needPaint)
{
Debug.Assert(target != null);
Debug.Assert(needPaint != null);
- Target = target;
- NeedPaint = needPaint;
+ Target = target ?? throw new ArgumentNullException(nameof(target));
+ NeedPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
}
#endregion
@@ -87,7 +87,7 @@ public virtual void MouseMove(Control c, Point pt)
/// True if capturing input; otherwise false.
public virtual bool MouseDown(Control c, Point pt, MouseButtons button)
{
- if (_mouseOver
+ if (_mouseOver
&& (button == MouseButtons.Left))
{
OnClick(EventArgs.Empty);
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonGallery.cs b/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonGallery.cs
index c6e391f1b..6828daa86 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonGallery.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonGallery.cs
@@ -5,10 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
- *
- * Modified: Monday 12th April, 2021 @ 18:00 GMT
- *
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*/
#endregion
@@ -107,7 +104,7 @@ public KryptonGallery()
// Create content storage
Images = new GalleryImages(NeedPaintDelegate);
- DropButtonRanges = new KryptonGalleryRangeCollection();
+ DropButtonRanges = [];
// Create the palette storage
StateCommon = new PaletteGalleryRedirect(Redirector, NeedPaintDelegate);
@@ -623,13 +620,13 @@ protected override bool ProcessDialogKey(Keys keyData)
// If inside a ribbon then we ignore the movement keys
if (Ribbon is null or { InKeyboardMode: false })
{
- _drawItems[_trackingIndex].KeyDown(new KeyEventArgs(keyData));
+ _drawItems[_trackingIndex]?.KeyDown(new KeyEventArgs(keyData));
return true;
}
break;
case Keys.Space:
case Keys.Enter:
- _drawItems[_trackingIndex].KeyDown(new KeyEventArgs(keyData));
+ _drawItems[_trackingIndex]?.KeyDown(new KeyEventArgs(keyData));
return true;
}
}
@@ -731,9 +728,9 @@ internal void SetTrackingIndex(int index, bool bringIntoView)
internal bool DesignerGetHitTest(Point pt) => false;
- internal Component DesignerComponentFromPoint(Point pt) =>
+ internal Component? DesignerComponentFromPoint(Point pt) =>
// Ignore call as view builder is already destructed
- IsDisposed ? null : ViewManager.ComponentFromPoint(pt);
+ IsDisposed ? null : ViewManager?.ComponentFromPoint(pt);
// Ask the current view for a decision
internal void DesignerMouseLeave() =>
@@ -830,7 +827,7 @@ internal void ShownGalleryDropDown(Rectangle screenRect,
}
// Need to know when the menu is dismissed
- args.KryptonContextMenu.Closed += OnDropMenuClosed;
+ args.KryptonContextMenu!.Closed += OnDropMenuClosed;
// Remember the delegate we need to fire when the menu is dismissed
_finishDelegate = finishDelegate;
@@ -845,7 +842,7 @@ internal void ShownGalleryDropDown(Rectangle screenRect,
}
}
- private void OnDropMenuClosed(object sender, ToolStripDropDownClosedEventArgs e)
+ private void OnDropMenuClosed(object? sender, ToolStripDropDownClosedEventArgs e)
{
if (_dropMenu != null)
{
@@ -881,13 +878,15 @@ private void OnDropMenuClosed(object sender, ToolStripDropDownClosedEventArgs e)
#endregion
#region Implementation
- private void OnDropImageSelect(object sender, EventArgs e)
+ private void OnDropImageSelect(object? sender, EventArgs e)
{
- var imageSelect = (KryptonContextMenuImageSelect)sender;
- SelectedIndex = imageSelect.SelectedIndex;
+ if (sender is KryptonContextMenuImageSelect imageSelect && imageSelect is not null)
+ {
+ SelectedIndex = imageSelect.SelectedIndex;
+ }
}
- private void OnDropImageTracking(object sender, ImageSelectEventArgs e) =>
+ private void OnDropImageTracking(object? sender, ImageSelectEventArgs e) =>
//KryptonContextMenuImageSelect imageSelect = (KryptonContextMenuImageSelect)sender;
TrackingIndex = e.ImageIndex;
@@ -900,15 +899,14 @@ private void UpdateStateAndPalettes()
_drawDocker.Enabled = Enabled;
// Find the new state of the main view element
- PaletteState state;
- state = IsActive ? PaletteState.Tracking : PaletteState.Normal;
+ PaletteState state = Enabled ? (IsActive ? PaletteState.Tracking : PaletteState.Normal) : PaletteState.Disabled;
_drawDocker.ElementState = state;
}
private PaletteGalleryState GetGalleryState() => Enabled ? (IsActive ? StateActive : StateNormal) : StateDisabled;
- private void OnTrackingTick(object sender, EventArgs e)
+ private void OnTrackingTick(object? sender, EventArgs e)
{
// If no change in tracking index over last interval
if (_trackingIndex == _cacheTrackingIndex)
@@ -919,7 +917,7 @@ private void OnTrackingTick(object sender, EventArgs e)
// But only generate if actual event would yield a different value
if (_eventTrackingIndex != _trackingIndex)
{
- OnTrackingImage(new ImageSelectEventArgs(_imageList, _trackingIndex));
+ OnTrackingImage(new ImageSelectEventArgs(_imageList!, _trackingIndex));
}
}
else
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonGalleryRange.cs b/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonGalleryRange.cs
index 3258aff51..6cf7d62df 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonGalleryRange.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonGalleryRange.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonGalleryRangeCollection.cs b/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonGalleryRangeCollection.cs
index d1d98fea7..6785824a6 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonGalleryRangeCollection.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonGalleryRangeCollection.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbon.cs b/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbon.cs
index 52f624111..8a72d4a9a 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbon.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbon.cs
@@ -1,12 +1,10 @@
#region BSD License
/*
- *
* Original BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE)
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
- *
+ *
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
- *
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2024. All rights reserved.
*/
#endregion
@@ -46,12 +44,10 @@ public RibbonButtonSpecAnyCollection(KryptonRibbon owner)
#endregion
#region Static Fields
-
private static readonly MethodInfo _containerSelect;
#endregion
#region Instance Fields
- // Private
private NeedPaintHandler _needPaintGroups;
private VisualPopupMinimized? _minimizedPopup;
private KryptonContextMenu? _kcm;
@@ -68,13 +64,12 @@ public RibbonButtonSpecAnyCollection(KryptonRibbon owner)
private KeyTipControl? _keyTipControlE;
private KeyTipControl? _keyTipControlD;
private KeyTipMode _keyTipMode;
- private Button _hiddenFocusTarget;
+ private Button? _hiddenFocusTarget;
// View Elements
private ViewDrawPanel _drawMinimizedPanel;
private ViewLayoutDocker? _rootDocker;
private ViewLayoutDocker _ribbonDocker;
- private ViewDrawRibbonComposition _compositionArea;
private ViewDrawRibbonQATBorder _qatBelowRibbon;
private ViewLayoutRibbonQATFromRibbon _qatBelowContents;
private ViewDrawRibbonMinimizeBar _minimizeBar;
@@ -83,10 +78,10 @@ public RibbonButtonSpecAnyCollection(KryptonRibbon owner)
// Palettes
private PaletteBackInheritRedirect _backPanelInherit;
+ private PaletteRibbonGeneralInheritRedirect _ribbonGeneralInherit;
// Properties
private bool _minimizedMode;
- private bool _allowFormIntegrate;
private bool _showMinimizeButton;
private string _selectedContext;
private Size _hideRibbonSize;
@@ -101,7 +96,6 @@ public RibbonButtonSpecAnyCollection(KryptonRibbon owner)
private PaletteBackStyle _backInactiveStyle;
private KryptonRibbonTab? _minSelectedTab;
private KryptonRibbonTab? _selectedTab;
-
#endregion
#region Events
@@ -183,7 +177,7 @@ static KryptonRibbon() =>
// Cache access to the internal 'Select' method of the ContainerControl
_containerSelect = typeof(ContainerControl).GetMethod("Select",
BindingFlags.Instance |
- BindingFlags.NonPublic);
+ BindingFlags.NonPublic)!;
///
/// Initialize a new instance of the KryptonRibbon class.
@@ -194,6 +188,8 @@ public KryptonRibbon()
SetStyle(ControlStyles.Selectable, false);
SetStyle(ControlStyles.ResizeRedraw, false);
+ _selectedContext = string.Empty;
+
CreateRibbonCollections();
CreateButtonSpecs();
CreateStorageObjects();
@@ -204,8 +200,6 @@ public KryptonRibbon()
// Snoop windows messages to handle command keys such as CTRL+F1 to
// toggle minimized mode and also when to exit keyboard access mode
Application.AddMessageFilter(this);
-
- _allowFormIntegrate = true;
}
///
@@ -223,11 +217,11 @@ protected override void Dispose(bool disposing)
// layout that then causes the children to be added again!
SuspendLayout();
- // Caption area must have chance to unintegrated from the custom chrome
- CaptionArea.Dispose();
+ // Caption area must have chance to un-integrated from the custom chrome
+ CaptionArea?.Dispose();
// Must get the tabs to dispose as it holds event hooks to other windows/controls
- TabsArea.Dispose();
+ TabsArea?.Dispose();
// Dispose of the cached krypton context menu
if (_kcm != null)
@@ -410,30 +404,6 @@ public override string Text
#endregion
#region Public Exposed Properties
- ///
- ///
- [Category(@"Visuals")]
- [Description(@"Integrate with operating system chrome instead of Krypton Palette")]
- public bool AllowFormIntegrate
- {
- get => _allowFormIntegrate;
- set
- {
- if (_allowFormIntegrate != value)
- {
- _allowFormIntegrate = value;
- CaptionArea.PerformFormChromeCheck();
- }
- }
- }
-
- private bool ShouldSerializeAllowFormIntegrate() => _allowFormIntegrate;
-
- ///
- /// Resets the AllowFormIntegrate property to its default value.
- ///
- public void ResetAllowFormIntegrate() => _allowFormIntegrate = true; // https://github.com/Krypton-Suite/Standard-Toolkit/issues/929
-
///
/// Gets or sets if the user is allowed to change the minimized mode.
@@ -661,6 +631,7 @@ public void ResetSelectedTab() =>
[Category(@"Values")]
[Description(@"Common separated list of selected context names.")]
[DefaultValue("")]
+ [AllowNull]
public string SelectedContext
{
get => _selectedContext;
@@ -683,12 +654,8 @@ public string SelectedContext
}
}
- private bool ShouldSerializeSelectedContext() => !string.IsNullOrEmpty(_selectedContext);
-
- ///
- /// Reset the SelectedContext to the default value.
- ///
private void ResetSelectedContext() => SelectedContext = string.Empty;
+ private bool ShouldSerializeSelectedContext() => !string.IsNullOrEmpty(_selectedContext);
///
/// Gets the collection of ribbon context definitions.
@@ -719,24 +686,24 @@ public string SelectedContext
public RibbonShortcuts RibbonShortcuts { get; private set; }
///
- /// Gets the set of ribbon display strings.
+ /// Gets the set of ribbon application button display strings.
///
[Category(@"Values")]
- [Description(@"Collection of ribbon strings.")]
+ [Description(@"Collection of ribbon app button settings.")]
[MergableProperty(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
[Localizable(true)]
- public RibbonStrings RibbonStrings { get; private set; }
+ public RibbonFileAppButton RibbonFileAppButton { get; private set; }
///
/// Gets the set of ribbon application button display strings.
///
[Category(@"Values")]
- [Description(@"Collection of ribbon app button settings.")]
+ [Description(@"Collection of ribbon 'File app tab' settings.")]
[MergableProperty(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
[Localizable(true)]
- public RibbonAppButton RibbonAppButton { get; private set; }
+ public RibbonFileAppTab RibbonFileAppTab { get; private set; }
///
/// Gets the styles for various ribbon elements.
@@ -764,7 +731,7 @@ public Size HideRibbonSize
if (_hideRibbonSize != value)
{
_hideRibbonSize = value;
- TabsArea.CheckRibbonSize();
+ TabsArea?.CheckRibbonSize();
}
}
}
@@ -805,7 +772,7 @@ public bool MinimizedMode
_drawMinimizedPanel.Add(GroupsArea);
}
- // Need to move any child controls out of the client area so they are not shown,
+ // Need to move any child controls out of the client area, so they are not shown,
// this can have when the QAT is below the ribbon and then the child controls that
// contain the per tab details will still be visible in that area.
foreach (Control child in Controls)
@@ -821,7 +788,7 @@ public bool MinimizedMode
ValidateSelectedTab();
// Must layout to effect changes
- TabsArea.RecreateButtons();
+ TabsArea?.RecreateButtons();
PerformNeedPaint(true);
}
else
@@ -859,7 +826,7 @@ public bool MinimizedMode
ValidateSelectedTab();
// Must layout to effect changes
- TabsArea.RecreateButtons();
+ TabsArea?.RecreateButtons();
PerformNeedPaint(true);
// Allow the ribbon to be laid out and painted before we
@@ -900,11 +867,11 @@ public QATLocation QATLocation
// and not showing the QAT below the ribbon
_minimizeBar.Visible = RealMinimizedMode && (QATLocation != QATLocation.Below);
- // Update the fullbar version of the QAT
+ // Update the full-bar version of the QAT
_qatBelowRibbon.Visible = _qatLocation == QATLocation.Below;
// Update the minibar versions of the QAT
- CaptionArea.UpdateQAT();
+ CaptionArea?.UpdateQAT();
// Must layout to effect changes
PerformLayout();
@@ -946,7 +913,7 @@ public bool ShowMinimizeButton
if (_showMinimizeButton != value)
{
_showMinimizeButton = value;
- TabsArea.RecreateButtons();
+ TabsArea?.RecreateButtons();
PerformNeedPaint(true);
}
}
@@ -962,7 +929,7 @@ public bool ShowMinimizeButton
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public ToolTipManager ToolTipManager => TabsArea.ToolTipManager;
+ public ToolTipManager ToolTipManager => TabsArea!.ToolTipManager;
///
/// Gets the collection of controls contained within the control.
@@ -974,7 +941,10 @@ public bool ShowMinimizeButton
/// Internal design time method.
///
[EditorBrowsable(EditorBrowsableState.Never)]
- public bool InDesignMode => DesignMode;
+ public new bool InDesignMode =>
+ // Removed warning CS0108: "IndesignMode hides inherited member VisualControl.InDesignMode".
+ // By marking the property as new.
+ DesignMode;
///
/// Internal design time method.
@@ -1039,7 +1009,7 @@ public void ToggleKeyboardMode()
}
else
{
- // Remove keytips from display
+ // Remove key tips from display
KillKeyboardKeyTips();
if (!IgnoreRestoreFocus)
@@ -1071,7 +1041,7 @@ public void ToggleKeyboardMode()
/// true to filter the message and stop it from being dispatched; false to allow the message to continue to the next filter or control.
public bool PreFilterMessage(ref Message m)
{
- // Prevent interception of messages during design time or after we have died
+ // Prevent interception of messages during design time, or after we have died
if (!IsDisposed && !DesignMode)
{
switch (m.Msg)
@@ -1134,14 +1104,12 @@ public bool PreFilterMessage(ref Message m)
if (ClientRectangle.Contains(PointToClient(pt)))
{
var delta = (short)PI.HIWORD((int)m.WParam.ToInt64());
- TabsArea.LayoutTabs.ProcessMouseWheel(delta < 0);
+ TabsArea?.LayoutTabs.ProcessMouseWheel(delta < 0);
return true;
}
}
}
break;
- default:
- break;
}
}
return false;
@@ -1162,7 +1130,7 @@ public bool DesignerGetHitTest(Point pt)
}
// Get the view the mouse is currently over
- ViewBase? mouseView = ViewManager.Root.ViewFromPoint(pt);
+ ViewBase? mouseView = ViewManager?.Root.ViewFromPoint(pt);
// Do we match of the views we always allow?
var matchView = (mouseView?.Parent != null)
@@ -1191,9 +1159,9 @@ public void DesignerMouseLeave() =>
/// Mouse point.
[EditorBrowsable(EditorBrowsableState.Never)]
[Browsable(false)]
- public Point ViewRectangleToPoint(ViewBase view)
+ public Point ViewRectangleToPoint(ViewBase? view)
{
- Rectangle screenRect = view.OwningControl.RectangleToScreen(view.ClientRectangle);
+ Rectangle screenRect = view!.OwningControl!.RectangleToScreen(view.ClientRectangle);
return new Point(screenRect.Left, screenRect.Bottom);
}
@@ -1212,7 +1180,7 @@ public Point ViewRectangleToPoint(ViewBase view)
}
// Get the view the mouse is currently over
- ViewBase? mouseView = ViewManager.Root.ViewFromPoint(pt);
+ ViewBase? mouseView = ViewManager?.Root.ViewFromPoint(pt);
if (mouseView is ViewDrawRibbonGroupDateTimePicker picker)
{
@@ -1220,7 +1188,7 @@ public Point ViewRectangleToPoint(ViewBase view)
}
else
{
- return ViewManager.ComponentFromPoint(pt);
+ return ViewManager?.ComponentFromPoint(pt);
}
}
#endregion
@@ -1277,9 +1245,6 @@ protected override void OnLayout(LayoutEventArgs levent)
CaptionArea?.AppButtonVisibleChanged();
}
- // If we have a parent form then ask it to check for a change in composition height
- CaptionArea?.KryptonForm?.RecalculateComposition();
-
base.OnLayout(levent);
}
@@ -1298,23 +1263,11 @@ protected override void WndProc(ref Message m)
// Convert to a client point
Point clientPoint = PointToClient(screenPoint);
- if (_compositionArea.Visible)
- {
- if (_compositionArea.ClientRectangle.Contains(clientPoint))
- {
- // By returning transparent the hit test gets sent the window behind it which
- // will be the form itself, and so the existing form level hit testing will
- // occur that handles the min/max/close app button etc...
- m.Result = (IntPtr)PI.HT.TRANSPARENT;
- return;
- }
- }
-
- if (TabsArea.LayoutTabs.GetViewForSpare != null)
+ if (TabsArea?.LayoutTabs.GetViewForSpare != null)
{
// Convert the spare tabs area from child control coordinates to ribbon control coordinates
Rectangle spareRect = TabsArea.LayoutTabs.GetViewForSpare.ClientRectangle;
- spareRect.Offset(TabsArea.TabsContainerControl.ChildControl.Location);
+ spareRect.Offset(TabsArea.TabsContainerControl.ChildControl!.Location);
// If the point is over the spare area of the tabs then treat that area transparent so
// that the form processing can then treat it as a caption area of the actual owning form
@@ -1324,7 +1277,6 @@ protected override void WndProc(ref Message m)
return;
}
}
-
}
base.WndProc(ref m);
@@ -1351,13 +1303,11 @@ protected override bool ProcessDialogKey(Keys keyData)
case Keys.Down:
case Keys.Space:
case Keys.Enter:
- // Any navigation keys remove the keytips
+ // Any navigation keys remove the key-tips
KillKeyboardKeyTips();
_focusView.KeyDown(new KeyEventArgs(keyData));
return true;
- default:
- break;
}
}
else
@@ -1375,8 +1325,6 @@ protected override bool ProcessDialogKey(Keys keyData)
return true;
}
- break;
- default:
break;
}
}
@@ -1466,7 +1414,7 @@ protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
}
// Check if a shortcut is triggered on the application button context menu
- if (RibbonAppButton.AppButtonMenuItems.ProcessShortcut(keyData))
+ if (RibbonFileAppButton.AppButtonMenuItems.ProcessShortcut(keyData))
{
ActionOccurred();
return true;
@@ -1517,10 +1465,10 @@ where qatButton.GetVisible() && qatButton.GetEnabled()
///
/// Source of notification.
/// An EventArgs containing event data.
- protected override void OnButtonSpecChanged(object sender, EventArgs e)
+ protected override void OnButtonSpecChanged(object? sender, EventArgs e)
{
// Recreate all the button specs with new values
- TabsArea.RecreateButtons();
+ TabsArea?.RecreateButtons();
// Let base class perform standard processing
base.OnButtonSpecChanged(sender, e);
@@ -1568,15 +1516,16 @@ protected override void OnGotFocus(EventArgs e)
if (SelectedTab != null)
{
- newFocus = TabsArea.LayoutTabs.GetViewForRibbonTab(SelectedTab);
+ newFocus = TabsArea?.LayoutTabs.GetViewForRibbonTab(SelectedTab);
}
else if (!RealMinimizedMode)
{
- newFocus = TabsArea.LayoutTabs.GetViewForFirstRibbonTab();
+ newFocus = TabsArea?.LayoutTabs.GetViewForFirstRibbonTab();
}
// If no tab to select, then use the application button
- if (newFocus == null)
+ if (newFocus == null
+ && TabsArea != null)
{
if (TabsArea.LayoutAppButton.Visible)
{
@@ -1655,58 +1604,13 @@ protected override void OnResize(EventArgs e)
base.OnResize(e);
}
- ///
- /// Raises the PaintBackground event.
- ///
- /// A PaintEventArgs that contains the event data.
- protected override void OnPaintBackground(PaintEventArgs pevent)
- {
- // If we are using the composition area
- if (_compositionArea.Visible)
- {
- // Cause an empty bitmap to be created and blited to the background,
- // strange though it might sound this creates an empty area and gets
- // rid of any drawing artifacts in that area.
- AccurateText.DrawCompositionGlowingText(pevent.Graphics, string.Empty, Font,
- ClientRectangle, PaletteState.Normal,
- Color.Transparent, false);
-
- // Exclude the composition area from the rest of the background painting
- pevent.Graphics.SetClip(new Rectangle(_compositionArea.ClientLocation, new Size(_compositionArea.ClientWidth, _compositionArea.CompHeight)), CombineMode.Exclude);
- }
-
- base.OnPaintBackground(pevent);
- }
-
///
/// Perform background painting with the provided default values.
///
/// Graphics reference for drawing.
/// Brush to use when painting.
/// Client area to paint.
- protected override void PaintBackground(Graphics g, Brush backBrush, Rectangle backRect)
- {
- // If we are using the composition area
- if (_compositionArea.Visible)
- {
- // Copy the current clipping
- Region oldClip = g.Clip.Clone();
-
- // Exclude the composition area from the background painting
- g.SetClip(new Rectangle(_compositionArea.ClientLocation, new Size(_compositionArea.ClientWidth, _compositionArea.CompHeight)), CombineMode.Exclude);
-
- // Fill background
- g.FillRectangle(backBrush, backRect);
-
- // Dispose of the combined clip and use the old one again
- g.Clip.Dispose();
- g.Clip = oldClip;
- }
- else
- {
- g.FillRectangle(backBrush, backRect);
- }
- }
+ protected override void PaintBackground(Graphics g, Brush backBrush, Rectangle backRect) => g.FillRectangle(backBrush, backRect);
///
/// Processes a notification from palette storage of a paint and optional layout required.
@@ -1806,11 +1710,11 @@ protected virtual void OnSelectedTabChanged(EventArgs e)
internal bool RealMinimizedMode => MinimizedMode && !InDesignMode;
- internal ViewRibbonManager ViewRibbonManager => ViewManager as ViewRibbonManager;
+ internal ViewRibbonManager? ViewRibbonManager => ViewManager as ViewRibbonManager;
internal ViewDrawRibbonPanel MainPanel { get; private set; }
- internal ViewLayoutRibbonTabsArea TabsArea { get; private set; }
+ internal ViewLayoutRibbonTabsArea? TabsArea { get; private set; }
internal ViewLayoutRibbonGroupsArea GroupsArea { get; private set; }
@@ -1844,7 +1748,7 @@ internal void UpdateBackStyle()
// Default to using the BackStyle property
PaletteBackStyle backStyle = BackStyle;
- // Walk up the parnet chain looking for the owning form
+ // Walk up the parent chain looking for the owning form
Form? f = null;
Control? c = this;
while (c.Parent != null)
@@ -1876,7 +1780,7 @@ internal void UpdateBackStyle()
{
_backPanelInherit.Style = backStyle;
GroupsArea.BackStyle = backStyle;
- TabsArea.RecreateButtons();
+ TabsArea?.RecreateButtons();
PerformNeedPaint(true);
}
}
@@ -1956,28 +1860,9 @@ internal ButtonStyle GroupDialogButtonStyle
}
}
- internal Rectangle ClientRectangleWithoutComposition
- {
- get
- {
- // Start with actual client rect
- Rectangle rect = ClientRectangle;
-
- // If showing a composition area at top (represents area under the Aero caption bar chrome)
- if (_compositionArea.Visible)
- {
- // Remove the composition area from client rect
- rect.Y += _compositionArea.ClientHeight;
- rect.Height -= _compositionArea.ClientHeight;
- }
-
- return rect;
- }
- }
-
- internal void TestForAppButtonDoubleClick() => TabsArea.TestForAppButtonDoubleClick();
+ internal void TestForAppButtonDoubleClick() => TabsArea?.TestForAppButtonDoubleClick();
- internal void HideFocus(Control c)
+ internal void HideFocus(Control? c)
{
// Keep going till be find a known parent control
while (c != null)
@@ -2005,11 +1890,11 @@ internal void HideFocus(Control c)
// Last resort, use the hidden one in the ribbon
if (c == null)
{
- _hiddenFocusTarget.Focus();
+ _hiddenFocusTarget?.Focus();
}
}
- internal KryptonForm FindKryptonForm()
+ internal KryptonForm? FindKryptonForm()
{
Control? c = this;
while (c != null)
@@ -2051,23 +1936,24 @@ internal void DisplayQATCustomizeMenu(Rectangle screenRectangle,
// Add heading at top of the context menu
var heading = new KryptonContextMenuHeading
{
- Text = RibbonStrings.CustomizeQuickAccessToolbar
+ Text = KryptonManager.Strings.RibbonStrings.CustomizeQuickAccessToolbar
};
- _kcm.Items.Add(heading);
+ _kcm?.Items.Add(heading);
// Create a container for a set of individual menu items
var menuItems = new KryptonContextMenuItems();
- _kcm.Items.Add(menuItems);
+ _kcm?.Items.Add(menuItems);
// Is user allowed to change the QAT entries?
if (QATUserChange)
{
// Add an entry for each quick access toolbar button
- foreach (IQuickAccessToolbarButton qatButton in QATButtons)
+ foreach (var component in QATButtons)
{
+ var qatButton = component as IQuickAccessToolbarButton;
var menuItem = new KryptonContextMenuItem
{
- Text = qatButton.GetText(),
+ Text = qatButton!.GetText(),
Checked = qatButton.GetVisible()
};
menuItem.Click += OnQATCustomizeClick;
@@ -2082,8 +1968,8 @@ internal void DisplayQATCustomizeMenu(Rectangle screenRectangle,
var showQAT = new KryptonContextMenuItem
{
Text = QATLocation == QATLocation.Above
- ? RibbonStrings.ShowBelowRibbon
- : RibbonStrings.ShowAboveRibbon
+ ? KryptonManager.Strings.RibbonStrings.ShowBelowRibbon
+ : KryptonManager.Strings.RibbonStrings.ShowAboveRibbon
};
showQAT.Click += OnInvertQATLocation;
@@ -2101,7 +1987,7 @@ internal void DisplayQATCustomizeMenu(Rectangle screenRectangle,
// Allow the ribbon to be minimized
var minimize = new KryptonContextMenuItem
{
- Text = RibbonStrings.Minimize,
+ Text = KryptonManager.Strings.RibbonStrings.Minimize,
Checked = MinimizedMode
};
minimize.Click += OnInvertMinimizeMode;
@@ -2116,7 +2002,7 @@ internal void DisplayQATCustomizeMenu(Rectangle screenRectangle,
}
// Give developers a change to modify the customize menu or even cancel it
- var args = new ContextMenuArgs(_kcm);
+ var args = new ContextMenuArgs(_kcm!);
OnShowQATCustomizeMenu(args);
// If not cancelled, then show it
@@ -2127,7 +2013,7 @@ internal void DisplayQATCustomizeMenu(Rectangle screenRectangle,
// Show at the bottom of the button on the left hand side
VisualPopupManager.Singleton.EndAllTracking();
- _kcm.Show(new Point(screenRectangle.X, screenRectangle.Bottom + 1));
+ _kcm?.Show(new Point(screenRectangle.X, screenRectangle.Bottom + 1));
}
else
{
@@ -2154,7 +2040,7 @@ internal void DisplayRibbonContextMenu(MouseEventArgs e)
// Create a container for a set of individual menu items
var menuItems = new KryptonContextMenuItems();
- _kcm.Items.Add(menuItems);
+ _kcm?.Items.Add(menuItems);
// Do we need to allow the QAT location to be inverted?
if (QATLocation != QATLocation.Hidden)
@@ -2162,8 +2048,8 @@ internal void DisplayRibbonContextMenu(MouseEventArgs e)
var showQAT = new KryptonContextMenuItem
{
Text = QATLocation == QATLocation.Above
- ? RibbonStrings.ShowQATBelowRibbon
- : RibbonStrings.ShowQATAboveRibbon
+ ? KryptonManager.Strings.RibbonStrings.ShowQATBelowRibbon
+ : KryptonManager.Strings.RibbonStrings.ShowQATAboveRibbon
};
showQAT.Click += OnInvertQATLocation;
@@ -2176,7 +2062,7 @@ internal void DisplayRibbonContextMenu(MouseEventArgs e)
// Allow the ribbon to be minimized
var minimize = new KryptonContextMenuItem
{
- Text = RibbonStrings.Minimize,
+ Text = KryptonManager.Strings.RibbonStrings.Minimize,
Checked = MinimizedMode
};
minimize.Click += OnInvertMinimizeMode;
@@ -2187,7 +2073,7 @@ internal void DisplayRibbonContextMenu(MouseEventArgs e)
}
// Give developers a change to modify the context menu or even cancel it
- var args = new ContextMenuArgs(_kcm);
+ var args = new ContextMenuArgs(_kcm!);
OnShowRibbonContextMenu(args);
// If not cancelled, then show it
@@ -2195,7 +2081,7 @@ internal void DisplayRibbonContextMenu(MouseEventArgs e)
{
// Show at location we were provided, but need to convert to screen coordinates
VisualPopupManager.Singleton.EndAllTracking();
- _kcm.Show(PointToScreen(new Point(e.X, e.Y)));
+ _kcm?.Show(PointToScreen(new Point(e.X, e.Y)));
}
}
@@ -2204,7 +2090,7 @@ internal void DisplayRibbonContextMenu(MouseEventArgs e)
switch (QATLocation)
{
case QATLocation.Above:
- return CaptionArea.VisibleQAT.GetFirstQATView();
+ return CaptionArea?.VisibleQAT.GetFirstQATView();
case QATLocation.Below:
return _qatBelowContents.GetFirstQATView();
case QATLocation.Hidden:
@@ -2212,6 +2098,7 @@ internal void DisplayRibbonContextMenu(MouseEventArgs e)
default:
// Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(QATLocation.ToString());
return null;
}
}
@@ -2221,7 +2108,7 @@ internal void DisplayRibbonContextMenu(MouseEventArgs e)
switch (QATLocation)
{
case QATLocation.Above:
- return CaptionArea.VisibleQAT.GetLastQATView();
+ return CaptionArea?.VisibleQAT.GetLastQATView();
case QATLocation.Below:
return _qatBelowContents.GetLastQATView();
case QATLocation.Hidden:
@@ -2229,6 +2116,7 @@ internal void DisplayRibbonContextMenu(MouseEventArgs e)
default:
// Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(QATLocation.ToString());
return null;
}
}
@@ -2240,19 +2128,18 @@ internal void DisplayRibbonContextMenu(MouseEventArgs e)
switch (QATLocation)
{
case QATLocation.Above:
- view = CaptionArea.VisibleQAT.GetNextQATView(qatView);
+ view = CaptionArea?.VisibleQAT.GetNextQATView(qatView);
break;
case QATLocation.Below:
view = _qatBelowContents.GetNextQATView(qatView);
break;
- default:
- break;
}
// Get the first near edge button (the last near button is the leftmost one!)
- view ??= TabsArea.ButtonSpecManager.GetLastVisibleViewButton(PaletteRelativeEdgeAlign.Near);
+ view ??= TabsArea?.ButtonSpecManager?.GetLastVisibleViewButton(PaletteRelativeEdgeAlign.Near);
- if (view == null)
+ if (view == null
+ && TabsArea != null)
{
if (tab && (SelectedTab != null))
{
@@ -2266,14 +2153,15 @@ internal void DisplayRibbonContextMenu(MouseEventArgs e)
}
}
- // Move across to any far defined buttons
- view ??= TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far);
+ //// Move across to any far defined buttons
+ //view ??= TabsArea.ButtonSpecManager?.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Far);
// Move across to any inherit defined buttons
- view ??= TabsArea.ButtonSpecManager.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
+ view ??= TabsArea?.ButtonSpecManager?.GetFirstVisibleViewButton(PaletteRelativeEdgeAlign.Inherit);
// Move back to the application button/tab
- if (view == null)
+ if (view == null
+ && TabsArea != null)
{
if (TabsArea.LayoutAppButton.Visible)
{
@@ -2295,7 +2183,7 @@ internal void DisplayRibbonContextMenu(MouseEventArgs e)
switch (QATLocation)
{
case QATLocation.Above:
- view = CaptionArea.VisibleQAT.GetPreviousQATView(qatView);
+ view = CaptionArea?.VisibleQAT.GetPreviousQATView(qatView);
break;
case QATLocation.Below:
view = _qatBelowContents.GetPreviousQATView(qatView);
@@ -2303,7 +2191,8 @@ internal void DisplayRibbonContextMenu(MouseEventArgs e)
}
// Move back to the application button/tab
- if (view == null)
+ if (view == null
+ && TabsArea != null)
{
if (TabsArea.LayoutAppButton.Visible)
{
@@ -2401,7 +2290,7 @@ internal void ActionOccurred()
KillKeyboardMode();
}
- internal void UpdateQAT() => CaptionArea.UpdateQAT();
+ internal void UpdateQAT() => CaptionArea?.UpdateQAT();
internal KeyTipMode KeyTipMode
{
@@ -2458,7 +2347,7 @@ internal KeyTipInfoList GenerateKeyTipsAtTopLevel()
var keyTipList = new KeyTipInfoList();
// Add the application button/tab
- if (TabsArea.LayoutAppButton.Visible)
+ if (TabsArea!.LayoutAppButton.Visible)
{
keyTipList.Add(TabsArea.GetAppButtonKeyTip());
}
@@ -2470,8 +2359,8 @@ internal KeyTipInfoList GenerateKeyTipsAtTopLevel()
// Add the quick access toolbar buttons
keyTipList.AddRange(QATLocation == QATLocation.Above
- ? CaptionArea.VisibleQAT.GetQATKeyTips()
- : _qatBelowContents.GetQATKeyTips(null));
+ ? CaptionArea!.VisibleQAT.GetQATKeyTips()
+ : _qatBelowContents.GetQATKeyTips(this.FindKryptonForm()!));
// Add the tab headers
keyTipList.AddRange(TabsArea.GetTabKeyTips());
@@ -2481,7 +2370,7 @@ internal KeyTipInfoList GenerateKeyTipsAtTopLevel()
internal KeyTipInfoList GenerateKeyTipsForSelectedTab()
{
- // Make sure all the elements in current tab have been synched
+ // Make sure all the elements in current tab have been synced
// and created so that the generated contents are accurate
Refresh();
@@ -2529,9 +2418,9 @@ internal Point ViewPointToScreen(Point pt) => VisualPopupManager.Singleton.Curre
? VisualPopupManager.Singleton.CurrentPopup.PointToScreen(pt)
: PointToScreen(pt);
- internal Rectangle ViewRectangleToScreen(ViewBase view) => view.OwningControl.RectangleToScreen(view.ClientRectangle);
+ internal Rectangle ViewRectangleToScreen(ViewBase view) => view.OwningControl!.RectangleToScreen(view.ClientRectangle);
- internal Rectangle KeyTipToScreen(ViewBase view) => view.OwningControl.RectangleToScreen(view.ClientRectangle);
+ internal Rectangle KeyTipToScreen(ViewBase? view) => view!.OwningControl!.RectangleToScreen(view.ClientRectangle);
internal ViewBase? FocusView
{
@@ -2559,9 +2448,9 @@ internal ViewBase? FocusView
internal PaletteRibbonShape RibbonShape => StateCommon.RibbonGeneral.GetRibbonShape();
- internal PaletteRedirect? GetRedirector() => Redirector;
+ internal PaletteRedirect GetRedirector() => Redirector;
- internal Control? GetControllerControl(Control c)
+ internal Control? GetControllerControl(Control? c)
{
// Keep searching till we get to the top of the hierarchy
while (c != null)
@@ -2595,12 +2484,10 @@ internal void MinimizedKeyDown(Keys keyData)
case Keys.Down:
case Keys.Space:
case Keys.Enter:
- // Any navigation keys remove the keytips
+ // Any navigation keys remove the key-tips
KillKeyboardKeyTips();
_focusView.KeyDown(new KeyEventArgs(keyData));
break;
- default:
- break;
}
}
}
@@ -2623,8 +2510,6 @@ private void AssignDefaultFields()
ShowMinimizeButton = true;
QATLocation = QATLocation.Above;
QATUserChange = true;
- _allowFormIntegrate = true;
- //ResetAllowFormIntegrate();
LostFocusLosesKeyboard = true;
BackStyle = PaletteBackStyle.PanelClient;
@@ -2656,19 +2541,19 @@ private void CreateInternal()
private void CreateRibbonCollections()
{
- RibbonContexts = new KryptonRibbonContextCollection();
+ RibbonContexts = [];
RibbonContexts.Clearing += OnRibbonContextsClearing;
RibbonContexts.Cleared += OnRibbonContextsCleared;
RibbonContexts.Inserted += OnRibbonContextsInserted;
RibbonContexts.Removed += OnRibbonContextsRemoved;
- RibbonTabs = new KryptonRibbonTabCollection();
+ RibbonTabs = [];
RibbonTabs.Clearing += OnRibbonTabsClearing;
RibbonTabs.Cleared += OnRibbonTabsCleared;
RibbonTabs.Inserted += OnRibbonTabsInserted;
RibbonTabs.Removed += OnRibbonTabsRemoved;
- QATButtons = new KryptonRibbonQATButtonCollection();
+ QATButtons = [];
QATButtons.Clearing += OnRibbonQATButtonsClearing;
QATButtons.Cleared += OnRibbonQATButtonsCleared;
QATButtons.Inserted += OnRibbonQATButtonsInserted;
@@ -2680,8 +2565,15 @@ private void CreateRibbonCollections()
private void CreateStorageObjects()
{
RibbonShortcuts = new RibbonShortcuts();
- RibbonStrings = new RibbonStrings();
- RibbonAppButton = new RibbonAppButton(this);
+
+ // Create direct access to the redirector for panel background
+ _backPanelInherit = new PaletteBackInheritRedirect(Redirector, PaletteBackStyle.PanelClient);
+
+ _ribbonGeneralInherit = new PaletteRibbonGeneralInheritRedirect(Redirector);
+
+ RibbonFileAppButton = new RibbonFileAppButton(this);
+ RibbonFileAppTab = new RibbonFileAppTab(this);
+
RibbonStyles = new PaletteRibbonStyles(this, NeedPaintPaletteDelegate);
StateCommon = new PaletteRibbonRedirect(Redirector, PaletteBackStyle.PanelClient, NeedPaintPaletteDelegate);
StateDisabled = new PaletteRibbonDisabled(StateCommon, NeedPaintPaletteDelegate);
@@ -2702,31 +2594,21 @@ private void CreateViewManager()
// Setup the need paint delegate
_needPaintGroups = OnNeedPaintMinimizedGroups;
- // Create direct access to the redirector for panel background
- _backPanelInherit = new PaletteBackInheritRedirect(Redirector, PaletteBackStyle.PanelClient);
-
// Create the background panel for the entire ribbon area and the groups area when minimized
- MainPanel = new ViewDrawRibbonPanel(this, _backPanelInherit, NeedPaintDelegate);
+ MainPanel = new ViewDrawRibbonPanel(this, _backPanelInherit, NeedPaintDelegate, StateCommon.RibbonGeneral);
_drawMinimizedPanel = new ViewDrawPanel(_backPanelInherit);
// Create layout docker for the entire ribbon control
_rootDocker = new ViewLayoutDocker();
- // Docker for the area below the composition element
+ // Docker for the area below the Form Bar
_ribbonDocker = new ViewLayoutDocker();
- // Create the area used to host the caption of glass window
- _compositionArea = new ViewDrawRibbonComposition(this, NeedPaintDelegate)
- {
- Visible = false
- };
-
// Create caption area which is used if custom chrome cannot perform task
- CaptionArea = new ViewDrawRibbonCaptionArea(this, Redirector, _compositionArea, NeedPaintDelegate);
+ CaptionArea = new ViewDrawRibbonCaptionArea(this, Redirector, NeedPaintDelegate);
// Create tabs area containing the tabs, pendant buttons etc...
TabsArea = new ViewLayoutRibbonTabsArea(this, Redirector, CaptionArea, CaptionArea.ContextTitles, NeedPaintDelegate);
- TabsArea.PaintBackground += OnTabsAreaPaintBackground;
// Create groups area containing the groups of the selected tab
GroupsArea = new ViewLayoutRibbonGroupsArea(this, Redirector, _needPaintGroups);
@@ -2753,9 +2635,8 @@ private void CreateViewManager()
_ribbonDocker.Add(TabsArea, ViewDockStyle.Top);
_ribbonDocker.Add(CaptionArea, ViewDockStyle.Top);
- // The root contains the composition at the top and fills out with the panel areas
+ // The root contains the top and fills out with the panel areas
_rootDocker.Add(MainPanel, ViewDockStyle.Fill);
- _rootDocker.Add(_compositionArea, ViewDockStyle.Top);
// Final construction steps
CaptionArea.HookToolTipHandling();
@@ -2832,10 +2713,10 @@ private bool TabIsContextValid(KryptonRibbonTab tab)
if (!string.IsNullOrEmpty(SelectedContext))
{
// Get list of all valid contexts
- var contexts = SelectedContext.Split(',');
+ var contexts = SelectedContext?.Split(',');
// If the tab context name is one of the selected contexts, then fine
- foreach (var context in contexts)
+ foreach (var context in contexts!)
{
if (context == tab.ContextName)
{
@@ -2975,7 +2856,7 @@ private bool SelectNonRibbonControl(bool forward)
{
// We need to call the protected select method in order to have
// it perform an internal select of the first/last ordered item
- _containerSelect.Invoke(next, new object[] { true, forward });
+ _containerSelect.Invoke(next, [true, forward]);
return true;
}
}
@@ -2996,7 +2877,7 @@ private bool SelectNonRibbonControl(bool forward)
return false;
}
- private void OnRibbonContextsClearing(object sender, EventArgs e)
+ private void OnRibbonContextsClearing(object? sender, EventArgs e)
{
// Unhook from all the context instances
foreach (KryptonRibbonContext context in RibbonContexts)
@@ -3005,34 +2886,34 @@ private void OnRibbonContextsClearing(object sender, EventArgs e)
}
}
- private void OnRibbonContextsCleared(object sender, EventArgs e)
+ private void OnRibbonContextsCleared(object? sender, EventArgs e)
{
// Layout now the collection has been cleared down
- CaptionArea.UpdateVisible();
+ CaptionArea?.UpdateVisible();
PerformNeedPaint(true);
}
private void OnRibbonContextsInserted(object sender, TypedCollectionEventArgs e)
{
// Hook into property changes for the context
- e.Item.PropertyChanged += OnContextPropertyChanged;
- CaptionArea.UpdateVisible();
+ e.Item!.PropertyChanged += OnContextPropertyChanged;
+ CaptionArea!.UpdateVisible();
PerformNeedPaint(true);
}
private void OnRibbonContextsRemoved(object sender, TypedCollectionEventArgs e)
{
// Remove context instance hook
- e.Item.PropertyChanged -= OnContextPropertyChanged;
- CaptionArea.UpdateVisible();
+ e.Item!.PropertyChanged -= OnContextPropertyChanged;
+ CaptionArea!.UpdateVisible();
PerformNeedPaint(true);
}
- private void OnContextPropertyChanged(object sender, PropertyChangedEventArgs e) =>
+ private void OnContextPropertyChanged(object? sender, PropertyChangedEventArgs e) =>
// Layout to show the context change
PerformNeedPaint(true);
- private void OnRibbonTabsClearing(object sender, EventArgs e)
+ private void OnRibbonTabsClearing(object? sender, EventArgs e)
{
// Remove all the back references
foreach (KryptonRibbonTab tab in RibbonTabs)
@@ -3045,7 +2926,7 @@ private void OnRibbonTabsClearing(object sender, EventArgs e)
}
}
- private void OnRibbonTabsCleared(object sender, EventArgs e)
+ private void OnRibbonTabsCleared(object? sender, EventArgs e)
{
// Do not remember a tab this is now removed
_minSelectedTab = null;
@@ -3060,7 +2941,7 @@ private void OnRibbonTabsCleared(object sender, EventArgs e)
private void OnRibbonTabsInserted(object sender, TypedCollectionEventArgs e)
{
// Setup the back reference from tab to ribbon control
- e.Item.Ribbon = this;
+ e.Item!.Ribbon = this;
// Need to monitor tab in case its properties change
e.Item.PropertyChanged += OnTabPropertyChanged;
@@ -3075,9 +2956,9 @@ private void OnRibbonTabsInserted(object sender, TypedCollectionEventArgs e)
{
// Unhook from tab property change event
- e.Item.PropertyChanged -= OnTabPropertyChanged;
+ e.Item!.PropertyChanged -= OnTabPropertyChanged;
- // Remove the backreference
+ // Remove the back-reference
e.Item.Ribbon = null;
// Do not remember a tab this is now removed
@@ -3093,7 +2974,7 @@ private void OnRibbonTabsRemoved(object sender, TypedCollectionEventArgs e)
@@ -3144,7 +3024,7 @@ private void OnRibbonQATButtonsInserted(object sender, TypedCollectionEventArgs<
PerformNeedPaint(true);
// Inform the caption area it might need to repaint the integrated QAT
- CaptionArea.QATButtonsChanged();
+ CaptionArea?.QATButtonsChanged();
}
private void OnRibbonQATButtonsRemoved(object sender, TypedCollectionEventArgs e)
@@ -3153,16 +3033,19 @@ private void OnRibbonQATButtonsRemoved(object sender, TypedCollectionEventArgs
// Update the screen location of popup to reflect a change in selected tab
- _minimizedPopup?.Show(TabsArea, _drawMinimizedPanel);
+ _minimizedPopup?.Show(TabsArea!, _drawMinimizedPanel);
- private void OnMinimizedPopupDisposed(object sender, EventArgs e)
+ private void OnMinimizedPopupDisposed(object? sender, EventArgs e)
{
// We no longer have a popup showing
_minimizedPopup = null;
@@ -3246,7 +3129,7 @@ private void OnMinimizedPopupDisposed(object sender, EventArgs e)
PerformNeedPaint(true);
}
- private void OnQATCustomizeClick(object sender, EventArgs e)
+ private void OnQATCustomizeClick(object? sender, EventArgs e)
{
// Remove any popups, the customize context menu can appear because
// the use selected the QAT overflow button causing a popup to show
@@ -3256,7 +3139,7 @@ private void OnQATCustomizeClick(object sender, EventArgs e)
KillKeyboardMode();
// Cast to correct type
- var menuItem = (KryptonContextMenuItem)sender;
+ var menuItem = sender as KryptonContextMenuItem ?? throw new ArgumentNullException(nameof(sender));
// Find index of the item to toggle
var index = (int)(menuItem.Tag ?? -1);
@@ -3271,7 +3154,7 @@ private void OnQATCustomizeClick(object sender, EventArgs e)
qatButton.SetVisible(!qatButton.GetVisible());
// Need a layout to see the change
- CaptionArea.UpdateQAT();
+ CaptionArea?.UpdateQAT();
PerformNeedPaint(true);
}
}
@@ -3289,7 +3172,7 @@ private void ResetCachedKryptonContextMenu()
_kcm.Items.Clear();
}
- private void OnKryptonContextMenuClosed(object sender, EventArgs e)
+ private void OnKryptonContextMenuClosed(object? sender, EventArgs e)
{
// Fire any associated finish delegate
if (_kcmFinishDelegate != null)
@@ -3298,8 +3181,6 @@ private void OnKryptonContextMenuClosed(object sender, EventArgs e)
_kcmFinishDelegate = null;
}
}
-
- private void OnTabsAreaPaintBackground(object sender, PaintEventArgs e) => MainPanel.PaintRectangle(e.Graphics, e.ClipRectangle, false, sender as Control);
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonContext.cs b/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonContext.cs
index 06ea3c4d6..9cee267e3 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonContext.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonContext.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -28,7 +28,7 @@ public class KryptonRibbonContext : Component
private string _contextName;
private string _contextTitle;
private Color _contextColor;
- private object _tag;
+ private object? _tag;
#endregion
#region Events
@@ -142,7 +142,7 @@ public Color ContextColor
[Description(@"User-defined data associated with the object.")]
[TypeConverter(typeof(StringConverter))]
[Bindable(true)]
- public object Tag
+ public object? Tag
{
get => _tag;
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonContextCollection.cs b/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonContextCollection.cs
index b548a6d58..4e2bbb056 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonContextCollection.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonContextCollection.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonGroup.cs b/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonGroup.cs
index 80433e527..e67f7f7da 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonGroup.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonGroup.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -116,7 +116,7 @@ public KryptonRibbonGroup()
_maximumWidth = -1;
// Create collection for holding child items
- Items = new KryptonRibbonGroupContainerCollection();
+ Items = [];
Items.Clearing += OnRibbonGroupItemsClearing;
Items.Cleared += OnRibbonGroupItemsCleared;
Items.Inserted += OnRibbonGroupItemsInserted;
@@ -432,7 +432,7 @@ public int MaximumWidth
[Category(@"Visuals")]
[Description(@"Collection of ribbon group items.")]
[MergableProperty(false)]
- [Editor(typeof(KryptonRibbonGroupContainerCollectionEditor), typeof(CollectionEditor))]
+ [Editor(typeof(KryptonRibbonGroupContainerCollectionEditor), typeof(UITypeEditor))]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public KryptonRibbonGroupContainerCollection Items { get; }
@@ -525,7 +525,7 @@ internal bool ProcessCmdKey(ref Message msg, Keys keyData)
#endregion
#region Private
- private void OnRibbonGroupItemsClearing(object sender, EventArgs e)
+ private void OnRibbonGroupItemsClearing(object? sender, EventArgs e)
{
// Remove the back references
foreach (KryptonRibbonGroupContainer container in Items)
@@ -536,7 +536,7 @@ private void OnRibbonGroupItemsClearing(object sender, EventArgs e)
}
}
- private void OnRibbonGroupItemsCleared(object sender, EventArgs e)
+ private void OnRibbonGroupItemsCleared(object? sender, EventArgs e)
{
// Only need to update display if this tab is selected
if ((_ribbon != null)
@@ -551,7 +551,7 @@ private void OnRibbonGroupItemsCleared(object sender, EventArgs e)
private void OnRibbonGroupItemsInserted(object sender, TypedCollectionEventArgs e)
{
// Setup the back references
- e.Item.Ribbon = _ribbon;
+ e.Item!.Ribbon = _ribbon;
e.Item.RibbonTab = _ribbonTab;
e.Item.RibbonGroup = this;
@@ -568,7 +568,7 @@ private void OnRibbonGroupItemsInserted(object sender, TypedCollectionEventArgs<
private void OnRibbonGroupItemsRemoved(object sender, TypedCollectionEventArgs e)
{
// Remove the back references
- e.Item.Ribbon = null;
+ e.Item!.Ribbon = null;
e.Item.RibbonTab = null;
e.Item.RibbonGroup = null;
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonGroupCollection.cs b/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonGroupCollection.cs
index cab2050d4..fd2352c8e 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonGroupCollection.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonGroupCollection.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonQATButton.cs b/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonQATButton.cs
index c1fc70049..c888cbb89 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonQATButton.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonQATButton.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -27,12 +27,12 @@ public class KryptonRibbonQATButton : Component,
IQuickAccessToolbarButton
{
#region Static Fields
- private static readonly Image _defaultImage = GenericImageResources.QATButtonDefault;
+ private static readonly Image? _defaultImage = GenericImageResources.QATButtonDefault;
#endregion
#region Instance Fields
- private object _tag;
- private Image _image;
+ private object? _tag;
+ private Image? _image;
private bool _visible;
private bool _enabled;
private string _text;
@@ -203,7 +203,7 @@ public string Text
// We never allow an empty text value
if (string.IsNullOrEmpty(value))
{
- value = "QAT Button";
+ value = @"QAT Button";
}
if (value != _text)
@@ -253,7 +253,7 @@ public string Text
[Bindable(true)]
[Category(@"Appearance")]
[Description(@"Color to draw as transparent in the ToolTipImage.")]
- [KryptonDefaultColor()]
+ [KryptonDefaultColor]
[Localizable(true)]
public Color ToolTipImageTransparentColor { get; set; }
@@ -336,7 +336,7 @@ public KryptonCommand? KryptonCommand
[Description(@"User-defined data associated with the object.")]
[TypeConverter(typeof(StringConverter))]
[Bindable(true)]
- public object Tag
+ public object? Tag
{
get => _tag;
@@ -415,7 +415,7 @@ public object Tag
/// Gets and sets the image for the item ToolTip.
///
[EditorBrowsable(EditorBrowsableState.Advanced)]
- public Image GetToolTipImage() => ToolTipImage;
+ public Image? GetToolTipImage() => ToolTipImage!;
///
/// Gets and sets the color to draw as transparent in the ToolTipImage.
@@ -451,7 +451,7 @@ public object Tag
///
/// Source of the event.
/// A PropertyChangedEventArgs that contains the event data.
- protected virtual void OnCommandPropertyChanged(object sender, PropertyChangedEventArgs e)
+ protected virtual void OnCommandPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
var refresh = false;
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonQATButtonCollection.cs b/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonQATButtonCollection.cs
index efa6c28e9..bb068ee82 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonQATButtonCollection.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonQATButtonCollection.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -20,7 +20,7 @@ namespace Krypton.Ribbon
public class KryptonRibbonQATButtonCollection : TypedRestrictCollection
{
#region Static Fields
- private static readonly Type[] _types = { typeof(IQuickAccessToolbarButton) };
+ private static readonly Type[] _types = [typeof(IQuickAccessToolbarButton)];
#endregion
#region Restrict
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonRecentDoc.cs b/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonRecentDoc.cs
index 28128bd5e..c90bbc825 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonRecentDoc.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonRecentDoc.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -29,7 +29,7 @@ public class KryptonRibbonRecentDoc : Component
private Color _imageTransparentColor;
private string _text;
private string _extraText;
- private object _tag;
+ private object? _tag;
#endregion
#region Events
@@ -118,13 +118,7 @@ public Image? Image
{
get => _image;
- set
- {
- if (_image != value)
- {
- _image = value;
- }
- }
+ set => _image = value;
}
///
@@ -155,7 +149,7 @@ public Color ImageTransparentColor
[Description(@"User-defined data associated with the object.")]
[TypeConverter(typeof(StringConverter))]
[Bindable(true)]
- public object Tag
+ public object? Tag
{
get => _tag;
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonRecentDocCollection.cs b/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonRecentDocCollection.cs
index f263d7fb4..49e63904f 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonRecentDocCollection.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonRecentDocCollection.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonTab.cs b/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonTab.cs
index e3dc58747..9665c464b 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonTab.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonTab.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -69,7 +69,7 @@ public KryptonRibbonTab()
_visible = true;
// Create the collection for defining groups
- Groups = new KryptonRibbonGroupCollection();
+ Groups = [];
Groups.Clearing += OnRibbonGroupsClearing;
Groups.Cleared += OnRibbonGroupsCleared;
Groups.Inserted += OnRibbonGroupsInserted;
@@ -332,7 +332,7 @@ internal bool ProcessCmdKey(ref Message msg, Keys keyData)
#endregion
#region Private
- private void OnRibbonGroupsClearing(object sender, EventArgs e)
+ private void OnRibbonGroupsClearing(object? sender, EventArgs e)
{
// Remove the back references
foreach (KryptonRibbonGroup group in Groups)
@@ -342,7 +342,7 @@ private void OnRibbonGroupsClearing(object sender, EventArgs e)
}
}
- private void OnRibbonGroupsCleared(object sender, EventArgs e)
+ private void OnRibbonGroupsCleared(object? sender, EventArgs e)
{
// Only need to update display if this tab is selected
if ((_ribbon != null) && (_ribbon.SelectedTab == this))
@@ -354,7 +354,7 @@ private void OnRibbonGroupsCleared(object sender, EventArgs e)
private void OnRibbonGroupsInserted(object sender, TypedCollectionEventArgs e)
{
// Setup the back references
- e.Item.Ribbon = _ribbon;
+ e.Item!.Ribbon = _ribbon;
e.Item.RibbonTab = this;
// Only need to update display if this tab is selected and the group is visible
@@ -367,7 +367,7 @@ private void OnRibbonGroupsInserted(object sender, TypedCollectionEventArgs e)
{
// Remove the back references
- e.Item.Ribbon = null;
+ e.Item!.Ribbon = null;
e.Item.RibbonTab = null;
// Only need to update display if this tab is selected and the group was visible
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonTabCollection.cs b/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonTabCollection.cs
index 129066598..778d99d30 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonTabCollection.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controls Ribbon/KryptonRibbonTabCollection.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controls Visuals/KeyTipControl.cs b/Source/Krypton Components/Krypton.Ribbon/Controls Visuals/KeyTipControl.cs
index f558500ea..18b5ac6a4 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controls Visuals/KeyTipControl.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controls Visuals/KeyTipControl.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -68,7 +68,7 @@ public KeyTipControl(KryptonRibbon ribbon,
public void SetKeyTips(KeyTipInfoList keyTips)
{
// Create a new list of key tip views
- _viewList = new List();
+ _viewList = [];
var enclosingRect = Rectangle.Empty;
@@ -278,9 +278,9 @@ private void StartTimer()
_redrawTimer.Start();
}
- private void OnRedrawTick(object sender, EventArgs e)
+ private void OnRedrawTick(object? sender, EventArgs e)
{
- _redrawTimer = (Timer)sender;
+ _redrawTimer = sender as Timer ?? throw new ArgumentNullException(nameof(sender));
_redrawTimer.Stop();
_redrawTimer.Dispose();
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controls Visuals/VisualPopupAppMenu.cs b/Source/Krypton Components/Krypton.Ribbon/Controls Visuals/VisualPopupAppMenu.cs
index f90f15c6b..84de31ea3 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controls Visuals/VisualPopupAppMenu.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controls Visuals/VisualPopupAppMenu.cs
@@ -1,14 +1,10 @@
#region BSD License
/*
- *
* Original BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE)
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
- *
- * Modified: Monday 12th April, 2021 @ 18:00 GMT
- *
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*/
#endregion
@@ -18,7 +14,7 @@ internal class VisualPopupAppMenu : VisualPopup
{
#region Instance Fields
private readonly KryptonRibbon _ribbon;
- private PaletteBase? _palette;
+ private PaletteBase _palette;
private IPaletteBack _drawOutsideBack;
private IPaletteBorder _drawOutsideBorder;
private readonly AppButtonMenuProvider _provider;
@@ -34,11 +30,11 @@ internal class VisualPopupAppMenu : VisualPopup
#endregion
#region Identity
+
///
/// Initialize a new instance of the VisualPopupAppMenu class.
///
/// Owning ribbon instance.
- /// Originating app button instance.
/// Local palette setting to use initially.
/// Palette mode setting to use initially.
/// Redirector used for obtaining palette values.
@@ -46,10 +42,9 @@ internal class VisualPopupAppMenu : VisualPopup
/// Screen location of the lower half of the app button.
/// Was the context menu activated by a keyboard action.
public VisualPopupAppMenu(KryptonRibbon ribbon,
- RibbonAppButton appButton,
PaletteBase? palette,
PaletteMode paletteMode,
- PaletteRedirect? redirector,
+ PaletteRedirect redirector,
Rectangle rectAppButtonTopHalf,
Rectangle rectAppButtonBottomHalf,
bool keyboardActivated)
@@ -72,7 +67,7 @@ public VisualPopupAppMenu(KryptonRibbon ribbon,
// Create provider instance
_provider = new AppButtonMenuProvider((ViewContextMenuManager)ViewManager,
- _ribbon.RibbonAppButton.AppButtonMenuItems,
+ _ribbon.RibbonFileAppButton.AppButtonMenuItems,
_viewColumns, palette, paletteMode,
redirector, NeedPaintDelegate);
@@ -82,12 +77,12 @@ public VisualPopupAppMenu(KryptonRibbon ribbon,
CreateAppButtonBottom();
CreateButtonSpecView();
- CreateContextMenuView(appButton);
+ CreateContextMenuView(_ribbon.RibbonFileAppButton);
CreateRecentDocumentsView();
CreateInnerBacking(CreateInsideCanvas());
CreateOuterBacking();
CreateOutsideDocker();
- CreateButtonManager(appButton);
+ CreateButtonManager(_ribbon.RibbonFileAppButton);
// With keyboard activate we select the first valid item
if (keyboardActivated)
@@ -100,7 +95,7 @@ private void CreateButtonSpecView() =>
// Layout docker used to contain the generated button specs
_viewButtonSpecDocker = new ViewLayoutDocker();
- private void CreateContextMenuView(RibbonAppButton appButton)
+ private void CreateContextMenuView(RibbonFileAppButton fileAppButton)
{
// Ask the top level collection to generate the child view elements
var topCollection = new KryptonContextMenuCollection();
@@ -109,7 +104,7 @@ private void CreateContextMenuView(RibbonAppButton appButton)
ImageColumn = false
};
topCollection.Add(topItems);
- foreach (KryptonContextMenuItemBase item in appButton.AppButtonMenuItems)
+ foreach (KryptonContextMenuItemBase item in fileAppButton.AppButtonMenuItems)
{
topItems.Items.Add(item);
}
@@ -119,7 +114,7 @@ private void CreateContextMenuView(RibbonAppButton appButton)
private void CreateRecentDocumentsView()
{
// Do we need to add the recent docs view?
- if (_ribbon.RibbonAppButton.AppButtonShowRecentDocs)
+ if (_ribbon.RibbonFileAppButton.AppButtonShowRecentDocs)
{
// Create a dummy vertical menu separator for separating recent documents from menu items
var dummySep1 = new KryptonContextMenuSeparator
@@ -127,7 +122,7 @@ private void CreateRecentDocumentsView()
Horizontal = false
};
_viewColumns.Add(new ViewDrawMenuSeparator(dummySep1, _provider.ProviderStateCommon.Separator));
- _viewColumns.Add(new ViewLayoutSeparator(0, _ribbon.RibbonAppButton.AppButtonMinRecentSize.Height));
+ _viewColumns.Add(new ViewLayoutSeparator(0, _ribbon.RibbonFileAppButton.AppButtonMinRecentSize.Height));
// Use a layout that draws the background color of the recent docs area
var recentDocsBack = new ViewDrawRibbonAppMenuDocs(_ribbon);
@@ -138,7 +133,7 @@ private void CreateRecentDocumentsView()
recentDocsBack.Add(documentStack);
// Use fixed width separator to enforce a minimum width to column
- documentStack.Add(new ViewLayoutSeparator(_ribbon.RibbonAppButton.AppButtonMinRecentSize.Width, 0));
+ documentStack.Add(new ViewLayoutSeparator(_ribbon.RibbonFileAppButton.AppButtonMinRecentSize.Width, 0));
// Add the recent document title
documentStack.Add(new ViewDrawRibbonRecentDocs(_ribbon));
@@ -150,9 +145,9 @@ private void CreateRecentDocumentsView()
// Then generate an item per recent document entry
var index = 1;
- foreach (KryptonRibbonRecentDoc recentDoc in _ribbon.RibbonAppButton.AppButtonRecentDocs)
+ foreach (KryptonRibbonRecentDoc recentDoc in _ribbon.RibbonFileAppButton.AppButtonRecentDocs)
{
- documentStack.Add(new ViewDrawRibbonAppMenuRecentDec(_ribbon, _provider, recentDoc, _ribbon.RibbonAppButton.AppButtonMaxRecentSize.Width, NeedPaintDelegate, index++));
+ documentStack.Add(new ViewDrawRibbonAppMenuRecentDec(_ribbon, _provider, recentDoc, _ribbon.RibbonFileAppButton.AppButtonMaxRecentSize.Width, NeedPaintDelegate, index++));
}
// Add separator entry which is then used to fill remained space
@@ -170,7 +165,7 @@ private ViewDrawCanvas CreateInsideCanvas()
{
_viewColumns
};
- mainBackground.KeyController = new ContextMenuController((ViewContextMenuManager)ViewManager);
+ mainBackground.KeyController = new ContextMenuController((ViewContextMenuManager)ViewManager!);
return mainBackground;
}
@@ -206,21 +201,21 @@ private void CreateOutsideDocker()
_drawOutsideBorder = new PaletteBorderToPalette(Redirector, PaletteBorderStyle.ControlRibbonAppMenu);
_drawOutsideDocker = new ViewDrawRibbonAppMenu(_drawOutsideBack, _drawOutsideBorder, _appButtonBottom, _rectAppButtonBottomHalf)
{
- KeyController = new ContextMenuController((ViewContextMenuManager)ViewManager)
+ KeyController = new ContextMenuController((ViewContextMenuManager)ViewManager!)
};
_drawOutsideDocker.Add(_drawOutsideBacking, ViewDockStyle.Fill);
- ViewManager.Root = _drawOutsideDocker;
+ ViewManager!.Root = _drawOutsideDocker;
}
- private void CreateButtonManager(RibbonAppButton appButton)
+ private void CreateButtonManager(RibbonFileAppButton fileAppButton)
{
- _buttonManager = new ButtonSpecManagerLayoutAppButton((ViewContextMenuManager)ViewManager,
- this, Redirector, appButton.AppButtonSpecs, null,
- new[] { _viewButtonSpecDocker },
- new IPaletteMetric[] { _ribbon.StateCommon },
- new[] { PaletteMetricInt.None },
- new[] { PaletteMetricPadding.RibbonAppButton },
- CreateToolStripRenderer,
+ _buttonManager = new ButtonSpecManagerLayoutAppButton((ViewContextMenuManager)ViewManager!,
+ this, Redirector, fileAppButton.AppButtonSpecs, null,
+ [_viewButtonSpecDocker],
+ [_ribbon.StateCommon],
+ [PaletteMetricInt.None],
+ [PaletteMetricPadding.RibbonAppButton],
+ CreateToolStripRenderer!,
OnButtonSpecPaint);
_buttonManager.RecreateButtons();
@@ -235,11 +230,12 @@ protected override void Dispose(bool disposing)
if (disposing)
{
// Must unhook from the palette paint event
- if (_palette != null)
+ if (_palette != null!)
{
_palette.PalettePaint -= OnPaletteNeedPaint;
_palette.BasePaletteChanged -= OnBaseChanged;
_palette.BaseRendererChanged -= OnBaseChanged;
+ _palette = null!;
}
if (_buttonManager != null!)
@@ -321,7 +317,7 @@ public KryptonContextMenuPositionV ShowVert
///
/// Gets access to the view manager for the context menu.
///
- public ViewContextMenuManager ViewContextMenuManager => (ViewContextMenuManager)ViewManager;
+ public ViewContextMenuManager ViewContextMenuManager => (ViewContextMenuManager)ViewManager!;
///
/// Should a mouse down at the provided point cause an end to popup tracking.
@@ -334,7 +330,7 @@ public override bool DoesCurrentMouseDownEndAllTracking(Message m, Point pt)
if (_appButtonBottom.Visible)
{
// If mouse is over the top half of the button (which is in the non-client area of
- // the owner ribbon) then we do not want to end all tracking from this method. Otherwise
+ // the owner ribbon) then we do not want to end all tracking from this method. Otherwise,
// if the mouse is inside the bottom half of the button then we do end tracking!
if (RectangleToClient(_rectAppButtonTopHalf).Contains(pt))
{
@@ -393,7 +389,7 @@ public override bool DoesMouseDownGetEaten(Message m, Point pt)
///
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
- public override PaletteBase? GetResolvedPalette() => _palette;
+ public override PaletteBase GetResolvedPalette() => _palette;
#endregion
@@ -401,7 +397,7 @@ public override bool DoesMouseDownGetEaten(Message m, Point pt)
///
/// Gets access to the palette redirector.
///
- protected PaletteRedirect? Redirector
+ protected PaletteRedirect Redirector
{
[DebuggerStepThrough]
get;
@@ -439,6 +435,7 @@ protected override void OnLayout(LayoutEventArgs levent)
// Need a render context for accessing the renderer
using var context = new RenderContext(this, null, ClientRectangle, Renderer);
+ using var gh = new GraphicsHint(context.Graphics, _drawOutsideBorder.GetBorderGraphicsHint(PaletteState.Normal));
// Grab a path that is the outside edge of the border
Rectangle borderRect = ClientRectangle;
GraphicsPath borderPath1 = Renderer.RenderStandardBorder.GetOutsideBorderPath(context, borderRect, _drawOutsideBorder, VisualOrientation.Top, PaletteState.Normal);
@@ -459,7 +456,7 @@ protected override void OnLayout(LayoutEventArgs levent)
///
/// Source of notification.
/// An NeedLayoutEventArgs containing event data.
- protected virtual void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e) =>
+ protected virtual void OnPaletteNeedPaint(object? sender, NeedLayoutEventArgs e) =>
// Need to recalculate anything relying on the palette
OnNeedPaint(sender, e);
#endregion
@@ -474,7 +471,7 @@ private Size CalculatePreferredSize()
{
// Find the preferred size which fits exactly the calculated contents size
using var context = new ViewLayoutContext(this, Renderer);
- return ViewManager.Root.GetPreferredSize(context);
+ return ViewManager!.Root.GetPreferredSize(context);
}
finally
{
@@ -483,12 +480,12 @@ private Size CalculatePreferredSize()
}
}
- private void SetPalette(PaletteBase? palette)
+ private void SetPalette(PaletteBase palette)
{
if (palette != _palette)
{
// Unhook from current palette events
- if (_palette != null)
+ if (_palette != null!)
{
_palette.PalettePaint -= OnPaletteNeedPaint;
_palette.BasePaletteChanged -= OnBaseChanged;
@@ -499,10 +496,13 @@ private void SetPalette(PaletteBase? palette)
_palette = palette;
// Update redirector to use palette as source for obtaining values
- Redirector.Target = _palette;
+ if (Redirector != null!)
+ {
+ Redirector.Target = _palette;
+ }
// Hook to new palette events
- if (_palette != null)
+ if (_palette != null!)
{
// Get the renderer associated with the palette
Renderer = _palette.GetRenderer();
@@ -513,19 +513,19 @@ private void SetPalette(PaletteBase? palette)
}
}
- private void OnBaseChanged(object sender, EventArgs e) =>
+ private void OnBaseChanged(object? sender, EventArgs e) =>
// Change in base renderer or base palette require we fetch the latest renderer
- Renderer = _palette?.GetRenderer();
+ Renderer = _palette.GetRenderer();
- private void OnButtonSpecPaint(object sender, NeedLayoutEventArgs e) => OnNeedPaint(sender, new NeedLayoutEventArgs(false));
+ private void OnButtonSpecPaint(object? sender, NeedLayoutEventArgs e) => OnNeedPaint(sender, new NeedLayoutEventArgs(false));
- private void OnProviderClosing(object sender, CancelEventArgs e) => _ribbon.OnAppButtonMenuClosing(e);
+ private void OnProviderClosing(object? sender, CancelEventArgs e) => _ribbon.OnAppButtonMenuClosing(e);
- private void OnProviderClose(object sender, CloseReasonEventArgs e) =>
+ private void OnProviderClose(object? sender, CloseReasonEventArgs e) =>
// Remove ourself from being shown
VisualPopupManager.Singleton.EndPopupTracking(this);
- private void OnProviderClose(object sender, EventArgs e)
+ private void OnProviderClose(object? sender, EventArgs e)
{
// Unhook from event source
//var provider = (IContextMenuProvider)sender;
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controls Visuals/VisualPopupGroup.cs b/Source/Krypton Components/Krypton.Ribbon/Controls Visuals/VisualPopupGroup.cs
index 974a12bd8..8f7ac5282 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controls Visuals/VisualPopupGroup.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controls Visuals/VisualPopupGroup.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -26,7 +26,7 @@ internal class VisualPopupGroup : VisualPopup
private readonly KryptonRibbon _ribbon;
private readonly KryptonRibbonGroup _ribbonGroup;
private readonly ViewDrawRibbonGroupsBorder _viewBackground;
- private readonly Button _hiddenFocusTarget;
+ private readonly Button? _hiddenFocusTarget;
#endregion
#region Identity
@@ -41,12 +41,12 @@ public VisualPopupGroup([DisallowNull] KryptonRibbon ribbon,
IRenderer renderer)
: base(renderer, true)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(ribbonGroup != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(ribbonGroup is not null);
// Remember references needed later
- _ribbon = ribbon;
- _ribbonGroup = ribbonGroup;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _ribbonGroup = ribbonGroup ?? throw new ArgumentNullException(nameof(ribbonGroup));
// Create a view element for drawing the group
ViewGroup = new ViewDrawRibbonGroup(ribbon, ribbonGroup, NeedPaintDelegate)
@@ -81,7 +81,7 @@ protected override void Dispose(bool disposing)
if (disposing)
{
// Ensure the manager believes the mouse has left the area
- ViewManager.MouseLeave(EventArgs.Empty);
+ ViewManager?.MouseLeave(EventArgs.Empty);
// Do we need to restore the previous focus from the ribbon
if (RestorePreviousFocus)
@@ -135,7 +135,7 @@ protected override void Dispose(bool disposing)
/// ViewBase of item; otherwise false.
public void SetFirstFocusItem()
{
- ViewPopupManager.FocusView = ViewGroup.GetFirstFocusItem();
+ ViewPopupManager!.FocusView = ViewGroup.GetFirstFocusItem();
PerformNeedPaint(false);
}
#endregion
@@ -147,7 +147,7 @@ public void SetFirstFocusItem()
/// ViewBase of item; otherwise false.
public void SetLastFocusItem()
{
- ViewPopupManager.FocusView = ViewGroup.GetLastFocusItem();
+ ViewPopupManager!.FocusView = ViewGroup.GetLastFocusItem();
PerformNeedPaint(false);
}
#endregion
@@ -159,11 +159,11 @@ public void SetLastFocusItem()
public void SetNextFocusItem()
{
// Find the next item in sequence
- var matched = false;
- ViewBase view = ViewGroup.GetNextFocusItem(ViewPopupManager.FocusView, ref matched);
+ bool matched = false;
+ ViewBase? view = ViewGroup.GetNextFocusItem(ViewPopupManager!.FocusView!, ref matched);
// Rotate around to the first item
- if (view == null)
+ if (view is null)
{
SetFirstFocusItem();
}
@@ -182,8 +182,8 @@ public void SetNextFocusItem()
public void SetPreviousFocusItem()
{
// Find the previous item in sequence
- var matched = false;
- ViewBase view = ViewGroup.GetPreviousFocusItem(ViewPopupManager.FocusView, ref matched);
+ bool matched = false;
+ ViewBase? view = ViewGroup.GetPreviousFocusItem(ViewPopupManager?.FocusView!, ref matched);
// Rotate around to the last item
if (view == null)
@@ -192,7 +192,7 @@ public void SetPreviousFocusItem()
}
else
{
- ViewPopupManager.FocusView = view;
+ ViewPopupManager!.FocusView = view;
PerformNeedPaint(false);
}
}
@@ -246,7 +246,7 @@ public void ShowCalculatingSize(ViewDrawRibbonGroup parentGroup,
///
/// Hide focus by giving it to the hidden control.
///
- public void HideFocus() => _hiddenFocusTarget.Focus();
+ public void HideFocus() => _hiddenFocusTarget?.Focus();
#endregion
#region Implementation
@@ -262,7 +262,7 @@ private Rectangle CalculateBelowPopupRect(Rectangle parentScreenRect, Size popup
var popupLocation = new Point(parentScreenRect.X, parentScreenRect.Bottom);
// Is there enough room below the parent for the entire popup height?
- if ((parentScreenRect.Bottom + popupSize.Height) <= workingArea.Bottom)
+ if (parentScreenRect.Bottom + popupSize.Height <= workingArea.Bottom)
{
// Place the popup below the parent
popupLocation.Y = parentScreenRect.Bottom;
@@ -292,7 +292,7 @@ private Rectangle CalculateBelowPopupRect(Rectangle parentScreenRect, Size popup
popupLocation.X = workingArea.Left;
}
- // Preven the popup from being off the right size of the screen
+ // Prevent the popup from being off the right size of the screen
if ((popupLocation.X + popupSize.Width) > workingArea.Right)
{
popupLocation.X = workingArea.Right - popupSize.Width;
@@ -306,7 +306,7 @@ private Rectangle CalculateBelowPopupRect(Rectangle parentScreenRect, Size popup
///
/// Gets access to the popup group specific view manager.
///
- protected ViewRibbonPopupGroupManager ViewPopupManager => ViewManager as ViewRibbonPopupGroupManager;
+ protected ViewRibbonPopupGroupManager? ViewPopupManager => ViewManager as ViewRibbonPopupGroupManager;
///
/// Gets the creation parameters.
@@ -316,7 +316,7 @@ protected override CreateParams CreateParams
get
{
CreateParams cp = base.CreateParams;
- cp.Style |= (int) PI.WS_.CLIPCHILDREN;
+ cp.Style |= (int)PI.WS_.CLIPCHILDREN;
return cp;
}
}
@@ -329,7 +329,7 @@ protected override void OnLayout(LayoutEventArgs levent)
{
// Let base class calculate fill rectangle
base.OnLayout(levent);
- var borderRounding = _ribbon.RibbonShape switch
+ var borderRounding = _ribbon.RibbonShape! switch
{
PaletteRibbonShape.Office2010 => 1,
_ => 2
@@ -363,7 +363,7 @@ protected override void OnKeyPress(KeyPressEventArgs e)
protected override bool ProcessDialogKey(Keys keyData)
{
// Grab the view manager handling the focus view
- ViewBase focusView = ((ViewRibbonPopupGroupManager)GetViewManager()).FocusView;
+ ViewBase? focusView = ((GetViewManager() as ViewRibbonPopupGroupManager)!).FocusView;
// When in keyboard mode...
if (focusView != null)
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controls Visuals/VisualPopupMinimized.cs b/Source/Krypton Components/Krypton.Ribbon/Controls Visuals/VisualPopupMinimized.cs
index ebd99396d..5a7072f2e 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controls Visuals/VisualPopupMinimized.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controls Visuals/VisualPopupMinimized.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -42,12 +42,12 @@ public VisualPopupMinimized([DisallowNull] KryptonRibbon ribbon,
IRenderer renderer)
: base(viewManager, renderer, true)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(captionArea != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(captionArea is not null);
// Remember incoming references
- _ribbon = ribbon;
- _captionArea = captionArea;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _captionArea = captionArea ?? throw new ArgumentNullException(nameof(captionArea));
}
///
@@ -59,7 +59,7 @@ protected override void Dispose(bool disposing)
if (disposing)
{
// Ensure the manager believes the mouse has left the area
- ViewRibbonManager.MouseLeave(EventArgs.Empty);
+ ViewRibbonManager?.MouseLeave(EventArgs.Empty);
// If this group is being dismissed with key tips showing
if (_ribbon is { InKeyboardMode: true, KeyTipMode: KeyTipMode.PopupMinimized })
@@ -93,7 +93,7 @@ protected override void Dispose(bool disposing)
///
/// Gets the view for the popup group.
///
- public ViewRibbonMinimizedManager ViewRibbonManager => ViewManager as ViewRibbonMinimizedManager;
+ public ViewRibbonMinimizedManager? ViewRibbonManager => ViewManager as ViewRibbonMinimizedManager;
///
/// Sets focus to the first focus item inside the selected tab.
@@ -105,7 +105,7 @@ public void SetFirstFocusItem()
// Make the item the new focus for the popup
if (newView != null)
{
- ViewRibbonManager.FocusView = newView;
+ ViewRibbonManager!.FocusView = newView;
PerformNeedPaint(false);
}
}
@@ -121,7 +121,7 @@ public void SetLastFocusItem()
// Make the item the new focus for the popup
if (newView != null)
{
- ViewRibbonManager.FocusView = newView;
+ ViewRibbonManager!.FocusView = newView;
PerformNeedPaint(false);
}
}
@@ -132,7 +132,7 @@ public void SetLastFocusItem()
public void SetNextFocusItem()
{
// Find the next item in sequence
- ViewBase newView = _ribbon.GroupsArea.ViewGroups.GetNextFocusItem(ViewRibbonManager.FocusView);
+ ViewBase newView = _ribbon.GroupsArea.ViewGroups.GetNextFocusItem(ViewRibbonManager!.FocusView!);
// Rotate around to the first item
if (newView == null)
@@ -152,7 +152,7 @@ public void SetNextFocusItem()
public void SetPreviousFocusItem()
{
// Find the previous item in sequence
- ViewBase newView = _ribbon.GroupsArea.ViewGroups.GetPreviousFocusItem(ViewRibbonManager.FocusView);
+ ViewBase newView = _ribbon.GroupsArea.ViewGroups.GetPreviousFocusItem(ViewRibbonManager!.FocusView!);
// Rotate around to the last item
if (newView == null)
@@ -180,7 +180,7 @@ public override bool DoesCurrentMouseDownEndAllTracking(Message m, Point pt)
// If the base class wants to end tracking and not inside the ribbon control
return base.DoesCurrentMouseDownEndAllTracking(m, pt) &&
- !_ribbon.ClientRectangleWithoutComposition.Contains(ribbonPt) &&
+ !_ribbon.ClientRectangle.Contains(ribbonPt) &&
_captionArea.DoesCurrentMouseDownEndAllTracking(screenPt);
}
@@ -222,7 +222,7 @@ public void Show(ViewLayoutRibbonTabsArea tabsArea,
///
/// Tabs area of the
///
- public void UpdatePosition(ViewLayoutRibbonTabsArea tabsArea,
+ public void UpdatePosition(ViewLayoutRibbonTabsArea tabsArea,
ViewDrawPanel drawMinimizedPanel)
{
// Move to the newly calculated position
@@ -240,7 +240,7 @@ protected override CreateParams CreateParams
get
{
CreateParams cp = base.CreateParams;
- cp.Style |= (int) PI.WS_.CLIPCHILDREN;
+ cp.Style |= (int)PI.WS_.CLIPCHILDREN;
return cp;
}
}
@@ -285,7 +285,7 @@ private Rectangle CalculatePopupRect(ViewLayoutRibbonTabsArea tabsArea,
popupSize.Height);
// Get the view element for the currently selected tab
- ViewDrawRibbonTab viewTab = tabsArea.LayoutTabs.GetViewForRibbonTab(_ribbon.SelectedTab);
+ ViewDrawRibbonTab viewTab = (ViewDrawRibbonTab)tabsArea.LayoutTabs.GetViewForRibbonTab(_ribbon.SelectedTab)!;
// Convert the view tab client area to screen coordinates
Rectangle viewTabRect = _ribbon.RectangleToScreen(viewTab.ClientRectangle);
diff --git a/Source/Krypton Components/Krypton.Ribbon/Controls Visuals/VisualPopupQATOverflow.cs b/Source/Krypton Components/Krypton.Ribbon/Controls Visuals/VisualPopupQATOverflow.cs
index 563f11850..897cb9c65 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Controls Visuals/VisualPopupQATOverflow.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Controls Visuals/VisualPopupQATOverflow.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -30,22 +30,22 @@ internal class VisualPopupQATOverflow : VisualPopup
/// Reference to original contents which has overflow items.
/// Drawing renderer.
public VisualPopupQATOverflow([DisallowNull] KryptonRibbon ribbon,
- ViewLayoutRibbonQATContents contents,
- IRenderer? renderer)
+ [DisallowNull] ViewLayoutRibbonQATContents? contents,
+ IRenderer renderer)
: base(renderer, true)
{
- Debug.Assert(ribbon != null);
+ Debug.Assert(ribbon is not null);
// Remember references needed later
- _ribbon = ribbon;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
// Create a view element for drawing the group
_viewQAT = new ViewDrawRibbonQATOverflow(ribbon, NeedPaintDelegate);
// Create and add the element used to synch and draw the actual contents
- ViewQATContents = new ViewLayoutRibbonQATFromOverflow(this, ribbon,
- NeedPaintDelegate,
- true, contents);
+ ViewQATContents = new ViewLayoutRibbonQATFromOverflow(this, ribbon,
+ NeedPaintDelegate,
+ true, contents);
_viewQAT.Add(ViewQATContents);
// Attach the root to the view manager instance
@@ -85,7 +85,7 @@ protected override void Dispose(bool disposing)
///
/// Gets the qat overflow manager.
///
- public ViewRibbonQATOverflowManager ViewOverflowManager => ViewManager as ViewRibbonQATOverflowManager;
+ public ViewRibbonQATOverflowManager? ViewOverflowManager => ViewManager as ViewRibbonQATOverflowManager;
#endregion
@@ -104,7 +104,7 @@ protected override void Dispose(bool disposing)
/// ViewBase of item; otherwise false.
public void SetFirstFocusItem()
{
- ViewOverflowManager.FocusView = ViewQATContents.GetFirstQATView();
+ ViewOverflowManager!.FocusView = ViewQATContents.GetFirstQATView();
PerformNeedPaint(false);
}
#endregion
@@ -116,7 +116,7 @@ public void SetFirstFocusItem()
/// ViewBase of item; otherwise false.
public void SetLastFocusItem()
{
- ViewOverflowManager.FocusView = ViewQATContents.GetLastQATView();
+ ViewOverflowManager!.FocusView = ViewQATContents.GetLastQATView();
PerformNeedPaint(false);
}
#endregion
@@ -128,7 +128,7 @@ public void SetLastFocusItem()
public void SetNextFocusItem()
{
// Find the next item in sequence
- ViewBase? view = ViewQATContents.GetNextQATView(ViewOverflowManager.FocusView);
+ ViewBase view = ViewQATContents.GetNextQATView(ViewOverflowManager!.FocusView!);
// Rotate around to the first item
if (view == null)
@@ -150,10 +150,10 @@ public void SetNextFocusItem()
public void SetPreviousFocusItem()
{
// Find the previous item in sequence
- ViewBase view = ViewQATContents.GetPreviousQATView(ViewOverflowManager.FocusView);
+ ViewBase view = ViewQATContents.GetPreviousQATView(ViewOverflowManager!.FocusView!);
// Rotate around to the last item
- if (view == null)
+ if (view is null)
{
SetLastFocusItem();
}
@@ -198,7 +198,7 @@ protected override CreateParams CreateParams
get
{
CreateParams cp = base.CreateParams;
- cp.Style |= (int) PI.WS_.CLIPCHILDREN;
+ cp.Style |= (int)PI.WS_.CLIPCHILDREN;
return cp;
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Action Lists/KryptonGalleryActionList.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Action Lists/KryptonGalleryActionList.cs
index f3b7d651e..d395eb271 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Action Lists/KryptonGalleryActionList.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Action Lists/KryptonGalleryActionList.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -17,8 +17,8 @@ namespace Krypton.Ribbon
internal class KryptonGalleryActionList : DesignerActionList
{
#region Instance Fields
- private readonly KryptonGallery? _gallery;
- private readonly IComponentChangeService _service;
+ private readonly KryptonGallery _gallery;
+ private readonly IComponentChangeService? _service;
#endregion
#region Identity
@@ -26,17 +26,17 @@ internal class KryptonGalleryActionList : DesignerActionList
/// Initialize a new instance of the KryptonGalleryActionList class.
///
/// Designer that owns this action list instance.
- public KryptonGalleryActionList(KryptonGalleryDesigner owner)
+ public KryptonGalleryActionList(KryptonGalleryDesigner owner)
: base(owner.Component)
{
// Remember the gallery instance
- _gallery = (KryptonGallery)owner.Component;
+ _gallery = (owner.Component as KryptonGallery)!;
// Cache service used to notify when a property has changed
- _service = (IComponentChangeService)GetService(typeof(IComponentChangeService));
+ _service = GetService(typeof(IComponentChangeService)) as IComponentChangeService;
}
#endregion
-
+
#region Public
///
/// Gets and sets the palette mode.
@@ -49,7 +49,7 @@ public PaletteMode PaletteMode
{
if (_gallery.PaletteMode != value)
{
- _service.OnComponentChanged(_gallery, null, _gallery.PaletteMode, value);
+ _service?.OnComponentChanged(_gallery, null, _gallery.PaletteMode, value);
_gallery.PaletteMode = value;
}
}
@@ -73,7 +73,7 @@ public override DesignerActionItemCollection GetSortedActionItems()
actions.Add(new DesignerActionHeaderItem("Visuals"));
actions.Add(new DesignerActionPropertyItem(nameof(PaletteMode), "Palette", "Visuals", "Palette applied to drawing"));
}
-
+
return actions;
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Action Lists/KryptonRibbonActionList.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Action Lists/KryptonRibbonActionList.cs
index 5d1638e76..a051042c1 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Action Lists/KryptonRibbonActionList.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Action Lists/KryptonRibbonActionList.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -17,8 +17,8 @@ namespace Krypton.Ribbon
internal class KryptonRibbonActionList : DesignerActionList
{
#region Instance Fields
- private readonly KryptonRibbon? _ribbon;
- private readonly IComponentChangeService _service;
+ private readonly KryptonRibbon _ribbon;
+ private readonly IComponentChangeService? _service;
#endregion
#region Identity
@@ -30,23 +30,15 @@ public KryptonRibbonActionList(KryptonRibbonDesigner owner)
: base(owner.Component)
{
// Remember the ribbon instance
- _ribbon = (KryptonRibbon)owner.Component;
+ _ribbon = (owner.Component as KryptonRibbon)!;
// Cache service used to notify when a property has changed
- _service = (IComponentChangeService)GetService(typeof(IComponentChangeService));
+ _service = GetService(typeof(IComponentChangeService)) as IComponentChangeService;
}
#endregion
#region Public
- /// Gets or sets a value indicating whether [allow form integrate].
- /// true if [allow form integrate]; otherwise, false .
- public bool AllowFormIntegrate
- {
- get => _ribbon.AllowFormIntegrate;
- set => _ribbon.AllowFormIntegrate = value;
- }
-
///
/// Gets and sets use of design time helpers.
///
@@ -67,7 +59,7 @@ public PaletteMode PaletteMode
{
if (_ribbon.PaletteMode != value)
{
- _service.OnComponentChanged(_ribbon, null, _ribbon.PaletteMode, value);
+ _service?.OnComponentChanged(_ribbon, null, _ribbon.PaletteMode, value);
_ribbon.PaletteMode = value;
}
}
@@ -91,7 +83,6 @@ public override DesignerActionItemCollection GetSortedActionItems()
actions.Add(new DesignerActionHeaderItem("Design"));
actions.Add(new DesignerActionPropertyItem(nameof(InDesignHelperMode), "Design Helpers", "Design", "Show design time helpers for creating items."));
actions.Add(new DesignerActionHeaderItem("Visuals"));
- actions.Add(new DesignerActionPropertyItem(nameof(AllowFormIntegrate), "Allow Form Integration", "Visuals", "Integrate with operating system chrome instead of Krypton Palette."));
actions.Add(new DesignerActionPropertyItem(nameof(PaletteMode), "Palette", "Visuals", "Palette applied to drawing"));
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Collection Editors/KryptonRibbonGroupClusterCollectionEditor.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Collection Editors/KryptonRibbonGroupClusterCollectionEditor.cs
index 0cc24a41b..a473f8e89 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Collection Editors/KryptonRibbonGroupClusterCollectionEditor.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Collection Editors/KryptonRibbonGroupClusterCollectionEditor.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -28,7 +28,10 @@ public KryptonRibbonGroupClusterCollectionEditor()
/// Gets the data types that this collection editor can contain.
///
/// An array of data types that this collection can contain.
- protected override Type[] CreateNewItemTypes() => new[] { typeof(KryptonRibbonGroupClusterButton),
- typeof(KryptonRibbonGroupClusterColorButton)};
+ protected override Type[] CreateNewItemTypes() =>
+ [
+ typeof(KryptonRibbonGroupClusterButton),
+ typeof(KryptonRibbonGroupClusterColorButton)
+ ];
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Collection Editors/KryptonRibbonGroupContainerCollectionEditor.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Collection Editors/KryptonRibbonGroupContainerCollectionEditor.cs
index f57ecb7d7..02ce8b35b 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Collection Editors/KryptonRibbonGroupContainerCollectionEditor.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Collection Editors/KryptonRibbonGroupContainerCollectionEditor.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -29,8 +29,10 @@ public KryptonRibbonGroupContainerCollectionEditor()
protected override Type[] CreateNewItemTypes() =>
// Bug https://github.com/Krypton-Suite/Standard-Toolkit/issues/66
// For some reason in .Net5 onwards, the following function is not called
- new[] { typeof(KryptonRibbonGroupLines),
+ [
+ typeof(KryptonRibbonGroupLines),
typeof(KryptonRibbonGroupTriple),
- typeof(KryptonRibbonGroupSeparator) };
+ typeof(KryptonRibbonGroupSeparator)
+ ];
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Collection Editors/KryptonRibbonGroupLinesCollectionEditor.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Collection Editors/KryptonRibbonGroupLinesCollectionEditor.cs
index 13cf85aab..7ed0c5ad7 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Collection Editors/KryptonRibbonGroupLinesCollectionEditor.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Collection Editors/KryptonRibbonGroupLinesCollectionEditor.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -28,7 +28,9 @@ public KryptonRibbonGroupLinesCollectionEditor()
/// Gets the data types that this collection editor can contain.
///
/// An array of data types that this collection can contain.
- protected override Type[] CreateNewItemTypes() => new[] { typeof(KryptonRibbonGroupButton),
+ protected override Type[] CreateNewItemTypes() =>
+ [
+ typeof(KryptonRibbonGroupButton),
typeof(KryptonRibbonGroupColorButton),
typeof(KryptonRibbonGroupCheckBox),
typeof(KryptonRibbonGroupComboBox),
@@ -41,6 +43,7 @@ protected override Type[] CreateNewItemTypes() => new[] { typeof(KryptonRibbonGr
typeof(KryptonRibbonGroupRadioButton),
typeof(KryptonRibbonGroupRichTextBox),
typeof(KryptonRibbonGroupTextBox),
- typeof(KryptonRibbonGroupTrackBar)};
+ typeof(KryptonRibbonGroupTrackBar)
+ ];
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Collection Editors/KryptonRibbonGroupTripleCollectionEditor.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Collection Editors/KryptonRibbonGroupTripleCollectionEditor.cs
index ac038777c..40e356af0 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Collection Editors/KryptonRibbonGroupTripleCollectionEditor.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Collection Editors/KryptonRibbonGroupTripleCollectionEditor.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -28,8 +28,8 @@ public KryptonRibbonGroupTripleCollectionEditor()
/// Gets the data types that this collection editor can contain.
///
/// An array of data types that this collection can contain.
- protected override Type[] CreateNewItemTypes() => new[]
- {
+ protected override Type[] CreateNewItemTypes() =>
+ [
typeof(KryptonRibbonGroupButton),
typeof(KryptonRibbonGroupColorButton),
typeof(KryptonRibbonGroupCheckBox),
@@ -45,6 +45,6 @@ protected override Type[] CreateNewItemTypes() => new[]
typeof(KryptonRibbonGroupTextBox),
typeof(KryptonRibbonGroupTrackBar),
typeof(KryptonRibbonGroupThemeComboBox)
- };
+ ];
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Collection Editors/KryptonRibbonQATButtonCollectionEditor.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Collection Editors/KryptonRibbonQATButtonCollectionEditor.cs
index fadd307f1..1ab923d41 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Collection Editors/KryptonRibbonQATButtonCollectionEditor.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Collection Editors/KryptonRibbonQATButtonCollectionEditor.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -28,7 +28,7 @@ public KryptonRibbonQATButtonCollectionEditor()
/// Gets the data types that this collection editor can contain.
///
/// An array of data types that this collection can contain.
- protected override Type[] CreateNewItemTypes() => new[] { typeof(KryptonRibbonQATButton) };
+ protected override Type[] CreateNewItemTypes() => [typeof(KryptonRibbonQATButton)];
///
/// Sets the specified array as the items of the collection.
@@ -36,18 +36,18 @@ public KryptonRibbonQATButtonCollectionEditor()
/// The collection to edit.
/// An array of objects to set as the collection items.
/// The newly created collection object.
- protected override object SetItems(object editValue, object[] value)
+ protected override object? SetItems(object? editValue, object[]? value)
{
// Cast the context into the expected control type
- var ribbon = (KryptonRibbon)Context.Instance;
+ var ribbon = Context?.Instance as KryptonRibbon ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("ribbon"));
// Suspend changes until collection has been updated
- ribbon?.SuspendLayout();
+ ribbon.SuspendLayout();
// Let base class update the collection
var ret = base.SetItems(editValue, value);
- ribbon?.ResumeLayout(true);
+ ribbon.ResumeLayout(true);
return ret;
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Collection Editors/KryptonRibbonRecentDocCollectionEditor.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Collection Editors/KryptonRibbonRecentDocCollectionEditor.cs
index e3fa9d5b6..759c56743 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Collection Editors/KryptonRibbonRecentDocCollectionEditor.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Collection Editors/KryptonRibbonRecentDocCollectionEditor.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -28,6 +28,6 @@ public KryptonRibbonRecentDocCollectionEditor()
/// Gets the data types that this collection editor can contain.
///
/// An array of data types that this collection can contain.
- protected override Type[] CreateNewItemTypes() => new[] { typeof(KryptonRibbonRecentDoc) };
+ protected override Type[] CreateNewItemTypes() => [typeof(KryptonRibbonRecentDoc)];
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonGalleryDesigner.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonGalleryDesigner.cs
index 977db15fe..26615bde1 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonGalleryDesigner.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonGalleryDesigner.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -17,7 +17,7 @@ namespace Krypton.Ribbon
internal class KryptonGalleryDesigner : ParentControlDesigner
{
#region Instance Fields
- private KryptonGallery _gallery;
+ private KryptonGallery? _gallery;
private IComponentChangeService _changeService;
#endregion
@@ -48,7 +48,7 @@ public override void Initialize([DisallowNull] IComponent component)
_gallery = component as KryptonGallery;
// We need to know when we are being removed
- _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
+ _changeService = (IComponentChangeService?)GetService(typeof(IComponentChangeService)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_changeService)));
_changeService.ComponentRemoving += OnComponentRemoving;
}
@@ -63,7 +63,7 @@ public override ICollection AssociatedComponents
var compound = new ArrayList(base.AssociatedComponents);
// Add all the display ranges
- foreach (KryptonGalleryRange dropRange in _gallery.DropButtonRanges)
+ foreach (KryptonGalleryRange dropRange in _gallery?.DropButtonRanges!)
{
compound.Add(dropRange);
}
@@ -124,16 +124,16 @@ protected override void Dispose(bool disposing)
#endregion
#region Implementation
- private void OnComponentRemoving(object sender, ComponentEventArgs e)
+ private void OnComponentRemoving(object? sender, ComponentEventArgs e)
{
// If our control is being removed
if (e.Component == _gallery)
{
// Need access to host in order to delete a component
- var host = (IDesignerHost)GetService(typeof(IDesignerHost));
+ var host = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("host"));
// We need to remove all the range instances
- for (var i = _gallery.DropButtonRanges.Count - 1; i >= 0; i--)
+ for (var i = _gallery!.DropButtonRanges.Count - 1; i >= 0; i--)
{
KryptonGalleryRange dropRange = _gallery.DropButtonRanges[i];
_gallery.DropButtonRanges.Remove(dropRange);
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonDesigner.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonDesigner.cs
index b878d053c..ff01bfc2a 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonDesigner.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonDesigner.cs
@@ -1,14 +1,10 @@
#region BSD License
/*
- *
* Original BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE)
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
- *
- * Modified: Monday 12th April, 2021 @ 18:00 GMT
- *
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*/
#endregion
@@ -18,10 +14,10 @@ internal class KryptonRibbonDesigner : ParentControlDesigner
{
#region Instance Fields
private KryptonRibbon? _ribbon;
- private IDesignerHost _designerHost;
- private ISelectionService _selectionService;
- private IComponentChangeService _changeService;
- private DesignerVerbCollection _verbs;
+ private IDesignerHost? _designerHost;
+ private ISelectionService? _selectionService;
+ private IComponentChangeService? _changeService;
+ private DesignerVerbCollection _verbs = [];
private DesignerVerb _toggleHelpersVerb;
private DesignerVerb _addTabVerb;
private DesignerVerb _clearTabsVerb;
@@ -50,23 +46,24 @@ public override void Initialize([DisallowNull] IComponent component)
// Let base class do standard stuff
base.Initialize(component);
- Debug.Assert(component != null);
+ Debug.Assert(component is not null);
// Cast to correct type
- _ribbon = component as KryptonRibbon;
- if (_ribbon?.GetViewManager() != null)
+ _ribbon = component as KryptonRibbon ?? throw new ArgumentNullException(nameof(_ribbon));
+
+ if (_ribbon.GetViewManager() is ViewManager viewManager && viewManager is not null)
{
// Hook into ribbon events
- _ribbon.GetViewManager().MouseUpProcessed += OnRibbonMouseUp;
- _ribbon.GetViewManager().DoubleClickProcessed += OnRibbonDoubleClick;
+ viewManager.MouseUpProcessed += OnRibbonMouseUp;
+ viewManager.DoubleClickProcessed += OnRibbonDoubleClick;
_ribbon.SelectedTabChanged += OnSelectedTabChanged;
_ribbon.DesignTimeAddTab += OnAddTab;
}
// Get access to the services
- _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
- _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
- _selectionService = (ISelectionService)GetService(typeof(ISelectionService));
+ _designerHost = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_designerHost)));
+ _changeService = (IComponentChangeService?)GetService(typeof(IComponentChangeService)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_changeService)));
+ _selectionService = (ISelectionService?)GetService(typeof(ISelectionService)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_selectionService)));
// We need to know when we are being removed
_changeService.ComponentRemoving += OnComponentRemoving;
@@ -92,12 +89,12 @@ public override ICollection AssociatedComponents
// Create a new collection for both values
var compound = new ArrayList(base.AssociatedComponents);
- compound.AddRange(_ribbon.ButtonSpecs);
+ compound.AddRange(_ribbon!.ButtonSpecs);
compound.AddRange(_ribbon.QATButtons);
compound.AddRange(_ribbon.RibbonContexts);
- compound.AddRange(_ribbon.RibbonAppButton.AppButtonMenuItems);
- compound.AddRange(_ribbon.RibbonAppButton.AppButtonRecentDocs);
- compound.AddRange(_ribbon.RibbonAppButton.AppButtonSpecs);
+ compound.AddRange(_ribbon.RibbonFileAppButton.AppButtonMenuItems);
+ compound.AddRange(_ribbon.RibbonFileAppButton.AppButtonRecentDocs);
+ compound.AddRange(_ribbon.RibbonFileAppButton.AppButtonSpecs);
// Add all the objects for each tab
foreach (KryptonRibbonTab ribbonTab in _ribbon.RibbonTabs)
@@ -135,9 +132,8 @@ public override DesignerVerbCollection Verbs
get
{
// Create verbs first time around
- if (_verbs == null)
+ if (_verbs.Count == 0)
{
- _verbs = new DesignerVerbCollection();
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_addTabVerb = new DesignerVerb(@"Add Tab", OnAddTab);
_clearTabsVerb = new DesignerVerb(@"Clear Tabs", OnClearTabs);
@@ -161,15 +157,24 @@ protected override void Dispose(bool disposing)
{
if (disposing)
{
- // Unhook from navigator events
- _ribbon.GetViewManager().MouseUpProcessed -= OnRibbonMouseUp;
- _ribbon.GetViewManager().DoubleClickProcessed -= OnRibbonDoubleClick;
- _ribbon.SelectedTabChanged -= OnSelectedTabChanged;
- _ribbon.DesignTimeAddTab -= OnAddTab;
-
- // Unhook from events
- _changeService.ComponentRemoving -= OnComponentRemoving;
- _changeService.ComponentChanged -= OnComponentChanged;
+ if (_ribbon is not null)
+ {
+ if (_ribbon.GetViewManager() is ViewManager viewManager && viewManager is not null)
+ {
+ // Unhook from navigator events
+ viewManager.MouseUpProcessed -= OnRibbonMouseUp;
+ viewManager.DoubleClickProcessed -= OnRibbonDoubleClick;
+ _ribbon.SelectedTabChanged -= OnSelectedTabChanged;
+ _ribbon.DesignTimeAddTab -= OnAddTab;
+ }
+ }
+
+ if (_changeService is not null)
+ {
+ // Unhook from events
+ _changeService.ComponentRemoving -= OnComponentRemoving;
+ _changeService.ComponentChanged -= OnComponentChanged;
+ }
}
}
finally
@@ -187,7 +192,7 @@ protected override void Dispose(bool disposing)
protected override bool GetHitTest(Point point)
{
// Ask the control if it wants to process the point
- var ret = _ribbon.DesignerGetHitTest(_ribbon.PointToClient(point));
+ var ret = _ribbon!.DesignerGetHitTest(_ribbon.PointToClient(point));
// If the ribbon does not want the mouse point then make sure the
// tracking element is informed that the mouse has left the control
@@ -207,7 +212,7 @@ protected override bool GetHitTest(Point point)
///
protected override void OnMouseLeave()
{
- _ribbon.DesignerMouseLeave();
+ _ribbon!.DesignerMouseLeave();
base.OnMouseLeave();
}
@@ -231,35 +236,45 @@ protected override void OnMouseLeave()
#endregion
#region Implementation
- private void OnSelectedTabChanged(object sender, EventArgs e)
+ private void OnSelectedTabChanged(object? sender, EventArgs e)
{
// Notify a change in the selected tab value, marks the form as dirty
- MemberDescriptor propertyTab = TypeDescriptor.GetProperties(_ribbon)[@"SelectedTab"];
+ MemberDescriptor? propertyTab = TypeDescriptor.GetProperties(_ribbon!)[@"SelectedTab"];
RaiseComponentChanging(propertyTab);
RaiseComponentChanged(propertyTab, null, null);
}
private void UpdateVerbStatus()
{
- if (_verbs != null)
+ if (_verbs.Count != 0 && _ribbon is not null)
{
_clearTabsVerb.Enabled = _ribbon.RibbonTabs.Count > 0;
}
}
- private void OnToggleHelpers(object sender, EventArgs e) =>
+ private void OnToggleHelpers(object? sender, EventArgs e) =>
// Invert the current toggle helper mode
- _ribbon.InDesignHelperMode = !_ribbon.InDesignHelperMode;
+ _ribbon!.InDesignHelperMode = !_ribbon.InDesignHelperMode;
- private void OnAddTab(object sender, EventArgs e)
+ private void OnAddTab(object? sender, EventArgs e)
{
+ if (_designerHost is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_designerHost)));
+ }
+
+ if (_ribbon is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_ribbon)));
+ }
+
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbon AddTab");
try
{
// Get access to the tabs property
- MemberDescriptor propertyPages = TypeDescriptor.GetProperties(_ribbon)[@"RibbonTabs"];
+ MemberDescriptor? propertyPages = TypeDescriptor.GetProperties(_ribbon)[@"RibbonTabs"];
RaiseComponentChanging(propertyPages);
@@ -278,20 +293,30 @@ private void OnAddTab(object sender, EventArgs e)
}
}
- private void OnClearTabs(object sender, EventArgs e)
+ private void OnClearTabs(object? sender, EventArgs e)
{
+ if (_designerHost is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_designerHost)));
+ }
+
+ if (_ribbon is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_ribbon)));
+ }
+
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbon ClearTabs");
try
{
// Get access to the tabs property
- MemberDescriptor propertyPages = TypeDescriptor.GetProperties(_ribbon)[@"RibbonTabs"];
+ MemberDescriptor? propertyPages = TypeDescriptor.GetProperties(_ribbon)[@"RibbonTabs"];
RaiseComponentChanging(propertyPages);
// Need access to host in order to delete a component
- var host = (IDesignerHost)GetService(typeof(IDesignerHost));
+ var host = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("host"));
// We need to remove all the tabs from the ribbon
for (var i = _ribbon.RibbonTabs.Count - 1; i >= 0; i--)
@@ -312,21 +337,19 @@ private void OnClearTabs(object sender, EventArgs e)
}
}
- private void OnRibbonMouseUp(object sender, MouseEventArgs e)
+ private void OnRibbonMouseUp(object? sender, MouseEventArgs e)
{
// Get any component associated with the current mouse position
- Component component = _ribbon.DesignerComponentFromPoint(new Point(e.X, e.Y));
-
- if (component != null)
- {
+ if (_ribbon is not null
+ && _ribbon.DesignerComponentFromPoint(new Point(e.X, e.Y)) is Component component
+ && component is not null)
+ {
// Select the component
- var selectionList = new ArrayList
- {
- component
- };
- _selectionService.SetSelectedComponents(selectionList, SelectionTypes.Auto);
+ ArrayList selectionList = [component];
+
+ _selectionService!.SetSelectedComponents(selectionList, SelectionTypes.Auto);
- // Force the layout to be update for any change in selection
+ // Force the layout to be updated for any change in selection
_ribbon.PerformLayout();
}
}
@@ -334,31 +357,33 @@ private void OnRibbonMouseUp(object sender, MouseEventArgs e)
private void OnRibbonDoubleClick(object sender, Point pt)
{
// Get any component associated with the current mouse position
- Component component = _ribbon.DesignerComponentFromPoint(pt);
// We are only interested in the contained components and not the ribbon control
- if ((component != null) && component is not System.Windows.Forms.Control)
+ if ( _ribbon is not null
+ && _ribbon.DesignerComponentFromPoint(pt) is Component component
+ && component is not null
+ && component is not System.Windows.Forms.Control)
{
// Get the designer for the component
- IDesigner designer = _designerHost.GetDesigner(component);
+ IDesigner? designer = _designerHost!.GetDesigner(component);
// Request code for the default event be generated
- designer.DoDefaultAction();
+ designer?.DoDefaultAction();
}
}
- private void OnComponentChanged(object sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
+ private void OnComponentChanged(object? sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
- private void OnComponentRemoving(object sender, ComponentEventArgs e)
+ private void OnComponentRemoving(object? sender, ComponentEventArgs e)
{
// If our control is being removed
if (e.Component == _ribbon)
{
// Need access to host in order to delete a component
- var host = (IDesignerHost)GetService(typeof(IDesignerHost));
+ var host = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("host"));
// We need to remove all the button spec instances
- for (var i = _ribbon.ButtonSpecs.Count - 1; i >= 0; i--)
+ for (var i = _ribbon!.ButtonSpecs.Count - 1; i >= 0; i--)
{
ButtonSpec spec = _ribbon.ButtonSpecs[i];
_ribbon.ButtonSpecs.Remove(spec);
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupButtonDesigner.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupButtonDesigner.cs
index 97884f224..53bf3935c 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupButtonDesigner.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupButtonDesigner.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -19,7 +19,7 @@ internal class KryptonRibbonGroupButtonDesigner : ComponentDesigner
#region Instance Fields
private IDesignerHost _designerHost;
private IComponentChangeService _changeService;
- private KryptonRibbonGroupButton _ribbonButton;
+ private KryptonRibbonGroupButton? _ribbonButton;
private DesignerVerbCollection _verbs;
private DesignerVerb _toggleHelpersVerb;
private DesignerVerb _moveFirstVerb;
@@ -73,8 +73,8 @@ public override void Initialize([DisallowNull] IComponent component)
}
// Get access to the services
- _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
- _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
+ _designerHost = (IDesignerHost?)GetService(typeof(IDesignerHost))!;
+ _changeService = (IComponentChangeService?)GetService(typeof(IComponentChangeService))!;
// We need to know when we are being removed/changed
_changeService.ComponentChanged += OnComponentChanged;
@@ -105,7 +105,7 @@ protected override void Dispose(bool disposing)
if (disposing)
{
// Unhook from events
- _ribbonButton.DesignTimeContextMenu -= OnContextMenu;
+ _ribbonButton!.DesignTimeContextMenu -= OnContextMenu;
_changeService.ComponentChanged -= OnComponentChanged;
}
}
@@ -121,9 +121,9 @@ protected override void Dispose(bool disposing)
private void UpdateVerbStatus()
{
// Create verbs first time around
- if (_verbs == null)
+ if (_verbs is null)
{
- _verbs = new DesignerVerbCollection();
+ _verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move Button First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move Button Previous", OnMovePrevious);
@@ -139,9 +139,9 @@ private void UpdateVerbStatus()
var moveNext = false;
var moveLast = false;
- if (_ribbonButton.Ribbon != null)
+ if (_ribbonButton is not null && _ribbonButton.Ribbon is not null)
{
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
moveFirst = items.IndexOf(_ribbonButton) > 0;
movePrev = items.IndexOf(_ribbonButton) > 0;
moveNext = items.IndexOf(_ribbonButton) < (items.Count - 1);
@@ -154,21 +154,23 @@ private void UpdateVerbStatus()
_moveLastVerb.Enabled = moveLast;
}
- private void OnToggleHelpers(object sender, EventArgs e)
+ private void OnToggleHelpers(object? sender, EventArgs e)
{
// Invert the current toggle helper mode
- if (_ribbonButton.Ribbon != null)
+ if (_ribbonButton!.Ribbon != null)
{
_ribbonButton.Ribbon.InDesignHelperMode = !_ribbonButton.Ribbon.InDesignHelperMode;
}
}
- private void OnMoveFirst(object sender, EventArgs e)
+ private void OnMoveFirst(object? sender, EventArgs e)
{
- if (_ribbonButton.Ribbon != null)
+ if (_ribbonButton is not null
+ && _ribbonButton.Ribbon is not null
+ && _ribbonButton.RibbonContainer is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupButton MoveFirst");
@@ -176,7 +178,7 @@ private void OnMoveFirst(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonButton.RibbonContainer)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonButton.RibbonContainer)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -190,17 +192,19 @@ private void OnMoveFirst(object sender, EventArgs e)
finally
{
// If we managed to create the transaction, then do it
- transaction?.Commit();
+ transaction.Commit();
}
}
}
- private void OnMovePrevious(object sender, EventArgs e)
+ private void OnMovePrevious(object? sender, EventArgs e)
{
- if (_ribbonButton.Ribbon != null)
+ if (_ribbonButton is not null
+ && _ribbonButton.Ribbon is not null
+ && _ribbonButton.RibbonContainer is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupButton MovePrevious");
@@ -208,7 +212,7 @@ private void OnMovePrevious(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonButton.RibbonContainer)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonButton.RibbonContainer)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -224,17 +228,19 @@ private void OnMovePrevious(object sender, EventArgs e)
finally
{
// If we managed to create the transaction, then do it
- transaction?.Commit();
+ transaction.Commit();
}
}
}
- private void OnMoveNext(object sender, EventArgs e)
+ private void OnMoveNext(object? sender, EventArgs e)
{
- if (_ribbonButton.Ribbon != null)
+ if (_ribbonButton is not null
+ && _ribbonButton.Ribbon is not null
+ && _ribbonButton.RibbonContainer is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupButton MoveNext");
@@ -242,7 +248,7 @@ private void OnMoveNext(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonButton.RibbonContainer)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonButton.RibbonContainer)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -258,17 +264,19 @@ private void OnMoveNext(object sender, EventArgs e)
finally
{
// If we managed to create the transaction, then do it
- transaction?.Commit();
+ transaction.Commit();
}
}
}
- private void OnMoveLast(object sender, EventArgs e)
+ private void OnMoveLast(object? sender, EventArgs e)
{
- if (_ribbonButton.Ribbon != null)
+ if (_ribbonButton is not null
+ && _ribbonButton.RibbonContainer is not null
+ && _ribbonButton.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupButton MoveLast");
@@ -276,7 +284,7 @@ private void OnMoveLast(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonButton.RibbonContainer)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonButton.RibbonContainer)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -290,17 +298,19 @@ private void OnMoveLast(object sender, EventArgs e)
finally
{
// If we managed to create the transaction, then do it
- transaction?.Commit();
+ transaction.Commit();
}
}
}
- private void OnDeleteButton(object sender, EventArgs e)
+ private void OnDeleteButton(object? sender, EventArgs e)
{
- if (_ribbonButton.Ribbon != null)
+ if (_ribbonButton is not null
+ && _ribbonButton.Ribbon is not null
+ && _ribbonButton.RibbonContainer is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupButton DeleteButton");
@@ -308,7 +318,7 @@ private void OnDeleteButton(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonButton.RibbonContainer)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonButton.RibbonContainer)[@"Items"];
// Remove the ribbon group from the ribbon tab
RaiseComponentChanging(null);
@@ -326,79 +336,79 @@ private void OnDeleteButton(object sender, EventArgs e)
finally
{
// If we managed to create the transaction, then do it
- transaction?.Commit();
+ transaction.Commit();
}
}
}
- private void OnVisible(object sender, EventArgs e)
+ private void OnVisible(object? sender, EventArgs e)
{
- if (_ribbonButton.Ribbon != null)
+ if (_ribbonButton!.Ribbon != null)
{
_changeService.OnComponentChanged(_ribbonButton, null, _ribbonButton.Visible, !_ribbonButton.Visible);
_ribbonButton.Visible = !_ribbonButton.Visible;
}
}
- private void OnEnabled(object sender, EventArgs e)
+ private void OnEnabled(object? sender, EventArgs e)
{
- if (_ribbonButton.Ribbon != null)
+ if (_ribbonButton!.Ribbon != null)
{
_changeService.OnComponentChanged(_ribbonButton, null, _ribbonButton.Enabled, !_ribbonButton.Enabled);
_ribbonButton.Enabled = !_ribbonButton.Enabled;
}
}
- private void OnChecked(object sender, EventArgs e)
+ private void OnChecked(object? sender, EventArgs e)
{
- if (_ribbonButton.Ribbon != null)
+ if (_ribbonButton!.Ribbon != null)
{
_changeService.OnComponentChanged(_ribbonButton, null, _ribbonButton.Checked, !_ribbonButton.Checked);
_ribbonButton.Checked = !_ribbonButton.Checked;
}
}
- private void OnTypePush(object sender, EventArgs e)
+ private void OnTypePush(object? sender, EventArgs e)
{
- if (_ribbonButton.Ribbon != null)
+ if (_ribbonButton!.Ribbon != null)
{
_changeService.OnComponentChanged(_ribbonButton, null, _ribbonButton.ButtonType, GroupButtonType.Push);
_ribbonButton.ButtonType = GroupButtonType.Push;
}
}
- private void OnTypeCheck(object sender, EventArgs e)
+ private void OnTypeCheck(object? sender, EventArgs e)
{
- if (_ribbonButton.Ribbon != null)
+ if (_ribbonButton!.Ribbon != null)
{
_changeService.OnComponentChanged(_ribbonButton, null, _ribbonButton.ButtonType, GroupButtonType.Check);
_ribbonButton.ButtonType = GroupButtonType.Check;
}
}
- private void OnTypeDropDown(object sender, EventArgs e)
+ private void OnTypeDropDown(object? sender, EventArgs e)
{
- if (_ribbonButton.Ribbon != null)
+ if (_ribbonButton!.Ribbon != null)
{
_changeService.OnComponentChanged(_ribbonButton, null, _ribbonButton.ButtonType, GroupButtonType.DropDown);
_ribbonButton.ButtonType = GroupButtonType.DropDown;
}
}
- private void OnTypeSplit(object sender, EventArgs e)
+ private void OnTypeSplit(object? sender, EventArgs e)
{
- if (_ribbonButton.Ribbon != null)
+ if (_ribbonButton!.Ribbon != null)
{
_changeService.OnComponentChanged(_ribbonButton, null, _ribbonButton.ButtonType, GroupButtonType.Split);
_ribbonButton.ButtonType = GroupButtonType.Split;
}
}
- private void OnComponentChanged(object sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
+ private void OnComponentChanged(object? sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
- private void OnContextMenu(object sender, MouseEventArgs e)
+ private void OnContextMenu(object? sender, MouseEventArgs e)
{
- if (_ribbonButton.Ribbon != null)
+ if ( _ribbonButton is not null && _ribbonButton.Ribbon is not null)
{
// Create the menu strip the first time around
if (_cms == null)
@@ -445,7 +455,7 @@ private void OnContextMenu(object sender, MouseEventArgs e)
// Show the context menu
if (CommonHelper.ValidContextMenuStrip(_cms))
{
- Point screenPt = _ribbonButton.Ribbon.ViewRectangleToPoint(_ribbonButton.ButtonView);
+ Point screenPt = _ribbonButton.Ribbon.ViewRectangleToPoint(_ribbonButton.ButtonView!);
VisualPopupManager.Singleton.ShowContextMenuStrip(_cms, screenPt);
}
}
@@ -455,7 +465,7 @@ private TypedRestrictCollection? ParentItems
{
get
{
- switch (_ribbonButton.RibbonContainer)
+ switch (_ribbonButton!.RibbonContainer)
{
case KryptonRibbonGroupTriple triple:
return triple.Items;
@@ -464,6 +474,7 @@ private TypedRestrictCollection? ParentItems
default:
// Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(_ribbonButton.RibbonContainer!.ToString());
return null;
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupCheckBoxDesigner.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupCheckBoxDesigner.cs
index 19776d494..42a93b0f3 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupCheckBoxDesigner.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupCheckBoxDesigner.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -19,7 +19,7 @@ internal class KryptonRibbonGroupCheckBoxDesigner : ComponentDesigner
#region Instance Fields
private IDesignerHost _designerHost;
private IComponentChangeService _changeService;
- private KryptonRibbonGroupCheckBox _ribbonCheckBox;
+ private KryptonRibbonGroupCheckBox? _ribbonCheckBox;
private DesignerVerbCollection _verbs;
private DesignerVerb _toggleHelpersVerb;
private DesignerVerb _moveFirstVerb;
@@ -60,18 +60,18 @@ public override void Initialize([DisallowNull] IComponent component)
// Let base class do standard stuff
base.Initialize(component);
- Debug.Assert(component != null);
+ Debug.Assert(component is not null);
// Cast to correct type
_ribbonCheckBox = component as KryptonRibbonGroupCheckBox;
- if (_ribbonCheckBox != null)
+ if (_ribbonCheckBox is not null)
{
_ribbonCheckBox.DesignTimeContextMenu += OnContextMenu;
}
// Get access to the services
- _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
- _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
+ _designerHost = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_designerHost)));
+ _changeService = (IComponentChangeService?)GetService(typeof(IComponentChangeService)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_changeService)));
// We need to know when we are being removed/changed
_changeService.ComponentChanged += OnComponentChanged;
@@ -102,7 +102,7 @@ protected override void Dispose(bool disposing)
if (disposing)
{
// Unhook from events
- _ribbonCheckBox.DesignTimeContextMenu -= OnContextMenu;
+ _ribbonCheckBox!.DesignTimeContextMenu -= OnContextMenu;
_changeService.ComponentChanged -= OnComponentChanged;
}
}
@@ -120,7 +120,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
- _verbs = new DesignerVerbCollection();
+ _verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move CheckBox First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move CheckBox Previous", OnMovePrevious);
@@ -136,10 +136,10 @@ private void UpdateVerbStatus()
var moveNext = false;
var moveLast = false;
- if (_ribbonCheckBox.Ribbon != null)
+ if (_ribbonCheckBox!.Ribbon != null)
{
var items = ParentItems;
- moveFirst = items.IndexOf(_ribbonCheckBox) > 0;
+ moveFirst = items!.IndexOf(_ribbonCheckBox) > 0;
movePrev = items.IndexOf(_ribbonCheckBox) > 0;
moveNext = items.IndexOf(_ribbonCheckBox) < (items.Count - 1);
moveLast = items.IndexOf(_ribbonCheckBox) < (items.Count - 1);
@@ -151,21 +151,23 @@ private void UpdateVerbStatus()
_moveLastVerb.Enabled = moveLast;
}
- private void OnToggleHelpers(object sender, EventArgs e)
+ private void OnToggleHelpers(object? sender, EventArgs e)
{
// Invert the current toggle helper mode
- if (_ribbonCheckBox.Ribbon != null)
+ if (_ribbonCheckBox!.Ribbon != null)
{
_ribbonCheckBox.Ribbon.InDesignHelperMode = !_ribbonCheckBox.Ribbon.InDesignHelperMode;
}
}
- private void OnMoveFirst(object sender, EventArgs e)
+ private void OnMoveFirst(object? sender, EventArgs e)
{
- if (_ribbonCheckBox.Ribbon != null)
+ if (_ribbonCheckBox is not null
+ && _ribbonCheckBox.Ribbon is not null
+ && _ribbonCheckBox.RibbonContainer is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupCheckBox MoveFirst");
@@ -173,7 +175,7 @@ private void OnMoveFirst(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonCheckBox.RibbonContainer)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonCheckBox.RibbonContainer)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -187,17 +189,20 @@ private void OnMoveFirst(object sender, EventArgs e)
finally
{
// If we managed to create the transaction, then do it
- transaction?.Commit();
+ transaction.Commit();
}
}
}
- private void OnMovePrevious(object sender, EventArgs e)
+ private void OnMovePrevious(object? sender, EventArgs e)
{
- if (_ribbonCheckBox.Ribbon != null)
+ if (_ribbonCheckBox is not null
+ && _ribbonCheckBox.Ribbon is not null
+ && _ribbonCheckBox.RibbonContainer is not null)
+
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupCheckBox MovePrevious");
@@ -205,12 +210,12 @@ private void OnMovePrevious(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonCheckBox.RibbonContainer)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonCheckBox.RibbonContainer)[@"Items"];
RaiseComponentChanging(propertyItems);
// Move position of the triple
- var index = items.IndexOf(_ribbonCheckBox) - 1;
+ var index = items!.IndexOf(_ribbonCheckBox) - 1;
index = Math.Max(index, 0);
items.Remove(_ribbonCheckBox);
items.Insert(index, _ribbonCheckBox);
@@ -221,17 +226,19 @@ private void OnMovePrevious(object sender, EventArgs e)
finally
{
// If we managed to create the transaction, then do it
- transaction?.Commit();
+ transaction.Commit();
}
}
}
- private void OnMoveNext(object sender, EventArgs e)
+ private void OnMoveNext(object? sender, EventArgs e)
{
- if (_ribbonCheckBox.Ribbon != null)
+ if (_ribbonCheckBox is not null
+ && _ribbonCheckBox.Ribbon is not null
+ && _ribbonCheckBox.RibbonContainer is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupCheckBox MoveNext");
@@ -239,7 +246,7 @@ private void OnMoveNext(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonCheckBox.RibbonContainer)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonCheckBox.RibbonContainer)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -255,17 +262,19 @@ private void OnMoveNext(object sender, EventArgs e)
finally
{
// If we managed to create the transaction, then do it
- transaction?.Commit();
+ transaction.Commit();
}
}
}
- private void OnMoveLast(object sender, EventArgs e)
+ private void OnMoveLast(object? sender, EventArgs e)
{
- if (_ribbonCheckBox.Ribbon != null)
+ if (_ribbonCheckBox is not null
+ && _ribbonCheckBox.Ribbon is not null
+ && _ribbonCheckBox.RibbonContainer is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupCheckBox MoveLast");
@@ -273,7 +282,7 @@ private void OnMoveLast(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonCheckBox.RibbonContainer)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonCheckBox.RibbonContainer)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -287,17 +296,19 @@ private void OnMoveLast(object sender, EventArgs e)
finally
{
// If we managed to create the transaction, then do it
- transaction?.Commit();
+ transaction.Commit();
}
}
}
- private void OnDeleteCheckBox(object sender, EventArgs e)
+ private void OnDeleteCheckBox(object? sender, EventArgs e)
{
- if (_ribbonCheckBox.Ribbon != null)
+ if (_ribbonCheckBox is not null
+ && _ribbonCheckBox.Ribbon is not null
+ && _ribbonCheckBox.RibbonContainer is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupCheckBox DeleteCheckBox");
@@ -305,7 +316,7 @@ private void OnDeleteCheckBox(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonCheckBox.RibbonContainer)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonCheckBox.RibbonContainer)[@"Items"];
// Remove the ribbon group from the ribbon tab
RaiseComponentChanging(null);
@@ -323,61 +334,62 @@ private void OnDeleteCheckBox(object sender, EventArgs e)
finally
{
// If we managed to create the transaction, then do it
- transaction?.Commit();
+ transaction.Commit();
}
}
}
- private void OnVisible(object sender, EventArgs e)
+ private void OnVisible(object? sender, EventArgs e)
{
- if (_ribbonCheckBox.Ribbon != null)
+ if (_ribbonCheckBox is not null && _ribbonCheckBox.Ribbon is not null)
+
{
_changeService.OnComponentChanged(_ribbonCheckBox, null, _ribbonCheckBox.Visible, !_ribbonCheckBox.Visible);
_ribbonCheckBox.Visible = !_ribbonCheckBox.Visible;
}
}
- private void OnEnabled(object sender, EventArgs e)
+ private void OnEnabled(object? sender, EventArgs e)
{
- if (_ribbonCheckBox.Ribbon != null)
+ if (_ribbonCheckBox is not null && _ribbonCheckBox.Ribbon is not null)
{
_changeService.OnComponentChanged(_ribbonCheckBox, null, _ribbonCheckBox.Enabled, !_ribbonCheckBox.Enabled);
_ribbonCheckBox.Enabled = !_ribbonCheckBox.Enabled;
}
}
- private void OnAutoCheck(object sender, EventArgs e)
+ private void OnAutoCheck(object? sender, EventArgs e)
{
- if (_ribbonCheckBox.Ribbon != null)
+ if (_ribbonCheckBox is not null && _ribbonCheckBox.Ribbon is not null)
{
_changeService.OnComponentChanged(_ribbonCheckBox, null, _ribbonCheckBox.AutoCheck, !_ribbonCheckBox.AutoCheck);
_ribbonCheckBox.AutoCheck = !_ribbonCheckBox.AutoCheck;
}
}
- private void OnThreeState(object sender, EventArgs e)
+ private void OnThreeState(object? sender, EventArgs e)
{
- if (_ribbonCheckBox.Ribbon != null)
+ if (_ribbonCheckBox is not null && _ribbonCheckBox.Ribbon is not null)
{
_changeService.OnComponentChanged(_ribbonCheckBox, null, _ribbonCheckBox.ThreeState, !_ribbonCheckBox.ThreeState);
_ribbonCheckBox.ThreeState = !_ribbonCheckBox.ThreeState;
}
}
- private void OnChecked(object sender, EventArgs e)
+ private void OnChecked(object? sender, EventArgs e)
{
- if (_ribbonCheckBox.Ribbon != null)
+ if (_ribbonCheckBox is not null && _ribbonCheckBox.Ribbon is not null)
{
_changeService.OnComponentChanged(_ribbonCheckBox, null, _ribbonCheckBox.Checked, !_ribbonCheckBox.Checked);
_ribbonCheckBox.Checked = !_ribbonCheckBox.Checked;
}
}
- private void OnComponentChanged(object sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
+ private void OnComponentChanged(object? sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
- private void OnContextMenu(object sender, MouseEventArgs e)
+ private void OnContextMenu(object? sender, MouseEventArgs e)
{
- if (_ribbonCheckBox.Ribbon != null)
+ if (_ribbonCheckBox!.Ribbon != null)
{
// Create the menu strip the first time around
if (_cms == null)
@@ -428,7 +440,7 @@ private TypedRestrictCollection? ParentItems
{
get
{
- switch (_ribbonCheckBox.RibbonContainer)
+ switch (_ribbonCheckBox!.RibbonContainer)
{
case KryptonRibbonGroupTriple triple:
return triple.Items;
@@ -437,6 +449,7 @@ private TypedRestrictCollection? ParentItems
default:
// Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(_ribbonCheckBox.RibbonContainer!.ToString());
return null;
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupClusterButtonDesigner.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupClusterButtonDesigner.cs
index 1c40fe46d..8fe702afb 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupClusterButtonDesigner.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupClusterButtonDesigner.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -19,7 +19,7 @@ internal class KryptonRibbonGroupClusterButtonDesigner : ComponentDesigner
#region Instance Fields
private IDesignerHost _designerHost;
private IComponentChangeService _changeService;
- private KryptonRibbonGroupClusterButton _ribbonButton;
+ private KryptonRibbonGroupClusterButton? _ribbonButton;
private DesignerVerbCollection _verbs;
private DesignerVerb _toggleHelpersVerb;
private DesignerVerb _moveFirstVerb;
@@ -73,8 +73,8 @@ public override void Initialize([DisallowNull] IComponent component)
}
// Get access to the services
- _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
- _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
+ _designerHost = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_designerHost)));
+ _changeService = (IComponentChangeService?)GetService(typeof(IComponentChangeService)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_changeService)));
// We need to know when we are being removed/changed
_changeService.ComponentChanged += OnComponentChanged;
@@ -105,7 +105,7 @@ protected override void Dispose(bool disposing)
if (disposing)
{
// Unhook from events
- _ribbonButton.DesignTimeContextMenu -= OnContextMenu;
+ _ribbonButton!.DesignTimeContextMenu -= OnContextMenu;
_changeService.ComponentChanged -= OnComponentChanged;
}
}
@@ -123,7 +123,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
- _verbs = new DesignerVerbCollection();
+ _verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move Cluster Button First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move Cluster Button Previous", OnMovePrevious);
@@ -139,12 +139,12 @@ private void UpdateVerbStatus()
var moveNext = false;
var moveLast = false;
- if (_ribbonButton.Ribbon != null)
+ if (_ribbonButton?.Ribbon != null)
{
// Cast container to the correct type
- var cluster = (KryptonRibbonGroupCluster)_ribbonButton.RibbonContainer;
+ var cluster = _ribbonButton.RibbonContainer as KryptonRibbonGroupCluster;
- moveFirst = cluster.Items.IndexOf(_ribbonButton) > 0;
+ moveFirst = cluster!.Items.IndexOf(_ribbonButton) > 0;
movePrev = cluster.Items.IndexOf(_ribbonButton) > 0;
moveNext = cluster.Items.IndexOf(_ribbonButton) < (cluster.Items.Count - 1);
moveLast = cluster.Items.IndexOf(_ribbonButton) < (cluster.Items.Count - 1);
@@ -156,21 +156,21 @@ private void UpdateVerbStatus()
_moveLastVerb.Enabled = moveLast;
}
- private void OnToggleHelpers(object sender, EventArgs e)
+ private void OnToggleHelpers(object? sender, EventArgs e)
{
// Invert the current toggle helper mode
- if (_ribbonButton.Ribbon != null)
+ if (_ribbonButton?.Ribbon != null)
{
_ribbonButton.Ribbon.InDesignHelperMode = !_ribbonButton.Ribbon.InDesignHelperMode;
}
}
- private void OnMoveFirst(object sender, EventArgs e)
+ private void OnMoveFirst(object? sender, EventArgs e)
{
- if (_ribbonButton.Ribbon != null)
+ if (_ribbonButton?.Ribbon != null)
{
// Cast container to the correct type
- var cluster = (KryptonRibbonGroupCluster)_ribbonButton.RibbonContainer;
+ var cluster = _ribbonButton.RibbonContainer as KryptonRibbonGroupCluster;
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupClusterButton MoveFirst");
@@ -178,13 +178,13 @@ private void OnMoveFirst(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(cluster)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(cluster!)[@"Items"];
RaiseComponentChanging(propertyItems);
// Move position of the button
- cluster.Items.Remove(_ribbonButton);
- cluster.Items.Insert(0, _ribbonButton);
+ cluster?.Items.Remove(_ribbonButton);
+ cluster?.Items.Insert(0, _ribbonButton);
UpdateVerbStatus();
RaiseComponentChanged(propertyItems, null, null);
@@ -197,12 +197,12 @@ private void OnMoveFirst(object sender, EventArgs e)
}
}
- private void OnMovePrevious(object sender, EventArgs e)
+ private void OnMovePrevious(object? sender, EventArgs e)
{
- if (_ribbonButton.Ribbon != null)
+ if (_ribbonButton?.Ribbon != null)
{
// Cast container to the correct type
- var cluster = (KryptonRibbonGroupCluster)_ribbonButton.RibbonContainer;
+ var cluster = _ribbonButton.RibbonContainer as KryptonRibbonGroupCluster;
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupClusterButton MovePrevious");
@@ -210,15 +210,15 @@ private void OnMovePrevious(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(cluster)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(cluster!)[@"Items"];
RaiseComponentChanging(propertyItems);
// Move position of the triple
- var index = cluster.Items.IndexOf(_ribbonButton) - 1;
+ var index = cluster!.Items.IndexOf(_ribbonButton) - 1;
index = Math.Max(index, 0);
- cluster.Items.Remove(_ribbonButton);
- cluster.Items.Insert(index, _ribbonButton);
+ cluster?.Items.Remove(_ribbonButton);
+ cluster?.Items.Insert(index, _ribbonButton);
UpdateVerbStatus();
RaiseComponentChanged(propertyItems, null, null);
@@ -231,12 +231,12 @@ private void OnMovePrevious(object sender, EventArgs e)
}
}
- private void OnMoveNext(object sender, EventArgs e)
+ private void OnMoveNext(object? sender, EventArgs e)
{
- if (_ribbonButton.Ribbon != null)
+ if (_ribbonButton?.Ribbon != null)
{
// Cast container to the correct type
- var cluster = (KryptonRibbonGroupCluster)_ribbonButton.RibbonContainer;
+ var cluster = _ribbonButton.RibbonContainer as KryptonRibbonGroupCluster;
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupClusterButton MoveNext");
@@ -244,15 +244,15 @@ private void OnMoveNext(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(cluster)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(cluster!)[@"Items"];
RaiseComponentChanging(propertyItems);
// Move position of the triple
- var index = cluster.Items.IndexOf(_ribbonButton) + 1;
+ var index = cluster!.Items.IndexOf(_ribbonButton) + 1;
index = Math.Min(index, cluster.Items.Count - 1);
- cluster.Items.Remove(_ribbonButton);
- cluster.Items.Insert(index, _ribbonButton);
+ cluster?.Items.Remove(_ribbonButton);
+ cluster?.Items.Insert(index, _ribbonButton);
UpdateVerbStatus();
RaiseComponentChanged(propertyItems, null, null);
@@ -265,12 +265,12 @@ private void OnMoveNext(object sender, EventArgs e)
}
}
- private void OnMoveLast(object sender, EventArgs e)
+ private void OnMoveLast(object? sender, EventArgs e)
{
- if (_ribbonButton.Ribbon != null)
+ if (_ribbonButton?.Ribbon != null)
{
// Cast container to the correct type
- var cluster = (KryptonRibbonGroupCluster)_ribbonButton.RibbonContainer;
+ var cluster = _ribbonButton.RibbonContainer as KryptonRibbonGroupCluster;
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupClusterButton MoveLast");
@@ -278,13 +278,13 @@ private void OnMoveLast(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(cluster)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(cluster!)[@"Items"];
RaiseComponentChanging(propertyItems);
// Move position of the triple
- cluster.Items.Remove(_ribbonButton);
- cluster.Items.Insert(cluster.Items.Count, _ribbonButton);
+ cluster?.Items.Remove(_ribbonButton);
+ cluster?.Items.Insert(cluster.Items.Count, _ribbonButton);
UpdateVerbStatus();
RaiseComponentChanged(propertyItems, null, null);
@@ -297,12 +297,12 @@ private void OnMoveLast(object sender, EventArgs e)
}
}
- private void OnDeleteButton(object sender, EventArgs e)
+ private void OnDeleteButton(object? sender, EventArgs e)
{
- if (_ribbonButton.Ribbon != null)
+ if (_ribbonButton?.Ribbon != null)
{
// Cast container to the correct type
- var cluster = (KryptonRibbonGroupCluster)_ribbonButton.RibbonContainer;
+ var cluster = _ribbonButton.RibbonContainer as KryptonRibbonGroupCluster;
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupClusterButton DeleteButton");
@@ -310,14 +310,14 @@ private void OnDeleteButton(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(cluster)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(cluster!)[@"Items"];
// Remove the ribbon group from the ribbon tab
RaiseComponentChanging(null);
RaiseComponentChanging(propertyItems);
// Remove the button from the group
- cluster.Items.Remove(_ribbonButton);
+ cluster?.Items.Remove(_ribbonButton);
// Get designer to destroy it
_designerHost.DestroyComponent(_ribbonButton);
@@ -333,74 +333,74 @@ private void OnDeleteButton(object sender, EventArgs e)
}
}
- private void OnVisible(object sender, EventArgs e)
+ private void OnVisible(object? sender, EventArgs e)
{
- if (_ribbonButton.Ribbon != null)
+ if (_ribbonButton?.Ribbon != null)
{
_changeService.OnComponentChanged(_ribbonButton, null, _ribbonButton.Visible, !_ribbonButton.Visible);
_ribbonButton.Visible = !_ribbonButton.Visible;
}
}
- private void OnEnabled(object sender, EventArgs e)
+ private void OnEnabled(object? sender, EventArgs e)
{
- if (_ribbonButton.Ribbon != null)
+ if (_ribbonButton?.Ribbon != null)
{
_changeService.OnComponentChanged(_ribbonButton, null, _ribbonButton.Enabled, !_ribbonButton.Enabled);
_ribbonButton.Enabled = !_ribbonButton.Enabled;
}
}
- private void OnChecked(object sender, EventArgs e)
+ private void OnChecked(object? sender, EventArgs e)
{
- if (_ribbonButton.Ribbon != null)
+ if (_ribbonButton?.Ribbon != null)
{
_changeService.OnComponentChanged(_ribbonButton, null, _ribbonButton.Checked, !_ribbonButton.Checked);
_ribbonButton.Checked = !_ribbonButton.Checked;
}
}
- private void OnTypePush(object sender, EventArgs e)
+ private void OnTypePush(object? sender, EventArgs e)
{
- if (_ribbonButton.Ribbon != null)
+ if (_ribbonButton?.Ribbon != null)
{
_changeService.OnComponentChanged(_ribbonButton, null, _ribbonButton.ButtonType, GroupButtonType.Push);
_ribbonButton.ButtonType = GroupButtonType.Push;
}
}
- private void OnTypeCheck(object sender, EventArgs e)
+ private void OnTypeCheck(object? sender, EventArgs e)
{
- if (_ribbonButton.Ribbon != null)
+ if (_ribbonButton?.Ribbon != null)
{
_changeService.OnComponentChanged(_ribbonButton, null, _ribbonButton.ButtonType, GroupButtonType.Check);
_ribbonButton.ButtonType = GroupButtonType.Check;
}
}
- private void OnTypeDropDown(object sender, EventArgs e)
+ private void OnTypeDropDown(object? sender, EventArgs e)
{
- if (_ribbonButton.Ribbon != null)
+ if (_ribbonButton?.Ribbon != null)
{
_changeService.OnComponentChanged(_ribbonButton, null, _ribbonButton.ButtonType, GroupButtonType.DropDown);
_ribbonButton.ButtonType = GroupButtonType.DropDown;
}
}
- private void OnTypeSplit(object sender, EventArgs e)
+ private void OnTypeSplit(object? sender, EventArgs e)
{
- if (_ribbonButton.Ribbon != null)
+ if (_ribbonButton?.Ribbon != null)
{
_changeService.OnComponentChanged(_ribbonButton, null, _ribbonButton.ButtonType, GroupButtonType.Split);
_ribbonButton.ButtonType = GroupButtonType.Split;
}
}
- private void OnComponentChanged(object sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
+ private void OnComponentChanged(object? sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
- private void OnContextMenu(object sender, MouseEventArgs e)
+ private void OnContextMenu(object? sender, MouseEventArgs e)
{
- if (_ribbonButton.Ribbon != null)
+ if (_ribbonButton?.Ribbon != null)
{
// Create the menu strip the first time around
if (_cms == null)
@@ -430,7 +430,7 @@ private void OnContextMenu(object sender, MouseEventArgs e)
// Update verbs to work out correct enable states
UpdateVerbStatus();
- // Update menu items state from versb
+ // Update menu items state from verbs
_toggleHelpersMenu.Checked = _ribbonButton.Ribbon.InDesignHelperMode;
_visibleMenu.Checked = _ribbonButton.Visible;
_enabledMenu.Checked = _ribbonButton.Enabled;
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupClusterColorButtonDesigner.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupClusterColorButtonDesigner.cs
index e868166dd..d753ae62d 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupClusterColorButtonDesigner.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupClusterColorButtonDesigner.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -19,7 +19,7 @@ internal class KryptonRibbonGroupClusterColorButtonDesigner : ComponentDesigner
#region Instance Fields
private IDesignerHost _designerHost;
private IComponentChangeService _changeService;
- private KryptonRibbonGroupClusterColorButton _ribbonColorButton;
+ private KryptonRibbonGroupClusterColorButton? _ribbonColorButton;
private DesignerVerbCollection _verbs;
private DesignerVerb _toggleHelpersVerb;
private DesignerVerb _moveFirstVerb;
@@ -73,8 +73,8 @@ public override void Initialize([DisallowNull] IComponent component)
}
// Get access to the services
- _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
- _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
+ _designerHost = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_designerHost)));
+ _changeService = (IComponentChangeService?)GetService(typeof(IComponentChangeService)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_changeService)));
// We need to know when we are being removed/changed
_changeService.ComponentChanged += OnComponentChanged;
@@ -105,7 +105,7 @@ protected override void Dispose(bool disposing)
if (disposing)
{
// Unhook from events
- _ribbonColorButton.DesignTimeContextMenu -= OnContextMenu;
+ _ribbonColorButton!.DesignTimeContextMenu -= OnContextMenu;
_changeService.ComponentChanged -= OnComponentChanged;
}
}
@@ -123,7 +123,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
- _verbs = new DesignerVerbCollection();
+ _verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move Cluster Color Button First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move Cluster Color Button Previous", OnMovePrevious);
@@ -139,12 +139,12 @@ private void UpdateVerbStatus()
var moveNext = false;
var moveLast = false;
- if (_ribbonColorButton.Ribbon != null)
+ if (_ribbonColorButton!.Ribbon != null)
{
// Cast container to the correct type
- var cluster = (KryptonRibbonGroupCluster)_ribbonColorButton.RibbonContainer;
+ var cluster = _ribbonColorButton.RibbonContainer as KryptonRibbonGroupCluster;
- moveFirst = cluster.Items.IndexOf(_ribbonColorButton) > 0;
+ moveFirst = cluster!.Items.IndexOf(_ribbonColorButton) > 0;
movePrev = cluster.Items.IndexOf(_ribbonColorButton) > 0;
moveNext = cluster.Items.IndexOf(_ribbonColorButton) < (cluster.Items.Count - 1);
moveLast = cluster.Items.IndexOf(_ribbonColorButton) < (cluster.Items.Count - 1);
@@ -156,21 +156,21 @@ private void UpdateVerbStatus()
_moveLastVerb.Enabled = moveLast;
}
- private void OnToggleHelpers(object sender, EventArgs e)
+ private void OnToggleHelpers(object? sender, EventArgs e)
{
// Invert the current toggle helper mode
- if (_ribbonColorButton.Ribbon != null)
+ if (_ribbonColorButton!.Ribbon != null)
{
_ribbonColorButton.Ribbon.InDesignHelperMode = !_ribbonColorButton.Ribbon.InDesignHelperMode;
}
}
- private void OnMoveFirst(object sender, EventArgs e)
+ private void OnMoveFirst(object? sender, EventArgs e)
{
- if (_ribbonColorButton.Ribbon != null)
+ if (_ribbonColorButton!.Ribbon != null)
{
// Cast container to the correct type
- var cluster = (KryptonRibbonGroupCluster)_ribbonColorButton.RibbonContainer;
+ var cluster = _ribbonColorButton.RibbonContainer as KryptonRibbonGroupCluster;
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupColorClusterButton MoveFirst");
@@ -178,13 +178,13 @@ private void OnMoveFirst(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(cluster)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(cluster!)[@"Items"];
RaiseComponentChanging(propertyItems);
// Move position of the button
- cluster.Items.Remove(_ribbonColorButton);
- cluster.Items.Insert(0, _ribbonColorButton);
+ cluster?.Items.Remove(_ribbonColorButton);
+ cluster?.Items.Insert(0, _ribbonColorButton);
UpdateVerbStatus();
RaiseComponentChanged(propertyItems, null, null);
@@ -197,12 +197,12 @@ private void OnMoveFirst(object sender, EventArgs e)
}
}
- private void OnMovePrevious(object sender, EventArgs e)
+ private void OnMovePrevious(object? sender, EventArgs e)
{
- if (_ribbonColorButton.Ribbon != null)
+ if (_ribbonColorButton!.Ribbon != null)
{
// Cast container to the correct type
- var cluster = (KryptonRibbonGroupCluster)_ribbonColorButton.RibbonContainer;
+ var cluster = _ribbonColorButton.RibbonContainer as KryptonRibbonGroupCluster;
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupColorClusterButton MovePrevious");
@@ -210,12 +210,12 @@ private void OnMovePrevious(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(cluster)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(cluster!)[@"Items"];
RaiseComponentChanging(propertyItems);
// Move position of the triple
- var index = cluster.Items.IndexOf(_ribbonColorButton) - 1;
+ var index = cluster!.Items.IndexOf(_ribbonColorButton) - 1;
index = Math.Max(index, 0);
cluster.Items.Remove(_ribbonColorButton);
cluster.Items.Insert(index, _ribbonColorButton);
@@ -231,12 +231,12 @@ private void OnMovePrevious(object sender, EventArgs e)
}
}
- private void OnMoveNext(object sender, EventArgs e)
+ private void OnMoveNext(object? sender, EventArgs e)
{
- if (_ribbonColorButton.Ribbon != null)
+ if (_ribbonColorButton!.Ribbon != null)
{
// Cast container to the correct type
- var cluster = (KryptonRibbonGroupCluster)_ribbonColorButton.RibbonContainer;
+ var cluster = _ribbonColorButton.RibbonContainer as KryptonRibbonGroupCluster;
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupColorClusterButton MoveNext");
@@ -244,15 +244,15 @@ private void OnMoveNext(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(cluster)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(cluster!)[@"Items"];
RaiseComponentChanging(propertyItems);
// Move position of the triple
- var index = cluster.Items.IndexOf(_ribbonColorButton) + 1;
+ var index = cluster!.Items.IndexOf(_ribbonColorButton) + 1;
index = Math.Min(index, cluster.Items.Count - 1);
- cluster.Items.Remove(_ribbonColorButton);
- cluster.Items.Insert(index, _ribbonColorButton);
+ cluster?.Items.Remove(_ribbonColorButton);
+ cluster?.Items.Insert(index, _ribbonColorButton);
UpdateVerbStatus();
RaiseComponentChanged(propertyItems, null, null);
@@ -265,12 +265,12 @@ private void OnMoveNext(object sender, EventArgs e)
}
}
- private void OnMoveLast(object sender, EventArgs e)
+ private void OnMoveLast(object? sender, EventArgs e)
{
- if (_ribbonColorButton.Ribbon != null)
+ if (_ribbonColorButton!.Ribbon != null)
{
// Cast container to the correct type
- var cluster = (KryptonRibbonGroupCluster)_ribbonColorButton.RibbonContainer;
+ var cluster = _ribbonColorButton.RibbonContainer as KryptonRibbonGroupCluster;
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupColorClusterButton MoveLast");
@@ -278,13 +278,13 @@ private void OnMoveLast(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(cluster)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(cluster!)[@"Items"];
RaiseComponentChanging(propertyItems);
// Move position of the triple
- cluster.Items.Remove(_ribbonColorButton);
- cluster.Items.Insert(cluster.Items.Count, _ribbonColorButton);
+ cluster?.Items.Remove(_ribbonColorButton);
+ cluster?.Items.Insert(cluster.Items.Count, _ribbonColorButton);
UpdateVerbStatus();
RaiseComponentChanged(propertyItems, null, null);
@@ -297,12 +297,12 @@ private void OnMoveLast(object sender, EventArgs e)
}
}
- private void OnDeleteButton(object sender, EventArgs e)
+ private void OnDeleteButton(object? sender, EventArgs e)
{
- if (_ribbonColorButton.Ribbon != null)
+ if (_ribbonColorButton!.Ribbon != null)
{
// Cast container to the correct type
- var cluster = (KryptonRibbonGroupCluster)_ribbonColorButton.RibbonContainer;
+ var cluster = _ribbonColorButton.RibbonContainer as KryptonRibbonGroupCluster;
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupColorClusterButton DeleteButton");
@@ -310,14 +310,14 @@ private void OnDeleteButton(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(cluster)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(cluster!)[@"Items"];
// Remove the ribbon group from the ribbon tab
RaiseComponentChanging(null);
RaiseComponentChanging(propertyItems);
// Remove the button from the group
- cluster.Items.Remove(_ribbonColorButton);
+ cluster?.Items.Remove(_ribbonColorButton);
// Get designer to destroy it
_designerHost.DestroyComponent(_ribbonColorButton);
@@ -333,74 +333,74 @@ private void OnDeleteButton(object sender, EventArgs e)
}
}
- private void OnVisible(object sender, EventArgs e)
+ private void OnVisible(object? sender, EventArgs e)
{
- if (_ribbonColorButton.Ribbon != null)
+ if (_ribbonColorButton!.Ribbon != null)
{
_changeService.OnComponentChanged(_ribbonColorButton, null, _ribbonColorButton.Visible, !_ribbonColorButton.Visible);
_ribbonColorButton.Visible = !_ribbonColorButton.Visible;
}
}
- private void OnEnabled(object sender, EventArgs e)
+ private void OnEnabled(object? sender, EventArgs e)
{
- if (_ribbonColorButton.Ribbon != null)
+ if (_ribbonColorButton!.Ribbon != null)
{
_changeService.OnComponentChanged(_ribbonColorButton, null, _ribbonColorButton.Enabled, !_ribbonColorButton.Enabled);
_ribbonColorButton.Enabled = !_ribbonColorButton.Enabled;
}
}
- private void OnChecked(object sender, EventArgs e)
+ private void OnChecked(object? sender, EventArgs e)
{
- if (_ribbonColorButton.Ribbon != null)
+ if (_ribbonColorButton!.Ribbon != null)
{
_changeService.OnComponentChanged(_ribbonColorButton, null, _ribbonColorButton.Checked, !_ribbonColorButton.Checked);
_ribbonColorButton.Checked = !_ribbonColorButton.Checked;
}
}
- private void OnTypePush(object sender, EventArgs e)
+ private void OnTypePush(object? sender, EventArgs e)
{
- if (_ribbonColorButton.Ribbon != null)
+ if (_ribbonColorButton!.Ribbon != null)
{
_changeService.OnComponentChanged(_ribbonColorButton, null, _ribbonColorButton.ButtonType, GroupButtonType.Push);
_ribbonColorButton.ButtonType = GroupButtonType.Push;
}
}
- private void OnTypeCheck(object sender, EventArgs e)
+ private void OnTypeCheck(object? sender, EventArgs e)
{
- if (_ribbonColorButton.Ribbon != null)
+ if (_ribbonColorButton!.Ribbon != null)
{
_changeService.OnComponentChanged(_ribbonColorButton, null, _ribbonColorButton.ButtonType, GroupButtonType.Check);
_ribbonColorButton.ButtonType = GroupButtonType.Check;
}
}
- private void OnTypeDropDown(object sender, EventArgs e)
+ private void OnTypeDropDown(object? sender, EventArgs e)
{
- if (_ribbonColorButton.Ribbon != null)
+ if (_ribbonColorButton!.Ribbon != null)
{
_changeService.OnComponentChanged(_ribbonColorButton, null, _ribbonColorButton.ButtonType, GroupButtonType.DropDown);
_ribbonColorButton.ButtonType = GroupButtonType.DropDown;
}
}
- private void OnTypeSplit(object sender, EventArgs e)
+ private void OnTypeSplit(object? sender, EventArgs e)
{
- if (_ribbonColorButton.Ribbon != null)
+ if (_ribbonColorButton!.Ribbon != null)
{
_changeService.OnComponentChanged(_ribbonColorButton, null, _ribbonColorButton.ButtonType, GroupButtonType.Split);
_ribbonColorButton.ButtonType = GroupButtonType.Split;
}
}
- private void OnComponentChanged(object sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
+ private void OnComponentChanged(object? sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
- private void OnContextMenu(object sender, MouseEventArgs e)
+ private void OnContextMenu(object? sender, MouseEventArgs e)
{
- if (_ribbonColorButton.Ribbon != null)
+ if (_ribbonColorButton!.Ribbon != null)
{
// Create the menu strip the first time around
if (_cms == null)
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupClusterDesigner.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupClusterDesigner.cs
index 1986a74f1..7b6ee1e67 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupClusterDesigner.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupClusterDesigner.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -19,7 +19,7 @@ internal class KryptonRibbonGroupClusterDesigner : ComponentDesigner
#region Instance Fields
private IDesignerHost _designerHost;
private IComponentChangeService _changeService;
- private KryptonRibbonGroupCluster _ribbonCluster;
+ private KryptonRibbonGroupCluster? _ribbonCluster;
private DesignerVerbCollection _verbs;
private DesignerVerb _toggleHelpersVerb;
private DesignerVerb _moveFirstVerb;
@@ -74,8 +74,8 @@ public override void Initialize([DisallowNull] IComponent component)
}
// Get access to the services
- _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
- _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
+ _designerHost = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_designerHost)));
+ _changeService = (IComponentChangeService?)GetService(typeof(IComponentChangeService)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_changeService)));
// We need to know when we are being removed/changed
_changeService.ComponentRemoving += OnComponentRemoving;
@@ -90,7 +90,7 @@ public override ICollection AssociatedComponents
get
{
var compound = new ArrayList(base.AssociatedComponents);
- compound.AddRange(_ribbonCluster.Items);
+ compound.AddRange(_ribbonCluster!.Items);
return compound;
}
}
@@ -120,7 +120,7 @@ protected override void Dispose(bool disposing)
if (disposing)
{
// Unhook from events
- _ribbonCluster.DesignTimeAddButton -= OnAddButton;
+ _ribbonCluster!.DesignTimeAddButton -= OnAddButton;
_ribbonCluster.DesignTimeContextMenu -= OnContextMenu;
_changeService.ComponentRemoving -= OnComponentRemoving;
_changeService.ComponentChanged -= OnComponentChanged;
@@ -140,7 +140,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
- _verbs = new DesignerVerbCollection();
+ _verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move Cluster First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move Cluster Previous", OnMovePrevious);
@@ -160,15 +160,15 @@ private void UpdateVerbStatus()
var moveLast = false;
var clearItems = false;
- if (_ribbonCluster.Ribbon != null)
+ if (_ribbonCluster!.Ribbon != null)
{
// Cast container to the correct type
- var lines = (KryptonRibbonGroupLines)_ribbonCluster.RibbonContainer;
+ var lines = _ribbonCluster.RibbonContainer as KryptonRibbonGroupLines;
- moveFirst = lines.Items.IndexOf(_ribbonCluster) > 0;
- movePrev = lines.Items.IndexOf(_ribbonCluster) > 0;
- moveNext = lines.Items.IndexOf(_ribbonCluster) < (lines.Items.Count - 1);
- moveLast = lines.Items.IndexOf(_ribbonCluster) < (lines.Items.Count - 1);
+ moveFirst = lines!.Items!.IndexOf(_ribbonCluster) > 0;
+ movePrev = lines.Items!.IndexOf(_ribbonCluster) > 0;
+ moveNext = lines.Items!.IndexOf(_ribbonCluster) < (lines.Items.Count - 1);
+ moveLast = lines.Items!.IndexOf(_ribbonCluster) < (lines.Items.Count - 1);
clearItems = _ribbonCluster.Items.Count > 0;
}
@@ -179,21 +179,21 @@ private void UpdateVerbStatus()
_clearItemsVerb.Enabled = clearItems;
}
- private void OnToggleHelpers(object sender, EventArgs e)
+ private void OnToggleHelpers(object? sender, EventArgs e)
{
// Invert the current toggle helper mode
- if (_ribbonCluster.Ribbon != null)
+ if (_ribbonCluster!.Ribbon != null)
{
_ribbonCluster.Ribbon.InDesignHelperMode = !_ribbonCluster.Ribbon.InDesignHelperMode;
}
}
- private void OnMoveFirst(object sender, EventArgs e)
+ private void OnMoveFirst(object? sender, EventArgs e)
{
- if (_ribbonCluster.Ribbon != null)
+ if (_ribbonCluster!.Ribbon != null)
{
// Cast container to the correct type
- var lines = (KryptonRibbonGroupLines)_ribbonCluster.RibbonContainer;
+ var lines = _ribbonCluster.RibbonContainer as KryptonRibbonGroupLines;
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupCluster MoveFirst");
@@ -201,13 +201,13 @@ private void OnMoveFirst(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(lines)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(lines!)[@"Items"];
RaiseComponentChanging(propertyItems);
// Move position of the cluster
- lines.Items.Remove(_ribbonCluster);
- lines.Items.Insert(0, _ribbonCluster);
+ lines!.Items!.Remove(_ribbonCluster);
+ lines.Items!.Insert(0, _ribbonCluster);
UpdateVerbStatus();
RaiseComponentChanged(propertyItems, null, null);
@@ -220,12 +220,12 @@ private void OnMoveFirst(object sender, EventArgs e)
}
}
- private void OnMovePrevious(object sender, EventArgs e)
+ private void OnMovePrevious(object? sender, EventArgs e)
{
- if (_ribbonCluster.Ribbon != null)
+ if (_ribbonCluster!.Ribbon != null)
{
// Cast container to the correct type
- var lines = (KryptonRibbonGroupLines)_ribbonCluster.RibbonContainer;
+ var lines = _ribbonCluster.RibbonContainer as KryptonRibbonGroupLines;
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupCluster MovePrevious");
@@ -233,15 +233,15 @@ private void OnMovePrevious(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(lines)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(lines!)[@"Items"];
RaiseComponentChanging(propertyItems);
// Move position of the cluster
- var index = lines.Items.IndexOf(_ribbonCluster) - 1;
+ var index = lines!.Items!.IndexOf(_ribbonCluster) - 1;
index = Math.Max(index, 0);
- lines.Items.Remove(_ribbonCluster);
- lines.Items.Insert(index, _ribbonCluster);
+ lines.Items!.Remove(_ribbonCluster);
+ lines.Items!.Insert(index, _ribbonCluster);
UpdateVerbStatus();
RaiseComponentChanged(propertyItems, null, null);
@@ -254,12 +254,12 @@ private void OnMovePrevious(object sender, EventArgs e)
}
}
- private void OnMoveNext(object sender, EventArgs e)
+ private void OnMoveNext(object? sender, EventArgs e)
{
- if (_ribbonCluster.Ribbon != null)
+ if (_ribbonCluster!.Ribbon != null)
{
// Cast container to the correct type
- var lines = (KryptonRibbonGroupLines)_ribbonCluster.RibbonContainer;
+ var lines = _ribbonCluster.RibbonContainer as KryptonRibbonGroupLines;
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupCluster MoveNext");
@@ -267,15 +267,15 @@ private void OnMoveNext(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(lines)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(lines!)[@"Items"];
RaiseComponentChanging(propertyItems);
// Move position of the cluster
- var index = lines.Items.IndexOf(_ribbonCluster) + 1;
+ var index = lines!.Items!.IndexOf(_ribbonCluster) + 1;
index = Math.Min(index, lines.Items.Count - 1);
- lines.Items.Remove(_ribbonCluster);
- lines.Items.Insert(index, _ribbonCluster);
+ lines.Items!.Remove(_ribbonCluster);
+ lines.Items!.Insert(index, _ribbonCluster);
UpdateVerbStatus();
RaiseComponentChanged(propertyItems, null, null);
@@ -288,12 +288,12 @@ private void OnMoveNext(object sender, EventArgs e)
}
}
- private void OnMoveLast(object sender, EventArgs e)
+ private void OnMoveLast(object? sender, EventArgs e)
{
- if (_ribbonCluster.Ribbon != null)
+ if (_ribbonCluster!.Ribbon != null)
{
// Cast container to the correct type
- var lines = (KryptonRibbonGroupLines)_ribbonCluster.RibbonContainer;
+ var lines = _ribbonCluster.RibbonContainer as KryptonRibbonGroupLines;
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupCluster MoveLast");
@@ -301,13 +301,13 @@ private void OnMoveLast(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(lines)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(lines!)[@"Items"];
RaiseComponentChanging(propertyItems);
// Move position of the cluster
- lines.Items.Remove(_ribbonCluster);
- lines.Items.Insert(lines.Items.Count, _ribbonCluster);
+ lines!.Items!.Remove(_ribbonCluster);
+ lines.Items!.Insert(lines.Items!.Count, _ribbonCluster);
UpdateVerbStatus();
RaiseComponentChanged(propertyItems, null, null);
@@ -320,9 +320,9 @@ private void OnMoveLast(object sender, EventArgs e)
}
}
- private void OnAddButton(object sender, EventArgs e)
+ private void OnAddButton(object? sender, EventArgs e)
{
- if (_ribbonCluster.Ribbon != null)
+ if (_ribbonCluster!.Ribbon != null)
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupCluster AddButton");
@@ -330,7 +330,7 @@ private void OnAddButton(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonCluster)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonCluster)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -348,9 +348,9 @@ private void OnAddButton(object sender, EventArgs e)
}
}
- private void OnAddColorButton(object sender, EventArgs e)
+ private void OnAddColorButton(object? sender, EventArgs e)
{
- if (_ribbonCluster.Ribbon != null)
+ if (_ribbonCluster!.Ribbon != null)
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupCluster AddColorButton");
@@ -358,7 +358,7 @@ private void OnAddColorButton(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonCluster)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonCluster)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -376,9 +376,9 @@ private void OnAddColorButton(object sender, EventArgs e)
}
}
- private void OnClearItems(object sender, EventArgs e)
+ private void OnClearItems(object? sender, EventArgs e)
{
- if (_ribbonCluster.Ribbon != null)
+ if (_ribbonCluster!.Ribbon != null)
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupCluster ClearItems");
@@ -386,12 +386,12 @@ private void OnClearItems(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonCluster)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonCluster)[@"Items"];
RaiseComponentChanging(propertyItems);
// Need access to host in order to delete a component
- var host = (IDesignerHost)GetService(typeof(IDesignerHost));
+ var host = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("host"));
// We need to remove all the buttons from the cluster group
for (var i = _ribbonCluster.Items.Count - 1; i >= 0; i--)
@@ -411,12 +411,12 @@ private void OnClearItems(object sender, EventArgs e)
}
}
- private void OnDeleteCluster(object sender, EventArgs e)
+ private void OnDeleteCluster(object? sender, EventArgs e)
{
- if (_ribbonCluster.Ribbon != null)
+ if (_ribbonCluster!.Ribbon != null)
{
// Cast container to the correct type
- var lines = (KryptonRibbonGroupLines)_ribbonCluster.RibbonContainer;
+ var lines = _ribbonCluster.RibbonContainer as KryptonRibbonGroupLines;
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupTriple DeleteTriple");
@@ -424,14 +424,14 @@ private void OnDeleteCluster(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(lines)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(lines!)[@"Items"];
// Remove the ribbon group from the ribbon tab
RaiseComponentChanging(null);
RaiseComponentChanging(propertyItems);
// Remove the cluster from the lines
- lines.Items.Remove(_ribbonCluster);
+ lines!.Items!.Remove(_ribbonCluster);
// Get designer to destroy it
_designerHost.DestroyComponent(_ribbonCluster);
@@ -447,47 +447,47 @@ private void OnDeleteCluster(object sender, EventArgs e)
}
}
- private void OnVisible(object sender, EventArgs e)
+ private void OnVisible(object? sender, EventArgs e)
{
- if (_ribbonCluster.Ribbon != null)
+ if (_ribbonCluster!.Ribbon != null)
{
_changeService.OnComponentChanged(_ribbonCluster, null, _ribbonCluster.Visible, !_ribbonCluster.Visible);
_ribbonCluster.Visible = !_ribbonCluster.Visible;
}
}
- private void OnComponentChanged(object sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
+ private void OnComponentChanged(object? sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
- private void OnComponentRemoving(object sender, ComponentEventArgs e)
+ private void OnComponentRemoving(object? sender, ComponentEventArgs e)
{
// If our cluster is being removed
if (e.Component == _ribbonCluster)
{
// Need access to host in order to delete a component
- var host = (IDesignerHost)GetService(typeof(IDesignerHost));
+ var host = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("host"));
// We need to remove all items from the cluster
- for (var j = _ribbonCluster.Items.Count - 1; j >= 0; j--)
+ for (var j = _ribbonCluster!.Items.Count - 1; j >= 0; j--)
{
if (_ribbonCluster.Items[j] is IRibbonGroupItem item)
{
_ribbonCluster.Items.Remove(item);
- host.DestroyComponent(item as Component);
+ host.DestroyComponent((item as Component)!);
}
else
{
var container = _ribbonCluster.Items[j] as IRibbonGroupContainer;
- _ribbonCluster.Items.Remove(container);
- host.DestroyComponent(container as Component);
+ _ribbonCluster.Items.Remove(container!);
+ host.DestroyComponent((container as Component)!);
}
}
}
}
- private void OnContextMenu(object sender, MouseEventArgs e)
+ private void OnContextMenu(object? sender, MouseEventArgs e)
{
- if (_ribbonCluster.Ribbon != null)
+ if (_ribbonCluster!.Ribbon != null)
{
// Create the menu strip the first time around
if (_cms == null)
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupColorButtonDesigner.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupColorButtonDesigner.cs
index 82bc2a062..2399d76f3 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupColorButtonDesigner.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupColorButtonDesigner.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -19,7 +19,7 @@ internal class KryptonRibbonGroupColorButtonDesigner : ComponentDesigner
#region Instance Fields
private IDesignerHost _designerHost;
private IComponentChangeService _changeService;
- private KryptonRibbonGroupColorButton _ribbonColorButton;
+ private KryptonRibbonGroupColorButton? _ribbonColorButton;
private DesignerVerbCollection _verbs;
private DesignerVerb _toggleHelpersVerb;
private DesignerVerb _moveFirstVerb;
@@ -73,8 +73,8 @@ public override void Initialize([DisallowNull] IComponent component)
}
// Get access to the services
- _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
- _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
+ _designerHost = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_designerHost)));
+ _changeService = (IComponentChangeService?)GetService(typeof(IComponentChangeService)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_changeService)));
// We need to know when we are being removed/changed
_changeService.ComponentChanged += OnComponentChanged;
@@ -105,7 +105,7 @@ protected override void Dispose(bool disposing)
if (disposing)
{
// Unhook from events
- _ribbonColorButton.DesignTimeContextMenu -= OnContextMenu;
+ _ribbonColorButton!.DesignTimeContextMenu -= OnContextMenu;
_changeService.ComponentChanged -= OnComponentChanged;
}
}
@@ -123,7 +123,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
- _verbs = new DesignerVerbCollection();
+ _verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move Color Button First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move Color Button Previous", OnMovePrevious);
@@ -139,12 +139,12 @@ private void UpdateVerbStatus()
var moveNext = false;
var moveLast = false;
- if (_ribbonColorButton.Ribbon != null)
+ if (_ribbonColorButton?.Ribbon != null)
{
var items = ParentItems;
- moveFirst = items.IndexOf(_ribbonColorButton) > 0;
- movePrev = items.IndexOf(_ribbonColorButton) > 0;
- moveNext = items.IndexOf(_ribbonColorButton) < (items.Count - 1);
+ moveFirst = items?.IndexOf(_ribbonColorButton) > 0;
+ movePrev = items?.IndexOf(_ribbonColorButton) > 0;
+ moveNext = items?.IndexOf(_ribbonColorButton) < (items!.Count - 1);
moveLast = items.IndexOf(_ribbonColorButton) < (items.Count - 1);
}
@@ -154,18 +154,18 @@ private void UpdateVerbStatus()
_moveLastVerb.Enabled = moveLast;
}
- private void OnToggleHelpers(object sender, EventArgs e)
+ private void OnToggleHelpers(object? sender, EventArgs e)
{
// Invert the current toggle helper mode
- if (_ribbonColorButton.Ribbon != null)
+ if (_ribbonColorButton!.Ribbon != null)
{
_ribbonColorButton.Ribbon.InDesignHelperMode = !_ribbonColorButton.Ribbon.InDesignHelperMode;
}
}
- private void OnMoveFirst(object sender, EventArgs e)
+ private void OnMoveFirst(object? sender, EventArgs e)
{
- if (_ribbonColorButton.Ribbon != null)
+ if (_ribbonColorButton!.Ribbon != null)
{
// Get access to the parent collection of items
var items = ParentItems;
@@ -176,13 +176,13 @@ private void OnMoveFirst(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonColorButton.RibbonContainer)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonColorButton.RibbonContainer!)[@"Items"];
RaiseComponentChanging(propertyItems);
// Move position of the button
- items.Remove(_ribbonColorButton);
- items.Insert(0, _ribbonColorButton);
+ items?.Remove(_ribbonColorButton);
+ items?.Insert(0, _ribbonColorButton);
UpdateVerbStatus();
RaiseComponentChanged(propertyItems, null, null);
@@ -195,9 +195,9 @@ private void OnMoveFirst(object sender, EventArgs e)
}
}
- private void OnMovePrevious(object sender, EventArgs e)
+ private void OnMovePrevious(object? sender, EventArgs e)
{
- if (_ribbonColorButton.Ribbon != null)
+ if (_ribbonColorButton!.Ribbon != null)
{
// Get access to the parent collection of items
var items = ParentItems;
@@ -208,12 +208,12 @@ private void OnMovePrevious(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonColorButton.RibbonContainer)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonColorButton.RibbonContainer!)[@"Items"];
RaiseComponentChanging(propertyItems);
// Move position of the triple
- var index = items.IndexOf(_ribbonColorButton) - 1;
+ var index = items!.IndexOf(_ribbonColorButton) - 1;
index = Math.Max(index, 0);
items.Remove(_ribbonColorButton);
items.Insert(index, _ribbonColorButton);
@@ -229,9 +229,9 @@ private void OnMovePrevious(object sender, EventArgs e)
}
}
- private void OnMoveNext(object sender, EventArgs e)
+ private void OnMoveNext(object? sender, EventArgs e)
{
- if (_ribbonColorButton.Ribbon != null)
+ if (_ribbonColorButton!.Ribbon != null)
{
// Get access to the parent collection of items
var items = ParentItems;
@@ -242,12 +242,12 @@ private void OnMoveNext(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonColorButton.RibbonContainer)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonColorButton.RibbonContainer!)[@"Items"];
RaiseComponentChanging(propertyItems);
// Move position of the triple
- var index = items.IndexOf(_ribbonColorButton) + 1;
+ var index = items!.IndexOf(_ribbonColorButton) + 1;
index = Math.Min(index, items.Count - 1);
items.Remove(_ribbonColorButton);
items.Insert(index, _ribbonColorButton);
@@ -263,9 +263,9 @@ private void OnMoveNext(object sender, EventArgs e)
}
}
- private void OnMoveLast(object sender, EventArgs e)
+ private void OnMoveLast(object? sender, EventArgs e)
{
- if (_ribbonColorButton.Ribbon != null)
+ if (_ribbonColorButton!.Ribbon != null)
{
// Get access to the parent collection of items
var items = ParentItems;
@@ -276,13 +276,13 @@ private void OnMoveLast(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonColorButton.RibbonContainer)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonColorButton.RibbonContainer!)[@"Items"];
RaiseComponentChanging(propertyItems);
// Move position of the triple
- items.Remove(_ribbonColorButton);
- items.Insert(items.Count, _ribbonColorButton);
+ items?.Remove(_ribbonColorButton);
+ items?.Insert(items.Count, _ribbonColorButton);
UpdateVerbStatus();
RaiseComponentChanged(propertyItems, null, null);
@@ -295,9 +295,9 @@ private void OnMoveLast(object sender, EventArgs e)
}
}
- private void OnDeleteButton(object sender, EventArgs e)
+ private void OnDeleteButton(object? sender, EventArgs e)
{
- if (_ribbonColorButton.Ribbon != null)
+ if (_ribbonColorButton!.Ribbon != null)
{
// Get access to the parent collection of items
var items = ParentItems;
@@ -308,14 +308,14 @@ private void OnDeleteButton(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonColorButton.RibbonContainer)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonColorButton.RibbonContainer!)[@"Items"];
// Remove the ribbon group from the ribbon tab
RaiseComponentChanging(null);
RaiseComponentChanging(propertyItems);
// Remove the button from the group
- items.Remove(_ribbonColorButton);
+ items?.Remove(_ribbonColorButton);
// Get designer to destroy it
_designerHost.DestroyComponent(_ribbonColorButton);
@@ -331,74 +331,74 @@ private void OnDeleteButton(object sender, EventArgs e)
}
}
- private void OnVisible(object sender, EventArgs e)
+ private void OnVisible(object? sender, EventArgs e)
{
- if (_ribbonColorButton.Ribbon != null)
+ if (_ribbonColorButton!.Ribbon != null)
{
_changeService.OnComponentChanged(_ribbonColorButton, null, _ribbonColorButton.Visible, !_ribbonColorButton.Visible);
_ribbonColorButton.Visible = !_ribbonColorButton.Visible;
}
}
- private void OnEnabled(object sender, EventArgs e)
+ private void OnEnabled(object? sender, EventArgs e)
{
- if (_ribbonColorButton.Ribbon != null)
+ if (_ribbonColorButton!.Ribbon != null)
{
_changeService.OnComponentChanged(_ribbonColorButton, null, _ribbonColorButton.Enabled, !_ribbonColorButton.Enabled);
_ribbonColorButton.Enabled = !_ribbonColorButton.Enabled;
}
}
- private void OnChecked(object sender, EventArgs e)
+ private void OnChecked(object? sender, EventArgs e)
{
- if (_ribbonColorButton.Ribbon != null)
+ if (_ribbonColorButton!.Ribbon != null)
{
_changeService.OnComponentChanged(_ribbonColorButton, null, _ribbonColorButton.Checked, !_ribbonColorButton.Checked);
_ribbonColorButton.Checked = !_ribbonColorButton.Checked;
}
}
- private void OnTypePush(object sender, EventArgs e)
+ private void OnTypePush(object? sender, EventArgs e)
{
- if (_ribbonColorButton.Ribbon != null)
+ if (_ribbonColorButton!.Ribbon != null)
{
_changeService.OnComponentChanged(_ribbonColorButton, null, _ribbonColorButton.ButtonType, GroupButtonType.Push);
_ribbonColorButton.ButtonType = GroupButtonType.Push;
}
}
- private void OnTypeCheck(object sender, EventArgs e)
+ private void OnTypeCheck(object? sender, EventArgs e)
{
- if (_ribbonColorButton.Ribbon != null)
+ if (_ribbonColorButton!.Ribbon != null)
{
_changeService.OnComponentChanged(_ribbonColorButton, null, _ribbonColorButton.ButtonType, GroupButtonType.Check);
_ribbonColorButton.ButtonType = GroupButtonType.Check;
}
}
- private void OnTypeDropDown(object sender, EventArgs e)
+ private void OnTypeDropDown(object? sender, EventArgs e)
{
- if (_ribbonColorButton.Ribbon != null)
+ if (_ribbonColorButton!.Ribbon != null)
{
_changeService.OnComponentChanged(_ribbonColorButton, null, _ribbonColorButton.ButtonType, GroupButtonType.DropDown);
_ribbonColorButton.ButtonType = GroupButtonType.DropDown;
}
}
- private void OnTypeSplit(object sender, EventArgs e)
+ private void OnTypeSplit(object? sender, EventArgs e)
{
- if (_ribbonColorButton.Ribbon != null)
+ if (_ribbonColorButton!.Ribbon != null)
{
_changeService.OnComponentChanged(_ribbonColorButton, null, _ribbonColorButton.ButtonType, GroupButtonType.Split);
_ribbonColorButton.ButtonType = GroupButtonType.Split;
}
}
- private void OnComponentChanged(object sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
+ private void OnComponentChanged(object? sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
- private void OnContextMenu(object sender, MouseEventArgs e)
+ private void OnContextMenu(object? sender, MouseEventArgs e)
{
- if (_ribbonColorButton.Ribbon != null)
+ if (_ribbonColorButton!.Ribbon != null)
{
// Create the menu strip the first time around
if (_cms == null)
@@ -455,7 +455,7 @@ private TypedRestrictCollection? ParentItems
{
get
{
- switch (_ribbonColorButton.RibbonContainer)
+ switch (_ribbonColorButton!.RibbonContainer)
{
case KryptonRibbonGroupTriple triple:
return triple.Items;
@@ -464,6 +464,7 @@ private TypedRestrictCollection? ParentItems
default:
// Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(_ribbonColorButton.RibbonContainer!.ToString());
return null;
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupComboBoxDesigner.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupComboBoxDesigner.cs
index 139cb0d88..724dfb001 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupComboBoxDesigner.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupComboBoxDesigner.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -19,7 +19,7 @@ internal class KryptonRibbonGroupComboBoxDesigner : ComponentDesigner, IKryptonD
#region Instance Fields
private IDesignerHost _designerHost;
private IComponentChangeService _changeService;
- private KryptonRibbonGroupComboBox _ribbonComboBox;
+ private KryptonRibbonGroupComboBox? _ribbonComboBox;
private DesignerVerbCollection _verbs;
private DesignerVerb _toggleHelpersVerb;
private DesignerVerb _moveFirstVerb;
@@ -81,8 +81,8 @@ public override void Initialize([DisallowNull] IComponent component)
}
// Get access to the services
- _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
- _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
+ _designerHost = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_designerHost)));
+ _changeService = (IComponentChangeService?)GetService(typeof(IComponentChangeService)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_changeService)));
// We need to know when we are being removed/changed
_changeService.ComponentChanged += OnComponentChanged;
@@ -131,7 +131,7 @@ protected override void Dispose(bool disposing)
if (disposing)
{
// Unhook from events
- _ribbonComboBox.DesignTimeContextMenu -= OnContextMenu;
+ _ribbonComboBox!.DesignTimeContextMenu -= OnContextMenu;
_changeService.ComponentChanged -= OnComponentChanged;
}
}
@@ -152,13 +152,12 @@ protected override void PreFilterProperties(IDictionary properties)
// Setup the array of properties we override
var attributes = Array.Empty();
- string[] strArray = { nameof(Visible), nameof(Enabled) };
+ string[] strArray = [nameof(Visible), nameof(Enabled)];
// Adjust our list of properties
for (var i = 0; i < strArray.Length; i++)
{
- var descrip = (PropertyDescriptor)properties[strArray[i]];
- if (descrip != null)
+ if (properties[strArray[i]] is PropertyDescriptor descrip)
{
properties[strArray[i]] = TypeDescriptor.CreateProperty(typeof(KryptonRibbonGroupComboBoxDesigner), descrip, attributes);
}
@@ -187,7 +186,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
- _verbs = new DesignerVerbCollection();
+ _verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move ComboBox First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move ComboBox Previous", OnMovePrevious);
@@ -203,13 +202,13 @@ private void UpdateVerbStatus()
var moveNext = false;
var moveLast = false;
- if (_ribbonComboBox.Ribbon != null)
+ if (_ribbonComboBox!.Ribbon != null)
{
var items = ParentItems;
- moveFirst = items.IndexOf(_ribbonComboBox) > 0;
- movePrev = items.IndexOf(_ribbonComboBox) > 0;
- moveNext = items.IndexOf(_ribbonComboBox) < (items.Count - 1);
- moveLast = items.IndexOf(_ribbonComboBox) < (items.Count - 1);
+ moveFirst = items?.IndexOf(_ribbonComboBox) > 0;
+ movePrev = items?.IndexOf(_ribbonComboBox) > 0;
+ moveNext = items?.IndexOf(_ribbonComboBox) < (items?.Count - 1);
+ moveLast = items?.IndexOf(_ribbonComboBox) < (items?.Count - 1);
}
_moveFirstVerb.Enabled = moveFirst;
@@ -218,18 +217,18 @@ private void UpdateVerbStatus()
_moveLastVerb.Enabled = moveLast;
}
- private void OnToggleHelpers(object sender, EventArgs e)
+ private void OnToggleHelpers(object? sender, EventArgs e)
{
// Invert the current toggle helper mode
- if (_ribbonComboBox.Ribbon != null)
+ if (_ribbonComboBox!.Ribbon != null)
{
_ribbonComboBox.Ribbon.InDesignHelperMode = !_ribbonComboBox.Ribbon.InDesignHelperMode;
}
}
- private void OnMoveFirst(object sender, EventArgs e)
+ private void OnMoveFirst(object? sender, EventArgs e)
{
- if (_ribbonComboBox.Ribbon != null)
+ if (_ribbonComboBox!.Ribbon != null)
{
// Get access to the parent collection of items
var items = ParentItems;
@@ -240,13 +239,13 @@ private void OnMoveFirst(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonComboBox.RibbonContainer)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonComboBox.RibbonContainer!)[@"Items"];
RaiseComponentChanging(propertyItems);
// Move position of the combobox
- items.Remove(_ribbonComboBox);
- items.Insert(0, _ribbonComboBox);
+ items?.Remove(_ribbonComboBox);
+ items?.Insert(0, _ribbonComboBox);
UpdateVerbStatus();
RaiseComponentChanged(propertyItems, null, null);
@@ -259,9 +258,9 @@ private void OnMoveFirst(object sender, EventArgs e)
}
}
- private void OnMovePrevious(object sender, EventArgs e)
+ private void OnMovePrevious(object? sender, EventArgs e)
{
- if (_ribbonComboBox.Ribbon != null)
+ if (_ribbonComboBox!.Ribbon != null)
{
// Get access to the parent collection of items
var items = ParentItems;
@@ -272,15 +271,15 @@ private void OnMovePrevious(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonComboBox.RibbonContainer)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonComboBox.RibbonContainer!)[@"Items"];
RaiseComponentChanging(propertyItems);
// Move position of the combotextbox
- var index = items.IndexOf(_ribbonComboBox) - 1;
+ var index = items!.IndexOf(_ribbonComboBox) - 1;
index = Math.Max(index, 0);
- items.Remove(_ribbonComboBox);
- items.Insert(index, _ribbonComboBox);
+ items?.Remove(_ribbonComboBox);
+ items?.Insert(index, _ribbonComboBox);
UpdateVerbStatus();
RaiseComponentChanged(propertyItems, null, null);
@@ -293,9 +292,9 @@ private void OnMovePrevious(object sender, EventArgs e)
}
}
- private void OnMoveNext(object sender, EventArgs e)
+ private void OnMoveNext(object? sender, EventArgs e)
{
- if (_ribbonComboBox.Ribbon != null)
+ if (_ribbonComboBox!.Ribbon != null)
{
// Get access to the parent collection of items
var items = ParentItems;
@@ -306,15 +305,15 @@ private void OnMoveNext(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonComboBox.RibbonContainer)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonComboBox.RibbonContainer!)[@"Items"];
RaiseComponentChanging(propertyItems);
// Move position of the combobox
- var index = items.IndexOf(_ribbonComboBox) + 1;
+ var index = items!.IndexOf(_ribbonComboBox) + 1;
index = Math.Min(index, items.Count - 1);
- items.Remove(_ribbonComboBox);
- items.Insert(index, _ribbonComboBox);
+ items?.Remove(_ribbonComboBox);
+ items?.Insert(index, _ribbonComboBox);
UpdateVerbStatus();
RaiseComponentChanged(propertyItems, null, null);
@@ -327,9 +326,9 @@ private void OnMoveNext(object sender, EventArgs e)
}
}
- private void OnMoveLast(object sender, EventArgs e)
+ private void OnMoveLast(object? sender, EventArgs e)
{
- if (_ribbonComboBox.Ribbon != null)
+ if (_ribbonComboBox!.Ribbon != null)
{
// Get access to the parent collection of items
var items = ParentItems;
@@ -340,13 +339,13 @@ private void OnMoveLast(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonComboBox.RibbonContainer)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonComboBox.RibbonContainer!)[@"Items"];
RaiseComponentChanging(propertyItems);
// Move position of the combobox
- items.Remove(_ribbonComboBox);
- items.Insert(items.Count, _ribbonComboBox);
+ items?.Remove(_ribbonComboBox);
+ items?.Insert(items.Count, _ribbonComboBox);
UpdateVerbStatus();
RaiseComponentChanged(propertyItems, null, null);
@@ -359,9 +358,9 @@ private void OnMoveLast(object sender, EventArgs e)
}
}
- private void OnDeleteTextBox(object sender, EventArgs e)
+ private void OnDeleteTextBox(object? sender, EventArgs e)
{
- if (_ribbonComboBox.Ribbon != null)
+ if (_ribbonComboBox!.Ribbon != null)
{
// Get access to the parent collection of items
var items = ParentItems;
@@ -372,13 +371,13 @@ private void OnDeleteTextBox(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonComboBox.RibbonContainer)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonComboBox.RibbonContainer!)[@"Items"];
RaiseComponentChanging(null);
RaiseComponentChanging(propertyItems);
// Remove the combobox from the group
- items.Remove(_ribbonComboBox);
+ items?.Remove(_ribbonComboBox);
// Get designer to destroy it
_designerHost.DestroyComponent(_ribbonComboBox);
@@ -394,35 +393,35 @@ private void OnDeleteTextBox(object sender, EventArgs e)
}
}
- private void OnEnabled(object sender, EventArgs e)
+ private void OnEnabled(object? sender, EventArgs e)
{
- if (_ribbonComboBox.Ribbon != null)
+ if (_ribbonComboBox!.Ribbon != null)
{
- PropertyDescriptor propertyEnabled = TypeDescriptor.GetProperties(_ribbonComboBox)[nameof(Enabled)];
- var oldValue = (bool)propertyEnabled.GetValue(_ribbonComboBox);
+ PropertyDescriptor? propertyEnabled = TypeDescriptor.GetProperties(_ribbonComboBox)[nameof(Enabled)];
+ var oldValue = (bool)propertyEnabled?.GetValue(_ribbonComboBox)!;
var newValue = !oldValue;
_changeService.OnComponentChanged(_ribbonComboBox, null, oldValue, newValue);
propertyEnabled.SetValue(_ribbonComboBox, newValue);
}
}
- private void OnVisible(object sender, EventArgs e)
+ private void OnVisible(object? sender, EventArgs e)
{
- if (_ribbonComboBox.Ribbon != null)
+ if (_ribbonComboBox!.Ribbon != null)
{
- PropertyDescriptor propertyVisible = TypeDescriptor.GetProperties(_ribbonComboBox)[nameof(Visible)];
- var oldValue = (bool)propertyVisible.GetValue(_ribbonComboBox);
+ PropertyDescriptor? propertyVisible = TypeDescriptor.GetProperties(_ribbonComboBox)[nameof(Visible)];
+ var oldValue = (bool)propertyVisible?.GetValue(_ribbonComboBox)!;
var newValue = !oldValue;
_changeService.OnComponentChanged(_ribbonComboBox, null, oldValue, newValue);
propertyVisible.SetValue(_ribbonComboBox, newValue);
}
}
- private void OnComponentChanged(object sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
+ private void OnComponentChanged(object? sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
- private void OnContextMenu(object sender, MouseEventArgs e)
+ private void OnContextMenu(object? sender, MouseEventArgs e)
{
- if (_ribbonComboBox.Ribbon != null)
+ if (_ribbonComboBox!.Ribbon != null)
{
// Create the menu strip the first time around
if (_cms == null)
@@ -465,7 +464,7 @@ private TypedRestrictCollection? ParentItems
{
get
{
- switch (_ribbonComboBox.RibbonContainer)
+ switch (_ribbonComboBox!.RibbonContainer)
{
case KryptonRibbonGroupTriple triple:
return triple.Items;
@@ -474,6 +473,7 @@ private TypedRestrictCollection? ParentItems
default:
// Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(_ribbonComboBox.RibbonContainer!.ToString());
return null;
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupCustomControlDesigner.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupCustomControlDesigner.cs
index 4cc06ca88..b5279bfab 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupCustomControlDesigner.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupCustomControlDesigner.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -19,7 +19,7 @@ internal class KryptonRibbonGroupCustomControlDesigner : ComponentDesigner, IKry
#region Instance Fields
private IDesignerHost _designerHost;
private IComponentChangeService _changeService;
- private KryptonRibbonGroupCustomControl _ribbonCustomControl;
+ private KryptonRibbonGroupCustomControl? _ribbonCustomControl;
private DesignerVerbCollection _verbs;
private DesignerVerb _toggleHelpersVerb;
private DesignerVerb _moveFirstVerb;
@@ -78,8 +78,8 @@ public override void Initialize([DisallowNull] IComponent component)
}
// Get access to the services
- _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
- _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
+ _designerHost = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_designerHost)));
+ _changeService = (IComponentChangeService?)GetService(typeof(IComponentChangeService)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_changeService)));
// We need to know when we are being removed/changed
_changeService.ComponentChanged += OnComponentChanged;
@@ -128,7 +128,7 @@ protected override void Dispose(bool disposing)
if (disposing)
{
// Unhook from events
- _ribbonCustomControl.DesignTimeContextMenu -= OnContextMenu;
+ _ribbonCustomControl!.DesignTimeContextMenu -= OnContextMenu;
_changeService.ComponentChanged -= OnComponentChanged;
}
}
@@ -149,13 +149,12 @@ protected override void PreFilterProperties(IDictionary properties)
// Setup the array of properties we override
var attributes = Array.Empty();
- string[] strArray = { nameof(Visible), nameof(Enabled) };
+ string[] strArray = [nameof(Visible), nameof(Enabled)];
// Adjust our list of properties
for (var i = 0; i < strArray.Length; i++)
{
- var descrip = (PropertyDescriptor)properties[strArray[i]];
- if (descrip != null)
+ if (properties[strArray[i]] is PropertyDescriptor descrip)
{
properties[strArray[i]] = TypeDescriptor.CreateProperty(typeof(KryptonRibbonGroupCustomControlDesigner), descrip, attributes);
}
@@ -184,7 +183,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
- _verbs = new DesignerVerbCollection();
+ _verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move Custom Control First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move Custom Control Previous", OnMovePrevious);
@@ -200,10 +199,10 @@ private void UpdateVerbStatus()
var moveNext = false;
var moveLast = false;
- if (_ribbonCustomControl.Ribbon != null)
+ if (_ribbonCustomControl!.Ribbon != null)
{
var items = ParentItems;
- moveFirst = items.IndexOf(_ribbonCustomControl) > 0;
+ moveFirst = items!.IndexOf(_ribbonCustomControl) > 0;
movePrev = items.IndexOf(_ribbonCustomControl) > 0;
moveNext = items.IndexOf(_ribbonCustomControl) < (items.Count - 1);
moveLast = items.IndexOf(_ribbonCustomControl) < (items.Count - 1);
@@ -215,18 +214,18 @@ private void UpdateVerbStatus()
_moveLastVerb.Enabled = moveLast;
}
- private void OnToggleHelpers(object sender, EventArgs e)
+ private void OnToggleHelpers(object? sender, EventArgs e)
{
// Invert the current toggle helper mode
- if (_ribbonCustomControl.Ribbon != null)
+ if (_ribbonCustomControl!.Ribbon != null)
{
_ribbonCustomControl.Ribbon.InDesignHelperMode = !_ribbonCustomControl.Ribbon.InDesignHelperMode;
}
}
- private void OnMoveFirst(object sender, EventArgs e)
+ private void OnMoveFirst(object? sender, EventArgs e)
{
- if (_ribbonCustomControl.Ribbon != null)
+ if (_ribbonCustomControl!.Ribbon != null)
{
// Get access to the parent collection of items
var items = ParentItems;
@@ -237,13 +236,13 @@ private void OnMoveFirst(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonCustomControl.RibbonContainer)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonCustomControl!.RibbonContainer!)[@"Items"];
RaiseComponentChanging(propertyItems);
// Move position of the custom control
- items.Remove(_ribbonCustomControl);
- items.Insert(0, _ribbonCustomControl);
+ items?.Remove(_ribbonCustomControl);
+ items?.Insert(0, _ribbonCustomControl);
UpdateVerbStatus();
RaiseComponentChanged(propertyItems, null, null);
@@ -256,9 +255,9 @@ private void OnMoveFirst(object sender, EventArgs e)
}
}
- private void OnMovePrevious(object sender, EventArgs e)
+ private void OnMovePrevious(object? sender, EventArgs e)
{
- if (_ribbonCustomControl.Ribbon != null)
+ if (_ribbonCustomControl!.Ribbon != null)
{
// Get access to the parent collection of items
var items = ParentItems;
@@ -269,15 +268,15 @@ private void OnMovePrevious(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonCustomControl.RibbonContainer)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonCustomControl!.RibbonContainer!)[@"Items"];
RaiseComponentChanging(propertyItems);
// Move position of the custom control
- var index = items.IndexOf(_ribbonCustomControl) - 1;
+ var index = items!.IndexOf(_ribbonCustomControl) - 1;
index = Math.Max(index, 0);
- items.Remove(_ribbonCustomControl);
- items.Insert(index, _ribbonCustomControl);
+ items?.Remove(_ribbonCustomControl);
+ items?.Insert(index, _ribbonCustomControl);
UpdateVerbStatus();
RaiseComponentChanged(propertyItems, null, null);
@@ -290,9 +289,9 @@ private void OnMovePrevious(object sender, EventArgs e)
}
}
- private void OnMoveNext(object sender, EventArgs e)
+ private void OnMoveNext(object? sender, EventArgs e)
{
- if (_ribbonCustomControl.Ribbon != null)
+ if (_ribbonCustomControl!.Ribbon != null)
{
// Get access to the parent collection of items
var items = ParentItems;
@@ -303,15 +302,15 @@ private void OnMoveNext(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonCustomControl.RibbonContainer)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonCustomControl!.RibbonContainer!)[@"Items"];
RaiseComponentChanging(propertyItems);
// Move position of the custom control
- var index = items.IndexOf(_ribbonCustomControl) + 1;
+ var index = items!.IndexOf(_ribbonCustomControl) + 1;
index = Math.Min(index, items.Count - 1);
- items.Remove(_ribbonCustomControl);
- items.Insert(index, _ribbonCustomControl);
+ items?.Remove(_ribbonCustomControl);
+ items?.Insert(index, _ribbonCustomControl);
UpdateVerbStatus();
RaiseComponentChanged(propertyItems, null, null);
@@ -324,9 +323,9 @@ private void OnMoveNext(object sender, EventArgs e)
}
}
- private void OnMoveLast(object sender, EventArgs e)
+ private void OnMoveLast(object? sender, EventArgs e)
{
- if (_ribbonCustomControl.Ribbon != null)
+ if (_ribbonCustomControl!.Ribbon != null)
{
// Get access to the parent collection of items
var items = ParentItems;
@@ -337,13 +336,13 @@ private void OnMoveLast(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonCustomControl.RibbonContainer)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonCustomControl!.RibbonContainer!)[@"Items"];
RaiseComponentChanging(propertyItems);
// Move position of the triple
- items.Remove(_ribbonCustomControl);
- items.Insert(items.Count, _ribbonCustomControl);
+ items?.Remove(_ribbonCustomControl);
+ items?.Insert(items.Count, _ribbonCustomControl);
UpdateVerbStatus();
RaiseComponentChanged(propertyItems, null, null);
@@ -356,9 +355,9 @@ private void OnMoveLast(object sender, EventArgs e)
}
}
- private void OnDeleteCustomControl(object sender, EventArgs e)
+ private void OnDeleteCustomControl(object? sender, EventArgs e)
{
- if (_ribbonCustomControl.Ribbon != null)
+ if (_ribbonCustomControl!.Ribbon != null)
{
// Get access to the parent collection of items
var items = ParentItems;
@@ -369,14 +368,14 @@ private void OnDeleteCustomControl(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonCustomControl.RibbonContainer)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonCustomControl!.RibbonContainer!)[@"Items"];
// Remove the ribbon group from the ribbon tab
RaiseComponentChanging(null);
RaiseComponentChanging(propertyItems);
// Remove the custom control from the group
- items.Remove(_ribbonCustomControl);
+ items?.Remove(_ribbonCustomControl);
// Get designer to destroy it
_designerHost.DestroyComponent(_ribbonCustomControl);
@@ -392,35 +391,35 @@ private void OnDeleteCustomControl(object sender, EventArgs e)
}
}
- private void OnEnabled(object sender, EventArgs e)
+ private void OnEnabled(object? sender, EventArgs e)
{
- if (_ribbonCustomControl.Ribbon != null)
+ if (_ribbonCustomControl!.Ribbon != null)
{
- PropertyDescriptor propertyEnabled = TypeDescriptor.GetProperties(_ribbonCustomControl)[nameof(Enabled)];
- var oldValue = (bool)propertyEnabled.GetValue(_ribbonCustomControl);
+ PropertyDescriptor? propertyEnabled = TypeDescriptor.GetProperties(_ribbonCustomControl)[nameof(Enabled)];
+ var oldValue = (bool)propertyEnabled!.GetValue(_ribbonCustomControl)!;
var newValue = !oldValue;
_changeService.OnComponentChanged(_ribbonCustomControl, null, oldValue, newValue);
propertyEnabled.SetValue(_ribbonCustomControl, newValue);
}
}
- private void OnVisible(object sender, EventArgs e)
+ private void OnVisible(object? sender, EventArgs e)
{
- if (_ribbonCustomControl.Ribbon != null)
+ if (_ribbonCustomControl!.Ribbon != null)
{
- PropertyDescriptor propertyVisible = TypeDescriptor.GetProperties(_ribbonCustomControl)[nameof(Visible)];
- var oldValue = (bool)propertyVisible.GetValue(_ribbonCustomControl);
+ PropertyDescriptor? propertyVisible = TypeDescriptor.GetProperties(_ribbonCustomControl)[nameof(Visible)];
+ var oldValue = (bool)propertyVisible?.GetValue(_ribbonCustomControl)!;
var newValue = !oldValue;
_changeService.OnComponentChanged(_ribbonCustomControl, null, oldValue, newValue);
propertyVisible.SetValue(_ribbonCustomControl, newValue);
}
}
- private void OnComponentChanged(object sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
+ private void OnComponentChanged(object? sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
- private void OnContextMenu(object sender, MouseEventArgs e)
+ private void OnContextMenu(object? sender, MouseEventArgs e)
{
- if (_ribbonCustomControl.Ribbon != null)
+ if (_ribbonCustomControl!.Ribbon != null)
{
// Create the menu strip the first time around
if (_cms == null)
@@ -463,7 +462,7 @@ private TypedRestrictCollection? ParentItems
{
get
{
- switch (_ribbonCustomControl.RibbonContainer)
+ switch (_ribbonCustomControl!.RibbonContainer)
{
case KryptonRibbonGroupTriple triple:
return triple.Items;
@@ -472,6 +471,7 @@ private TypedRestrictCollection? ParentItems
default:
// Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(_ribbonCustomControl.RibbonContainer!.ToString());
return null;
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupDateTimePickerDesigner.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupDateTimePickerDesigner.cs
index 026c5b0be..d289824ec 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupDateTimePickerDesigner.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupDateTimePickerDesigner.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -57,11 +57,12 @@ public override void Initialize([DisallowNull] IComponent component)
// Let base class do standard stuff
base.Initialize(component);
- Debug.Assert(component != null);
+ Debug.Assert(component is not null);
// Cast to correct type
- _ribbonDateTimePicker = component as KryptonRibbonGroupDateTimePicker;
- if (_ribbonDateTimePicker != null)
+ _ribbonDateTimePicker = component as KryptonRibbonGroupDateTimePicker ?? throw new ArgumentNullException(nameof(component));
+
+ if (_ribbonDateTimePicker is not null && _ribbonDateTimePicker.DateTimePicker is not null)
{
_ribbonDateTimePicker.DateTimePickerDesigner = this;
@@ -81,8 +82,8 @@ public override void Initialize([DisallowNull] IComponent component)
}
// Get access to the services
- _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
- _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
+ _designerHost = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_designerHost)));
+ _changeService = (IComponentChangeService?)GetService(typeof(IComponentChangeService)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_changeService)));
// We need to know when we are being removed/changed
_changeService.ComponentChanged += OnComponentChanged;
@@ -152,12 +153,12 @@ protected override void PreFilterProperties(IDictionary properties)
// Setup the array of properties we override
var attributes = Array.Empty();
- string[] strArray = { nameof(Visible), nameof(Enabled) };
+ string[] strArray = [nameof(Visible), nameof(Enabled)];
// Adjust our list of properties
for (var i = 0; i < strArray.Length; i++)
{
- var descrip = (PropertyDescriptor)properties[strArray[i]];
+ var descrip = (PropertyDescriptor?)properties[strArray[i]];
if (descrip != null)
{
properties[strArray[i]] = TypeDescriptor.CreateProperty(typeof(KryptonRibbonGroupDateTimePickerDesigner), descrip, attributes);
@@ -187,7 +188,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
- _verbs = new DesignerVerbCollection();
+ _verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move DateTimePicker First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move DateTimePicker Previous", OnMovePrevious);
@@ -205,7 +206,7 @@ private void UpdateVerbStatus()
if (_ribbonDateTimePicker.Ribbon != null)
{
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
moveFirst = items.IndexOf(_ribbonDateTimePicker) > 0;
movePrev = items.IndexOf(_ribbonDateTimePicker) > 0;
moveNext = items.IndexOf(_ribbonDateTimePicker) < (items.Count - 1);
@@ -218,7 +219,7 @@ private void UpdateVerbStatus()
_moveLastVerb.Enabled = moveLast;
}
- private void OnToggleHelpers(object sender, EventArgs e)
+ private void OnToggleHelpers(object? sender, EventArgs e)
{
// Invert the current toggle helper mode
if (_ribbonDateTimePicker.Ribbon != null)
@@ -227,29 +228,32 @@ private void OnToggleHelpers(object sender, EventArgs e)
}
}
- private void OnMoveFirst(object sender, EventArgs e)
+ private void OnMoveFirst(object? sender, EventArgs e)
{
- if (_ribbonDateTimePicker.Ribbon != null)
+ if (_ribbonDateTimePicker.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupDateTimePicker MoveFirst");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonDateTimePicker.RibbonContainer)[@"Items"];
+ if (_ribbonDateTimePicker.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonDateTimePicker.RibbonContainer)[@"Items"]!;
- RaiseComponentChanging(propertyItems);
+ RaiseComponentChanging(propertyItems);
- // Move position of the date time picker
- items.Remove(_ribbonDateTimePicker);
- items.Insert(0, _ribbonDateTimePicker);
- UpdateVerbStatus();
+ // Move position of the date time picker
+ items.Remove(_ribbonDateTimePicker);
+ items.Insert(0, _ribbonDateTimePicker);
+ UpdateVerbStatus();
- RaiseComponentChanged(propertyItems, null, null);
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -259,31 +263,34 @@ private void OnMoveFirst(object sender, EventArgs e)
}
}
- private void OnMovePrevious(object sender, EventArgs e)
+ private void OnMovePrevious(object? sender, EventArgs e)
{
if (_ribbonDateTimePicker.Ribbon != null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupDateTimePicker MovePrevious");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonDateTimePicker.RibbonContainer)[@"Items"];
-
- RaiseComponentChanging(propertyItems);
-
- // Move position of the date time picker
- var index = items.IndexOf(_ribbonDateTimePicker) - 1;
- index = Math.Max(index, 0);
- items.Remove(_ribbonDateTimePicker);
- items.Insert(index, _ribbonDateTimePicker);
- UpdateVerbStatus();
-
- RaiseComponentChanged(propertyItems, null, null);
+ if (_ribbonDateTimePicker.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonDateTimePicker.RibbonContainer)[@"Items"]!;
+
+ RaiseComponentChanging(propertyItems);
+
+ // Move position of the date time picker
+ var index = items.IndexOf(_ribbonDateTimePicker) - 1;
+ index = Math.Max(index, 0);
+ items.Remove(_ribbonDateTimePicker);
+ items.Insert(index, _ribbonDateTimePicker);
+ UpdateVerbStatus();
+
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -293,31 +300,34 @@ private void OnMovePrevious(object sender, EventArgs e)
}
}
- private void OnMoveNext(object sender, EventArgs e)
+ private void OnMoveNext(object? sender, EventArgs e)
{
if (_ribbonDateTimePicker.Ribbon != null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupDateTimePicker MoveNext");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonDateTimePicker.RibbonContainer)[@"Items"];
-
- RaiseComponentChanging(propertyItems);
-
- // Move position of the date time picker
- var index = items.IndexOf(_ribbonDateTimePicker) + 1;
- index = Math.Min(index, items.Count - 1);
- items.Remove(_ribbonDateTimePicker);
- items.Insert(index, _ribbonDateTimePicker);
- UpdateVerbStatus();
-
- RaiseComponentChanged(propertyItems, null, null);
+ if (_ribbonDateTimePicker.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonDateTimePicker.RibbonContainer)[@"Items"]!;
+
+ RaiseComponentChanging(propertyItems);
+
+ // Move position of the date time picker
+ var index = items.IndexOf(_ribbonDateTimePicker) + 1;
+ index = Math.Min(index, items.Count - 1);
+ items.Remove(_ribbonDateTimePicker);
+ items.Insert(index, _ribbonDateTimePicker);
+ UpdateVerbStatus();
+
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -327,29 +337,32 @@ private void OnMoveNext(object sender, EventArgs e)
}
}
- private void OnMoveLast(object sender, EventArgs e)
+ private void OnMoveLast(object? sender, EventArgs e)
{
if (_ribbonDateTimePicker.Ribbon != null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupDateTimePicker MoveLast");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonDateTimePicker.RibbonContainer)[@"Items"];
+ if (_ribbonDateTimePicker.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonDateTimePicker.RibbonContainer)[@"Items"]!;
- RaiseComponentChanging(propertyItems);
+ RaiseComponentChanging(propertyItems);
- // Move position of the date time picker
- items.Remove(_ribbonDateTimePicker);
- items.Insert(items.Count, _ribbonDateTimePicker);
- UpdateVerbStatus();
+ // Move position of the date time picker
+ items.Remove(_ribbonDateTimePicker);
+ items.Insert(items.Count, _ribbonDateTimePicker);
+ UpdateVerbStatus();
- RaiseComponentChanged(propertyItems, null, null);
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -359,32 +372,35 @@ private void OnMoveLast(object sender, EventArgs e)
}
}
- private void OnDeleteDateTimePicker(object sender, EventArgs e)
+ private void OnDeleteDateTimePicker(object? sender, EventArgs e)
{
- if (_ribbonDateTimePicker.Ribbon != null)
+ if (_ribbonDateTimePicker.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupDateTimePicker DeleteDateTimePicker");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonDateTimePicker.RibbonContainer)[@"Items"];
+ if (_ribbonDateTimePicker.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonDateTimePicker.RibbonContainer)[@"Items"]!;
- RaiseComponentChanging(null);
- RaiseComponentChanging(propertyItems);
+ RaiseComponentChanging(null);
+ RaiseComponentChanging(propertyItems);
- // Remove the date time picker from the group
- items.Remove(_ribbonDateTimePicker);
+ // Remove the date time picker from the group
+ items.Remove(_ribbonDateTimePicker);
- // Get designer to destroy it
- _designerHost.DestroyComponent(_ribbonDateTimePicker);
+ // Get designer to destroy it
+ _designerHost.DestroyComponent(_ribbonDateTimePicker);
- RaiseComponentChanged(propertyItems, null, null);
- RaiseComponentChanged(null, null, null);
+ RaiseComponentChanged(propertyItems, null, null);
+ RaiseComponentChanged(null, null, null);
+ }
}
finally
{
@@ -394,33 +410,33 @@ private void OnDeleteDateTimePicker(object sender, EventArgs e)
}
}
- private void OnEnabled(object sender, EventArgs e)
+ private void OnEnabled(object? sender, EventArgs e)
{
if (_ribbonDateTimePicker.Ribbon != null)
{
- PropertyDescriptor propertyEnabled = TypeDescriptor.GetProperties(_ribbonDateTimePicker)[nameof(Enabled)];
- var oldValue = (bool)propertyEnabled.GetValue(_ribbonDateTimePicker);
+ PropertyDescriptor propertyEnabled = TypeDescriptor.GetProperties(_ribbonDateTimePicker)[nameof(Enabled)] ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("propertyEnabled"));
+ var oldValue = (bool?)propertyEnabled.GetValue(_ribbonDateTimePicker);
var newValue = !oldValue;
_changeService.OnComponentChanged(_ribbonDateTimePicker, null, oldValue, newValue);
propertyEnabled.SetValue(_ribbonDateTimePicker, newValue);
}
}
- private void OnVisible(object sender, EventArgs e)
+ private void OnVisible(object? sender, EventArgs e)
{
if (_ribbonDateTimePicker.Ribbon != null)
{
- PropertyDescriptor propertyVisible = TypeDescriptor.GetProperties(_ribbonDateTimePicker)[nameof(Visible)];
- var oldValue = (bool)propertyVisible.GetValue(_ribbonDateTimePicker);
+ PropertyDescriptor propertyVisible = TypeDescriptor.GetProperties(_ribbonDateTimePicker)[nameof(Visible)] ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("propertyVisible"));
+ var oldValue = (bool?)propertyVisible.GetValue(_ribbonDateTimePicker);
var newValue = !oldValue;
_changeService.OnComponentChanged(_ribbonDateTimePicker, null, oldValue, newValue);
propertyVisible.SetValue(_ribbonDateTimePicker, newValue);
}
}
- private void OnComponentChanged(object sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
+ private void OnComponentChanged(object? sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
- private void OnContextMenu(object sender, MouseEventArgs e)
+ private void OnContextMenu(object? sender, MouseEventArgs e)
{
if (_ribbonDateTimePicker.Ribbon != null)
{
@@ -474,6 +490,7 @@ private TypedRestrictCollection? ParentItems
default:
// Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(_ribbonDateTimePicker.RibbonContainer!.ToString());
return null;
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupDesigner.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupDesigner.cs
index 47c31f27a..ca5790084 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupDesigner.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupDesigner.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -70,8 +70,8 @@ public override void Initialize([DisallowNull] IComponent component)
Debug.Assert(component != null);
// Cast to correct type
- _ribbonGroup = component as KryptonRibbonGroup;
- if (_ribbonGroup != null)
+ _ribbonGroup = component as KryptonRibbonGroup ?? throw new ArgumentNullException(nameof(component));
+ if (_ribbonGroup is not null)
{
_ribbonGroup.DesignTimeAddTriple += OnAddTriple;
_ribbonGroup.DesignTimeAddLines += OnAddLines;
@@ -81,8 +81,8 @@ public override void Initialize([DisallowNull] IComponent component)
}
// Get access to the services
- _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
- _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
+ _designerHost = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_designerHost)));
+ _changeService = (IComponentChangeService?)GetService(typeof(IComponentChangeService)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_changeService)));
// We need to know when we are being removed/changed
_changeService.ComponentRemoving += OnComponentRemoving;
@@ -150,7 +150,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
- _verbs = new DesignerVerbCollection();
+ _verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move Group First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move Group Previous", OnMovePrevious);
@@ -172,7 +172,9 @@ private void UpdateVerbStatus()
var moveLast = false;
var clearItems = false;
- if ((_ribbonGroup.Ribbon != null) && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
+ if ((_ribbonGroup.Ribbon is not null)
+ && _ribbonGroup.RibbonTab is not null
+ && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
{
moveFirst = _ribbonGroup.RibbonTab.Groups.IndexOf(_ribbonGroup) > 0;
movePrev = _ribbonGroup.RibbonTab.Groups.IndexOf(_ribbonGroup) > 0;
@@ -188,7 +190,7 @@ private void UpdateVerbStatus()
_clearItemsVerb.Enabled = clearItems;
}
- private void OnToggleHelpers(object sender, EventArgs e)
+ private void OnToggleHelpers(object? sender, EventArgs e)
{
// Invert the current toggle helper mode
if (_ribbonGroup.Ribbon != null)
@@ -197,9 +199,11 @@ private void OnToggleHelpers(object sender, EventArgs e)
}
}
- private void OnMoveFirst(object sender, EventArgs e)
+ private void OnMoveFirst(object? sender, EventArgs e)
{
- if ((_ribbonGroup.Ribbon != null) && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
+ if ((_ribbonGroup.Ribbon is not null)
+ && _ribbonGroup.RibbonTab is not null
+ && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroup MoveFirst");
@@ -207,7 +211,7 @@ private void OnMoveFirst(object sender, EventArgs e)
try
{
// Get access to the Group property
- MemberDescriptor propertyGroups = TypeDescriptor.GetProperties(_ribbonGroup.RibbonTab)[@"Groups"];
+ MemberDescriptor? propertyGroups = TypeDescriptor.GetProperties(_ribbonGroup.RibbonTab)[@"Groups"];
RaiseComponentChanging(propertyGroups);
@@ -227,9 +231,11 @@ private void OnMoveFirst(object sender, EventArgs e)
}
}
- private void OnMovePrevious(object sender, EventArgs e)
+ private void OnMovePrevious(object? sender, EventArgs e)
{
- if ((_ribbonGroup.Ribbon != null) && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
+ if ((_ribbonGroup.Ribbon is not null)
+ && _ribbonGroup.RibbonTab is not null
+ && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroup MovePrevious");
@@ -237,7 +243,7 @@ private void OnMovePrevious(object sender, EventArgs e)
try
{
// Get access to the Group property
- MemberDescriptor propertyGroups = TypeDescriptor.GetProperties(_ribbonGroup.RibbonTab)[@"Groups"];
+ MemberDescriptor? propertyGroups = TypeDescriptor.GetProperties(_ribbonGroup.RibbonTab)[@"Groups"];
RaiseComponentChanging(propertyGroups);
@@ -259,9 +265,11 @@ private void OnMovePrevious(object sender, EventArgs e)
}
}
- private void OnMoveNext(object sender, EventArgs e)
+ private void OnMoveNext(object? sender, EventArgs e)
{
- if ((_ribbonGroup.Ribbon != null) && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
+ if ((_ribbonGroup.Ribbon is not null)
+ && _ribbonGroup.RibbonTab is not null
+ && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroup MoveNext");
@@ -269,7 +277,7 @@ private void OnMoveNext(object sender, EventArgs e)
try
{
// Get access to the Group property
- MemberDescriptor propertyGroups = TypeDescriptor.GetProperties(_ribbonGroup.RibbonTab)[@"Groups"];
+ MemberDescriptor? propertyGroups = TypeDescriptor.GetProperties(_ribbonGroup.RibbonTab)[@"Groups"];
RaiseComponentChanging(propertyGroups);
@@ -291,9 +299,11 @@ private void OnMoveNext(object sender, EventArgs e)
}
}
- private void OnMoveLast(object sender, EventArgs e)
+ private void OnMoveLast(object? sender, EventArgs e)
{
- if ((_ribbonGroup.Ribbon != null) && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
+ if ((_ribbonGroup.Ribbon is not null)
+ && _ribbonGroup.RibbonTab is not null
+ && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroup MoveLast");
@@ -301,7 +311,7 @@ private void OnMoveLast(object sender, EventArgs e)
try
{
// Get access to the Group property
- MemberDescriptor propertyGroups = TypeDescriptor.GetProperties(_ribbonGroup.RibbonTab)[@"Groups"];
+ MemberDescriptor? propertyGroups = TypeDescriptor.GetProperties(_ribbonGroup.RibbonTab)[@"Groups"];
RaiseComponentChanging(propertyGroups);
@@ -321,9 +331,11 @@ private void OnMoveLast(object sender, EventArgs e)
}
}
- private void OnAddTriple(object sender, EventArgs e)
+ private void OnAddTriple(object? sender, EventArgs e)
{
- if ((_ribbonGroup.Ribbon != null) && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
+ if ((_ribbonGroup.Ribbon != null)
+ && _ribbonGroup.RibbonTab is not null
+ && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroup AddTriple");
@@ -331,7 +343,7 @@ private void OnAddTriple(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonGroup)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonGroup)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -340,7 +352,7 @@ private void OnAddTriple(object sender, EventArgs e)
_ribbonGroup.Items.Add(triple);
// Get access to the Triple.Items property
- MemberDescriptor propertyTripleItems = TypeDescriptor.GetProperties(triple)[@"Items"];
+ MemberDescriptor? propertyTripleItems = TypeDescriptor.GetProperties(triple)[@"Items"];
RaiseComponentChanging(propertyTripleItems);
@@ -348,7 +360,7 @@ private void OnAddTriple(object sender, EventArgs e)
var button1 = (KryptonRibbonGroupButton)_designerHost.CreateComponent(typeof(KryptonRibbonGroupButton));
var button2 = (KryptonRibbonGroupButton)_designerHost.CreateComponent(typeof(KryptonRibbonGroupButton));
var button3 = (KryptonRibbonGroupButton)_designerHost.CreateComponent(typeof(KryptonRibbonGroupButton));
- triple.Items.Add(button1);
+ triple.Items!.Add(button1);
triple.Items.Add(button2);
triple.Items.Add(button3);
@@ -363,9 +375,11 @@ private void OnAddTriple(object sender, EventArgs e)
}
}
- private void OnAddLines(object sender, EventArgs e)
+ private void OnAddLines(object? sender, EventArgs e)
{
- if ((_ribbonGroup.Ribbon != null) && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
+ if ((_ribbonGroup.Ribbon is not null)
+ && _ribbonGroup.RibbonTab is not null
+ && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroup AddLines");
@@ -373,24 +387,27 @@ private void OnAddLines(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonGroup)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonGroup)[@"Items"];
RaiseComponentChanging(propertyItems);
// Get designer to create the new lines component
- var lines = (KryptonRibbonGroupLines)_designerHost.CreateComponent(typeof(KryptonRibbonGroupLines));
+ var lines = (KryptonRibbonGroupLines)_designerHost.CreateComponent(typeof(KryptonRibbonGroupLines)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("lines"));
_ribbonGroup.Items.Add(lines);
// Get access to the Lines.Items property
- MemberDescriptor propertyLinesItems = TypeDescriptor.GetProperties(lines)[@"Items"];
+ MemberDescriptor? propertyLinesItems = TypeDescriptor.GetProperties(lines)[@"Items"];
RaiseComponentChanging(propertyLinesItems);
// Get designer to create three new button components
- var button1 = (KryptonRibbonGroupButton)_designerHost.CreateComponent(typeof(KryptonRibbonGroupButton));
- var button2 = (KryptonRibbonGroupButton)_designerHost.CreateComponent(typeof(KryptonRibbonGroupButton));
- lines.Items.Add(button1);
- lines.Items.Add(button2);
+ if (lines.Items is not null)
+ {
+ var button1 = (KryptonRibbonGroupButton)_designerHost.CreateComponent(typeof(KryptonRibbonGroupButton));
+ var button2 = (KryptonRibbonGroupButton)_designerHost.CreateComponent(typeof(KryptonRibbonGroupButton));
+ lines.Items.Add(button1);
+ lines.Items.Add(button2);
+ }
RaiseComponentChanged(propertyLinesItems, null, null);
RaiseComponentChanged(propertyItems, null, null);
@@ -403,9 +420,11 @@ private void OnAddLines(object sender, EventArgs e)
}
}
- private void OnAddSep(object sender, EventArgs e)
+ private void OnAddSep(object? sender, EventArgs e)
{
- if ((_ribbonGroup.Ribbon != null) && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
+ if ((_ribbonGroup.Ribbon is not null)
+ && _ribbonGroup.RibbonTab is not null
+ && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroup AddSep");
@@ -413,7 +432,7 @@ private void OnAddSep(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonGroup)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonGroup)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -431,9 +450,11 @@ private void OnAddSep(object sender, EventArgs e)
}
}
- private void OnAddGallery(object sender, EventArgs e)
+ private void OnAddGallery(object? sender, EventArgs e)
{
- if ((_ribbonGroup.Ribbon != null) && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
+ if ((_ribbonGroup.Ribbon is not null)
+ && _ribbonGroup.RibbonTab is not null
+ && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroup AddGallery");
@@ -441,7 +462,7 @@ private void OnAddGallery(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonGroup)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonGroup)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -459,9 +480,11 @@ private void OnAddGallery(object sender, EventArgs e)
}
}
- private void OnClearItems(object sender, EventArgs e)
+ private void OnClearItems(object? sender, EventArgs e)
{
- if ((_ribbonGroup.Ribbon != null) && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
+ if ((_ribbonGroup.Ribbon is not null)
+ && _ribbonGroup.RibbonTab is not null
+ && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroup ClearItems");
@@ -469,12 +492,12 @@ private void OnClearItems(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonGroup)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonGroup)[@"Items"];
RaiseComponentChanging(propertyItems);
// Need access to host in order to delete a component
- var host = (IDesignerHost)GetService(typeof(IDesignerHost));
+ var host = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("host"));
// We need to remove all the items from the tab
for (var i = _ribbonGroup.Items.Count - 1; i >= 0; i--)
@@ -494,9 +517,11 @@ private void OnClearItems(object sender, EventArgs e)
}
}
- private void OnDeleteGroup(object sender, EventArgs e)
+ private void OnDeleteGroup(object? sender, EventArgs e)
{
- if ((_ribbonGroup.Ribbon != null) && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
+ if ((_ribbonGroup.Ribbon is not null)
+ && _ribbonGroup.RibbonTab is not null
+ && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroup DeleteGroup");
@@ -504,7 +529,7 @@ private void OnDeleteGroup(object sender, EventArgs e)
try
{
// Get access to the Groups property
- MemberDescriptor propertyGroups = TypeDescriptor.GetProperties(_ribbonGroup.RibbonTab)[@"Groups"];
+ MemberDescriptor? propertyGroups = TypeDescriptor.GetProperties(_ribbonGroup.RibbonTab)[@"Groups"];
// Remove the ribbon tab from the ribbon
RaiseComponentChanging(null);
@@ -527,42 +552,48 @@ private void OnDeleteGroup(object sender, EventArgs e)
}
}
- private void OnVisible(object sender, EventArgs e)
+ private void OnVisible(object? sender, EventArgs e)
{
- if ((_ribbonGroup.Ribbon != null) && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
+ if ((_ribbonGroup.Ribbon is not null)
+ && _ribbonGroup.RibbonTab is not null
+ && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
{
_changeService.OnComponentChanged(_ribbonGroup, null, _ribbonGroup.Visible, !_ribbonGroup.Visible);
_ribbonGroup.Visible = !_ribbonGroup.Visible;
}
}
- private void OnCollapsable(object sender, EventArgs e)
+ private void OnCollapsable(object? sender, EventArgs e)
{
- if ((_ribbonGroup.Ribbon != null) && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
+ if ((_ribbonGroup.Ribbon is not null)
+ && _ribbonGroup.RibbonTab is not null
+ && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
{
_changeService.OnComponentChanged(_ribbonGroup, null, _ribbonGroup.AllowCollapsed, !_ribbonGroup.AllowCollapsed);
_ribbonGroup.AllowCollapsed = !_ribbonGroup.AllowCollapsed;
}
}
- private void OnDialogLauncher(object sender, EventArgs e)
+ private void OnDialogLauncher(object? sender, EventArgs e)
{
- if ((_ribbonGroup.Ribbon != null) && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
+ if ((_ribbonGroup.Ribbon is not null)
+ && _ribbonGroup.RibbonTab is not null
+ && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
{
_changeService.OnComponentChanged(_ribbonGroup, null, _ribbonGroup.DialogBoxLauncher, !_ribbonGroup.DialogBoxLauncher);
_ribbonGroup.DialogBoxLauncher = !_ribbonGroup.DialogBoxLauncher;
}
}
- private void OnComponentChanged(object sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
+ private void OnComponentChanged(object? sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
- private void OnComponentRemoving(object sender, ComponentEventArgs e)
+ private void OnComponentRemoving(object? sender, ComponentEventArgs e)
{
// If our group is being removed
if (e.Component == _ribbonGroup)
{
// Need access to host in order to delete a component
- var host = (IDesignerHost)GetService(typeof(IDesignerHost));
+ var host = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("host"));
// We need to remove all containers from the group
for (var j = _ribbonGroup.Items.Count - 1; j >= 0; j--)
@@ -574,9 +605,11 @@ private void OnComponentRemoving(object sender, ComponentEventArgs e)
}
}
- private void OnContextMenu(object sender, MouseEventArgs e)
+ private void OnContextMenu(object? sender, MouseEventArgs e)
{
- if ((_ribbonGroup.Ribbon != null) && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
+ if ((_ribbonGroup.Ribbon is not null)
+ && _ribbonGroup.RibbonTab is not null
+ && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
{
// Create the menu strip the first time around
if (_cms == null)
@@ -668,15 +701,17 @@ private void UpdateMoveToTab()
}
}
- private void OnMoveToTab(object sender, EventArgs e)
+ private void OnMoveToTab(object? sender, EventArgs e)
{
- if ((_ribbonGroup.Ribbon != null) && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
+ if ((_ribbonGroup.Ribbon is not null)
+ && _ribbonGroup.RibbonTab is not null
+ && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
{
// Cast to correct type
- var tabMenuItem = (ToolStripMenuItem)sender;
+ var tabMenuItem = sender as ToolStripMenuItem ?? throw new ArgumentNullException(nameof(sender));
// Get access to the destination tab
- var destination = (KryptonRibbonTab)tabMenuItem.Tag;
+ var destination = tabMenuItem.Tag as KryptonRibbonTab ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(tabMenuItem.Tag)));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroup MoveTabTo");
@@ -684,9 +719,9 @@ private void OnMoveToTab(object sender, EventArgs e)
try
{
// Get access to the Groups property
- MemberDescriptor oldGroups = TypeDescriptor.GetProperties(_ribbonGroup.RibbonTab)[@"Groups"];
- MemberDescriptor newGroups = TypeDescriptor.GetProperties(destination)[@"Groups"];
- MemberDescriptor newGroupsTab = TypeDescriptor.GetProperties(_ribbonGroup.Ribbon)[@"RibbonTabs"];
+ MemberDescriptor? oldGroups = TypeDescriptor.GetProperties(_ribbonGroup.RibbonTab)[@"Groups"];
+ MemberDescriptor? newGroups = TypeDescriptor.GetProperties(destination)[@"Groups"];
+ MemberDescriptor? newGroupsTab = TypeDescriptor.GetProperties(_ribbonGroup.Ribbon)[@"RibbonTabs"];
// Remove the ribbon tab from the ribbon
RaiseComponentChanging(null);
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupDomainUpDownDesigner.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupDomainUpDownDesigner.cs
index f2cd88cb4..2871efdd2 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupDomainUpDownDesigner.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupDomainUpDownDesigner.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -57,11 +57,12 @@ public override void Initialize([DisallowNull] IComponent component)
// Let base class do standard stuff
base.Initialize(component);
- Debug.Assert(component != null);
+ Debug.Assert(component is not null);
// Cast to correct type
- _ribbonDomainUpDown = component as KryptonRibbonGroupDomainUpDown;
- if (_ribbonDomainUpDown != null)
+ _ribbonDomainUpDown = component as KryptonRibbonGroupDomainUpDown ?? throw new ArgumentNullException(nameof(component));
+
+ if (_ribbonDomainUpDown is not null)
{
_ribbonDomainUpDown.DomainUpDownDesigner = this;
@@ -74,15 +75,15 @@ public override void Initialize([DisallowNull] IComponent component)
_ribbonDomainUpDown.Enabled = true;
// Tell the embedded domain up-down control it is in design mode
- _ribbonDomainUpDown.DomainUpDown.InRibbonDesignMode = true;
+ _ribbonDomainUpDown.DomainUpDown!.InRibbonDesignMode = true;
// Hook into events
_ribbonDomainUpDown.DesignTimeContextMenu += OnContextMenu;
}
// Get access to the services
- _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
- _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
+ _designerHost = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_designerHost)));
+ _changeService = (IComponentChangeService?)GetService(typeof(IComponentChangeService)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_changeService)));
// We need to know when we are being removed/changed
_changeService.ComponentChanged += OnComponentChanged;
@@ -152,12 +153,12 @@ protected override void PreFilterProperties(IDictionary properties)
// Setup the array of properties we override
var attributes = Array.Empty();
- string[] strArray = { nameof(Visible), nameof(Enabled) };
+ string[] strArray = [nameof(Visible), nameof(Enabled)];
// Adjust our list of properties
for (var i = 0; i < strArray.Length; i++)
{
- var descrip = (PropertyDescriptor)properties[strArray[i]];
+ var descrip = (PropertyDescriptor?)properties[strArray[i]];
if (descrip != null)
{
properties[strArray[i]] = TypeDescriptor.CreateProperty(typeof(KryptonRibbonGroupDomainUpDownDesigner), descrip, attributes);
@@ -187,7 +188,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
- _verbs = new DesignerVerbCollection();
+ _verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move DomainUpDown First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move DomainUpDown Previous", OnMovePrevious);
@@ -203,9 +204,9 @@ private void UpdateVerbStatus()
var moveNext = false;
var moveLast = false;
- if (_ribbonDomainUpDown.Ribbon != null)
+ if (_ribbonDomainUpDown.Ribbon is not null)
{
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
moveFirst = items.IndexOf(_ribbonDomainUpDown) > 0;
movePrev = items.IndexOf(_ribbonDomainUpDown) > 0;
moveNext = items.IndexOf(_ribbonDomainUpDown) < (items.Count - 1);
@@ -218,38 +219,41 @@ private void UpdateVerbStatus()
_moveLastVerb.Enabled = moveLast;
}
- private void OnToggleHelpers(object sender, EventArgs e)
+ private void OnToggleHelpers(object? sender, EventArgs e)
{
// Invert the current toggle helper mode
- if (_ribbonDomainUpDown.Ribbon != null)
+ if (_ribbonDomainUpDown.Ribbon is not null)
{
_ribbonDomainUpDown.Ribbon.InDesignHelperMode = !_ribbonDomainUpDown.Ribbon.InDesignHelperMode;
}
}
- private void OnMoveFirst(object sender, EventArgs e)
+ private void OnMoveFirst(object? sender, EventArgs e)
{
- if (_ribbonDomainUpDown.Ribbon != null)
+ if (_ribbonDomainUpDown.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupDomainUpDown MoveFirst");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonDomainUpDown.RibbonContainer)[@"Items"];
+ if (_ribbonDomainUpDown.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonDomainUpDown.RibbonContainer)[@"Items"];
- RaiseComponentChanging(propertyItems);
+ RaiseComponentChanging(propertyItems);
- // Move position of the numeric up-down
- items.Remove(_ribbonDomainUpDown);
- items.Insert(0, _ribbonDomainUpDown);
- UpdateVerbStatus();
+ // Move position of the numeric up-down
+ items.Remove(_ribbonDomainUpDown);
+ items.Insert(0, _ribbonDomainUpDown);
+ UpdateVerbStatus();
- RaiseComponentChanged(propertyItems, null, null);
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -259,31 +263,34 @@ private void OnMoveFirst(object sender, EventArgs e)
}
}
- private void OnMovePrevious(object sender, EventArgs e)
+ private void OnMovePrevious(object? sender, EventArgs e)
{
- if (_ribbonDomainUpDown.Ribbon != null)
+ if (_ribbonDomainUpDown.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupDomainUpDown MovePrevious");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonDomainUpDown.RibbonContainer)[@"Items"];
-
- RaiseComponentChanging(propertyItems);
-
- // Move position of the numeric up-down
- var index = items.IndexOf(_ribbonDomainUpDown) - 1;
- index = Math.Max(index, 0);
- items.Remove(_ribbonDomainUpDown);
- items.Insert(index, _ribbonDomainUpDown);
- UpdateVerbStatus();
-
- RaiseComponentChanged(propertyItems, null, null);
+ if (_ribbonDomainUpDown.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonDomainUpDown.RibbonContainer)[@"Items"];
+
+ RaiseComponentChanging(propertyItems);
+
+ // Move position of the numeric up-down
+ var index = items.IndexOf(_ribbonDomainUpDown) - 1;
+ index = Math.Max(index, 0);
+ items.Remove(_ribbonDomainUpDown);
+ items.Insert(index, _ribbonDomainUpDown);
+ UpdateVerbStatus();
+
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -293,31 +300,34 @@ private void OnMovePrevious(object sender, EventArgs e)
}
}
- private void OnMoveNext(object sender, EventArgs e)
+ private void OnMoveNext(object? sender, EventArgs e)
{
- if (_ribbonDomainUpDown.Ribbon != null)
+ if (_ribbonDomainUpDown.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupDomainUpDown MoveNext");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonDomainUpDown.RibbonContainer)[@"Items"];
-
- RaiseComponentChanging(propertyItems);
-
- // Move position of the numeric up-down
- var index = items.IndexOf(_ribbonDomainUpDown) + 1;
- index = Math.Min(index, items.Count - 1);
- items.Remove(_ribbonDomainUpDown);
- items.Insert(index, _ribbonDomainUpDown);
- UpdateVerbStatus();
-
- RaiseComponentChanged(propertyItems, null, null);
+ if (_ribbonDomainUpDown.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonDomainUpDown.RibbonContainer)[@"Items"];
+
+ RaiseComponentChanging(propertyItems);
+
+ // Move position of the numeric up-down
+ var index = items.IndexOf(_ribbonDomainUpDown) + 1;
+ index = Math.Min(index, items.Count - 1);
+ items.Remove(_ribbonDomainUpDown);
+ items.Insert(index, _ribbonDomainUpDown);
+ UpdateVerbStatus();
+
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -327,29 +337,32 @@ private void OnMoveNext(object sender, EventArgs e)
}
}
- private void OnMoveLast(object sender, EventArgs e)
+ private void OnMoveLast(object? sender, EventArgs e)
{
- if (_ribbonDomainUpDown.Ribbon != null)
+ if (_ribbonDomainUpDown.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupDomainUpDown MoveLast");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonDomainUpDown.RibbonContainer)[@"Items"];
+ if (_ribbonDomainUpDown.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonDomainUpDown.RibbonContainer)[@"Items"];
- RaiseComponentChanging(propertyItems);
+ RaiseComponentChanging(propertyItems);
- // Move position of the numeric up-down
- items.Remove(_ribbonDomainUpDown);
- items.Insert(items.Count, _ribbonDomainUpDown);
- UpdateVerbStatus();
+ // Move position of the numeric up-down
+ items.Remove(_ribbonDomainUpDown);
+ items.Insert(items.Count, _ribbonDomainUpDown);
+ UpdateVerbStatus();
- RaiseComponentChanged(propertyItems, null, null);
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -359,32 +372,35 @@ private void OnMoveLast(object sender, EventArgs e)
}
}
- private void OnDeleteDomainUpDown(object sender, EventArgs e)
+ private void OnDeleteDomainUpDown(object? sender, EventArgs e)
{
- if (_ribbonDomainUpDown.Ribbon != null)
+ if (_ribbonDomainUpDown.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupDomainUpDown DeleteDomainUpDown");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonDomainUpDown.RibbonContainer)[@"Items"];
+ if (_ribbonDomainUpDown.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonDomainUpDown.RibbonContainer)[@"Items"];
- RaiseComponentChanging(null);
- RaiseComponentChanging(propertyItems);
+ RaiseComponentChanging(null);
+ RaiseComponentChanging(propertyItems);
- // Remove the numeric up-down from the group
- items.Remove(_ribbonDomainUpDown);
+ // Remove the numeric up-down from the group
+ items.Remove(_ribbonDomainUpDown);
- // Get designer to destroy it
- _designerHost.DestroyComponent(_ribbonDomainUpDown);
+ // Get designer to destroy it
+ _designerHost.DestroyComponent(_ribbonDomainUpDown);
- RaiseComponentChanged(propertyItems, null, null);
- RaiseComponentChanged(null, null, null);
+ RaiseComponentChanged(propertyItems, null, null);
+ RaiseComponentChanged(null, null, null);
+ }
}
finally
{
@@ -394,35 +410,35 @@ private void OnDeleteDomainUpDown(object sender, EventArgs e)
}
}
- private void OnEnabled(object sender, EventArgs e)
+ private void OnEnabled(object? sender, EventArgs e)
{
- if (_ribbonDomainUpDown.Ribbon != null)
+ if (_ribbonDomainUpDown.Ribbon is not null)
{
- PropertyDescriptor propertyEnabled = TypeDescriptor.GetProperties(_ribbonDomainUpDown)[nameof(Enabled)];
- var oldValue = (bool)propertyEnabled.GetValue(_ribbonDomainUpDown);
+ PropertyDescriptor? propertyEnabled = TypeDescriptor.GetProperties(_ribbonDomainUpDown)[nameof(Enabled)] ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("propertyEnabled"));
+ var oldValue = (bool?)propertyEnabled.GetValue(_ribbonDomainUpDown);
var newValue = !oldValue;
_changeService.OnComponentChanged(_ribbonDomainUpDown, null, oldValue, newValue);
propertyEnabled.SetValue(_ribbonDomainUpDown, newValue);
}
}
- private void OnVisible(object sender, EventArgs e)
+ private void OnVisible(object? sender, EventArgs e)
{
- if (_ribbonDomainUpDown.Ribbon != null)
+ if (_ribbonDomainUpDown.Ribbon is not null)
{
- PropertyDescriptor propertyVisible = TypeDescriptor.GetProperties(_ribbonDomainUpDown)[nameof(Visible)];
- var oldValue = (bool)propertyVisible.GetValue(_ribbonDomainUpDown);
+ PropertyDescriptor? propertyVisible = TypeDescriptor.GetProperties(_ribbonDomainUpDown)[nameof(Visible)] ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("propertyVisible"));
+ var oldValue = (bool?)propertyVisible.GetValue(_ribbonDomainUpDown);
var newValue = !oldValue;
_changeService.OnComponentChanged(_ribbonDomainUpDown, null, oldValue, newValue);
propertyVisible.SetValue(_ribbonDomainUpDown, newValue);
}
}
- private void OnComponentChanged(object sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
+ private void OnComponentChanged(object? sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
- private void OnContextMenu(object sender, MouseEventArgs e)
+ private void OnContextMenu(object? sender, MouseEventArgs e)
{
- if (_ribbonDomainUpDown.Ribbon != null)
+ if (_ribbonDomainUpDown.Ribbon is not null)
{
// Create the menu strip the first time around
if (_cms == null)
@@ -474,6 +490,7 @@ private TypedRestrictCollection? ParentItems
default:
// Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(_ribbonDomainUpDown.RibbonContainer!.ToString());
return null;
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupGalleryDesigner.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupGalleryDesigner.cs
index 1b862739c..9481ead14 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupGalleryDesigner.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupGalleryDesigner.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -69,7 +69,8 @@ public override void Initialize([DisallowNull] IComponent component)
Debug.Assert(component != null);
// Cast to correct type
- _ribbonGallery = component as KryptonRibbonGroupGallery;
+ _ribbonGallery = component as KryptonRibbonGroupGallery ?? throw new ArgumentNullException(nameof(component));
+
if (_ribbonGallery != null)
{
_ribbonGallery.GalleryDesigner = this;
@@ -90,8 +91,8 @@ public override void Initialize([DisallowNull] IComponent component)
}
// Get access to the services
- _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
- _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
+ _designerHost = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_designerHost)));
+ _changeService = (IComponentChangeService?)GetService(typeof(IComponentChangeService)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_changeService)));
// We need to know when we are being removed/changed
_changeService.ComponentChanged += OnComponentChanged;
@@ -161,12 +162,12 @@ protected override void PreFilterProperties(IDictionary properties)
// Setup the array of properties we override
var attributes = Array.Empty();
- string[] strArray = { nameof(Visible), nameof(Enabled) };
+ string[] strArray = [nameof(Visible), nameof(Enabled)];
// Adjust our list of properties
for (var i = 0; i < strArray.Length; i++)
{
- var descrip = (PropertyDescriptor)properties[strArray[i]];
+ var descrip = (PropertyDescriptor?)properties[strArray[i]];
if (descrip != null)
{
properties[strArray[i]] = TypeDescriptor.CreateProperty(typeof(KryptonRibbonGroupGalleryDesigner), descrip, attributes);
@@ -196,7 +197,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
- _verbs = new DesignerVerbCollection();
+ _verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move Gallery First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move Gallery Previous", OnMovePrevious);
@@ -212,7 +213,9 @@ private void UpdateVerbStatus()
var moveNext = false;
var moveLast = false;
- if ((_ribbonGallery.Ribbon != null) && _ribbonGallery.RibbonGroup.Items.Contains(_ribbonGallery))
+ if ((_ribbonGallery.Ribbon is not null)
+ && _ribbonGallery.RibbonGroup is not null
+ && _ribbonGallery.RibbonGroup.Items.Contains(_ribbonGallery))
{
moveFirst = _ribbonGallery.RibbonGroup.Items.IndexOf(_ribbonGallery) > 0;
movePrev = _ribbonGallery.RibbonGroup.Items.IndexOf(_ribbonGallery) > 0;
@@ -226,7 +229,7 @@ private void UpdateVerbStatus()
_moveLastVerb.Enabled = moveLast;
}
- private void OnToggleHelpers(object sender, EventArgs e)
+ private void OnToggleHelpers(object? sender, EventArgs e)
{
// Invert the current toggle helper mode
if (_ribbonGallery.Ribbon != null)
@@ -235,9 +238,11 @@ private void OnToggleHelpers(object sender, EventArgs e)
}
}
- private void OnMoveFirst(object sender, EventArgs e)
+ private void OnMoveFirst(object? sender, EventArgs e)
{
- if ((_ribbonGallery.Ribbon != null) && _ribbonGallery.RibbonGroup.Items.Contains(_ribbonGallery))
+ if ((_ribbonGallery.Ribbon is not null)
+ && _ribbonGallery.RibbonGroup is not null
+ && _ribbonGallery.RibbonGroup.Items.Contains(_ribbonGallery))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupGallery MoveFirst");
@@ -245,7 +250,7 @@ private void OnMoveFirst(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonGallery.RibbonGroup)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonGallery.RibbonGroup)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -265,9 +270,11 @@ private void OnMoveFirst(object sender, EventArgs e)
}
}
- private void OnMovePrevious(object sender, EventArgs e)
+ private void OnMovePrevious(object? sender, EventArgs e)
{
- if ((_ribbonGallery.Ribbon != null) && _ribbonGallery.RibbonGroup.Items.Contains(_ribbonGallery))
+ if ((_ribbonGallery.Ribbon is not null)
+ && _ribbonGallery.RibbonGroup is not null
+ && _ribbonGallery.RibbonGroup.Items.Contains(_ribbonGallery))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupGallery MovePrevious");
@@ -275,7 +282,7 @@ private void OnMovePrevious(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonGallery.RibbonGroup)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonGallery.RibbonGroup)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -297,9 +304,11 @@ private void OnMovePrevious(object sender, EventArgs e)
}
}
- private void OnMoveNext(object sender, EventArgs e)
+ private void OnMoveNext(object? sender, EventArgs e)
{
- if ((_ribbonGallery.Ribbon != null) && _ribbonGallery.RibbonGroup.Items.Contains(_ribbonGallery))
+ if ((_ribbonGallery.Ribbon is not null)
+ && _ribbonGallery.RibbonGroup is not null
+ && _ribbonGallery.RibbonGroup.Items.Contains(_ribbonGallery))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupGallery MoveNext");
@@ -307,7 +316,7 @@ private void OnMoveNext(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonGallery.RibbonGroup)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonGallery.RibbonGroup)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -329,9 +338,11 @@ private void OnMoveNext(object sender, EventArgs e)
}
}
- private void OnMoveLast(object sender, EventArgs e)
+ private void OnMoveLast(object? sender, EventArgs e)
{
- if ((_ribbonGallery.Ribbon != null) && _ribbonGallery.RibbonGroup.Items.Contains(_ribbonGallery))
+ if ((_ribbonGallery.Ribbon is not null)
+ && _ribbonGallery.RibbonGroup is not null
+ && _ribbonGallery.RibbonGroup.Items.Contains(_ribbonGallery))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupGallery MoveLast");
@@ -339,7 +350,7 @@ private void OnMoveLast(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonGallery.RibbonGroup)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonGallery.RibbonGroup)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -359,9 +370,11 @@ private void OnMoveLast(object sender, EventArgs e)
}
}
- private void OnDeleteGallery(object sender, EventArgs e)
+ private void OnDeleteGallery(object? sender, EventArgs e)
{
- if ((_ribbonGallery.Ribbon != null) && _ribbonGallery.RibbonGroup.Items.Contains(_ribbonGallery))
+ if ((_ribbonGallery.Ribbon is not null)
+ && _ribbonGallery.RibbonGroup is not null
+ && _ribbonGallery.RibbonGroup.Items.Contains(_ribbonGallery))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupGallery DeleteGallery");
@@ -369,7 +382,7 @@ private void OnDeleteGallery(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonGallery.RibbonGroup)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonGallery.RibbonGroup)[@"Items"];
// Remove the ribbon group from the ribbon tab
RaiseComponentChanging(null);
@@ -392,31 +405,31 @@ private void OnDeleteGallery(object sender, EventArgs e)
}
}
- private void OnEnabled(object sender, EventArgs e)
+ private void OnEnabled(object? sender, EventArgs e)
{
if (_ribbonGallery.Ribbon != null)
{
- PropertyDescriptor propertyEnabled = TypeDescriptor.GetProperties(_ribbonGallery)[nameof(Enabled)];
- var oldValue = (bool)propertyEnabled.GetValue(_ribbonGallery);
+ PropertyDescriptor? propertyEnabled = TypeDescriptor.GetProperties(_ribbonGallery)[nameof(Enabled)] ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("propertyEnabled"));
+ var oldValue = (bool?)propertyEnabled.GetValue(_ribbonGallery);
var newValue = !oldValue;
_changeService.OnComponentChanged(_ribbonGallery, null, oldValue, newValue);
propertyEnabled.SetValue(_ribbonGallery, newValue);
}
}
- private void OnVisible(object sender, EventArgs e)
+ private void OnVisible(object? sender, EventArgs e)
{
if (_ribbonGallery.Ribbon != null)
{
- PropertyDescriptor propertyVisible = TypeDescriptor.GetProperties(_ribbonGallery)[nameof(Visible)];
- var oldValue = (bool)propertyVisible.GetValue(_ribbonGallery);
+ PropertyDescriptor? propertyVisible = TypeDescriptor.GetProperties(_ribbonGallery)[nameof(Visible)] ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("propertyVisible"));
+ var oldValue = (bool?)propertyVisible.GetValue(_ribbonGallery);
var newValue = !oldValue;
_changeService.OnComponentChanged(_ribbonGallery, null, oldValue, newValue);
propertyVisible.SetValue(_ribbonGallery, newValue);
}
}
- private void OnMaxLarge(object sender, EventArgs e)
+ private void OnMaxLarge(object? sender, EventArgs e)
{
if (_ribbonGallery.Ribbon != null)
{
@@ -425,7 +438,7 @@ private void OnMaxLarge(object sender, EventArgs e)
}
}
- private void OnMaxMedium(object sender, EventArgs e)
+ private void OnMaxMedium(object? sender, EventArgs e)
{
if (_ribbonGallery.Ribbon != null)
{
@@ -434,7 +447,7 @@ private void OnMaxMedium(object sender, EventArgs e)
}
}
- private void OnMaxSmall(object sender, EventArgs e)
+ private void OnMaxSmall(object? sender, EventArgs e)
{
if (_ribbonGallery.Ribbon != null)
{
@@ -443,7 +456,7 @@ private void OnMaxSmall(object sender, EventArgs e)
}
}
- private void OnMinLarge(object sender, EventArgs e)
+ private void OnMinLarge(object? sender, EventArgs e)
{
if (_ribbonGallery.Ribbon != null)
{
@@ -452,7 +465,7 @@ private void OnMinLarge(object sender, EventArgs e)
}
}
- private void OnMinMedium(object sender, EventArgs e)
+ private void OnMinMedium(object? sender, EventArgs e)
{
if (_ribbonGallery.Ribbon != null)
{
@@ -461,7 +474,7 @@ private void OnMinMedium(object sender, EventArgs e)
}
}
- private void OnMinSmall(object sender, EventArgs e)
+ private void OnMinSmall(object? sender, EventArgs e)
{
if (_ribbonGallery.Ribbon != null)
{
@@ -470,9 +483,9 @@ private void OnMinSmall(object sender, EventArgs e)
}
}
- private void OnComponentChanged(object sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
+ private void OnComponentChanged(object? sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
- private void OnContextMenu(object sender, MouseEventArgs e)
+ private void OnContextMenu(object? sender, MouseEventArgs e)
{
if (_ribbonGallery.Ribbon != null)
{
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupLabelDesigner.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupLabelDesigner.cs
index 25294b4f9..88d9d5c76 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupLabelDesigner.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupLabelDesigner.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -60,15 +60,16 @@ public override void Initialize([DisallowNull] IComponent component)
Debug.Assert(component != null);
// Cast to correct type
- _ribbonLabel = component as KryptonRibbonGroupLabel;
+ _ribbonLabel = component as KryptonRibbonGroupLabel ?? throw new ArgumentNullException(nameof(component));
+
if (_ribbonLabel != null)
{
_ribbonLabel.DesignTimeContextMenu += OnContextMenu;
}
// Get access to the services
- _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
- _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
+ _designerHost = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_designerHost)));
+ _changeService = (IComponentChangeService?)GetService(typeof(IComponentChangeService)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_changeService)));
// We need to know when we are being removed/changed
_changeService.ComponentChanged += OnComponentChanged;
@@ -117,7 +118,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
- _verbs = new DesignerVerbCollection();
+ _verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move Label First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move Label Previous", OnMovePrevious);
@@ -135,7 +136,8 @@ private void UpdateVerbStatus()
if (_ribbonLabel.Ribbon != null)
{
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
+
moveFirst = items.IndexOf(_ribbonLabel) > 0;
movePrev = items.IndexOf(_ribbonLabel) > 0;
moveNext = items.IndexOf(_ribbonLabel) < (items.Count - 1);
@@ -148,7 +150,7 @@ private void UpdateVerbStatus()
_moveLastVerb.Enabled = moveLast;
}
- private void OnToggleHelpers(object sender, EventArgs e)
+ private void OnToggleHelpers(object? sender, EventArgs e)
{
// Invert the current toggle helper mode
if (_ribbonLabel.Ribbon != null)
@@ -157,29 +159,32 @@ private void OnToggleHelpers(object sender, EventArgs e)
}
}
- private void OnMoveFirst(object sender, EventArgs e)
+ private void OnMoveFirst(object? sender, EventArgs e)
{
- if (_ribbonLabel.Ribbon != null)
+ if (_ribbonLabel.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupLabel MoveFirst");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonLabel.RibbonContainer)[@"Items"];
+ if (_ribbonLabel.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonLabel.RibbonContainer)[@"Items"];
- RaiseComponentChanging(propertyItems);
+ RaiseComponentChanging(propertyItems);
- // Move position of the label
- items.Remove(_ribbonLabel);
- items.Insert(0, _ribbonLabel);
- UpdateVerbStatus();
+ // Move position of the label
+ items.Remove(_ribbonLabel);
+ items.Insert(0, _ribbonLabel);
+ UpdateVerbStatus();
- RaiseComponentChanged(propertyItems, null, null);
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -189,31 +194,34 @@ private void OnMoveFirst(object sender, EventArgs e)
}
}
- private void OnMovePrevious(object sender, EventArgs e)
+ private void OnMovePrevious(object? sender, EventArgs e)
{
- if (_ribbonLabel.Ribbon != null)
+ if (_ribbonLabel.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupLabel MovePrevious");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonLabel.RibbonContainer)[@"Items"];
-
- RaiseComponentChanging(propertyItems);
-
- // Move position of the triple
- var index = items.IndexOf(_ribbonLabel) - 1;
- index = Math.Max(index, 0);
- items.Remove(_ribbonLabel);
- items.Insert(index, _ribbonLabel);
- UpdateVerbStatus();
-
- RaiseComponentChanged(propertyItems, null, null);
+ if (_ribbonLabel.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonLabel.RibbonContainer)[@"Items"];
+
+ RaiseComponentChanging(propertyItems);
+
+ // Move position of the triple
+ var index = items.IndexOf(_ribbonLabel) - 1;
+ index = Math.Max(index, 0);
+ items.Remove(_ribbonLabel);
+ items.Insert(index, _ribbonLabel);
+ UpdateVerbStatus();
+
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -223,31 +231,34 @@ private void OnMovePrevious(object sender, EventArgs e)
}
}
- private void OnMoveNext(object sender, EventArgs e)
+ private void OnMoveNext(object? sender, EventArgs e)
{
- if (_ribbonLabel.Ribbon != null)
+ if (_ribbonLabel.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupLabel MoveNext");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonLabel.RibbonContainer)[@"Items"];
-
- RaiseComponentChanging(propertyItems);
-
- // Move position of the triple
- var index = items.IndexOf(_ribbonLabel) + 1;
- index = Math.Min(index, items.Count - 1);
- items.Remove(_ribbonLabel);
- items.Insert(index, _ribbonLabel);
- UpdateVerbStatus();
-
- RaiseComponentChanged(propertyItems, null, null);
+ if (_ribbonLabel.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonLabel.RibbonContainer)[@"Items"];
+
+ RaiseComponentChanging(propertyItems);
+
+ // Move position of the triple
+ var index = items.IndexOf(_ribbonLabel) + 1;
+ index = Math.Min(index, items.Count - 1);
+ items.Remove(_ribbonLabel);
+ items.Insert(index, _ribbonLabel);
+ UpdateVerbStatus();
+
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -257,29 +268,32 @@ private void OnMoveNext(object sender, EventArgs e)
}
}
- private void OnMoveLast(object sender, EventArgs e)
+ private void OnMoveLast(object? sender, EventArgs e)
{
- if (_ribbonLabel.Ribbon != null)
+ if (_ribbonLabel.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupLabel MoveLast");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonLabel.RibbonContainer)[@"Items"];
+ if (_ribbonLabel.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonLabel.RibbonContainer)[@"Items"];
- RaiseComponentChanging(propertyItems);
+ RaiseComponentChanging(propertyItems);
- // Move position of the triple
- items.Remove(_ribbonLabel);
- items.Insert(items.Count, _ribbonLabel);
- UpdateVerbStatus();
+ // Move position of the triple
+ items.Remove(_ribbonLabel);
+ items.Insert(items.Count, _ribbonLabel);
+ UpdateVerbStatus();
- RaiseComponentChanged(propertyItems, null, null);
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -289,33 +303,36 @@ private void OnMoveLast(object sender, EventArgs e)
}
}
- private void OnDeleteLabel(object sender, EventArgs e)
+ private void OnDeleteLabel(object? sender, EventArgs e)
{
- if (_ribbonLabel.Ribbon != null)
+ if (_ribbonLabel.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupLabel DeleteLabel");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonLabel.RibbonContainer)[@"Items"];
+ if (_ribbonLabel.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonLabel.RibbonContainer)[@"Items"];
- // Remove the ribbon group from the ribbon tab
- RaiseComponentChanging(null);
- RaiseComponentChanging(propertyItems);
+ // Remove the ribbon group from the ribbon tab
+ RaiseComponentChanging(null);
+ RaiseComponentChanging(propertyItems);
- // Remove the label from the group
- items.Remove(_ribbonLabel);
+ // Remove the label from the group
+ items.Remove(_ribbonLabel);
- // Get designer to destroy it
- _designerHost.DestroyComponent(_ribbonLabel);
+ // Get designer to destroy it
+ _designerHost.DestroyComponent(_ribbonLabel);
- RaiseComponentChanged(propertyItems, null, null);
- RaiseComponentChanged(null, null, null);
+ RaiseComponentChanged(propertyItems, null, null);
+ RaiseComponentChanged(null, null, null);
+ }
}
finally
{
@@ -325,29 +342,29 @@ private void OnDeleteLabel(object sender, EventArgs e)
}
}
- private void OnVisible(object sender, EventArgs e)
+ private void OnVisible(object? sender, EventArgs e)
{
- if (_ribbonLabel.Ribbon != null)
+ if (_ribbonLabel.Ribbon is not null)
{
_changeService.OnComponentChanged(_ribbonLabel, null, _ribbonLabel.Visible, !_ribbonLabel.Visible);
_ribbonLabel.Visible = !_ribbonLabel.Visible;
}
}
- private void OnEnabled(object sender, EventArgs e)
+ private void OnEnabled(object? sender, EventArgs e)
{
- if (_ribbonLabel.Ribbon != null)
+ if (_ribbonLabel.Ribbon is not null)
{
_changeService.OnComponentChanged(_ribbonLabel, null, _ribbonLabel.Enabled, !_ribbonLabel.Enabled);
_ribbonLabel.Enabled = !_ribbonLabel.Enabled;
}
}
- private void OnComponentChanged(object sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
+ private void OnComponentChanged(object? sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
- private void OnContextMenu(object sender, MouseEventArgs e)
+ private void OnContextMenu(object? sender, MouseEventArgs e)
{
- if (_ribbonLabel.Ribbon != null)
+ if (_ribbonLabel.Ribbon is not null)
{
// Create the menu strip the first time around
if (_cms == null)
@@ -401,6 +418,7 @@ private TypedRestrictCollection? ParentItems
default:
// Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(_ribbonLabel.RibbonContainer!.ToString());
return null;
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupLinesDesigner.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupLinesDesigner.cs
index 6e70e8b1a..bc763c064 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupLinesDesigner.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupLinesDesigner.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -41,6 +41,7 @@ internal class KryptonRibbonGroupLinesDesigner : ComponentDesigner
private DesignerVerb _addDomainUpDownVerb;
private DesignerVerb _addDateTimePickerVerb;
private DesignerVerb _addTrackBarVerb;
+ private DesignerVerb _addThemeComboBoxVerb;
private DesignerVerb _clearItemsVerb;
private DesignerVerb _deleteLinesVerb;
private ContextMenuStrip? _cms;
@@ -74,6 +75,7 @@ internal class KryptonRibbonGroupLinesDesigner : ComponentDesigner
private ToolStripMenuItem _addDomainUpDownMenu;
private ToolStripMenuItem _addDateTimePickerMenu;
private ToolStripMenuItem _addTrackBarMenu;
+ private ToolStripMenuItem _addThemeComboBoxMenu;
private ToolStripMenuItem _clearItemsMenu;
private ToolStripMenuItem _deleteLinesMenu;
#endregion
@@ -97,10 +99,10 @@ public override void Initialize([DisallowNull] IComponent component)
// Let base class do standard stuff
base.Initialize(component);
- Debug.Assert(component != null);
+ Debug.Assert(component is not null);
// Cast to correct type
- _ribbonLines = component as KryptonRibbonGroupLines;
+ _ribbonLines = component as KryptonRibbonGroupLines ?? throw new ArgumentNullException(nameof(component));
if (_ribbonLines != null)
{
_ribbonLines.DesignTimeAddButton += OnAddButton;
@@ -118,12 +120,13 @@ public override void Initialize([DisallowNull] IComponent component)
_ribbonLines.DesignTimeAddDomainUpDown += OnAddDomainUpDown;
_ribbonLines.DesignTimeAddDateTimePicker += OnAddDateTimePicker;
_ribbonLines.DesignTimeAddTrackBar += OnAddTrackBar;
+ _ribbonLines.DesignTimeAddThemeComboBox += OnAddThemeComboBox;
_ribbonLines.DesignTimeContextMenu += OnContextMenu;
}
// Get access to the services
- _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
- _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
+ _designerHost = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_designerHost)));
+ _changeService = (IComponentChangeService?)GetService(typeof(IComponentChangeService)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_changeService)));
// We need to know when we are being removed/changed
_changeService.ComponentRemoving += OnComponentRemoving;
@@ -138,7 +141,12 @@ public override ICollection AssociatedComponents
get
{
var compound = new ArrayList(base.AssociatedComponents);
- compound.AddRange(_ribbonLines.Items);
+
+ if ( _ribbonLines.Items is not null && _ribbonLines.Items.Count > 0)
+ {
+ compound.AddRange(_ribbonLines.Items);
+ }
+
return compound;
}
}
@@ -184,6 +192,7 @@ protected override void Dispose(bool disposing)
_ribbonLines.DesignTimeAddDateTimePicker -= OnAddDateTimePicker;
_ribbonLines.DesignTimeContextMenu -= OnContextMenu;
_ribbonLines.DesignTimeAddTrackBar -= OnAddTrackBar;
+ _ribbonLines.DesignTimeAddThemeComboBox -= OnAddThemeComboBox;
_changeService.ComponentRemoving -= OnComponentRemoving;
_changeService.ComponentChanged -= OnComponentChanged;
}
@@ -202,7 +211,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
- _verbs = new DesignerVerbCollection();
+ _verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move Lines First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move Lines Previous", OnMovePrevious);
@@ -223,25 +232,35 @@ private void UpdateVerbStatus()
_addDomainUpDownVerb = new DesignerVerb(@"Add DomainUpDown", OnAddDomainUpDown);
_addDateTimePickerVerb = new DesignerVerb(@"Add DateTimePicker", OnAddDateTimePicker);
_addTrackBarVerb = new DesignerVerb(@"Add TrackBar", OnAddTrackBar);
+ _addThemeComboBoxVerb = new DesignerVerb("Add Theme ComboBox", OnAddThemeComboBox);
_clearItemsVerb = new DesignerVerb(@"Clear Items", OnClearItems);
_deleteLinesVerb = new DesignerVerb(@"Delete Lines", OnDeleteLines);
- _verbs.AddRange(new[] { _toggleHelpersVerb, _moveFirstVerb, _movePrevVerb, _moveNextVerb, _moveLastVerb,
- _addButtonVerb,
- _addCheckBoxVerb,
- _addClusterVerb,
- _addColorButtonVerb,
- _addComboBoxVerb,
- _addCustomControlVerb,
- _addDateTimePickerVerb,
- _addDomainUpDownVerb,
- _addLabelVerb,
- _addNumericUpDownVerb,
- _addMaskedTextBoxVerb,
- _addRadioButtonVerb,
- _addRichTextBoxVerb,
- _addTextBoxVerb,
- _addTrackBarVerb,
- _clearItemsVerb, _deleteLinesVerb });
+ _verbs.AddRange(new[]
+ {
+ _toggleHelpersVerb,
+ _moveFirstVerb,
+ _movePrevVerb,
+ _moveNextVerb,
+ _moveLastVerb,
+ _addButtonVerb,
+ _addCheckBoxVerb,
+ _addClusterVerb,
+ _addColorButtonVerb,
+ _addComboBoxVerb,
+ _addCustomControlVerb,
+ _addDateTimePickerVerb,
+ _addDomainUpDownVerb,
+ _addLabelVerb,
+ _addNumericUpDownVerb,
+ _addMaskedTextBoxVerb,
+ _addRadioButtonVerb,
+ _addRichTextBoxVerb,
+ _addTextBoxVerb,
+ _addTrackBarVerb,
+ _addThemeComboBoxVerb,
+ _clearItemsVerb,
+ _deleteLinesVerb
+ });
}
var moveFirst = false;
@@ -250,7 +269,10 @@ private void UpdateVerbStatus()
var moveLast = false;
var clearItems = false;
- if ((_ribbonLines.Ribbon != null) && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
+ if ((_ribbonLines.Ribbon is not null)
+ && _ribbonLines.Items is not null
+ && _ribbonLines.RibbonGroup is not null
+ && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
{
moveFirst = _ribbonLines.RibbonGroup.Items.IndexOf(_ribbonLines) > 0;
movePrev = _ribbonLines.RibbonGroup.Items.IndexOf(_ribbonLines) > 0;
@@ -266,7 +288,7 @@ private void UpdateVerbStatus()
_clearItemsVerb.Enabled = clearItems;
}
- private void OnToggleHelpers(object sender, EventArgs e)
+ private void OnToggleHelpers(object? sender, EventArgs e)
{
// Invert the current toggle helper mode
if (_ribbonLines.Ribbon != null)
@@ -275,9 +297,11 @@ private void OnToggleHelpers(object sender, EventArgs e)
}
}
- private void OnMoveFirst(object sender, EventArgs e)
+ private void OnMoveFirst(object? sender, EventArgs e)
{
- if ((_ribbonLines?.Ribbon != null) && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
+ if ((_ribbonLines?.Ribbon is not null)
+ && _ribbonLines.RibbonGroup is not null
+ && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupLines MoveFirst");
@@ -285,7 +309,7 @@ private void OnMoveFirst(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonLines.RibbonGroup)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonLines.RibbonGroup)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -305,9 +329,11 @@ private void OnMoveFirst(object sender, EventArgs e)
}
}
- private void OnMovePrevious(object sender, EventArgs e)
+ private void OnMovePrevious(object? sender, EventArgs e)
{
- if ((_ribbonLines.Ribbon != null) && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
+ if ((_ribbonLines.Ribbon != null)
+ && _ribbonLines.RibbonGroup is not null
+ && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupLines MovePrevious");
@@ -315,7 +341,7 @@ private void OnMovePrevious(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonLines.RibbonGroup)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonLines.RibbonGroup)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -337,9 +363,11 @@ private void OnMovePrevious(object sender, EventArgs e)
}
}
- private void OnMoveNext(object sender, EventArgs e)
+ private void OnMoveNext(object? sender, EventArgs e)
{
- if ((_ribbonLines.Ribbon != null) && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
+ if ((_ribbonLines.Ribbon is not null)
+ && _ribbonLines.RibbonGroup is not null
+ && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupLines MoveNext");
@@ -347,7 +375,7 @@ private void OnMoveNext(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonLines.RibbonGroup)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonLines.RibbonGroup)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -369,9 +397,11 @@ private void OnMoveNext(object sender, EventArgs e)
}
}
- private void OnMoveLast(object sender, EventArgs e)
+ private void OnMoveLast(object? sender, EventArgs e)
{
- if ((_ribbonLines.Ribbon != null) && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
+ if ((_ribbonLines.Ribbon is not null)
+ && _ribbonLines.RibbonGroup is not null
+ && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupLines MoveLast");
@@ -379,7 +409,7 @@ private void OnMoveLast(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonLines.RibbonGroup)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonLines.RibbonGroup)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -399,9 +429,12 @@ private void OnMoveLast(object sender, EventArgs e)
}
}
- private void OnAddButton(object sender, EventArgs e)
+ private void OnAddButton(object? sender, EventArgs e)
{
- if ((_ribbonLines.Ribbon != null) && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
+ if ((_ribbonLines.Ribbon is not null)
+ && _ribbonLines.Items is not null
+ && _ribbonLines.RibbonGroup is not null
+ && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupLines AddButton");
@@ -409,7 +442,7 @@ private void OnAddButton(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -427,9 +460,12 @@ private void OnAddButton(object sender, EventArgs e)
}
}
- private void OnAddColorButton(object sender, EventArgs e)
+ private void OnAddColorButton(object? sender, EventArgs e)
{
- if ((_ribbonLines.Ribbon != null) && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
+ if ((_ribbonLines.Ribbon is not null)
+ && _ribbonLines.Items is not null
+ && _ribbonLines.RibbonGroup is not null
+ && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupLines AddColorButton");
@@ -437,7 +473,7 @@ private void OnAddColorButton(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -455,9 +491,12 @@ private void OnAddColorButton(object sender, EventArgs e)
}
}
- private void OnAddCheckBox(object sender, EventArgs e)
+ private void OnAddCheckBox(object? sender, EventArgs e)
{
- if ((_ribbonLines.Ribbon != null) && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
+ if ((_ribbonLines.Ribbon is not null)
+ && _ribbonLines.Items is not null
+ && _ribbonLines.RibbonGroup is not null
+ && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupLines AddCheckBox");
@@ -465,7 +504,7 @@ private void OnAddCheckBox(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -483,9 +522,12 @@ private void OnAddCheckBox(object sender, EventArgs e)
}
}
- private void OnAddRadioButton(object sender, EventArgs e)
+ private void OnAddRadioButton(object? sender, EventArgs e)
{
- if ((_ribbonLines.Ribbon != null) && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
+ if ((_ribbonLines.Ribbon is not null)
+ && _ribbonLines.Items is not null
+ && _ribbonLines.RibbonGroup is not null
+ && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupLines AddRadioButton");
@@ -493,7 +535,7 @@ private void OnAddRadioButton(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -511,9 +553,12 @@ private void OnAddRadioButton(object sender, EventArgs e)
}
}
- private void OnAddLabel(object sender, EventArgs e)
+ private void OnAddLabel(object? sender, EventArgs e)
{
- if ((_ribbonLines.Ribbon != null) && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
+ if ((_ribbonLines.Ribbon is not null)
+ && _ribbonLines.Items is not null
+ && _ribbonLines.RibbonGroup is not null
+ && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupLines AddLabel");
@@ -521,7 +566,7 @@ private void OnAddLabel(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -539,9 +584,12 @@ private void OnAddLabel(object sender, EventArgs e)
}
}
- private void OnAddCustomControl(object sender, EventArgs e)
+ private void OnAddCustomControl(object? sender, EventArgs e)
{
- if ((_ribbonLines.Ribbon != null) && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
+ if ((_ribbonLines.Ribbon is not null)
+ && _ribbonLines.Items is not null
+ && _ribbonLines.RibbonGroup is not null
+ && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupLines AddCustomControl");
@@ -549,7 +597,7 @@ private void OnAddCustomControl(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -567,9 +615,12 @@ private void OnAddCustomControl(object sender, EventArgs e)
}
}
- private void OnAddTextBox(object sender, EventArgs e)
+ private void OnAddTextBox(object? sender, EventArgs e)
{
- if ((_ribbonLines.Ribbon != null) && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
+ if ((_ribbonLines.Ribbon is not null)
+ && _ribbonLines.Items is not null
+ && _ribbonLines.RibbonGroup is not null
+ && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupLines AddTextBox");
@@ -577,7 +628,7 @@ private void OnAddTextBox(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -595,9 +646,12 @@ private void OnAddTextBox(object sender, EventArgs e)
}
}
- private void OnAddMaskedTextBox(object sender, EventArgs e)
+ private void OnAddMaskedTextBox(object? sender, EventArgs e)
{
- if ((_ribbonLines.Ribbon != null) && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
+ if ((_ribbonLines.Ribbon is not null)
+ && _ribbonLines.Items is not null
+ && _ribbonLines.RibbonGroup is not null
+ && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupLines AddMaskedTextBox");
@@ -605,7 +659,7 @@ private void OnAddMaskedTextBox(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -623,9 +677,12 @@ private void OnAddMaskedTextBox(object sender, EventArgs e)
}
}
- private void OnAddRichTextBox(object sender, EventArgs e)
+ private void OnAddRichTextBox(object? sender, EventArgs e)
{
- if ((_ribbonLines.Ribbon != null) && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
+ if ((_ribbonLines.Ribbon is not null)
+ &&_ribbonLines.Items is not null
+ && _ribbonLines.RibbonGroup is not null
+ && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupLines AddRichTextBox");
@@ -633,7 +690,7 @@ private void OnAddRichTextBox(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -651,9 +708,13 @@ private void OnAddRichTextBox(object sender, EventArgs e)
}
}
- private void OnAddComboBox(object sender, EventArgs e)
+ private void OnAddComboBox(object? sender, EventArgs e)
{
- if (_ribbonLines != null && _ribbonLines.Ribbon != null && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
+ if (_ribbonLines is not null
+ && _ribbonLines.Ribbon is not null
+ && _ribbonLines.Items is not null
+ && _ribbonLines.RibbonGroup is not null
+ && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupLines AddComboBox");
@@ -661,7 +722,7 @@ private void OnAddComboBox(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -679,9 +740,12 @@ private void OnAddComboBox(object sender, EventArgs e)
}
}
- private void OnAddNumericUpDown(object sender, EventArgs e)
+ private void OnAddNumericUpDown(object? sender, EventArgs e)
{
- if ((_ribbonLines.Ribbon != null) && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
+ if ((_ribbonLines.Ribbon is not null)
+ && _ribbonLines.Items is not null
+ && _ribbonLines.RibbonGroup is not null
+ && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupLines AddNumericUpDown");
@@ -689,7 +753,7 @@ private void OnAddNumericUpDown(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -707,9 +771,12 @@ private void OnAddNumericUpDown(object sender, EventArgs e)
}
}
- private void OnAddDomainUpDown(object sender, EventArgs e)
+ private void OnAddDomainUpDown(object? sender, EventArgs e)
{
- if ((_ribbonLines.Ribbon != null) && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
+ if ((_ribbonLines.Ribbon is not null)
+ && _ribbonLines.Items is not null
+ && _ribbonLines.RibbonGroup is not null
+ && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupLines AddDomainUpDown");
@@ -717,7 +784,7 @@ private void OnAddDomainUpDown(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -735,9 +802,12 @@ private void OnAddDomainUpDown(object sender, EventArgs e)
}
}
- private void OnAddDateTimePicker(object sender, EventArgs e)
+ private void OnAddDateTimePicker(object? sender, EventArgs e)
{
- if ((_ribbonLines.Ribbon != null) && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
+ if ((_ribbonLines.Ribbon is not null)
+ && _ribbonLines.Items is not null
+ && _ribbonLines.RibbonGroup is not null
+ && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupLines AddDateTimePicker");
@@ -745,7 +815,7 @@ private void OnAddDateTimePicker(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -763,9 +833,12 @@ private void OnAddDateTimePicker(object sender, EventArgs e)
}
}
- private void OnAddTrackBar(object sender, EventArgs e)
+ private void OnAddTrackBar(object? sender, EventArgs e)
{
- if ((_ribbonLines.Ribbon != null) && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
+ if ((_ribbonLines.Ribbon is not null)
+ && _ribbonLines.Items is not null
+ && _ribbonLines.RibbonGroup is not null
+ && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupLines AddTrackBar");
@@ -773,7 +846,7 @@ private void OnAddTrackBar(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -791,9 +864,41 @@ private void OnAddTrackBar(object sender, EventArgs e)
}
}
- private void OnAddCluster(object sender, EventArgs e)
+ private void OnAddThemeComboBox(object? sender, EventArgs e)
+ {
+ if ((_ribbonLines.Ribbon is not null)
+ && _ribbonLines.Items is not null
+ && _ribbonLines.RibbonGroup is not null
+ && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
+ {
+ DesignerTransaction transaction = _designerHost.CreateTransaction("KryptonRibbonGroupLines AddThemeComboBox");
+
+ try
+ {
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
+
+ RaiseComponentChanging(propertyItems);
+
+ var tcb = (KryptonRibbonGroupThemeComboBox)_designerHost.CreateComponent(
+ typeof(KryptonRibbonGroupThemeComboBox));
+
+ _ribbonLines.Items.Add(tcb);
+
+ RaiseComponentChanged(propertyItems, null, null);
+ }
+ finally
+ {
+ transaction?.Commit();
+ }
+ }
+ }
+
+ private void OnAddCluster(object? sender, EventArgs e)
{
- if ((_ribbonLines.Ribbon != null) && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
+ if ((_ribbonLines.Ribbon is not null)
+ && _ribbonLines.Items is not null
+ && _ribbonLines.RibbonGroup is not null
+ && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupLines AddCluster");
@@ -801,7 +906,7 @@ private void OnAddCluster(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -810,7 +915,7 @@ private void OnAddCluster(object sender, EventArgs e)
_ribbonLines.Items.Add(cluster);
// Get access to the Cluster.Items property
- MemberDescriptor propertyClusterItems = TypeDescriptor.GetProperties(cluster)[@"Items"];
+ MemberDescriptor? propertyClusterItems = TypeDescriptor.GetProperties(cluster)[@"Items"];
RaiseComponentChanging(propertyClusterItems);
@@ -831,9 +936,12 @@ private void OnAddCluster(object sender, EventArgs e)
}
}
- private void OnClearItems(object sender, EventArgs e)
+ private void OnClearItems(object? sender, EventArgs e)
{
- if ((_ribbonLines.Ribbon != null) && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
+ if ((_ribbonLines.Ribbon is not null)
+ && _ribbonLines.Items is not null
+ && _ribbonLines.RibbonGroup is not null
+ && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupLines ClearItems");
@@ -841,12 +949,12 @@ private void OnClearItems(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonLines)[@"Items"];
RaiseComponentChanging(propertyItems);
// Need access to host in order to delete a component
- var host = (IDesignerHost)GetService(typeof(IDesignerHost));
+ var host = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("host"));
// We need to remove all the items from the lines group
for (var i = _ribbonLines.Items.Count - 1; i >= 0; i--)
@@ -866,9 +974,11 @@ private void OnClearItems(object sender, EventArgs e)
}
}
- private void OnDeleteLines(object sender, EventArgs e)
+ private void OnDeleteLines(object? sender, EventArgs e)
{
- if ((_ribbonLines.Ribbon != null) && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
+ if ((_ribbonLines.Ribbon is not null)
+ && _ribbonLines.RibbonGroup is not null
+ && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupLines DeleteLines");
@@ -876,7 +986,7 @@ private void OnDeleteLines(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonLines.RibbonGroup)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonLines.RibbonGroup)[@"Items"];
// Remove the ribbon group from the ribbon tab
RaiseComponentChanging(null);
@@ -899,92 +1009,111 @@ private void OnDeleteLines(object sender, EventArgs e)
}
}
- private void OnVisible(object sender, EventArgs e)
+ private void OnVisible(object? sender, EventArgs e)
{
- if ((_ribbonLines.Ribbon != null) && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
+ if ((_ribbonLines.Ribbon is not null)
+ && _ribbonLines.RibbonGroup is not null
+ && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
{
_changeService.OnComponentChanged(_ribbonLines, null, _ribbonLines.Visible, !_ribbonLines.Visible);
_ribbonLines.Visible = !_ribbonLines.Visible;
}
}
- private void OnMaxLarge(object sender, EventArgs e)
+ private void OnMaxLarge(object? sender, EventArgs e)
{
- if ((_ribbonLines.Ribbon != null) && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
+ if ((_ribbonLines.Ribbon is not null)
+ && _ribbonLines.RibbonGroup is not null
+ && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
{
_changeService.OnComponentChanged(_ribbonLines, null, _ribbonLines.MaximumSize, GroupItemSize.Large);
_ribbonLines.MaximumSize = GroupItemSize.Large;
}
}
- private void OnMaxMedium(object sender, EventArgs e)
+ private void OnMaxMedium(object? sender, EventArgs e)
{
- if ((_ribbonLines.Ribbon != null) && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
+ if ((_ribbonLines.Ribbon is not null)
+ && _ribbonLines.RibbonGroup is not null
+ && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
{
_changeService.OnComponentChanged(_ribbonLines, null, _ribbonLines.MaximumSize, GroupItemSize.Medium);
_ribbonLines.MaximumSize = GroupItemSize.Medium;
}
}
- private void OnMaxSmall(object sender, EventArgs e)
+ private void OnMaxSmall(object? sender, EventArgs e)
{
- if ((_ribbonLines.Ribbon != null) && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
+ if ((_ribbonLines.Ribbon is not null)
+ && _ribbonLines.RibbonGroup is not null
+ && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
{
_changeService.OnComponentChanged(_ribbonLines, null, _ribbonLines.MaximumSize, GroupItemSize.Small);
_ribbonLines.MaximumSize = GroupItemSize.Small;
}
}
- private void OnMinLarge(object sender, EventArgs e)
+ private void OnMinLarge(object? sender, EventArgs e)
{
- if ((_ribbonLines.Ribbon != null) && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
+ if ((_ribbonLines.Ribbon is not null)
+ && _ribbonLines.RibbonGroup is not null
+ && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
{
_changeService.OnComponentChanged(_ribbonLines, null, _ribbonLines.MinimumSize, GroupItemSize.Large);
_ribbonLines.MinimumSize = GroupItemSize.Large;
}
}
- private void OnMinMedium(object sender, EventArgs e)
+ private void OnMinMedium(object? sender, EventArgs e)
{
- if ((_ribbonLines.Ribbon != null) && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
+ if ((_ribbonLines.Ribbon is not null)
+ && _ribbonLines.RibbonGroup is not null
+ && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
{
_changeService.OnComponentChanged(_ribbonLines, null, _ribbonLines.MinimumSize, GroupItemSize.Medium);
_ribbonLines.MinimumSize = GroupItemSize.Medium;
}
}
- private void OnMinSmall(object sender, EventArgs e)
+ private void OnMinSmall(object? sender, EventArgs e)
{
- if ((_ribbonLines.Ribbon != null) && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
+ if ((_ribbonLines.Ribbon is not null)
+ && _ribbonLines.RibbonGroup is not null
+ && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
{
_changeService.OnComponentChanged(_ribbonLines, null, _ribbonLines.MinimumSize, GroupItemSize.Small);
_ribbonLines.MinimumSize = GroupItemSize.Small;
}
}
- private void OnComponentChanged(object sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
+ private void OnComponentChanged(object? sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
- private void OnComponentRemoving(object sender, ComponentEventArgs e)
+ private void OnComponentRemoving(object? sender, ComponentEventArgs e)
{
// If our component is being removed
if (e.Component == _ribbonLines)
{
// Need access to host in order to delete a component
- var host = (IDesignerHost)GetService(typeof(IDesignerHost));
+ var host = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("host"));
// We need to remove all items from the lines groups
- for (var j = _ribbonLines.Items.Count - 1; j >= 0; j--)
+ if (_ribbonLines.Items is not null)
{
- var item = _ribbonLines.Items[j] as KryptonRibbonGroupItem;
- _ribbonLines.Items.Remove(item);
- host.DestroyComponent(item);
+ for (var j = _ribbonLines.Items.Count - 1 ; j >= 0 ; j--)
+ {
+ var item = _ribbonLines.Items[j] as KryptonRibbonGroupItem;
+ _ribbonLines.Items.Remove(item);
+ host.DestroyComponent(item);
+ }
}
}
}
- private void OnContextMenu(object sender, MouseEventArgs e)
+ private void OnContextMenu(object? sender, MouseEventArgs e)
{
- if ((_ribbonLines.Ribbon != null) && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
+ if ((_ribbonLines.Ribbon is not null)
+ && _ribbonLines.RibbonGroup is not null
+ && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
{
// Create the menu strip the first time around
if (_cms == null)
@@ -1022,30 +1151,40 @@ private void OnContextMenu(object sender, MouseEventArgs e)
_addRichTextBoxMenu = new ToolStripMenuItem("Add RichTextBox", GenericImageResources.KryptonRibbonGroupRichTextBox, OnAddRichTextBox);
_addTextBoxMenu = new ToolStripMenuItem("Add TextBox", GenericImageResources.KryptonRibbonGroupTextBox, OnAddTextBox);
_addTrackBarMenu = new ToolStripMenuItem("Add TrackBar", GenericImageResources.KryptonRibbonGroupTrackBar, OnAddTrackBar);
+ _addThemeComboBoxMenu = new ToolStripMenuItem("Add ThemeComboBox", GenericImageResources.KryptonRibbonGroupComboBox, OnAddThemeComboBox);
_clearItemsMenu = new ToolStripMenuItem("Clear Items", null, OnClearItems);
_deleteLinesMenu = new ToolStripMenuItem("Delete Lines", GenericImageResources.Delete, OnDeleteLines);
- _cms.Items.AddRange(new ToolStripItem[] { _toggleHelpersMenu, new ToolStripSeparator(),
- _visibleMenu, _maximumSizeMenu, _minimumSizeMenu, new ToolStripSeparator(),
- _moveFirstMenu, _movePreviousMenu, _moveNextMenu, _moveLastMenu, new ToolStripSeparator(),
- _moveToGroupMenu, new ToolStripSeparator(),
- _addButtonMenu,
- _addCheckBoxMenu,
- _addClusterMenu,
- _addColorButtonMenu,
- _addComboBoxMenu,
- _addCustomControlMenu,
- _addDateTimePickerMenu,
- _addDomainUpDownMenu,
- _addLabelMenu,
- _addMaskedTextBoxMenu,
- _addNumericUpDownMenu,
- _addRadioButtonMenu,
- _addRichTextBoxMenu,
- _addTextBoxMenu,
- _addTrackBarMenu,
- new ToolStripSeparator(),
- _clearItemsMenu, new ToolStripSeparator(),
- _deleteLinesMenu });
+ _cms.Items.AddRange(new ToolStripItem[]
+ {
+ _toggleHelpersMenu, new ToolStripSeparator(),
+ _visibleMenu,
+ _maximumSizeMenu,
+ _minimumSizeMenu, new ToolStripSeparator(),
+ _moveFirstMenu,
+ _movePreviousMenu,
+ _moveNextMenu,
+ _moveLastMenu, new ToolStripSeparator(),
+ _moveToGroupMenu, new ToolStripSeparator(),
+ _addButtonMenu,
+ _addCheckBoxMenu,
+ _addClusterMenu,
+ _addColorButtonMenu,
+ _addComboBoxMenu,
+ _addCustomControlMenu,
+ _addDateTimePickerMenu,
+ _addDomainUpDownMenu,
+ _addLabelMenu,
+ _addMaskedTextBoxMenu,
+ _addNumericUpDownMenu,
+ _addRadioButtonMenu,
+ _addRichTextBoxMenu,
+ _addTextBoxMenu,
+ _addTrackBarMenu,
+ _addThemeComboBoxMenu,
+ new ToolStripSeparator(),
+ _clearItemsMenu, new ToolStripSeparator(),
+ _deleteLinesMenu
+ });
// Ensure add images have correct transparent background
_addButtonMenu.ImageTransparentColor = Color.Magenta;
@@ -1063,6 +1202,7 @@ private void OnContextMenu(object sender, MouseEventArgs e)
_addDomainUpDownMenu.ImageTransparentColor = Color.Magenta;
_addDateTimePickerMenu.ImageTransparentColor = Color.Magenta;
_addTrackBarMenu.ImageTransparentColor = Color.Magenta;
+ _addThemeComboBoxMenu.ImageTransparentColor = Color.Magenta;
}
// Update verbs to work out correct enable states
@@ -1101,7 +1241,7 @@ private void UpdateMoveToGroup()
// Remove any existing child items
_moveToGroupMenu.DropDownItems.Clear();
- if (_ribbonLines.Ribbon != null)
+ if (_ribbonLines.Ribbon is not null && _ribbonLines.RibbonTab is not null)
{
// Create a new item per group in the same ribbon tab
foreach (KryptonRibbonGroup group in _ribbonLines.RibbonTab.Groups)
@@ -1126,15 +1266,17 @@ private void UpdateMoveToGroup()
}
}
- private void OnMoveToGroup(object sender, EventArgs e)
+ private void OnMoveToGroup(object? sender, EventArgs e)
{
- if ((_ribbonLines.Ribbon != null) && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
+ if ((_ribbonLines.Ribbon is not null)
+ && _ribbonLines.RibbonGroup is not null
+ && _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
{
// Cast to correct type
- var groupMenuItem = (ToolStripMenuItem)sender;
+ var groupMenuItem = sender as ToolStripMenuItem ?? throw new ArgumentNullException(nameof(sender));
// Get access to the destination tab
- var destination = (KryptonRibbonGroup)groupMenuItem.Tag;
+ var destination = groupMenuItem.Tag as KryptonRibbonGroup ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("destination"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupLines MoveLinesToGroup");
@@ -1142,8 +1284,8 @@ private void OnMoveToGroup(object sender, EventArgs e)
try
{
// Get access to the Groups property
- MemberDescriptor oldItems = TypeDescriptor.GetProperties(_ribbonLines.RibbonGroup)[@"Items"];
- MemberDescriptor newItems = TypeDescriptor.GetProperties(destination)[@"Items"];
+ MemberDescriptor? oldItems = TypeDescriptor.GetProperties(_ribbonLines.RibbonGroup)[@"Items"];
+ MemberDescriptor? newItems = TypeDescriptor.GetProperties(destination)[@"Items"];
// Remove the ribbon tab from the ribbon
RaiseComponentChanging(null);
@@ -1169,4 +1311,4 @@ private void OnMoveToGroup(object sender, EventArgs e)
}
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupMaskedTextBoxDesigner.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupMaskedTextBoxDesigner.cs
index 09766e66d..400d7f921 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupMaskedTextBoxDesigner.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupMaskedTextBoxDesigner.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -60,8 +60,9 @@ public override void Initialize([DisallowNull] IComponent component)
Debug.Assert(component != null);
// Cast to correct type
- _ribbonMaskedTextBox = component as KryptonRibbonGroupMaskedTextBox;
- if (_ribbonMaskedTextBox != null)
+ _ribbonMaskedTextBox = component as KryptonRibbonGroupMaskedTextBox ?? throw new ArgumentNullException(nameof(component));
+
+ if (_ribbonMaskedTextBox is not null)
{
_ribbonMaskedTextBox.MaskedTextBoxDesigner = this;
@@ -81,8 +82,8 @@ public override void Initialize([DisallowNull] IComponent component)
}
// Get access to the services
- _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
- _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
+ _designerHost = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("_designerHost"));
+ _changeService = (IComponentChangeService?)GetService(typeof(IComponentChangeService)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("_changeService"));
// We need to know when we are being removed/changed
_changeService.ComponentChanged += OnComponentChanged;
@@ -152,12 +153,12 @@ protected override void PreFilterProperties(IDictionary properties)
// Setup the array of properties we override
var attributes = Array.Empty();
- string[] strArray = { nameof(Visible), nameof(Enabled) };
+ string[] strArray = [nameof(Visible), nameof(Enabled)];
// Adjust our list of properties
for (var i = 0; i < strArray.Length; i++)
{
- var descrip = (PropertyDescriptor)properties[strArray[i]];
+ var descrip = (PropertyDescriptor?)properties[strArray[i]];
if (descrip != null)
{
properties[strArray[i]] = TypeDescriptor.CreateProperty(typeof(KryptonRibbonGroupMaskedTextBoxDesigner), descrip, attributes);
@@ -187,7 +188,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
- _verbs = new DesignerVerbCollection();
+ _verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move TextBox First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move TextBox Previous", OnMovePrevious);
@@ -205,7 +206,7 @@ private void UpdateVerbStatus()
if (_ribbonMaskedTextBox.Ribbon != null)
{
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
moveFirst = items.IndexOf(_ribbonMaskedTextBox) > 0;
movePrev = items.IndexOf(_ribbonMaskedTextBox) > 0;
moveNext = items.IndexOf(_ribbonMaskedTextBox) < (items.Count - 1);
@@ -218,7 +219,7 @@ private void UpdateVerbStatus()
_moveLastVerb.Enabled = moveLast;
}
- private void OnToggleHelpers(object sender, EventArgs e)
+ private void OnToggleHelpers(object? sender, EventArgs e)
{
// Invert the current toggle helper mode
if (_ribbonMaskedTextBox.Ribbon != null)
@@ -227,29 +228,32 @@ private void OnToggleHelpers(object sender, EventArgs e)
}
}
- private void OnMoveFirst(object sender, EventArgs e)
+ private void OnMoveFirst(object? sender, EventArgs e)
{
- if (_ribbonMaskedTextBox.Ribbon != null)
+ if (_ribbonMaskedTextBox.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupMaskedTextBox MoveFirst");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonMaskedTextBox.RibbonContainer)[@"Items"];
+ if (_ribbonMaskedTextBox.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonMaskedTextBox.RibbonContainer)[@"Items"];
- RaiseComponentChanging(propertyItems);
+ RaiseComponentChanging(propertyItems);
- // Move position of the textbox
- items.Remove(_ribbonMaskedTextBox);
- items.Insert(0, _ribbonMaskedTextBox);
- UpdateVerbStatus();
+ // Move position of the textbox
+ items.Remove(_ribbonMaskedTextBox);
+ items.Insert(0, _ribbonMaskedTextBox);
+ UpdateVerbStatus();
- RaiseComponentChanged(propertyItems, null, null);
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -259,31 +263,34 @@ private void OnMoveFirst(object sender, EventArgs e)
}
}
- private void OnMovePrevious(object sender, EventArgs e)
+ private void OnMovePrevious(object? sender, EventArgs e)
{
- if (_ribbonMaskedTextBox.Ribbon != null)
+ if (_ribbonMaskedTextBox.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupMaskedTextBox MovePrevious");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonMaskedTextBox.RibbonContainer)[@"Items"];
-
- RaiseComponentChanging(propertyItems);
-
- // Move position of the textbox
- var index = items.IndexOf(_ribbonMaskedTextBox) - 1;
- index = Math.Max(index, 0);
- items.Remove(_ribbonMaskedTextBox);
- items.Insert(index, _ribbonMaskedTextBox);
- UpdateVerbStatus();
-
- RaiseComponentChanged(propertyItems, null, null);
+ if (_ribbonMaskedTextBox.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonMaskedTextBox.RibbonContainer)[@"Items"];
+
+ RaiseComponentChanging(propertyItems);
+
+ // Move position of the textbox
+ var index = items.IndexOf(_ribbonMaskedTextBox) - 1;
+ index = Math.Max(index, 0);
+ items.Remove(_ribbonMaskedTextBox);
+ items.Insert(index, _ribbonMaskedTextBox);
+ UpdateVerbStatus();
+
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -293,31 +300,34 @@ private void OnMovePrevious(object sender, EventArgs e)
}
}
- private void OnMoveNext(object sender, EventArgs e)
+ private void OnMoveNext(object? sender, EventArgs e)
{
- if (_ribbonMaskedTextBox.Ribbon != null)
+ if (_ribbonMaskedTextBox.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupMaskedTextBox MoveNext");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonMaskedTextBox.RibbonContainer)[@"Items"];
-
- RaiseComponentChanging(propertyItems);
-
- // Move position of the textbox
- var index = items.IndexOf(_ribbonMaskedTextBox) + 1;
- index = Math.Min(index, items.Count - 1);
- items.Remove(_ribbonMaskedTextBox);
- items.Insert(index, _ribbonMaskedTextBox);
- UpdateVerbStatus();
-
- RaiseComponentChanged(propertyItems, null, null);
+ if (_ribbonMaskedTextBox.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonMaskedTextBox.RibbonContainer)[@"Items"];
+
+ RaiseComponentChanging(propertyItems);
+
+ // Move position of the textbox
+ var index = items.IndexOf(_ribbonMaskedTextBox) + 1;
+ index = Math.Min(index, items.Count - 1);
+ items.Remove(_ribbonMaskedTextBox);
+ items.Insert(index, _ribbonMaskedTextBox);
+ UpdateVerbStatus();
+
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -327,29 +337,32 @@ private void OnMoveNext(object sender, EventArgs e)
}
}
- private void OnMoveLast(object sender, EventArgs e)
+ private void OnMoveLast(object? sender, EventArgs e)
{
- if (_ribbonMaskedTextBox.Ribbon != null)
+ if (_ribbonMaskedTextBox.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupMaskedTextBox MoveLast");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonMaskedTextBox.RibbonContainer)[@"Items"];
+ if (_ribbonMaskedTextBox.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonMaskedTextBox.RibbonContainer)[@"Items"];
- RaiseComponentChanging(propertyItems);
+ RaiseComponentChanging(propertyItems);
- // Move position of the textbox
- items.Remove(_ribbonMaskedTextBox);
- items.Insert(items.Count, _ribbonMaskedTextBox);
- UpdateVerbStatus();
+ // Move position of the textbox
+ items.Remove(_ribbonMaskedTextBox);
+ items.Insert(items.Count, _ribbonMaskedTextBox);
+ UpdateVerbStatus();
- RaiseComponentChanged(propertyItems, null, null);
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -359,32 +372,35 @@ private void OnMoveLast(object sender, EventArgs e)
}
}
- private void OnDeleteTextBox(object sender, EventArgs e)
+ private void OnDeleteTextBox(object? sender, EventArgs e)
{
- if (_ribbonMaskedTextBox.Ribbon != null)
+ if (_ribbonMaskedTextBox.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupMaskedTextBox DeleteTextBox");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonMaskedTextBox.RibbonContainer)[@"Items"];
+ if (_ribbonMaskedTextBox.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonMaskedTextBox.RibbonContainer)[@"Items"];
- RaiseComponentChanging(null);
- RaiseComponentChanging(propertyItems);
+ RaiseComponentChanging(null);
+ RaiseComponentChanging(propertyItems);
- // Remove the textbox from the group
- items.Remove(_ribbonMaskedTextBox);
+ // Remove the textbox from the group
+ items.Remove(_ribbonMaskedTextBox);
- // Get designer to destroy it
- _designerHost.DestroyComponent(_ribbonMaskedTextBox);
+ // Get designer to destroy it
+ _designerHost.DestroyComponent(_ribbonMaskedTextBox);
- RaiseComponentChanged(propertyItems, null, null);
- RaiseComponentChanged(null, null, null);
+ RaiseComponentChanged(propertyItems, null, null);
+ RaiseComponentChanged(null, null, null);
+ }
}
finally
{
@@ -394,33 +410,33 @@ private void OnDeleteTextBox(object sender, EventArgs e)
}
}
- private void OnEnabled(object sender, EventArgs e)
+ private void OnEnabled(object? sender, EventArgs e)
{
if (_ribbonMaskedTextBox.Ribbon != null)
{
- PropertyDescriptor propertyEnabled = TypeDescriptor.GetProperties(_ribbonMaskedTextBox)[nameof(Enabled)];
- var oldValue = (bool)propertyEnabled.GetValue(_ribbonMaskedTextBox);
+ PropertyDescriptor? propertyEnabled = TypeDescriptor.GetProperties(_ribbonMaskedTextBox)[nameof(Enabled)] ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("propertyEnabled"));
+ var oldValue = (bool?)propertyEnabled.GetValue(_ribbonMaskedTextBox);
var newValue = !oldValue;
_changeService.OnComponentChanged(_ribbonMaskedTextBox, null, oldValue, newValue);
propertyEnabled.SetValue(_ribbonMaskedTextBox, newValue);
}
}
- private void OnVisible(object sender, EventArgs e)
+ private void OnVisible(object? sender, EventArgs e)
{
if (_ribbonMaskedTextBox.Ribbon != null)
{
- PropertyDescriptor propertyVisible = TypeDescriptor.GetProperties(_ribbonMaskedTextBox)[nameof(Visible)];
- var oldValue = (bool)propertyVisible.GetValue(_ribbonMaskedTextBox);
+ PropertyDescriptor? propertyVisible = TypeDescriptor.GetProperties(_ribbonMaskedTextBox)[nameof(Visible)] ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("propertyVisible"));
+ var oldValue = (bool?)propertyVisible.GetValue(_ribbonMaskedTextBox);
var newValue = !oldValue;
_changeService.OnComponentChanged(_ribbonMaskedTextBox, null, oldValue, newValue);
propertyVisible.SetValue(_ribbonMaskedTextBox, newValue);
}
}
- private void OnComponentChanged(object sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
+ private void OnComponentChanged(object? sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
- private void OnContextMenu(object sender, MouseEventArgs e)
+ private void OnContextMenu(object? sender, MouseEventArgs e)
{
if (_ribbonMaskedTextBox.Ribbon != null)
{
@@ -474,6 +490,7 @@ private TypedRestrictCollection? ParentItems
default:
// Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(_ribbonMaskedTextBox.RibbonContainer!.ToString());
return null;
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupNumericUpDownDesigner.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupNumericUpDownDesigner.cs
index 6db93b721..a0243e751 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupNumericUpDownDesigner.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupNumericUpDownDesigner.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -60,7 +60,8 @@ public override void Initialize([DisallowNull] IComponent component)
Debug.Assert(component != null);
// Cast to correct type
- _ribbonNumericUpDown = component as KryptonRibbonGroupNumericUpDown;
+ _ribbonNumericUpDown = component as KryptonRibbonGroupNumericUpDown ?? throw new ArgumentNullException(nameof(component));
+
if (_ribbonNumericUpDown != null)
{
_ribbonNumericUpDown.NumericUpDownDesigner = this;
@@ -74,15 +75,15 @@ public override void Initialize([DisallowNull] IComponent component)
_ribbonNumericUpDown.Enabled = true;
// Tell the embedded numeric up-down control it is in design mode
- _ribbonNumericUpDown.NumericUpDown.InRibbonDesignMode = true;
+ _ribbonNumericUpDown.NumericUpDown!.InRibbonDesignMode = true;
// Hook into events
_ribbonNumericUpDown.DesignTimeContextMenu += OnContextMenu;
}
// Get access to the services
- _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
- _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
+ _designerHost = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("_designerHost"));
+ _changeService = (IComponentChangeService?)GetService(typeof(IComponentChangeService)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("_changeService"));
// We need to know when we are being removed/changed
_changeService.ComponentChanged += OnComponentChanged;
@@ -152,7 +153,7 @@ protected override void PreFilterProperties(IDictionary properties)
// Setup the array of properties we override
var attributes = Array.Empty();
- string[] strArray = { nameof(Visible), nameof(Enabled) };
+ string[] strArray = [nameof(Visible), nameof(Enabled)];
// Adjust our list of properties
for (var i = 0; i < strArray.Length; i++)
@@ -186,7 +187,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
- _verbs = new DesignerVerbCollection();
+ _verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move NumericUpDown First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move NumericUpDown Previous", OnMovePrevious);
@@ -204,7 +205,7 @@ private void UpdateVerbStatus()
if (_ribbonNumericUpDown.Ribbon != null)
{
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
moveFirst = items.IndexOf(_ribbonNumericUpDown) > 0;
movePrev = items.IndexOf(_ribbonNumericUpDown) > 0;
moveNext = items.IndexOf(_ribbonNumericUpDown) < (items.Count - 1);
@@ -217,7 +218,7 @@ private void UpdateVerbStatus()
_moveLastVerb.Enabled = moveLast;
}
- private void OnToggleHelpers(object sender, EventArgs e)
+ private void OnToggleHelpers(object? sender, EventArgs e)
{
// Invert the current toggle helper mode
if (_ribbonNumericUpDown.Ribbon != null)
@@ -226,29 +227,32 @@ private void OnToggleHelpers(object sender, EventArgs e)
}
}
- private void OnMoveFirst(object sender, EventArgs e)
+ private void OnMoveFirst(object? sender, EventArgs e)
{
- if (_ribbonNumericUpDown.Ribbon != null)
+ if (_ribbonNumericUpDown.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupNumericUpDown MoveFirst");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonNumericUpDown.RibbonContainer)[@"Items"];
+ if (_ribbonNumericUpDown.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonNumericUpDown.RibbonContainer)[@"Items"];
- RaiseComponentChanging(propertyItems);
+ RaiseComponentChanging(propertyItems);
- // Move position of the numeric up-down
- items.Remove(_ribbonNumericUpDown);
- items.Insert(0, _ribbonNumericUpDown);
- UpdateVerbStatus();
+ // Move position of the numeric up-down
+ items.Remove(_ribbonNumericUpDown);
+ items.Insert(0, _ribbonNumericUpDown);
+ UpdateVerbStatus();
- RaiseComponentChanged(propertyItems, null, null);
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -258,31 +262,33 @@ private void OnMoveFirst(object sender, EventArgs e)
}
}
- private void OnMovePrevious(object sender, EventArgs e)
+ private void OnMovePrevious(object? sender, EventArgs e)
{
- if (_ribbonNumericUpDown.Ribbon != null)
+ if (_ribbonNumericUpDown.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupNumericUpDown MovePrevious");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonNumericUpDown.RibbonContainer)[@"Items"];
+ if (_ribbonNumericUpDown.RibbonContainer is not null)
+ {// Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonNumericUpDown.RibbonContainer)[@"Items"];
- RaiseComponentChanging(propertyItems);
+ RaiseComponentChanging(propertyItems);
- // Move position of the numeric up-down
- var index = items.IndexOf(_ribbonNumericUpDown) - 1;
- index = Math.Max(index, 0);
- items.Remove(_ribbonNumericUpDown);
- items.Insert(index, _ribbonNumericUpDown);
- UpdateVerbStatus();
+ // Move position of the numeric up-down
+ var index = items.IndexOf(_ribbonNumericUpDown) - 1;
+ index = Math.Max(index, 0);
+ items.Remove(_ribbonNumericUpDown);
+ items.Insert(index, _ribbonNumericUpDown);
+ UpdateVerbStatus();
- RaiseComponentChanged(propertyItems, null, null);
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -292,31 +298,34 @@ private void OnMovePrevious(object sender, EventArgs e)
}
}
- private void OnMoveNext(object sender, EventArgs e)
+ private void OnMoveNext(object? sender, EventArgs e)
{
- if (_ribbonNumericUpDown.Ribbon != null)
+ if (_ribbonNumericUpDown.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupNumericUpDown MoveNext");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonNumericUpDown.RibbonContainer)[@"Items"];
-
- RaiseComponentChanging(propertyItems);
-
- // Move position of the numeric up-down
- var index = items.IndexOf(_ribbonNumericUpDown) + 1;
- index = Math.Min(index, items.Count - 1);
- items.Remove(_ribbonNumericUpDown);
- items.Insert(index, _ribbonNumericUpDown);
- UpdateVerbStatus();
-
- RaiseComponentChanged(propertyItems, null, null);
+ if (_ribbonNumericUpDown.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonNumericUpDown.RibbonContainer)[@"Items"];
+
+ RaiseComponentChanging(propertyItems);
+
+ // Move position of the numeric up-down
+ var index = items.IndexOf(_ribbonNumericUpDown) + 1;
+ index = Math.Min(index, items.Count - 1);
+ items.Remove(_ribbonNumericUpDown);
+ items.Insert(index, _ribbonNumericUpDown);
+ UpdateVerbStatus();
+
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -326,29 +335,32 @@ private void OnMoveNext(object sender, EventArgs e)
}
}
- private void OnMoveLast(object sender, EventArgs e)
+ private void OnMoveLast(object? sender, EventArgs e)
{
- if (_ribbonNumericUpDown.Ribbon != null)
+ if (_ribbonNumericUpDown.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupNumericUpDown MoveLast");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonNumericUpDown.RibbonContainer)[@"Items"];
+ if (_ribbonNumericUpDown.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonNumericUpDown.RibbonContainer)[@"Items"];
- RaiseComponentChanging(propertyItems);
+ RaiseComponentChanging(propertyItems);
- // Move position of the numeric up-down
- items.Remove(_ribbonNumericUpDown);
- items.Insert(items.Count, _ribbonNumericUpDown);
- UpdateVerbStatus();
+ // Move position of the numeric up-down
+ items.Remove(_ribbonNumericUpDown);
+ items.Insert(items.Count, _ribbonNumericUpDown);
+ UpdateVerbStatus();
- RaiseComponentChanged(propertyItems, null, null);
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -358,32 +370,35 @@ private void OnMoveLast(object sender, EventArgs e)
}
}
- private void OnDeleteNumericUpDown(object sender, EventArgs e)
+ private void OnDeleteNumericUpDown(object? sender, EventArgs e)
{
if (_ribbonNumericUpDown.Ribbon != null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupNumericUpDown DeleteNumericUpDown");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonNumericUpDown.RibbonContainer)[@"Items"];
+ if (_ribbonNumericUpDown.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonNumericUpDown.RibbonContainer)[@"Items"];
- RaiseComponentChanging(null);
- RaiseComponentChanging(propertyItems);
+ RaiseComponentChanging(null);
+ RaiseComponentChanging(propertyItems);
- // Remove the numeric up-down from the group
- items.Remove(_ribbonNumericUpDown);
+ // Remove the numeric up-down from the group
+ items.Remove(_ribbonNumericUpDown);
- // Get designer to destroy it
- _designerHost.DestroyComponent(_ribbonNumericUpDown);
+ // Get designer to destroy it
+ _designerHost.DestroyComponent(_ribbonNumericUpDown);
- RaiseComponentChanged(propertyItems, null, null);
- RaiseComponentChanged(null, null, null);
+ RaiseComponentChanged(propertyItems, null, null);
+ RaiseComponentChanged(null, null, null);
+ }
}
finally
{
@@ -393,33 +408,33 @@ private void OnDeleteNumericUpDown(object sender, EventArgs e)
}
}
- private void OnEnabled(object sender, EventArgs e)
+ private void OnEnabled(object? sender, EventArgs e)
{
if (_ribbonNumericUpDown.Ribbon != null)
{
- PropertyDescriptor propertyEnabled = TypeDescriptor.GetProperties(_ribbonNumericUpDown)[nameof(Enabled)];
- var oldValue = (bool)propertyEnabled.GetValue(_ribbonNumericUpDown);
+ PropertyDescriptor? propertyEnabled = TypeDescriptor.GetProperties(_ribbonNumericUpDown)[nameof(Enabled)] ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("propertyEnabled"));
+ var oldValue = (bool?)propertyEnabled.GetValue(_ribbonNumericUpDown);
var newValue = !oldValue;
_changeService.OnComponentChanged(_ribbonNumericUpDown, null, oldValue, newValue);
propertyEnabled.SetValue(_ribbonNumericUpDown, newValue);
}
}
- private void OnVisible(object sender, EventArgs e)
+ private void OnVisible(object? sender, EventArgs e)
{
if (_ribbonNumericUpDown.Ribbon != null)
{
- PropertyDescriptor propertyVisible = TypeDescriptor.GetProperties(_ribbonNumericUpDown)[nameof(Visible)];
- var oldValue = (bool)propertyVisible.GetValue(_ribbonNumericUpDown);
+ PropertyDescriptor? propertyVisible = TypeDescriptor.GetProperties(_ribbonNumericUpDown)[nameof(Visible)] ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("propertyVisible"));
+ var oldValue = (bool?)propertyVisible.GetValue(_ribbonNumericUpDown);
var newValue = !oldValue;
_changeService.OnComponentChanged(_ribbonNumericUpDown, null, oldValue, newValue);
propertyVisible.SetValue(_ribbonNumericUpDown, newValue);
}
}
- private void OnComponentChanged(object sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
+ private void OnComponentChanged(object? sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
- private void OnContextMenu(object sender, MouseEventArgs e)
+ private void OnContextMenu(object? sender, MouseEventArgs e)
{
if (_ribbonNumericUpDown.Ribbon != null)
{
@@ -473,6 +488,7 @@ private TypedRestrictCollection? ParentItems
default:
// Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(_ribbonNumericUpDown.RibbonContainer!.ToString());
return null;
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupRadioButtonDesigner.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupRadioButtonDesigner.cs
index 8b92aa438..5893a4ce3 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupRadioButtonDesigner.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupRadioButtonDesigner.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -61,18 +61,18 @@ public override void Initialize([DisallowNull] IComponent component)
Debug.Assert(component != null);
// Cast to correct type
- _ribbonRadioButton = component as KryptonRibbonGroupRadioButton;
+ _ribbonRadioButton = component as KryptonRibbonGroupRadioButton ?? throw new ArgumentNullException(nameof(component));
if (_ribbonRadioButton != null)
{
_ribbonRadioButton.DesignTimeContextMenu += OnContextMenu;
}
// Get access to the services
- _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
- _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
+ _designerHost = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_designerHost)));
+ _changeService = (IComponentChangeService?)GetService(typeof(IComponentChangeService)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_changeService)));
// We need to know when we are being removed/changed
- _changeService.ComponentChanged += OnComponentChanged;
+ _changeService!.ComponentChanged += OnComponentChanged;
}
///
@@ -118,7 +118,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
- _verbs = new DesignerVerbCollection();
+ _verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move RadioButton First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move RadioButton Previous", OnMovePrevious);
@@ -136,7 +136,7 @@ private void UpdateVerbStatus()
if (_ribbonRadioButton.Ribbon != null)
{
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(ParentItems)));
moveFirst = items.IndexOf(_ribbonRadioButton) > 0;
movePrev = items.IndexOf(_ribbonRadioButton) > 0;
moveNext = items.IndexOf(_ribbonRadioButton) < (items.Count - 1);
@@ -149,7 +149,7 @@ private void UpdateVerbStatus()
_moveLastVerb.Enabled = moveLast;
}
- private void OnToggleHelpers(object sender, EventArgs e)
+ private void OnToggleHelpers(object? sender, EventArgs e)
{
// Invert the current toggle helper mode
if (_ribbonRadioButton.Ribbon != null)
@@ -158,12 +158,12 @@ private void OnToggleHelpers(object sender, EventArgs e)
}
}
- private void OnMoveFirst(object sender, EventArgs e)
+ private void OnMoveFirst(object? sender, EventArgs e)
{
if (_ribbonRadioButton.Ribbon != null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(ParentItems)));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupRadioButton MoveFirst");
@@ -171,7 +171,7 @@ private void OnMoveFirst(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonRadioButton.RibbonContainer)[@"Items"];
+ MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonRadioButton.RibbonContainer!)[@"Items"] ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("propertyItems"));
RaiseComponentChanging(propertyItems);
@@ -190,12 +190,12 @@ private void OnMoveFirst(object sender, EventArgs e)
}
}
- private void OnMovePrevious(object sender, EventArgs e)
+ private void OnMovePrevious(object? sender, EventArgs e)
{
if (_ribbonRadioButton.Ribbon != null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(ParentItems)));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupRadioButton MovePrevious");
@@ -203,7 +203,7 @@ private void OnMovePrevious(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonRadioButton.RibbonContainer)[@"Items"];
+ MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonRadioButton.RibbonContainer!)[@"Items"] ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("propertyItems"));
RaiseComponentChanging(propertyItems);
@@ -224,12 +224,12 @@ private void OnMovePrevious(object sender, EventArgs e)
}
}
- private void OnMoveNext(object sender, EventArgs e)
+ private void OnMoveNext(object? sender, EventArgs e)
{
if (_ribbonRadioButton.Ribbon != null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(ParentItems)));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupRadioButton MoveNext");
@@ -237,7 +237,7 @@ private void OnMoveNext(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonRadioButton.RibbonContainer)[@"Items"];
+ MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonRadioButton.RibbonContainer!)[@"Items"] ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("propertyItems"));
RaiseComponentChanging(propertyItems);
@@ -258,12 +258,12 @@ private void OnMoveNext(object sender, EventArgs e)
}
}
- private void OnMoveLast(object sender, EventArgs e)
+ private void OnMoveLast(object? sender, EventArgs e)
{
if (_ribbonRadioButton.Ribbon != null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(ParentItems)));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupRadioButton MoveLast");
@@ -271,7 +271,7 @@ private void OnMoveLast(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonRadioButton.RibbonContainer)[@"Items"];
+ MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonRadioButton.RibbonContainer!)[@"Items"] ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("propertyItems"));
RaiseComponentChanging(propertyItems);
@@ -290,12 +290,12 @@ private void OnMoveLast(object sender, EventArgs e)
}
}
- private void OnDeleteRadioButton(object sender, EventArgs e)
+ private void OnDeleteRadioButton(object? sender, EventArgs e)
{
if (_ribbonRadioButton.Ribbon != null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(ParentItems)));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupRadioButton DeleteRadioButton");
@@ -303,7 +303,7 @@ private void OnDeleteRadioButton(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonRadioButton.RibbonContainer)[@"Items"];
+ MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonRadioButton.RibbonContainer!)[@"Items"] ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("propertyItems"));
// Remove the ribbon group from the ribbon tab
RaiseComponentChanging(null);
@@ -326,7 +326,7 @@ private void OnDeleteRadioButton(object sender, EventArgs e)
}
}
- private void OnVisible(object sender, EventArgs e)
+ private void OnVisible(object? sender, EventArgs e)
{
if (_ribbonRadioButton.Ribbon != null)
{
@@ -335,7 +335,7 @@ private void OnVisible(object sender, EventArgs e)
}
}
- private void OnEnabled(object sender, EventArgs e)
+ private void OnEnabled(object? sender, EventArgs e)
{
if (_ribbonRadioButton.Ribbon != null)
{
@@ -344,7 +344,7 @@ private void OnEnabled(object sender, EventArgs e)
}
}
- private void OnChecked(object sender, EventArgs e)
+ private void OnChecked(object? sender, EventArgs e)
{
if (_ribbonRadioButton.Ribbon != null)
{
@@ -353,9 +353,9 @@ private void OnChecked(object sender, EventArgs e)
}
}
- private void OnComponentChanged(object sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
+ private void OnComponentChanged(object? sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
- private void OnContextMenu(object sender, MouseEventArgs e)
+ private void OnContextMenu(object? sender, MouseEventArgs e)
{
if (_ribbonRadioButton.Ribbon != null)
{
@@ -413,6 +413,7 @@ private TypedRestrictCollection? ParentItems
default:
// Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(_ribbonRadioButton.RibbonContainer!.ToString());
return null;
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupRichTextBoxDesigner.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupRichTextBoxDesigner.cs
index ace33655a..6d2b76a95 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupRichTextBoxDesigner.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupRichTextBoxDesigner.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -57,11 +57,12 @@ public override void Initialize([DisallowNull] IComponent component)
// Let base class do standard stuff
base.Initialize(component);
- Debug.Assert(component != null);
+ Debug.Assert(component is not null);
// Cast to correct type
- _ribbonRichTextBox = component as KryptonRibbonGroupRichTextBox;
- if (_ribbonRichTextBox != null)
+ _ribbonRichTextBox = component as KryptonRibbonGroupRichTextBox ?? throw new ArgumentNullException(nameof(component));
+
+ if (_ribbonRichTextBox is not null)
{
_ribbonRichTextBox.RichTextBoxDesigner = this;
@@ -74,15 +75,15 @@ public override void Initialize([DisallowNull] IComponent component)
_ribbonRichTextBox.Enabled = true;
// Tell the embedded text box it is in design mode
- _ribbonRichTextBox.RichTextBox.InRibbonDesignMode = true;
+ _ribbonRichTextBox.RichTextBox!.InRibbonDesignMode = true;
// Hook into events
_ribbonRichTextBox.DesignTimeContextMenu += OnContextMenu;
}
// Get access to the services
- _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
- _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
+ _designerHost = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_designerHost)));
+ _changeService = (IComponentChangeService?)GetService(typeof(IComponentChangeService)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_changeService)));
// We need to know when we are being removed/changed
_changeService.ComponentChanged += OnComponentChanged;
@@ -152,12 +153,12 @@ protected override void PreFilterProperties(IDictionary properties)
// Setup the array of properties we override
var attributes = Array.Empty();
- string[] strArray = { nameof(Visible), nameof(Enabled) };
+ string[] strArray = [nameof(Visible), nameof(Enabled)];
// Adjust our list of properties
for (var i = 0; i < strArray.Length; i++)
{
- var descrip = (PropertyDescriptor)properties[strArray[i]];
+ var descrip = (PropertyDescriptor?)properties[strArray[i]];
if (descrip != null)
{
properties[strArray[i]] = TypeDescriptor.CreateProperty(typeof(KryptonRibbonGroupRichTextBoxDesigner), descrip, attributes);
@@ -187,7 +188,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
- _verbs = new DesignerVerbCollection();
+ _verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move RichTextBox First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move RichTextBox Previous", OnMovePrevious);
@@ -205,7 +206,7 @@ private void UpdateVerbStatus()
if (_ribbonRichTextBox.Ribbon != null)
{
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
moveFirst = items.IndexOf(_ribbonRichTextBox) > 0;
movePrev = items.IndexOf(_ribbonRichTextBox) > 0;
moveNext = items.IndexOf(_ribbonRichTextBox) < (items.Count - 1);
@@ -218,7 +219,7 @@ private void UpdateVerbStatus()
_moveLastVerb.Enabled = moveLast;
}
- private void OnToggleHelpers(object sender, EventArgs e)
+ private void OnToggleHelpers(object? sender, EventArgs e)
{
// Invert the current toggle helper mode
if (_ribbonRichTextBox.Ribbon != null)
@@ -227,29 +228,32 @@ private void OnToggleHelpers(object sender, EventArgs e)
}
}
- private void OnMoveFirst(object sender, EventArgs e)
+ private void OnMoveFirst(object? sender, EventArgs e)
{
if (_ribbonRichTextBox.Ribbon != null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupRichTextBox MoveFirst");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonRichTextBox.RibbonContainer)[@"Items"];
+ if (_ribbonRichTextBox.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonRichTextBox.RibbonContainer)[@"Items"];
- RaiseComponentChanging(propertyItems);
+ RaiseComponentChanging(propertyItems);
- // Move position of the richtextbox
- items.Remove(_ribbonRichTextBox);
- items.Insert(0, _ribbonRichTextBox);
- UpdateVerbStatus();
+ // Move position of the richtextbox
+ items.Remove(_ribbonRichTextBox);
+ items.Insert(0, _ribbonRichTextBox);
+ UpdateVerbStatus();
- RaiseComponentChanged(propertyItems, null, null);
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -259,31 +263,34 @@ private void OnMoveFirst(object sender, EventArgs e)
}
}
- private void OnMovePrevious(object sender, EventArgs e)
+ private void OnMovePrevious(object? sender, EventArgs e)
{
if (_ribbonRichTextBox.Ribbon != null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupRichTextBox MovePrevious");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonRichTextBox.RibbonContainer)[@"Items"];
-
- RaiseComponentChanging(propertyItems);
-
- // Move position of the richtextbox
- var index = items.IndexOf(_ribbonRichTextBox) - 1;
- index = Math.Max(index, 0);
- items.Remove(_ribbonRichTextBox);
- items.Insert(index, _ribbonRichTextBox);
- UpdateVerbStatus();
-
- RaiseComponentChanged(propertyItems, null, null);
+ if (_ribbonRichTextBox.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonRichTextBox.RibbonContainer)[@"Items"];
+
+ RaiseComponentChanging(propertyItems);
+
+ // Move position of the richtextbox
+ var index = items.IndexOf(_ribbonRichTextBox) - 1;
+ index = Math.Max(index, 0);
+ items.Remove(_ribbonRichTextBox);
+ items.Insert(index, _ribbonRichTextBox);
+ UpdateVerbStatus();
+
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -293,31 +300,34 @@ private void OnMovePrevious(object sender, EventArgs e)
}
}
- private void OnMoveNext(object sender, EventArgs e)
+ private void OnMoveNext(object? sender, EventArgs e)
{
if (_ribbonRichTextBox.Ribbon != null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupRichTextBox MoveNext");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonRichTextBox.RibbonContainer)[@"Items"];
-
- RaiseComponentChanging(propertyItems);
-
- // Move position of the richtextbox
- var index = items.IndexOf(_ribbonRichTextBox) + 1;
- index = Math.Min(index, items.Count - 1);
- items.Remove(_ribbonRichTextBox);
- items.Insert(index, _ribbonRichTextBox);
- UpdateVerbStatus();
-
- RaiseComponentChanged(propertyItems, null, null);
+ if (_ribbonRichTextBox.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonRichTextBox.RibbonContainer)[@"Items"];
+
+ RaiseComponentChanging(propertyItems);
+
+ // Move position of the richtextbox
+ var index = items.IndexOf(_ribbonRichTextBox) + 1;
+ index = Math.Min(index, items.Count - 1);
+ items.Remove(_ribbonRichTextBox);
+ items.Insert(index, _ribbonRichTextBox);
+ UpdateVerbStatus();
+
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -327,29 +337,32 @@ private void OnMoveNext(object sender, EventArgs e)
}
}
- private void OnMoveLast(object sender, EventArgs e)
+ private void OnMoveLast(object? sender, EventArgs e)
{
if (_ribbonRichTextBox.Ribbon != null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupRichTextBox MoveLast");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonRichTextBox.RibbonContainer)[@"Items"];
+ if (_ribbonRichTextBox.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonRichTextBox.RibbonContainer)[@"Items"];
- RaiseComponentChanging(propertyItems);
+ RaiseComponentChanging(propertyItems);
- // Move position of the richtextbox
- items.Remove(_ribbonRichTextBox);
- items.Insert(items.Count, _ribbonRichTextBox);
- UpdateVerbStatus();
+ // Move position of the richtextbox
+ items.Remove(_ribbonRichTextBox);
+ items.Insert(items.Count, _ribbonRichTextBox);
+ UpdateVerbStatus();
- RaiseComponentChanged(propertyItems, null, null);
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -359,32 +372,35 @@ private void OnMoveLast(object sender, EventArgs e)
}
}
- private void OnDeleteTextBox(object sender, EventArgs e)
+ private void OnDeleteTextBox(object? sender, EventArgs e)
{
if (_ribbonRichTextBox.Ribbon != null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupRichTextBox DeleteRichTextBox");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonRichTextBox.RibbonContainer)[@"Items"];
+ if (_ribbonRichTextBox.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonRichTextBox.RibbonContainer)[@"Items"];
- RaiseComponentChanging(null);
- RaiseComponentChanging(propertyItems);
+ RaiseComponentChanging(null);
+ RaiseComponentChanging(propertyItems);
- // Remove the richtextbox from the group
- items.Remove(_ribbonRichTextBox);
+ // Remove the richtextbox from the group
+ items.Remove(_ribbonRichTextBox);
- // Get designer to destroy it
- _designerHost.DestroyComponent(_ribbonRichTextBox);
+ // Get designer to destroy it
+ _designerHost.DestroyComponent(_ribbonRichTextBox);
- RaiseComponentChanged(propertyItems, null, null);
- RaiseComponentChanged(null, null, null);
+ RaiseComponentChanged(propertyItems, null, null);
+ RaiseComponentChanged(null, null, null);
+ }
}
finally
{
@@ -394,33 +410,33 @@ private void OnDeleteTextBox(object sender, EventArgs e)
}
}
- private void OnEnabled(object sender, EventArgs e)
+ private void OnEnabled(object? sender, EventArgs e)
{
- if (_ribbonRichTextBox.Ribbon != null)
+ if (_ribbonRichTextBox.Ribbon is not null)
{
- PropertyDescriptor propertyEnabled = TypeDescriptor.GetProperties(_ribbonRichTextBox)[nameof(Enabled)];
- var oldValue = (bool)propertyEnabled.GetValue(_ribbonRichTextBox);
+ PropertyDescriptor? propertyEnabled = TypeDescriptor.GetProperties(_ribbonRichTextBox)[nameof(Enabled)] ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("propertyEnabled"));
+ var oldValue = (bool?)propertyEnabled.GetValue(_ribbonRichTextBox);
var newValue = !oldValue;
_changeService.OnComponentChanged(_ribbonRichTextBox, null, oldValue, newValue);
propertyEnabled.SetValue(_ribbonRichTextBox, newValue);
}
}
- private void OnVisible(object sender, EventArgs e)
+ private void OnVisible(object? sender, EventArgs e)
{
- if (_ribbonRichTextBox.Ribbon != null)
+ if (_ribbonRichTextBox.Ribbon is not null)
{
- PropertyDescriptor propertyVisible = TypeDescriptor.GetProperties(_ribbonRichTextBox)[nameof(Visible)];
- var oldValue = (bool)propertyVisible.GetValue(_ribbonRichTextBox);
+ PropertyDescriptor? propertyVisible = TypeDescriptor.GetProperties(_ribbonRichTextBox)[nameof(Visible)] ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("propertyVisible"));
+ var oldValue = (bool?)propertyVisible.GetValue(_ribbonRichTextBox);
var newValue = !oldValue;
_changeService.OnComponentChanged(_ribbonRichTextBox, null, oldValue, newValue);
propertyVisible.SetValue(_ribbonRichTextBox, newValue);
}
}
- private void OnComponentChanged(object sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
+ private void OnComponentChanged(object? sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
- private void OnContextMenu(object sender, MouseEventArgs e)
+ private void OnContextMenu(object? sender, MouseEventArgs e)
{
if (_ribbonRichTextBox.Ribbon != null)
{
@@ -465,7 +481,7 @@ private TypedRestrictCollection? ParentItems
{
get
{
- switch (_ribbonRichTextBox.RibbonContainer)
+ switch (_ribbonRichTextBox!.RibbonContainer)
{
case KryptonRibbonGroupTriple triple:
return triple.Items;
@@ -474,6 +490,7 @@ private TypedRestrictCollection? ParentItems
default:
// Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(_ribbonRichTextBox.RibbonContainer!.ToString());
return null;
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupSeparatorDesigner.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupSeparatorDesigner.cs
index 35972c0fe..457726dc5 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupSeparatorDesigner.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupSeparatorDesigner.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -59,15 +59,16 @@ public override void Initialize([DisallowNull] IComponent component)
Debug.Assert(component != null);
// Cast to correct type
- _ribbonSeparator = component as KryptonRibbonGroupSeparator;
+ _ribbonSeparator = component as KryptonRibbonGroupSeparator ?? throw new ArgumentNullException(nameof(component));
+
if (_ribbonSeparator != null)
{
_ribbonSeparator.DesignTimeContextMenu += OnContextMenu;
}
// Get access to the services
- _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
- _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
+ _designerHost = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_designerHost)));
+ _changeService = (IComponentChangeService?)GetService(typeof(IComponentChangeService)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_changeService)));
// We need to know when we are being removed/changed
_changeService.ComponentChanged += OnComponentChanged;
@@ -81,6 +82,12 @@ public override DesignerVerbCollection Verbs
get
{
UpdateVerbStatus();
+
+ if (_verbs is null)
+ {
+ throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_verbs)));
+ }
+
return _verbs;
}
}
@@ -116,7 +123,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
- _verbs = new DesignerVerbCollection();
+ _verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move Separator First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move Separator Previous", OnMovePrevious);
@@ -134,7 +141,9 @@ private void UpdateVerbStatus()
var moveNext = false;
var moveLast = false;
- if ((_ribbonSeparator.Ribbon != null) && _ribbonSeparator.RibbonGroup.Items.Contains(_ribbonSeparator))
+ if ((_ribbonSeparator.Ribbon is not null)
+ && _ribbonSeparator.RibbonGroup is not null
+ && _ribbonSeparator.RibbonGroup.Items.Contains(_ribbonSeparator))
{
moveFirst = _ribbonSeparator.RibbonGroup.Items.IndexOf(_ribbonSeparator) > 0;
movePrev = _ribbonSeparator.RibbonGroup.Items.IndexOf(_ribbonSeparator) > 0;
@@ -149,7 +158,7 @@ private void UpdateVerbStatus()
}
}
- private void OnToggleHelpers(object sender, EventArgs e)
+ private void OnToggleHelpers(object? sender, EventArgs e)
{
// Invert the current toggle helper mode
if (_ribbonSeparator.Ribbon != null)
@@ -158,9 +167,11 @@ private void OnToggleHelpers(object sender, EventArgs e)
}
}
- private void OnMoveFirst(object sender, EventArgs e)
+ private void OnMoveFirst(object? sender, EventArgs e)
{
- if ((_ribbonSeparator.Ribbon != null) && _ribbonSeparator.RibbonGroup.Items.Contains(_ribbonSeparator))
+ if ((_ribbonSeparator.Ribbon is not null)
+ && _ribbonSeparator.RibbonGroup is not null
+ && _ribbonSeparator.RibbonGroup.Items.Contains(_ribbonSeparator))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupSeparator MoveFirst");
@@ -168,7 +179,7 @@ private void OnMoveFirst(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonSeparator.RibbonGroup)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonSeparator.RibbonGroup)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -188,9 +199,11 @@ private void OnMoveFirst(object sender, EventArgs e)
}
}
- private void OnMovePrevious(object sender, EventArgs e)
+ private void OnMovePrevious(object? sender, EventArgs e)
{
- if ((_ribbonSeparator.Ribbon != null) && _ribbonSeparator.RibbonGroup.Items.Contains(_ribbonSeparator))
+ if ((_ribbonSeparator.Ribbon is not null)
+ && _ribbonSeparator.RibbonGroup is not null
+ && _ribbonSeparator.RibbonGroup.Items.Contains(_ribbonSeparator))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupSeparator MovePrevious");
@@ -198,7 +211,7 @@ private void OnMovePrevious(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonSeparator.RibbonGroup)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonSeparator.RibbonGroup)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -220,9 +233,12 @@ private void OnMovePrevious(object sender, EventArgs e)
}
}
- private void OnMoveNext(object sender, EventArgs e)
+ private void OnMoveNext(object? sender, EventArgs e)
{
- if ((_ribbonSeparator.Ribbon != null) && _ribbonSeparator.RibbonGroup.Items.Contains(_ribbonSeparator))
+ if ((_ribbonSeparator.Ribbon is not null)
+ && _ribbonSeparator.RibbonGroup is not null
+ && _ribbonSeparator.RibbonGroup.Items.Contains(_ribbonSeparator))
+
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupSeparator MoveNext");
@@ -230,7 +246,7 @@ private void OnMoveNext(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonSeparator.RibbonGroup)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonSeparator.RibbonGroup)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -252,9 +268,11 @@ private void OnMoveNext(object sender, EventArgs e)
}
}
- private void OnMoveLast(object sender, EventArgs e)
+ private void OnMoveLast(object? sender, EventArgs e)
{
- if ((_ribbonSeparator.Ribbon != null) && _ribbonSeparator.RibbonGroup.Items.Contains(_ribbonSeparator))
+ if ((_ribbonSeparator.Ribbon is not null)
+ && _ribbonSeparator.RibbonGroup is not null
+ && _ribbonSeparator.RibbonGroup.Items.Contains(_ribbonSeparator))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupSeparator MoveLast");
@@ -262,7 +280,7 @@ private void OnMoveLast(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonSeparator.RibbonGroup)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonSeparator.RibbonGroup)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -282,9 +300,12 @@ private void OnMoveLast(object sender, EventArgs e)
}
}
- private void OnDeleteSeparator(object sender, EventArgs e)
+ private void OnDeleteSeparator(object? sender, EventArgs e)
{
- if ((_ribbonSeparator.Ribbon != null) && _ribbonSeparator.RibbonGroup.Items.Contains(_ribbonSeparator))
+ if ((_ribbonSeparator.Ribbon is not null)
+ && _ribbonSeparator.RibbonGroup is not null
+ && _ribbonSeparator.RibbonGroup.Items.Contains(_ribbonSeparator))
+
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupSeparator DeleteSeparator");
@@ -292,7 +313,7 @@ private void OnDeleteSeparator(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonSeparator.RibbonGroup)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonSeparator.RibbonGroup)[@"Items"];
// Remove the ribbon group from the ribbon tab
RaiseComponentChanging(null);
@@ -315,11 +336,13 @@ private void OnDeleteSeparator(object sender, EventArgs e)
}
}
- private void OnComponentChanged(object sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
+ private void OnComponentChanged(object? sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
- private void OnContextMenu(object sender, MouseEventArgs e)
+ private void OnContextMenu(object? sender, MouseEventArgs e)
{
- if ((_ribbonSeparator.Ribbon != null) && _ribbonSeparator.RibbonGroup.Items.Contains(_ribbonSeparator))
+ if ((_ribbonSeparator.Ribbon is not null)
+ && _ribbonSeparator.RibbonGroup is not null
+ && _ribbonSeparator.RibbonGroup.Items.Contains(_ribbonSeparator))
{
// Create the menu strip the first time around
if (_cms == null)
@@ -366,7 +389,7 @@ private void UpdateMoveToGroup()
// Remove any existing child items
_moveToGroupMenu.DropDownItems.Clear();
- if (_ribbonSeparator.Ribbon != null)
+ if (_ribbonSeparator.Ribbon is not null && _ribbonSeparator.RibbonTab is not null)
{
// Create a new item per group in the same ribbon tab
foreach (KryptonRibbonGroup group in _ribbonSeparator.RibbonTab.Groups)
@@ -391,15 +414,17 @@ private void UpdateMoveToGroup()
}
}
- private void OnMoveToGroup(object sender, EventArgs e)
+ private void OnMoveToGroup(object? sender, EventArgs e)
{
- if ((_ribbonSeparator.Ribbon != null) && _ribbonSeparator.RibbonGroup.Items.Contains(_ribbonSeparator))
+ if ((_ribbonSeparator.Ribbon is not null)
+ && _ribbonSeparator.RibbonGroup is not null
+ && _ribbonSeparator.RibbonGroup.Items.Contains(_ribbonSeparator))
{
// Cast to correct type
- var groupMenuItem = (ToolStripMenuItem)sender;
+ var groupMenuItem = sender as ToolStripMenuItem ?? throw new ArgumentNullException(nameof(sender));
// Get access to the destination tab
- var destination = (KryptonRibbonGroup)groupMenuItem.Tag;
+ var destination = groupMenuItem.Tag as KryptonRibbonGroup ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("destination"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupSeparator MoveSeparatorToGroup");
@@ -407,8 +432,8 @@ private void OnMoveToGroup(object sender, EventArgs e)
try
{
// Get access to the Groups property
- MemberDescriptor oldItems = TypeDescriptor.GetProperties(_ribbonSeparator.RibbonGroup)[@"Items"];
- MemberDescriptor newItems = TypeDescriptor.GetProperties(destination)[@"Items"];
+ MemberDescriptor? oldItems = TypeDescriptor.GetProperties(_ribbonSeparator.RibbonGroup)[@"Items"];
+ MemberDescriptor? newItems = TypeDescriptor.GetProperties(destination)[@"Items"];
// Remove the ribbon tab from the ribbon
RaiseComponentChanging(null);
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupTextBoxDesigner.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupTextBoxDesigner.cs
index 2ca10f04c..284f2068f 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupTextBoxDesigner.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupTextBoxDesigner.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -60,7 +60,8 @@ public override void Initialize([DisallowNull] IComponent component)
Debug.Assert(component != null);
// Cast to correct type
- _ribbonTextBox = component as KryptonRibbonGroupTextBox;
+ _ribbonTextBox = component as KryptonRibbonGroupTextBox ?? throw new ArgumentNullException(nameof(component));
+
if (_ribbonTextBox != null)
{
_ribbonTextBox.TextBoxDesigner = this;
@@ -74,15 +75,15 @@ public override void Initialize([DisallowNull] IComponent component)
_ribbonTextBox.Enabled = true;
// Tell the embedded text box it is in design mode
- _ribbonTextBox.TextBox.InRibbonDesignMode = true;
+ _ribbonTextBox.TextBox!.InRibbonDesignMode = true;
// Hook into events
_ribbonTextBox.DesignTimeContextMenu += OnContextMenu;
}
// Get access to the services
- _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
- _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
+ _designerHost = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_designerHost)));
+ _changeService = (IComponentChangeService?)GetService(typeof(IComponentChangeService)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_changeService)));
// We need to know when we are being removed/changed
_changeService.ComponentChanged += OnComponentChanged;
@@ -152,12 +153,12 @@ protected override void PreFilterProperties(IDictionary properties)
// Setup the array of properties we override
var attributes = Array.Empty();
- string[] strArray = { nameof(Visible), nameof(Enabled) };
+ string[] strArray = [nameof(Visible), nameof(Enabled)];
// Adjust our list of properties
for (var i = 0; i < strArray.Length; i++)
{
- var descrip = (PropertyDescriptor)properties[strArray[i]];
+ var descrip = (PropertyDescriptor?)properties[strArray[i]];
if (descrip != null)
{
properties[strArray[i]] = TypeDescriptor.CreateProperty(typeof(KryptonRibbonGroupTextBoxDesigner), descrip, attributes);
@@ -187,7 +188,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
- _verbs = new DesignerVerbCollection();
+ _verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move TextBox First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move TextBox Previous", OnMovePrevious);
@@ -205,7 +206,7 @@ private void UpdateVerbStatus()
if (_ribbonTextBox.Ribbon != null)
{
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
moveFirst = items.IndexOf(_ribbonTextBox) > 0;
movePrev = items.IndexOf(_ribbonTextBox) > 0;
moveNext = items.IndexOf(_ribbonTextBox) < (items.Count - 1);
@@ -218,7 +219,7 @@ private void UpdateVerbStatus()
_moveLastVerb.Enabled = moveLast;
}
- private void OnToggleHelpers(object sender, EventArgs e)
+ private void OnToggleHelpers(object? sender, EventArgs e)
{
// Invert the current toggle helper mode
if (_ribbonTextBox.Ribbon != null)
@@ -227,29 +228,32 @@ private void OnToggleHelpers(object sender, EventArgs e)
}
}
- private void OnMoveFirst(object sender, EventArgs e)
+ private void OnMoveFirst(object? sender, EventArgs e)
{
- if (_ribbonTextBox.Ribbon != null)
+ if (_ribbonTextBox.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupTextBox MoveFirst");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonTextBox.RibbonContainer)[@"Items"];
+ if (_ribbonTextBox.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonTextBox.RibbonContainer)[@"Items"];
- RaiseComponentChanging(propertyItems);
+ RaiseComponentChanging(propertyItems);
- // Move position of the textbox
- items.Remove(_ribbonTextBox);
- items.Insert(0, _ribbonTextBox);
- UpdateVerbStatus();
+ // Move position of the textbox
+ items.Remove(_ribbonTextBox);
+ items.Insert(0, _ribbonTextBox);
+ UpdateVerbStatus();
- RaiseComponentChanged(propertyItems, null, null);
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -259,31 +263,34 @@ private void OnMoveFirst(object sender, EventArgs e)
}
}
- private void OnMovePrevious(object sender, EventArgs e)
+ private void OnMovePrevious(object? sender, EventArgs e)
{
if (_ribbonTextBox.Ribbon != null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupTextBox MovePrevious");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonTextBox.RibbonContainer)[@"Items"];
-
- RaiseComponentChanging(propertyItems);
-
- // Move position of the textbox
- var index = items.IndexOf(_ribbonTextBox) - 1;
- index = Math.Max(index, 0);
- items.Remove(_ribbonTextBox);
- items.Insert(index, _ribbonTextBox);
- UpdateVerbStatus();
-
- RaiseComponentChanged(propertyItems, null, null);
+ if (_ribbonTextBox.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonTextBox.RibbonContainer)[@"Items"];
+
+ RaiseComponentChanging(propertyItems);
+
+ // Move position of the textbox
+ var index = items.IndexOf(_ribbonTextBox) - 1;
+ index = Math.Max(index, 0);
+ items.Remove(_ribbonTextBox);
+ items.Insert(index, _ribbonTextBox);
+ UpdateVerbStatus();
+
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -293,31 +300,34 @@ private void OnMovePrevious(object sender, EventArgs e)
}
}
- private void OnMoveNext(object sender, EventArgs e)
+ private void OnMoveNext(object? sender, EventArgs e)
{
- if (_ribbonTextBox.Ribbon != null)
+ if (_ribbonTextBox.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupTextBox MoveNext");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonTextBox.RibbonContainer)[@"Items"];
-
- RaiseComponentChanging(propertyItems);
-
- // Move position of the textbox
- var index = items.IndexOf(_ribbonTextBox) + 1;
- index = Math.Min(index, items.Count - 1);
- items.Remove(_ribbonTextBox);
- items.Insert(index, _ribbonTextBox);
- UpdateVerbStatus();
-
- RaiseComponentChanged(propertyItems, null, null);
+ if (_ribbonTextBox.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonTextBox.RibbonContainer)[@"Items"];
+
+ RaiseComponentChanging(propertyItems);
+
+ // Move position of the textbox
+ var index = items.IndexOf(_ribbonTextBox) + 1;
+ index = Math.Min(index, items.Count - 1);
+ items.Remove(_ribbonTextBox);
+ items.Insert(index, _ribbonTextBox);
+ UpdateVerbStatus();
+
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -327,29 +337,32 @@ private void OnMoveNext(object sender, EventArgs e)
}
}
- private void OnMoveLast(object sender, EventArgs e)
+ private void OnMoveLast(object? sender, EventArgs e)
{
- if (_ribbonTextBox.Ribbon != null)
+ if (_ribbonTextBox.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupTextBox MoveLast");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonTextBox.RibbonContainer)[@"Items"];
+ if (_ribbonTextBox.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonTextBox.RibbonContainer)[@"Items"];
- RaiseComponentChanging(propertyItems);
+ RaiseComponentChanging(propertyItems);
- // Move position of the textbox
- items.Remove(_ribbonTextBox);
- items.Insert(items.Count, _ribbonTextBox);
- UpdateVerbStatus();
+ // Move position of the textbox
+ items.Remove(_ribbonTextBox);
+ items.Insert(items.Count, _ribbonTextBox);
+ UpdateVerbStatus();
- RaiseComponentChanged(propertyItems, null, null);
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -359,32 +372,35 @@ private void OnMoveLast(object sender, EventArgs e)
}
}
- private void OnDeleteTextBox(object sender, EventArgs e)
+ private void OnDeleteTextBox(object? sender, EventArgs e)
{
- if (_ribbonTextBox.Ribbon != null)
+ if (_ribbonTextBox.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupTextBox DeleteTextBox");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonTextBox.RibbonContainer)[@"Items"];
+ if (_ribbonTextBox.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonTextBox.RibbonContainer)[@"Items"];
- RaiseComponentChanging(null);
- RaiseComponentChanging(propertyItems);
+ RaiseComponentChanging(null);
+ RaiseComponentChanging(propertyItems);
- // Remove the textbox from the group
- items.Remove(_ribbonTextBox);
+ // Remove the textbox from the group
+ items.Remove(_ribbonTextBox);
- // Get designer to destroy it
- _designerHost.DestroyComponent(_ribbonTextBox);
+ // Get designer to destroy it
+ _designerHost.DestroyComponent(_ribbonTextBox);
- RaiseComponentChanged(propertyItems, null, null);
- RaiseComponentChanged(null, null, null);
+ RaiseComponentChanged(propertyItems, null, null);
+ RaiseComponentChanged(null, null, null);
+ }
}
finally
{
@@ -394,33 +410,33 @@ private void OnDeleteTextBox(object sender, EventArgs e)
}
}
- private void OnEnabled(object sender, EventArgs e)
+ private void OnEnabled(object? sender, EventArgs e)
{
- if (_ribbonTextBox.Ribbon != null)
+ if (_ribbonTextBox.Ribbon is not null)
{
- PropertyDescriptor propertyEnabled = TypeDescriptor.GetProperties(_ribbonTextBox)[nameof(Enabled)];
- var oldValue = (bool)propertyEnabled.GetValue(_ribbonTextBox);
+ PropertyDescriptor? propertyEnabled = TypeDescriptor.GetProperties(_ribbonTextBox)[nameof(Enabled)] ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("propertyEnabled"));
+ var oldValue = (bool?)propertyEnabled.GetValue(_ribbonTextBox);
var newValue = !oldValue;
_changeService.OnComponentChanged(_ribbonTextBox, null, oldValue, newValue);
propertyEnabled.SetValue(_ribbonTextBox, newValue);
}
}
- private void OnVisible(object sender, EventArgs e)
+ private void OnVisible(object? sender, EventArgs e)
{
- if (_ribbonTextBox.Ribbon != null)
+ if (_ribbonTextBox.Ribbon is not null)
{
- PropertyDescriptor propertyVisible = TypeDescriptor.GetProperties(_ribbonTextBox)[nameof(Visible)];
- var oldValue = (bool)propertyVisible.GetValue(_ribbonTextBox);
+ PropertyDescriptor? propertyVisible = TypeDescriptor.GetProperties(_ribbonTextBox)[nameof(Visible)] ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("propertyVisible"));
+ var oldValue = (bool?)propertyVisible.GetValue(_ribbonTextBox);
var newValue = !oldValue;
_changeService.OnComponentChanged(_ribbonTextBox, null, oldValue, newValue);
propertyVisible.SetValue(_ribbonTextBox, newValue);
}
}
- private void OnComponentChanged(object sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
+ private void OnComponentChanged(object? sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
- private void OnContextMenu(object sender, MouseEventArgs e)
+ private void OnContextMenu(object? sender, MouseEventArgs e)
{
if (_ribbonTextBox.Ribbon != null)
{
@@ -465,7 +481,7 @@ private TypedRestrictCollection? ParentItems
{
get
{
- switch (_ribbonTextBox.RibbonContainer)
+ switch (_ribbonTextBox!.RibbonContainer)
{
case KryptonRibbonGroupTriple triple:
return triple.Items;
@@ -474,6 +490,7 @@ private TypedRestrictCollection? ParentItems
default:
// Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(_ribbonTextBox.RibbonContainer!.ToString());
return null;
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupThemeComboBoxDesigner.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupThemeComboBoxDesigner.cs
index 088cf0af2..539cb8e11 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupThemeComboBoxDesigner.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupThemeComboBoxDesigner.cs
@@ -2,7 +2,7 @@
/*
*
* 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. 2023 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2024. All rights reserved.
*
*/
#endregion
@@ -55,7 +55,8 @@ public override void Initialize([DisallowNull] IComponent component)
Debug.Assert(component != null);
// Cast to correct type
- _ribbonThemeComboBox = component as KryptonRibbonGroupThemeComboBox;
+ _ribbonThemeComboBox = component as KryptonRibbonGroupThemeComboBox ?? throw new ArgumentNullException(nameof(component));
+
if (_ribbonThemeComboBox != null)
{
_ribbonThemeComboBox.ComboBoxDesigner = this;
@@ -76,8 +77,8 @@ public override void Initialize([DisallowNull] IComponent component)
}
// Get access to the services
- _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
- _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
+ _designerHost = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("_designerHost"));
+ _changeService = (IComponentChangeService?)GetService(typeof(IComponentChangeService)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("_changeService"));
// We need to know when we are being removed/changed
_changeService.ComponentChanged += OnComponentChanged;
@@ -147,12 +148,12 @@ protected override void PreFilterProperties(IDictionary properties)
// Setup the array of properties we override
var attributes = Array.Empty();
- string[] strArray = { nameof(Visible), nameof(Enabled) };
+ string[] strArray = [nameof(Visible), nameof(Enabled)];
// Adjust our list of properties
for (var i = 0; i < strArray.Length; i++)
{
- var descrip = (PropertyDescriptor)properties[strArray[i]];
+ var descrip = (PropertyDescriptor?)properties[strArray[i]];
if (descrip != null)
{
properties[strArray[i]] = TypeDescriptor.CreateProperty(typeof(KryptonRibbonGroupThemeComboBoxDesigner), descrip, attributes);
@@ -182,7 +183,7 @@ private void UpdateVerbStatus()
// Create verbs first time around
if (_verbs == null)
{
- _verbs = new DesignerVerbCollection();
+ _verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move ComboBox First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move ComboBox Previous", OnMovePrevious);
@@ -198,9 +199,9 @@ private void UpdateVerbStatus()
var moveNext = false;
var moveLast = false;
- if (_ribbonThemeComboBox.Ribbon != null)
+ if (_ribbonThemeComboBox.Ribbon is not null)
{
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
moveFirst = items.IndexOf(_ribbonThemeComboBox) > 0;
movePrev = items.IndexOf(_ribbonThemeComboBox) > 0;
moveNext = items.IndexOf(_ribbonThemeComboBox) < (items.Count - 1);
@@ -213,38 +214,41 @@ private void UpdateVerbStatus()
_moveLastVerb.Enabled = moveLast;
}
- private void OnToggleHelpers(object sender, EventArgs e)
+ private void OnToggleHelpers(object? sender, EventArgs e)
{
// Invert the current toggle helper mode
- if (_ribbonThemeComboBox.Ribbon != null)
+ if (_ribbonThemeComboBox.Ribbon is not null)
{
_ribbonThemeComboBox.Ribbon.InDesignHelperMode = !_ribbonThemeComboBox.Ribbon.InDesignHelperMode;
}
}
- private void OnMoveFirst(object sender, EventArgs e)
+ private void OnMoveFirst(object? sender, EventArgs e)
{
- if (_ribbonThemeComboBox.Ribbon != null)
+ if (_ribbonThemeComboBox.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupThemeComboBoxBox MoveFirst");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonThemeComboBox.RibbonContainer)[@"Items"];
+ if (_ribbonThemeComboBox.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonThemeComboBox.RibbonContainer)[@"Items"];
- RaiseComponentChanging(propertyItems);
+ RaiseComponentChanging(propertyItems);
- // Move position of the combobox
- items.Remove(_ribbonThemeComboBox);
- items.Insert(0, _ribbonThemeComboBox);
- UpdateVerbStatus();
+ // Move position of the combobox
+ items.Remove(_ribbonThemeComboBox);
+ items.Insert(0, _ribbonThemeComboBox);
+ UpdateVerbStatus();
- RaiseComponentChanged(propertyItems, null, null);
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -254,31 +258,34 @@ private void OnMoveFirst(object sender, EventArgs e)
}
}
- private void OnMovePrevious(object sender, EventArgs e)
+ private void OnMovePrevious(object? sender, EventArgs e)
{
- if (_ribbonThemeComboBox.Ribbon != null)
+ if (_ribbonThemeComboBox.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupThemeComboBox MovePrevious");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonThemeComboBox.RibbonContainer)[@"Items"];
+ if (_ribbonThemeComboBox.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonThemeComboBox.RibbonContainer)[@"Items"];
- RaiseComponentChanging(propertyItems);
+ RaiseComponentChanging(propertyItems);
- // Move position of the combotextbox
- var index = items.IndexOf(_ribbonThemeComboBox) - 1;
- index = Math.Max(index, 0);
- items.Remove(_ribbonThemeComboBox);
- items.Insert(index, _ribbonThemeComboBox);
- UpdateVerbStatus();
+ // Move position of the combotextbox
+ var index = items.IndexOf(_ribbonThemeComboBox) - 1;
+ index = Math.Max(index, 0);
+ items.Remove(_ribbonThemeComboBox);
+ items.Insert(index, _ribbonThemeComboBox);
+ UpdateVerbStatus();
- RaiseComponentChanged(propertyItems, null, null);
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -288,31 +295,34 @@ private void OnMovePrevious(object sender, EventArgs e)
}
}
- private void OnMoveNext(object sender, EventArgs e)
+ private void OnMoveNext(object? sender, EventArgs e)
{
- if (_ribbonThemeComboBox.Ribbon != null)
+ if (_ribbonThemeComboBox.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupThemeComboBox MoveNext");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonThemeComboBox.RibbonContainer)[@"Items"];
+ if (_ribbonThemeComboBox.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonThemeComboBox.RibbonContainer)[@"Items"];
- RaiseComponentChanging(propertyItems);
+ RaiseComponentChanging(propertyItems);
- // Move position of the combobox
- var index = items.IndexOf(_ribbonThemeComboBox) + 1;
- index = Math.Min(index, items.Count - 1);
- items.Remove(_ribbonThemeComboBox);
- items.Insert(index, _ribbonThemeComboBox);
- UpdateVerbStatus();
+ // Move position of the combobox
+ var index = items.IndexOf(_ribbonThemeComboBox) + 1;
+ index = Math.Min(index, items.Count - 1);
+ items.Remove(_ribbonThemeComboBox);
+ items.Insert(index, _ribbonThemeComboBox);
+ UpdateVerbStatus();
- RaiseComponentChanged(propertyItems, null, null);
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -322,29 +332,32 @@ private void OnMoveNext(object sender, EventArgs e)
}
}
- private void OnMoveLast(object sender, EventArgs e)
+ private void OnMoveLast(object? sender, EventArgs e)
{
- if (_ribbonThemeComboBox.Ribbon != null)
+ if (_ribbonThemeComboBox.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupThemeComboBox MoveLast");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonThemeComboBox.RibbonContainer)[@"Items"];
+ if (_ribbonThemeComboBox.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonThemeComboBox.RibbonContainer)[@"Items"];
- RaiseComponentChanging(propertyItems);
+ RaiseComponentChanging(propertyItems);
- // Move position of the combobox
- items.Remove(_ribbonThemeComboBox);
- items.Insert(items.Count, _ribbonThemeComboBox);
- UpdateVerbStatus();
+ // Move position of the combobox
+ items.Remove(_ribbonThemeComboBox);
+ items.Insert(items.Count, _ribbonThemeComboBox);
+ UpdateVerbStatus();
- RaiseComponentChanged(propertyItems, null, null);
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -354,32 +367,35 @@ private void OnMoveLast(object sender, EventArgs e)
}
}
- private void OnDeleteThemeComboBox(object sender, EventArgs e)
+ private void OnDeleteThemeComboBox(object? sender, EventArgs e)
{
- if (_ribbonThemeComboBox.Ribbon != null)
+ if (_ribbonThemeComboBox.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupThemeComboBox DeleteThemeComboBox");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonThemeComboBox.RibbonContainer)[@"Items"];
+ if (_ribbonThemeComboBox.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonThemeComboBox.RibbonContainer)[@"Items"];
- RaiseComponentChanging(null);
- RaiseComponentChanging(propertyItems);
+ RaiseComponentChanging(null);
+ RaiseComponentChanging(propertyItems);
- // Remove the combobox from the group
- items.Remove(_ribbonThemeComboBox);
+ // Remove the combobox from the group
+ items.Remove(_ribbonThemeComboBox);
- // Get designer to destroy it
- _designerHost.DestroyComponent(_ribbonThemeComboBox);
+ // Get designer to destroy it
+ _designerHost.DestroyComponent(_ribbonThemeComboBox);
- RaiseComponentChanged(propertyItems, null, null);
- RaiseComponentChanged(null, null, null);
+ RaiseComponentChanged(propertyItems, null, null);
+ RaiseComponentChanged(null, null, null);
+ }
}
finally
{
@@ -389,35 +405,35 @@ private void OnDeleteThemeComboBox(object sender, EventArgs e)
}
}
- private void OnEnabled(object sender, EventArgs e)
+ private void OnEnabled(object? sender, EventArgs e)
{
- if (_ribbonThemeComboBox.Ribbon != null)
+ if (_ribbonThemeComboBox.Ribbon is not null)
{
- PropertyDescriptor propertyEnabled = TypeDescriptor.GetProperties(_ribbonThemeComboBox)[nameof(Enabled)];
- var oldValue = (bool)propertyEnabled.GetValue(_ribbonThemeComboBox);
+ PropertyDescriptor? propertyEnabled = TypeDescriptor.GetProperties(_ribbonThemeComboBox)[nameof(Enabled)] ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("propertyEnabled"));
+ var oldValue = (bool?)propertyEnabled.GetValue(_ribbonThemeComboBox);
var newValue = !oldValue;
_changeService.OnComponentChanged(_ribbonThemeComboBox, null, oldValue, newValue);
propertyEnabled.SetValue(_ribbonThemeComboBox, newValue);
}
}
- private void OnVisible(object sender, EventArgs e)
+ private void OnVisible(object? sender, EventArgs e)
{
- if (_ribbonThemeComboBox.Ribbon != null)
+ if (_ribbonThemeComboBox.Ribbon is not null)
{
- PropertyDescriptor propertyVisible = TypeDescriptor.GetProperties(_ribbonThemeComboBox)[nameof(Visible)];
- var oldValue = (bool)propertyVisible.GetValue(_ribbonThemeComboBox);
+ PropertyDescriptor? propertyVisible = TypeDescriptor.GetProperties(_ribbonThemeComboBox)[nameof(Visible)] ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("propertyVisible"));
+ var oldValue = (bool?)propertyVisible.GetValue(_ribbonThemeComboBox);
var newValue = !oldValue;
_changeService.OnComponentChanged(_ribbonThemeComboBox, null, oldValue, newValue);
propertyVisible.SetValue(_ribbonThemeComboBox, newValue);
}
}
- private void OnComponentChanged(object sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
+ private void OnComponentChanged(object? sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
- private void OnContextMenu(object sender, MouseEventArgs e)
+ private void OnContextMenu(object? sender, MouseEventArgs e)
{
- if (_ribbonThemeComboBox.Ribbon != null)
+ if (_ribbonThemeComboBox.Ribbon is not null)
{
// Create the menu strip the first time around
if (_cms == null)
@@ -463,7 +479,7 @@ private TypedRestrictCollection? ParentItems
{
get
{
- switch (_ribbonThemeComboBox.RibbonContainer)
+ switch (_ribbonThemeComboBox!.RibbonContainer!)
{
case KryptonRibbonGroupTriple triple:
return triple.Items;
@@ -472,6 +488,7 @@ private TypedRestrictCollection? ParentItems
default:
// Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(_ribbonThemeComboBox!.RibbonContainer!.ToString());
return null;
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupTrackBarDesigner.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupTrackBarDesigner.cs
index 877ded90a..41fe14f0a 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupTrackBarDesigner.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupTrackBarDesigner.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -60,8 +60,9 @@ public override void Initialize([DisallowNull] IComponent component)
Debug.Assert(component != null);
// Cast to correct type
- _ribbonTrackBar = component as KryptonRibbonGroupTrackBar;
- if (_ribbonTrackBar != null)
+ _ribbonTrackBar = component as KryptonRibbonGroupTrackBar ?? throw new ArgumentNullException(nameof(component));
+
+ if (_ribbonTrackBar is not null && _ribbonTrackBar.TrackBar is not null)
{
_ribbonTrackBar.TrackBarDesigner = this;
@@ -81,8 +82,8 @@ public override void Initialize([DisallowNull] IComponent component)
}
// Get access to the services
- _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
- _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
+ _designerHost = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_designerHost)));
+ _changeService = (IComponentChangeService?)GetService(typeof(IComponentChangeService)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_changeService)));
// We need to know when we are being removed/changed
_changeService.ComponentChanged += OnComponentChanged;
@@ -152,12 +153,12 @@ protected override void PreFilterProperties(IDictionary properties)
// Setup the array of properties we override
var attributes = Array.Empty();
- string[] strArray = { nameof(Visible), nameof(Enabled) };
+ string[] strArray = [nameof(Visible), nameof(Enabled)];
// Adjust our list of properties
for (var i = 0; i < strArray.Length; i++)
{
- var descrip = (PropertyDescriptor)properties[strArray[i]];
+ var descrip = (PropertyDescriptor?)properties[strArray[i]];
if (descrip != null)
{
properties[strArray[i]] = TypeDescriptor.CreateProperty(typeof(KryptonRibbonGroupTrackBarDesigner), descrip, attributes);
@@ -185,9 +186,9 @@ protected override void PreFilterProperties(IDictionary properties)
private void UpdateVerbStatus()
{
// Create verbs first time around
- if (_verbs == null)
+ if (_verbs is null)
{
- _verbs = new DesignerVerbCollection();
+ _verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move TrackBar First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move TrackBar Previous", OnMovePrevious);
@@ -205,7 +206,7 @@ private void UpdateVerbStatus()
if (_ribbonTrackBar.Ribbon != null)
{
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
moveFirst = items.IndexOf(_ribbonTrackBar) > 0;
movePrev = items.IndexOf(_ribbonTrackBar) > 0;
moveNext = items.IndexOf(_ribbonTrackBar) < (items.Count - 1);
@@ -218,7 +219,7 @@ private void UpdateVerbStatus()
_moveLastVerb.Enabled = moveLast;
}
- private void OnToggleHelpers(object sender, EventArgs e)
+ private void OnToggleHelpers(object? sender, EventArgs e)
{
// Invert the current toggle helper mode
if (_ribbonTrackBar.Ribbon != null)
@@ -227,29 +228,32 @@ private void OnToggleHelpers(object sender, EventArgs e)
}
}
- private void OnMoveFirst(object sender, EventArgs e)
+ private void OnMoveFirst(object? sender, EventArgs e)
{
- if (_ribbonTrackBar.Ribbon != null)
+ if (_ribbonTrackBar.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupTrackBar MoveFirst");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonTrackBar.RibbonContainer)[@"Items"];
+ if (_ribbonTrackBar.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonTrackBar.RibbonContainer)[@"Items"];
- RaiseComponentChanging(propertyItems);
+ RaiseComponentChanging(propertyItems);
- // Move position of the trackbar
- items.Remove(_ribbonTrackBar);
- items.Insert(0, _ribbonTrackBar);
- UpdateVerbStatus();
+ // Move position of the trackbar
+ items.Remove(_ribbonTrackBar);
+ items.Insert(0, _ribbonTrackBar);
+ UpdateVerbStatus();
- RaiseComponentChanged(propertyItems, null, null);
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -259,31 +263,34 @@ private void OnMoveFirst(object sender, EventArgs e)
}
}
- private void OnMovePrevious(object sender, EventArgs e)
+ private void OnMovePrevious(object? sender, EventArgs e)
{
- if (_ribbonTrackBar.Ribbon != null)
+ if (_ribbonTrackBar.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupTrackBar MovePrevious");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonTrackBar.RibbonContainer)[@"Items"];
-
- RaiseComponentChanging(propertyItems);
-
- // Move position of the trackbar
- var index = items.IndexOf(_ribbonTrackBar) - 1;
- index = Math.Max(index, 0);
- items.Remove(_ribbonTrackBar);
- items.Insert(index, _ribbonTrackBar);
- UpdateVerbStatus();
-
- RaiseComponentChanged(propertyItems, null, null);
+ if (_ribbonTrackBar.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonTrackBar.RibbonContainer)[@"Items"];
+
+ RaiseComponentChanging(propertyItems);
+
+ // Move position of the trackbar
+ var index = items.IndexOf(_ribbonTrackBar) - 1;
+ index = Math.Max(index, 0);
+ items.Remove(_ribbonTrackBar);
+ items.Insert(index, _ribbonTrackBar);
+ UpdateVerbStatus();
+
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -293,31 +300,34 @@ private void OnMovePrevious(object sender, EventArgs e)
}
}
- private void OnMoveNext(object sender, EventArgs e)
+ private void OnMoveNext(object? sender, EventArgs e)
{
- if (_ribbonTrackBar.Ribbon != null)
+ if (_ribbonTrackBar.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupTrackBar MoveNext");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonTrackBar.RibbonContainer)[@"Items"];
-
- RaiseComponentChanging(propertyItems);
-
- // Move position of the trackbar
- var index = items.IndexOf(_ribbonTrackBar) + 1;
- index = Math.Min(index, items.Count - 1);
- items.Remove(_ribbonTrackBar);
- items.Insert(index, _ribbonTrackBar);
- UpdateVerbStatus();
-
- RaiseComponentChanged(propertyItems, null, null);
+ if (_ribbonTrackBar.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonTrackBar.RibbonContainer)[@"Items"];
+
+ RaiseComponentChanging(propertyItems);
+
+ // Move position of the trackbar
+ var index = items.IndexOf(_ribbonTrackBar) + 1;
+ index = Math.Min(index, items.Count - 1);
+ items.Remove(_ribbonTrackBar);
+ items.Insert(index, _ribbonTrackBar);
+ UpdateVerbStatus();
+
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -327,29 +337,32 @@ private void OnMoveNext(object sender, EventArgs e)
}
}
- private void OnMoveLast(object sender, EventArgs e)
+ private void OnMoveLast(object? sender, EventArgs e)
{
- if (_ribbonTrackBar.Ribbon != null)
+ if (_ribbonTrackBar.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupTrackBar MoveLast");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonTrackBar.RibbonContainer)[@"Items"];
+ if (_ribbonTrackBar.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonTrackBar.RibbonContainer)[@"Items"];
- RaiseComponentChanging(propertyItems);
+ RaiseComponentChanging(propertyItems);
- // Move position of the trackbar
- items.Remove(_ribbonTrackBar);
- items.Insert(items.Count, _ribbonTrackBar);
- UpdateVerbStatus();
+ // Move position of the trackbar
+ items.Remove(_ribbonTrackBar);
+ items.Insert(items.Count, _ribbonTrackBar);
+ UpdateVerbStatus();
- RaiseComponentChanged(propertyItems, null, null);
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -359,32 +372,35 @@ private void OnMoveLast(object sender, EventArgs e)
}
}
- private void OnDeleteTrackBar(object sender, EventArgs e)
+ private void OnDeleteTrackBar(object? sender, EventArgs e)
{
- if (_ribbonTrackBar.Ribbon != null)
+ if (_ribbonTrackBar.Ribbon is not null)
{
// Get access to the parent collection of items
- var items = ParentItems;
+ var items = ParentItems ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("items"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupTrackBar DeleteTrackBar");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonTrackBar.RibbonContainer)[@"Items"];
+ if (_ribbonTrackBar.RibbonContainer is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonTrackBar.RibbonContainer)[@"Items"];
- RaiseComponentChanging(null);
- RaiseComponentChanging(propertyItems);
+ RaiseComponentChanging(null);
+ RaiseComponentChanging(propertyItems);
- // Remove the trackbar from the group
- items.Remove(_ribbonTrackBar);
+ // Remove the trackbar from the group
+ items.Remove(_ribbonTrackBar);
- // Get designer to destroy it
- _designerHost.DestroyComponent(_ribbonTrackBar);
+ // Get designer to destroy it
+ _designerHost.DestroyComponent(_ribbonTrackBar);
- RaiseComponentChanged(propertyItems, null, null);
- RaiseComponentChanged(null, null, null);
+ RaiseComponentChanged(propertyItems, null, null);
+ RaiseComponentChanged(null, null, null);
+ }
}
finally
{
@@ -396,33 +412,33 @@ private void OnDeleteTrackBar(object sender, EventArgs e)
private void OnEnabled(object sender, EventArgs e)
{
- if (_ribbonTrackBar.Ribbon != null)
+ if (_ribbonTrackBar.Ribbon is not null)
{
- PropertyDescriptor propertyEnabled = TypeDescriptor.GetProperties(_ribbonTrackBar)[nameof(Enabled)];
- var oldValue = (bool)propertyEnabled.GetValue(_ribbonTrackBar);
+ PropertyDescriptor? propertyEnabled = TypeDescriptor.GetProperties(_ribbonTrackBar)[nameof(Enabled)] ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("propertyEnabled"));
+ var oldValue = (bool?)propertyEnabled.GetValue(_ribbonTrackBar);
var newValue = !oldValue;
_changeService.OnComponentChanged(_ribbonTrackBar, null, oldValue, newValue);
propertyEnabled.SetValue(_ribbonTrackBar, newValue);
}
}
- private void OnVisible(object sender, EventArgs e)
+ private void OnVisible(object? sender, EventArgs e)
{
- if (_ribbonTrackBar.Ribbon != null)
+ if (_ribbonTrackBar.Ribbon is not null)
{
- PropertyDescriptor propertyVisible = TypeDescriptor.GetProperties(_ribbonTrackBar)[nameof(Visible)];
- var oldValue = (bool)propertyVisible.GetValue(_ribbonTrackBar);
+ PropertyDescriptor? propertyVisible = TypeDescriptor.GetProperties(_ribbonTrackBar)[nameof(Visible)] ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("propertyVisible"));
+ var oldValue = (bool?)propertyVisible.GetValue(_ribbonTrackBar);
var newValue = !oldValue;
_changeService.OnComponentChanged(_ribbonTrackBar, null, oldValue, newValue);
propertyVisible.SetValue(_ribbonTrackBar, newValue);
}
}
- private void OnComponentChanged(object sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
+ private void OnComponentChanged(object? sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
- private void OnContextMenu(object sender, MouseEventArgs e)
+ private void OnContextMenu(object? sender, MouseEventArgs e)
{
- if (_ribbonTrackBar.Ribbon != null)
+ if (_ribbonTrackBar.Ribbon is not null)
{
// Create the menu strip the first time around
if (_cms == null)
@@ -465,7 +481,7 @@ private TypedRestrictCollection? ParentItems
{
get
{
- switch (_ribbonTrackBar.RibbonContainer)
+ switch (_ribbonTrackBar.RibbonContainer!)
{
case KryptonRibbonGroupTriple triple:
return triple.Items;
@@ -474,6 +490,7 @@ private TypedRestrictCollection? ParentItems
default:
// Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(_ribbonTrackBar.RibbonContainer!.ToString());
return null;
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupTripleDesigner.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupTripleDesigner.cs
index d9a134892..cf5fd4ec6 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupTripleDesigner.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonGroupTripleDesigner.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -98,7 +98,7 @@ public override void Initialize([DisallowNull] IComponent component)
Debug.Assert(component != null);
// Cast to correct type
- _ribbonTriple = component as KryptonRibbonGroupTriple;
+ _ribbonTriple = component as KryptonRibbonGroupTriple ?? throw new ArgumentNullException(nameof(component));
if (_ribbonTriple != null)
{
_ribbonTriple.DesignTimeAddButton += OnAddButton;
@@ -120,8 +120,8 @@ public override void Initialize([DisallowNull] IComponent component)
}
// Get access to the services
- _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
- _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
+ _designerHost = GetService(typeof(IDesignerHost)) as IDesignerHost ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_designerHost)));
+ _changeService = GetService(typeof(IComponentChangeService)) as IComponentChangeService ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_changeService)));
// We need to know when we are being removed/changed
_changeService.ComponentRemoving += OnComponentRemoving;
@@ -136,7 +136,12 @@ public override ICollection AssociatedComponents
get
{
var compound = new ArrayList(base.AssociatedComponents);
- compound.AddRange(_ribbonTriple.Items);
+
+ if (_ribbonTriple.Items is not null)
+ {
+ compound.AddRange(_ribbonTriple.Items);
+ }
+
return compound;
}
}
@@ -149,7 +154,7 @@ public override DesignerVerbCollection Verbs
get
{
UpdateVerbStatus();
- return _verbs;
+ return _verbs!;
}
}
#endregion
@@ -198,9 +203,9 @@ protected override void Dispose(bool disposing)
private void UpdateVerbStatus()
{
// Create verbs first time around
- if (_verbs == null)
+ if (_verbs is null)
{
- _verbs = new DesignerVerbCollection();
+ _verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move Triple First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move Triple Previous", OnMovePrevious);
@@ -252,7 +257,9 @@ private void UpdateVerbStatus()
var add = false;
var clearItems = false;
- if ((_ribbonTriple.RibbonGroup != null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
+ if ((_ribbonTriple.RibbonGroup is not null)
+ && _ribbonTriple.Items is not null
+ && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
{
moveFirst = _ribbonTriple.RibbonGroup.Items.IndexOf(_ribbonTriple) > 0;
movePrev = _ribbonTriple.RibbonGroup.Items.IndexOf(_ribbonTriple) > 0;
@@ -284,18 +291,18 @@ private void UpdateVerbStatus()
_clearItemsVerb.Enabled = clearItems;
}
- private void OnToggleHelpers(object sender, EventArgs e)
+ private void OnToggleHelpers(object? sender, EventArgs e)
{
// Invert the current toggle helper mode
- if (_ribbonTriple.Ribbon != null)
+ if (_ribbonTriple.Ribbon is not null)
{
_ribbonTriple.Ribbon.InDesignHelperMode = !_ribbonTriple.Ribbon.InDesignHelperMode;
}
}
- private void OnMoveFirst(object sender, EventArgs e)
+ private void OnMoveFirst(object? sender, EventArgs e)
{
- if ((_ribbonTriple.RibbonGroup != null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
+ if ((_ribbonTriple.RibbonGroup is not null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupTriple MoveFirst");
@@ -303,7 +310,7 @@ private void OnMoveFirst(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonTriple.RibbonGroup)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonTriple.RibbonGroup)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -323,9 +330,9 @@ private void OnMoveFirst(object sender, EventArgs e)
}
}
- private void OnMovePrevious(object sender, EventArgs e)
+ private void OnMovePrevious(object? sender, EventArgs e)
{
- if ((_ribbonTriple.RibbonGroup != null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
+ if ((_ribbonTriple.RibbonGroup is not null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupTriple MovePrevious");
@@ -333,7 +340,7 @@ private void OnMovePrevious(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonTriple.RibbonGroup)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonTriple.RibbonGroup)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -355,9 +362,9 @@ private void OnMovePrevious(object sender, EventArgs e)
}
}
- private void OnMoveNext(object sender, EventArgs e)
+ private void OnMoveNext(object? sender, EventArgs e)
{
- if ((_ribbonTriple.RibbonGroup != null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
+ if ((_ribbonTriple.RibbonGroup is not null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupTriple MoveNext");
@@ -365,7 +372,7 @@ private void OnMoveNext(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonTriple.RibbonGroup)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonTriple.RibbonGroup)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -387,9 +394,9 @@ private void OnMoveNext(object sender, EventArgs e)
}
}
- private void OnMoveLast(object sender, EventArgs e)
+ private void OnMoveLast(object? sender, EventArgs e)
{
- if ((_ribbonTriple.RibbonGroup != null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
+ if ((_ribbonTriple.RibbonGroup is not null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupTriple MoveLast");
@@ -397,7 +404,7 @@ private void OnMoveLast(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonTriple.RibbonGroup)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonTriple.RibbonGroup)[@"Items"];
RaiseComponentChanging(propertyItems);
@@ -417,9 +424,9 @@ private void OnMoveLast(object sender, EventArgs e)
}
}
- private void OnAddButton(object sender, EventArgs e)
+ private void OnAddButton(object? sender, EventArgs e)
{
- if ((_ribbonTriple.RibbonGroup != null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
+ if ((_ribbonTriple.RibbonGroup is not null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupTriple AddButton");
@@ -427,13 +434,13 @@ private void OnAddButton(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonTriple)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonTriple)[@"Items"];
RaiseComponentChanging(propertyItems);
// Get designer to create a button item
var button = (KryptonRibbonGroupButton)_designerHost.CreateComponent(typeof(KryptonRibbonGroupButton));
- _ribbonTriple.Items.Add(button);
+ _ribbonTriple.Items!.Add(button);
RaiseComponentChanged(propertyItems, null, null);
}
@@ -445,9 +452,9 @@ private void OnAddButton(object sender, EventArgs e)
}
}
- private void OnAddColorButton(object sender, EventArgs e)
+ private void OnAddColorButton(object? sender, EventArgs e)
{
- if ((_ribbonTriple.RibbonGroup != null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
+ if ((_ribbonTriple.RibbonGroup is not null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupTriple AddColorButton");
@@ -455,13 +462,13 @@ private void OnAddColorButton(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonTriple)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonTriple)[@"Items"];
RaiseComponentChanging(propertyItems);
// Get designer to create a button item
var button = (KryptonRibbonGroupColorButton)_designerHost.CreateComponent(typeof(KryptonRibbonGroupColorButton));
- _ribbonTriple.Items.Add(button);
+ _ribbonTriple.Items!.Add(button);
RaiseComponentChanged(propertyItems, null, null);
}
@@ -473,9 +480,9 @@ private void OnAddColorButton(object sender, EventArgs e)
}
}
- private void OnAddCheckBox(object sender, EventArgs e)
+ private void OnAddCheckBox(object? sender, EventArgs e)
{
- if ((_ribbonTriple.RibbonGroup != null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
+ if ((_ribbonTriple.RibbonGroup is not null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupTriple AddCheckBox");
@@ -483,13 +490,13 @@ private void OnAddCheckBox(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonTriple)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonTriple)[@"Items"];
RaiseComponentChanging(propertyItems);
// Get designer to create a check box item.
var checkBox = (KryptonRibbonGroupCheckBox)_designerHost.CreateComponent(typeof(KryptonRibbonGroupCheckBox));
- _ribbonTriple.Items.Add(checkBox);
+ _ribbonTriple.Items!.Add(checkBox);
RaiseComponentChanged(propertyItems, null, null);
}
@@ -501,9 +508,9 @@ private void OnAddCheckBox(object sender, EventArgs e)
}
}
- private void OnAddRadioButton(object sender, EventArgs e)
+ private void OnAddRadioButton(object? sender, EventArgs e)
{
- if ((_ribbonTriple.RibbonGroup != null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
+ if ((_ribbonTriple.RibbonGroup is not null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupTriple AddRadioButton");
@@ -511,13 +518,13 @@ private void OnAddRadioButton(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonTriple)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonTriple)[@"Items"];
RaiseComponentChanging(propertyItems);
// Get designer to create a radio button item.
var radioButton = (KryptonRibbonGroupRadioButton)_designerHost.CreateComponent(typeof(KryptonRibbonGroupRadioButton));
- _ribbonTriple.Items.Add(radioButton);
+ _ribbonTriple.Items!.Add(radioButton);
RaiseComponentChanged(propertyItems, null, null);
}
@@ -529,9 +536,9 @@ private void OnAddRadioButton(object sender, EventArgs e)
}
}
- private void OnAddLabel(object sender, EventArgs e)
+ private void OnAddLabel(object? sender, EventArgs e)
{
- if ((_ribbonTriple.RibbonGroup != null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
+ if ((_ribbonTriple.RibbonGroup is not null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupTriple AddLabel");
@@ -539,13 +546,13 @@ private void OnAddLabel(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonTriple)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonTriple)[@"Items"];
RaiseComponentChanging(propertyItems);
// Get designer to create a label item
var label = (KryptonRibbonGroupLabel)_designerHost.CreateComponent(typeof(KryptonRibbonGroupLabel));
- _ribbonTriple.Items.Add(label);
+ _ribbonTriple.Items!.Add(label);
RaiseComponentChanged(propertyItems, null, null);
}
@@ -557,7 +564,7 @@ private void OnAddLabel(object sender, EventArgs e)
}
}
- private void OnAddCustomControl(object sender, EventArgs e)
+ private void OnAddCustomControl(object? sender, EventArgs e)
{
if ((_ribbonTriple.RibbonGroup != null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
{
@@ -567,13 +574,13 @@ private void OnAddCustomControl(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonTriple)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonTriple)[@"Items"];
RaiseComponentChanging(propertyItems);
// Get designer to create a custom control item
var cc = (KryptonRibbonGroupCustomControl)_designerHost.CreateComponent(typeof(KryptonRibbonGroupCustomControl));
- _ribbonTriple.Items.Add(cc);
+ _ribbonTriple.Items!.Add(cc);
RaiseComponentChanged(propertyItems, null, null);
}
@@ -585,9 +592,9 @@ private void OnAddCustomControl(object sender, EventArgs e)
}
}
- private void OnAddTextBox(object sender, EventArgs e)
+ private void OnAddTextBox(object? sender, EventArgs e)
{
- if ((_ribbonTriple.RibbonGroup != null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
+ if ((_ribbonTriple.RibbonGroup is not null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupTriple AddTextBox");
@@ -595,13 +602,13 @@ private void OnAddTextBox(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonTriple)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonTriple)[@"Items"];
RaiseComponentChanging(propertyItems);
// Get designer to create a textbox item
var tb = (KryptonRibbonGroupTextBox)_designerHost.CreateComponent(typeof(KryptonRibbonGroupTextBox));
- _ribbonTriple.Items.Add(tb);
+ _ribbonTriple.Items!.Add(tb);
RaiseComponentChanged(propertyItems, null, null);
}
@@ -613,9 +620,9 @@ private void OnAddTextBox(object sender, EventArgs e)
}
}
- private void OnAddTrackBar(object sender, EventArgs e)
+ private void OnAddTrackBar(object? sender, EventArgs e)
{
- if ((_ribbonTriple.RibbonGroup != null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
+ if ((_ribbonTriple.RibbonGroup is not null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupTriple AddTrackBar");
@@ -623,13 +630,13 @@ private void OnAddTrackBar(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonTriple)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonTriple)[@"Items"];
RaiseComponentChanging(propertyItems);
// Get designer to create a trackbar item
var tb = (KryptonRibbonGroupTrackBar)_designerHost.CreateComponent(typeof(KryptonRibbonGroupTrackBar));
- _ribbonTriple.Items.Add(tb);
+ _ribbonTriple.Items!.Add(tb);
RaiseComponentChanged(propertyItems, null, null);
}
@@ -641,9 +648,9 @@ private void OnAddTrackBar(object sender, EventArgs e)
}
}
- private void OnAddThemeComboBox(object sender, EventArgs e)
+ private void OnAddThemeComboBox(object? sender, EventArgs e)
{
- if ((_ribbonTriple.RibbonGroup != null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
+ if ((_ribbonTriple.RibbonGroup is not null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupTriple AddThemeComboBox");
@@ -651,13 +658,13 @@ private void OnAddThemeComboBox(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonTriple)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonTriple)[@"Items"];
RaiseComponentChanging(propertyItems);
// Get designer to create a themecombobox item
var tcb = (KryptonRibbonGroupThemeComboBox)_designerHost.CreateComponent(typeof(KryptonRibbonGroupThemeComboBox));
- _ribbonTriple.Items.Add(tcb);
+ _ribbonTriple.Items!.Add(tcb);
RaiseComponentChanged(propertyItems, null, null);
}
@@ -669,9 +676,9 @@ private void OnAddThemeComboBox(object sender, EventArgs e)
}
}
- private void OnAddMaskedTextBox(object sender, EventArgs e)
+ private void OnAddMaskedTextBox(object? sender, EventArgs e)
{
- if ((_ribbonTriple.RibbonGroup != null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
+ if ((_ribbonTriple.RibbonGroup is not null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupTriple AddMaskedTextBox");
@@ -679,13 +686,13 @@ private void OnAddMaskedTextBox(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonTriple)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonTriple)[@"Items"];
RaiseComponentChanging(propertyItems);
// Get designer to create a textbox item
var mtb = (KryptonRibbonGroupMaskedTextBox)_designerHost.CreateComponent(typeof(KryptonRibbonGroupMaskedTextBox));
- _ribbonTriple.Items.Add(mtb);
+ _ribbonTriple.Items!.Add(mtb);
RaiseComponentChanged(propertyItems, null, null);
}
@@ -697,9 +704,9 @@ private void OnAddMaskedTextBox(object sender, EventArgs e)
}
}
- private void OnAddRichTextBox(object sender, EventArgs e)
+ private void OnAddRichTextBox(object? sender, EventArgs e)
{
- if ((_ribbonTriple.RibbonGroup != null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
+ if ((_ribbonTriple.RibbonGroup is not null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupTriple AddRichTextBox");
@@ -707,13 +714,13 @@ private void OnAddRichTextBox(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonTriple)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonTriple)[@"Items"];
RaiseComponentChanging(propertyItems);
// Get designer to create a richtextbox item
var rtb = (KryptonRibbonGroupRichTextBox)_designerHost.CreateComponent(typeof(KryptonRibbonGroupRichTextBox));
- _ribbonTriple.Items.Add(rtb);
+ _ribbonTriple.Items!.Add(rtb);
RaiseComponentChanged(propertyItems, null, null);
}
@@ -725,9 +732,9 @@ private void OnAddRichTextBox(object sender, EventArgs e)
}
}
- private void OnAddComboBox(object sender, EventArgs e)
+ private void OnAddComboBox(object? sender, EventArgs e)
{
- if ((_ribbonTriple.RibbonGroup != null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
+ if ((_ribbonTriple.RibbonGroup is not null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupTriple AddComboBox");
@@ -735,13 +742,13 @@ private void OnAddComboBox(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonTriple)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonTriple)[@"Items"];
RaiseComponentChanging(propertyItems);
// Get designer to create a combobox item
var cc = (KryptonRibbonGroupComboBox)_designerHost.CreateComponent(typeof(KryptonRibbonGroupComboBox));
- _ribbonTriple.Items.Add(cc);
+ _ribbonTriple.Items!.Add(cc);
RaiseComponentChanged(propertyItems, null, null);
}
@@ -753,9 +760,9 @@ private void OnAddComboBox(object sender, EventArgs e)
}
}
- private void OnAddNumericUpDown(object sender, EventArgs e)
+ private void OnAddNumericUpDown(object? sender, EventArgs e)
{
- if ((_ribbonTriple.RibbonGroup != null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
+ if ((_ribbonTriple.RibbonGroup is not null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupTriple AddNumericUpDown");
@@ -763,13 +770,13 @@ private void OnAddNumericUpDown(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonTriple)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonTriple)[@"Items"];
RaiseComponentChanging(propertyItems);
// Get designer to create a numeric up-down item
var cc = (KryptonRibbonGroupNumericUpDown)_designerHost.CreateComponent(typeof(KryptonRibbonGroupNumericUpDown));
- _ribbonTriple.Items.Add(cc);
+ _ribbonTriple.Items!.Add(cc);
RaiseComponentChanged(propertyItems, null, null);
}
@@ -781,9 +788,9 @@ private void OnAddNumericUpDown(object sender, EventArgs e)
}
}
- private void OnAddDomainUpDown(object sender, EventArgs e)
+ private void OnAddDomainUpDown(object? sender, EventArgs e)
{
- if ((_ribbonTriple.RibbonGroup != null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
+ if ((_ribbonTriple.RibbonGroup is not null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupTriple AddDomainUpDown");
@@ -791,13 +798,13 @@ private void OnAddDomainUpDown(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonTriple)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonTriple)[@"Items"];
RaiseComponentChanging(propertyItems);
// Get designer to create a domain up-down item
var cc = (KryptonRibbonGroupDomainUpDown)_designerHost.CreateComponent(typeof(KryptonRibbonGroupDomainUpDown));
- _ribbonTriple.Items.Add(cc);
+ _ribbonTriple.Items!.Add(cc);
RaiseComponentChanged(propertyItems, null, null);
}
@@ -809,9 +816,9 @@ private void OnAddDomainUpDown(object sender, EventArgs e)
}
}
- private void OnAddDateTimePicker(object sender, EventArgs e)
+ private void OnAddDateTimePicker(object? sender, EventArgs e)
{
- if ((_ribbonTriple.RibbonGroup != null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
+ if ((_ribbonTriple.RibbonGroup is not null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupTriple AddDateTimePicker");
@@ -819,13 +826,13 @@ private void OnAddDateTimePicker(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonTriple)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonTriple)[@"Items"];
RaiseComponentChanging(propertyItems);
// Get designer to create a domain up-down item
var cc = (KryptonRibbonGroupDateTimePicker)_designerHost.CreateComponent(typeof(KryptonRibbonGroupDateTimePicker));
- _ribbonTriple.Items.Add(cc);
+ _ribbonTriple.Items!.Add(cc);
RaiseComponentChanged(propertyItems, null, null);
}
@@ -837,32 +844,35 @@ private void OnAddDateTimePicker(object sender, EventArgs e)
}
}
- private void OnClearItems(object sender, EventArgs e)
+ private void OnClearItems(object? sender, EventArgs e)
{
- if ((_ribbonTriple.RibbonGroup != null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
+ if ((_ribbonTriple.RibbonGroup is not null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupTriple ClearItems");
try
{
- // Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonTriple)[@"Items"];
+ if (_ribbonTriple.Items is not null)
+ {
+ // Get access to the Items property
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonTriple)[@"Items"];
- RaiseComponentChanging(propertyItems);
+ RaiseComponentChanging(propertyItems);
- // Need access to host in order to delete a component
- var host = (IDesignerHost)GetService(typeof(IDesignerHost));
+ // Need access to host in order to delete a component
+ var host = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("host"));
- // We need to remove all the items from the triple group
- for (var i = _ribbonTriple.Items.Count - 1; i >= 0; i--)
- {
- KryptonRibbonGroupItem item = _ribbonTriple.Items[i];
- _ribbonTriple.Items.Remove(item);
- host.DestroyComponent(item);
- }
+ // We need to remove all the items from the triple group
+ for (var i = _ribbonTriple.Items.Count - 1 ; i >= 0 ; i--)
+ {
+ KryptonRibbonGroupItem item = _ribbonTriple.Items[i];
+ _ribbonTriple.Items.Remove(item);
+ host.DestroyComponent(item);
+ }
- RaiseComponentChanged(propertyItems, null, null);
+ RaiseComponentChanged(propertyItems, null, null);
+ }
}
finally
{
@@ -872,9 +882,9 @@ private void OnClearItems(object sender, EventArgs e)
}
}
- private void OnDeleteTriple(object sender, EventArgs e)
+ private void OnDeleteTriple(object? sender, EventArgs e)
{
- if ((_ribbonTriple.RibbonGroup != null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
+ if ((_ribbonTriple.RibbonGroup is not null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupTriple DeleteTriple");
@@ -882,7 +892,7 @@ private void OnDeleteTriple(object sender, EventArgs e)
try
{
// Get access to the Items property
- MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonTriple.RibbonGroup)[@"Items"];
+ MemberDescriptor? propertyItems = TypeDescriptor.GetProperties(_ribbonTriple.RibbonGroup)[@"Items"];
// Remove the ribbon group from the ribbon tab
RaiseComponentChanging(null);
@@ -905,61 +915,61 @@ private void OnDeleteTriple(object sender, EventArgs e)
}
}
- private void OnVisible(object sender, EventArgs e)
+ private void OnVisible(object? sender, EventArgs e)
{
- if ((_ribbonTriple.RibbonGroup != null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
+ if ((_ribbonTriple.RibbonGroup is not null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
{
_changeService.OnComponentChanged(_ribbonTriple, null, _ribbonTriple.Visible, !_ribbonTriple.Visible);
_ribbonTriple.Visible = !_ribbonTriple.Visible;
}
}
- private void OnMaxLarge(object sender, EventArgs e)
+ private void OnMaxLarge(object? sender, EventArgs e)
{
- if ((_ribbonTriple.RibbonGroup != null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
+ if ((_ribbonTriple.RibbonGroup is not null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
{
_changeService.OnComponentChanged(_ribbonTriple, null, _ribbonTriple.MaximumSize, GroupItemSize.Large);
_ribbonTriple.MaximumSize = GroupItemSize.Large;
}
}
- private void OnMaxMedium(object sender, EventArgs e)
+ private void OnMaxMedium(object? sender, EventArgs e)
{
- if ((_ribbonTriple.RibbonGroup != null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
+ if ((_ribbonTriple.RibbonGroup is not null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
{
_changeService.OnComponentChanged(_ribbonTriple, null, _ribbonTriple.MaximumSize, GroupItemSize.Medium);
_ribbonTriple.MaximumSize = GroupItemSize.Medium;
}
}
- private void OnMaxSmall(object sender, EventArgs e)
+ private void OnMaxSmall(object? sender, EventArgs e)
{
- if ((_ribbonTriple?.Ribbon != null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
+ if ((_ribbonTriple.RibbonGroup is not null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
{
_changeService.OnComponentChanged(_ribbonTriple, null, _ribbonTriple.MaximumSize, GroupItemSize.Small);
_ribbonTriple.MaximumSize = GroupItemSize.Small;
}
}
- private void OnMinLarge(object sender, EventArgs e)
+ private void OnMinLarge(object? sender, EventArgs e)
{
- if ((_ribbonTriple.RibbonGroup != null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
+ if ((_ribbonTriple.RibbonGroup is not null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
{
_changeService.OnComponentChanged(_ribbonTriple, null, _ribbonTriple.MinimumSize, GroupItemSize.Large);
_ribbonTriple.MinimumSize = GroupItemSize.Large;
}
}
- private void OnMinMedium(object sender, EventArgs e)
+ private void OnMinMedium(object? sender, EventArgs e)
{
- if ((_ribbonTriple.RibbonGroup != null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
+ if ((_ribbonTriple.RibbonGroup is not null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
{
_changeService.OnComponentChanged(_ribbonTriple, null, _ribbonTriple.MinimumSize, GroupItemSize.Medium);
_ribbonTriple.MinimumSize = GroupItemSize.Medium;
}
}
- private void OnMinSmall(object sender, EventArgs e)
+ private void OnMinSmall(object? sender, EventArgs e)
{
if ((_ribbonTriple.RibbonGroup != null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
{
@@ -968,15 +978,15 @@ private void OnMinSmall(object sender, EventArgs e)
}
}
- private void OnComponentChanged(object sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
+ private void OnComponentChanged(object? sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
- private void OnComponentRemoving(object sender, ComponentEventArgs e)
+ private void OnComponentRemoving(object? sender, ComponentEventArgs e)
{
// If our triple is being removed
- if (e.Component == _ribbonTriple)
+ if (e.Component == _ribbonTriple && _ribbonTriple.Items is not null)
{
// Need access to host in order to delete a component
- var host = (IDesignerHost)GetService(typeof(IDesignerHost));
+ var host = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("host"));
// We need to remove all items from the triple group
for (var j = _ribbonTriple.Items.Count - 1; j >= 0; j--)
@@ -988,7 +998,7 @@ private void OnComponentRemoving(object sender, ComponentEventArgs e)
}
}
- private void OnContextMenu(object sender, MouseEventArgs e)
+ private void OnContextMenu(object? sender, MouseEventArgs e)
{
if ((_ribbonTriple.RibbonGroup != null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
{
@@ -1081,7 +1091,7 @@ private void OnContextMenu(object sender, MouseEventArgs e)
UpdateMoveToGroup();
// Update menu items state from verb
- _toggleHelpersMenu.Checked = _ribbonTriple.Ribbon.InDesignHelperMode;
+ _toggleHelpersMenu.Checked = _ribbonTriple.Ribbon!.InDesignHelperMode;
_visibleMenu.Checked = _ribbonTriple.Visible;
_maximumLMenu.Checked = _ribbonTriple.MaximumSize == GroupItemSize.Large;
_maximumMMenu.Checked = _ribbonTriple.MaximumSize == GroupItemSize.Medium;
@@ -1125,7 +1135,7 @@ private void UpdateMoveToGroup()
// Remove any existing child items
_moveToGroupMenu.DropDownItems.Clear();
- if (_ribbonTriple.Ribbon != null)
+ if (_ribbonTriple.Ribbon is not null && _ribbonTriple.RibbonTab is not null)
{
// Create a new item per group in the same ribbon tab
foreach (KryptonRibbonGroup group in _ribbonTriple.RibbonTab.Groups)
@@ -1150,15 +1160,15 @@ private void UpdateMoveToGroup()
}
}
- private void OnMoveToGroup(object sender, EventArgs e)
+ private void OnMoveToGroup(object? sender, EventArgs e)
{
if ((_ribbonTriple.RibbonGroup != null) && _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
{
// Cast to correct type
- var groupMenuItem = (ToolStripMenuItem)sender;
+ var groupMenuItem = sender as ToolStripMenuItem ?? throw new ArgumentNullException(nameof(sender));
// Get access to the destination tab
- var destination = (KryptonRibbonGroup)groupMenuItem.Tag;
+ var destination = groupMenuItem.Tag as KryptonRibbonGroup ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("destination"));
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonGroupTriple MoveTripleToGroup");
@@ -1166,8 +1176,8 @@ private void OnMoveToGroup(object sender, EventArgs e)
try
{
// Get access to the Groups property
- MemberDescriptor oldItems = TypeDescriptor.GetProperties(_ribbonTriple.RibbonGroup)[@"Items"];
- MemberDescriptor newItems = TypeDescriptor.GetProperties(destination)[@"Items"];
+ MemberDescriptor? oldItems = TypeDescriptor.GetProperties(_ribbonTriple.RibbonGroup)[@"Items"];
+ MemberDescriptor? newItems = TypeDescriptor.GetProperties(destination)[@"Items"];
// Remove the ribbon tab from the ribbon
RaiseComponentChanging(null);
diff --git a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonTabDesigner.cs b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonTabDesigner.cs
index 3d8374e9d..7b9eccb9f 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonTabDesigner.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Designers/Designers/KryptonRibbonTabDesigner.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -69,8 +69,8 @@ public override void Initialize([DisallowNull] IComponent component)
}
// Get access to the services
- _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
- _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
+ _designerHost = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_designerHost)));
+ _changeService = (IComponentChangeService?)GetService(typeof(IComponentChangeService)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(_changeService)));
// We need to know when we are being removed/changed
_changeService.ComponentRemoving += OnComponentRemoving;
@@ -85,7 +85,12 @@ public override ICollection AssociatedComponents
get
{
var compound = new ArrayList(base.AssociatedComponents);
- compound.AddRange(_ribbonTab.Groups);
+
+ if (_ribbonTab is not null)
+ {
+ compound.AddRange(_ribbonTab.Groups);
+ }
+
return compound;
}
}
@@ -98,7 +103,7 @@ public override DesignerVerbCollection Verbs
get
{
UpdateVerbStatus();
- return _verbs;
+ return _verbs!;
}
}
#endregion
@@ -122,8 +127,12 @@ protected override void Dispose(bool disposing)
}
// Unhook from events
- _ribbonTab.DesignTimeAddGroup -= OnAddGroup;
- _ribbonTab.DesignTimeContextMenu -= OnContextMenu;
+ if (_ribbonTab is not null)
+ {
+ _ribbonTab.DesignTimeAddGroup -= OnAddGroup;
+ _ribbonTab.DesignTimeContextMenu -= OnContextMenu;
+ }
+
_changeService.ComponentRemoving -= OnComponentRemoving;
_changeService.ComponentChanged -= OnComponentChanged;
}
@@ -140,9 +149,9 @@ protected override void Dispose(bool disposing)
private void UpdateVerbStatus()
{
// Create verbs first time around
- if (_verbs == null)
+ if (_verbs is null)
{
- _verbs = new DesignerVerbCollection();
+ _verbs = [];
_toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
_moveFirstVerb = new DesignerVerb(@"Move First", OnMoveFirst);
_movePrevVerb = new DesignerVerb(@"Move Previous", OnMovePrevious);
@@ -160,7 +169,7 @@ private void UpdateVerbStatus()
var moveLast = false;
var clearGroups = false;
- if ((_ribbonTab?.Ribbon != null) && _ribbonTab.Ribbon.RibbonTabs.Contains(_ribbonTab))
+ if ((_ribbonTab?.Ribbon is not null) && _ribbonTab.Ribbon.RibbonTabs.Contains(_ribbonTab))
{
moveFirst = _ribbonTab.Ribbon.RibbonTabs.IndexOf(_ribbonTab) > 0;
movePrev = _ribbonTab.Ribbon.RibbonTabs.IndexOf(_ribbonTab) > 0;
@@ -176,7 +185,7 @@ private void UpdateVerbStatus()
_clearGroupsVerb.Enabled = clearGroups;
}
- private void OnToggleHelpers(object sender, EventArgs e)
+ private void OnToggleHelpers(object? sender, EventArgs e)
{
// Invert the current toggle helper mode
if (_ribbonTab?.Ribbon != null)
@@ -185,7 +194,7 @@ private void OnToggleHelpers(object sender, EventArgs e)
}
}
- private void OnMoveFirst(object sender, EventArgs e)
+ private void OnMoveFirst(object? sender, EventArgs e)
{
if ((_ribbonTab?.Ribbon != null) && _ribbonTab.Ribbon.RibbonTabs.Contains(_ribbonTab))
{
@@ -195,7 +204,7 @@ private void OnMoveFirst(object sender, EventArgs e)
try
{
// Get access to the RibbonTabs property
- MemberDescriptor propertyTabs = TypeDescriptor.GetProperties(_ribbonTab.Ribbon)[@"RibbonTabs"];
+ MemberDescriptor? propertyTabs = TypeDescriptor.GetProperties(_ribbonTab.Ribbon)[@"RibbonTabs"];
RaiseComponentChanging(propertyTabs);
@@ -216,9 +225,11 @@ private void OnMoveFirst(object sender, EventArgs e)
}
}
- private void OnMovePrevious(object sender, EventArgs e)
+ private void OnMovePrevious(object? sender, EventArgs e)
{
- if ((_ribbonTab?.Ribbon != null) && _ribbonTab.Ribbon.RibbonTabs.Contains(_ribbonTab))
+ if ((_ribbonTab is not null)
+ && _ribbonTab.Ribbon != null
+ && _ribbonTab.Ribbon.RibbonTabs.Contains(_ribbonTab))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonTab MoveNext");
@@ -226,7 +237,7 @@ private void OnMovePrevious(object sender, EventArgs e)
try
{
// Get access to the RibbonTabs property
- MemberDescriptor propertyTabs = TypeDescriptor.GetProperties(_ribbonTab.Ribbon)[@"RibbonTabs"];
+ MemberDescriptor? propertyTabs = TypeDescriptor.GetProperties(_ribbonTab.Ribbon)[@"RibbonTabs"];
RaiseComponentChanging(propertyTabs);
@@ -249,9 +260,12 @@ private void OnMovePrevious(object sender, EventArgs e)
}
}
- private void OnMoveNext(object sender, EventArgs e)
+ private void OnMoveNext(object? sender, EventArgs e)
{
- if ((_ribbonTab?.Ribbon != null) && _ribbonTab.Ribbon.RibbonTabs.Contains(_ribbonTab))
+ if ((_ribbonTab is not null)
+ && _ribbonTab.Ribbon != null
+ && _ribbonTab.Ribbon.RibbonTabs.Contains(_ribbonTab))
+
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonTab MovePrevious");
@@ -259,7 +273,7 @@ private void OnMoveNext(object sender, EventArgs e)
try
{
// Get access to the RibbonTabs property
- MemberDescriptor propertyTabs = TypeDescriptor.GetProperties(_ribbonTab.Ribbon)[@"RibbonTabs"];
+ MemberDescriptor? propertyTabs = TypeDescriptor.GetProperties(_ribbonTab.Ribbon)[@"RibbonTabs"];
RaiseComponentChanging(propertyTabs);
@@ -282,9 +296,11 @@ private void OnMoveNext(object sender, EventArgs e)
}
}
- private void OnMoveLast(object sender, EventArgs e)
+ private void OnMoveLast(object? sender, EventArgs e)
{
- if ((_ribbonTab?.Ribbon != null) && _ribbonTab.Ribbon.RibbonTabs.Contains(_ribbonTab))
+ if ((_ribbonTab is not null)
+ && _ribbonTab.Ribbon != null
+ && _ribbonTab.Ribbon.RibbonTabs.Contains(_ribbonTab))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonTab MoveLast");
@@ -292,7 +308,7 @@ private void OnMoveLast(object sender, EventArgs e)
try
{
// Get access to the RibbonTabs property
- MemberDescriptor propertyTabs = TypeDescriptor.GetProperties(_ribbonTab.Ribbon)[@"RibbonTabs"];
+ MemberDescriptor? propertyTabs = TypeDescriptor.GetProperties(_ribbonTab.Ribbon)[@"RibbonTabs"];
RaiseComponentChanging(propertyTabs);
@@ -313,9 +329,11 @@ private void OnMoveLast(object sender, EventArgs e)
}
}
- private void OnAddGroup(object sender, EventArgs e)
+ private void OnAddGroup(object? sender, EventArgs e)
{
- if ((_ribbonTab?.Ribbon != null) && _ribbonTab.Ribbon.RibbonTabs.Contains(_ribbonTab))
+ if ((_ribbonTab is not null)
+ && _ribbonTab.Ribbon != null
+ && _ribbonTab.Ribbon.RibbonTabs.Contains(_ribbonTab))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonTab AddGroup");
@@ -323,7 +341,7 @@ private void OnAddGroup(object sender, EventArgs e)
try
{
// Get access to the Groups property
- MemberDescriptor propertyGroups = TypeDescriptor.GetProperties(_ribbonTab)[@"Groups"];
+ MemberDescriptor? propertyGroups = TypeDescriptor.GetProperties(_ribbonTab)[@"Groups"];
RaiseComponentChanging(propertyGroups);
@@ -341,9 +359,11 @@ private void OnAddGroup(object sender, EventArgs e)
}
}
- private void OnClearGroups(object sender, EventArgs e)
+ private void OnClearGroups(object? sender, EventArgs e)
{
- if ((_ribbonTab?.Ribbon != null) && _ribbonTab.Ribbon.RibbonTabs.Contains(_ribbonTab))
+ if ((_ribbonTab is not null)
+ && _ribbonTab.Ribbon != null
+ && _ribbonTab.Ribbon.RibbonTabs.Contains(_ribbonTab))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonTab ClearGroups");
@@ -351,12 +371,12 @@ private void OnClearGroups(object sender, EventArgs e)
try
{
// Get access to the Groups property
- MemberDescriptor propertyGroups = TypeDescriptor.GetProperties(_ribbonTab)[@"Groups"];
+ MemberDescriptor? propertyGroups = TypeDescriptor.GetProperties(_ribbonTab)[@"Groups"];
RaiseComponentChanging(propertyGroups);
// Need access to host in order to delete a component
- var host = (IDesignerHost)GetService(typeof(IDesignerHost));
+ var host = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("host"));
// We need to remove all the groups from the tab
for (var i = _ribbonTab.Groups.Count - 1; i >= 0; i--)
@@ -376,9 +396,11 @@ private void OnClearGroups(object sender, EventArgs e)
}
}
- private void OnDeleteTab(object sender, EventArgs e)
+ private void OnDeleteTab(object? sender, EventArgs e)
{
- if ((_ribbonTab?.Ribbon != null) && _ribbonTab.Ribbon.RibbonTabs.Contains(_ribbonTab))
+ if ((_ribbonTab is not null)
+ && _ribbonTab.Ribbon != null
+ && _ribbonTab.Ribbon.RibbonTabs.Contains(_ribbonTab))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction(@"KryptonRibbonTab DeleteTab");
@@ -386,7 +408,7 @@ private void OnDeleteTab(object sender, EventArgs e)
try
{
// Get access to the RibbonTabs property
- MemberDescriptor propertyTabs = TypeDescriptor.GetProperties(_ribbonTab.Ribbon)[@"RibbonTabs"];
+ MemberDescriptor? propertyTabs = TypeDescriptor.GetProperties(_ribbonTab.Ribbon)[@"RibbonTabs"];
// Remove the ribbon tab from the ribbon
RaiseComponentChanging(null);
@@ -409,24 +431,26 @@ private void OnDeleteTab(object sender, EventArgs e)
}
}
- private void OnVisible(object sender, EventArgs e)
+ private void OnVisible(object? sender, EventArgs e)
{
- if ((_ribbonTab?.Ribbon != null) && _ribbonTab.Ribbon.RibbonTabs.Contains(_ribbonTab))
+ if ((_ribbonTab is not null)
+ && _ribbonTab.Ribbon != null
+ && _ribbonTab.Ribbon.RibbonTabs.Contains(_ribbonTab))
{
_changeService.OnComponentChanged(_ribbonTab, null, _ribbonTab.Visible, !_ribbonTab.Visible);
_ribbonTab.Visible = !_ribbonTab.Visible;
}
}
- private void OnComponentChanged(object sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
+ private void OnComponentChanged(object? sender, ComponentChangedEventArgs e) => UpdateVerbStatus();
- private void OnComponentRemoving(object sender, ComponentEventArgs e)
+ private void OnComponentRemoving(object? sender, ComponentEventArgs e)
{
// If our tab is being removed
- if (e.Component == _ribbonTab)
+ if ( _ribbonTab is not null && e.Component == _ribbonTab)
{
// Need access to host in order to delete a component
- var host = (IDesignerHost)GetService(typeof(IDesignerHost));
+ var host = (IDesignerHost?)GetService(typeof(IDesignerHost)) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("host"));
// We need to remove all the groups from the tab
for (var i = _ribbonTab.Groups.Count - 1; i >= 0; i--)
@@ -438,12 +462,14 @@ private void OnComponentRemoving(object sender, ComponentEventArgs e)
}
}
- private void OnContextMenu(object sender, MouseEventArgs e)
+ private void OnContextMenu(object? sender, MouseEventArgs e)
{
- if ((_ribbonTab?.Ribbon != null) && _ribbonTab.Ribbon.RibbonTabs.Contains(_ribbonTab))
+ if ((_ribbonTab is not null)
+ && _ribbonTab.Ribbon != null
+ && _ribbonTab.Ribbon.RibbonTabs.Contains(_ribbonTab))
{
// Create the menu strip the first time around
- if (_cms == null)
+ if (_cms is null)
{
_cms = new ContextMenuStrip();
_toggleHelpersMenu = new ToolStripMenuItem("Design Helpers", null, OnToggleHelpers);
diff --git a/Source/Krypton Components/Krypton.Ribbon/EventArgs/GalleryDropMenuEventArgs.cs b/Source/Krypton Components/Krypton.Ribbon/EventArgs/GalleryDropMenuEventArgs.cs
index 2022ec8fa..58b728710 100644
--- a/Source/Krypton Components/Krypton.Ribbon/EventArgs/GalleryDropMenuEventArgs.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/EventArgs/GalleryDropMenuEventArgs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
diff --git a/Source/Krypton Components/Krypton.Ribbon/General/AppButtonMenuProvider.cs b/Source/Krypton Components/Krypton.Ribbon/General/AppButtonMenuProvider.cs
index 8c5ada840..1bd8cd1ab 100644
--- a/Source/Krypton Components/Krypton.Ribbon/General/AppButtonMenuProvider.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/General/AppButtonMenuProvider.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -60,7 +60,7 @@ public AppButtonMenuProvider(ViewContextMenuManager viewManager,
ViewLayoutStack viewColumns,
PaletteBase? palette,
PaletteMode paletteMode,
- PaletteRedirect? redirector,
+ PaletteRedirect redirector,
NeedPaintHandler needPaintDelegate)
{
// Store incoming state
@@ -166,7 +166,7 @@ public Rectangle ProviderShowSubMenuFixedRect(KryptonContextMenuItem menuItem)
{
if (ProviderShowSubMenuFixed(menuItem))
{
- Rectangle screenRect = FixedViewBase.OwningControl.RectangleToScreen(FixedViewBase.ClientRectangle);
+ Rectangle screenRect = FixedViewBase.OwningControl!.RectangleToScreen(FixedViewBase.ClientRectangle);
screenRect.Y++;
screenRect.Width -= 3;
screenRect.Height -= 4;
@@ -261,7 +261,7 @@ public ToolStripDropDownCloseReason? ProviderCloseReason
///
/// Gets access to the context menu redirector.
///
- public PaletteRedirect? ProviderRedirector { get; }
+ public PaletteRedirect ProviderRedirector { get; }
///
/// Gets a delegate used to indicate a repaint is required.
diff --git a/Source/Krypton Components/Krypton.Ribbon/General/CalculatedValues.cs b/Source/Krypton Components/Krypton.Ribbon/General/CalculatedValues.cs
index 17a570a60..cc0692df5 100644
--- a/Source/Krypton Components/Krypton.Ribbon/General/CalculatedValues.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/General/CalculatedValues.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -49,10 +49,10 @@ internal class CalculatedValues
/// Initialize a new instance of the CalculatedValues class.
///
/// Source control instance.
- public CalculatedValues([DisallowNull] KryptonRibbon ribbon)
+ public CalculatedValues([DisallowNull] KryptonRibbon? ribbon)
{
- Debug.Assert(ribbon != null);
- _ribbon = ribbon;
+ Debug.Assert(ribbon is not null);
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
_lastShape = PaletteRibbonShape.Inherit;
}
@@ -221,21 +221,27 @@ public Point KeyTipRectToPoint(Rectangle viewRect, int groupLine)
case 1:
screenPt = new Point(viewRect.Left + KEYTIP_HOFFSET, viewRect.Top);
break;
+
case 2:
screenPt = new Point(viewRect.Left + KEYTIP_HOFFSET, viewRect.Top + (viewRect.Height / 2) + KEYTIP_VOFFSET_LINE2);
break;
+
case 3:
screenPt = new Point(viewRect.Left + KEYTIP_HOFFSET, viewRect.Bottom);
break;
+
case 4:
screenPt = new Point(viewRect.Left + KEYTIP_HOFFSET, viewRect.Top - KEYTIP_VOFFSET_LINE4);
break;
+
case 5:
screenPt = new Point(viewRect.Left + KEYTIP_HOFFSET, viewRect.Bottom + KEYTIP_VOFFSET_LINE5);
break;
+
default:
// Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(groupLine.ToString());
screenPt = new Point(viewRect.X, viewRect.Y);
break;
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/General/Definitions.cs b/Source/Krypton Components/Krypton.Ribbon/General/Definitions.cs
index a91b4dd14..d28f31463 100644
--- a/Source/Krypton Components/Krypton.Ribbon/General/Definitions.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/General/Definitions.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -80,7 +80,7 @@ public interface IQuickAccessToolbarButton
///
/// Gets the image for the item ToolTip.
///
- Image GetToolTipImage();
+ Image? GetToolTipImage();
///
/// Gets the color to draw as transparent in the ToolTipImage.
@@ -169,8 +169,8 @@ public interface IRibbonGroupItem
///
/// Return base objects tooltip
///
- ToolTipValues ToolTipValues
- {
+ ToolTipValues ToolTipValues
+ {
// Return base objects tooltip
get;
}
@@ -209,13 +209,13 @@ internal interface IRibbonViewGroupItemView
/// Gets the first focus item from the item.
///
/// ViewBase of item; otherwise false.
- ViewBase? GetFirstFocusItem();
+ ViewBase GetFirstFocusItem();
///
/// Gets the last focus item from the item.
///
/// ViewBase of item; otherwise false.
- ViewBase? GetLastFocusItem();
+ ViewBase GetLastFocusItem();
///
/// Gets the next focus item based on the current item as provided.
@@ -223,7 +223,7 @@ internal interface IRibbonViewGroupItemView
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- ViewBase? GetNextFocusItem(ViewBase current, ref bool matched);
+ ViewBase GetNextFocusItem(ViewBase current, ref bool matched);
///
/// Gets the previous focus item based on the current item as provided.
@@ -231,7 +231,7 @@ internal interface IRibbonViewGroupItemView
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- ViewBase? GetPreviousFocusItem(ViewBase current, ref bool matched);
+ ViewBase GetPreviousFocusItem(ViewBase current, ref bool matched);
///
/// Gets the array of group level key tips.
@@ -267,13 +267,13 @@ internal interface IRibbonViewGroupContainerView
/// Gets the first focus item from the container.
///
/// ViewBase of item; otherwise false.
- ViewBase? GetFirstFocusItem();
+ ViewBase GetFirstFocusItem();
///
/// Gets the last focus item from the container.
///
/// ViewBase of item; otherwise false.
- ViewBase? GetLastFocusItem();
+ ViewBase GetLastFocusItem();
///
/// Gets the next focus item based on the current item as provided.
@@ -281,7 +281,7 @@ internal interface IRibbonViewGroupContainerView
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- ViewBase? GetNextFocusItem(ViewBase current, ref bool matched);
+ ViewBase GetNextFocusItem(ViewBase current, ref bool matched);
///
/// Gets the previous focus item based on the current item as provided.
@@ -289,7 +289,7 @@ internal interface IRibbonViewGroupContainerView
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- ViewBase? GetPreviousFocusItem(ViewBase current, ref bool matched);
+ ViewBase GetPreviousFocusItem(ViewBase current, ref bool matched);
///
/// Gets the array of group level key tips.
@@ -313,7 +313,7 @@ internal interface IRibbonViewGroupSize
/// Update the group with the provided sizing solution.
///
/// Array of values for the group containers.
- void SetSolutionSize(ItemSizeWidth[] size);
+ void SetSolutionSize(ItemSizeWidth[]? size);
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/General/DesignTimeDraw.cs b/Source/Krypton Components/Krypton.Ribbon/General/DesignTimeDraw.cs
index 3c891f069..58b906c6e 100644
--- a/Source/Krypton Components/Krypton.Ribbon/General/DesignTimeDraw.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/General/DesignTimeDraw.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
diff --git a/Source/Krypton Components/Krypton.Ribbon/General/ItemGroupSizeWidth.cs b/Source/Krypton Components/Krypton.Ribbon/General/ItemGroupSizeWidth.cs
index 3f68a8859..25bd3af65 100644
--- a/Source/Krypton Components/Krypton.Ribbon/General/ItemGroupSizeWidth.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/General/ItemGroupSizeWidth.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -70,7 +70,7 @@ internal class GroupSizeWidth
///
/// Width available for sizing a group.
/// Sizing information for applying to group.
- public GroupSizeWidth(int width, ItemSizeWidth[] sizing)
+ public GroupSizeWidth(int width, ItemSizeWidth[]? sizing)
{
Width = width;
Sizing = sizing;
@@ -86,7 +86,7 @@ public GroupSizeWidth(int width, ItemSizeWidth[] sizing)
///
/// Gets and sets the array of sizing information for group.
///
- public ItemSizeWidth[] Sizing { get; set; }
+ public ItemSizeWidth[]? Sizing { get; set; }
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/General/KeyTipInfo.cs b/Source/Krypton Components/Krypton.Ribbon/General/KeyTipInfo.cs
index 0b3df46ee..672b4c1a5 100644
--- a/Source/Krypton Components/Krypton.Ribbon/General/KeyTipInfo.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/General/KeyTipInfo.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -14,7 +14,7 @@
namespace Krypton.Ribbon
{
- internal class KeyTipInfoList : List {}
+ internal class KeyTipInfoList : List;
internal class KeyTipInfo
{
diff --git a/Source/Krypton Components/Krypton.Ribbon/Global/GlobalDeclarations.cs b/Source/Krypton Components/Krypton.Ribbon/Global/GlobalDeclarations.cs
index c39dea128..2825d6e4b 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Global/GlobalDeclarations.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Global/GlobalDeclarations.cs
@@ -1,7 +1,7 @@
#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. 2021 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2021 - 2024. All rights reserved.
*/
#endregion
@@ -40,4 +40,7 @@
[assembly: Dependency(@"System.Drawing", LoadHint.Always)]
[assembly: Dependency(@"System.Windows.Forms", LoadHint.Always)]
[assembly: Dependency(@"Krypton.Toolkit", LoadHint.Always)]
-[assembly: InternalsVisibleTo(@"Krypton.Toolkit, PublicKey=a87e673e9ecb6e8e", AllInternalsVisible = true)]
+
+// Public key value needs to be the full key. Before, this was the PublicKeyToken value.
+// See: https://stackoverflow.com/questions/106880/internalsvisibleto-attribute-isnt-working/107958#107958
+[assembly: InternalsVisibleTo( "Krypton.Toolkit, PublicKey=00240000048000009400000006020000002400005253413100040000010001001f208b6887f7b4f8fad6c30b9eca9849f09cbfbd37901e222f8e888331622c907dfa686c56389c95966b86b33f0dd0ab4cca46b1f1ed92efd7d5ddee2e2274f485867202c581f68c32bd3278ab1188e978a53ea6851be2c14d87efe9ed78c71df95e1a7f7d6923b6703c00dc56b76fd582f945cd0c1951844ebe478a911fcab4", AllInternalsVisible = true)]
diff --git a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupButton.cs b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupButton.cs
index a5dbaeb45..f8b412fd1 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupButton.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupButton.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -529,7 +529,7 @@ public override ViewBase CreateView(KryptonRibbon ribbon,
///
/// Source of the event.
/// A PropertyChangedEventArgs that contains the event data.
- protected virtual void OnCommandPropertyChanged(object sender, PropertyChangedEventArgs e)
+ protected virtual void OnCommandPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
switch (e.PropertyName)
{
@@ -562,7 +562,7 @@ protected virtual void OnClick(EventHandler? finishDelegate)
{
var fireDelegate = true;
- if (!Ribbon.InDesignMode)
+ if (!Ribbon!.InDesignMode)
{
// Events only occur when enabled
if (Enabled)
@@ -618,7 +618,7 @@ protected virtual void OnDropDown(EventHandler? finishDelegate)
{
var fireDelegate = true;
- if (!Ribbon.InDesignMode)
+ if (!Ribbon!.InDesignMode)
{
// Events only occur when enabled
if (Enabled)
@@ -729,13 +729,16 @@ internal override bool ProcessCmdKey(ref Message msg, Keys keyData)
case GroupButtonType.Check:
PerformClick();
return true;
+
case GroupButtonType.DropDown:
case GroupButtonType.Split:
PerformDropDown();
return true;
+
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(ButtonType.ToString());
break;
}
@@ -769,16 +772,18 @@ internal override bool ProcessCmdKey(ref Message msg, Keys keyData)
#endregion
#region Implementation
- private void OnKryptonContextMenuClosed(object sender, EventArgs e)
+ private void OnKryptonContextMenuClosed(object? sender, EventArgs e)
{
- var kcm = (KryptonContextMenu)sender;
- kcm.Closed -= OnKryptonContextMenuClosed;
-
- // Fire any associated finish delegate
- if (_kcmFinishDelegate != null)
+ if (sender is KryptonContextMenu kcm)
{
- _kcmFinishDelegate(this, e);
- _kcmFinishDelegate = null;
+ kcm.Closed -= OnKryptonContextMenuClosed;
+
+ // Fire any associated finish delegate
+ if (_kcmFinishDelegate != null)
+ {
+ _kcmFinishDelegate(this, e);
+ _kcmFinishDelegate = null;
+ }
}
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupCheckBox.cs b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupCheckBox.cs
index 17602cfcd..78c62fbb4 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupCheckBox.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupCheckBox.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -485,7 +485,7 @@ public override ViewBase CreateView(KryptonRibbon ribbon,
///
/// Source of the event.
/// A PropertyChangedEventArgs that contains the event data.
- protected virtual void OnCommandPropertyChanged(object sender, PropertyChangedEventArgs e)
+ protected virtual void OnCommandPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
switch (e.PropertyName)
{
@@ -513,7 +513,7 @@ protected virtual void OnClick(EventHandler? finishDelegate)
{
var fireDelegate = true;
- if (!Ribbon.InDesignMode)
+ if (!Ribbon!.InDesignMode)
{
if (Enabled)
{
diff --git a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupCluster.cs b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupCluster.cs
index 52d9dda4a..92e7fc68c 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupCluster.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupCluster.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -74,7 +74,7 @@ public KryptonRibbonGroupCluster()
_visible = true;
// Create collection for holding triple items
- Items = new KryptonRibbonGroupClusterCollection();
+ Items = [];
Items.Clearing += OnRibbonGroupClusterClearing;
Items.Cleared += OnRibbonGroupClusterCleared;
Items.Inserted += OnRibbonGroupClusterInserted;
@@ -315,7 +315,7 @@ public override Component[] GetChildComponents()
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[EditorBrowsable(EditorBrowsableState.Never)]
[Browsable(false)]
- public ViewBase ClusterView { get; set; }
+ public ViewBase? ClusterView { get; set; }
#endregion
@@ -350,7 +350,7 @@ internal override bool ProcessCmdKey(ref Message msg, Keys keyData)
#endregion
#region Private
- private void OnRibbonGroupClusterClearing(object sender, EventArgs e)
+ private void OnRibbonGroupClusterClearing(object? sender, EventArgs e)
{
// Remove the back references
foreach (IRibbonGroupItem item in Items)
@@ -361,7 +361,7 @@ private void OnRibbonGroupClusterClearing(object sender, EventArgs e)
}
}
- private void OnRibbonGroupClusterCleared(object sender, EventArgs e)
+ private void OnRibbonGroupClusterCleared(object? sender, EventArgs e)
{
// Only need to update display if this tab is selected
if ((Ribbon != null) && (RibbonTab != null) && (Ribbon.SelectedTab == RibbonTab))
@@ -373,7 +373,7 @@ private void OnRibbonGroupClusterCleared(object sender, EventArgs e)
private void OnRibbonGroupClusterInserted(object sender, TypedCollectionEventArgs e)
{
// Setup the back references
- e.Item.Ribbon = Ribbon;
+ e.Item!.Ribbon = Ribbon;
e.Item.RibbonTab = RibbonTab;
e.Item.RibbonContainer = this;
@@ -392,7 +392,7 @@ private void OnRibbonGroupClusterInserted(object sender, TypedCollectionEventArg
private void OnRibbonGroupClusterRemoved(object sender, TypedCollectionEventArgs e)
{
// Remove the back references
- e.Item.Ribbon = null;
+ e.Item!.Ribbon = null;
e.Item.RibbonTab = null;
e.Item.RibbonContainer = null;
diff --git a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupClusterButton.cs b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupClusterButton.cs
index 7e9b1a818..d24dd6eab 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupClusterButton.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupClusterButton.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -27,7 +27,7 @@ namespace Krypton.Ribbon
public class KryptonRibbonGroupClusterButton : KryptonRibbonGroupItem
{
#region Static Fields
- private static readonly Image _defaultButtonImageSmall = GenericImageResources.ButtonImageSmall;
+ private static readonly Image? _defaultButtonImageSmall = GenericImageResources.ButtonImageSmall;
#endregion
#region Instance Fields
@@ -500,7 +500,7 @@ public override ViewBase CreateView(KryptonRibbon ribbon,
///
/// Source of the event.
/// A PropertyChangedEventArgs that contains the event data.
- protected virtual void OnCommandPropertyChanged(object sender, PropertyChangedEventArgs e)
+ protected virtual void OnCommandPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
switch (e.PropertyName)
{
@@ -516,8 +516,6 @@ protected virtual void OnCommandPropertyChanged(object sender, PropertyChangedEv
case nameof(Checked):
OnPropertyChanged(nameof(Checked));
break;
- default:
- break;
}
}
@@ -529,7 +527,7 @@ protected virtual void OnClick(EventHandler? finishDelegate)
{
var fireDelegate = true;
- if (!Ribbon.InDesignMode)
+ if (!Ribbon!.InDesignMode)
{
// Events only occur when enabled
if (Enabled)
@@ -585,7 +583,7 @@ protected virtual void OnDropDown(EventHandler? finishDelegate)
{
var fireDelegate = true;
- if (!Ribbon.InDesignMode)
+ if (!Ribbon!.InDesignMode)
{
// Events only occur when enabled
if (Enabled)
@@ -696,13 +694,16 @@ internal override bool ProcessCmdKey(ref Message msg, Keys keyData)
case GroupButtonType.Check:
PerformClick();
return true;
+
case GroupButtonType.DropDown:
case GroupButtonType.Split:
PerformDropDown();
return true;
+
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(ButtonType.ToString());
break;
}
@@ -737,16 +738,18 @@ internal override bool ProcessCmdKey(ref Message msg, Keys keyData)
#endregion
#region Implementation
- private void OnKryptonContextMenuClosed(object sender, EventArgs e)
+ private void OnKryptonContextMenuClosed(object? sender, EventArgs e)
{
- var kcm = (KryptonContextMenu)sender;
- kcm.Closed -= OnKryptonContextMenuClosed;
-
- // Fire any associated finish delegate
- if (_kcmFinishDelegate != null)
+ if (sender is KryptonContextMenu kcm)
{
- _kcmFinishDelegate(this, e);
- _kcmFinishDelegate = null;
+ kcm.Closed -= OnKryptonContextMenuClosed;
+
+ // Fire any associated finish delegate
+ if (_kcmFinishDelegate != null)
+ {
+ _kcmFinishDelegate(this, e);
+ _kcmFinishDelegate = null;
+ }
}
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupClusterCollection.cs b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupClusterCollection.cs
index 123cd924a..ff6b555a9 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupClusterCollection.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupClusterCollection.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -20,8 +20,11 @@ namespace Krypton.Ribbon
public class KryptonRibbonGroupClusterCollection : TypedRestrictCollection
{
#region Static Fields
- private static readonly Type[] _types = { typeof(KryptonRibbonGroupClusterButton),
- typeof(KryptonRibbonGroupClusterColorButton)};
+ private static readonly Type[] _types =
+ [
+ typeof(KryptonRibbonGroupClusterButton),
+ typeof(KryptonRibbonGroupClusterColorButton)
+ ];
#endregion
#region Restrict
diff --git a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupClusterColorButton.cs b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupClusterColorButton.cs
index 861143e53..cbfaec629 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupClusterColorButton.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupClusterColorButton.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -27,7 +27,7 @@ namespace Krypton.Ribbon
public class KryptonRibbonGroupClusterColorButton : KryptonRibbonGroupItem
{
#region Static Fields
- private static readonly Image _defaultButtonImageSmall = GenericImageResources.ButtonColorImageSmall;
+ private static readonly Image? _defaultButtonImageSmall = GenericImageResources.ButtonColorImageSmall;
#endregion
#region Instance Fields
@@ -157,7 +157,7 @@ public KryptonRibbonGroupClusterColorButton()
_imageSmall = _defaultButtonImageSmall;
_buttonType = GroupButtonType.Split;
_maxRecentColors = 10;
- _recentColors = new List();
+ _recentColors = [];
// Create the context menu items
_kryptonContextMenu = new KryptonContextMenu();
@@ -178,11 +178,13 @@ public KryptonRibbonGroupClusterColorButton()
_itemMoreColors = new KryptonContextMenuItem("&More Colors...", OnClickMoreColors);
_itemsMoreColors = new KryptonContextMenuItems();
_itemsMoreColors.Items.Add(_itemMoreColors);
- _kryptonContextMenu.Items.AddRange(new KryptonContextMenuItemBase[] { _separatorTheme, _headingTheme, _colorsTheme,
+ _kryptonContextMenu.Items.AddRange([
+ _separatorTheme, _headingTheme, _colorsTheme,
_separatorStandard, _headingStandard, _colorsStandard,
_separatorRecent, _headingRecent, _colorsRecent,
_separatorNoColor, _itemsNoColor,
- _separatorMoreColors, _itemsMoreColors});
+ _separatorMoreColors, _itemsMoreColors
+ ]);
}
#endregion
@@ -809,7 +811,7 @@ public override ViewBase CreateView(KryptonRibbon ribbon,
///
/// Source of the event.
/// A PropertyChangedEventArgs that contains the event data.
- protected virtual void OnCommandPropertyChanged(object sender, PropertyChangedEventArgs e)
+ protected virtual void OnCommandPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
switch (e.PropertyName)
{
@@ -836,7 +838,7 @@ protected virtual void OnClick(EventHandler? finishDelegate)
{
var fireDelegate = true;
- if (!Ribbon.InDesignMode)
+ if (!Ribbon!.InDesignMode)
{
// Events only occur when enabled
if (Enabled)
@@ -892,7 +894,7 @@ protected virtual void OnDropDown(EventHandler? finishDelegate)
{
var fireDelegate = true;
- if (!Ribbon.InDesignMode)
+ if (!Ribbon!.InDesignMode)
{
// Events only occur when enabled
if (Enabled)
@@ -1002,13 +1004,16 @@ internal override bool ProcessCmdKey(ref Message msg, Keys keyData)
case GroupButtonType.Check:
PerformClick();
return true;
+
case GroupButtonType.DropDown:
case GroupButtonType.Split:
PerformDropDown();
return true;
+
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(ButtonType.ToString());
break;
}
@@ -1061,13 +1066,13 @@ private void HookContextMenuEvents(KryptonContextMenuCollection collection, bool
private void UpdateRecentColors([DisallowNull] Color color)
{
- // Do we need to update the recent colors collection?
+ // Do we need to update the recent colors' collection?
if (AutoRecentColors)
{
// We do not add to recent colors if it is inside another color columns
- foreach (KryptonContextMenuItemBase item in _kryptonContextMenu.Items)
+ foreach (var item in _kryptonContextMenu!.Items)
{
- // Only interested in the non-recent colors color columns
+ // Only interested in the non-recent colors' color columns
if ((item != _colorsRecent) && (item is KryptonContextMenuColorColumns colors))
{
// Cast to correct type
@@ -1126,11 +1131,11 @@ private void UpdateContextMenu()
_itemsMoreColors.Visible = _visibleMoreColors;
// Define the display strings
- _headingTheme.Text = Ribbon.RibbonStrings.ThemeColors;
- _headingStandard.Text = Ribbon.RibbonStrings.StandardColors;
- _headingRecent.Text = Ribbon.RibbonStrings.RecentColors;
- _itemNoColor.Text = Ribbon.RibbonStrings.NoColor;
- _itemMoreColors.Text = Ribbon.RibbonStrings.MoreColors;
+ _headingTheme.Text = KryptonManager.Strings.RibbonStrings.ThemeColors;
+ _headingStandard.Text = KryptonManager.Strings.RibbonStrings.StandardColors;
+ _headingRecent.Text = KryptonManager.Strings.RibbonStrings.RecentColors;
+ _itemNoColor.Text = KryptonManager.Strings.RibbonStrings.NoColor;
+ _itemMoreColors.Text = KryptonManager.Strings.RibbonStrings.MoreColors;
// Define the colors used in the first two color schemes
_colorsTheme.ColorScheme = SchemeThemes;
@@ -1149,7 +1154,7 @@ private void UpdateContextMenu()
// Each column is just a single color
for (var i = 0; i < _recentColors.Count; i++)
{
- colors[i] = new[] { _recentColors[i] };
+ colors[i] = [_recentColors[i]];
}
_colorsRecent.SetCustomColors(colors);
@@ -1167,7 +1172,7 @@ private void DecideOnVisible(KryptonContextMenuItemBase visible, KryptonContextM
if (target.Visible)
{
// Check all items before the target
- foreach (KryptonContextMenuItemBase item in _kryptonContextMenu.Items)
+ foreach (var item in _kryptonContextMenu!.Items)
{
// Finish when we reach the target
if (item == target)
@@ -1191,13 +1196,13 @@ private void DecideOnVisible(KryptonContextMenuItemBase visible, KryptonContextM
visible.Visible = previous;
}
- private void OnColumnsTrackingColor(object sender, ColorEventArgs e) => OnTrackingColor(new ColorEventArgs(e.Color));
+ private void OnColumnsTrackingColor(object? sender, ColorEventArgs e) => OnTrackingColor(new ColorEventArgs(e.Color));
- private void OnColumnsSelectedColorChanged(object sender, ColorEventArgs e) => SelectedColor = e.Color;
+ private void OnColumnsSelectedColorChanged(object? sender, ColorEventArgs e) => SelectedColor = e.Color;
- private void OnClickNoColor(object sender, EventArgs e) => SelectedColor = Color.Empty;
+ private void OnClickNoColor(object? sender, EventArgs e) => SelectedColor = Color.Empty;
- private void OnClickMoreColors(object sender, EventArgs e)
+ private void OnClickMoreColors(object? sender, EventArgs e)
{
// Give user a chance to cancel showing the standard more colors dialog
var cea = new CancelEventArgs();
@@ -1221,10 +1226,10 @@ private void OnClickMoreColors(object sender, EventArgs e)
}
}
- private void OnKryptonContextMenuClosed(object sender, EventArgs e)
+ private void OnKryptonContextMenuClosed(object? sender, EventArgs e)
{
- var kcm = (KryptonContextMenu)sender;
- kcm.Closed -= OnKryptonContextMenuClosed;
+ var kcm = sender as KryptonContextMenu;
+ kcm!.Closed -= OnKryptonContextMenuClosed;
// Fire any associated finish delegate
if (_kcmFinishDelegate != null)
@@ -1234,7 +1239,7 @@ private void OnKryptonContextMenuClosed(object sender, EventArgs e)
}
// Unhook from item events
- HookContextMenuEvents(_kryptonContextMenu.Items, false);
+ HookContextMenuEvents(_kryptonContextMenu?.Items!, false);
}
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupColorButton.cs b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupColorButton.cs
index a0b094c5f..472c4070e 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupColorButton.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupColorButton.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -27,8 +27,8 @@ namespace Krypton.Ribbon
public class KryptonRibbonGroupColorButton : KryptonRibbonGroupItem
{
#region Static Fields
- private static readonly Image _defaultButtonImageSmall = GenericImageResources.ButtonColorImageSmall;
- private static readonly Image _defaultButtonImageLarge = GenericImageResources.ButtonColorImageLarge;
+ private static readonly Image? _defaultButtonImageSmall = GenericImageResources.ButtonColorImageSmall;
+ private static readonly Image? _defaultButtonImageLarge = GenericImageResources.ButtonColorImageLarge;
#endregion
#region Instance Fields
@@ -164,7 +164,7 @@ public KryptonRibbonGroupColorButton()
_itemSizeMin = GroupItemSize.Small;
_itemSizeCurrent = GroupItemSize.Large;
_maxRecentColors = 10;
- _recentColors = new List();
+ _recentColors = [];
// Create the context menu items
_kryptonContextMenu = new KryptonContextMenu();
@@ -185,11 +185,13 @@ public KryptonRibbonGroupColorButton()
_itemMoreColors = new KryptonContextMenuItem("&More Colors...", OnClickMoreColors);
_itemsMoreColors = new KryptonContextMenuItems();
_itemsMoreColors.Items.Add(_itemMoreColors);
- _kryptonContextMenu.Items.AddRange(new KryptonContextMenuItemBase[] { _separatorTheme, _headingTheme, _colorsTheme,
+ _kryptonContextMenu.Items.AddRange([
+ _separatorTheme, _headingTheme, _colorsTheme,
_separatorStandard, _headingStandard, _colorsStandard,
_separatorRecent, _headingRecent, _colorsRecent,
_separatorNoColor, _itemsNoColor,
- _separatorMoreColors, _itemsMoreColors});
+ _separatorMoreColors, _itemsMoreColors
+ ]);
}
#endregion
@@ -857,7 +859,7 @@ public override ViewBase CreateView(KryptonRibbon ribbon,
///
/// Source of the event.
/// A PropertyChangedEventArgs that contains the event data.
- protected virtual void OnCommandPropertyChanged(object sender, PropertyChangedEventArgs e)
+ protected virtual void OnCommandPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
switch (e.PropertyName)
{
@@ -879,8 +881,6 @@ protected virtual void OnCommandPropertyChanged(object sender, PropertyChangedEv
case nameof(Checked):
OnPropertyChanged(nameof(Checked));
break;
- default:
- break;
}
}
@@ -892,7 +892,7 @@ protected virtual void OnClick(EventHandler? finishDelegate)
{
var fireDelegate = true;
- if (!Ribbon.InDesignMode)
+ if (!Ribbon!.InDesignMode)
{
// Events only occur when enabled
if (Enabled)
@@ -948,7 +948,7 @@ protected virtual void OnDropDown(EventHandler? finishDelegate)
{
var fireDelegate = true;
- if (!Ribbon.InDesignMode)
+ if (!Ribbon!.InDesignMode)
{
// Events only occur when enabled
if (Enabled)
@@ -1058,13 +1058,16 @@ internal override bool ProcessCmdKey(ref Message msg, Keys keyData)
case GroupButtonType.Check:
PerformClick();
return true;
+
case GroupButtonType.DropDown:
case GroupButtonType.Split:
PerformDropDown();
return true;
+
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(ButtonType.ToString());
break;
}
@@ -1094,7 +1097,7 @@ internal override bool ProcessCmdKey(ref Message msg, Keys keyData)
private void HookContextMenuEvents(KryptonContextMenuCollection collection, bool hook)
{
// Search for items of interest
- foreach (KryptonContextMenuItemBase item in collection)
+ foreach (var item in collection)
{
// Hook into color events
if (item is KryptonContextMenuColorColumns columns)
@@ -1121,7 +1124,7 @@ private void UpdateRecentColors(Color color)
if (AutoRecentColors)
{
// We do not add to recent colors if it is inside another color columns
- foreach (KryptonContextMenuItemBase item in _kryptonContextMenu.Items)
+ foreach (var item in _kryptonContextMenu?.Items!)
{
// Only interested in the non-recent colors color columns
if ((item != _colorsRecent) && (item is KryptonContextMenuColorColumns colors))
@@ -1147,7 +1150,7 @@ private void UpdateRecentColors(Color color)
if ((color != Color.Empty) && !color.Equals(Color.Empty))
{
var found = false;
- foreach (Color recentColor in _recentColors)
+ foreach (var recentColor in _recentColors)
{
if (recentColor.Equals(color))
{
@@ -1182,11 +1185,11 @@ private void UpdateContextMenu()
_itemsMoreColors.Visible = _visibleMoreColors;
// Define the display strings
- _headingTheme.Text = Ribbon.RibbonStrings.ThemeColors;
- _headingStandard.Text = Ribbon.RibbonStrings.StandardColors;
- _headingRecent.Text = Ribbon.RibbonStrings.RecentColors;
- _itemNoColor.Text = Ribbon.RibbonStrings.NoColor;
- _itemMoreColors.Text = Ribbon.RibbonStrings.MoreColors;
+ _headingTheme.Text = KryptonManager.Strings.RibbonStrings.ThemeColors;
+ _headingStandard.Text = KryptonManager.Strings.RibbonStrings.StandardColors;
+ _headingRecent.Text = KryptonManager.Strings.RibbonStrings.RecentColors;
+ _itemNoColor.Text = KryptonManager.Strings.RibbonStrings.NoColor;
+ _itemMoreColors.Text = KryptonManager.Strings.RibbonStrings.MoreColors;
// Define the colors used in the first two color schemes
_colorsTheme.ColorScheme = SchemeThemes;
@@ -1205,7 +1208,7 @@ private void UpdateContextMenu()
// Each column is just a single color
for (var i = 0; i < _recentColors.Count; i++)
{
- colors[i] = new[] { _recentColors[i] };
+ colors[i] = [_recentColors[i]];
}
_colorsRecent.SetCustomColors(colors);
@@ -1223,7 +1226,7 @@ private void DecideOnVisible(KryptonContextMenuItemBase visible, KryptonContextM
if (target.Visible)
{
// Check all items before the target
- foreach (KryptonContextMenuItemBase item in _kryptonContextMenu.Items)
+ foreach (var item in _kryptonContextMenu?.Items!)
{
// Finish when we reach the target
if (item == target)
@@ -1246,13 +1249,13 @@ private void DecideOnVisible(KryptonContextMenuItemBase visible, KryptonContextM
visible.Visible = previous;
}
- private void OnColumnsTrackingColor(object sender, ColorEventArgs e) => OnTrackingColor(new ColorEventArgs(e.Color));
+ private void OnColumnsTrackingColor(object? sender, ColorEventArgs e) => OnTrackingColor(new ColorEventArgs(e.Color));
- private void OnColumnsSelectedColorChanged(object sender, ColorEventArgs e) => SelectedColor = e.Color;
+ private void OnColumnsSelectedColorChanged(object? sender, ColorEventArgs e) => SelectedColor = e.Color;
- private void OnClickNoColor(object sender, EventArgs e) => SelectedColor = Color.Empty;
+ private void OnClickNoColor(object? sender, EventArgs e) => SelectedColor = Color.Empty;
- private void OnClickMoreColors(object sender, EventArgs e)
+ private void OnClickMoreColors(object? sender, EventArgs e)
{
// Give user a chance to cancel showing the standard more colors dialog
var cea = new CancelEventArgs();
@@ -1276,10 +1279,10 @@ private void OnClickMoreColors(object sender, EventArgs e)
}
}
- private void OnKryptonContextMenuClosed(object sender, EventArgs e)
+ private void OnKryptonContextMenuClosed(object? sender, EventArgs e)
{
- var kcm = (KryptonContextMenu)sender;
- kcm.Closed -= OnKryptonContextMenuClosed;
+ var kcm = sender as KryptonContextMenu;
+ kcm!.Closed -= OnKryptonContextMenuClosed;
// Fire any associated finish delegate
if (_kcmFinishDelegate != null)
@@ -1289,7 +1292,7 @@ private void OnKryptonContextMenuClosed(object sender, EventArgs e)
}
// Unhook from item events
- HookContextMenuEvents(_kryptonContextMenu.Items, false);
+ HookContextMenuEvents(_kryptonContextMenu?.Items!, false);
}
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupComboBox.cs b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupComboBox.cs
index b6acf9a9c..7d8e76f1c 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupComboBox.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupComboBox.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -246,11 +246,11 @@ protected override void Dispose(bool disposing)
{
if (disposing)
{
- if (ComboBox != null)
+ if (ComboBox != null!)
{
UnmonitorControl(ComboBox);
ComboBox.Dispose();
- ComboBox = null;
+ ComboBox = null!;
}
}
@@ -275,7 +275,8 @@ public override KryptonRibbon? Ribbon
{
// Use the same palette in the combo box as the ribbon, plus we need
// to know when the ribbon palette changes so we can reflect that change
- ComboBox.Palette = Ribbon!.GetResolvedPalette();
+ ComboBox.PaletteMode = Ribbon!.PaletteMode;
+ ComboBox.LocalCustomPalette = Ribbon!.LocalCustomPalette;
Ribbon!.PaletteChanged += OnRibbonPaletteChanged;
}
}
@@ -311,7 +312,7 @@ public override KryptonRibbon? Ribbon
[Localizable(true)]
[Category(@"Appearance")]
[Description(@"Ribbon group text box key tip.")]
- [DefaultValue("X")]
+ [DefaultValue(@"X")]
public string KeyTip
{
get => _keyTip;
@@ -320,7 +321,7 @@ public string KeyTip
{
if (string.IsNullOrEmpty(value))
{
- value = "X";
+ value = @"X";
}
_keyTip = value.ToUpper();
@@ -412,8 +413,7 @@ public Size MaximumSize
[Category(@"Appearance")]
[Description(@"Text associated with the control.")]
[Editor(typeof(MultilineStringEditor), typeof(UITypeEditor))]
- [AllowNull]
- public string Text
+ public virtual string Text
{
get => ComboBox.Text;
set => ComboBox.Text = value;
@@ -464,7 +464,7 @@ public string ValueMember
[AttributeProvider(typeof(IListSource))]
[RefreshProperties(RefreshProperties.Repaint)]
[DefaultValue(null)]
- public object DataSource
+ public object? DataSource
{
get => ComboBox.DataSource;
set => ComboBox.DataSource = value;
@@ -491,7 +491,7 @@ public string DisplayMember
[Description(@"Controls the appearance and functionality of the KryptonComboBox.")]
[DefaultValue(typeof(ComboBoxStyle), nameof(DropDown))]
[RefreshProperties(RefreshProperties.Repaint)]
- public ComboBoxStyle DropDownStyle
+ public virtual ComboBoxStyle DropDownStyle
{
get => ComboBox.DropDownStyle;
set => ComboBox.DropDownStyle = value;
@@ -589,7 +589,7 @@ public bool Sorted
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
[MergableProperty(false)]
[Localizable(true)]
- public ComboBox.ObjectCollection Items => ComboBox.Items;
+ public virtual ComboBox.ObjectCollection Items => ComboBox.Items;
///
/// Gets and sets a value indicating if tooltips should be Displayed for button specs.
@@ -632,7 +632,7 @@ public bool AllowButtonSpecToolTipPriority
[EditorBrowsable(EditorBrowsableState.Always)]
[Localizable(true)]
[Browsable(true)]
- public AutoCompleteStringCollection AutoCompleteCustomSource
+ public virtual AutoCompleteStringCollection AutoCompleteCustomSource
{
get => ComboBox.AutoCompleteCustomSource;
set => ComboBox.AutoCompleteCustomSource = value;
@@ -645,7 +645,7 @@ public AutoCompleteStringCollection AutoCompleteCustomSource
[DefaultValue(typeof(AutoCompleteMode), "None")]
[EditorBrowsable(EditorBrowsableState.Always)]
[Browsable(true)]
- public AutoCompleteMode AutoCompleteMode
+ public virtual AutoCompleteMode AutoCompleteMode
{
get => ComboBox.AutoCompleteMode;
set => ComboBox.AutoCompleteMode = value;
@@ -658,7 +658,7 @@ public AutoCompleteMode AutoCompleteMode
[DefaultValue(typeof(AutoCompleteSource), "None")]
[EditorBrowsable(EditorBrowsableState.Always)]
[Browsable(true)]
- public AutoCompleteSource AutoCompleteSource
+ public virtual AutoCompleteSource AutoCompleteSource
{
get => ComboBox.AutoCompleteSource;
set => ComboBox.AutoCompleteSource = value;
@@ -671,7 +671,7 @@ public AutoCompleteSource AutoCompleteSource
[Editor(@"System.Windows.Forms.Design.FormatStringEditor", typeof(UITypeEditor))]
[MergableProperty(false)]
[DefaultValue("")]
- public string FormatString
+ public virtual string FormatString
{
get => ComboBox.FormatString;
set => ComboBox.FormatString = value;
@@ -728,7 +728,7 @@ public int SelectionStart
[Bindable(true)]
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public object SelectedItem
+ public object? SelectedItem
{
get => ComboBox.SelectedItem;
set => ComboBox.SelectedItem = value;
@@ -739,7 +739,7 @@ public object SelectedItem
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public string SelectedText
+ public string? SelectedText
{
get => ComboBox.SelectedText;
set => ComboBox.SelectedText = value;
@@ -822,7 +822,7 @@ public bool DroppedDown
///
/// The object from which to get the contents to display.
/// If the DisplayMember property is not specified, the value returned by GetItemText is the value of the item's ToString method. Otherwise, the method returns the string value of the member specified in the DisplayMember property for the object specified in the item parameter.
- public string GetItemText(object item) => ComboBox.GetItemText(item);
+ public string? GetItemText(object item) => ComboBox.GetItemText(item);
///
/// Selects a range of text in the control.
@@ -1041,9 +1041,9 @@ public override ViewBase CreateView(KryptonRibbon ribbon,
#endregion
#region Internal
- internal Control LastParentControl { get; set; }
+ internal Control? LastParentControl { get; set; }
- internal KryptonComboBox LastComboBox { get; set; }
+ internal KryptonComboBox? LastComboBox { get; set; }
internal NeedPaintHandler? ViewPaintDelegate { get; set; }
@@ -1093,55 +1093,60 @@ private void UnmonitorControl(KryptonComboBox c)
c.TrackMouseLeave -= OnControlLeave;
}
- private void OnControlEnter(object sender, EventArgs e) => MouseEnterControl?.Invoke(this, e);
+ private void OnControlEnter(object? sender, EventArgs e) => MouseEnterControl?.Invoke(this, e);
- private void OnControlLeave(object sender, EventArgs e) => MouseLeaveControl?.Invoke(this, e);
+ private void OnControlLeave(object? sender, EventArgs e) => MouseLeaveControl?.Invoke(this, e);
private void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e) =>
// Pass request onto the view provided paint delegate
ViewPaintDelegate?.Invoke(this, e);
- private void OnComboBoxGotFocus(object sender, EventArgs e) => OnGotFocus(e);
+ private void OnComboBoxGotFocus(object? sender, EventArgs e) => OnGotFocus(e);
- private void OnComboBoxLostFocus(object sender, EventArgs e) => OnLostFocus(e);
+ private void OnComboBoxLostFocus(object? sender, EventArgs e) => OnLostFocus(e);
- private void OnComboBoxTextUpdate(object sender, EventArgs e) => OnTextUpdate(e);
+ private void OnComboBoxTextUpdate(object? sender, EventArgs e) => OnTextUpdate(e);
- private void OnComboBoxSelectionChangeCommitted(object sender, EventArgs e) => OnSelectionChangeCommitted(e);
+ private void OnComboBoxSelectionChangeCommitted(object? sender, EventArgs e) => OnSelectionChangeCommitted(e);
- private void OnComboBoxSelectedIndexChanged(object sender, EventArgs e) => OnSelectedIndexChanged(e);
+ private protected void OnComboBoxSelectedIndexChanged(object? sender, EventArgs e) => OnSelectedIndexChanged(e);
- private void OnComboBoxDropDownStyleChanged(object sender, EventArgs e) => OnDropDownStyleChanged(e);
+ private void OnComboBoxDropDownStyleChanged(object? sender, EventArgs e) => OnDropDownStyleChanged(e);
- private void OnComboBoxDataSourceChanged(object sender, EventArgs e) => OnDataSourceChanged(e);
+ private void OnComboBoxDataSourceChanged(object? sender, EventArgs e) => OnDataSourceChanged(e);
- private void OnComboBoxDisplayMemberChanged(object sender, EventArgs e) => OnDisplayMemberChanged(e);
+ private void OnComboBoxDisplayMemberChanged(object? sender, EventArgs e) => OnDisplayMemberChanged(e);
- private void OnComboBoxDropDownClosed(object sender, EventArgs e) => OnDropDownClosed(e);
+ private void OnComboBoxDropDownClosed(object? sender, EventArgs e) => OnDropDownClosed(e);
- private void OnComboBoxDropDown(object sender, EventArgs e) => OnDropDown(e);
+ private void OnComboBoxDropDown(object? sender, EventArgs e) => OnDropDown(e);
- private void OnComboBoxKeyPress(object sender, KeyPressEventArgs e) => OnKeyPress(e);
+ private void OnComboBoxKeyPress(object? sender, KeyPressEventArgs e) => OnKeyPress(e);
- private void OnComboBoxKeyUp(object sender, KeyEventArgs e) => OnKeyUp(e);
+ private void OnComboBoxKeyUp(object? sender, KeyEventArgs e) => OnKeyUp(e);
- private void OnComboBoxKeyDown(object sender, KeyEventArgs e) => OnKeyDown(e);
+ private void OnComboBoxKeyDown(object? sender, KeyEventArgs e) => OnKeyDown(e);
- private void OnComboBoxPreviewKeyDown(object sender, PreviewKeyDownEventArgs e) => OnPreviewKeyDown(e);
+ private void OnComboBoxPreviewKeyDown(object? sender, PreviewKeyDownEventArgs e) => OnPreviewKeyDown(e);
- private void OnComboBoxFormat(object sender, ListControlConvertEventArgs e) => OnFormat(e);
+ private void OnComboBoxFormat(object? sender, ListControlConvertEventArgs e) => OnFormat(e);
- private void OnComboBoxFormatInfoChanged(object sender, EventArgs e) => OnFormatInfoChanged(e);
+ private void OnComboBoxFormatInfoChanged(object? sender, EventArgs e) => OnFormatInfoChanged(e);
- private void OnComboBoxFormatStringChanged(object sender, EventArgs e) => OnFormatStringChanged(e);
+ private void OnComboBoxFormatStringChanged(object? sender, EventArgs e) => OnFormatStringChanged(e);
- private void OnComboBoxFormattingEnabledChanged(object sender, EventArgs e) => OnFormattingEnabledChanged(e);
+ private void OnComboBoxFormattingEnabledChanged(object? sender, EventArgs e) => OnFormattingEnabledChanged(e);
- private void OnComboBoxSelectedValueChanged(object sender, EventArgs e) => OnSelectedValueChanged(e);
+ private void OnComboBoxSelectedValueChanged(object? sender, EventArgs e) => OnSelectedValueChanged(e);
- private void OnComboBoxValueMemberChanged(object sender, EventArgs e) => OnValueMemberChanged(e);
+ private void OnComboBoxValueMemberChanged(object? sender, EventArgs e) => OnValueMemberChanged(e);
+
+ private void OnRibbonPaletteChanged(object? sender, EventArgs e)
+ {
+ ComboBox.PaletteMode = Ribbon!.PaletteMode;
+ ComboBox.LocalCustomPalette = Ribbon!.LocalCustomPalette;
+ }
- private void OnRibbonPaletteChanged(object sender, EventArgs e) => ComboBox.Palette = Ribbon.GetResolvedPalette();
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupContainer.cs b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupContainer.cs
index b38a653e8..226a32ca3 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupContainer.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupContainer.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupContainerCollection.cs b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupContainerCollection.cs
index 048f42668..9da2bb938 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupContainerCollection.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupContainerCollection.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -18,10 +18,13 @@ namespace Krypton.Ribbon
public class KryptonRibbonGroupContainerCollection : TypedRestrictCollection
{
#region Static Fields
- private static readonly Type[] _types = { typeof(KryptonRibbonGroupLines),
+ private static readonly Type[] _types =
+ [
+ typeof(KryptonRibbonGroupLines),
typeof(KryptonRibbonGroupTriple),
typeof(KryptonRibbonGroupSeparator),
- typeof(KryptonRibbonGroupGallery)};
+ typeof(KryptonRibbonGroupGallery)
+ ];
#endregion
#region Restrict
diff --git a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupCustomControl.cs b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupCustomControl.cs
index 16340dcd6..ac47f034b 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupCustomControl.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupCustomControl.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -30,7 +30,7 @@ public class KryptonRibbonGroupCustomControl : KryptonRibbonGroupItem
private bool _enabled;
private string _keyTip;
private GroupItemSize _itemSizeCurrent;
- private Control _customControl;
+ private Control? _customControl;
#endregion
@@ -152,7 +152,7 @@ public override ToolTipValues ToolTipValues
[Browsable(true)]
[EditorBrowsable(EditorBrowsableState.Always)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
- public Control CustomControl
+ public Control? CustomControl
{
get => _customControl;
@@ -377,9 +377,9 @@ private void UnmonitorControl(Control c)
}
}
- private void OnCustomControlEnter(object sender, EventArgs e) => MouseEnterControl?.Invoke(this, e);
+ private void OnCustomControlEnter(object? sender, EventArgs e) => MouseEnterControl?.Invoke(this, e);
- private void OnCustomControlLeave(object sender, EventArgs e) => MouseLeaveControl?.Invoke(this, e);
+ private void OnCustomControlLeave(object? sender, EventArgs e) => MouseLeaveControl?.Invoke(this, e);
private void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e) =>
// Pass request onto the view provided paint delegate
diff --git a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupDateTimePicker.cs b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupDateTimePicker.cs
index 15b8a9df3..fb5d095ea 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupDateTimePicker.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupDateTimePicker.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -183,11 +183,11 @@ protected override void Dispose(bool disposing)
{
if (disposing)
{
- if (DateTimePicker != null)
+ if (DateTimePicker != null!)
{
UnmonitorControl(DateTimePicker);
DateTimePicker.Dispose();
- DateTimePicker = null;
+ DateTimePicker = null!;
}
}
@@ -208,12 +208,13 @@ public override KryptonRibbon? Ribbon
{
base.Ribbon = value;
- if (value != null)
+ if (value is not null)
{
// Use the same palette in the date time picker as the ribbon, plus we need
- // to know when the ribbon palette changes so we can reflect that change
- DateTimePicker.Palette = Ribbon!.GetResolvedPalette();
- Ribbon!.PaletteChanged += OnRibbonPaletteChanged;
+ // to know when the ribbon palette changes, so we can reflect that change
+ DateTimePicker.PaletteMode = Ribbon!.PaletteMode;
+ DateTimePicker.LocalCustomPalette = Ribbon.LocalCustomPalette;
+ Ribbon.PaletteChanged += OnRibbonPaletteChanged;
}
}
}
@@ -258,7 +259,7 @@ public string KeyTip
{
if (string.IsNullOrEmpty(value))
{
- value = "X";
+ value = @"X";
}
_keyTip = value.ToUpper();
@@ -491,6 +492,7 @@ public bool CalendarShowWeekNumbers
///
[Category(@"MonthCalendar")]
[Description(@"Today's date.")]
+ [AllowNull]
public DateTime CalendarTodayDate
{
get => DateTimePicker.CalendarTodayDate;
@@ -507,7 +509,7 @@ public DateTime CalendarTodayDate
[Category(@"MonthCalendar")]
[Description(@"Indicates which annual dates should be boldface.")]
[Localizable(true)]
- public DateTime[] CalendarAnnuallyBoldedDates
+ public DateTime[]? CalendarAnnuallyBoldedDates
{
get => DateTimePicker.CalendarAnnuallyBoldedDates;
set => DateTimePicker.CalendarAnnuallyBoldedDates = value;
@@ -523,7 +525,7 @@ public DateTime[] CalendarAnnuallyBoldedDates
[Category(@"MonthCalendar")]
[Description(@"Indicates which monthly dates should be boldface.")]
[Localizable(true)]
- public DateTime[] CalendarMonthlyBoldedDates
+ public DateTime[]? CalendarMonthlyBoldedDates
{
get => DateTimePicker.CalendarMonthlyBoldedDates;
set => DateTimePicker.CalendarMonthlyBoldedDates = value;
@@ -539,7 +541,7 @@ public DateTime[] CalendarMonthlyBoldedDates
[Category(@"MonthCalendar")]
[Description(@"Indicates which dates should be boldface.")]
[Localizable(true)]
- public DateTime[] CalendarBoldedDates
+ public DateTime[]? CalendarBoldedDates
{
get => DateTimePicker.CalendarBoldedDates;
set => DateTimePicker.CalendarBoldedDates = value;
@@ -570,18 +572,21 @@ public LeftRightAlignment DropDownAlign
[TypeConverter(typeof(DateTimeNullableConverter))]
[RefreshProperties(RefreshProperties.All)]
[Bindable(true)]
- public object ValueNullable
+ public object? ValueNullable
{
get => DateTimePicker.ValueNullable;
set => DateTimePicker.ValueNullable = value;
}
-
private void ResetValueNullable() => DateTimePicker.ResetValueNullable();
-
private bool ShouldSerializeValueNullable() => DateTimePicker.ShouldSerializeValueNullable();
///
- /// Gets or sets the date/time value assigned to the control..
+ /// Sets date as the current selected date.
+ ///
+ public void SetDate(DateTime date) => DateTimePicker.SetDate( date);
+
+ ///
+ /// Gets or sets the date/time value assigned to the control.
///
[Category(@"Appearance")]
[Description(@"Property for the date/time.")]
@@ -592,9 +597,7 @@ public DateTime Value
get => DateTimePicker.Value;
set => DateTimePicker.Value = value;
}
-
private void ResetValue() => DateTimePicker.ResetValue();
-
private bool ShouldSerializeValue() => DateTimePicker.ShouldSerializeValue();
///
@@ -698,7 +701,7 @@ public bool Checked
[DefaultValue("")]
[RefreshProperties(RefreshProperties.Repaint)]
[Localizable(true)]
- public string CustomFormat
+ public string? CustomFormat
{
get => DateTimePicker.CustomFormat;
set => DateTimePicker.CustomFormat = value;
@@ -977,39 +980,44 @@ private void UnmonitorControl(KryptonDateTimePicker c)
c.MouseLeave -= OnControlLeave;
}
- private void OnControlEnter(object sender, EventArgs e) => MouseEnterControl?.Invoke(this, e);
+ private void OnControlEnter(object? sender, EventArgs e) => MouseEnterControl?.Invoke(this, e);
- private void OnControlLeave(object sender, EventArgs e) => MouseLeaveControl?.Invoke(this, e);
+ private void OnControlLeave(object? sender, EventArgs e) => MouseLeaveControl?.Invoke(this, e);
private void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e) =>
// Pass request onto the view provided paint delegate
ViewPaintDelegate?.Invoke(this, e);
- private void OnDateTimePickerGotFocus(object sender, EventArgs e) => OnGotFocus(e);
+ private void OnDateTimePickerGotFocus(object? sender, EventArgs e) => OnGotFocus(e);
+
+ private void OnDateTimePickerLostFocus(object? sender, EventArgs e) => OnLostFocus(e);
- private void OnDateTimePickerLostFocus(object sender, EventArgs e) => OnLostFocus(e);
+ private void OnDateTimePickerFormatChanged(object? sender, EventArgs e) => OnFormatChanged(e);
- private void OnDateTimePickerFormatChanged(object sender, EventArgs e) => OnFormatChanged(e);
+ private void OnDateTimePickerCheckedChanged(object? sender, EventArgs e) => OnCheckedChanged(e);
- private void OnDateTimePickerCheckedChanged(object sender, EventArgs e) => OnCheckedChanged(e);
+ private void OnDateTimePickerCloseUp(object? sender, DateTimePickerCloseArgs e) => OnCloseUp(e);
- private void OnDateTimePickerCloseUp(object sender, DateTimePickerCloseArgs e) => OnCloseUp(e);
+ private void OnDateTimePickerDropDown(object? sender, DateTimePickerDropArgs e) => OnDropDown(e);
- private void OnDateTimePickerDropDown(object sender, DateTimePickerDropArgs e) => OnDropDown(e);
+ private void OnDateTimePickerValueNullableChanged(object? sender, EventArgs e) => OnValueNullableChanged(e);
- private void OnDateTimePickerValueNullableChanged(object sender, EventArgs e) => OnValueNullableChanged(e);
+ private void OnDateTimePickerValueChanged(object? sender, EventArgs e) => OnValueChanged(e);
- private void OnDateTimePickerValueChanged(object sender, EventArgs e) => OnValueChanged(e);
+ private void OnDateTimePickerKeyPress(object? sender, KeyPressEventArgs e) => OnKeyPress(e);
- private void OnDateTimePickerKeyPress(object sender, KeyPressEventArgs e) => OnKeyPress(e);
+ private void OnDateTimePickerKeyUp(object? sender, KeyEventArgs e) => OnKeyUp(e);
- private void OnDateTimePickerKeyUp(object sender, KeyEventArgs e) => OnKeyUp(e);
+ private void OnDateTimePickerKeyDown(object? sender, KeyEventArgs e) => OnKeyDown(e);
- private void OnDateTimePickerKeyDown(object sender, KeyEventArgs e) => OnKeyDown(e);
+ private void OnDateTimePickerKeyDown(object? sender, PreviewKeyDownEventArgs e) => OnPreviewKeyDown(e);
- private void OnDateTimePickerKeyDown(object sender, PreviewKeyDownEventArgs e) => OnPreviewKeyDown(e);
+ private void OnRibbonPaletteChanged(object? sender, EventArgs e)
+ {
+ DateTimePicker.PaletteMode = Ribbon!.PaletteMode;
+ DateTimePicker.LocalCustomPalette = Ribbon.LocalCustomPalette;
+ }
- private void OnRibbonPaletteChanged(object sender, EventArgs e) => DateTimePicker.Palette = Ribbon.GetResolvedPalette();
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupDomainUpDown.cs b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupDomainUpDown.cs
index fca875cc8..448124c86 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupDomainUpDown.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupDomainUpDown.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -187,8 +187,9 @@ public override KryptonRibbon? Ribbon
{
// Use the same palette in the domain up-down as the ribbon, plus we need
// to know when the ribbon palette changes so we can reflect that change
- DomainUpDown.Palette = Ribbon!.GetResolvedPalette();
- Ribbon!.PaletteChanged += OnRibbonPaletteChanged;
+ DomainUpDown!.PaletteMode = Ribbon!.PaletteMode;
+ DomainUpDown.LocalCustomPalette = Ribbon.LocalCustomPalette;
+ Ribbon.PaletteChanged += OnRibbonPaletteChanged;
}
}
}
@@ -200,8 +201,8 @@ public override KryptonRibbon? Ribbon
[DefaultValue(-1)]
public int SelectedIndex
{
- get => DomainUpDown.SelectedIndex;
- set => DomainUpDown.SelectedIndex = value;
+ get => DomainUpDown!.SelectedIndex;
+ set => DomainUpDown!.SelectedIndex = value;
}
///
@@ -209,10 +210,10 @@ public int SelectedIndex
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public object SelectedItem
+ public object? SelectedItem
{
- get => DomainUpDown.SelectedItem;
- set => DomainUpDown.SelectedItem = value;
+ get => DomainUpDown!.SelectedItem;
+ set => DomainUpDown!.SelectedItem = value;
}
///
@@ -223,8 +224,8 @@ public object SelectedItem
[Editor(typeof(MultilineStringEditor), typeof(UITypeEditor))]
public string Text
{
- get => DomainUpDown.Text;
- set => DomainUpDown.Text = value;
+ get => DomainUpDown!.Text;
+ set => DomainUpDown!.Text = value;
}
///
@@ -250,7 +251,7 @@ public string Text
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
[Editor(@"System.Windows.Forms.Design.StringCollectionEditor", typeof(UITypeEditor))]
[Localizable(true)]
- public DomainUpDown.DomainUpDownItemCollection Items => DomainUpDown.Items;
+ public DomainUpDown.DomainUpDownItemCollection Items => DomainUpDown!.Items;
///
/// Access to the actual embedded KryptonDomainUpDown instance.
@@ -259,7 +260,7 @@ public string Text
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Always)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public KryptonDomainUpDown DomainUpDown { get; private set; }
+ public KryptonDomainUpDown? DomainUpDown { get; private set; }
///
/// Gets or sets a value indicating whether the item collection is sorted.
@@ -269,8 +270,8 @@ public string Text
[DefaultValue(false)]
public bool Sorted
{
- get => DomainUpDown.Sorted;
- set => DomainUpDown.Sorted = value;
+ get => DomainUpDown!.Sorted;
+ set => DomainUpDown!.Sorted = value;
}
///
@@ -289,7 +290,7 @@ public string KeyTip
{
if (string.IsNullOrEmpty(value))
{
- value = "X";
+ value = @"X";
}
_keyTip = value.ToUpper();
@@ -305,8 +306,8 @@ public string KeyTip
[Localizable(true)]
public HorizontalAlignment TextAlign
{
- get => DomainUpDown.TextAlign;
- set => DomainUpDown.TextAlign = value;
+ get => DomainUpDown!.TextAlign;
+ set => DomainUpDown!.TextAlign = value;
}
@@ -319,8 +320,8 @@ public HorizontalAlignment TextAlign
[Localizable(true)]
public LeftRightAlignment UpDownAlign
{
- get => DomainUpDown.UpDownAlign;
- set => DomainUpDown.UpDownAlign = value;
+ get => DomainUpDown!.UpDownAlign;
+ set => DomainUpDown!.UpDownAlign = value;
}
///
@@ -331,8 +332,8 @@ public LeftRightAlignment UpDownAlign
[DefaultValue(true)]
public bool InterceptArrowKeys
{
- get => DomainUpDown.InterceptArrowKeys;
- set => DomainUpDown.InterceptArrowKeys = value;
+ get => DomainUpDown!.InterceptArrowKeys;
+ set => DomainUpDown!.InterceptArrowKeys = value;
}
///
@@ -344,8 +345,8 @@ public bool InterceptArrowKeys
[DefaultValue(false)]
public bool ReadOnly
{
- get => DomainUpDown.ReadOnly;
- set => DomainUpDown.ReadOnly = value;
+ get => DomainUpDown!.ReadOnly;
+ set => DomainUpDown!.ReadOnly = value;
}
///
@@ -354,7 +355,7 @@ public bool ReadOnly
[Category(@"Visuals")]
[Description(@"Collection of button specifications.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public KryptonDomainUpDown.DomainUpDownButtonSpecCollection ButtonSpecs => DomainUpDown.ButtonSpecs;
+ public KryptonDomainUpDown.DomainUpDownButtonSpecCollection ButtonSpecs => DomainUpDown!.ButtonSpecs;
///
/// Gets and sets the visible state of the domain up-down.
@@ -419,8 +420,8 @@ public bool Enabled
[DefaultValue(typeof(Size), "121, 0")]
public Size MinimumSize
{
- get => DomainUpDown.MinimumSize;
- set => DomainUpDown.MinimumSize = value;
+ get => DomainUpDown!.MinimumSize;
+ set => DomainUpDown!.MinimumSize = value;
}
///
@@ -431,8 +432,8 @@ public Size MinimumSize
[DefaultValue(typeof(Size), "121, 0")]
public Size MaximumSize
{
- get => DomainUpDown.MaximumSize;
- set => DomainUpDown.MaximumSize = value;
+ get => DomainUpDown!.MaximumSize;
+ set => DomainUpDown!.MaximumSize = value;
}
///
@@ -443,8 +444,8 @@ public Size MaximumSize
[DefaultValue(null)]
public ContextMenuStrip? ContextMenuStrip
{
- get => DomainUpDown.ContextMenuStrip;
- set => DomainUpDown.ContextMenuStrip = value;
+ get => DomainUpDown!.ContextMenuStrip;
+ set => DomainUpDown!.ContextMenuStrip = value;
}
///
@@ -455,14 +456,14 @@ public ContextMenuStrip? ContextMenuStrip
[DefaultValue(null)]
public KryptonContextMenu? KryptonContextMenu
{
- get => DomainUpDown.KryptonContextMenu;
- set => DomainUpDown.KryptonContextMenu = value;
+ get => DomainUpDown!.KryptonContextMenu;
+ set => DomainUpDown!.KryptonContextMenu = value;
}
///
/// Gets access to the Wrapped Controls Tooltips.
///
- public override ToolTipValues ToolTipValues => DomainUpDown.ToolTipValues;
+ public override ToolTipValues ToolTipValues => DomainUpDown!.ToolTipValues;
///
@@ -473,8 +474,8 @@ public KryptonContextMenu? KryptonContextMenu
[DefaultValue(false)]
public bool AllowButtonSpecToolTips
{
- get => DomainUpDown.AllowButtonSpecToolTips;
- set => DomainUpDown.AllowButtonSpecToolTips = value;
+ get => DomainUpDown!.AllowButtonSpecToolTips;
+ set => DomainUpDown!.AllowButtonSpecToolTips = value;
}
///
@@ -485,8 +486,8 @@ public bool AllowButtonSpecToolTips
[DefaultValue(false)]
public bool AllowButtonSpecToolTipPriority
{
- get => DomainUpDown.AllowButtonSpecToolTipPriority;
- set => DomainUpDown.AllowButtonSpecToolTipPriority = value;
+ get => DomainUpDown!.AllowButtonSpecToolTipPriority;
+ set => DomainUpDown!.AllowButtonSpecToolTipPriority = value;
}
///
@@ -494,7 +495,7 @@ public bool AllowButtonSpecToolTipPriority
///
/// The position of the first character in the current text selection within the text box.
/// The number of characters to select.
- public void Select(int start, int length) => DomainUpDown.Select(start, length);
+ public void Select(int start, int length) => DomainUpDown!.Select(start, length);
///
/// Gets and sets the maximum allowed size of the item.
@@ -565,7 +566,7 @@ public override ViewBase CreateView(KryptonRibbon ribbon,
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[EditorBrowsable(EditorBrowsableState.Never)]
[Browsable(false)]
- public ViewBase DomainUpDownView { get; set; }
+ public ViewBase? DomainUpDownView { get; set; }
#endregion
@@ -684,33 +685,38 @@ private void UnmonitorControl(KryptonDomainUpDown c)
c.TrackMouseLeave -= OnControlLeave;
}
- private void OnControlEnter(object sender, EventArgs e) => MouseEnterControl?.Invoke(this, e);
+ private void OnControlEnter(object? sender, EventArgs e) => MouseEnterControl?.Invoke(this, e);
- private void OnControlLeave(object sender, EventArgs e) => MouseLeaveControl?.Invoke(this, e);
+ private void OnControlLeave(object? sender, EventArgs e) => MouseLeaveControl?.Invoke(this, e);
private void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e) =>
// Pass request onto the view provided paint delegate
ViewPaintDelegate?.Invoke(this, e);
- private void OnDomainUpDownScroll(object sender, ScrollEventArgs e) => OnScroll(e);
+ private void OnDomainUpDownScroll(object? sender, ScrollEventArgs e) => OnScroll(e);
- private void OnDomainUpDownSelectedItemChanged(object sender, EventArgs e) => OnSelectedItemChanged(e);
+ private void OnDomainUpDownSelectedItemChanged(object? sender, EventArgs e) => OnSelectedItemChanged(e);
- private void OnDomainUpDownTextChanged(object sender, EventArgs e) => OnTextChanged(e);
+ private void OnDomainUpDownTextChanged(object? sender, EventArgs e) => OnTextChanged(e);
- private void OnDomainUpDownGotFocus(object sender, EventArgs e) => OnGotFocus(e);
+ private void OnDomainUpDownGotFocus(object? sender, EventArgs e) => OnGotFocus(e);
- private void OnDomainUpDownLostFocus(object sender, EventArgs e) => OnLostFocus(e);
+ private void OnDomainUpDownLostFocus(object? sender, EventArgs e) => OnLostFocus(e);
- private void OnDomainUpDownKeyPress(object sender, KeyPressEventArgs e) => OnKeyPress(e);
+ private void OnDomainUpDownKeyPress(object? sender, KeyPressEventArgs e) => OnKeyPress(e);
- private void OnDomainUpDownKeyUp(object sender, KeyEventArgs e) => OnKeyUp(e);
+ private void OnDomainUpDownKeyUp(object? sender, KeyEventArgs e) => OnKeyUp(e);
- private void OnDomainUpDownKeyDown(object sender, KeyEventArgs e) => OnKeyDown(e);
+ private void OnDomainUpDownKeyDown(object? sender, KeyEventArgs e) => OnKeyDown(e);
- private void OnDomainUpDownPreviewKeyDown(object sender, PreviewKeyDownEventArgs e) => OnPreviewKeyDown(e);
+ private void OnDomainUpDownPreviewKeyDown(object? sender, PreviewKeyDownEventArgs e) => OnPreviewKeyDown(e);
+
+ private void OnRibbonPaletteChanged(object? sender, EventArgs e)
+ {
+ DomainUpDown!.PaletteMode = Ribbon!.PaletteMode;
+ DomainUpDown.LocalCustomPalette = Ribbon.LocalCustomPalette;
+ }
- private void OnRibbonPaletteChanged(object sender, EventArgs e) => DomainUpDown.Palette = Ribbon.GetResolvedPalette();
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupGallery.cs b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupGallery.cs
index 63e71eaa9..e29b3beb6 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupGallery.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupGallery.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -72,7 +72,7 @@ public class KryptonRibbonGroupGallery : KryptonRibbonGroupContainer
///
[Category(@"Action")]
[Description(@"Occurs when user invokes the drop down menu.")]
- public event EventHandler GalleryDropMenu;
+ public event EventHandler? GalleryDropMenu;
///
/// Occurs after the value of a property has changed.
@@ -648,7 +648,7 @@ public override ViewBase CreateView(KryptonRibbon ribbon,
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[EditorBrowsable(EditorBrowsableState.Never)]
[Browsable(false)]
- public ViewBase GalleryView { get; set; }
+ public ViewBase? GalleryView { get; set; }
#endregion
@@ -657,7 +657,7 @@ public override ViewBase CreateView(KryptonRibbon ribbon,
internal KryptonGallery? LastGallery { get; set; }
- internal NeedPaintHandler ViewPaintDelegate { get; set; }
+ internal NeedPaintHandler? ViewPaintDelegate { get; set; }
internal void OnDesignTimeContextMenu(MouseEventArgs e) => DesignTimeContextMenu?.Invoke(this, e);
@@ -690,7 +690,7 @@ public override ViewBase CreateView(KryptonRibbon ribbon,
/// Raises the GalleryDropMenu event.
///
/// An GalleryDropMenuEventArgs containing the event data.
- protected virtual void OnGalleryDropMenu(GalleryDropMenuEventArgs e) => GalleryDropMenu.Invoke(this, e);
+ protected virtual void OnGalleryDropMenu(GalleryDropMenuEventArgs e) => GalleryDropMenu?.Invoke(this, e);
///
/// Raises the GotFocus event.
@@ -724,21 +724,21 @@ private void UnmonitorControl(KryptonGallery c)
c.MouseLeave -= OnControlLeave;
}
- private void OnControlEnter(object sender, EventArgs e) => MouseEnterControl?.Invoke(this, e);
+ private void OnControlEnter(object? sender, EventArgs e) => MouseEnterControl?.Invoke(this, e);
- private void OnControlLeave(object sender, EventArgs e) => MouseLeaveControl?.Invoke(this, e);
+ private void OnControlLeave(object? sender, EventArgs e) => MouseLeaveControl?.Invoke(this, e);
- private void OnGalleryImageListChanged(object sender, EventArgs e) => OnImageListChanged(e);
+ private void OnGalleryImageListChanged(object? sender, EventArgs e) => OnImageListChanged(e);
- private void OnGallerySelectedIndexChanged(object sender, EventArgs e) => OnSelectedIndexChanged(e);
+ private void OnGallerySelectedIndexChanged(object? sender, EventArgs e) => OnSelectedIndexChanged(e);
- private void OnGalleryTrackingImage(object sender, ImageSelectEventArgs e) => OnTrackingImage(e);
+ private void OnGalleryTrackingImage(object? sender, ImageSelectEventArgs e) => OnTrackingImage(e);
- private void OnGalleryGalleryDropMenu(object sender, GalleryDropMenuEventArgs e) => OnGalleryDropMenu(e);
+ private void OnGalleryGalleryDropMenu(object? sender, GalleryDropMenuEventArgs e) => OnGalleryDropMenu(e);
- private void OnGalleryGotFocus(object sender, EventArgs e) => OnGotFocus(e);
+ private void OnGalleryGotFocus(object? sender, EventArgs e) => OnGotFocus(e);
- private void OnGalleryLostFocus(object sender, EventArgs e) => OnLostFocus(e);
+ private void OnGalleryLostFocus(object? sender, EventArgs e) => OnLostFocus(e);
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupItem.cs b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupItem.cs
index 5e75d99fe..8f0a8cb3f 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupItem.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupItem.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -211,7 +211,7 @@ protected bool ChainVisible
[AllowNull]
public BindingContext BindingContext
{
- get => _bindingContext ??= new BindingContext();
+ get => _bindingContext ??= [];
set => _bindingContext = value;
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupLabel.cs b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupLabel.cs
index 9916ac129..1ee5c3e64 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupLabel.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupLabel.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -28,12 +28,12 @@ public class KryptonRibbonGroupLabel : KryptonRibbonGroupItem
#region Instance Fields
private bool _visible;
private bool _enabled;
- private Image _imageSmall;
- private Image _imageLarge;
+ private Image? _imageSmall;
+ private Image? _imageLarge;
private string _textLine1;
private string _textLine2;
private GroupItemSize _itemSizeCurrent;
- private KryptonCommand _command;
+ private KryptonCommand? _command;
private readonly NeedPaintHandler _needPaintDelegate;
private readonly PaletteRibbonText _stateNormal;
private readonly PaletteRibbonText _stateDisabled;
@@ -359,7 +359,7 @@ public override ViewBase CreateView(KryptonRibbon ribbon,
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[EditorBrowsable(EditorBrowsableState.Never)]
[Browsable(false)]
- public ViewBase LabelView { get; set; }
+ public ViewBase? LabelView { get; set; }
#endregion
@@ -369,7 +369,7 @@ public override ViewBase CreateView(KryptonRibbon ribbon,
///
/// Source of the event.
/// A PropertyChangedEventArgs that contains the event data.
- protected virtual void OnCommandPropertyChanged(object sender, PropertyChangedEventArgs e)
+ protected virtual void OnCommandPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
switch (e.PropertyName)
{
@@ -410,7 +410,7 @@ internal override bool ProcessCmdKey(ref Message msg, Keys keyData) =>
#endregion
#region Implementation
- private void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e) =>
+ private void OnPaletteNeedPaint(object? sender, NeedLayoutEventArgs e) =>
// Pass request onto the view provided paint delegate
ViewPaintDelegate?.Invoke(this, e);
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupLines.cs b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupLines.cs
index 32b4c38e3..a4a27a41b 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupLines.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupLines.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -145,6 +145,13 @@ public class KryptonRibbonGroupLines : KryptonRibbonGroupContainer
[Browsable(false)]
public event EventHandler? DesignTimeAddTrackBar;
+ ///
+ /// Occurs when the design time wants to add a theme combobox.
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ [Browsable(false)]
+ public event EventHandler? DesignTimeAddThemeComboBox;
+
///
/// Occurs when the design time context menu is requested.
///
@@ -167,7 +174,7 @@ public KryptonRibbonGroupLines()
_itemSizeCurrent = GroupItemSize.Large;
// Create collection for holding triple items
- Items = new KryptonRibbonGroupLinesCollection();
+ Items = [];
Items.Clearing += OnRibbonGroupLineClearing;
Items.Cleared += OnRibbonGroupLineCleared;
Items.Inserted += OnRibbonGroupLineInserted;
@@ -183,7 +190,7 @@ protected override void Dispose(bool disposing)
if (disposing)
{
// Dispose of per-item resources
- foreach (KryptonRibbonGroupItem item in Items)
+ foreach (var item in Items!)
{
item.Dispose();
}
@@ -209,8 +216,8 @@ public override KryptonRibbon? Ribbon
base.Ribbon = value;
// Forward the reference to all children (just in case the children
- // are added before the this object is added to the owner)
- foreach (KryptonRibbonGroupItem item in Items)
+ // are added before this object is added to the owner)
+ foreach (var item in Items!)
{
item.Ribbon = value;
}
@@ -232,8 +239,8 @@ public override KryptonRibbonTab? RibbonTab
base.RibbonTab = value;
// Forward the reference to all children (just in case the children
- // are added before the this object is added to the owner)
- foreach (KryptonRibbonGroupItem item in Items)
+ // are added before this object is added to the owner)
+ foreach (var item in Items!)
{
item.RibbonTab = value;
}
@@ -337,8 +344,8 @@ public override GroupItemSize ItemSizeMaximum
}
// Update all contained elements to reflect the same sizing
- GroupItemSize itemSize = LinesToItemSize(_itemSizeMax);
- foreach (IRibbonGroupItem item in Items)
+ var itemSize = LinesToItemSize(_itemSizeMax);
+ foreach (IRibbonGroupItem item in Items!)
{
item.ItemSizeMaximum = itemSize;
}
@@ -380,7 +387,7 @@ public override GroupItemSize ItemSizeMinimum
// Update all contained elements to reflect the same sizing
_ = LinesToItemSize(_itemSizeMin);
- foreach (IRibbonGroupItem item in Items)
+ foreach (IRibbonGroupItem item in Items!)
{
item.ItemSizeMinimum = value;
}
@@ -437,7 +444,7 @@ public override ViewBase CreateView(KryptonRibbon ribbon,
[MergableProperty(false)]
[Editor(typeof(KryptonRibbonGroupLinesCollectionEditor), typeof(UITypeEditor))]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public KryptonRibbonGroupLinesCollection Items { get; }
+ public KryptonRibbonGroupLinesCollection? Items { get; }
///
/// Gets an array of all the contained components.
@@ -445,7 +452,7 @@ public override ViewBase CreateView(KryptonRibbon ribbon,
/// Array of child components.
public override Component[] GetChildComponents()
{
- var array = new Component[Items.Count];
+ var array = new Component[Items!.Count];
Items.CopyTo(array, 0);
return array;
}
@@ -499,12 +506,14 @@ public override Component[] GetChildComponents()
internal void OnDesignTimeAddTrackBar() => DesignTimeAddTrackBar?.Invoke(this, EventArgs.Empty);
+ internal void OnDesignTimeAddThemeComboBox() => DesignTimeAddThemeComboBox?.Invoke(this, EventArgs.Empty);
+
internal void OnDesignTimeContextMenu(MouseEventArgs e) => DesignTimeContextMenu?.Invoke(this, e);
internal override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
// Ask the containers to check for command key processing
- foreach (KryptonRibbonGroupItem item in Items)
+ foreach (var item in Items!)
{
if (item.ProcessCmdKey(ref msg, keyData))
{
@@ -532,10 +541,10 @@ private GroupItemSize LinesToItemSize(GroupItemSize containerSize)
}
}
- private void OnRibbonGroupLineClearing(object sender, EventArgs e)
+ private void OnRibbonGroupLineClearing(object? sender, EventArgs e)
{
// Remove the back references
- foreach (IRibbonGroupItem item in Items)
+ foreach (var item in Items!)
{
item.Ribbon = null;
item.RibbonTab = null;
@@ -543,7 +552,7 @@ private void OnRibbonGroupLineClearing(object sender, EventArgs e)
}
}
- private void OnRibbonGroupLineCleared(object sender, EventArgs e)
+ private void OnRibbonGroupLineCleared(object? sender, EventArgs e)
{
// Only need to update display if this tab is selected
if ((Ribbon != null) && (RibbonTab != null) && (Ribbon.SelectedTab == RibbonTab))
@@ -555,7 +564,7 @@ private void OnRibbonGroupLineCleared(object sender, EventArgs e)
private void OnRibbonGroupLineInserted(object sender, TypedCollectionEventArgs e)
{
// Setup the back references
- e.Item.Ribbon = Ribbon;
+ e.Item!.Ribbon = Ribbon;
e.Item.RibbonTab = RibbonTab;
e.Item.RibbonContainer = this;
@@ -574,7 +583,7 @@ private void OnRibbonGroupLineInserted(object sender, TypedCollectionEventArgs e)
{
// Remove the back references
- e.Item.Ribbon = null;
+ e.Item!.Ribbon = null;
e.Item.RibbonTab = null;
e.Item.RibbonContainer = null;
@@ -586,4 +595,4 @@ private void OnRibbonGroupLineRemoved(object sender, TypedCollectionEventArgs
{
#region Static Fields
- private static readonly Type[] _types = { typeof(KryptonRibbonGroupButton),
- typeof(KryptonRibbonGroupColorButton),
- typeof(KryptonRibbonGroupCheckBox),
- typeof(KryptonRibbonGroupComboBox),
- typeof(KryptonRibbonGroupCluster),
- typeof(KryptonRibbonGroupCustomControl),
- typeof(KryptonRibbonGroupDateTimePicker),
- typeof(KryptonRibbonGroupDomainUpDown),
- typeof(KryptonRibbonGroupLabel),
- typeof(KryptonRibbonGroupNumericUpDown),
- typeof(KryptonRibbonGroupRadioButton),
- typeof(KryptonRibbonGroupRichTextBox),
- typeof(KryptonRibbonGroupTextBox),
- typeof(KryptonRibbonGroupTrackBar),
- typeof(KryptonRibbonGroupMaskedTextBox)
- };
+
+ private static readonly Type[] _types =
+ [
+ typeof(KryptonRibbonGroupButton),
+ typeof(KryptonRibbonGroupColorButton),
+ typeof(KryptonRibbonGroupCheckBox),
+ typeof(KryptonRibbonGroupComboBox),
+ typeof(KryptonRibbonGroupCluster),
+ typeof(KryptonRibbonGroupCustomControl),
+ typeof(KryptonRibbonGroupDateTimePicker),
+ typeof(KryptonRibbonGroupDomainUpDown),
+ typeof(KryptonRibbonGroupLabel),
+ typeof(KryptonRibbonGroupNumericUpDown),
+ typeof(KryptonRibbonGroupRadioButton),
+ typeof(KryptonRibbonGroupRichTextBox),
+ typeof(KryptonRibbonGroupTextBox),
+ typeof(KryptonRibbonGroupTrackBar),
+ typeof(KryptonRibbonGroupMaskedTextBox),
+ typeof(KryptonRibbonGroupThemeComboBox)
+ ];
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupMaskedTextBox.cs b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupMaskedTextBox.cs
index f660a5ffc..cb3613e3f 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupMaskedTextBox.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupMaskedTextBox.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -27,7 +27,7 @@ public class KryptonRibbonGroupMaskedTextBox : KryptonRibbonGroupItem
#region Instance Fields
private bool _visible;
private bool _enabled;
- private string _keyTip;
+ private string? _keyTip;
private GroupItemSize _itemSizeCurrent;
#endregion
@@ -165,7 +165,7 @@ public KryptonRibbonGroupMaskedTextBox()
_enabled = true;
_itemSizeCurrent = GroupItemSize.Medium;
ShortcutKeys = Keys.None;
- _keyTip = "X";
+ _keyTip = @"X";
// Create the actual masked text box control and set initial settings
MaskedTextBox = new KryptonMaskedTextBox
@@ -206,11 +206,11 @@ protected override void Dispose(bool disposing)
{
if (disposing)
{
- if (MaskedTextBox != null)
+ if (MaskedTextBox != null!)
{
UnmonitorControl(MaskedTextBox);
MaskedTextBox.Dispose();
- MaskedTextBox = null;
+ MaskedTextBox = null!;
}
}
@@ -235,7 +235,8 @@ public override KryptonRibbon? Ribbon
{
// Use the same palette in the masked text box as the ribbon, plus we need
// to know when the ribbon palette changes so we can reflect that change
- MaskedTextBox.Palette = value.GetResolvedPalette();
+ MaskedTextBox.PaletteMode = Ribbon!.PaletteMode;
+ MaskedTextBox.LocalCustomPalette = Ribbon!.LocalCustomPalette;
value.PaletteChanged += OnRibbonPaletteChanged;
}
}
@@ -263,7 +264,7 @@ public override KryptonRibbon? Ribbon
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Always)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public KryptonMaskedTextBox? MaskedTextBox { get; private set; }
+ public KryptonMaskedTextBox MaskedTextBox { get; private set; }
///
/// Gets and sets the key tip for the ribbon group masked text box.
@@ -274,7 +275,7 @@ public override KryptonRibbon? Ribbon
[Description(@"Ribbon group masked text box key tip.")]
[DefaultValue("X")]
[AllowNull]
- public string KeyTip
+ public string? KeyTip
{
get => _keyTip;
@@ -285,7 +286,7 @@ public string KeyTip
value = @"X";
}
- _keyTip = value.ToUpper();
+ _keyTip = value?.ToUpper();
}
}
@@ -352,8 +353,8 @@ public bool Enabled
[DefaultValue(typeof(Size), "121, 0")]
public Size MinimumSize
{
- get => MaskedTextBox!.MinimumSize;
- set => MaskedTextBox!.MinimumSize = value;
+ get => MaskedTextBox.MinimumSize;
+ set => MaskedTextBox.MinimumSize = value;
}
///
@@ -364,8 +365,8 @@ public Size MinimumSize
[DefaultValue(typeof(Size), "121, 0")]
public Size MaximumSize
{
- get => MaskedTextBox!.MaximumSize;
- set => MaskedTextBox!.MaximumSize = value;
+ get => MaskedTextBox.MaximumSize;
+ set => MaskedTextBox.MaximumSize = value;
}
///
@@ -418,10 +419,10 @@ public override GroupItemSize ItemSizeCurrent
[Category(@"Appearance")]
[Editor(@"System.Windows.Forms.Design.MaskedTextBoxTextEditor", typeof(UITypeEditor))]
[AllowNull]
- public string Text
+ public string? Text
{
- get => MaskedTextBox?.Text ?? string.Empty;
- set => MaskedTextBox!.Text = value;
+ get => MaskedTextBox.Text;
+ set => MaskedTextBox.Text = value;
}
///
@@ -429,7 +430,7 @@ public string Text
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public bool Modified => MaskedTextBox!.Modified;
+ public bool Modified => MaskedTextBox.Modified;
///
/// Gets and sets the selected text within the control.
@@ -437,9 +438,9 @@ public string Text
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[AllowNull]
- public string SelectedText
+ public string? SelectedText
{
- get => MaskedTextBox?.SelectedText ?? string.Empty;
+ get => MaskedTextBox.SelectedText;
set => MaskedTextBox.SelectedText = value;
}
@@ -450,7 +451,7 @@ public string SelectedText
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public int SelectionLength
{
- get => MaskedTextBox?.SelectionLength ?? 0;
+ get => MaskedTextBox.SelectionLength;
set => MaskedTextBox.SelectionLength = value;
}
@@ -461,7 +462,7 @@ public int SelectionLength
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public int SelectionStart
{
- get => MaskedTextBox?.SelectionStart ?? 0;
+ get => MaskedTextBox.SelectionStart;
set => MaskedTextBox.SelectionStart = value;
}
@@ -470,32 +471,32 @@ public int SelectionStart
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public int TextLength => MaskedTextBox?.TextLength ?? 0;
+ public int TextLength => MaskedTextBox.TextLength;
///
/// Gets a value that specifies whether new user input overwrites existing input.
///
[Browsable(false)]
- public bool IsOverwriteMode => MaskedTextBox?.IsOverwriteMode ?? false;
+ public bool IsOverwriteMode => MaskedTextBox.IsOverwriteMode;
///
/// Gets a value indicating whether all required inputs have been entered into the input mask.
///
[Browsable(false)]
- public bool MaskCompleted => MaskedTextBox?.MaskCompleted ?? false;
+ public bool MaskCompleted => MaskedTextBox.MaskCompleted;
///
/// Gets a clone of the mask provider associated with this instance of the masked text box control.
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public MaskedTextProvider? MaskedTextProvider => MaskedTextBox?.MaskedTextProvider;
+ public MaskedTextProvider? MaskedTextProvider => MaskedTextBox.MaskedTextProvider;
///
/// Gets a value indicating whether all required and optional inputs have been entered into the input mask.
///
[Browsable(false)]
- public bool MaskFull => MaskedTextBox?.MaskFull ?? false;
+ public bool MaskFull => MaskedTextBox.MaskFull;
///
/// Gets or sets the maximum number of characters that can be entered into the edit control.
@@ -504,7 +505,7 @@ public int SelectionStart
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public int MaxLength
{
- get => MaskedTextBox?.MaxLength ?? 0;
+ get => MaskedTextBox.MaxLength;
set => MaskedTextBox.MaxLength = value;
}
@@ -515,7 +516,7 @@ public int MaxLength
[DefaultValue(null)]
public Type? ValidatingType
{
- get => MaskedTextBox?.ValidatingType;
+ get => MaskedTextBox.ValidatingType;
set => MaskedTextBox.ValidatingType = value;
}
@@ -528,7 +529,7 @@ public Type? ValidatingType
[Localizable(true)]
public HorizontalAlignment TextAlign
{
- get => MaskedTextBox?.TextAlign ?? HorizontalAlignment.Left;
+ get => MaskedTextBox.TextAlign;
set => MaskedTextBox.TextAlign = value;
}
@@ -542,7 +543,7 @@ public HorizontalAlignment TextAlign
[Localizable(true)]
public char PromptChar
{
- get => MaskedTextBox?.PromptChar ?? '_';
+ get => MaskedTextBox.PromptChar;
set => MaskedTextBox.PromptChar = value;
}
@@ -554,7 +555,7 @@ public char PromptChar
[DefaultValue(true)]
public bool AllowPromptAsInput
{
- get => MaskedTextBox?.AllowPromptAsInput ?? false;
+ get => MaskedTextBox.AllowPromptAsInput;
set => MaskedTextBox.AllowPromptAsInput = value;
}
@@ -567,7 +568,7 @@ public bool AllowPromptAsInput
[DefaultValue(false)]
public bool AsciiOnly
{
- get => MaskedTextBox?.AsciiOnly ?? false;
+ get => MaskedTextBox.AsciiOnly;
set => MaskedTextBox.AsciiOnly = value;
}
@@ -579,7 +580,7 @@ public bool AsciiOnly
[DefaultValue(false)]
public bool BeepOnError
{
- get => MaskedTextBox?.BeepOnError ?? false;
+ get => MaskedTextBox.BeepOnError;
set => MaskedTextBox.BeepOnError = value;
}
@@ -591,7 +592,7 @@ public bool BeepOnError
[RefreshProperties(RefreshProperties.All)]
public CultureInfo Culture
{
- get => MaskedTextBox?.Culture ?? CultureInfo.InvariantCulture;
+ get => MaskedTextBox.Culture;
set => MaskedTextBox.Culture = value;
}
@@ -606,7 +607,7 @@ public CultureInfo Culture
[DefaultValue(typeof(MaskFormat), @"IncludeLiterals")]
public MaskFormat CutCopyMaskFormat
{
- get => MaskedTextBox?.CutCopyMaskFormat ?? MaskFormat.IncludeLiterals;
+ get => MaskedTextBox.CutCopyMaskFormat;
set => MaskedTextBox.CutCopyMaskFormat = value;
}
@@ -619,7 +620,7 @@ public MaskFormat CutCopyMaskFormat
[DefaultValue(false)]
public bool HidePromptOnLeave
{
- get => MaskedTextBox?.HidePromptOnLeave ?? false;
+ get => MaskedTextBox.HidePromptOnLeave;
set => MaskedTextBox.HidePromptOnLeave = value;
}
@@ -631,7 +632,7 @@ public bool HidePromptOnLeave
[DefaultValue(typeof(InsertKeyMode), @"Default")]
public InsertKeyMode InsertKeyMode
{
- get => MaskedTextBox?.InsertKeyMode ?? InsertKeyMode.Default;
+ get => MaskedTextBox.InsertKeyMode;
set => MaskedTextBox.InsertKeyMode = value;
}
@@ -647,7 +648,7 @@ public InsertKeyMode InsertKeyMode
[AllowNull]
public string Mask
{
- get => MaskedTextBox?.Mask ?? string.Empty;
+ get => MaskedTextBox.Mask;
set => MaskedTextBox.Mask = value;
}
@@ -659,7 +660,7 @@ public string Mask
[DefaultValue(true)]
public bool HideSelection
{
- get => MaskedTextBox?.HideSelection ?? true;
+ get => MaskedTextBox.HideSelection;
set => MaskedTextBox.HideSelection = value;
}
@@ -672,7 +673,7 @@ public bool HideSelection
[DefaultValue(false)]
public bool ReadOnly
{
- get => MaskedTextBox?.ReadOnly ?? false;
+ get => MaskedTextBox.ReadOnly;
set => MaskedTextBox.ReadOnly = value;
}
@@ -684,7 +685,7 @@ public bool ReadOnly
[DefaultValue(false)]
public bool RejectInputOnFirstFailure
{
- get => MaskedTextBox?.RejectInputOnFirstFailure ?? false;
+ get => MaskedTextBox.RejectInputOnFirstFailure;
set => MaskedTextBox.RejectInputOnFirstFailure = value;
}
@@ -696,7 +697,7 @@ public bool RejectInputOnFirstFailure
[DefaultValue(true)]
public bool ResetOnPrompt
{
- get => MaskedTextBox?.ResetOnPrompt ?? true;
+ get => MaskedTextBox.ResetOnPrompt;
set => MaskedTextBox.ResetOnPrompt = value;
}
@@ -708,7 +709,7 @@ public bool ResetOnPrompt
[DefaultValue(true)]
public bool ResetOnSpace
{
- get => MaskedTextBox?.ResetOnSpace ?? true;
+ get => MaskedTextBox.ResetOnSpace;
set => MaskedTextBox.ResetOnSpace = value;
}
@@ -720,7 +721,7 @@ public bool ResetOnSpace
[DefaultValue(true)]
public bool SkipLiterals
{
- get => MaskedTextBox?.SkipLiterals ?? true;
+ get => MaskedTextBox.SkipLiterals;
set => MaskedTextBox.SkipLiterals = value;
}
@@ -733,7 +734,7 @@ public bool SkipLiterals
[RefreshProperties(RefreshProperties.Repaint)]
public MaskFormat TextMaskFormat
{
- get => MaskedTextBox?.TextMaskFormat ?? MaskFormat.IncludeLiterals;
+ get => MaskedTextBox.TextMaskFormat;
set => MaskedTextBox.TextMaskFormat = value;
}
@@ -747,7 +748,7 @@ public MaskFormat TextMaskFormat
[Localizable(true)]
public char PasswordChar
{
- get => MaskedTextBox?.PasswordChar ?? '\0';
+ get => MaskedTextBox.PasswordChar;
set => MaskedTextBox.PasswordChar = value;
}
@@ -760,7 +761,7 @@ public char PasswordChar
[DefaultValue(false)]
public bool UseSystemPasswordChar
{
- get => MaskedTextBox?.UseSystemPasswordChar ?? false;
+ get => MaskedTextBox.UseSystemPasswordChar;
set => MaskedTextBox.UseSystemPasswordChar = value;
}
@@ -772,7 +773,7 @@ public bool UseSystemPasswordChar
[DefaultValue(null)]
public ContextMenuStrip? ContextMenuStrip
{
- get => MaskedTextBox?.ContextMenuStrip;
+ get => MaskedTextBox.ContextMenuStrip;
set => MaskedTextBox.ContextMenuStrip = value;
}
@@ -784,7 +785,7 @@ public ContextMenuStrip? ContextMenuStrip
[DefaultValue(null)]
public KryptonContextMenu? KryptonContextMenu
{
- get => MaskedTextBox?.KryptonContextMenu;
+ get => MaskedTextBox.KryptonContextMenu;
set => MaskedTextBox.KryptonContextMenu = value;
}
@@ -801,7 +802,7 @@ public KryptonContextMenu? KryptonContextMenu
[DefaultValue(false)]
public bool AllowButtonSpecToolTips
{
- get => MaskedTextBox?.AllowButtonSpecToolTips ?? false;
+ get => MaskedTextBox.AllowButtonSpecToolTips;
set => MaskedTextBox.AllowButtonSpecToolTips = value;
}
@@ -813,7 +814,7 @@ public bool AllowButtonSpecToolTips
[DefaultValue(false)]
public bool AllowButtonSpecToolTipPriority
{
- get => MaskedTextBox?.AllowButtonSpecToolTipPriority ?? false;
+ get => MaskedTextBox.AllowButtonSpecToolTipPriority;
set => MaskedTextBox.AllowButtonSpecToolTipPriority = value;
}
@@ -850,7 +851,7 @@ public override ViewBase CreateView(KryptonRibbon ribbon,
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[EditorBrowsable(EditorBrowsableState.Never)]
[Browsable(false)]
- public ViewBase MaskedTextBoxView { get; set; }
+ public ViewBase? MaskedTextBoxView { get; set; }
#endregion
@@ -1005,50 +1006,48 @@ private void UnmonitorControl(KryptonMaskedTextBox c)
c.TrackMouseLeave -= OnControlLeave;
}
- private void OnControlEnter(object sender, EventArgs e) => MouseEnterControl?.Invoke(this, e);
+ private void OnControlEnter(object? sender, EventArgs e) => MouseEnterControl?.Invoke(this, e);
- private void OnControlLeave(object sender, EventArgs e) => MouseLeaveControl?.Invoke(this, e);
+ private void OnControlLeave(object? sender, EventArgs e) => MouseLeaveControl?.Invoke(this, e);
private void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e) =>
// Pass request onto the view provided paint delegate
ViewPaintDelegate?.Invoke(this, e);
- private void OnMaskedTextBoxTextChanged(object sender, EventArgs e) => OnTextChanged(e);
+ private void OnMaskedTextBoxTextChanged(object? sender, EventArgs e) => OnTextChanged(e);
- private void OnMaskedTextBoxTextAlignChanged(object sender, EventArgs e) => OnTextAlignChanged(e);
+ private void OnMaskedTextBoxTextAlignChanged(object? sender, EventArgs e) => OnTextAlignChanged(e);
- private void OnMaskedMaskChanged(object sender, EventArgs e) => OnMaskChanged(e);
+ private void OnMaskedMaskChanged(object? sender, EventArgs e) => OnMaskChanged(e);
- private void OnMaskedIsOverwriteModeChanged(object sender, EventArgs e) => OnIsOverwriteModeChanged(e);
+ private void OnMaskedIsOverwriteModeChanged(object? sender, EventArgs e) => OnIsOverwriteModeChanged(e);
- private void OnMaskedMaskInputRejected(object sender, MaskInputRejectedEventArgs e) => OnMaskInputRejected(e);
+ private void OnMaskedMaskInputRejected(object? sender, MaskInputRejectedEventArgs e) => OnMaskInputRejected(e);
- private void OnMaskedTypeValidationCompleted(object sender, TypeValidationEventArgs e) => OnTypeValidationCompleted(e);
+ private void OnMaskedTypeValidationCompleted(object? sender, TypeValidationEventArgs e) => OnTypeValidationCompleted(e);
- private void OnMaskedTextBoxHideSelectionChanged(object sender, EventArgs e) => OnHideSelectionChanged(e);
+ private void OnMaskedTextBoxHideSelectionChanged(object? sender, EventArgs e) => OnHideSelectionChanged(e);
- private void OnMaskedTextBoxModifiedChanged(object sender, EventArgs e) => OnModifiedChanged(e);
+ private void OnMaskedTextBoxModifiedChanged(object? sender, EventArgs e) => OnModifiedChanged(e);
- private void OnMaskedTextBoxReadOnlyChanged(object sender, EventArgs e) => OnReadOnlyChanged(e);
+ private void OnMaskedTextBoxReadOnlyChanged(object? sender, EventArgs e) => OnReadOnlyChanged(e);
- private void OnMaskedTextBoxGotFocus(object sender, EventArgs e) => OnGotFocus(e);
+ private void OnMaskedTextBoxGotFocus(object? sender, EventArgs e) => OnGotFocus(e);
- private void OnMaskedTextBoxLostFocus(object sender, EventArgs e) => OnLostFocus(e);
+ private void OnMaskedTextBoxLostFocus(object? sender, EventArgs e) => OnLostFocus(e);
- private void OnMaskedTextBoxKeyPress(object sender, KeyPressEventArgs e) => OnKeyPress(e);
+ private void OnMaskedTextBoxKeyPress(object? sender, KeyPressEventArgs e) => OnKeyPress(e);
- private void OnMaskedTextBoxKeyUp(object sender, KeyEventArgs e) => OnKeyUp(e);
+ private void OnMaskedTextBoxKeyUp(object? sender, KeyEventArgs e) => OnKeyUp(e);
- private void OnMaskedTextBoxKeyDown(object sender, KeyEventArgs e) => OnKeyDown(e);
+ private void OnMaskedTextBoxKeyDown(object? sender, KeyEventArgs e) => OnKeyDown(e);
- private void OnMaskedTextBoxPreviewKeyDown(object sender, PreviewKeyDownEventArgs e) => OnPreviewKeyDown(e);
+ private void OnMaskedTextBoxPreviewKeyDown(object? sender, PreviewKeyDownEventArgs e) => OnPreviewKeyDown(e);
- private void OnRibbonPaletteChanged(object sender, EventArgs e)
+ private void OnRibbonPaletteChanged(object? sender, EventArgs e)
{
- if (MaskedTextBox != null)
- {
- MaskedTextBox.Palette = Ribbon?.GetResolvedPalette();
- }
+ MaskedTextBox.PaletteMode = Ribbon!.PaletteMode;
+ MaskedTextBox.LocalCustomPalette = Ribbon!.LocalCustomPalette;
}
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupNumericUpDown.cs b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupNumericUpDown.cs
index 5fb1f264d..10e3efbee 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupNumericUpDown.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupNumericUpDown.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -124,7 +124,7 @@ public KryptonRibbonGroupNumericUpDown()
};
// Hook into events to expose via this container
- NumericUpDown.ValueChanged += OnNumericUpDownValueChanged;
+ NumericUpDown!.ValueChanged += OnNumericUpDownValueChanged;
NumericUpDown.GotFocus += OnNumericUpDownGotFocus;
NumericUpDown.LostFocus += OnNumericUpDownLostFocus;
NumericUpDown.KeyDown += OnNumericUpDownKeyDown;
@@ -161,7 +161,7 @@ protected override void Dispose(bool disposing)
///
/// Gets access to the Wrapped Controls Tooltips.
///
- public override ToolTipValues ToolTipValues => NumericUpDown.ToolTipValues;
+ public override ToolTipValues ToolTipValues => NumericUpDown!.ToolTipValues;
///
/// Gets access to the owning ribbon control.
@@ -175,11 +175,12 @@ public override KryptonRibbon? Ribbon
{
base.Ribbon = value;
- if (Ribbon != null)
+ if (Ribbon is not null)
{
// Use the same palette in the numeric up-down as the ribbon, plus we need
// to know when the ribbon palette changes so we can reflect that change
- NumericUpDown.Palette = Ribbon.GetResolvedPalette();
+ NumericUpDown!.PaletteMode = Ribbon.PaletteMode;
+ NumericUpDown.LocalCustomPalette = Ribbon.LocalCustomPalette;
Ribbon.PaletteChanged += OnRibbonPaletteChanged;
}
}
@@ -207,7 +208,7 @@ public override KryptonRibbon? Ribbon
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Always)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public KryptonNumericUpDown NumericUpDown { get; private set; }
+ public KryptonNumericUpDown? NumericUpDown { get; private set; }
///
/// Gets and sets the key tip for the ribbon group numeric up-down.
@@ -225,7 +226,7 @@ public string KeyTip
{
if (string.IsNullOrEmpty(value))
{
- value = "X";
+ value = @"X";
}
_keyTip = value.ToUpper();
@@ -240,8 +241,8 @@ public string KeyTip
[DefaultValue(0)]
public int DecimalPlaces
{
- get => NumericUpDown.DecimalPlaces;
- set => NumericUpDown.DecimalPlaces = value;
+ get => NumericUpDown!.DecimalPlaces;
+ set => NumericUpDown!.DecimalPlaces = value;
}
///
@@ -252,8 +253,8 @@ public int DecimalPlaces
[DefaultValue(typeof(decimal), "1")]
public decimal Increment
{
- get => NumericUpDown.Increment;
- set => NumericUpDown.Increment = value;
+ get => NumericUpDown!.Increment;
+ set => NumericUpDown!.Increment = value;
}
///
@@ -265,8 +266,8 @@ public decimal Increment
[DefaultValue(typeof(decimal), "100")]
public decimal Maximum
{
- get => NumericUpDown.Maximum;
- set => NumericUpDown.Maximum = value;
+ get => NumericUpDown!.Maximum;
+ set => NumericUpDown!.Maximum = value;
}
///
@@ -278,8 +279,8 @@ public decimal Maximum
[DefaultValue(typeof(decimal), "0")]
public decimal Minimum
{
- get => NumericUpDown.Minimum;
- set => NumericUpDown.Minimum = value;
+ get => NumericUpDown!.Minimum;
+ set => NumericUpDown!.Minimum = value;
}
///
@@ -291,8 +292,8 @@ public decimal Minimum
[Localizable(true)]
public bool ThousandsSeparator
{
- get => NumericUpDown.ThousandsSeparator;
- set => NumericUpDown.ThousandsSeparator = value;
+ get => NumericUpDown!.ThousandsSeparator;
+ set => NumericUpDown!.ThousandsSeparator = value;
}
///
@@ -304,8 +305,8 @@ public bool ThousandsSeparator
[Bindable(true)]
public decimal Value
{
- get => NumericUpDown.Value;
- set => NumericUpDown.Value = value;
+ get => NumericUpDown!.Value;
+ set => NumericUpDown!.Value = value;
}
///
@@ -317,8 +318,8 @@ public decimal Value
[Localizable(true)]
public HorizontalAlignment TextAlign
{
- get => NumericUpDown.TextAlign;
- set => NumericUpDown.TextAlign = value;
+ get => NumericUpDown!.TextAlign;
+ set => NumericUpDown!.TextAlign = value;
}
///
@@ -329,8 +330,8 @@ public HorizontalAlignment TextAlign
[DefaultValue(false)]
public bool Hexadecimal
{
- get => NumericUpDown.Hexadecimal;
- set => NumericUpDown.Hexadecimal = value;
+ get => NumericUpDown!.Hexadecimal;
+ set => NumericUpDown!.Hexadecimal = value;
}
///
@@ -342,8 +343,8 @@ public bool Hexadecimal
[Localizable(true)]
public LeftRightAlignment UpDownAlign
{
- get => NumericUpDown.UpDownAlign;
- set => NumericUpDown.UpDownAlign = value;
+ get => NumericUpDown!.UpDownAlign;
+ set => NumericUpDown!.UpDownAlign = value;
}
///
@@ -354,8 +355,8 @@ public LeftRightAlignment UpDownAlign
[DefaultValue(true)]
public bool InterceptArrowKeys
{
- get => NumericUpDown.InterceptArrowKeys;
- set => NumericUpDown.InterceptArrowKeys = value;
+ get => NumericUpDown!.InterceptArrowKeys;
+ set => NumericUpDown!.InterceptArrowKeys = value;
}
///
@@ -367,8 +368,8 @@ public bool InterceptArrowKeys
[DefaultValue(false)]
public bool ReadOnly
{
- get => NumericUpDown.ReadOnly;
- set => NumericUpDown.ReadOnly = value;
+ get => NumericUpDown!.ReadOnly;
+ set => NumericUpDown!.ReadOnly = value;
}
///
@@ -377,7 +378,7 @@ public bool ReadOnly
[Category(@"Visuals")]
[Description(@"Collection of button specifications.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public KryptonNumericUpDown.NumericUpDownButtonSpecCollection ButtonSpecs => NumericUpDown.ButtonSpecs;
+ public KryptonNumericUpDown.NumericUpDownButtonSpecCollection ButtonSpecs => NumericUpDown!.ButtonSpecs;
///
/// Gets and sets the visible state of the numeric up-down.
@@ -442,8 +443,8 @@ public bool Enabled
[DefaultValue(typeof(Size), "121, 0")]
public Size MinimumSize
{
- get => NumericUpDown.MinimumSize;
- set => NumericUpDown.MinimumSize = value;
+ get => NumericUpDown!.MinimumSize;
+ set => NumericUpDown!.MinimumSize = value;
}
///
@@ -454,8 +455,8 @@ public Size MinimumSize
[DefaultValue(typeof(Size), "121, 0")]
public Size MaximumSize
{
- get => NumericUpDown.MaximumSize;
- set => NumericUpDown.MaximumSize = value;
+ get => NumericUpDown!.MaximumSize;
+ set => NumericUpDown!.MaximumSize = value;
}
///
@@ -466,8 +467,8 @@ public Size MaximumSize
[DefaultValue(null)]
public ContextMenuStrip? ContextMenuStrip
{
- get => NumericUpDown.ContextMenuStrip;
- set => NumericUpDown.ContextMenuStrip = value;
+ get => NumericUpDown!.ContextMenuStrip;
+ set => NumericUpDown!.ContextMenuStrip = value;
}
///
@@ -478,8 +479,8 @@ public ContextMenuStrip? ContextMenuStrip
[DefaultValue(null)]
public KryptonContextMenu? KryptonContextMenu
{
- get => NumericUpDown.KryptonContextMenu;
- set => NumericUpDown.KryptonContextMenu = value;
+ get => NumericUpDown!.KryptonContextMenu;
+ set => NumericUpDown!.KryptonContextMenu = value;
}
///
@@ -490,8 +491,8 @@ public KryptonContextMenu? KryptonContextMenu
[DefaultValue(false)]
public bool AllowButtonSpecToolTips
{
- get => NumericUpDown.AllowButtonSpecToolTips;
- set => NumericUpDown.AllowButtonSpecToolTips = value;
+ get => NumericUpDown!.AllowButtonSpecToolTips;
+ set => NumericUpDown!.AllowButtonSpecToolTips = value;
}
///
@@ -502,8 +503,8 @@ public bool AllowButtonSpecToolTips
[DefaultValue(false)]
public bool AllowButtonSpecToolTipPriority
{
- get => NumericUpDown.AllowButtonSpecToolTipPriority;
- set => NumericUpDown.AllowButtonSpecToolTipPriority = value;
+ get => NumericUpDown!.AllowButtonSpecToolTipPriority;
+ set => NumericUpDown!.AllowButtonSpecToolTipPriority = value;
}
///
@@ -511,7 +512,7 @@ public bool AllowButtonSpecToolTipPriority
///
/// The position of the first character in the current text selection within the text box.
/// The number of characters to select.
- public void Select(int start, int length) => NumericUpDown.Select(start, length);
+ public void Select(int start, int length) => NumericUpDown!.Select(start, length);
///
/// Gets and sets the maximum allowed size of the item.
@@ -574,7 +575,7 @@ public override ViewBase CreateView(KryptonRibbon ribbon,
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[EditorBrowsable(EditorBrowsableState.Never)]
[Browsable(false)]
- public IKryptonDesignObject NumericUpDownDesigner { get; set; }
+ public IKryptonDesignObject? NumericUpDownDesigner { get; set; }
///
/// Internal design time properties.
@@ -582,7 +583,7 @@ public override ViewBase CreateView(KryptonRibbon ribbon,
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[EditorBrowsable(EditorBrowsableState.Never)]
[Browsable(false)]
- public ViewBase NumericUpDownView { get; set; }
+ public ViewBase? NumericUpDownView { get; set; }
#endregion
@@ -637,7 +638,7 @@ public override ViewBase CreateView(KryptonRibbon ribbon,
#endregion
#region Internal
- internal Control LastParentControl { get; set; }
+ internal Control? LastParentControl { get; set; }
internal KryptonNumericUpDown? LastNumericUpDown { get; set; }
@@ -660,7 +661,7 @@ internal override bool ProcessCmdKey(ref Message msg, Keys keyData)
// Can the numeric up-down take the focus
if (LastNumericUpDown is { CanFocus: true })
{
- LastNumericUpDown.NumericUpDown.Focus();
+ LastNumericUpDown.NumericUpDown!.Focus();
}
return true;
@@ -690,29 +691,34 @@ private void UnmonitorControl(KryptonNumericUpDown c)
c.TrackMouseLeave -= OnControlLeave;
}
- private void OnControlEnter(object sender, EventArgs e) => MouseEnterControl?.Invoke(this, e);
+ private void OnControlEnter(object? sender, EventArgs e) => MouseEnterControl?.Invoke(this, e);
- private void OnControlLeave(object sender, EventArgs e) => MouseLeaveControl?.Invoke(this, e);
+ private void OnControlLeave(object? sender, EventArgs e) => MouseLeaveControl?.Invoke(this, e);
private void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e) =>
// Pass request onto the view provided paint delegate
ViewPaintDelegate?.Invoke(this, e);
- private void OnNumericUpDownValueChanged(object sender, EventArgs e) => OnValueChanged(e);
+ private void OnNumericUpDownValueChanged(object? sender, EventArgs e) => OnValueChanged(e);
- private void OnNumericUpDownGotFocus(object sender, EventArgs e) => OnGotFocus(e);
+ private void OnNumericUpDownGotFocus(object? sender, EventArgs e) => OnGotFocus(e);
- private void OnNumericUpDownLostFocus(object sender, EventArgs e) => OnLostFocus(e);
+ private void OnNumericUpDownLostFocus(object? sender, EventArgs e) => OnLostFocus(e);
- private void OnNumericUpDownKeyPress(object sender, KeyPressEventArgs e) => OnKeyPress(e);
+ private void OnNumericUpDownKeyPress(object? sender, KeyPressEventArgs e) => OnKeyPress(e);
- private void OnNumericUpDownKeyUp(object sender, KeyEventArgs e) => OnKeyUp(e);
+ private void OnNumericUpDownKeyUp(object? sender, KeyEventArgs e) => OnKeyUp(e);
- private void OnNumericUpDownKeyDown(object sender, KeyEventArgs e) => OnKeyDown(e);
+ private void OnNumericUpDownKeyDown(object? sender, KeyEventArgs e) => OnKeyDown(e);
- private void OnNumericUpDownPreviewKeyDown(object sender, PreviewKeyDownEventArgs e) => OnPreviewKeyDown(e);
+ private void OnNumericUpDownPreviewKeyDown(object? sender, PreviewKeyDownEventArgs e) => OnPreviewKeyDown(e);
+
+ private void OnRibbonPaletteChanged(object? sender, EventArgs e)
+ {
+ NumericUpDown!.PaletteMode = Ribbon!.PaletteMode;
+ NumericUpDown.LocalCustomPalette = Ribbon.LocalCustomPalette;
+ }
- private void OnRibbonPaletteChanged(object sender, EventArgs e) => NumericUpDown.Palette = Ribbon.GetResolvedPalette();
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupRadioButton.cs b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupRadioButton.cs
index f126869d2..2493a66e1 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupRadioButton.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupRadioButton.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -400,7 +400,7 @@ protected virtual void OnClick(EventHandler? finishDelegate)
{
var fireDelegate = true;
- if (!Ribbon.InDesignMode)
+ if (!Ribbon!.InDesignMode)
{
if (Enabled)
{
diff --git a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupRichTextBox.cs b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupRichTextBox.cs
index f6f2008cb..a54dda08e 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupRichTextBox.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupRichTextBox.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -194,7 +194,7 @@ public KryptonRibbonGroupRichTextBox()
};
// Hook into events to expose via our container
- RichTextBox.AcceptsTabChanged += OnRichTextBoxAcceptsTabChanged;
+ RichTextBox!.AcceptsTabChanged += OnRichTextBoxAcceptsTabChanged;
RichTextBox.TextChanged += OnRichTextBoxTextChanged;
RichTextBox.HideSelectionChanged += OnRichTextBoxHideSelectionChanged;
RichTextBox.ModifiedChanged += OnRichTextBoxModifiedChanged;
@@ -227,7 +227,7 @@ protected override void Dispose(bool disposing)
if (RichTextBox != null)
{
UnmonitorControl(RichTextBox);
- RichTextBox.Dispose();
+ RichTextBox!.Dispose();
RichTextBox = null;
}
}
@@ -253,7 +253,8 @@ public override KryptonRibbon? Ribbon
{
// Use the same palette in the text box as the ribbon, plus we need
// to know when the ribbon palette changes so we can reflect that change
- RichTextBox.Palette = Ribbon.GetResolvedPalette();
+ RichTextBox!.PaletteMode = Ribbon!.PaletteMode;
+ RichTextBox.LocalCustomPalette = Ribbon!.LocalCustomPalette;
Ribbon.PaletteChanged += OnRibbonPaletteChanged;
}
}
@@ -281,7 +282,7 @@ public override KryptonRibbon? Ribbon
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Always)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public KryptonRichTextBox RichTextBox { get; private set; }
+ public KryptonRichTextBox? RichTextBox { get; private set; }
///
/// Gets and sets the key tip for the ribbon group rich text box.
@@ -299,7 +300,7 @@ public string KeyTip
{
if (string.IsNullOrEmpty(value))
{
- value = "X";
+ value = @"X";
}
_keyTip = value.ToUpper();
@@ -369,8 +370,8 @@ public bool Enabled
[DefaultValue(typeof(Size), "121, 0")]
public Size MinimumSize
{
- get => RichTextBox.MinimumSize;
- set => RichTextBox.MinimumSize = value;
+ get => RichTextBox!.MinimumSize;
+ set => RichTextBox!.MinimumSize = value;
}
///
@@ -381,8 +382,8 @@ public Size MinimumSize
[DefaultValue(typeof(Size), "121, 0")]
public Size MaximumSize
{
- get => RichTextBox.MaximumSize;
- set => RichTextBox.MaximumSize = value;
+ get => RichTextBox!.MaximumSize;
+ set => RichTextBox!.MaximumSize = value;
}
///
@@ -393,8 +394,8 @@ public Size MaximumSize
[Editor(typeof(MultilineStringEditor), typeof(UITypeEditor))]
public string Text
{
- get => RichTextBox.Text;
- set => RichTextBox.Text = value;
+ get => RichTextBox!.Text;
+ set => RichTextBox!.Text = value;
}
///
@@ -402,7 +403,7 @@ public string Text
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public int TextLength => RichTextBox.TextLength;
+ public int TextLength => RichTextBox!.TextLength;
///
/// Gets and sets the associated context menu strip.
@@ -412,8 +413,8 @@ public string Text
[DefaultValue(null)]
public ContextMenuStrip? ContextMenuStrip
{
- get => RichTextBox.ContextMenuStrip;
- set => RichTextBox.ContextMenuStrip = value;
+ get => RichTextBox!.ContextMenuStrip;
+ set => RichTextBox!.ContextMenuStrip = value;
}
///
@@ -424,8 +425,8 @@ public ContextMenuStrip? ContextMenuStrip
[DefaultValue(null)]
public KryptonContextMenu? KryptonContextMenu
{
- get => RichTextBox.KryptonContextMenu;
- set => RichTextBox.KryptonContextMenu = value;
+ get => RichTextBox!.KryptonContextMenu;
+ set => RichTextBox!.KryptonContextMenu = value;
}
///
@@ -439,8 +440,8 @@ public KryptonContextMenu? KryptonContextMenu
[Localizable(true)]
public string[] Lines
{
- get => RichTextBox.Lines;
- set => RichTextBox.Lines = value;
+ get => RichTextBox!.Lines;
+ set => RichTextBox!.Lines = value;
}
///
@@ -452,8 +453,8 @@ public string[] Lines
[Localizable(true)]
public RichTextBoxScrollBars ScrollBars
{
- get => RichTextBox.ScrollBars;
- set => RichTextBox.ScrollBars = value;
+ get => RichTextBox!.ScrollBars;
+ set => RichTextBox!.ScrollBars = value;
}
///
@@ -465,8 +466,8 @@ public RichTextBoxScrollBars ScrollBars
[Localizable(true)]
public bool WordWrap
{
- get => RichTextBox.WordWrap;
- set => RichTextBox.WordWrap = value;
+ get => RichTextBox!.WordWrap;
+ set => RichTextBox!.WordWrap = value;
}
///
@@ -478,8 +479,8 @@ public bool WordWrap
[Localizable(true)]
public int RightMargin
{
- get => RichTextBox.RightMargin;
- set => RichTextBox.RightMargin = value;
+ get => RichTextBox!.RightMargin;
+ set => RichTextBox!.RightMargin = value;
}
///
@@ -490,8 +491,8 @@ public int RightMargin
[DefaultValue(false)]
public bool ShowSelectionMargin
{
- get => RichTextBox.ShowSelectionMargin;
- set => RichTextBox.ShowSelectionMargin = value;
+ get => RichTextBox!.ShowSelectionMargin;
+ set => RichTextBox!.ShowSelectionMargin = value;
}
///
@@ -503,8 +504,8 @@ public bool ShowSelectionMargin
[Localizable(true)]
public float ZoomFactor
{
- get => RichTextBox.ZoomFactor;
- set => RichTextBox.ZoomFactor = value;
+ get => RichTextBox!.ZoomFactor;
+ set => RichTextBox!.ZoomFactor = value;
}
///
@@ -517,8 +518,8 @@ public float ZoomFactor
[Localizable(true)]
public bool Multiline
{
- get => RichTextBox.Multiline;
- set => RichTextBox.Multiline = value;
+ get => RichTextBox!.Multiline;
+ set => RichTextBox!.Multiline = value;
}
///
@@ -529,8 +530,8 @@ public bool Multiline
[DefaultValue(false)]
public bool AcceptsTab
{
- get => RichTextBox.AcceptsTab;
- set => RichTextBox.AcceptsTab = value;
+ get => RichTextBox!.AcceptsTab;
+ set => RichTextBox!.AcceptsTab = value;
}
///
@@ -541,8 +542,8 @@ public bool AcceptsTab
[DefaultValue(true)]
public bool HideSelection
{
- get => RichTextBox.HideSelection;
- set => RichTextBox.HideSelection = value;
+ get => RichTextBox!.HideSelection;
+ set => RichTextBox!.HideSelection = value;
}
///
@@ -554,8 +555,8 @@ public bool HideSelection
[Localizable(true)]
public int MaxLength
{
- get => RichTextBox.MaxLength;
- set => RichTextBox.MaxLength = value;
+ get => RichTextBox!.MaxLength;
+ set => RichTextBox!.MaxLength = value;
}
///
@@ -566,8 +567,8 @@ public int MaxLength
[DefaultValue(false)]
public bool AutoWordSelection
{
- get => RichTextBox.AutoWordSelection;
- set => RichTextBox.AutoWordSelection = value;
+ get => RichTextBox!.AutoWordSelection;
+ set => RichTextBox!.AutoWordSelection = value;
}
///
@@ -579,8 +580,8 @@ public bool AutoWordSelection
[Localizable(true)]
public int BulletIndent
{
- get => RichTextBox.BulletIndent;
- set => RichTextBox.BulletIndent = value;
+ get => RichTextBox!.BulletIndent;
+ set => RichTextBox!.BulletIndent = value;
}
///
@@ -591,8 +592,8 @@ public int BulletIndent
[DefaultValue(true)]
public bool DetectUrls
{
- get => RichTextBox.DetectUrls;
- set => RichTextBox.DetectUrls = value;
+ get => RichTextBox!.DetectUrls;
+ set => RichTextBox!.DetectUrls = value;
}
///
@@ -603,8 +604,8 @@ public bool DetectUrls
[DefaultValue(false)]
public bool EnableAutoDragDrop
{
- get => RichTextBox.EnableAutoDragDrop;
- set => RichTextBox.EnableAutoDragDrop = value;
+ get => RichTextBox!.EnableAutoDragDrop;
+ set => RichTextBox!.EnableAutoDragDrop = value;
}
///
@@ -616,8 +617,8 @@ public bool EnableAutoDragDrop
[DefaultValue(false)]
public bool ReadOnly
{
- get => RichTextBox.ReadOnly;
- set => RichTextBox.ReadOnly = value;
+ get => RichTextBox!.ReadOnly;
+ set => RichTextBox!.ReadOnly = value;
}
///
@@ -628,14 +629,14 @@ public bool ReadOnly
[DefaultValue(true)]
public bool ShortcutsEnabled
{
- get => RichTextBox.ShortcutsEnabled;
- set => RichTextBox.ShortcutsEnabled = value;
+ get => RichTextBox!.ShortcutsEnabled;
+ set => RichTextBox!.ShortcutsEnabled = value;
}
///
/// Gets access to the Wrapped Controls Tooltips.
///
- public override ToolTipValues ToolTipValues => RichTextBox.ToolTipValues;
+ public override ToolTipValues ToolTipValues => RichTextBox!.ToolTipValues;
///
/// Gets and sets a value indicating if tooltips should be Displayed for button specs.
@@ -645,8 +646,8 @@ public bool ShortcutsEnabled
[DefaultValue(false)]
public bool AllowButtonSpecToolTips
{
- get => RichTextBox.AllowButtonSpecToolTips;
- set => RichTextBox.AllowButtonSpecToolTips = value;
+ get => RichTextBox!.AllowButtonSpecToolTips;
+ set => RichTextBox!.AllowButtonSpecToolTips = value;
}
///
@@ -657,8 +658,8 @@ public bool AllowButtonSpecToolTips
[DefaultValue(false)]
public bool AllowButtonSpecToolTipPriority
{
- get => RichTextBox.AllowButtonSpecToolTipPriority;
- set => RichTextBox.AllowButtonSpecToolTipPriority = value;
+ get => RichTextBox!.AllowButtonSpecToolTipPriority;
+ set => RichTextBox!.AllowButtonSpecToolTipPriority = value;
}
///
@@ -667,28 +668,28 @@ public bool AllowButtonSpecToolTipPriority
[Category(@"Visuals")]
[Description(@"Collection of button specifications.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public KryptonRichTextBox.RichTextBoxButtonSpecCollection ButtonSpecs => RichTextBox.ButtonSpecs;
+ public KryptonRichTextBox.RichTextBoxButtonSpecCollection ButtonSpecs => RichTextBox!.ButtonSpecs;
///
/// Gets and sets if the control can redo a previously undo operation.
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public bool CanRedo => RichTextBox.CanRedo;
+ public bool CanRedo => RichTextBox!.CanRedo;
///
/// Gets a value indicating whether the user can undo the previous operation in a rich text box control.
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public bool CanUndo => RichTextBox.CanUndo;
+ public bool CanUndo => RichTextBox!.CanUndo;
///
/// Gets a value indicating whether the contents have changed since last last.
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public bool Modified => RichTextBox.Modified;
+ public bool Modified => RichTextBox!.Modified;
///
/// Gets and sets the language option.
@@ -697,8 +698,8 @@ public bool AllowButtonSpecToolTipPriority
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public RichTextBoxLanguageOptions LanguageOption
{
- get => RichTextBox.LanguageOption;
- set => RichTextBox.LanguageOption = value;
+ get => RichTextBox!.LanguageOption;
+ set => RichTextBox!.LanguageOption = value;
}
///
@@ -706,14 +707,14 @@ public RichTextBoxLanguageOptions LanguageOption
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public string RedoActionName => RichTextBox.RedoActionName;
+ public string? RedoActionName => RichTextBox!.RedoActionName;
///
/// Gets and sets the name of the action to be undone.
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public string UndoActionName => RichTextBox.UndoActionName;
+ public string UndoActionName => RichTextBox!.UndoActionName!;
///
/// Gets and sets if keyboard shortcuts are enabled.
@@ -723,8 +724,8 @@ public RichTextBoxLanguageOptions LanguageOption
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool RichTextShortcutsEnabled
{
- get => RichTextBox.RichTextShortcutsEnabled;
- set => RichTextBox.RichTextShortcutsEnabled = value;
+ get => RichTextBox!.RichTextShortcutsEnabled;
+ set => RichTextBox!.RichTextShortcutsEnabled = value;
}
///
@@ -735,8 +736,8 @@ public bool RichTextShortcutsEnabled
[RefreshProperties(RefreshProperties.All)]
public string Rtf
{
- get => RichTextBox.Rtf;
- set => RichTextBox.Rtf = value;
+ get => RichTextBox!.Rtf;
+ set => RichTextBox!.Rtf = value;
}
///
@@ -747,8 +748,8 @@ public string Rtf
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string SelectedRtf
{
- get => RichTextBox.SelectedRtf;
- set => RichTextBox.SelectedRtf = value;
+ get => RichTextBox!.SelectedRtf;
+ set => RichTextBox!.SelectedRtf = value;
}
///
@@ -758,8 +759,8 @@ public string SelectedRtf
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string SelectedText
{
- get => RichTextBox.SelectedText;
- set => RichTextBox.SelectedText = value;
+ get => RichTextBox!.SelectedText;
+ set => RichTextBox!.SelectedText = value;
}
///
@@ -770,8 +771,8 @@ public string SelectedText
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public HorizontalAlignment SelectionAlignment
{
- get => RichTextBox.SelectionAlignment;
- set => RichTextBox.SelectionAlignment = value;
+ get => RichTextBox!.SelectionAlignment;
+ set => RichTextBox!.SelectionAlignment = value;
}
///
@@ -781,8 +782,8 @@ public HorizontalAlignment SelectionAlignment
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public Color SelectionBackColor
{
- get => RichTextBox.SelectionBackColor;
- set => RichTextBox.SelectionBackColor = value;
+ get => RichTextBox!.SelectionBackColor;
+ set => RichTextBox!.SelectionBackColor = value;
}
///
@@ -792,8 +793,8 @@ public Color SelectionBackColor
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool SelectionBullet
{
- get => RichTextBox.SelectionBullet;
- set => RichTextBox.SelectionBullet = value;
+ get => RichTextBox!.SelectionBullet;
+ set => RichTextBox!.SelectionBullet = value;
}
///
@@ -803,8 +804,8 @@ public bool SelectionBullet
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public int SelectionCharOffset
{
- get => RichTextBox.SelectionCharOffset;
- set => RichTextBox.SelectionCharOffset = value;
+ get => RichTextBox!.SelectionCharOffset;
+ set => RichTextBox!.SelectionCharOffset = value;
}
///
@@ -814,8 +815,8 @@ public int SelectionCharOffset
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public Color SelectionColor
{
- get => RichTextBox.SelectionColor;
- set => RichTextBox.SelectionColor = value;
+ get => RichTextBox!.SelectionColor;
+ set => RichTextBox!.SelectionColor = value;
}
///
@@ -825,8 +826,8 @@ public Color SelectionColor
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public Font SelectionFont
{
- get => RichTextBox.SelectionFont;
- set => RichTextBox.SelectionFont = value;
+ get => RichTextBox!.SelectionFont;
+ set => RichTextBox!.SelectionFont = value;
}
///
@@ -836,8 +837,8 @@ public Font SelectionFont
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public int SelectionHangingIndent
{
- get => RichTextBox.SelectionHangingIndent;
- set => RichTextBox.SelectionHangingIndent = value;
+ get => RichTextBox!.SelectionHangingIndent;
+ set => RichTextBox!.SelectionHangingIndent = value;
}
///
@@ -847,8 +848,8 @@ public int SelectionHangingIndent
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public int SelectionIndent
{
- get => RichTextBox.SelectionIndent;
- set => RichTextBox.SelectionIndent = value;
+ get => RichTextBox!.SelectionIndent;
+ set => RichTextBox!.SelectionIndent = value;
}
///
@@ -858,8 +859,8 @@ public int SelectionIndent
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public int SelectionLength
{
- get => RichTextBox.SelectionLength;
- set => RichTextBox.SelectionLength = value;
+ get => RichTextBox!.SelectionLength;
+ set => RichTextBox!.SelectionLength = value;
}
///
@@ -869,8 +870,8 @@ public int SelectionLength
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public int SelectionProtected
{
- get => RichTextBox.SelectionLength;
- set => RichTextBox.SelectionLength = value;
+ get => RichTextBox!.SelectionLength;
+ set => RichTextBox!.SelectionLength = value;
}
///
@@ -880,8 +881,8 @@ public int SelectionProtected
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public int SelectionRightIndent
{
- get => RichTextBox.SelectionRightIndent;
- set => RichTextBox.SelectionRightIndent = value;
+ get => RichTextBox!.SelectionRightIndent;
+ set => RichTextBox!.SelectionRightIndent = value;
}
///
@@ -891,8 +892,8 @@ public int SelectionRightIndent
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public int SelectionStart
{
- get => RichTextBox.SelectionStart;
- set => RichTextBox.SelectionStart = value;
+ get => RichTextBox!.SelectionStart;
+ set => RichTextBox!.SelectionStart = value;
}
///
@@ -902,8 +903,8 @@ public int SelectionStart
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public int[] SelectionTabs
{
- get => RichTextBox.SelectionTabs;
- set => RichTextBox.SelectionTabs = value;
+ get => RichTextBox!.SelectionTabs;
+ set => RichTextBox!.SelectionTabs = value;
}
///
@@ -911,59 +912,59 @@ public int[] SelectionTabs
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public RichTextBoxSelectionTypes SelectionType => RichTextBox.SelectionType;
+ public RichTextBoxSelectionTypes SelectionType => RichTextBox!.SelectionType;
///
/// Appends text to the current text of a rich text box.
///
/// The text to append to the current contents of the text box.
- public void AppendText(string text) => RichTextBox.AppendText(text);
+ public void AppendText(string text) => RichTextBox!.AppendText(text);
///
/// Clears all text from the text box control.
///
- public void Clear() => RichTextBox.Clear();
+ public void Clear() => RichTextBox!.Clear();
///
/// Clears information about the most recent operation from the undo buffer of the rich text box.
///
- public void ClearUndo() => RichTextBox.ClearUndo();
+ public void ClearUndo() => RichTextBox!.ClearUndo();
///
/// Copies the current selection in the text box to the Clipboard.
///
- public void Copy() => RichTextBox.Copy();
+ public void Copy() => RichTextBox!.Copy();
///
/// Moves the current selection in the text box to the Clipboard.
///
- public void Cut() => RichTextBox.Cut();
+ public void Cut() => RichTextBox!.Cut();
///
/// Specifies that the value of the SelectionLength property is zero so that no characters are selected in the control.
///
- public void DeselectAll() => RichTextBox.DeselectAll();
+ public void DeselectAll() => RichTextBox!.DeselectAll();
///
/// Determines whether you can paste information from the Clipboard in the specified data format.
///
/// One of the System.Windows.Forms.DataFormats.Format values.
/// true if you can paste data from the Clipboard in the specified data format; otherwise, false.
- public bool CanPaste(DataFormats.Format clipFormat) => RichTextBox.CanPaste(clipFormat);
+ public bool CanPaste(DataFormats.Format clipFormat) => RichTextBox!.CanPaste(clipFormat);
///
/// Searches the text in a RichTextBox control for a string.
///
/// The text to locate in the control.
/// The location within the control where the search text was found or -1 if the search string is not found or an empty search string is specified in the str parameter.
- public int Find(string str) => RichTextBox.Find(str);
+ public int Find(string str) => RichTextBox!.Find(str);
///
/// Searches the text of a RichTextBox control for the first instance of a character from a list of characters.
///
/// The array of characters to search for.
/// The location within the control where the search characters were found or -1 if the search characters are not found or an empty search character set is specified in the char parameter.
- public int Find(char[] characterSet) => RichTextBox.Find(characterSet);
+ public int Find(char[] characterSet) => RichTextBox!.Find(characterSet);
///
/// Searches the text of a RichTextBox control, at a specific starting point, for the first instance of a character from a list of characters.
@@ -971,7 +972,7 @@ public int[] SelectionTabs
/// The array of characters to search for.
/// The location within the control's text at which to begin searching.
/// The location within the control where the search characters are found.
- public int Find(char[] characterSet, int start) => RichTextBox.Find(characterSet, start);
+ public int Find(char[] characterSet, int start) => RichTextBox!.Find(characterSet, start);
///
/// Searches the text in a RichTextBox control for a string with specific options applied to the search.
@@ -979,7 +980,7 @@ public int[] SelectionTabs
/// The text to locate in the control.
/// A bitwise combination of the RichTextBoxFinds values.
/// The location within the control where the search text was found.
- public int Find(string str, RichTextBoxFinds options) => RichTextBox.Find(str, options);
+ public int Find(string str, RichTextBoxFinds options) => RichTextBox!.Find(str, options);
///
/// Searches a range of text in a RichTextBox control for the first instance of a character from a list of characters.
@@ -988,7 +989,7 @@ public int[] SelectionTabs
/// The location within the control's text at which to begin searching.
/// The location within the control's text at which to end searching.
/// The location within the control where the search characters are found.
- public int Find(char[] characterSet, int start, int end) => RichTextBox.Find(characterSet, start, end);
+ public int Find(char[] characterSet, int start, int end) => RichTextBox!.Find(characterSet, start, end);
///
/// Searches the text in a RichTextBox control for a string at a specific location within the control and with specific options applied to the search.
@@ -997,7 +998,7 @@ public int[] SelectionTabs
/// The location within the control's text at which to begin searching.
/// A bitwise combination of the RichTextBoxFinds values.
/// The location within the control where the search text was found.
- public int Find(string str, int start, RichTextBoxFinds options) => RichTextBox.Find(str, start, options);
+ public int Find(string str, int start, RichTextBoxFinds options) => RichTextBox!.Find(str, start, options);
///
/// Searches the text in a RichTextBox control for a string within a range of text within the control and with specific options applied to the search.
@@ -1007,126 +1008,126 @@ public int[] SelectionTabs
/// The location within the control's text at which to end searching. This value must be equal to negative one (-1) or greater than or equal to the start parameter.
/// A bitwise combination of the RichTextBoxFinds values.
///
- public int Find(string str, int start, int end, RichTextBoxFinds options) => RichTextBox.Find(str, start, end, options);
+ public int Find(string str, int start, int end, RichTextBoxFinds options) => RichTextBox!.Find(str, start, end, options);
///
/// Retrieves the character that is closest to the specified location within the control.
///
/// The location from which to seek the nearest character.
/// The character at the specified location.
- public int GetCharFromPosition(Point pt) => RichTextBox.GetCharFromPosition(pt);
+ public int GetCharFromPosition(Point pt) => RichTextBox!.GetCharFromPosition(pt);
///
/// Retrieves the index of the character nearest to the specified location.
///
/// The location to search.
/// The zero-based character index at the specified location.
- public int GetCharIndexFromPosition(Point pt) => RichTextBox.GetCharIndexFromPosition(pt);
+ public int GetCharIndexFromPosition(Point pt) => RichTextBox!.GetCharIndexFromPosition(pt);
///
/// Retrieves the index of the first character of a given line.
///
/// The line for which to get the index of its first character.
/// The zero-based character index in the specified line.
- public int GetFirstCharIndexFromLine(int lineNumber) => RichTextBox.GetFirstCharIndexFromLine(lineNumber);
+ public int GetFirstCharIndexFromLine(int lineNumber) => RichTextBox!.GetFirstCharIndexFromLine(lineNumber);
///
/// Retrieves the index of the first character of the current line.
///
/// The zero-based character index in the current line.
- public int GetFirstCharIndexOfCurrentLine() => RichTextBox.GetFirstCharIndexOfCurrentLine();
+ public int GetFirstCharIndexOfCurrentLine() => RichTextBox!.GetFirstCharIndexOfCurrentLine();
///
/// Retrieves the line number from the specified character position within the text of the RichTextBox control.
///
/// The character index position to search.
/// The zero-based line number in which the character index is located.
- public int GetLineFromCharIndex(int index) => RichTextBox.GetLineFromCharIndex(index);
+ public int GetLineFromCharIndex(int index) => RichTextBox!.GetLineFromCharIndex(index);
///
/// Retrieves the location within the control at the specified character index.
///
/// The index of the character for which to retrieve the location.
/// The location of the specified character.
- public Point GetPositionFromCharIndex(int index) => RichTextBox.GetPositionFromCharIndex(index);
+ public Point GetPositionFromCharIndex(int index) => RichTextBox!.GetPositionFromCharIndex(index);
///
/// Loads a rich text format (RTF) or standard ASCII text file into the RichTextBox control.
///
/// The name and location of the file to load into the control.
- public void LoadFile(string path) => RichTextBox.LoadFile(path);
+ public void LoadFile(string path) => RichTextBox!.LoadFile(path);
///
/// Loads the contents of an existing data stream into the RichTextBox control.
///
/// A stream of data to load into the RichTextBox control.
/// One of the RichTextBoxStreamType values.
- public void LoadFile(Stream data, RichTextBoxStreamType fileType) => RichTextBox.LoadFile(data, fileType);
+ public void LoadFile(Stream data, RichTextBoxStreamType fileType) => RichTextBox!.LoadFile(data, fileType);
///
/// Loads a specific type of file into the RichTextBox control.
///
/// The name and location of the file to load into the control.
/// One of the RichTextBoxStreamType values.
- public void LoadFile(string path, RichTextBoxStreamType fileType) => RichTextBox.LoadFile(path, fileType);
+ public void LoadFile(string path, RichTextBoxStreamType fileType) => RichTextBox!.LoadFile(path, fileType);
///
/// Replaces the current selection in the text box with the contents of the Clipboard.
///
- public void Paste() => RichTextBox.Paste();
+ public void Paste() => RichTextBox!.Paste();
///
/// Undoes the last edit operation in the text box.
///
- public void Undo() => RichTextBox.Undo();
+ public void Undo() => RichTextBox!.Undo();
///
/// Pastes the contents of the Clipboard in the specified Clipboard format.
///
/// The Clipboard format in which the data should be obtained from the Clipboard.
- public void Paste(DataFormats.Format clipFormat) => RichTextBox.Paste(clipFormat);
+ public void Paste(DataFormats.Format clipFormat) => RichTextBox!.Paste(clipFormat);
///
/// Reapplies the last operation that was undone in the control.
///
- public void Redo() => RichTextBox.Redo();
+ public void Redo() => RichTextBox!.Redo();
///
/// Saves the contents of the RichTextBox to a rich text format (RTF) file.
///
/// The name and location of the file to save.
- public void SaveFile(string path) => RichTextBox.SaveFile(path);
+ public void SaveFile(string path) => RichTextBox!.SaveFile(path);
///
/// Saves the contents of a RichTextBox control to an open data stream.
///
/// The data stream that contains the file to save to.
/// One of the RichTextBoxStreamType values.
- public void SaveFile(Stream data, RichTextBoxStreamType fileType) => RichTextBox.SaveFile(data, fileType);
+ public void SaveFile(Stream data, RichTextBoxStreamType fileType) => RichTextBox!.SaveFile(data, fileType);
///
/// Saves the contents of the KryptonRichTextBox to a specific type of file.
///
/// The name and location of the file to save.
/// One of the RichTextBoxStreamType values.
- public void SaveFile(string path, RichTextBoxStreamType fileType) => RichTextBox.SaveFile(path, fileType);
+ public void SaveFile(string path, RichTextBoxStreamType fileType) => RichTextBox!.SaveFile(path, fileType);
///
/// Scrolls the contents of the control to the current caret position.
///
- public void ScrollToCaret() => RichTextBox.ScrollToCaret();
+ public void ScrollToCaret() => RichTextBox!.ScrollToCaret();
///
/// Selects a range of text in the control.
///
/// The position of the first character in the current text selection within the text box.
/// The number of characters to select.
- public void Select(int start, int length) => RichTextBox.Select(start, length);
+ public void Select(int start, int length) => RichTextBox!.Select(start, length);
///
/// Selects all text in the control.
///
- public void SelectAll() => RichTextBox.SelectAll();
+ public void SelectAll() => RichTextBox!.SelectAll();
///
/// Gets and sets the maximum allowed size of the item.
@@ -1197,7 +1198,7 @@ public override ViewBase CreateView(KryptonRibbon ribbon,
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[EditorBrowsable(EditorBrowsableState.Never)]
[Browsable(false)]
- public ViewBase RichTextBoxView { get; set; }
+ public ViewBase? RichTextBoxView { get; set; }
#endregion
@@ -1364,49 +1365,57 @@ private void UnmonitorControl(KryptonRichTextBox c)
c.TrackMouseLeave -= OnControlLeave;
}
- private void OnControlEnter(object sender, EventArgs e) => MouseEnterControl?.Invoke(this, e);
+ private void OnControlEnter(object? sender, EventArgs e) => MouseEnterControl?.Invoke(this, e);
- private void OnControlLeave(object sender, EventArgs e) => MouseLeaveControl?.Invoke(this, e);
+ private void OnControlLeave(object? sender, EventArgs e) => MouseLeaveControl?.Invoke(this, e);
private void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e) =>
// Pass request onto the view provided paint delegate
ViewPaintDelegate?.Invoke(this, e);
- private void OnRichTextBoxAcceptsTabChanged(object sender, EventArgs e) => OnAcceptsTabChanged(e);
+ private void OnRichTextBoxAcceptsTabChanged(object? sender, EventArgs e) => OnAcceptsTabChanged(e);
- private void OnRichTextBoxTextChanged(object sender, EventArgs e) => OnTextChanged(e);
+ private void OnRichTextBoxTextChanged(object? sender, EventArgs e) => OnTextChanged(e);
- private void OnRichTextBoxHideSelectionChanged(object sender, EventArgs e) => OnHideSelectionChanged(e);
+ private void OnRichTextBoxHideSelectionChanged(object? sender, EventArgs e) => OnHideSelectionChanged(e);
- private void OnRichTextBoxModifiedChanged(object sender, EventArgs e) => OnModifiedChanged(e);
+ private void OnRichTextBoxModifiedChanged(object? sender, EventArgs e) => OnModifiedChanged(e);
- private void OnRichTextBoxMultilineChanged(object sender, EventArgs e) => OnMultilineChanged(e);
+ private void OnRichTextBoxMultilineChanged(object? sender, EventArgs e) => OnMultilineChanged(e);
- private void OnRichTextBoxReadOnlyChanged(object sender, EventArgs e) => OnReadOnlyChanged(e);
+ private void OnRichTextBoxReadOnlyChanged(object? sender, EventArgs e) => OnReadOnlyChanged(e);
- private void OnRichTextBoxGotFocus(object sender, EventArgs e) => OnGotFocus(e);
+ private void OnRichTextBoxGotFocus(object? sender, EventArgs e) => OnGotFocus(e);
- private void OnRichTextBoxLostFocus(object sender, EventArgs e) => OnLostFocus(e);
+ private void OnRichTextBoxLostFocus(object? sender, EventArgs e) => OnLostFocus(e);
- private void OnRichTextBoxKeyPress(object sender, KeyPressEventArgs e) => OnKeyPress(e);
+ private void OnRichTextBoxKeyPress(object? sender, KeyPressEventArgs e) => OnKeyPress(e);
- private void OnRichTextBoxKeyUp(object sender, KeyEventArgs e) => OnKeyUp(e);
+ private void OnRichTextBoxKeyUp(object? sender, KeyEventArgs e) => OnKeyUp(e);
- private void OnRichTextBoxKeyDown(object sender, KeyEventArgs e) => OnKeyDown(e);
+ private void OnRichTextBoxKeyDown(object? sender, KeyEventArgs e) => OnKeyDown(e);
- private void OnRichTextBoxPreviewKeyDown(object sender, PreviewKeyDownEventArgs e) => OnPreviewKeyDown(e);
+ private void OnRichTextBoxPreviewKeyDown(object? sender, PreviewKeyDownEventArgs e) => OnPreviewKeyDown(e);
- private void OnRichTextBoxVScroll(object sender, EventArgs e) => OnVScroll(e);
+ private void OnRichTextBoxVScroll(object? sender, EventArgs e) => OnVScroll(e);
- private void OnRichTextBoxHScroll(object sender, EventArgs e) => OnHScroll(e);
+ private void OnRichTextBoxHScroll(object? sender, EventArgs e) => OnHScroll(e);
- private void OnRichTextBoxSelectionChanged(object sender, EventArgs e) => OnSelectionChanged(e);
+ private void OnRichTextBoxSelectionChanged(object? sender, EventArgs e) => OnSelectionChanged(e);
- private void OnRichTextBoxProtected(object sender, EventArgs e) => OnProtected(e);
+ private void OnRichTextBoxProtected(object? sender, EventArgs e) => OnProtected(e);
- private void OnRichTextBoxLinkClicked(object sender, LinkClickedEventArgs e) => OnLinkClicked(e);
+ private void OnRichTextBoxLinkClicked(object? sender, LinkClickedEventArgs e) => OnLinkClicked(e);
+
+ private void OnRibbonPaletteChanged(object? sender, EventArgs e)
+ {
+ if (RichTextBox is not null && Ribbon is not null)
+ {
+ RichTextBox.PaletteMode = Ribbon.PaletteMode;
+ RichTextBox.LocalCustomPalette = Ribbon.LocalCustomPalette;
+ }
+ }
- private void OnRibbonPaletteChanged(object sender, EventArgs e) => RichTextBox.Palette = Ribbon.GetResolvedPalette();
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupSeparator.cs b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupSeparator.cs
index 47a900a3c..f943bf307 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupSeparator.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupSeparator.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -154,7 +154,7 @@ public override ViewBase CreateView(KryptonRibbon ribbon,
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[EditorBrowsable(EditorBrowsableState.Never)]
[Browsable(false)]
- public ViewBase SeparatorView { get; set; }
+ public ViewBase? SeparatorView { get; set; }
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupTextBox.cs b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupTextBox.cs
index 4277ab554..27c8dbd32 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupTextBox.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupTextBox.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -164,7 +164,7 @@ public KryptonRibbonGroupTextBox()
};
// Hook into events to expose via this container
- TextBox.AcceptsTabChanged += OnTextBoxAcceptsTabChanged;
+ TextBox!.AcceptsTabChanged += OnTextBoxAcceptsTabChanged;
TextBox.TextAlignChanged += OnTextBoxTextAlignChanged;
TextBox.TextChanged += OnTextBoxTextChanged;
TextBox.HideSelectionChanged += OnTextBoxHideSelectionChanged;
@@ -193,7 +193,7 @@ protected override void Dispose(bool disposing)
if (TextBox != null)
{
UnmonitorControl(TextBox);
- TextBox.Dispose();
+ TextBox!.Dispose();
TextBox = null;
}
}
@@ -219,7 +219,8 @@ public override KryptonRibbon? Ribbon
{
// Use the same palette in the text box as the ribbon, plus we need
// to know when the ribbon palette changes so we can reflect that change
- TextBox.Palette = Ribbon.GetResolvedPalette();
+ TextBox!.PaletteMode = Ribbon!.PaletteMode;
+ TextBox.LocalCustomPalette = Ribbon!.LocalCustomPalette;
Ribbon.PaletteChanged += OnRibbonPaletteChanged;
}
}
@@ -247,7 +248,7 @@ public override KryptonRibbon? Ribbon
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Always)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public KryptonTextBox TextBox { get; private set; }
+ public KryptonTextBox? TextBox { get; private set; }
///
/// Gets and sets the key tip for the ribbon group text box.
@@ -335,8 +336,8 @@ public bool Enabled
[DefaultValue(typeof(Size), "121, 0")]
public Size MinimumSize
{
- get => TextBox.MinimumSize;
- set => TextBox.MinimumSize = value;
+ get => TextBox!.MinimumSize;
+ set => TextBox!.MinimumSize = value;
}
///
@@ -347,8 +348,8 @@ public Size MinimumSize
[DefaultValue(typeof(Size), "121, 0")]
public Size MaximumSize
{
- get => TextBox.MaximumSize;
- set => TextBox.MaximumSize = value;
+ get => TextBox!.MaximumSize;
+ set => TextBox!.MaximumSize = value;
}
///
@@ -359,8 +360,8 @@ public Size MaximumSize
[Editor(typeof(MultilineStringEditor), typeof(UITypeEditor))]
public string Text
{
- get => TextBox.Text;
- set => TextBox.Text = value;
+ get => TextBox!.Text;
+ set => TextBox!.Text = value;
}
///
@@ -374,8 +375,8 @@ public string Text
[Localizable(true)]
public string[] Lines
{
- get => TextBox.Lines;
- set => TextBox.Lines = value;
+ get => TextBox!.Lines;
+ set => TextBox!.Lines = value;
}
///
@@ -387,8 +388,8 @@ public string[] Lines
[Localizable(true)]
public ScrollBars ScrollBars
{
- get => TextBox.ScrollBars;
- set => TextBox.ScrollBars = value;
+ get => TextBox!.ScrollBars;
+ set => TextBox!.ScrollBars = value;
}
///
@@ -400,8 +401,8 @@ public ScrollBars ScrollBars
[Localizable(true)]
public HorizontalAlignment TextAlign
{
- get => TextBox.TextAlign;
- set => TextBox.TextAlign = value;
+ get => TextBox!.TextAlign;
+ set => TextBox!.TextAlign = value;
}
///
@@ -412,8 +413,8 @@ public HorizontalAlignment TextAlign
[DefaultValue(null)]
public ContextMenuStrip? ContextMenuStrip
{
- get => TextBox.ContextMenuStrip;
- set => TextBox.ContextMenuStrip = value;
+ get => TextBox!.ContextMenuStrip;
+ set => TextBox!.ContextMenuStrip = value;
}
///
@@ -424,8 +425,8 @@ public ContextMenuStrip? ContextMenuStrip
[DefaultValue(null)]
public KryptonContextMenu? KryptonContextMenu
{
- get => TextBox.KryptonContextMenu;
- set => TextBox.KryptonContextMenu = value;
+ get => TextBox!.KryptonContextMenu;
+ set => TextBox!.KryptonContextMenu = value;
}
///
@@ -437,8 +438,8 @@ public KryptonContextMenu? KryptonContextMenu
[Localizable(true)]
public bool WordWrap
{
- get => TextBox.WordWrap;
- set => TextBox.WordWrap = value;
+ get => TextBox!.WordWrap;
+ set => TextBox!.WordWrap = value;
}
///
@@ -451,8 +452,8 @@ public bool WordWrap
[Localizable(true)]
public bool Multiline
{
- get => TextBox.Multiline;
- set => TextBox.Multiline = value;
+ get => TextBox!.Multiline;
+ set => TextBox!.Multiline = value;
}
///
@@ -463,8 +464,8 @@ public bool Multiline
[DefaultValue(false)]
public bool AcceptsReturn
{
- get => TextBox.AcceptsReturn;
- set => TextBox.AcceptsReturn = value;
+ get => TextBox!.AcceptsReturn;
+ set => TextBox!.AcceptsReturn = value;
}
///
@@ -475,8 +476,8 @@ public bool AcceptsReturn
[DefaultValue(false)]
public bool AcceptsTab
{
- get => TextBox.AcceptsTab;
- set => TextBox.AcceptsTab = value;
+ get => TextBox!.AcceptsTab;
+ set => TextBox!.AcceptsTab = value;
}
///
@@ -487,8 +488,8 @@ public bool AcceptsTab
[DefaultValue(typeof(CharacterCasing), "Normal")]
public CharacterCasing CharacterCasing
{
- get => TextBox.CharacterCasing;
- set => TextBox.CharacterCasing = value;
+ get => TextBox!.CharacterCasing;
+ set => TextBox!.CharacterCasing = value;
}
///
@@ -499,8 +500,8 @@ public CharacterCasing CharacterCasing
[DefaultValue(true)]
public bool HideSelection
{
- get => TextBox.HideSelection;
- set => TextBox.HideSelection = value;
+ get => TextBox!.HideSelection;
+ set => TextBox!.HideSelection = value;
}
///
@@ -512,8 +513,8 @@ public bool HideSelection
[Localizable(true)]
public int MaxLength
{
- get => TextBox.MaxLength;
- set => TextBox.MaxLength = value;
+ get => TextBox!.MaxLength;
+ set => TextBox!.MaxLength = value;
}
///
@@ -525,8 +526,8 @@ public int MaxLength
[DefaultValue(false)]
public bool ReadOnly
{
- get => TextBox.ReadOnly;
- set => TextBox.ReadOnly = value;
+ get => TextBox!.ReadOnly;
+ set => TextBox!.ReadOnly = value;
}
///
@@ -537,8 +538,8 @@ public bool ReadOnly
[DefaultValue(true)]
public bool ShortcutsEnabled
{
- get => TextBox.ShortcutsEnabled;
- set => TextBox.ShortcutsEnabled = value;
+ get => TextBox!.ShortcutsEnabled;
+ set => TextBox!.ShortcutsEnabled = value;
}
///
@@ -551,8 +552,8 @@ public bool ShortcutsEnabled
[Localizable(true)]
public char PasswordChar
{
- get => TextBox.PasswordChar;
- set => TextBox.PasswordChar = value;
+ get => TextBox!.PasswordChar;
+ set => TextBox!.PasswordChar = value;
}
///
@@ -564,8 +565,8 @@ public char PasswordChar
[DefaultValue(false)]
public bool UseSystemPasswordChar
{
- get => TextBox.UseSystemPasswordChar;
- set => TextBox.UseSystemPasswordChar = value;
+ get => TextBox!.UseSystemPasswordChar;
+ set => TextBox!.UseSystemPasswordChar = value;
}
///
@@ -579,21 +580,21 @@ public bool UseSystemPasswordChar
[Browsable(true)]
public AutoCompleteStringCollection AutoCompleteCustomSource
{
- get => TextBox.AutoCompleteCustomSource;
- set => TextBox.AutoCompleteCustomSource = value;
+ get => TextBox!.AutoCompleteCustomSource;
+ set => TextBox!.AutoCompleteCustomSource = value;
}
///
- /// Gets or sets the text completion behavior of the textbox.
+ /// Gets or sets the text completion behavior of the TextBox!.
///
- [Description(@"Indicates the text completion behavior of the textbox.")]
+ [Description(@"Indicates the text completion behavior of the TextBox.")]
[DefaultValue(typeof(AutoCompleteMode), "None")]
[EditorBrowsable(EditorBrowsableState.Always)]
[Browsable(true)]
public AutoCompleteMode AutoCompleteMode
{
- get => TextBox.AutoCompleteMode;
- set => TextBox.AutoCompleteMode = value;
+ get => TextBox!.AutoCompleteMode;
+ set => TextBox!.AutoCompleteMode = value;
}
///
@@ -605,14 +606,14 @@ public AutoCompleteMode AutoCompleteMode
[Browsable(true)]
public AutoCompleteSource AutoCompleteSource
{
- get => TextBox.AutoCompleteSource;
- set => TextBox.AutoCompleteSource = value;
+ get => TextBox!.AutoCompleteSource;
+ set => TextBox!.AutoCompleteSource = value;
}
///
/// Gets access to the Wrapped Controls Tooltips.
///
- public override ToolTipValues ToolTipValues => TextBox.ToolTipValues;
+ public override ToolTipValues ToolTipValues => TextBox!.ToolTipValues;
///
/// Gets and sets a value indicating if tooltips should be Displayed for button specs.
@@ -622,8 +623,8 @@ public AutoCompleteSource AutoCompleteSource
[DefaultValue(false)]
public bool AllowButtonSpecToolTips
{
- get => TextBox.AllowButtonSpecToolTips;
- set => TextBox.AllowButtonSpecToolTips = value;
+ get => TextBox!.AllowButtonSpecToolTips;
+ set => TextBox!.AllowButtonSpecToolTips = value;
}
///
@@ -634,8 +635,8 @@ public bool AllowButtonSpecToolTips
[DefaultValue(false)]
public bool AllowButtonSpecToolTipPriority
{
- get => TextBox.AllowButtonSpecToolTipPriority;
- set => TextBox.AllowButtonSpecToolTipPriority = value;
+ get => TextBox!.AllowButtonSpecToolTipPriority;
+ set => TextBox!.AllowButtonSpecToolTipPriority = value;
}
///
@@ -644,21 +645,21 @@ public bool AllowButtonSpecToolTipPriority
[Category(@"Visuals")]
[Description(@"Collection of button specifications.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public KryptonTextBox.TextBoxButtonSpecCollection ButtonSpecs => TextBox.ButtonSpecs;
+ public KryptonTextBox.TextBoxButtonSpecCollection ButtonSpecs => TextBox!.ButtonSpecs;
///
/// Gets a value indicating whether the user can undo the previous operation in a rich text box control.
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public bool CanUndo => TextBox.CanUndo;
+ public bool CanUndo => TextBox!.CanUndo;
///
/// Gets a value indicating whether the contents have changed since last last.
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public bool Modified => TextBox.Modified;
+ public bool Modified => TextBox!.Modified;
///
/// Gets and sets the selected text within the control.
@@ -667,8 +668,8 @@ public bool AllowButtonSpecToolTipPriority
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string SelectedText
{
- get => TextBox.SelectedText;
- set => TextBox.SelectedText = value;
+ get => TextBox!.SelectedText;
+ set => TextBox!.SelectedText = value;
}
///
@@ -678,8 +679,8 @@ public string SelectedText
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public int SelectionLength
{
- get => TextBox.SelectionLength;
- set => TextBox.SelectionLength = value;
+ get => TextBox!.SelectionLength;
+ set => TextBox!.SelectionLength = value;
}
///
@@ -689,8 +690,8 @@ public int SelectionLength
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public int SelectionStart
{
- get => TextBox.SelectionStart;
- set => TextBox.SelectionStart = value;
+ get => TextBox!.SelectionStart;
+ set => TextBox!.SelectionStart = value;
}
///
@@ -698,106 +699,106 @@ public int SelectionStart
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public int TextLength => TextBox.TextLength;
+ public int TextLength => TextBox!.TextLength;
///
/// Appends text to the current text of a rich text box.
///
/// The text to append to the current contents of the text box.
- public void AppendText(string text) => TextBox.AppendText(text);
+ public void AppendText(string text) => TextBox!.AppendText(text);
///
/// Clears all text from the text box control.
///
- public void Clear() => TextBox.Clear();
+ public void Clear() => TextBox!.Clear();
///
/// Clears information about the most recent operation from the undo buffer of the rich text box.
///
- public void ClearUndo() => TextBox.ClearUndo();
+ public void ClearUndo() => TextBox!.ClearUndo();
///
/// Copies the current selection in the text box to the Clipboard.
///
- public void Copy() => TextBox.Copy();
+ public void Copy() => TextBox!.Copy();
///
/// Moves the current selection in the text box to the Clipboard.
///
- public void Cut() => TextBox.Cut();
+ public void Cut() => TextBox!.Cut();
///
/// Replaces the current selection in the text box with the contents of the Clipboard.
///
- public void Paste() => TextBox.Paste();
+ public void Paste() => TextBox!.Paste();
///
/// Scrolls the contents of the control to the current caret position.
///
- public void ScrollToCaret() => TextBox.ScrollToCaret();
+ public void ScrollToCaret() => TextBox!.ScrollToCaret();
///
/// Selects a range of text in the control.
///
/// The position of the first character in the current text selection within the text box.
/// The number of characters to select.
- public void Select(int start, int length) => TextBox.Select(start, length);
+ public void Select(int start, int length) => TextBox!.Select(start, length);
///
/// Selects all text in the control.
///
- public void SelectAll() => TextBox.SelectAll();
+ public void SelectAll() => TextBox!.SelectAll();
///
/// Undoes the last edit operation in the text box.
///
- public void Undo() => TextBox.Undo();
+ public void Undo() => TextBox!.Undo();
///
/// Specifies that the value of the SelectionLength property is zero so that no characters are selected in the control.
///
- public void DeselectAll() => TextBox.DeselectAll();
+ public void DeselectAll() => TextBox!.DeselectAll();
///
/// Retrieves the character that is closest to the specified location within the control.
///
/// The location from which to seek the nearest character.
/// The character at the specified location.
- public int GetCharFromPosition(Point pt) => TextBox.GetCharFromPosition(pt);
+ public int GetCharFromPosition(Point pt) => TextBox!.GetCharFromPosition(pt);
///
/// Retrieves the index of the character nearest to the specified location.
///
/// The location to search.
/// The zero-based character index at the specified location.
- public int GetCharIndexFromPosition(Point pt) => TextBox.GetCharIndexFromPosition(pt);
+ public int GetCharIndexFromPosition(Point pt) => TextBox!.GetCharIndexFromPosition(pt);
///
/// Retrieves the index of the first character of a given line.
///
/// The line for which to get the index of its first character.
/// The zero-based character index in the specified line.
- public int GetFirstCharIndexFromLine(int lineNumber) => TextBox.GetFirstCharIndexFromLine(lineNumber);
+ public int GetFirstCharIndexFromLine(int lineNumber) => TextBox!.GetFirstCharIndexFromLine(lineNumber);
///
/// Retrieves the index of the first character of the current line.
///
/// The zero-based character index in the current line.
- public int GetFirstCharIndexOfCurrentLine() => TextBox.GetFirstCharIndexOfCurrentLine();
+ public int GetFirstCharIndexOfCurrentLine() => TextBox!.GetFirstCharIndexOfCurrentLine();
///
/// Retrieves the line number from the specified character position within the text of the RichTextBox control.
///
/// The character index position to search.
/// The zero-based line number in which the character index is located.
- public int GetLineFromCharIndex(int index) => TextBox.GetLineFromCharIndex(index);
+ public int GetLineFromCharIndex(int index) => TextBox!.GetLineFromCharIndex(index);
///
/// Retrieves the location within the control at the specified character index.
///
/// The index of the character for which to retrieve the location.
/// The location of the specified character.
- public Point GetPositionFromCharIndex(int index) => TextBox.GetPositionFromCharIndex(index);
+ public Point GetPositionFromCharIndex(int index) => TextBox!.GetPositionFromCharIndex(index);
///
/// Gets and sets the maximum allowed size of the item.
@@ -868,7 +869,7 @@ public override ViewBase CreateView(KryptonRibbon ribbon,
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[EditorBrowsable(EditorBrowsableState.Never)]
[Browsable(false)]
- public ViewBase TextBoxView { get; set; }
+ public ViewBase? TextBoxView { get; set; }
#endregion
@@ -1011,41 +1012,46 @@ private void UnmonitorControl(KryptonTextBox c)
c.TrackMouseLeave -= OnControlLeave;
}
- private void OnControlEnter(object sender, EventArgs e) => MouseEnterControl?.Invoke(this, e);
+ private void OnControlEnter(object? sender, EventArgs e) => MouseEnterControl?.Invoke(this, e);
- private void OnControlLeave(object sender, EventArgs e) => MouseLeaveControl?.Invoke(this, e);
+ private void OnControlLeave(object? sender, EventArgs e) => MouseLeaveControl?.Invoke(this, e);
private void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e) =>
// Pass request onto the view provided paint delegate
ViewPaintDelegate?.Invoke(this, e);
- private void OnTextBoxAcceptsTabChanged(object sender, EventArgs e) => OnAcceptsTabChanged(e);
+ private void OnTextBoxAcceptsTabChanged(object? sender, EventArgs e) => OnAcceptsTabChanged(e);
- private void OnTextBoxTextChanged(object sender, EventArgs e) => OnTextChanged(e);
+ private void OnTextBoxTextChanged(object? sender, EventArgs e) => OnTextChanged(e);
- private void OnTextBoxTextAlignChanged(object sender, EventArgs e) => OnTextAlignChanged(e);
+ private void OnTextBoxTextAlignChanged(object? sender, EventArgs e) => OnTextAlignChanged(e);
- private void OnTextBoxHideSelectionChanged(object sender, EventArgs e) => OnHideSelectionChanged(e);
+ private void OnTextBoxHideSelectionChanged(object? sender, EventArgs e) => OnHideSelectionChanged(e);
- private void OnTextBoxModifiedChanged(object sender, EventArgs e) => OnModifiedChanged(e);
+ private void OnTextBoxModifiedChanged(object? sender, EventArgs e) => OnModifiedChanged(e);
- private void OnTextBoxMultilineChanged(object sender, EventArgs e) => OnMultilineChanged(e);
+ private void OnTextBoxMultilineChanged(object? sender, EventArgs e) => OnMultilineChanged(e);
- private void OnTextBoxReadOnlyChanged(object sender, EventArgs e) => OnReadOnlyChanged(e);
+ private void OnTextBoxReadOnlyChanged(object? sender, EventArgs e) => OnReadOnlyChanged(e);
- private void OnTextBoxGotFocus(object sender, EventArgs e) => OnGotFocus(e);
+ private void OnTextBoxGotFocus(object? sender, EventArgs e) => OnGotFocus(e);
- private void OnTextBoxLostFocus(object sender, EventArgs e) => OnLostFocus(e);
+ private void OnTextBoxLostFocus(object? sender, EventArgs e) => OnLostFocus(e);
- private void OnTextBoxKeyPress(object sender, KeyPressEventArgs e) => OnKeyPress(e);
+ private void OnTextBoxKeyPress(object? sender, KeyPressEventArgs e) => OnKeyPress(e);
- private void OnTextBoxKeyUp(object sender, KeyEventArgs e) => OnKeyUp(e);
+ private void OnTextBoxKeyUp(object? sender, KeyEventArgs e) => OnKeyUp(e);
- private void OnTextBoxKeyDown(object sender, KeyEventArgs e) => OnKeyDown(e);
+ private void OnTextBoxKeyDown(object? sender, KeyEventArgs e) => OnKeyDown(e);
- private void OnTextBoxPreviewKeyDown(object sender, PreviewKeyDownEventArgs e) => OnPreviewKeyDown(e);
+ private void OnTextBoxPreviewKeyDown(object? sender, PreviewKeyDownEventArgs e) => OnPreviewKeyDown(e);
+
+ private void OnRibbonPaletteChanged(object? sender, EventArgs e)
+ {
+ TextBox!.PaletteMode = Ribbon!.PaletteMode;
+ TextBox.LocalCustomPalette = Ribbon.LocalCustomPalette;
+ }
- private void OnRibbonPaletteChanged(object sender, EventArgs e) => TextBox.Palette = Ribbon.GetResolvedPalette();
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupThemeComboBox.cs b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupThemeComboBox.cs
index d8a80ddce..542d8090a 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupThemeComboBox.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupThemeComboBox.cs
@@ -2,7 +2,7 @@
/*
*
* 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. 2023 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,119 +20,111 @@ namespace Krypton.Ribbon
[DesignTimeVisible(false)]
[DefaultEvent("SelectedTextChanged")]
[DefaultProperty(nameof(Text))]
- public class KryptonRibbonGroupThemeComboBox : KryptonRibbonGroupComboBox
+ public class KryptonRibbonGroupThemeComboBox : KryptonRibbonGroupComboBox, IKryptonThemeSelectorBase
{
+ // TODO: grouped Ribbon controls do expose designers, needs a closer look
+
#region Instance Fields
- private int _selectedIndex;
+ /// When we change the palette, Krypton Manager will notify us that there was a change. Since we are changing it that notification can be skipped.
+ private bool _isLocalUpdate = false;
+ /// Suppress code execution in the SelectedIndexChanged event handler, when a theme change via the KManager has been performed.
+ private bool _isExternalUpdate = false;
+ /// Backing var for the DefaultPalette property.
+ private PaletteMode _defaultPalette = PaletteMode.Global;
+ /// Local Krypton Manager instance.
+ private readonly KryptonManager _manager;
+ /// User defined palette.
+ private KryptonCustomPaletteBase? _kryptonCustomPalette = null;
+
+ #endregion
- private readonly int _defaultPaletteIndex = (int)PaletteMode.Microsoft365Blue;
+ #region Identity
- private PaletteMode _defaultPalette;
+ /// Initializes a new instance of the class.
+ public KryptonRibbonGroupThemeComboBox()
+ {
+ _manager = new KryptonManager();
+ DropDownStyle = ComboBoxStyle.DropDownList;
+ Items.Clear();
+ Items.AddRange(CommonHelperThemeSelectors.GetThemesArray());
+
+ // Sets the intial palette from either global or DefaultPalette property
+ SelectedIndex = CommonHelperThemeSelectors.GetInitialSelectedIndex(DefaultPalette, _manager, Items);
+
+ // React to theme changes from outside this control.
+ KryptonManager.GlobalPaletteChanged += KryptonManagerGlobalPaletteChanged;
+ }
#endregion
#region Public
- /// Gets or sets the default palette mode.
- /// The default palette mode.
+ ///
[Category(@"Visuals")]
- [Description(@"The default palette mode.")]
- [DefaultValue(PaletteMode.Microsoft365Blue)]
- public PaletteMode DefaultPalette
+ [Description(@"The custom assigned palette mode.")]
+ [DefaultValue(null)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
+ public KryptonCustomPaletteBase? KryptonCustomPalette
{
- get => _defaultPalette;
- set
- {
- _defaultPalette = value;
- UpdateDefaultPaletteIndex(value);
- }
+ get => _kryptonCustomPalette;
+ set => _kryptonCustomPalette = value;
}
- ///
- /// Gets and sets the ThemeSelectedIndex.
- ///
+ private void ResetKryptonCustomPalette() => _kryptonCustomPalette = null;
+ private bool ShouldSerializeKryptonCustomPalette() => _kryptonCustomPalette is not null;
+
+ ///
[Category(@"Visuals")]
- [Description(@"Theme Selected Index. (Default = `Office 365 - Blue`)")]
- [DefaultValue((int)PaletteMode.Microsoft365Blue)]
- public int ThemeSelectedIndex
+ [Description(@"The default palette mode.")]
+ [DefaultValue(PaletteMode.Global)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
+ public PaletteMode DefaultPalette
{
- get => _selectedIndex;
-
- private set => SelectedIndex = value;
+ get => _defaultPalette;
+ set => SelectedIndex = CommonHelperThemeSelectors.DefaultPaletteSetter(ref _defaultPalette, value, Items, SelectedIndex);
}
- private void ResetThemeSelectedIndex() => _selectedIndex = (int)PaletteMode.Microsoft365Blue;
+ private void ResetDefaultPalette() => DefaultPalette = PaletteMode.Global;
+ private bool ShouldSerializeDefaultPalette() => _defaultPalette != PaletteMode.Global;
- private bool ShouldSerializeThemeSelectedIndex() => _selectedIndex != (int)PaletteMode.Microsoft365Blue;
+ #endregion
+
+ #region Implementation
///
- /// Gets and sets the ThemeSelectedIndex.
+ /// This method will run when the KryptonManager.GlobalPaletteChanged event is fired.
+ /// It will synchronize the SelectedIndex with the newly assigned Global Palette.
///
- [Category(@"Visuals")]
- [Description(@"Custom Theme to use when `Custom` is selected")]
- [DefaultValue(null)]
- public KryptonCustomPaletteBase? KryptonCustomPalette { get; set; }
-
- [EditorBrowsable(EditorBrowsableState.Never)]
- public KryptonManager Manager
+ /// Object that initiated the call.
+ /// Eventargs object data (not used).
+ private void KryptonManagerGlobalPaletteChanged(object? sender, EventArgs e)
{
- get;
- } = new KryptonManager();
+ /*
+ * Only executes when fully initialized.
+ * OnHandleCreated could not be used here since this control derives from Component.
+ */
- #endregion
-
- #region Identity
-
- /// Initializes a new instance of the class.
- public KryptonRibbonGroupThemeComboBox()
- {
- DropDownStyle = ComboBoxStyle.DropDownList;
- DisplayMember = "Key";
- ValueMember = "Value";
- foreach (var kvp in PaletteModeStrings.SupportedThemesMap)
+ if (ComboBox is not null)
{
- Items.Add(kvp);
+ SelectedIndex = CommonHelperThemeSelectors.KryptonManagerGlobalPaletteChanged(_isLocalUpdate, ref _isExternalUpdate, SelectedIndex, Items);
}
- var cnvtr = new PaletteModeConverter();
- Text = cnvtr.ConvertToString(PaletteMode.Microsoft365Blue)!;
-
- _selectedIndex = SelectedIndex = _defaultPaletteIndex;
- _defaultPalette = PaletteMode.Microsoft365Blue;
- Debug.Assert(_selectedIndex == _defaultPaletteIndex, $@"Microsoft365Blue needs to be at the index position of {_defaultPaletteIndex} for backward compatibility");
}
#endregion
- #region Implementation
-
- private void UpdateDefaultPaletteIndex(PaletteMode mode) => _selectedIndex = (int)mode;
-
- /// Returns the palette mode.
- ///
- ///
- ///
- public PaletteMode ReturnPaletteMode() => Manager.GlobalPaletteMode;
-
- #endregion
-
#region Protected Overrides
-
///
protected override void OnSelectedIndexChanged(EventArgs e)
{
- RibbonThemeManager.ApplyTheme(Text, Manager);
-
- ThemeSelectedIndex = SelectedIndex;
-
- base.OnSelectedIndexChanged(e);
- if ((RibbonThemeManager.GetThemeManagerMode(Text) == PaletteMode.Custom) && (KryptonCustomPalette != null))
+ if (!CommonHelperThemeSelectors.OnSelectedIndexChanged(ref _isLocalUpdate, _isExternalUpdate, ref _defaultPalette, Text, _manager, _kryptonCustomPalette))
{
- Manager.GlobalPalette = KryptonCustomPalette;
+ //theme change went wrong, make the active theme the selected theme in the list.
+ SelectedIndex = CommonHelperThemeSelectors.GetPaletteIndex(Items, _manager.GlobalPaletteMode);
}
- }
-
+ base.OnSelectedIndexChanged(e);
+ }
#endregion
#region Removed Designer
@@ -140,17 +132,25 @@ protected override void OnSelectedIndexChanged(EventArgs e)
/// Gets and sets the text associated with the control.
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- [AllowNull]
- public new string Text
+ public override string Text
{
get => base.Text;
set => base.Text = value;
}
+ /// Gets or sets the format specifier characters that indicate how a value is to be Displayed.
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public override string FormatString
+ {
+ get => base.FormatString;
+ set => base.FormatString = value;
+ }
+
/// Gets and sets the appearance and functionality of the KryptonComboBox.
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new ComboBoxStyle DropDownStyle
+ public override ComboBoxStyle DropDownStyle
{
get => base.DropDownStyle;
set => base.DropDownStyle = value;
@@ -159,12 +159,12 @@ protected override void OnSelectedIndexChanged(EventArgs e)
/// Gets or sets the items in the KryptonComboBox.
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new ComboBox.ObjectCollection Items => base.Items;
+ public override ComboBox.ObjectCollection Items => base.Items;
/// Gets or sets the StringCollection to use when the AutoCompleteSource property is set to CustomSource.
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new AutoCompleteStringCollection AutoCompleteCustomSource
+ public override AutoCompleteStringCollection AutoCompleteCustomSource
{
get => base.AutoCompleteCustomSource;
set => base.AutoCompleteCustomSource = value;
@@ -173,7 +173,7 @@ protected override void OnSelectedIndexChanged(EventArgs e)
/// Gets or sets the text completion behavior of the combobox.
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new AutoCompleteMode AutoCompleteMode
+ public override AutoCompleteMode AutoCompleteMode
{
get => base.AutoCompleteMode;
set => base.AutoCompleteMode = value;
@@ -182,12 +182,11 @@ protected override void OnSelectedIndexChanged(EventArgs e)
/// Gets or sets the autocomplete source, which can be one of the values from AutoCompleteSource enumeration.
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new AutoCompleteSource AutoCompleteSource
+ public override AutoCompleteSource AutoCompleteSource
{
get => base.AutoCompleteSource;
set => base.AutoCompleteSource = value;
}
-
#endregion
}
}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupTrackBar.cs b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupTrackBar.cs
index 3e8dd55ad..a696949a7 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupTrackBar.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupTrackBar.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -144,7 +144,8 @@ public override KryptonRibbon? Ribbon
{
// Use the same palette in the track bar as the ribbon, plus we need
// to know when the ribbon palette changes so we can reflect that change
- TrackBar.Palette = Ribbon.GetResolvedPalette();
+ TrackBar!.PaletteMode = Ribbon!.PaletteMode;
+ TrackBar.LocalCustomPalette = Ribbon!.LocalCustomPalette;
Ribbon.PaletteChanged += OnRibbonPaletteChanged;
}
}
@@ -157,12 +158,12 @@ public override KryptonRibbon? Ribbon
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Always)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public KryptonTrackBar TrackBar { get; private set; }
+ public KryptonTrackBar? TrackBar { get; private set; }
///
/// Gets access to the Wrapped Controls Tooltips.
///
- public override ToolTipValues ToolTipValues => TrackBar.ToolTipValues;
+ public override ToolTipValues ToolTipValues => TrackBar?.ToolTipValues!;
///
/// Gets and sets the key tip for the ribbon group track bar.
@@ -255,7 +256,7 @@ public int MinimumLength
set
{
_minimumLength = value;
- TrackBar.MinimumSize = Orientation == Orientation.Horizontal
+ TrackBar!.MinimumSize = Orientation == Orientation.Horizontal
? new Size(_minimumLength, 0)
: new Size(0, _minimumLength);
}
@@ -274,7 +275,7 @@ public int MaximumLength
set
{
_maximumLength = value;
- TrackBar.MaximumSize = Orientation == Orientation.Horizontal
+ TrackBar!.MaximumSize = Orientation == Orientation.Horizontal
? new Size(_maximumLength, 0)
: new Size(0, _maximumLength);
}
@@ -288,8 +289,8 @@ public int MaximumLength
[DefaultValue(null)]
public ContextMenuStrip? ContextMenuStrip
{
- get => TrackBar.ContextMenuStrip;
- set => TrackBar.ContextMenuStrip = value;
+ get => TrackBar?.ContextMenuStrip;
+ set => TrackBar!.ContextMenuStrip = value;
}
///
@@ -300,8 +301,8 @@ public ContextMenuStrip? ContextMenuStrip
[DefaultValue(null)]
public KryptonContextMenu? KryptonContextMenu
{
- get => TrackBar.KryptonContextMenu;
- set => TrackBar.KryptonContextMenu = value;
+ get => TrackBar?.KryptonContextMenu;
+ set => TrackBar!.KryptonContextMenu = value;
}
///
@@ -312,8 +313,8 @@ public KryptonContextMenu? KryptonContextMenu
[DefaultValue(typeof(PaletteTrackBarSize), "Medium")]
public PaletteTrackBarSize TrackBarSize
{
- get => TrackBar.TrackBarSize;
- set => TrackBar.TrackBarSize = value;
+ get => TrackBar!.TrackBarSize;
+ set => TrackBar!.TrackBarSize = value;
}
///
@@ -325,8 +326,8 @@ public PaletteTrackBarSize TrackBarSize
[RefreshProperties(RefreshProperties.All)]
public TickStyle TickStyle
{
- get => TrackBar.TickStyle;
- set => TrackBar.TickStyle = value;
+ get => TrackBar!.TickStyle;
+ set => TrackBar!.TickStyle = value;
}
///
@@ -337,8 +338,8 @@ public TickStyle TickStyle
[DefaultValue(1)]
public int TickFrequency
{
- get => TrackBar.TickFrequency;
- set => TrackBar.TickFrequency = value;
+ get => TrackBar!.TickFrequency;
+ set => TrackBar!.TickFrequency = value;
}
///
@@ -349,8 +350,8 @@ public int TickFrequency
[DefaultValue(false)]
public bool VolumeControl
{
- get => TrackBar.VolumeControl;
- set => TrackBar.VolumeControl = value;
+ get => TrackBar!.VolumeControl;
+ set => TrackBar!.VolumeControl = value;
}
///
@@ -362,11 +363,11 @@ public bool VolumeControl
[RefreshProperties(RefreshProperties.All)]
public Orientation Orientation
{
- get => TrackBar.Orientation;
+ get => TrackBar!.Orientation;
set
{
- if (value != TrackBar.Orientation)
+ if (value != TrackBar!.Orientation)
{
TrackBar.Orientation = value;
@@ -393,8 +394,8 @@ public Orientation Orientation
[DefaultValue(10)]
public int Maximum
{
- get => TrackBar.Maximum;
- set => TrackBar.Maximum = value;
+ get => TrackBar!.Maximum;
+ set => TrackBar!.Maximum = value;
}
///
@@ -406,8 +407,8 @@ public int Maximum
[DefaultValue(0)]
public int Minimum
{
- get => TrackBar.Minimum;
- set => TrackBar.Minimum = value;
+ get => TrackBar!.Minimum;
+ set => TrackBar!.Minimum = value;
}
///
@@ -418,8 +419,8 @@ public int Minimum
[DefaultValue(0)]
public int Value
{
- get => TrackBar.Value;
- set => TrackBar.Value = value;
+ get => TrackBar!.Value;
+ set => TrackBar!.Value = value;
}
///
@@ -431,8 +432,8 @@ public int Value
[DisallowNull]
public int SmallChange
{
- get => TrackBar.SmallChange;
- set => TrackBar.SmallChange = value;
+ get => TrackBar!.SmallChange;
+ set => TrackBar!.SmallChange = value;
}
///
@@ -444,8 +445,8 @@ public int SmallChange
[DisallowNull]
public int LargeChange
{
- get => TrackBar.LargeChange;
- set => TrackBar.LargeChange = value;
+ get => TrackBar!.LargeChange;
+ set => TrackBar!.LargeChange = value;
}
///
@@ -453,7 +454,7 @@ public int LargeChange
///
/// The lower limit of the range of the track bar.
/// The upper limit of the range of the track bar.
- public void SetRange(int minValue, int maxValue) => TrackBar.SetRange(minValue, maxValue);
+ public void SetRange(int minValue, int maxValue) => TrackBar?.SetRange(minValue, maxValue);
///
/// Gets and sets the maximum allowed size of the item.
@@ -524,7 +525,7 @@ public override ViewBase CreateView(KryptonRibbon ribbon,
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[EditorBrowsable(EditorBrowsableState.Never)]
[Browsable(false)]
- public ViewBase TrackBarView { get; set; }
+ public ViewBase? TrackBarView { get; set; }
#endregion
@@ -549,7 +550,7 @@ public override ViewBase CreateView(KryptonRibbon ribbon,
#endregion
#region Internal
- internal Control LastParentControl { get; set; }
+ internal Control? LastParentControl { get; set; }
internal KryptonTrackBar? LastTrackBar { get; set; }
@@ -562,33 +563,38 @@ public override ViewBase CreateView(KryptonRibbon ribbon,
#endregion
#region Implementation
- private void MonitorControl(KryptonTrackBar c)
+ private void MonitorControl(KryptonTrackBar? c)
{
- c.MouseEnter += OnControlEnter;
+ c!.MouseEnter += OnControlEnter;
c.MouseLeave += OnControlLeave;
}
- private void UnmonitorControl(KryptonTrackBar c)
+ private void UnmonitorControl(KryptonTrackBar? c)
{
- c.MouseEnter -= OnControlEnter;
+ c!.MouseEnter -= OnControlEnter;
c.MouseLeave -= OnControlLeave;
}
- private void OnControlEnter(object sender, EventArgs e) => MouseEnterControl?.Invoke(this, e);
+ private void OnControlEnter(object? sender, EventArgs e) => MouseEnterControl?.Invoke(this, e);
- private void OnControlLeave(object sender, EventArgs e) => MouseLeaveControl?.Invoke(this, e);
+ private void OnControlLeave(object? sender, EventArgs e) => MouseLeaveControl?.Invoke(this, e);
private void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e) =>
// Pass request onto the view provided paint delegate
ViewPaintDelegate?.Invoke(this, e);
- private void OnTrackBarGotFocus(object sender, EventArgs e) => OnGotFocus(e);
+ private void OnTrackBarGotFocus(object? sender, EventArgs e) => OnGotFocus(e);
- private void OnTrackBarLostFocus(object sender, EventArgs e) => OnLostFocus(e);
+ private void OnTrackBarLostFocus(object? sender, EventArgs e) => OnLostFocus(e);
- private void OnTrackBarValueChanged(object sender, EventArgs e) => ValueChanged?.Invoke(this, e);
+ private void OnTrackBarValueChanged(object? sender, EventArgs e) => ValueChanged?.Invoke(this, e);
+
+ private void OnRibbonPaletteChanged(object? sender, EventArgs e)
+ {
+ TrackBar!.PaletteMode = Ribbon!.PaletteMode;
+ TrackBar.LocalCustomPalette = Ribbon!.LocalCustomPalette;
+ }
- private void OnRibbonPaletteChanged(object sender, EventArgs e) => TrackBar.Palette = Ribbon.GetResolvedPalette();
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupTriple.cs b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupTriple.cs
index 536b84b32..f34eb16f5 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupTriple.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupTriple.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -167,7 +167,7 @@ public KryptonRibbonGroupTriple()
_itemAlignment = RibbonItemAlignment.Near;
// Create collection for holding triple items
- Items = new KryptonRibbonGroupTripleCollection();
+ Items = [];
Items.Clearing += OnRibbonGroupTripleClearing;
Items.Cleared += OnRibbonGroupTripleCleared;
Items.Inserted += OnRibbonGroupTripleInserted;
@@ -183,7 +183,7 @@ protected override void Dispose(bool disposing)
if (disposing)
{
// Dispose of per-item resources
- foreach (KryptonRibbonGroupItem item in Items)
+ foreach (var item in Items!)
{
item.Dispose();
}
@@ -209,8 +209,8 @@ public override KryptonRibbon? Ribbon
base.Ribbon = value;
// Forward the reference to all children (just in case the children
- // are added before the this object is added to the owner)
- foreach (KryptonRibbonGroupItem item in Items)
+ // are added before this object is added to the owner)
+ foreach (var item in Items!)
{
item.Ribbon = value;
}
@@ -232,8 +232,8 @@ public override KryptonRibbonTab? RibbonTab
base.RibbonTab = value;
// Forward the reference to all children (just in case the children
- // are added before the this object is added to the owner)
- foreach (KryptonRibbonGroupItem item in Items)
+ // are added before this object is added to the owner)
+ foreach (var item in Items!)
{
item.RibbonTab = value;
}
@@ -357,7 +357,7 @@ public override GroupItemSize ItemSizeMaximum
}
// Update all contained elements to reflect the same sizing
- foreach (IRibbonGroupItem item in Items)
+ foreach (IRibbonGroupItem item in Items!)
{
item.ItemSizeMaximum = value;
}
@@ -398,7 +398,7 @@ public override GroupItemSize ItemSizeMinimum
}
// Update all contained elements to reflect the same sizing
- foreach (IRibbonGroupItem item in Items)
+ foreach (IRibbonGroupItem item in Items!)
{
item.ItemSizeMinimum = value;
}
@@ -425,7 +425,7 @@ public override GroupItemSize ItemSizeCurrent
_itemSizeCurrent = value;
// Update all contained elements to reflect the same sizing
- foreach (IRibbonGroupItem item in Items)
+ foreach (IRibbonGroupItem item in Items!)
{
item.ItemSizeCurrent = value;
}
@@ -462,7 +462,7 @@ public override ViewBase CreateView(KryptonRibbon ribbon,
[MergableProperty(false)]
[Editor(typeof(KryptonRibbonGroupTripleCollectionEditor), typeof(UITypeEditor))]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public KryptonRibbonGroupTripleCollection Items { get; }
+ public KryptonRibbonGroupTripleCollection? Items { get; }
///
/// Gets an array of all the contained components.
@@ -470,7 +470,7 @@ public override ViewBase CreateView(KryptonRibbon ribbon,
/// Array of child components.
public override Component[] GetChildComponents()
{
- var array = new Component[Items.Count];
+ var array = new Component[Items!.Count];
Items.CopyTo(array, 0);
return array;
}
@@ -529,7 +529,7 @@ public override Component[] GetChildComponents()
internal override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
// Ask the containers to check for command key processing
- foreach (KryptonRibbonGroupItem item in Items)
+ foreach (var item in Items!)
{
if (item.ProcessCmdKey(ref msg, keyData))
{
@@ -542,10 +542,10 @@ internal override bool ProcessCmdKey(ref Message msg, Keys keyData)
#endregion
#region Private
- private void OnRibbonGroupTripleClearing(object sender, EventArgs e)
+ private void OnRibbonGroupTripleClearing(object? sender, EventArgs e)
{
// Remove the back references
- foreach (IRibbonGroupItem item in Items)
+ foreach (IRibbonGroupItem item in Items!)
{
item.Ribbon = null;
item.RibbonTab = null;
@@ -553,7 +553,7 @@ private void OnRibbonGroupTripleClearing(object sender, EventArgs e)
}
}
- private void OnRibbonGroupTripleCleared(object sender, EventArgs e)
+ private void OnRibbonGroupTripleCleared(object? sender, EventArgs e)
{
// Only need to update display if this tab is selected
if ((Ribbon != null)
@@ -568,7 +568,7 @@ private void OnRibbonGroupTripleCleared(object sender, EventArgs e)
private void OnRibbonGroupTripleInserted(object sender, TypedCollectionEventArgs e)
{
// Setup the back references
- e.Item.Ribbon = Ribbon;
+ e.Item!.Ribbon = Ribbon;
e.Item.RibbonTab = RibbonTab;
e.Item.RibbonContainer = this;
@@ -590,7 +590,7 @@ private void OnRibbonGroupTripleInserted(object sender, TypedCollectionEventArgs
private void OnRibbonGroupTripleRemoved(object sender, TypedCollectionEventArgs e)
{
// Remove the back references
- e.Item.Ribbon = null;
+ e.Item!.Ribbon = null;
e.Item.RibbonTab = null;
e.Item.RibbonContainer = null;
diff --git a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupTripleCollection.cs b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupTripleCollection.cs
index 046c4d398..5c72f48b6 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupTripleCollection.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Group Contents/KryptonRibbonGroupTripleCollection.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -20,7 +20,9 @@ namespace Krypton.Ribbon
public class KryptonRibbonGroupTripleCollection : TypedRestrictCollection
{
#region Static Fields
- private static readonly Type[] _types = { typeof(KryptonRibbonGroupButton),
+ private static readonly Type[] _types =
+ [
+ typeof(KryptonRibbonGroupButton),
typeof(KryptonRibbonGroupColorButton),
typeof(KryptonRibbonGroupCheckBox),
typeof(KryptonRibbonGroupComboBox),
@@ -34,7 +36,7 @@ public class KryptonRibbonGroupTripleCollection : TypedRestrictCollection
/// Object reference.
/// The position into which the new item was inserted.
- public override int Add(object value)
+ public override int Add(object? value)
{
// Restrict contents to three items max
if (Count == 3)
@@ -67,7 +69,7 @@ public override int Add(object value)
///
/// Insert index.
/// Object reference.
- public override void Insert(int index, object value)
+ public override void Insert(int index, object? value)
{
// Restrict contents to three items max
if (Count == 3)
@@ -85,7 +87,7 @@ public override void Insert(int index, object value)
///
/// Insert index.
/// Item reference.
- public override void Insert(int index, KryptonRibbonGroupItem item)
+ public override void Insert(int index, KryptonRibbonGroupItem? item)
{
// Restrict contents to three items max
if (Count == 3)
@@ -102,7 +104,7 @@ public override void Insert(int index, KryptonRibbonGroupItem item)
/// Append an item to the collection.
///
/// Item reference.
- public override void Add(KryptonRibbonGroupItem item)
+ public override void Add(KryptonRibbonGroupItem? item)
{
// Restrict contents to three items max
if (Count == 3)
diff --git a/Source/Krypton Components/Krypton.Ribbon/Krypton.Ribbon 2022.csproj b/Source/Krypton Components/Krypton.Ribbon/Krypton.Ribbon 2022.csproj
index d149b8320..08c990e1b 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Krypton.Ribbon 2022.csproj
+++ b/Source/Krypton Components/Krypton.Ribbon/Krypton.Ribbon 2022.csproj
@@ -1,26 +1,17 @@

-
+
- net462;net47;net471;net472;net48;net481;net6.0-windows;net7.0-windows;net8.0-windows
+ net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows
-
-
-
- net462;net47;net471;net472;net48;net481;net6.0-windows;net7.0-windows;net8.0-windows
-
-
-
-
- net48;net481;net6.0-windows;net7.0-windows
+
+ net48;net481;net8.0-windows;net9.0-windows
- net462;net47;net471;net472;net48;net481;net6.0-windows;net7.0-windows;net8.0-windows
-
-
-
+ net462;net47;net471;net472;net48;net481;net8.0-windows
+
@@ -40,10 +31,13 @@
en
true
Debug;Release;Installer;Nightly;Canary
- preview
enable
- 6
+
+ 8
+ latest
true
+
+ true
@@ -51,6 +45,12 @@
This is the ribbon module.
+
+
+
+
+
+
True
@@ -126,7 +126,7 @@
- ..\..\..\Bin\$(Configuration)\Krypton.Ribbon.xml
+ true
..\..\..\Bin\$(Configuration)\
diff --git a/Source/Krypton Components/Krypton.Ribbon/Krypton.Ribbon.licenseheader b/Source/Krypton Components/Krypton.Ribbon/Krypton.Ribbon.licenseheader
index c733ea0c8..1c668a35f 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Krypton.Ribbon.licenseheader
+++ b/Source/Krypton Components/Krypton.Ribbon/Krypton.Ribbon.licenseheader
@@ -6,9 +6,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
- * Modified: Monday 12th April, 2021 @ 18:00 GMT
- *
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/AppButtonToolTipToContent.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/AppButtonToolTipToContent.cs
index 55c57a18b..4c6bf3fb1 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/AppButtonToolTipToContent.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/AppButtonToolTipToContent.cs
@@ -1,14 +1,10 @@
#region BSD License
/*
- *
* Original BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE)
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
- *
- * Modified: Monday 12th April, 2021 @ 18:00 GMT
- *
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*/
#endregion
@@ -31,7 +27,7 @@ internal class AppButtonToolTipToContent : IContentValues
public AppButtonToolTipToContent([DisallowNull] KryptonRibbon ribbon)
{
Debug.Assert(ribbon != null);
- _ribbon = ribbon;
+ _ribbon = ribbon!;
}
#endregion
@@ -51,26 +47,26 @@ public AppButtonToolTipToContent([DisallowNull] KryptonRibbon ribbon)
///
/// The state for which the image is needed.
/// Image value.
- public Image? GetImage(PaletteState state) => _ribbon.RibbonAppButton.AppButtonToolTipImage;
+ public Image? GetImage(PaletteState state) => _ribbon.RibbonFileAppButton.AppButtonToolTipImage;
///
/// Gets the image color that should be transparent.
///
/// The state for which the image is needed.
/// Color value.
- public Color GetImageTransparentColor(PaletteState state) => _ribbon.RibbonAppButton.AppButtonToolTipImageTransparentColor;
+ public Color GetImageTransparentColor(PaletteState state) => _ribbon.RibbonFileAppButton.AppButtonToolTipImageTransparentColor;
///
/// Gets the content short text.
///
/// String value.
- public string GetShortText() => _ribbon.RibbonAppButton.AppButtonToolTipTitle;
+ public string GetShortText() => _ribbon.RibbonFileAppButton.AppButtonToolTipTitle;
///
/// Gets the content long text.
///
/// String value.
- public string GetLongText() => _ribbon.RibbonAppButton.AppButtonToolTipBody;
+ public string GetLongText() => _ribbon.RibbonFileAppButton.AppButtonToolTipBody;
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/ContextTabSet.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/ContextTabSet.cs
index 72e5f9c54..2159439f6 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/ContextTabSet.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/ContextTabSet.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -31,15 +31,16 @@ internal class ContextTabSet
///
/// Reference to first tab of the set.
/// Reference to owning context details.
- public ContextTabSet([DisallowNull] ViewDrawRibbonTab tab,
- [DisallowNull] KryptonRibbonContext context)
+ public ContextTabSet([DisallowNull] ViewDrawRibbonTab? tab,
+ [DisallowNull] KryptonRibbonContext? context)
{
- Debug.Assert(tab != null);
- Debug.Assert(context != null);
+ Debug.Assert(tab is not null);
+ Debug.Assert(context is not null);
- FirstTab = tab;
+ FirstTab = tab ?? throw new ArgumentNullException(nameof(tab));
_lastTab = tab;
- Context = context;
+
+ Context = context ?? throw new ArgumentNullException(nameof(context));
}
#endregion
@@ -76,8 +77,8 @@ public ContextTabSet([DisallowNull] ViewDrawRibbonTab tab,
/// Reference to new last tab.
public void UpdateLastTab([DisallowNull] ViewDrawRibbonTab tab)
{
- Debug.Assert(tab != null);
- _lastTab = tab;
+ Debug.Assert(tab is not null);
+ _lastTab = tab ?? throw new ArgumentNullException(nameof(tab));
}
///
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/ContextToContent.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/ContextToContent.cs
index 662c13d7d..c6a0df2b9 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/ContextToContent.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/ContextToContent.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/DesignTextToContent.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/DesignTextToContent.cs
index 0f17a075c..bdcca3a49 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/DesignTextToContent.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/DesignTextToContent.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -17,7 +17,7 @@ namespace Krypton.Ribbon
internal class DesignTextToContent : RibbonToContent
{
#region Instance Fields
- private readonly KryptonRibbon _ribbon;
+ private readonly KryptonRibbon? _ribbon;
#endregion
#region Identity
@@ -25,11 +25,12 @@ internal class DesignTextToContent : RibbonToContent
/// Initialize a new instance of the DesignTextToContent class.
///
/// Reference to the owning ribbon control.
- public DesignTextToContent([DisallowNull] KryptonRibbon ribbon)
+ public DesignTextToContent([DisallowNull] KryptonRibbon? ribbon)
: base(ribbon.StateCommon.RibbonGeneral)
{
- Debug.Assert(ribbon != null);
- _ribbon = ribbon;
+ Debug.Assert(ribbon is not null);
+
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
}
#endregion
@@ -54,8 +55,8 @@ public DesignTextToContent([DisallowNull] KryptonRibbon ribbon)
/// Palette value should be applicable to this state.
/// Color value.
public override Color GetContentShortTextColor1(PaletteState state) => state == PaletteState.Normal
- ? _ribbon.StateCommon.RibbonGeneral.GetRibbonGroupSeparatorLight(state)
- : _ribbon.StateCommon.RibbonGroupButton.Content.GetContentShortTextColor1(state);
+ ? _ribbon!.StateCommon.RibbonGeneral.GetRibbonGroupSeparatorLight(state)
+ : _ribbon!.StateCommon.RibbonGroupButton.Content.GetContentShortTextColor1(state);
///
/// Gets the second back color for the short text.
@@ -63,8 +64,8 @@ public override Color GetContentShortTextColor1(PaletteState state) => state ==
/// Palette value should be applicable to this state.
/// Color value.
public override Color GetContentShortTextColor2(PaletteState state) => state == PaletteState.Normal
- ? _ribbon.StateCommon.RibbonGeneral.GetRibbonGroupSeparatorLight(state)
- : _ribbon.StateCommon.RibbonGroupButton.Content.GetContentShortTextColor1(state);
+ ? _ribbon!.StateCommon.RibbonGeneral.GetRibbonGroupSeparatorLight(state)
+ : _ribbon!.StateCommon.RibbonGroupButton.Content.GetContentShortTextColor1(state);
///
/// Gets the text trimming to use for long text.
@@ -79,8 +80,8 @@ public override Color GetContentShortTextColor2(PaletteState state) => state ==
/// Palette value should be applicable to this state.
/// Color value.
public override Color GetContentLongTextColor1(PaletteState state) => state == PaletteState.Normal
- ? _ribbon.StateCommon.RibbonGeneral.GetRibbonGroupSeparatorLight(state)
- : _ribbon.StateCommon.RibbonGroupButton.Content.GetContentShortTextColor1(state);
+ ? _ribbon!.StateCommon.RibbonGeneral.GetRibbonGroupSeparatorLight(state)
+ : _ribbon!.StateCommon.RibbonGroupButton.Content.GetContentShortTextColor1(state);
///
/// Gets the second back color for the long text.
@@ -88,8 +89,8 @@ public override Color GetContentLongTextColor1(PaletteState state) => state == P
/// Palette value should be applicable to this state.
/// Color value.
public override Color GetContentLongTextColor2(PaletteState state) => state == PaletteState.Normal
- ? _ribbon.StateCommon.RibbonGeneral.GetRibbonGroupSeparatorLight(state)
- : _ribbon.StateCommon.RibbonGroupButton.Content.GetContentShortTextColor1(state);
+ ? _ribbon!.StateCommon.RibbonGeneral.GetRibbonGroupSeparatorLight(state)
+ : _ribbon!.StateCommon.RibbonGroupButton.Content.GetContentShortTextColor1(state);
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/ApplicationTabToContent.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/FileApplicationTabToContent.cs
similarity index 63%
rename from Source/Krypton Components/Krypton.Ribbon/Palette/ApplicationTabToContent.cs
rename to Source/Krypton Components/Krypton.Ribbon/Palette/FileApplicationTabToContent.cs
index 9c8752e1e..ae76535c0 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/ApplicationTabToContent.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/FileApplicationTabToContent.cs
@@ -1,20 +1,16 @@
#region BSD License
/*
- *
* Original BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE)
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
- *
- * Modified: Monday 12th April, 2021 @ 18:00 GMT
- *
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*/
#endregion
namespace Krypton.Ribbon
{
- internal class ApplicationTabToContent : RibbonToContent
+ internal class FileApplicationTabToContent : RibbonToContent
{
#region Instance Fields
private readonly KryptonRibbon _ribbon;
@@ -26,7 +22,7 @@ internal class ApplicationTabToContent : RibbonToContent
///
/// Reference to owning ribbon control..
/// Source for general ribbon settings.
- public ApplicationTabToContent(KryptonRibbon ribbon,
+ public FileApplicationTabToContent(KryptonRibbon ribbon,
PaletteRibbonGeneral ribbonGeneral)
: base(ribbonGeneral) =>
_ribbon = ribbon;
@@ -39,28 +35,49 @@ public ApplicationTabToContent(KryptonRibbon ribbon,
///
/// Palette value should be applicable to this state.
/// Color value.
- public override Color GetContentShortTextColor1(PaletteState state) => _ribbon.RibbonAppButton.AppButtonTextColor;
+ public override Color GetContentShortTextColor1(PaletteState state) => RibbonFileAppTabTextColor(state);
///
/// Gets the second color for the short text.
///
/// Palette value should be applicable to this state.
/// Color value.
- public override Color GetContentShortTextColor2(PaletteState state) => _ribbon.RibbonAppButton.AppButtonTextColor;
+ public override Color GetContentShortTextColor2(PaletteState state) => RibbonFileAppTabTextColor(state);
+
+ private Color RibbonFileAppTabTextColor(PaletteState state)
+ {
+ PaletteRibbonFileAppTab palette;
+
+ // Find the correct palette to use that matches the button state
+ switch (state)
+ {
+ default:
+ case PaletteState.Normal:
+ palette = _ribbon.StateNormal.RibbonFileAppTab;
+ break;
+ case PaletteState.Tracking:
+ palette = _ribbon.StateNormal.RibbonFileAppTab;
+ break;
+ case PaletteState.Pressed:
+ palette = _ribbon.StateNormal.RibbonFileAppTab;
+ break;
+ }
+ return palette.GetRibbonFileAppTabTextColor(state);
+ }
///
/// Gets the first color for the long text.
///
/// Palette value should be applicable to this state.
/// Color value.
- public override Color GetContentLongTextColor1(PaletteState state) => _ribbon.RibbonAppButton.AppButtonTextColor;
+ public override Color GetContentLongTextColor1(PaletteState state) => RibbonFileAppTabTextColor(state);
///
/// Gets the second color for the long text.
///
/// Palette value should be applicable to this state.
/// Color value.
- public override Color GetContentLongTextColor2(PaletteState state) => _ribbon.RibbonAppButton.AppButtonTextColor;
+ public override Color GetContentLongTextColor2(PaletteState state) => RibbonFileAppTabTextColor(state);
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteCaptionRedirect.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteCaptionRedirect.cs
index cdb0e3447..29ce49b04 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteCaptionRedirect.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteCaptionRedirect.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -24,7 +24,7 @@ internal class PaletteCaptionRedirect : PaletteRedirect
/// Initialize a new instance of the PaletteCaptionRedirect class.
///
/// Initial palette target for redirection.
- public PaletteCaptionRedirect(PaletteBase? target)
+ public PaletteCaptionRedirect(PaletteBase target)
: base(target)
{
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteGalleryBackBorder.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteGalleryBackBorder.cs
index a0d77e360..4b42db849 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteGalleryBackBorder.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteGalleryBackBorder.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -26,10 +26,10 @@ internal class PaletteGalleryBackBorder : IPaletteBack,
/// Initialize a new instance of the PaletteGalleryBackBorder class.
///
/// Initial state for background/border.
- public PaletteGalleryBackBorder([DisallowNull] PaletteGalleryState state)
+ public PaletteGalleryBackBorder([DisallowNull] PaletteGalleryState? state)
{
- Debug.Assert(state != null);
- _state = state;
+ Debug.Assert(state is not null);
+ _state = state ?? throw new ArgumentNullException(nameof(state));
}
#endregion
@@ -41,7 +41,7 @@ public PaletteGalleryBackBorder([DisallowNull] PaletteGalleryState state)
public void SetState([DisallowNull] PaletteGalleryState state)
{
Debug.Assert(state != null);
- _state = state;
+ _state = state ?? throw new ArgumentNullException(nameof(state));
}
#endregion
@@ -65,14 +65,14 @@ public void SetState([DisallowNull] PaletteGalleryState state)
///
/// Palette value should be applicable to this state.
/// Color value.
- public Color GetBackColor1(PaletteState state) => _state.RibbonGalleryBack.GetRibbonBackColor1(state);
+ public Color GetBackColor1(PaletteState state) => _state!.RibbonGalleryBack.GetRibbonBackColor1(state);
///
/// Gets the second back color.
///
/// Palette value should be applicable to this state.
/// Color value.
- public Color GetBackColor2(PaletteState state) => _state.RibbonGalleryBack.GetRibbonBackColor2(state);
+ public Color GetBackColor2(PaletteState state) => _state!.RibbonGalleryBack.GetRibbonBackColor2(state);
///
/// Gets the color drawing style.
@@ -145,14 +145,14 @@ public void SetState([DisallowNull] PaletteGalleryState state)
///
/// Palette value should be applicable to this state.
/// Color value.
- public Color GetBorderColor1(PaletteState state) => _state.RibbonGalleryBorder.GetRibbonBackColor1(state);
+ public Color GetBorderColor1(PaletteState state) => _state!.RibbonGalleryBorder.GetRibbonBackColor1(state);
///
/// Gets the second border color.
///
/// Palette value should be applicable to this state.
/// Color value.
- public Color GetBorderColor2(PaletteState state) => _state.RibbonGalleryBorder.GetRibbonBackColor2(state);
+ public Color GetBorderColor2(PaletteState state) => _state!.RibbonGalleryBorder.GetRibbonBackColor2(state);
///
/// Gets the color drawing style.
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteGalleryRedirect.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteGalleryRedirect.cs
index 50e2489ab..da5f675c7 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteGalleryRedirect.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteGalleryRedirect.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -36,10 +36,20 @@ public class PaletteGalleryRedirect : PaletteMetricRedirect
/// inheritance redirection instance.
/// Paint delegate.
public PaletteGalleryRedirect([DisallowNull] PaletteRedirect redirect,
- NeedPaintHandler needPaint)
+ [DisallowNull] NeedPaintHandler needPaint)
: base(redirect)
{
- Debug.Assert(redirect != null);
+ Debug.Assert(redirect is not null);
+
+ if (redirect is null)
+ {
+ throw new ArgumentNullException(nameof(redirect));
+ }
+
+ if (needPaint is null)
+ {
+ throw new ArgumentNullException(nameof(needPaint));
+ }
// Store the provided paint notification delegate
NeedPaint = needPaint;
@@ -59,7 +69,7 @@ public PaletteGalleryRedirect([DisallowNull] PaletteRedirect redirect,
/// Update the redirector with new reference.
///
/// Target redirector.
- public override void SetRedirector(PaletteRedirect? redirect)
+ public override void SetRedirector(PaletteRedirect redirect)
{
base.SetRedirector(redirect);
_ribbonBackInherit.SetRedirector(redirect);
@@ -72,8 +82,9 @@ public override void SetRedirector(PaletteRedirect? redirect)
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => RibbonGalleryBack.IsDefault &
- RibbonGalleryBorder.IsDefault;
+ RibbonGalleryBorder.IsDefault;
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteGalleryState.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteGalleryState.cs
index e809d8aee..0653b6ae5 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteGalleryState.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteGalleryState.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -44,8 +44,9 @@ public PaletteGalleryState(PaletteGalleryRedirect inherit,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => RibbonGalleryBack.IsDefault &
- RibbonGalleryBorder.IsDefault;
+ RibbonGalleryBorder.IsDefault;
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRedirectRibbonAeroOverride.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRedirectRibbonAeroOverride.cs
index f45fa7058..c01dc2860 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRedirectRibbonAeroOverride.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRedirectRibbonAeroOverride.cs
@@ -1,14 +1,10 @@
#region BSD License
/*
- *
* Original BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE)
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
- *
- * Modified: Monday 12th April, 2021 @ 18:00 GMT
- *
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*/
#endregion
@@ -30,7 +26,7 @@ public class PaletteRedirectRibbonAeroOverride : PaletteRedirect
/// Reference to owning Ribbon instance.
/// Source for inheriting values.
public PaletteRedirectRibbonAeroOverride(KryptonRibbon ribbon,
- PaletteRedirect? redirect)
+ PaletteRedirect redirect)
: base(redirect) =>
_ribbon = ribbon;
@@ -49,8 +45,7 @@ public override Color GetContentShortTextColor1(PaletteContentStyle style, Palet
if ((style == PaletteContentStyle.ButtonButtonSpec) && (state == PaletteState.Normal))
{
// If the ribbon is showing in office 2010 style and using glass
- if (_ribbon.CaptionArea.DrawCaptionOnComposition
- && RibbonShapeIs2010OrHigher())
+ if (RibbonShapeIs2010OrHigher())
{
return LightBackground(base.GetContentShortTextColor1(style, state));
}
@@ -71,8 +66,7 @@ public override Color GetContentShortTextColor2(PaletteContentStyle style, Palet
if ((style == PaletteContentStyle.ButtonButtonSpec) && (state == PaletteState.Normal))
{
// If the ribbon is showing in office 2010 style and using glass
- if (_ribbon.CaptionArea.DrawCaptionOnComposition
- && RibbonShapeIs2010OrHigher())
+ if (RibbonShapeIs2010OrHigher())
{
return LightBackground(base.GetContentShortTextColor2(style, state));
}
@@ -95,8 +89,7 @@ public override Color GetContentLongTextColor1(PaletteContentStyle style, Palett
if ((style == PaletteContentStyle.ButtonButtonSpec) && (state == PaletteState.Normal))
{
// If the ribbon is showing in office 2010 style and using glass
- if (_ribbon.CaptionArea.DrawCaptionOnComposition
- && RibbonShapeIs2010OrHigher())
+ if ( RibbonShapeIs2010OrHigher())
{
return LightBackground(base.GetContentLongTextColor1(style, state));
}
@@ -117,8 +110,7 @@ public override Color GetContentLongTextColor2(PaletteContentStyle style, Palett
if ((style == PaletteContentStyle.ButtonButtonSpec) && (state == PaletteState.Normal))
{
// If the ribbon is showing in office 2010 style and using glass
- if (_ribbon.CaptionArea.DrawCaptionOnComposition
- && RibbonShapeIs2010OrHigher())
+ if ( RibbonShapeIs2010OrHigher())
{
return LightBackground(base.GetContentLongTextColor2(style, state));
}
@@ -135,8 +127,6 @@ private Color LightBackground(Color retColor) =>
Math.Min(retColor.G, (byte)60),
Math.Min(retColor.B, (byte)60));
-
-
private bool RibbonShapeIs2010OrHigher() => _ribbon.RibbonShape is PaletteRibbonShape.Office2010 or PaletteRibbonShape.VisualStudio2010 or PaletteRibbonShape.VisualStudio2010 or PaletteRibbonShape.Office2013 or PaletteRibbonShape.Microsoft365 or PaletteRibbonShape.VisualStudio;
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonAppButton.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonAppButton.cs
index f99370bd0..9a9517173 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonAppButton.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonAppButton.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -37,7 +37,12 @@ public class PaletteRibbonAppButton : Storage
public PaletteRibbonAppButton([DisallowNull] PaletteRibbonRedirect inherit,
NeedPaintHandler needPaint)
{
- Debug.Assert(inherit != null);
+ Debug.Assert(inherit is not null);
+
+ if (inherit is null)
+ {
+ throw new ArgumentNullException(nameof(inherit));
+ }
// Store the provided paint notification delegate
NeedPaint = needPaint;
@@ -57,12 +62,13 @@ public PaletteRibbonAppButton([DisallowNull] PaletteRibbonRedirect inherit,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => RibbonAppButton.IsDefault &&
- RibbonGroupCollapsedBorder.IsDefault &&
- RibbonGroupCollapsedBack.IsDefault &&
- RibbonGroupCollapsedFrameBorder.IsDefault &&
- RibbonGroupCollapsedFrameBack.IsDefault &&
- RibbonGroupCollapsedText.IsDefault;
+ RibbonGroupCollapsedBorder.IsDefault &&
+ RibbonGroupCollapsedBack.IsDefault &&
+ RibbonGroupCollapsedFrameBorder.IsDefault &&
+ RibbonGroupCollapsedFrameBack.IsDefault &&
+ RibbonGroupCollapsedText.IsDefault;
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonAppGroupTab.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonAppGroupTab.cs
index 63d349b10..664e36ed8 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonAppGroupTab.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonAppGroupTab.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -59,16 +59,17 @@ public PaletteRibbonAppGroupTab(PaletteRibbonRedirect inherit,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => base.IsDefault &&
- RibbonGroupArea.IsDefault &&
- RibbonAppButton.IsDefault &&
- RibbonGroupNormalBorder.IsDefault &&
- RibbonGroupNormalTitle.IsDefault &&
- RibbonGroupCollapsedBorder.IsDefault &&
- RibbonGroupCollapsedBack.IsDefault &&
- RibbonGroupCollapsedFrameBorder.IsDefault &&
- RibbonGroupCollapsedFrameBack.IsDefault &&
- RibbonGroupCollapsedText.IsDefault;
+ RibbonGroupArea.IsDefault &&
+ RibbonAppButton.IsDefault &&
+ RibbonGroupNormalBorder.IsDefault &&
+ RibbonGroupNormalTitle.IsDefault &&
+ RibbonGroupCollapsedBorder.IsDefault &&
+ RibbonGroupCollapsedBack.IsDefault &&
+ RibbonGroupCollapsedFrameBorder.IsDefault &&
+ RibbonGroupCollapsedFrameBack.IsDefault &&
+ RibbonGroupCollapsedText.IsDefault;
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonContextBack.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonContextBack.cs
index d5430e036..b673ef92d 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonContextBack.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonContextBack.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -31,7 +31,13 @@ public class PaletteRibbonContextBack : IPaletteRibbonBack
/// Reference to ribbon control.
public PaletteRibbonContextBack([DisallowNull] KryptonRibbon ribbon)
{
- Debug.Assert(ribbon != null);
+ Debug.Assert(ribbon is not null);
+
+ if (ribbon is null)
+ {
+ throw new ArgumentNullException(nameof(ribbon));
+ }
+
_ribbon = ribbon;
}
#endregion
@@ -161,13 +167,12 @@ public Color GetRibbonBackColor5(PaletteState state)
return retColor;
}
#endregion
-
#region Implementation
private Color CheckForContextColor()
{
// We need an associated ribbon tab
// Does the ribbon tab have a context setting?
- if (_ribbon.SelectedTab != null)
+ if (_ribbon is not null && _ribbon.SelectedTab is not null)
{
KryptonRibbonTab selectedTab = _ribbon.SelectedTab;
if (!string.IsNullOrEmpty(selectedTab?.ContextName))
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonContextDouble.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonContextDouble.cs
index e06c87558..4b00333a7 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonContextDouble.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonContextDouble.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -33,8 +33,9 @@ public class PaletteRibbonContextDouble : IPaletteRibbonBack,
/// Reference to ribbon control.
public PaletteRibbonContextDouble([DisallowNull] KryptonRibbon ribbon)
{
- Debug.Assert(ribbon != null);
- _ribbon = ribbon;
+ Debug.Assert(ribbon is not null);
+
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
LightBackground = false;
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonDisabled.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonDisabled.cs
index 4d00920d5..72fc04635 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonDisabled.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonDisabled.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -48,10 +48,11 @@ public PaletteRibbonDisabled(PaletteRibbonRedirect inherit,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => RibbonGroupCheckBoxText.IsDefault &&
- RibbonGroupButtonText.IsDefault &&
- RibbonGroupLabelText.IsDefault &&
- RibbonGroupRadioButtonText.IsDefault;
+ RibbonGroupButtonText.IsDefault &&
+ RibbonGroupLabelText.IsDefault &&
+ RibbonGroupRadioButtonText.IsDefault;
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonFocus.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonFocus.cs
index be29cb597..87f4f8943 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonFocus.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonFocus.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -31,13 +31,18 @@ public class PaletteRibbonFocus : PaletteMetricRedirect
/// Inheritence redirection instance.
/// Paint delegate.
public PaletteRibbonFocus([DisallowNull] PaletteRedirect redirect,
- NeedPaintHandler needPaint)
+ [DisallowNull] NeedPaintHandler? needPaint)
: base(redirect)
{
- Debug.Assert(redirect != null);
+ Debug.Assert(redirect is not null);
+
+ if (redirect is null)
+ {
+ throw new ArgumentNullException(nameof(redirect));
+ }
// Store the provided paint notification delegate
- NeedPaint = needPaint;
+ NeedPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
// Create the redirection instances
_ribbonTabInherit = new PaletteRibbonDoubleInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonTab, PaletteRibbonTextStyle.RibbonTab);
@@ -52,7 +57,7 @@ public PaletteRibbonFocus([DisallowNull] PaletteRedirect redirect,
/// Update the redirector with new reference.
///
/// Target redirector.
- public override void SetRedirector(PaletteRedirect? redirect)
+ public override void SetRedirector(PaletteRedirect redirect)
{
base.SetRedirector(redirect);
_ribbonTabInherit.SetRedirector(redirect);
@@ -64,6 +69,7 @@ public override void SetRedirector(PaletteRedirect? redirect)
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => RibbonTab.IsDefault;
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonGroupAreaTab.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonGroupAreaTab.cs
index 8f233cbf1..f59bc4520 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonGroupAreaTab.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonGroupAreaTab.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -42,8 +42,9 @@ public PaletteRibbonGroupAreaTab(PaletteRibbonRedirect inherit,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => base.IsDefault &&
- RibbonGroupArea.IsDefault;
+ RibbonGroupArea.IsDefault;
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonGroupTab.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonGroupTab.cs
index 29ece950c..c8334501d 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonGroupTab.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonGroupTab.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -57,15 +57,16 @@ public PaletteRibbonGroupTab(PaletteRibbonRedirect inherit,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => base.IsDefault &&
- RibbonGroupArea.IsDefault &&
- RibbonGroupNormalBorder.IsDefault &&
- RibbonGroupNormalTitle.IsDefault &&
- RibbonGroupCollapsedBorder.IsDefault &&
- RibbonGroupCollapsedBack.IsDefault &&
- RibbonGroupCollapsedFrameBorder.IsDefault &&
- RibbonGroupCollapsedFrameBack.IsDefault &&
- RibbonGroupCollapsedText.IsDefault;
+ RibbonGroupArea.IsDefault &&
+ RibbonGroupNormalBorder.IsDefault &&
+ RibbonGroupNormalTitle.IsDefault &&
+ RibbonGroupCollapsedBorder.IsDefault &&
+ RibbonGroupCollapsedBack.IsDefault &&
+ RibbonGroupCollapsedFrameBorder.IsDefault &&
+ RibbonGroupCollapsedFrameBack.IsDefault &&
+ RibbonGroupCollapsedText.IsDefault;
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonImages.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonImages.cs
index 2932383c4..17eb28924 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonImages.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonImages.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -43,8 +43,9 @@ public PaletteRibbonImages([DisallowNull] PaletteRedirect redirect,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => CheckBox.IsDefault &&
- RadioButton.IsDefault;
+ RadioButton.IsDefault;
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonJustGroup.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonJustGroup.cs
index d16e33fd0..06cbaa69b 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonJustGroup.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonJustGroup.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -37,12 +37,17 @@ public class PaletteRibbonJustGroup : Storage
/// Source for inheriting values.
/// Delegate for notifying paint requests.
public PaletteRibbonJustGroup([DisallowNull] PaletteRibbonRedirect inherit,
- NeedPaintHandler needPaint)
+ [DisallowNull] NeedPaintHandler needPaint)
{
- Debug.Assert(inherit != null);
+ Debug.Assert(inherit is not null);
+
+ if (inherit is null)
+ {
+ throw new ArgumentNullException(nameof(inherit));
+ }
// Store the provided paint notification delegate
- NeedPaint = needPaint;
+ NeedPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
// Create storage that maps onto the inherit instances
_ribbonGroupArea = new PaletteRibbonBack(inherit.RibbonGroupBackArea, needPaint);
@@ -61,14 +66,15 @@ public PaletteRibbonJustGroup([DisallowNull] PaletteRibbonRedirect inherit,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => RibbonGroupArea.IsDefault &&
- RibbonGroupNormalBorder.IsDefault &&
- RibbonGroupNormalTitle.IsDefault &&
- RibbonGroupCollapsedBorder.IsDefault &&
- RibbonGroupCollapsedBack.IsDefault &&
- RibbonGroupCollapsedFrameBorder.IsDefault &&
- RibbonGroupCollapsedFrameBack.IsDefault &&
- RibbonGroupCollapsedText.IsDefault;
+ RibbonGroupNormalBorder.IsDefault &&
+ RibbonGroupNormalTitle.IsDefault &&
+ RibbonGroupCollapsedBorder.IsDefault &&
+ RibbonGroupCollapsedBack.IsDefault &&
+ RibbonGroupCollapsedFrameBorder.IsDefault &&
+ RibbonGroupCollapsedFrameBack.IsDefault &&
+ RibbonGroupCollapsedText.IsDefault;
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonJustTab.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonJustTab.cs
index 7eb47c947..36c7fb23b 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonJustTab.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonJustTab.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -30,12 +30,17 @@ public class PaletteRibbonJustTab : Storage
/// Source for inheriting values.
/// Delegate for notifying paint requests.
public PaletteRibbonJustTab([DisallowNull] PaletteRibbonRedirect inherit,
- NeedPaintHandler needPaint)
+ [DisallowNull] NeedPaintHandler needPaint)
{
- Debug.Assert(inherit != null);
+ Debug.Assert(inherit is not null);
+
+ if (inherit is null)
+ {
+ throw new ArgumentNullException(nameof(inherit));
+ }
// Store the provided paint notification delegate
- NeedPaint = needPaint;
+ NeedPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
// Create storage that maps onto the inherit instances
_ribbonTab = new PaletteRibbonDouble(inherit.RibbonTab, inherit.RibbonTab, needPaint);
@@ -47,6 +52,7 @@ public PaletteRibbonJustTab([DisallowNull] PaletteRibbonRedirect inherit,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => RibbonTab.IsDefault;
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonNormal.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonNormal.cs
index 63430505e..2463125dd 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonNormal.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonNormal.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -36,6 +36,7 @@ public PaletteRibbonNormal(PaletteRibbonRedirect inherit,
NeedPaintHandler needPaint)
: base(inherit, needPaint)
{
+ RibbonFileAppTab = new PaletteRibbonFileAppTab(inherit.RibbonFileAppTab, needPaint);
// Create storage that maps onto the inherit instances
_ribbonGroupCheckBoxText = new PaletteRibbonText(inherit.RibbonGroupCheckBoxText, needPaint);
_ribbonGroupButtonText = new PaletteRibbonText(inherit.RibbonGroupButtonText, needPaint);
@@ -49,11 +50,12 @@ public PaletteRibbonNormal(PaletteRibbonRedirect inherit,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => base.IsDefault &&
- RibbonGroupCheckBoxText.IsDefault &&
- RibbonGroupButtonText.IsDefault &&
- RibbonGroupLabelText.IsDefault &&
- RibbonGroupRadioButtonText.IsDefault;
+ RibbonGroupCheckBoxText.IsDefault &&
+ RibbonGroupButtonText.IsDefault &&
+ RibbonGroupLabelText.IsDefault &&
+ RibbonGroupRadioButtonText.IsDefault;
#endregion
@@ -86,6 +88,17 @@ public override void SetInherit(PaletteRibbonRedirect inherit)
}
#endregion
+
+ ///
+ /// Gets the set of ribbon application button display strings.
+ ///
+ [Category(@"Values")]
+ [Description(@"Collection of ribbon 'File app button' settings.")]
+ [MergableProperty(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ public virtual PaletteRibbonFileAppTab RibbonFileAppTab { get; }
+ private bool ShouldSerializeRibbonFileAppTab() => !RibbonFileAppTab.IsDefault;
+
#region RibbonGroupCheckBoxText
///
/// Gets access to the ribbon group check box label palette details.
@@ -94,7 +107,6 @@ public override void SetInherit(PaletteRibbonRedirect inherit)
[Description(@"Overrides for defining ribbon group check box label appearance.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public virtual PaletteRibbonText RibbonGroupCheckBoxText => _ribbonGroupCheckBoxText;
-
private bool ShouldSerializeRibbonGroupCheckBoxText() => !_ribbonGroupCheckBoxText.IsDefault;
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonRedirect.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonRedirect.cs
index 378a5976c..6628f5f86 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonRedirect.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonRedirect.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -49,6 +49,7 @@ public class PaletteRibbonRedirect : PaletteMetricRedirect
// Redirection
private readonly PaletteRibbonBackInheritRedirect _ribbonAppButtonInherit;
+ private readonly PaletteRibbonFileAppTabInheritRedirect _ribbonFileAppTabInherit;
private readonly PaletteRibbonBackInheritRedirect _ribbonAppMenuOuterInherit;
private readonly PaletteRibbonBackInheritRedirect _ribbonAppMenuInnerInherit;
private readonly PaletteRibbonBackInheritRedirect _ribbonAppMenuDocsInherit;
@@ -89,46 +90,48 @@ public PaletteRibbonRedirect([DisallowNull] PaletteRedirect redirect,
: base(redirect)
{
Debug.Assert(redirect != null);
-
+ var _redirect = redirect!;
// Store the provided paint notification delegate
NeedPaint = needPaint;
// Create the style redirection instances
- RibbonGroupButton = new PaletteTripleRedirect(redirect, PaletteBackStyle.ButtonButtonSpec, PaletteBorderStyle.ButtonButtonSpec, PaletteContentStyle.ButtonButtonSpec, needPaint);
- RibbonGroupClusterButton = new PaletteTripleRedirect(redirect, PaletteBackStyle.ButtonStandalone, PaletteBorderStyle.ButtonStandalone, PaletteContentStyle.ButtonStandalone, needPaint);
- RibbonGroupCollapsedButton = new PaletteTripleRedirect(redirect, PaletteBackStyle.ButtonButtonSpec, PaletteBorderStyle.ButtonButtonSpec, PaletteContentStyle.ButtonButtonSpec, needPaint);
- RibbonGroupDialogButton = new PaletteTripleRedirect(redirect, PaletteBackStyle.ButtonButtonSpec, PaletteBorderStyle.ButtonButtonSpec, PaletteContentStyle.ButtonButtonSpec, needPaint);
- RibbonKeyTip = new PaletteTripleRedirect(redirect, PaletteBackStyle.ControlToolTip, PaletteBorderStyle.ControlToolTip, PaletteContentStyle.LabelKeyTip, needPaint);
- RibbonQATButton = new PaletteTripleRedirect(redirect, PaletteBackStyle.ButtonButtonSpec, PaletteBorderStyle.ButtonButtonSpec, PaletteContentStyle.ButtonButtonSpec, needPaint);
- RibbonScroller = new PaletteTripleRedirect(redirect, PaletteBackStyle.ButtonStandalone, PaletteBorderStyle.ButtonStandalone, PaletteContentStyle.ButtonStandalone, needPaint);
+ RibbonGroupButton = new PaletteTripleRedirect(_redirect, PaletteBackStyle.ButtonButtonSpec, PaletteBorderStyle.ButtonButtonSpec, PaletteContentStyle.ButtonButtonSpec, needPaint);
+ RibbonGroupClusterButton = new PaletteTripleRedirect(_redirect, PaletteBackStyle.ButtonStandalone, PaletteBorderStyle.ButtonStandalone, PaletteContentStyle.ButtonStandalone, needPaint);
+ RibbonGroupCollapsedButton = new PaletteTripleRedirect(_redirect, PaletteBackStyle.ButtonButtonSpec, PaletteBorderStyle.ButtonButtonSpec, PaletteContentStyle.ButtonButtonSpec, needPaint);
+ RibbonGroupDialogButton = new PaletteTripleRedirect(_redirect, PaletteBackStyle.ButtonButtonSpec, PaletteBorderStyle.ButtonButtonSpec, PaletteContentStyle.ButtonButtonSpec, needPaint);
+ RibbonKeyTip = new PaletteTripleRedirect(_redirect, PaletteBackStyle.ControlToolTip, PaletteBorderStyle.ControlToolTip, PaletteContentStyle.LabelKeyTip, needPaint);
+ RibbonQATButton = new PaletteTripleRedirect(_redirect, PaletteBackStyle.ButtonButtonSpec, PaletteBorderStyle.ButtonButtonSpec, PaletteContentStyle.ButtonButtonSpec, needPaint);
+ RibbonScroller = new PaletteTripleRedirect(_redirect, PaletteBackStyle.ButtonStandalone, PaletteBorderStyle.ButtonStandalone, PaletteContentStyle.ButtonStandalone, needPaint);
// Create the redirection instances
- _ribbonAppButtonInherit = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonAppButton);
- _ribbonAppMenuInnerInherit = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonAppMenuInner);
- _ribbonAppMenuOuterInherit = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonAppMenuOuter);
- _ribbonAppMenuDocsInherit = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonAppMenuDocs);
- _ribbonAppMenuDocsTitleInherit = new PaletteRibbonTextInheritRedirect(redirect, PaletteRibbonTextStyle.RibbonAppMenuDocsTitle);
- _ribbonAppMenuDocsEntryInherit = new PaletteRibbonTextInheritRedirect(redirect, PaletteRibbonTextStyle.RibbonAppMenuDocsEntry);
- _ribbonGeneralInherit = new PaletteRibbonGeneralInheritRedirect(redirect);
- _ribbonGroupBackAreaInherit = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonGroupArea);
- _ribbonGroupButtonTextInherit = new PaletteRibbonTextInheritRedirect(redirect, PaletteRibbonTextStyle.RibbonGroupButtonText);
- _ribbonGroupCheckBoxTextInherit = new PaletteRibbonTextInheritRedirect(redirect, PaletteRibbonTextStyle.RibbonGroupCheckBoxText);
- _ribbonGroupCollapsedBackInherit = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonGroupCollapsedBack);
- _ribbonGroupCollapsedBorderInherit = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonGroupCollapsedBorder);
- _ribbonGroupCollapsedFrameBackInherit = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonGroupCollapsedFrameBack);
- _ribbonGroupCollapsedFrameBorderInherit = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonGroupCollapsedFrameBorder);
- _ribbonGroupCollapsedTextInherit = new PaletteRibbonTextInheritRedirect(redirect, PaletteRibbonTextStyle.RibbonGroupCollapsedText);
- _ribbonGroupNormalBorderInherit = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonGroupNormalBorder);
- _ribbonGroupNormalTitleInherit = new PaletteRibbonDoubleInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonGroupNormalTitle, PaletteRibbonTextStyle.RibbonGroupNormalTitle);
- _ribbonGroupRadioButtonTextInherit = new PaletteRibbonTextInheritRedirect(redirect, PaletteRibbonTextStyle.RibbonGroupRadioButtonText);
- _ribbonGroupLabelTextInherit = new PaletteRibbonTextInheritRedirect(redirect, PaletteRibbonTextStyle.RibbonGroupLabelText);
- _ribbonTabInherit = new PaletteRibbonDoubleInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonTab, PaletteRibbonTextStyle.RibbonTab);
- _ribbonQATFullbarInherit = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonQATFullbar);
- _ribbonQATMinibarInherit = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonQATMinibar);
- _ribbonQATOverflowInherit = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonQATOverflow);
+ _ribbonAppButtonInherit = new PaletteRibbonBackInheritRedirect(_redirect, PaletteRibbonBackStyle.RibbonAppButton);
+ _ribbonFileAppTabInherit = new PaletteRibbonFileAppTabInheritRedirect(_redirect);
+ _ribbonAppMenuInnerInherit = new PaletteRibbonBackInheritRedirect(_redirect, PaletteRibbonBackStyle.RibbonAppMenuInner);
+ _ribbonAppMenuOuterInherit = new PaletteRibbonBackInheritRedirect(_redirect, PaletteRibbonBackStyle.RibbonAppMenuOuter);
+ _ribbonAppMenuDocsInherit = new PaletteRibbonBackInheritRedirect(_redirect, PaletteRibbonBackStyle.RibbonAppMenuDocs);
+ _ribbonAppMenuDocsTitleInherit = new PaletteRibbonTextInheritRedirect(_redirect, PaletteRibbonTextStyle.RibbonAppMenuDocsTitle);
+ _ribbonAppMenuDocsEntryInherit = new PaletteRibbonTextInheritRedirect(_redirect, PaletteRibbonTextStyle.RibbonAppMenuDocsEntry);
+ _ribbonGeneralInherit = new PaletteRibbonGeneralInheritRedirect(_redirect);
+ _ribbonGroupBackAreaInherit = new PaletteRibbonBackInheritRedirect(_redirect, PaletteRibbonBackStyle.RibbonGroupArea);
+ _ribbonGroupButtonTextInherit = new PaletteRibbonTextInheritRedirect(_redirect, PaletteRibbonTextStyle.RibbonGroupButtonText);
+ _ribbonGroupCheckBoxTextInherit = new PaletteRibbonTextInheritRedirect(_redirect, PaletteRibbonTextStyle.RibbonGroupCheckBoxText);
+ _ribbonGroupCollapsedBackInherit = new PaletteRibbonBackInheritRedirect(_redirect, PaletteRibbonBackStyle.RibbonGroupCollapsedBack);
+ _ribbonGroupCollapsedBorderInherit = new PaletteRibbonBackInheritRedirect(_redirect, PaletteRibbonBackStyle.RibbonGroupCollapsedBorder);
+ _ribbonGroupCollapsedFrameBackInherit = new PaletteRibbonBackInheritRedirect(_redirect, PaletteRibbonBackStyle.RibbonGroupCollapsedFrameBack);
+ _ribbonGroupCollapsedFrameBorderInherit = new PaletteRibbonBackInheritRedirect(_redirect, PaletteRibbonBackStyle.RibbonGroupCollapsedFrameBorder);
+ _ribbonGroupCollapsedTextInherit = new PaletteRibbonTextInheritRedirect(_redirect, PaletteRibbonTextStyle.RibbonGroupCollapsedText);
+ _ribbonGroupNormalBorderInherit = new PaletteRibbonBackInheritRedirect(_redirect, PaletteRibbonBackStyle.RibbonGroupNormalBorder);
+ _ribbonGroupNormalTitleInherit = new PaletteRibbonDoubleInheritRedirect(_redirect, PaletteRibbonBackStyle.RibbonGroupNormalTitle, PaletteRibbonTextStyle.RibbonGroupNormalTitle);
+ _ribbonGroupRadioButtonTextInherit = new PaletteRibbonTextInheritRedirect(_redirect, PaletteRibbonTextStyle.RibbonGroupRadioButtonText);
+ _ribbonGroupLabelTextInherit = new PaletteRibbonTextInheritRedirect(_redirect, PaletteRibbonTextStyle.RibbonGroupLabelText);
+ _ribbonTabInherit = new PaletteRibbonDoubleInheritRedirect(_redirect, PaletteRibbonBackStyle.RibbonTab, PaletteRibbonTextStyle.RibbonTab);
+ _ribbonQATFullbarInherit = new PaletteRibbonBackInheritRedirect(_redirect, PaletteRibbonBackStyle.RibbonQATFullbar);
+ _ribbonQATMinibarInherit = new PaletteRibbonBackInheritRedirect(_redirect, PaletteRibbonBackStyle.RibbonQATMinibar);
+ _ribbonQATOverflowInherit = new PaletteRibbonBackInheritRedirect(_redirect, PaletteRibbonBackStyle.RibbonQATOverflow);
// Create storage that maps onto the inherit instances
_ribbonAppButton = new PaletteRibbonBack(_ribbonAppButtonInherit, needPaint);
+ RibbonFileAppTab = new PaletteRibbonFileAppTab(_ribbonFileAppTabInherit, needPaint);
_ribbonAppMenuInner = new PaletteRibbonBack(_ribbonAppMenuInnerInherit, needPaint);
_ribbonAppMenuOuter = new PaletteRibbonBack(_ribbonAppMenuOuterInherit, needPaint);
_ribbonAppMenuDocs = new PaletteRibbonBack(_ribbonAppMenuDocsInherit, needPaint);
@@ -152,7 +155,7 @@ public PaletteRibbonRedirect([DisallowNull] PaletteRedirect redirect,
_ribbonQATMinibarActive = new PaletteRibbonBack(_ribbonQATMinibarInherit, needPaint);
_ribbonQATMinibarInactive = new PaletteRibbonBack(_ribbonQATMinibarInherit, needPaint);
_ribbonQATOverflow = new PaletteRibbonBack(_ribbonQATOverflowInherit, needPaint);
- _ribbonImages = new PaletteRibbonImages(redirect, NeedPaintDelegate);
+ _ribbonImages = new PaletteRibbonImages(_redirect, NeedPaintDelegate);
}
#endregion
@@ -161,7 +164,7 @@ public PaletteRibbonRedirect([DisallowNull] PaletteRedirect redirect,
/// Update the redirector with new reference.
///
/// Target redirector.
- public override void SetRedirector(PaletteRedirect? redirect)
+ public override void SetRedirector(PaletteRedirect redirect)
{
base.SetRedirector(redirect);
RibbonGroupButton.SetRedirector(redirect);
@@ -172,6 +175,7 @@ public override void SetRedirector(PaletteRedirect? redirect)
RibbonQATButton.SetRedirector(redirect);
RibbonScroller.SetRedirector(redirect);
_ribbonAppButtonInherit.SetRedirector(redirect);
+ _ribbonFileAppTabInherit.SetRedirector(redirect);
_ribbonAppMenuInnerInherit.SetRedirector(redirect);
_ribbonAppMenuOuterInherit.SetRedirector(redirect);
_ribbonAppMenuDocsInherit.SetRedirector(redirect);
@@ -202,31 +206,32 @@ public override void SetRedirector(PaletteRedirect? redirect)
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => RibbonAppButton.IsDefault &&
- RibbonAppMenuOuter.IsDefault &&
- RibbonAppMenuInner.IsDefault &&
- RibbonAppMenuDocs.IsDefault &&
- RibbonAppMenuDocsTitle.IsDefault &&
- RibbonAppMenuDocsEntry.IsDefault &&
- RibbonGeneral.IsDefault &&
- RibbonGroupBackArea.IsDefault &&
- RibbonGroupCheckBoxText.IsDefault &&
- RibbonGroupNormalBorder.IsDefault &&
- RibbonGroupNormalTitle.IsDefault &&
- RibbonGroupButtonText.IsDefault &&
- RibbonGroupCollapsedBorder.IsDefault &&
- RibbonGroupCollapsedBack.IsDefault &&
- RibbonGroupCollapsedFrameBorder.IsDefault &&
- RibbonGroupCollapsedFrameBack.IsDefault &&
- RibbonGroupCollapsedText.IsDefault &&
- RibbonGroupRadioButtonText.IsDefault &&
- RibbonGroupLabelText.IsDefault &&
- RibbonImages.IsDefault &&
- RibbonTab.IsDefault &&
- RibbonQATFullbar.IsDefault &&
- RibbonQATMinibarActive.IsDefault &&
- RibbonQATMinibarInactive.IsDefault &&
- RibbonQATOverflow.IsDefault;
+ RibbonAppMenuOuter.IsDefault &&
+ RibbonAppMenuInner.IsDefault &&
+ RibbonAppMenuDocs.IsDefault &&
+ RibbonAppMenuDocsTitle.IsDefault &&
+ RibbonAppMenuDocsEntry.IsDefault &&
+ RibbonGeneral.IsDefault &&
+ RibbonGroupBackArea.IsDefault &&
+ RibbonGroupCheckBoxText.IsDefault &&
+ RibbonGroupNormalBorder.IsDefault &&
+ RibbonGroupNormalTitle.IsDefault &&
+ RibbonGroupButtonText.IsDefault &&
+ RibbonGroupCollapsedBorder.IsDefault &&
+ RibbonGroupCollapsedBack.IsDefault &&
+ RibbonGroupCollapsedFrameBorder.IsDefault &&
+ RibbonGroupCollapsedFrameBack.IsDefault &&
+ RibbonGroupCollapsedText.IsDefault &&
+ RibbonGroupRadioButtonText.IsDefault &&
+ RibbonGroupLabelText.IsDefault &&
+ RibbonImages.IsDefault &&
+ RibbonTab.IsDefault &&
+ RibbonQATFullbar.IsDefault &&
+ RibbonQATMinibarActive.IsDefault &&
+ RibbonQATMinibarInactive.IsDefault &&
+ RibbonQATOverflow.IsDefault;
#endregion
@@ -238,9 +243,18 @@ public override void SetRedirector(PaletteRedirect? redirect)
[Description(@"Overrides for defining application button appearance.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public virtual PaletteRibbonBack RibbonAppButton => _ribbonAppButton;
-
private bool ShouldSerializeRibbonAppButton() => !_ribbonAppButton.IsDefault;
+ #endregion
+ #region RibbonFileAppTab
+ ///
+ /// Gets access to the application button palette details.
+ ///
+ [Category(@"Visuals")]
+ [Description(@"Overrides for defining application button appearance.")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ public virtual PaletteRibbonFileAppTab RibbonFileAppTab { get; }
+ private bool ShouldSerializeRibbonFileAppTab() => !RibbonFileAppTab.IsDefault;
#endregion
#region RibbonAppMenuOuter
@@ -342,9 +356,7 @@ public override void SetRedirector(PaletteRedirect? redirect)
[Description(@"Overrides for defining ribbon group check box label appearance.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public virtual PaletteRibbonText RibbonGroupCheckBoxText => _ribbonGroupCheckBoxText;
-
private bool ShouldSerializeRibbonGroupCheckBoxText() => !_ribbonGroupCheckBoxText.IsDefault;
-
#endregion
#region RibbonGroupButtonText
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonStyles.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonStyles.cs
index 0fda5538b..18538b0b5 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonStyles.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/PaletteRibbonStyles.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -29,11 +29,14 @@ public class PaletteRibbonStyles : Storage
///
/// Source ribbon control instance.
/// Delegate for notifying paint requests.
- public PaletteRibbonStyles([DisallowNull] KryptonRibbon ribbon,
- NeedPaintHandler needPaint)
+ public PaletteRibbonStyles(KryptonRibbon ribbon,
+ NeedPaintHandler? needPaint)
{
- Debug.Assert(ribbon != null);
- _ribbon = ribbon;
+ // Debug.Assert() causes the null assignment warning.
+ // Suppressed by the null forgiving operator
+ Debug.Assert(ribbon is not null);
+
+ _ribbon = ribbon!;
// Store the provided paint notification delegate
NeedPaint = needPaint;
@@ -45,13 +48,14 @@ public PaletteRibbonStyles([DisallowNull] KryptonRibbon ribbon,
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => (BackStyle == PaletteBackStyle.PanelClient) &&
- (GroupButtonStyle == ButtonStyle.ButtonSpec) &&
- (GroupClusterButtonStyle == ButtonStyle.Cluster) &&
- (GroupDialogButtonStyle == ButtonStyle.ButtonSpec) &&
- (GroupCollapsedButtonStyle == ButtonStyle.Alternate) &&
- (QATButtonStyle == ButtonStyle.ButtonSpec) &&
- (ScrollerStyle == ButtonStyle.Standalone);
+ (GroupButtonStyle == ButtonStyle.ButtonSpec) &&
+ (GroupClusterButtonStyle == ButtonStyle.Cluster) &&
+ (GroupDialogButtonStyle == ButtonStyle.ButtonSpec) &&
+ (GroupCollapsedButtonStyle == ButtonStyle.Alternate) &&
+ (QATButtonStyle == ButtonStyle.ButtonSpec) &&
+ (ScrollerStyle == ButtonStyle.Standalone);
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/QATButtonToContent.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/QATButtonToContent.cs
index 6efc8d7a2..2f809bc84 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/QATButtonToContent.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/QATButtonToContent.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -27,8 +27,9 @@ internal class QATButtonToContent : IPaletteContent
/// Source for button values.
public QATButtonToContent([DisallowNull] IQuickAccessToolbarButton qatButton)
{
- Debug.Assert(qatButton != null);
- _qatButton = qatButton;
+ Debug.Assert(qatButton is not null);
+
+ _qatButton = qatButton ?? throw new ArgumentNullException(nameof(qatButton));
}
#endregion
@@ -89,21 +90,21 @@ public PaletteImageEffect GetContentImageEffect(PaletteState state) => state !=
///
/// Palette value should be applicable to this state.
/// Font value.
- public Font GetContentShortTextFont(PaletteState state) => null;
+ public Font? GetContentShortTextFont(PaletteState state) => null;
///
/// Gets the font for the short text by generating a new font instance.
///
/// Palette value should be applicable to this state.
/// Font value.
- public Font GetContentShortTextNewFont(PaletteState state) => null;
+ public Font? GetContentShortTextNewFont(PaletteState state) => null;
///
/// Gets the rendering hint for the short text.
///
/// Palette value should be applicable to this state.
/// PaletteTextHint value.
- public PaletteTextHint GetContentShortTextHint(PaletteState state) => PaletteTextHint.SystemDefault;
+ public PaletteTextHint GetContentShortTextHint(PaletteState state) => PaletteTextHint.ClearTypeGridFit;
///
/// Gets the prefix drawing setting for short text.
@@ -208,21 +209,21 @@ public PaletteImageEffect GetContentImageEffect(PaletteState state) => state !=
///
/// Palette value should be applicable to this state.
/// Font value.
- public Font GetContentLongTextFont(PaletteState state) => null;
+ public Font? GetContentLongTextFont(PaletteState state) => null;
///
/// Gets the font for the long text by generating a new font instance.
///
/// Palette value should be applicable to this state.
/// Font value.
- public Font GetContentLongTextNewFont(PaletteState state) => null;
+ public Font? GetContentLongTextNewFont(PaletteState state) => null;
///
/// Gets the rendering hint for the long text.
///
/// Palette value should be applicable to this state.
/// PaletteTextHint value.
- public PaletteTextHint GetContentLongTextHint(PaletteState state) => PaletteTextHint.SystemDefault;
+ public PaletteTextHint GetContentLongTextHint(PaletteState state) => PaletteTextHint.ClearTypeGridFit;
///
/// Gets the flag indicating if multiline text is allowed for long text.
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/QATButtonToolTipToContent.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/QATButtonToolTipToContent.cs
index 2d017e8d0..f23ac70d2 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/QATButtonToolTipToContent.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/QATButtonToolTipToContent.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -30,8 +30,9 @@ internal class QATButtonToolTipToContent : IContentValues
/// Source quick access toolbar button.
public QATButtonToolTipToContent([DisallowNull] IQuickAccessToolbarButton qatButton)
{
- Debug.Assert(qatButton != null);
- _qatButton = qatButton;
+ Debug.Assert(qatButton is not null);
+
+ _qatButton = qatButton ?? throw new ArgumentNullException(nameof(qatButton));
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonAppButton.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonFileAppButton.cs
similarity index 62%
rename from Source/Krypton Components/Krypton.Ribbon/Palette/RibbonAppButton.cs
rename to Source/Krypton Components/Krypton.Ribbon/Palette/RibbonFileAppButton.cs
index 0bffb6605..204b7a6f9 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonAppButton.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonFileAppButton.cs
@@ -1,27 +1,22 @@
#region BSD License
/*
- *
* Original BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE)
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
- *
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*/
#endregion
namespace Krypton.Ribbon
{
///
- /// Storage for application button related properties.
+ /// Storage for File application button related properties.
///
- public class RibbonAppButton : Storage
+ public class RibbonFileAppButton : Storage
{
#region Static Fields
- private static readonly Image _defaultAppImage = GenericImageResources.AppButtonDefault;
- private const string DEFAULT_APP_TEXT = @"File";
- private static readonly Color _defaultAppBaseColorDark = Color.FromArgb(31, 72, 161);
- private static readonly Color _defaultAppBaseColorLight = Color.FromArgb(84, 158, 243);
+ private static readonly Image? _defaultAppImage = GenericImageResources.AppButtonDefault;
#endregion
#region Type Definitions
@@ -45,24 +40,21 @@ public AppMenuButtonSpecCollection(KryptonRibbon owner)
#region Instance Fields
private readonly KryptonRibbon _ribbon;
- private Image _appButtonImage;
+ private Image? _appButtonImage;
private readonly KryptonContextMenuItems _appButtonMenuItems;
private bool _appButtonVisible;
- private Color _appButtonBaseColorDark;
- private Color _appButtonBaseColorLight;
- private Color _appButtonTextColor;
- private string _appButtonText;
+ private bool _formCloseBoxVisible;
#endregion
#region Identity
///
- /// Initialize a new instance of the RibbonAppButton class.
+ /// Initialize a new instance of the RibbonFileAppButton class.
///
/// Reference to owning ribbon instance.
- public RibbonAppButton([DisallowNull] KryptonRibbon ribbon)
+ public RibbonFileAppButton([DisallowNull] KryptonRibbon ribbon)
{
Debug.Assert(ribbon != null);
- _ribbon = ribbon;
+ _ribbon = ribbon!;
// Default values
_appButtonMenuItems = new KryptonContextMenuItems
@@ -70,20 +62,16 @@ public RibbonAppButton([DisallowNull] KryptonRibbon ribbon)
ImageColumn = false
};
_appButtonImage = _defaultAppImage;
- AppButtonSpecs = new AppMenuButtonSpecCollection(ribbon);
- AppButtonRecentDocs = new KryptonRibbonRecentDocCollection();
+ AppButtonSpecs = new AppMenuButtonSpecCollection(_ribbon);
+ AppButtonRecentDocs = [];
AppButtonToolTipTitle = string.Empty;
AppButtonToolTipBody = string.Empty;
AppButtonToolTipImageTransparentColor = Color.Empty;
- AppButtonToolTipStyle = LabelStyle.SuperTip;
AppButtonMinRecentSize = new Size(250, 250);
AppButtonMaxRecentSize = new Size(350, 350);
AppButtonShowRecentDocs = true;
_appButtonVisible = true;
- _appButtonBaseColorDark = _defaultAppBaseColorDark;
- _appButtonBaseColorLight = _defaultAppBaseColorLight;
- _appButtonTextColor = Color.White;
- _appButtonText = DEFAULT_APP_TEXT;
+ _formCloseBoxVisible = false;
}
#endregion
@@ -92,24 +80,22 @@ public RibbonAppButton([DisallowNull] KryptonRibbon ribbon)
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => (AppButtonImage == _defaultAppImage) &&
- (AppButtonText == DEFAULT_APP_TEXT) &&
- (AppButtonBaseColorDark == _defaultAppBaseColorDark) &&
- (AppButtonBaseColorLight == _defaultAppBaseColorLight) &&
- (AppButtonTextColor == Color.White) &&
- (AppButtonMenuItems.Count == 0) &&
- (AppButtonRecentDocs.Count == 0) &&
- AppButtonMinRecentSize.Equals(new Size(250, 250)) &&
- AppButtonMaxRecentSize.Equals(new Size(350, 350)) &&
- AppButtonShowRecentDocs &&
- (AppButtonSpecs.Count == 0) &&
- string.IsNullOrEmpty(AppButtonToolTipBody) &&
- string.IsNullOrEmpty(AppButtonToolTipBody) &&
- (AppButtonToolTipImage == null) &&
- (AppButtonToolTipImageTransparentColor == Color.Empty) &&
- (AppButtonToolTipStyle == LabelStyle.SuperTip) &&
- AppButtonVisible
- && !IgnoreDoubleClickClose;
+ (AppButtonMenuItems.Count == 0) &&
+ (AppButtonRecentDocs.Count == 0) &&
+ AppButtonMinRecentSize.Equals(new Size(250, 250)) &&
+ AppButtonMaxRecentSize.Equals(new Size(350, 350)) &&
+ AppButtonShowRecentDocs &&
+ (AppButtonSpecs.Count == 0) &&
+ string.IsNullOrEmpty(AppButtonToolTipBody) &&
+ string.IsNullOrEmpty(AppButtonToolTipBody) &&
+ (AppButtonToolTipImage == null) &&
+ (AppButtonToolTipImageTransparentColor == Color.Empty) &&
+ (AppButtonToolTipStyle == LabelStyle.SuperTip) &&
+ AppButtonVisible
+ && !IgnoreDoubleClickClose
+ && !FormCloseBoxVisible;
#endregion
@@ -121,7 +107,7 @@ public RibbonAppButton([DisallowNull] KryptonRibbon ribbon)
[Category(@"Values")]
[Description(@"Application button image.")]
[RefreshProperties(RefreshProperties.All)]
- public Image AppButtonImage
+ public Image? AppButtonImage
{
get => _appButtonImage;
@@ -141,103 +127,6 @@ public Image AppButtonImage
#endregion
- #region AppButtonBaseColorDark
- ///
- /// Gets and sets the darker base color used for drawing an Office 2010 style application button.
- ///
- [Bindable(true)]
- [Category(@"Appearance")]
- [Description(@"Darker base color used for drawing an Office 2010 style application button.")]
- [KryptonDefaultColor()]
- [DefaultValue(typeof(Color), "31, 72, 161")]
- public Color AppButtonBaseColorDark
- {
- get => _appButtonBaseColorDark;
-
- set
- {
- if (_appButtonBaseColorDark != value)
- {
- _appButtonBaseColorDark = value;
- _ribbon.PerformNeedPaint(true);
- }
- }
- }
- #endregion
-
- #region AppButtonBaseColorLight
- ///
- /// Gets and sets the lighter base color used for drawing an Office 2010 style application button.
- ///
- [Bindable(true)]
- [Category(@"Appearance")]
- [Description(@"Lighter base color used for drawing an Office 2010 style application button.")]
- [KryptonDefaultColor()]
- [DefaultValue(typeof(Color), "84, 158, 243")]
- public Color AppButtonBaseColorLight
- {
- get => _appButtonBaseColorLight;
-
- set
- {
- if (_appButtonBaseColorLight != value)
- {
- _appButtonBaseColorLight = value;
- _ribbon.PerformNeedPaint(true);
- }
- }
- }
- #endregion
-
- #region AppButtonTextColor
- ///
- /// Gets and sets the text color used for drawing an Office 2010 style application button.
- ///
- [Bindable(true)]
- [Category(@"Appearance")]
- [Description(@"Text color used for drawing an Office 2010 style application button.")]
- [KryptonDefaultColor()]
- [DefaultValue(typeof(Color), "White")]
- public Color AppButtonTextColor
- {
- get => _appButtonTextColor;
-
- set
- {
- if (_appButtonTextColor != value)
- {
- _appButtonTextColor = value;
- _ribbon.PerformNeedPaint(true);
- }
- }
- }
- #endregion
-
- #region AppButtonText
- ///
- /// Gets and sets the text used for drawing an Office 2010 style application button.
- ///
- [Bindable(true)]
- [Category(@"Appearance")]
- [Description(@"Text used for drawing an Office 2010 style application button.")]
- [KryptonDefaultColor()]
- [DefaultValue(nameof(File))]
- [Localizable(true)]
- public string AppButtonText
- {
- get => _appButtonText;
-
- set
- {
- if (_appButtonText != value)
- {
- _appButtonText = value;
- _ribbon.PerformNeedPaint(true);
- }
- }
- }
- #endregion
-
#region AppButtonContextMenu
///
/// Gets and sets the context menu items for the application button.
@@ -307,6 +196,7 @@ public string AppButtonText
#endregion
#region AppButtonToolTipStyle
+
///
/// Gets and sets the tooltip label style for the application button.
///
@@ -314,8 +204,9 @@ public string AppButtonText
[Description(@"Tooltip style for the application button.")]
[DefaultValue(typeof(LabelStyle), "SuperTip")]
[Localizable(true)]
- public LabelStyle AppButtonToolTipStyle { get; set; }
-
+ public LabelStyle AppButtonToolTipStyle { get; set; } = LabelStyle.SuperTip;
+ private void ResetAppButtonToolTipStyle() => AppButtonToolTipStyle = LabelStyle.SuperTip;
+ private bool ShouldSerializeAppButtonToolTipStyle() => AppButtonToolTipStyle != LabelStyle.SuperTip;
#endregion
#region ToolTipShadow
@@ -326,10 +217,8 @@ public string AppButtonText
[Description(@"Button tooltip Shadow.")]
[DefaultValue(true)]
public bool ToolTipShadow { get; set; } = true; // Backward compatible -> "Material Design" suggests this to be false
-
- private bool ShouldSerializeToolTipShadow() => !ToolTipShadow;
-
private void ResetToolTipShadow() => ToolTipShadow = true;
+ private bool ShouldSerializeToolTipShadow() => !ToolTipShadow;
#endregion
#region AppButtonToolTipImage
@@ -352,7 +241,7 @@ public string AppButtonText
[Bindable(true)]
[Category(@"Appearance")]
[Description(@"Color to draw as transparent in the ToolTipImage.")]
- [KryptonDefaultColor()]
+ [KryptonDefaultColor]
[Localizable(true)]
public Color AppButtonToolTipImageTransparentColor { get; set; }
@@ -405,9 +294,41 @@ public bool AppButtonVisible
if (_ribbon.CaptionArea != null)
{
- _ribbon.TabsArea.AppButtonVisibleChanged();
+ _ribbon.TabsArea?.AppButtonVisibleChanged();
_ribbon.CaptionArea.AppButtonVisibleChanged();
_ribbon.CaptionArea.PerformFormChromeCheck();
+ _ribbon.PerformNeedPaint(true);
+ }
+ }
+ }
+ }
+ #endregion
+
+ #region FormCloseBoxVisible
+ ///
+ /// Gets and sets if the Form CloseBox button is shown.
+ ///
+ [Category(@"Visuals")]
+ [Description(@"Determine if the Form CloseBox button is shown.")]
+ [DefaultValue(false)]
+ public bool FormCloseBoxVisible
+ {
+ get => _formCloseBoxVisible;
+
+ set
+ {
+ if (_formCloseBoxVisible != value)
+ {
+ _formCloseBoxVisible = value;
+
+ if (_ribbon.CaptionArea != null)
+ {
+ if (_ribbon.CaptionArea.KryptonForm != null)
+ {
+ _ribbon.CaptionArea.KryptonForm.CloseBox = value;
+ }
+
+ _ribbon.CaptionArea.PerformFormChromeCheck();
}
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonFileAppTab.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonFileAppTab.cs
new file mode 100644
index 000000000..8516050f9
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonFileAppTab.cs
@@ -0,0 +1,71 @@
+#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. 2024 - 2024. All rights reserved.
+ */
+#endregion
+
+namespace Krypton.Ribbon
+{
+ ///
+ /// Storage for the "File application tab" related properties.
+ ///
+ public class RibbonFileAppTab : Storage
+ {
+ #region Instance Fields
+ private readonly KryptonRibbon _ribbon;
+ private string _fileAppTabText;
+ #endregion
+
+ #region Identity
+ ///
+ /// Initialize a new instance of the RibbonFileAppButton class.
+ ///
+ /// Reference to owning ribbon instance.
+ public RibbonFileAppTab([DisallowNull] KryptonRibbon ribbon)
+ {
+ Debug.Assert(ribbon != null);
+
+ _ribbon = ribbon!;
+
+ ResetFileAppTabText();
+ }
+ #endregion
+
+ #region IsDefault
+ ///
+ /// Gets a value indicating if all values are default.
+ ///
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public override bool IsDefault => !ShouldSerializeFileAppTabText();
+ #endregion
+
+ #region FileAppTabText
+ ///
+ /// Gets and sets the text used for drawing an Office 2010 style application button.
+ ///
+ [Bindable(true)]
+ [Category(@"Appearance")]
+ [Description(@"Text used for drawing an Office 2010 style application button.")]
+ [KryptonDefaultColor]
+ [DefaultValue(nameof(File))]
+ [Localizable(true)]
+ public string FileAppTabText
+ {
+ get => _fileAppTabText;
+
+ set
+ {
+ if (_fileAppTabText != value)
+ {
+ _fileAppTabText = value;
+ _ribbon.PerformNeedPaint(true);
+ }
+ }
+ }
+ private void ResetFileAppTabText() => _fileAppTabText = KryptonManager.Strings.RibbonStrings.AppButtonText;
+ private bool ShouldSerializeFileAppTabText() => _fileAppTabText != KryptonManager.Strings.RibbonStrings.AppButtonText;
+ #endregion
+ }
+}
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonGroupLabelTextToContent.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonGroupLabelTextToContent.cs
index b6650ed0f..c668d3aa3 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonGroupLabelTextToContent.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonGroupLabelTextToContent.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -40,15 +40,15 @@ public RibbonGroupLabelTextToContent([DisallowNull] PaletteRibbonGeneral ribbonG
: base(ribbonGeneral)
{
- Debug.Assert(ribbonGroupTextNormal != null);
- Debug.Assert(ribbonGroupTextDisabled != null);
- Debug.Assert(ribbonLabelTextNormal != null);
- Debug.Assert(ribbonLabelTextDisabled != null);
+ Debug.Assert(ribbonGroupTextNormal is not null);
+ Debug.Assert(ribbonGroupTextDisabled is not null);
+ Debug.Assert(ribbonLabelTextNormal is not null);
+ Debug.Assert(ribbonLabelTextDisabled is not null);
- _ribbonGroupTextNormal = ribbonGroupTextNormal;
- _ribbonGroupTextDisabled = ribbonGroupTextDisabled;
- _ribbonLabelTextNormal = ribbonLabelTextNormal;
- _ribbonLabelTextDisabled = ribbonLabelTextDisabled;
+ _ribbonGroupTextNormal = ribbonGroupTextNormal ?? throw new ArgumentNullException(nameof(ribbonGroupTextNormal));
+ _ribbonGroupTextDisabled = ribbonGroupTextDisabled ?? throw new ArgumentNullException(nameof(ribbonGroupTextDisabled));
+ _ribbonLabelTextNormal = ribbonLabelTextNormal ?? throw new ArgumentNullException(nameof(ribbonLabelTextNormal));
+ _ribbonLabelTextDisabled = ribbonLabelTextDisabled ?? throw new ArgumentNullException(nameof(ribbonLabelTextDisabled));
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonGroupNormalDisabledTextToContent.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonGroupNormalDisabledTextToContent.cs
index d276e2cac..3d1c43569 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonGroupNormalDisabledTextToContent.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonGroupNormalDisabledTextToContent.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -33,8 +33,18 @@ public RibbonGroupNormalDisabledTextToContent([DisallowNull] PaletteRibbonGenera
[DisallowNull] IPaletteRibbonText ribbonGroupTextDisabled)
: base(ribbonGeneral)
{
- Debug.Assert(ribbonGroupTextNormal != null);
- Debug.Assert(ribbonGroupTextDisabled != null);
+ Debug.Assert(ribbonGroupTextNormal is not null);
+ Debug.Assert(ribbonGroupTextDisabled is not null);
+
+ if (ribbonGroupTextNormal is null)
+ {
+ throw new ArgumentNullException(nameof(ribbonGroupTextNormal));
+ }
+
+ if (ribbonGroupTextDisabled is null)
+ {
+ throw new ArgumentNullException(nameof(ribbonGroupTextDisabled));
+ }
_ribbonGroupTextNormal = ribbonGroupTextNormal;
_ribbonGroupTextDisabled = ribbonGroupTextDisabled;
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonGroupTextToContent.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonGroupTextToContent.cs
index 15fe1fdfe..4e9fd16b6 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonGroupTextToContent.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonGroupTextToContent.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -26,8 +26,9 @@ public RibbonGroupTextToContent([DisallowNull] PaletteRibbonGeneral ribbonGenera
[DisallowNull] IPaletteRibbonText ribbonGroupText)
: base(ribbonGeneral)
{
- Debug.Assert(ribbonGroupText != null);
- PaletteRibbonGroup = ribbonGroupText;
+ Debug.Assert(ribbonGroupText is not null);
+
+ PaletteRibbonGroup = ribbonGroupText ?? throw new ArgumentNullException(nameof(ribbonGroupText));
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonRecentDocsEntryToContent.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonRecentDocsEntryToContent.cs
index 7a8e367fb..396d94bf0 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonRecentDocsEntryToContent.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonRecentDocsEntryToContent.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -30,8 +30,9 @@ public RibbonRecentDocsEntryToContent([DisallowNull] PaletteRibbonGeneral ribbon
[DisallowNull] IPaletteRibbonText ribbonRecentDocEntryText)
: base(ribbonGeneral)
{
- Debug.Assert(ribbonRecentDocEntryText != null);
- _ribbonRecentDocEntryText = ribbonRecentDocEntryText;
+ Debug.Assert(ribbonRecentDocEntryText is not null);
+
+ _ribbonRecentDocEntryText = ribbonRecentDocEntryText ?? throw new ArgumentNullException(nameof(ribbonRecentDocEntryText));
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonRecentDocsShortCutToContent.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonRecentDocsShortCutToContent.cs
index cdb8579c5..2b59db297 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonRecentDocsShortCutToContent.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonRecentDocsShortCutToContent.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonRecentDocsTitleToContent.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonRecentDocsTitleToContent.cs
index a1032bb62..5727198be 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonRecentDocsTitleToContent.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonRecentDocsTitleToContent.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -35,8 +35,9 @@ public RibbonRecentDocsTitleToContent([DisallowNull] PaletteRibbonGeneral ribbon
[DisallowNull] IPaletteRibbonText ribbonRecentTitleText)
: base(ribbonGeneral)
{
- Debug.Assert(ribbonRecentTitleText != null);
- _ribbonRecentTitleText = ribbonRecentTitleText;
+ Debug.Assert(ribbonRecentTitleText is not null);
+
+ _ribbonRecentTitleText = ribbonRecentTitleText ?? throw new ArgumentNullException(nameof(ribbonRecentTitleText));
}
///
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonShortcuts.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonShortcuts.cs
index 14538fffe..e563295ef 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonShortcuts.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonShortcuts.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -45,9 +45,10 @@ public RibbonShortcuts()
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => (ToggleMinimizeMode == DEFAULT_TOGGLE_MINIMIZE_MODE) &&
- (ToggleKeyboardAccess1 == DEFAULT_TOGGLE_KEYBOARD_ACCESS1) &&
- (ToggleKeyboardAccess2 == DEFAULT_TOGGLE_KEYBOARD_ACCESS2);
+ (ToggleKeyboardAccess1 == DEFAULT_TOGGLE_KEYBOARD_ACCESS1) &&
+ (ToggleKeyboardAccess2 == DEFAULT_TOGGLE_KEYBOARD_ACCESS2);
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonTabToContent.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonTabToContent.cs
index b19a792a8..21a67b0b2 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonTabToContent.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonTabToContent.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -26,8 +26,9 @@ public RibbonTabToContent([DisallowNull] PaletteRibbonGeneral ribbonGeneral,
[DisallowNull] IPaletteRibbonText ribbonTabText)
: base(ribbonGeneral)
{
- Debug.Assert(ribbonTabText != null);
- PaletteRibbonText = ribbonTabText;
+ Debug.Assert(ribbonTabText is not null);
+
+ PaletteRibbonText = ribbonTabText ?? throw new ArgumentNullException(nameof(ribbonTabText));
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonThemeManager.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonThemeManager.cs
deleted file mode 100644
index e8fc79fa1..000000000
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonThemeManager.cs
+++ /dev/null
@@ -1,193 +0,0 @@
-#region BSD License
-/*
- *
- * Original BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE)
- * © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
- *
- * New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
- *
- */
-#endregion
-
-namespace Krypton.Ribbon
-{
- ///
- /// Allows the developer to easily access the entire array of supported themes for ribbon controls.
- ///
- public class RibbonThemeManager
- {
- #region Implementation
-
- ///
- /// Applies the theme.
- ///
- /// The mode.
- /// The manager.
- private static void ApplyTheme(PaletteMode mode, KryptonManager manager) => manager.GlobalPaletteMode = mode;
-
- /// Gets the palette mode.
- /// The manager.
- /// The current .
- public static PaletteMode GetPaletteMode(KryptonManager manager) => ReturnPaletteMode(manager.GlobalPaletteMode);
-
- private static PaletteMode ReturnPaletteMode(string themeName)
- {
- return PaletteModeStrings.SupportedThemesMap.TryGetValue(themeName, out var mode)
- ? mode
- : // Note: Needs to be filled out
- PaletteMode.Custom;
- }
-
- /// Returns the palette mode.
- /// The palette mode manager.
- /// The selected .
- private static PaletteMode ReturnPaletteMode(PaletteMode paletteMode) => paletteMode;
-
- ///
- /// Applies the theme.
- ///
- /// Name of the theme.
- /// The manager.
- public static void ApplyTheme(string themeName, KryptonManager manager) => ApplyTheme(PaletteModeStrings.SupportedThemesMap[themeName], manager);
-
- ///
- /// Sets the theme.
- ///
- /// Name of the theme.
- /// The manager.
- public static void SetTheme(string themeName, KryptonManager manager)
- {
- try
- {
- ApplyTheme(themeName, manager);
-
- ApplyGlobalTheme(manager, GetPaletteMode(manager));
- }
- catch (Exception exc)
- {
- ExceptionHandler.CaptureException(exc);
- }
- }
-
- ///
- /// Returns the palette mode manager as string.
- ///
- /// The palette mode manager.
- /// The manager.
- /// The chosen theme as a string.
- public static string? ReturnPaletteModeAsString(PaletteMode paletteMode, KryptonManager? manager)
- {
- var mode = manager?.GlobalPaletteMode ?? paletteMode;
- var cnvtr = new PaletteModeConverter();
- return cnvtr.ConvertToString(mode);
- }
-
- ///
- /// Loads the custom theme.
- ///
- /// The palette.
- /// The manager.
- /// A custom theme file.
- /// if set to true [silent].
- 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 KryptonCustomPaletteBase();
-
- manager = new KryptonManager();
-
- // Prompt user for palette definition
-
- // TODO: Add silent option
- if (silent)
- {
- if (themeFile is not ("" and ""))
- {
- palette.Import(themeFile, silent);
- }
- }
- else
- {
- palette.Import();
- }
-
- // Set manager
- manager.GlobalPalette = palette;
-
- ApplyTheme(PaletteMode.Custom, manager);
- }
- catch (Exception exc)
- {
- ExceptionHandler.CaptureException(exc);
- }
- }
-
- ///
- /// Returns the palette mode as string.
- ///
- /// The palette mode.
- ///
- public static string? ReturnPaletteModeAsString(PaletteMode paletteMode)
- {
- var modeConverter = new PaletteModeConverter();
-
- return modeConverter.ConvertToString(paletteMode);
- }
-
- ///
- /// Applies the global theme.
- ///
- /// The manager.
- /// The palette mode manager.
- public static void ApplyGlobalTheme(KryptonManager manager, PaletteMode paletteMode)
- {
- try
- {
- manager.GlobalPaletteMode = paletteMode;
- }
- catch (Exception exc)
- {
- ExceptionHandler.CaptureException(exc);
- }
- }
-
- private static void AddToCollection(IList target, string[] excludes)
- {
- try
- {
- foreach (var theme in PaletteModeStrings.SupportedThemesMap.Keys)
- {
- if (!excludes.Any(t => theme.IndexOf(t, StringComparison.InvariantCultureIgnoreCase) > -1))
- {
- target.Add(theme);
- }
- }
- }
- catch (Exception exc)
- {
- ExceptionHandler.CaptureException(exc);
- }
- }
-
- ///
- /// Applies the theme manager mode.
- ///
- /// Name of the theme.
- /// The equivalent.
- public static PaletteMode GetThemeManagerMode(string themeName) => PaletteModeStrings.SupportedThemesMap[themeName];
-
- ///
- /// Propagates the theme selector.
- ///
- /// The target.
- /// do not include any string containing
- public static void PropagateThemeSelector(KryptonRibbonGroupThemeComboBox target, params string[] excludePartials) => AddToCollection(target.Items, excludePartials);
-
- #endregion
- }
-}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonToContent.cs b/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonToContent.cs
index b02f7d979..114b8b823 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonToContent.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Palette/RibbonToContent.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -23,8 +23,9 @@ internal class RibbonToContent : IPaletteContent
/// Source for general ribbon settings.
public RibbonToContent([DisallowNull] PaletteRibbonGeneral ribbonGeneral)
{
- Debug.Assert(ribbonGeneral != null);
- RibbonGeneral = ribbonGeneral;
+ Debug.Assert(ribbonGeneral is not null);
+
+ RibbonGeneral = ribbonGeneral ?? throw new ArgumentNullException(nameof(ribbonGeneral));
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/Utilities/BiDictionary.cs b/Source/Krypton Components/Krypton.Ribbon/Utilities/BiDictionary.cs
index 18b7987fb..1b642fcca 100644
--- a/Source/Krypton Components/Krypton.Ribbon/Utilities/BiDictionary.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/Utilities/BiDictionary.cs
@@ -1,7 +1,7 @@
#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.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2022 - 2024. All rights reserved.
*
*/
#endregion
@@ -19,8 +19,10 @@ internal class BiDictionary
private static readonly IList _emptyFirstList = Array.Empty();
private static readonly IList _emptySecondList = Array.Empty();
+#pragma warning disable CS8714 // The type cannot be used as type parameter in the generic type or method. Nullability of type argument doesn't match 'notnull' constraint.
private readonly IDictionary _firstToSecond = new Dictionary();
private readonly IDictionary _secondToFirst = new Dictionary();
+#pragma warning restore CS8714 // The type cannot be used as type parameter in the generic type or method. Nullability of type argument doesn't match 'notnull' constraint.
public BiDictionary(IDictionary dictionary)
@@ -51,13 +53,13 @@ public void Add(TFirst first, TSecond second)
public TSecond GetByFirst(TFirst first)
{
_firstToSecond.TryGetValue(first, out var second);
- return second;
+ return second!;
}
public TFirst GetBySecond(TSecond second)
{
_secondToFirst.TryGetValue(second, out var first);
- return first;
+ return first!;
}
public ICollection GetAllFirsts() => _firstToSecond.Keys;
diff --git a/Source/Krypton Components/Krypton.Ribbon/Utilities/ExceptionHandler.cs b/Source/Krypton Components/Krypton.Ribbon/Utilities/ExceptionHandler.cs
deleted file mode 100644
index e45773382..000000000
--- a/Source/Krypton Components/Krypton.Ribbon/Utilities/ExceptionHandler.cs
+++ /dev/null
@@ -1,105 +0,0 @@
-#region BSD License
-/*
- *
- * Original BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE)
- * © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
- *
- * New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
- *
- */
-#endregion
-
-namespace Krypton.Ribbon
-{
- ///
- /// This class is designed to handle thrown exceptions. (FOR INTERNAL USE ONLY!)
- ///
- internal class ExceptionHandler
- {
- #region Constructor
- /// Initializes a new instance of the class.
- public ExceptionHandler()
- {
-
- }
- #endregion
-
- #region Methods
- /// Captures the exception.
- /// The exception.
- /// The title.
- /// The buttons.
- /// The icon.
- /// Name of the class.
- /// The method signature.
- public static void CaptureException(Exception exception, string title = @"Exception Caught", KryptonMessageBoxButtons buttons = KryptonMessageBoxButtons.OK, KryptonMessageBoxIcon icon = KryptonMessageBoxIcon.Error, string className = "", string methodSignature = "")
- {
- if (className != "")
- {
- KryptonMessageBox.Show($"An unexpected error has occurred: {exception.Message}.\n\nError in class: '{className}.cs'.", title, buttons, icon);
- }
- else if (methodSignature != "")
- {
- KryptonMessageBox.Show($"An unexpected error has occurred: {exception.Message}.\n\nError in method: '{methodSignature}'.", title, buttons, icon);
- }
- else if (className != "" && methodSignature != "")
- {
- KryptonMessageBox.Show($"An unexpected error has occurred: {exception.Message}.\n\nError in class: '{className}.cs'.\n\nError in method: '{methodSignature}'.", title, buttons, icon);
- }
- else
- {
- KryptonMessageBox.Show($"An unexpected error has occurred: {exception.Message}.", title, buttons, icon);
- }
- }
-
- /// Captures a stack trace of the exception.
- /// The incoming exception.
- /// The file to write the exception stack trace to.
- public static void PrintStackTrace(Exception exc, string fileName)
- {
- try
- {
- if (!File.Exists(fileName))
- {
- File.Create(fileName);
- }
-
- using var writer = new StreamWriter(fileName);
-
- writer.Write(exc.ToString());
-
- writer.Close();
- }
- catch (Exception e)
- {
- CaptureException(e);
- }
- }
-
- /// Captures a stack trace of the exception.
- /// The incoming exception.
- /// The file to write the exception stack trace to.
- public static void PrintExceptionStackTrace(Exception exc, string fileName)
- {
- try
- {
- if (!File.Exists(fileName))
- {
- File.Create(fileName);
- }
-
- using var writer = new StreamWriter(fileName);
-
- writer.Write(exc.StackTrace);
-
- writer.Close();
- }
- catch (Exception e)
- {
- CaptureException(e);
- }
- }
- #endregion
- }
-}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Ribbon/Utilities/KryptonRibbonMerger.cs b/Source/Krypton Components/Krypton.Ribbon/Utilities/KryptonRibbonMerger.cs
new file mode 100644
index 000000000..6782b9092
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Ribbon/Utilities/KryptonRibbonMerger.cs
@@ -0,0 +1,413 @@
+#region Original MIT License
+
+/*
+ * Copyright(C) 2018 Michael Winsor
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ * Created: September 28, 2018 9:03:32 PM
+ */
+
+#endregion
+
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+namespace Krypton.Ribbon
+{
+ /// Merges a krypton ribbon with another ribbon.
+ ///
+ /// To affect the order of the merged groups and tabs, set the Tag property to a value from 0 to n, where n is the count of the target group minus 1.
+ ///
+ public class KryptonRibbonMerger
+ {
+ #region Instance Fields
+
+ private readonly HashSet _mergedItems = new HashSet();
+
+ #endregion
+
+ #region Public
+
+ ///
+ /// Property to return the target ribbon that will receive the merged items.
+ ///
+ public KryptonRibbon TargetRibbon
+ {
+ get;
+ }
+
+ #endregion
+
+ #region Identity
+
+ ///
+ /// Merges a krypton ribbon with another ribbon.
+ ///
+ /// The ribbon to merge with.
+ /// Will be thrown if the parameter targetRibbon is null.
+ public KryptonRibbonMerger([DisallowNull ]KryptonRibbon targetRibbon)
+ {
+ TargetRibbon = targetRibbon ?? throw new ArgumentNullException(nameof(targetRibbon));
+ }
+
+ #endregion
+
+ #region Implementation
+
+ ///
+ /// Function to retrieve the sorting index from the items tag.
+ ///
+ /// The value for the tag.
+ /// The maximum value for the items.
+ /// The sorting index.
+ private int GetSortIndexFromTag(object tagValue, int maxValue)
+ {
+ if (maxValue < 0)
+ {
+ return 0;
+ }
+
+ return tagValue switch
+ {
+ null => maxValue,
+ string when int.TryParse(tagValue.ToString(), NumberStyles.Integer, CultureInfo.CurrentCulture,
+ out int parsedValue) => parsedValue.Max(0).Min(maxValue),
+ _ => (int)Convert.ChangeType(tagValue, typeof(int))
+ };
+ }
+
+ ///
+ /// Function to unmerge items for a group from an existing items list in the target ribbon group.
+ ///
+ /// The source items to unmerge.
+ /// The destination items to unmerge.
+ private void UnmergeGroupItems(KryptonRibbonGroupContainerCollection sourceItems, KryptonRibbonGroupContainerCollection targetItems)
+ {
+ IEnumerable items = targetItems.ToArray();
+
+ foreach (KryptonRibbonGroupContainer item in items)
+ {
+ if (!_mergedItems.Contains(item))
+ {
+ continue;
+ }
+
+ _mergedItems.Remove(item);
+ targetItems.Remove(item);
+ sourceItems.Add(item);
+ }
+ }
+
+ ///
+ /// Function to merge items from a group into an existing items list in the target ribbon group.
+ ///
+ /// The source items to merge.
+ /// The destination items to merge.
+ private void MergeGroupItems(KryptonRibbonGroupContainerCollection sourceItems, KryptonRibbonGroupContainerCollection targetItems)
+ {
+ IEnumerable items = sourceItems.ToArray();
+
+ foreach (KryptonRibbonGroupContainer sourceItem in items)
+ {
+ if (targetItems.Contains(sourceItem))
+ {
+ continue;
+ }
+
+ sourceItems.Remove(sourceItem);
+ int index = GetSortIndexFromTag(sourceItem.Tag!, targetItems.Count);
+ targetItems.Insert(index, sourceItem);
+
+ if (!_mergedItems.Contains(sourceItem))
+ {
+ _mergedItems.Add(sourceItem);
+ }
+ }
+ }
+
+ ///
+ /// Function to unmerge the groups for a tab from an existing tab in the target ribbon tab.
+ ///
+ /// The source groups to unmerge.
+ /// The destination groups to unmerge.
+ private void UnmergeGroups(KryptonRibbonGroupCollection sourceGroups, KryptonRibbonGroupCollection targetGroups)
+ {
+ IEnumerable groups = targetGroups.ToArray();
+
+ foreach (KryptonRibbonGroup grp in groups)
+ {
+ if (!_mergedItems.Contains(grp))
+ {
+ KryptonRibbonGroup? existingGroup = sourceGroups.FirstOrDefault(item => (string.Equals(item.TextLine1, grp.TextLine1, StringComparison.CurrentCulture))
+ && (string.Equals(item.TextLine2, grp.TextLine2, StringComparison.CurrentCulture)));
+
+ if (existingGroup is not null)
+ {
+ UnmergeGroupItems(existingGroup.Items, grp.Items);
+ }
+
+ continue;
+ }
+
+ _mergedItems.Remove(grp);
+ targetGroups.Remove(grp);
+ sourceGroups.Add(grp);
+ }
+ }
+
+ ///
+ /// Function to merge the groups from a tab into an existing tab in the target ribbon tab.
+ ///
+ /// The source groups to merge.
+ /// The destination groups to merge.
+ private void MergeGroups(KryptonRibbonGroupCollection sourceGroups, KryptonRibbonGroupCollection targetGroups)
+ {
+ IEnumerable groups = sourceGroups.ToArray();
+
+ foreach (KryptonRibbonGroup sourceGroup in groups)
+ {
+ KryptonRibbonGroup? existingGroup = targetGroups.FirstOrDefault(item => (string.Equals(item.TextLine1, sourceGroup.TextLine1, StringComparison.CurrentCulture))
+ && (string.Equals(item.TextLine2, sourceGroup.TextLine2, StringComparison.CurrentCulture)));
+
+ if ((existingGroup is null) && (!targetGroups.Contains(sourceGroup)))
+ {
+ sourceGroups.Remove(sourceGroup);
+
+ int index = GetSortIndexFromTag(sourceGroup.Tag!, targetGroups.Count);
+ targetGroups.Insert(index, sourceGroup);
+ if (!_mergedItems.Contains(sourceGroup))
+ {
+ _mergedItems.Add(sourceGroup);
+ }
+ continue;
+ }
+
+ // We'll need to merge the group items.
+ MergeGroupItems(sourceGroup.Items, existingGroup!.Items);
+ }
+ }
+
+ ///
+ /// Function to merge the tabs for a source ribbon into a target ribbon.
+ ///
+ /// The ribbon to merge.
+ /// The ribbon to be merged into.
+ private void MergeTabs(KryptonRibbon? sourceRibbon, KryptonRibbon targetRibbon)
+ {
+ IEnumerable sourceTabs = sourceRibbon!.RibbonTabs.ToArray();
+
+ foreach (KryptonRibbonTab tab in sourceTabs)
+ {
+ KryptonRibbonTab? existingTab = targetRibbon.RibbonTabs.FirstOrDefault(item => string.Equals(item.Text, tab.Text, StringComparison.CurrentCulture));
+
+ // The tab doesn't exist, so just add it
+ if ((existingTab is null) && (!targetRibbon.RibbonTabs.Contains(tab)))
+ {
+ sourceRibbon.RibbonTabs.Remove(tab);
+
+ int index = GetSortIndexFromTag(tab.Tag!, targetRibbon.RibbonTabs.Count);
+
+ targetRibbon.RibbonTabs.Insert(index, tab);
+ if (!_mergedItems.Contains(tab))
+ {
+ _mergedItems.Add(tab);
+ }
+ continue;
+ }
+
+ // We'll need to merge the groups.
+ MergeGroups(tab.Groups, existingTab!.Groups);
+ }
+ }
+
+ ///
+ /// Function to unmerge the contexts for a source ribbon from a target ribbon.
+ ///
+ /// The ribbon to unmerge.
+ /// The ribbon to be unmerged from.
+ private void UnmergeContexts(KryptonRibbon sourceRibbon, KryptonRibbon targetRibbon)
+ {
+ IEnumerable contexts = targetRibbon.RibbonContexts.ToArray();
+
+ foreach (KryptonRibbonContext context in contexts)
+ {
+ if (!_mergedItems.Contains(context))
+ {
+ continue;
+ }
+
+ KryptonRibbonContext? existing = sourceRibbon.RibbonContexts.FirstOrDefault(item => string.Equals(item.ContextTitle, context.ContextTitle, StringComparison.CurrentCulture));
+
+ // The tab doesn't exist, so just add it
+ if ((existing is not null) || (sourceRibbon.RibbonContexts.Contains(context)))
+ {
+ continue;
+ }
+
+ _mergedItems.Remove(context);
+ targetRibbon.RibbonContexts.Remove(context);
+ sourceRibbon.RibbonContexts.Add(context);
+ }
+ }
+
+ ///
+ /// Function to merge the contexts for a source ribbon into a target ribbon.
+ ///
+ /// The ribbon to merge.
+ /// The ribbon to be merged into.
+ private void MergeContexts(KryptonRibbon? sourceRibbon, KryptonRibbon targetRibbon)
+ {
+ IEnumerable contexts = sourceRibbon!.RibbonContexts.ToArray();
+
+ foreach (KryptonRibbonContext context in contexts)
+ {
+ KryptonRibbonContext? existing = targetRibbon.RibbonContexts.FirstOrDefault(item => string.Equals(item.ContextTitle, context.ContextTitle, StringComparison.CurrentCulture));
+
+ // The tab doesn't exist, so just add it
+ if ((existing is not null) || (targetRibbon.RibbonContexts.Contains(context)))
+ {
+ continue;
+ }
+
+ sourceRibbon.RibbonContexts.Remove(context);
+
+ int index = GetSortIndexFromTag(context.Tag!, targetRibbon.RibbonContexts.Count);
+
+ targetRibbon.RibbonContexts.Insert(index, context);
+ if (!_mergedItems.Contains(context))
+ {
+ _mergedItems.Add(context);
+ }
+ }
+ }
+
+ ///
+ /// Function to unmerge the tabs for a source ribbon from a target ribbon.
+ ///
+ /// The ribbon to merge into.
+ /// The ribbon to be unmerged from.
+ private void UnmergeTabs(KryptonRibbon sourceRibbon, KryptonRibbon targetRibbon)
+ {
+ IEnumerable tabs = targetRibbon.RibbonTabs.ToArray();
+
+ foreach (KryptonRibbonTab tab in tabs)
+ {
+ if (!_mergedItems.Contains(tab))
+ {
+ KryptonRibbonTab? existingTab = sourceRibbon.RibbonTabs.FirstOrDefault(item => string.Equals(item.Text, tab.Text, StringComparison.CurrentCulture));
+
+ if (existingTab is not null)
+ {
+ UnmergeGroups(existingTab.Groups, tab.Groups);
+ }
+ continue;
+ }
+
+ _mergedItems.Remove(tab);
+ targetRibbon.RibbonTabs.Remove(tab);
+ sourceRibbon.RibbonTabs.Add(tab);
+ }
+ }
+
+ ///
+ /// Function to merge a ribbon with the target ribbon
+ ///
+ /// The ribbon to merge.
+ public void Merge(KryptonRibbon? ribbon)
+ {
+ if (ribbon is null)
+ {
+ return;
+ }
+
+ string selectedContext = TargetRibbon.SelectedContext;
+ KryptonRibbonTab? selectedTab = TargetRibbon.SelectedTab;
+
+ MergeTabs(ribbon, TargetRibbon);
+ MergeContexts(ribbon, TargetRibbon);
+
+ // Ensure that the layout is refreshed.
+ TargetRibbon.CheckPerformLayout();
+ ribbon.CheckPerformLayout();
+
+ // Restore the selected tab.
+ TargetRibbon.SelectedContext = selectedContext;
+ TargetRibbon.SelectedTab = selectedTab;
+
+ FixGroupWidths();
+ }
+
+ ///
+ /// Function to unmerge the specified ribbon from the target ribbon.
+ ///
+ /// The ribbon to unmerge.
+ public void UnMerge(KryptonRibbon? ribbon)
+ {
+ if (ribbon is null)
+ {
+ return;
+ }
+
+ KryptonRibbonTab? selected = TargetRibbon.SelectedTab;
+
+ UnmergeContexts(ribbon, TargetRibbon);
+ UnmergeTabs(ribbon, TargetRibbon);
+
+ // Ensure that the layout is refreshed.
+ TargetRibbon.CheckPerformLayout();
+ ribbon.CheckPerformLayout();
+
+ // Restore the selected tab.
+ if (TargetRibbon.RibbonTabs.Contains(selected))
+ {
+ TargetRibbon.SelectedTab = selected;
+ }
+ else
+ {
+ TargetRibbon.ResetSelectedTab();
+ }
+ }
+
+ ///
+ /// Function to correct the clipping for groups that have long names, but little content.
+ ///
+ public void FixGroupWidths()
+ {
+ using var g = Graphics.FromHwnd(TargetRibbon.Parent!.Handle);
+ double dpi = g.DpiY / 96.0;
+
+ foreach (KryptonRibbonTab tab in TargetRibbon.RibbonTabs)
+ {
+ foreach (KryptonRibbonGroup grp in tab.Groups)
+ {
+ Size size = TextRenderer.MeasureText(g, grp.TextLine1 + (string.IsNullOrWhiteSpace(grp.TextLine2) ? " " + grp.TextLine2 : string.Empty), TargetRibbon.Parent.Font);
+ grp.MinimumWidth = size.Width + (int)(8 * dpi);
+ }
+ }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Ribbon/Utilities/MathExtensions.cs b/Source/Krypton Components/Krypton.Ribbon/Utilities/MathExtensions.cs
new file mode 100644
index 000000000..a6023d83a
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Ribbon/Utilities/MathExtensions.cs
@@ -0,0 +1,1372 @@
+#region Original MIT License
+
+/*
+ * Copyright(C) 2018 Michael Winsor
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ * Created: September 28, 2018 9:03:32 PM
+ */
+
+#endregion
+
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+namespace Krypton.Ribbon
+{
+ ///
+ /// Fluent extensions for mathematical operations on various numeric types.
+ ///
+ ///
+ ///
+ /// This provides a fluent interface to numeric types (e.g. , , , etc...) that will expose common mathematical functions without relying on
+ /// methods from . This makes it easy to chain together several functions to retrieve a result, for example:
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// Other mathematical functions are included, such as , , , etc...
+ ///
+ ///
+ /// CS3002 Warning
+ /// Extensions handling NON CLS-compliant data types have been disabled.
+ /// This goes for all unsigned types, except byte.
+ /// The attribute [System.CLSCompliant(true)] has been added to the class header
+ /// See:
+ ///
+ ///
+ [System.CLSCompliant(true)]
+ public static class MathExtensions
+ {
+ #region Constants.
+ // Constant containing the value used to convert degrees to radians.
+ private const float DEG_CONVERT = ((float)Math.PI / 180.0f);
+ // Constant containing the value used to convert radians to degrees.
+ private const float RAD_CONVERT = (180.0f / (float)Math.PI);
+
+ ///
+ /// Constant value for π.
+ ///
+ public const float PI = 3.141593f;
+ #endregion
+
+ #region Implementation
+ ///
+ /// Function to perform an approximation of a sine calculation.
+ ///
+ /// The angle, in radians.
+ /// The sine value for the angle.
+ ///
+ ///
+ /// This method will produce an approximation of the value returned by . Because this is an approximation, this method should not be used when accuracy is important.
+ ///
+ ///
+ /// This version of the sine function has better performance than the method, and as such, should be used in performance intensive situations.
+ ///
+ ///
+ /// This code was adapted from the GameDev.Net post by L.Spiro found here:
+ /// http://www.gamedev.net/topic/681723-faster-sin-and-cos/ .
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float FastSin(this float rads)
+ {
+ int i32I = (int)(rads * 0.31830988618379067153776752674503); // 1 / PI.
+ double radians = rads - ((i32I) * 3.1415926535897932384626433832795);
+
+ double fX2 = radians * radians;
+
+ return (float)(((i32I & 1) == 1)
+ ? -radians * ((1.00000000000000000000e+00) +
+ (fX2 * ((-1.66666671633720397949e-01) +
+ (fX2 * ((8.33333376795053482056e-03) +
+ (fX2 * ((-1.98412497411482036114e-04) +
+ (fX2 * ((2.75565571428160183132e-06) +
+ (fX2 * ((-2.50368472620721149724e-08) +
+ (fX2 * ((1.58849267073435385100e-10) +
+ (fX2 * (-6.58925550841432672300e-13)))))))))))))))
+ : radians * ((1.00000000000000000000e+00) +
+ (fX2 * ((-1.66666671633720397949e-01) +
+ (fX2 * ((8.33333376795053482056e-03) +
+ (fX2 * ((-1.98412497411482036114e-04) +
+ (fX2 * ((2.75565571428160183132e-06) +
+ (fX2 * ((-2.50368472620721149724e-08) +
+ (fX2 * ((1.58849267073435385100e-10) +
+ (fX2 * (-6.58925550841432672300e-13))))))))))))))));
+ }
+
+ ///
+ /// Function to perform an approximation of a cosine calculation.
+ ///
+ /// The angle, in radians.
+ /// The cosine value for the angle.
+ ///
+ ///
+ /// This method will produce an approximation of the value returned by . Because this is an approximation, this method should not be used when accuracy is important.
+ ///
+ ///
+ /// This version of the cosine function has better performance than the method, and as such, should be used in performance intensive situations.
+ ///
+ ///
+ /// This code was adapted from the GameDev.Net post by L.Spiro found here:
+ /// http://www.gamedev.net/topic/681723-faster-sin-and-cos/ .
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float FastCos(this float rads)
+ {
+ int i32I = (int)(rads * 0.31830988618379067153776752674503); // 1 / PI.
+ double radians = rads - ((i32I) * 3.1415926535897932384626433832795);
+
+ double fX2 = radians * radians;
+
+ return (float)(((i32I & 1) == 1)
+ ? -(1.00000000000000000000e+00) -
+ (fX2 * ((-5.00000000000000000000e-01) +
+ (fX2 * ((4.16666641831398010254e-02) +
+ (fX2 * ((-1.38888671062886714935e-03) +
+ (fX2 * ((2.48006890615215525031e-05) +
+ (fX2 * ((-2.75369927749125054106e-07) +
+ (fX2 * ((2.06207229069832465029e-09) +
+ (fX2 * (-9.77507137733812925262e-12))))))))))))))
+ : (1.00000000000000000000e+00) +
+ (fX2 * ((-5.00000000000000000000e-01) +
+ (fX2 * ((4.16666641831398010254e-02) +
+ (fX2 * ((-1.38888671062886714935e-03) +
+ (fX2 * ((2.48006890615215525031e-05) +
+ (fX2 * ((-2.75369927749125054106e-07) +
+ (fX2 * ((2.06207229069832465029e-09) +
+ (fX2 * (-9.77507137733812925262e-12)))))))))))))));
+ }
+
+ ///
+ /// Function to return the maximum value between two values.
+ ///
+ /// The first value to test.
+ /// The second value to test.
+ /// The larger of the two values.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static byte Max(this byte value1, byte value2) => (value1 > value2) ? value1 : value2;
+
+ ///
+ /// Function to return the minimum value between two values.
+ ///
+ /// The first value to test.
+ /// The second value to test.
+ /// The smaller of the two values.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static byte Min(this byte value1, byte value2) => (value1 < value2) ? value1 : value2;
+
+ /* Disabled CLS Non Compliant
+ ///
+ /// Function to return the maximum value between two values.
+ ///
+ /// The first value to test.
+ /// The second value to test.
+ /// The larger of the two values.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static ushort Max(this ushort value1, ushort value2) => (value1 > value2) ? value1 : value2;
+ */
+
+ /* Disabled CLS Non Compliant
+ ///
+ /// Function to return the minimum value between two values.
+ ///
+ /// The first value to test.
+ /// The second value to test.
+ /// The smaller of the two values.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static ushort Min(this ushort value1, ushort value2) => (value1 < value2) ? value1 : value2;
+ */
+ ///
+ /// Function to return the maximum value between two values.
+ ///
+ /// The first value to test.
+ /// The second value to test.
+ /// The larger of the two values.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static short Max(this short value1, short value2) => (value1 > value2) ? value1 : value2;
+
+ ///
+ /// Function to return the minimum value between two values.
+ ///
+ /// The first value to test.
+ /// The second value to test.
+ /// The smaller of the two values.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static short Min(this short value1, short value2) => (value1 < value2) ? value1 : value2;
+
+ /* Disabled CLS Non Compliant
+ ///
+ /// Function to return the maximum value between two values.
+ ///
+ /// The first value to test.
+ /// The second value to test.
+ /// The larger of the two values.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static uint Max(this uint value1, uint value2) => (value1 > value2) ? value1 : value2;
+ */
+
+ /* Disabled CLS Non Compliant
+ ///
+ /// Function to return the minimum value between two values.
+ ///
+ /// The first value to test.
+ /// The second value to test.
+ /// The smaller of the two values.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static uint Min(this uint value1, uint value2) => (value1 < value2) ? value1 : value2;
+ */
+
+ ///
+ /// Function to return the maximum value between two values.
+ ///
+ /// The first value to test.
+ /// The second value to test.
+ /// The larger of the two values.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static int Max(this int value1, int value2) => (value1 > value2) ? value1 : value2;
+
+ ///
+ /// Function to return the minimum value between two values.
+ ///
+ /// The first value to test.
+ /// The second value to test.
+ /// The smaller of the two values.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static int Min(this int value1, int value2) => (value1 < value2) ? value1 : value2;
+
+ /* Disabled CLS Non Compliant
+ ///
+ /// Function to return the maximum value between two values.
+ ///
+ /// The first value to test.
+ /// The second value to test.
+ /// The larger of the two values.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static ulong Max(this ulong value1, ulong value2) => (value1 > value2) ? value1 : value2;
+ */
+
+ /* Disabled CLS Non Compliant
+ ///
+ /// Function to return the minimum value between two values.
+ ///
+ /// The first value to test.
+ /// The second value to test.
+ /// The smaller of the two values.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static ulong Min(this ulong value1, ulong value2) => (value1 < value2) ? value1 : value2;
+ */
+
+ ///
+ /// Function to return the maximum value between two values.
+ ///
+ /// The first value to test.
+ /// The second value to test.
+ /// The larger of the two values.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static long Max(this long value1, long value2) => (value1 > value2) ? value1 : value2;
+
+ ///
+ /// Function to return the minimum value between two values..
+ ///
+ /// The first value to test.
+ /// The second value to test.
+ /// The smaller of the two values.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static long Min(this long value1, long value2) => (value1 < value2) ? value1 : value2;
+
+ ///
+ /// Function to return the maximum value between two values.
+ ///
+ /// The first value to test.
+ /// The second value to test.
+ /// The larger of the two values.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float Max(this float value1, float value2) => (value1 > value2) ? value1 : value2;
+
+ ///
+ /// Function to return the minimum value between two values.
+ ///
+ /// The first value to test.
+ /// The second value to test.
+ /// The smaller of the two values.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float Min(this float value1, float value2) => (value1 < value2) ? value1 : value2;
+
+ ///
+ /// Function to return the maximum value between two values.
+ ///
+ /// The first value to test.
+ /// The second value to test.
+ /// The larger of the two values.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static double Max(this double value1, double value2) => (value1 > value2) ? value1 : value2;
+
+ ///
+ /// Function to return the minimum value between two values.
+ ///
+ /// The first value to test.
+ /// The second value to test.
+ /// The smaller of the two values.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static double Min(this double value1, double value2) => (value1 < value2) ? value1 : value2;
+
+ ///
+ /// Function to return the maximum value between two values.
+ ///
+ /// The first value to test.
+ /// The second value to test.
+ /// The larger of the two values.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static decimal Max(this decimal value1, decimal value2) => (value1 > value2) ? value1 : value2;
+
+ ///
+ /// Function to return the minimum value between two values.
+ ///
+ /// The first value to test.
+ /// The second value to test.
+ /// The smaller of the two values.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static decimal Min(this decimal value1, decimal value2) => (value1 < value2) ? value1 : value2;
+
+ ///
+ /// Function to return the absolute value of a value.
+ ///
+ /// Value to evaluate.
+ /// The absolute value of .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static short Abs(this short value) => Math.Abs(value);
+
+ ///
+ /// Function to return the absolute value of an value.
+ ///
+ /// Value to evaluate.
+ /// The absolute value of .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static int Abs(this int value) => Math.Abs(value);
+
+ ///
+ /// Function to return the absolute value of a value.
+ ///
+ /// Value to evaluate.
+ /// The absolute value of .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static long Abs(this long value) => Math.Abs(value);
+
+ ///
+ /// Function to return the absolute value of a value.
+ ///
+ /// Value to evaluate.
+ /// The absolute value of .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static double Abs(this double value) => Math.Abs(value);
+
+ ///
+ /// Function to return the absolute value of a value.
+ ///
+ /// Value to evaluate.
+ /// The absolute value of .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static decimal Abs(this decimal value) => Math.Abs(value);
+
+ ///
+ /// Function to return the absolute value of a value.
+ ///
+ /// Value to evaluate.
+ /// The absolute value of .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float Abs(this float value) => Math.Abs(value);
+
+ ///
+ /// Function to round a value to the nearest whole or fractional number.
+ ///
+ /// The value to round.
+ /// [Optional] The number of decimal places to round to.
+ /// [Optional] The type of rounding to perform.
+ /// The value rounded to the nearest whole number.
+ ///
+ /// See for more information.
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float Round(this float value, int decimalCount = 0, MidpointRounding rounding = MidpointRounding.ToEven) => (float)(Math.Round(value, decimalCount, rounding));
+
+ ///
+ /// Function to round a value to the nearest whole or fractional number.
+ ///
+ /// The value to round.
+ /// [Optional] The number of decimal places to round to.
+ /// [Optional] The type of rounding to perform.
+ /// The value rounded to the nearest whole number.
+ ///
+ /// See for more information.
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static decimal Round(this decimal value, int decimalCount = 0, MidpointRounding rounding = MidpointRounding.ToEven) => Math.Round(value, decimalCount, rounding);
+
+ ///
+ /// Function to round a value to the nearest whole or fractional number.
+ ///
+ /// The value to round.
+ /// [Optional] The number of decimal places to round to.
+ /// [Optional] The type of rounding to perform.
+ /// The value rounded to the nearest whole number.
+ ///
+ /// See for more information.
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static double Round(this double value, int decimalCount = 0, MidpointRounding rounding = MidpointRounding.ToEven) => Math.Round(value, decimalCount, rounding);
+
+ ///
+ /// Function to convert a value representing a radian into an angle in degrees.
+ ///
+ /// The value to convert.
+ /// The angle in degrees.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float ToDegrees(this float radians) => radians * RAD_CONVERT;
+
+ ///
+ /// Function to convert a value representing an angle in degrees into a radian value.
+ ///
+ /// The angle value to convert.
+ /// The angle in radians.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float ToRadians(this float degrees) => degrees * DEG_CONVERT;
+
+ ///
+ /// Function to convert a value representing a radian into an angle in degrees.
+ ///
+ /// The value to convert.
+ /// The angle in degrees.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static decimal ToDegrees(this decimal radians) => radians * (decimal)RAD_CONVERT;
+
+ ///
+ /// Function to convert a value representing an angle in degrees into a radian value.
+ ///
+ /// The angle value to convert.
+ /// The angle in radians.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static decimal ToRadians(this decimal degrees) => degrees * (decimal)DEG_CONVERT;
+
+
+ ///
+ /// Function to convert a value representing a radian into an angle in degrees.
+ ///
+ /// The value to convert.
+ /// The angle in degrees.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static double ToDegrees(this double radians) => radians * RAD_CONVERT;
+
+ ///
+ /// Function to convert a value representing an angle in degrees into a radian value.
+ ///
+ /// The angle value to convert.
+ /// The angle in radians.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static double ToRadians(this double degrees) => degrees * DEG_CONVERT;
+
+ ///
+ /// Function to determine if a value is equal to another within a given tolerance.
+ ///
+ /// The left value to compare.
+ /// The right value to compare.
+ /// [Optional] The epsilon representing the error tolerance.
+ /// true if equal, false if not.
+ ///
+ ///
+ /// Floating point values are prone to error buildup due to their limited precision. Therefore, when performing a comparison between two floating point values: 4.23212f == 4.23212f may
+ /// actually be 4.232120000005422f == 4.232120000005433f . Obviously, the result will not be true when the values are actually considered equal. This method ensures that the comparison will
+ /// return true by removing the error through the parameter.
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static bool EqualsEpsilon(this float left, float right, float epsilon = 1e-06f) => Abs(right - left) <= epsilon;
+
+ ///
+ /// Function to determine if a value is equal to another within a given tolerance.
+ ///
+ /// The left value to compare.
+ /// The right value to compare.
+ /// [Optional] The epsilon representing the error tolerance.
+ /// true if equal, false if not.
+ ///
+ ///
+ /// Floating point values are prone to error buildup due to their limited precision. Therefore, when performing a comparison between two floating point values: 4.23212f == 4.23212f may
+ /// actually be 4.232120000005422f == 4.232120000005433f . Obviously, the result will not be true when the values are actually considered equal. This method ensures that the comparison will
+ /// return true by removing the error through the parameter.
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static bool EqualsEpsilon(this double left, double right, double epsilon = 1e-12) => Abs(right - left) <= epsilon;
+
+ ///
+ /// Function to return the inverse of the square root for a value.
+ ///
+ /// The value to get the inverse square root of.
+ /// The inverted square root of the value.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static double InverseSqrt(this double value) => 1.0 / Math.Sqrt(value);
+
+ ///
+ /// Function to return the inverse of the square root for a value.
+ ///
+ /// The value to get the inverse square root of.
+ /// The inverted square root of the value.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float InverseSqrt(this float value) => 1.0f / (float)Math.Sqrt(value);
+
+ ///
+ /// Function to return the square root for a value.
+ ///
+ /// The value to get the square root of.
+ /// The square root of the value.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static double Sqrt(this double value) => Math.Sqrt(value);
+
+ ///
+ /// Function to return the square root for a value.
+ ///
+ /// The value to get the square root of.
+ /// The square root of the value.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float Sqrt(this float value) => (float)Math.Sqrt(value);
+
+ ///
+ /// Function to return the sine value of a value representing an angle, in radians.
+ ///
+ /// The angle, in radians.
+ /// The sine value of the .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float Sin(this float angle) => (float)Math.Sin(angle);
+
+ ///
+ /// Function to return the sine value of a value representing an angle, in radians.
+ ///
+ /// The angle, in radians.
+ /// The sine value of the .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static decimal Sin(this decimal angle) => (decimal)Math.Sin((double)angle);
+
+ ///
+ /// Function to return the sine value of a value representing an angle, in radians.
+ ///
+ /// The angle, in radians.
+ /// The sine value of the .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static double Sin(this double angle) => Math.Sin(angle);
+
+ ///
+ /// Function to return the cosine value of a value representing an angle, in radians.
+ ///
+ /// The angle, in radians.
+ /// The cosine value of the .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float Cos(this float angle) => (float)Math.Cos(angle);
+
+ ///
+ /// Function to return the cosine value of a value representing an angle, in radians.
+ ///
+ /// The angle, in radians.
+ /// The cosine value of the .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static decimal Cos(this decimal angle) => (decimal)Math.Cos((double)angle);
+
+ ///
+ /// Function to return the cosine value of a value representing an angle, in radians.
+ ///
+ /// The angle, in radians.
+ /// The cosine value of the .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static double Cos(this double angle) => Math.Cos(angle);
+
+ ///
+ /// Function to return the tangent value of a value representing an angle, in radians.
+ ///
+ /// The angle, in radians.
+ /// The tangent value of the .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float Tan(this float angle) => (float)Math.Tan(angle);
+
+ ///
+ /// Function to return the tangent value of a value representing an angle, in radians.
+ ///
+ /// The angle, in radians.
+ /// The tangent value of the .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static decimal Tan(this decimal angle) => (decimal)Math.Tan((double)angle);
+
+ ///
+ /// Function to return the tangent value of a value representing an angle, in radians.
+ ///
+ /// The angle, in radians.
+ /// The tangent value of the .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static double Tan(this double angle) => Math.Tan(angle);
+
+ ///
+ /// Function to return the inverse sine value of a value representing an angle, in radians.
+ ///
+ /// The sine value.
+ /// The inverse sine value of the .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float ASin(this float sine) => (float)Math.Asin(sine);
+
+ ///
+ /// Function to return the inverse sine value of a value representing an angle, in radians.
+ ///
+ /// The sine value.
+ /// The inverse sine value of the .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static decimal ASin(this decimal sine) => (decimal)Math.Asin((double)sine);
+
+ ///
+ /// Function to return the inverse sine value of a value representing an angle, in radians.
+ ///
+ /// The sine value.
+ /// The inverse sine value of the .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static double ASin(this double sine) => Math.Asin(sine);
+
+ ///
+ /// Function to return the inverse cosine value of a value representing an angle, in radians.
+ ///
+ /// The cosine value.
+ /// The inverse cosine value of the .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float ACos(this float cosine) => (float)Math.Acos(cosine);
+
+ ///
+ /// Function to return the inverse cosine value of a value representing an angle, in radians.
+ ///
+ /// The cosine value.
+ /// The inverse cosine value of the .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static decimal ACos(this decimal cosine) => (decimal)Math.Acos((double)cosine);
+
+ ///
+ /// Function to return the inverse cosine value of a value representing an angle, in radians.
+ ///
+ /// The cosine value.
+ /// The inverse cosine value of the .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static double ACos(this double cosine) => Math.Acos(cosine);
+
+ ///
+ /// Function to return the inverse tangent value of a value representing an angle, in radians.
+ ///
+ /// The tangent value.
+ /// The tangent sine value of the .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float ATan(this float tangent) => (float)Math.Atan(tangent);
+
+ ///
+ /// Function to return the inverse tangent value of a value representing an angle, in radians.
+ ///
+ /// The tangent value.
+ /// The tangent sine value of the .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static decimal ATan(this decimal tangent) => (decimal)Math.Atan((double)tangent);
+
+ ///
+ /// Function to return the inverse tangent value of a value representing an angle, in radians.
+ ///
+ /// The tangent value.
+ /// The tangent sine value of the .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static double ATan(this double tangent) => Math.Atan(tangent);
+
+ ///
+ /// Function to return the inverse tangent of two values representing the horizontal and vertical offset of a slope.
+ ///
+ /// Vertical slope value to retrieve the inverse tangent from.
+ /// Horizontal slope value to retrieve the inverse tangent from.
+ /// The inverse tangent of the slope.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float ATan(this float y, float x) => (float)Math.Atan2(y, x);
+
+ ///
+ /// Function to return the inverse tangent of two values representing the horizontal and vertical offset of a slope.
+ ///
+ /// Vertical slope value to retrieve the inverse tangent from.
+ /// Horizontal slope value to retrieve the inverse tangent from.
+ /// The inverse tangent of the slope.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static decimal ATan(this decimal y, decimal x) => (decimal)Math.Atan2((double)y, (double)x);
+
+ ///
+ /// Function to return the inverse tangent of two values representing the horizontal and vertical offset of a slope.
+ ///
+ /// Vertical slope value to retrieve the inverse tangent from.
+ /// Horizontal slope value to retrieve the inverse tangent from.
+ /// The inverse tangent of the slope.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static double ATan(this double y, double x) => Math.Atan2(y, x);
+
+ ///
+ /// Function to return e raised to a value as the power.
+ ///
+ /// The value representing a power to raise to.
+ /// e raised to the specified.
+ ///
+ /// e is a constant value of ~2.71828.
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static double Exp(this double power) => Math.Exp(power);
+
+ ///
+ /// Function to return e raised to a value as the power.
+ ///
+ /// The value representing a power to raise to.
+ /// e raised to the specified.
+ ///
+ /// e is a constant value of ~2.71828.
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static decimal Exp(this decimal power) => (decimal)Math.Exp((double)power);
+ ///
+ /// Function to return e raised to a value as the power.
+ ///
+ /// The value representing a power to raise to.
+ /// e raised to the specified.
+ ///
+ /// e is a constant value of ~2.71828.
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float Exp(this float power) => (float)Math.Exp(power);
+
+ ///
+ /// Function to raise a to a specified power.
+ ///
+ /// The value to raise.
+ /// The value representing a power to raise to.
+ /// The raised to the specified .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static double Pow(this double value, double power) => Math.Pow(value, power);
+
+ ///
+ /// Function to raise a to a specified power.
+ ///
+ /// The value to raise.
+ /// The value representing a power to raise to.
+ /// The raised to the specified .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static decimal Pow(this decimal value, decimal power) => (decimal)Math.Pow((double)value, (double)power);
+
+ ///
+ /// Function to raise a to a specified power.
+ ///
+ /// The value to raise.
+ /// The value representing a power to raise to.
+ /// The raised to the specified .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float Pow(this float value, float power) => (float)Math.Pow(value, power);
+
+ ///
+ /// Function to compute the logarithim of a value.
+ ///
+ /// The value to compute the logarithim from.
+ /// The new base for the logarithm.
+ /// The logarithim value.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float Log(this float value, float power) => (float)Math.Log(value, power);
+
+ ///
+ /// Function to compute the logarithim of a value.
+ ///
+ /// The value to compute the logarithim from.
+ /// The new base for the logarithm.
+ /// The logarithim value.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static double Log(this double value, double power) => Math.Log(value, power);
+
+ ///
+ /// Function to compute the logarithim of a value.
+ ///
+ /// The value to compute the logarithim from.
+ /// The new base for the logarithm.
+ /// The logarithim value.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static decimal Log(this decimal value, decimal power) => (decimal)Math.Log((double)value, (double)power);
+
+ ///
+ /// Function to return the largest integer less than or equal to the specified value.
+ ///
+ /// The value to find the floor for.
+ /// The largest integer less than or equal to .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float FastFloor(this float value)
+ {
+ int result = (int)value;
+
+ return (value < result) ? result - 1 : result;
+ }
+
+ ///
+ /// Function to return the largest integer less than or equal to the specified value.
+ ///
+ /// The value to find the floor for.
+ /// The largest integer less than or equal to .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float FastFloor(this double value)
+ {
+ int result = (int)value;
+
+ return (value < result) ? result - 1 : result;
+ }
+
+ ///
+ /// Function to return the largest integer greater than or equal to the specified value.
+ ///
+ /// The value to find the ceiling for.
+ /// The largest integer greater than or equal to .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float FastCeiling(this float value)
+ {
+ int result = (int)value;
+
+ return (value > result) ? result + 1 : result;
+ }
+
+ ///
+ /// Function to return the largest integer greater than or equal to the specified value.
+ ///
+ /// The value to find the ceiling for.
+ /// The largest integer greater than or equal to .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float FastCeiling(this double value)
+ {
+ int result = (int)value;
+
+ return (value > result) ? result + 1 : result;
+ }
+
+ ///
+ /// Function to return the sign of an value.
+ ///
+ /// The value to evaluate.
+ /// 0 if the value is 0, -1 if the value is less than 0, and 1 if the value is greater than 0.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static int Sign(this int value)
+ {
+#pragma warning disable IDE0046 // Convert to conditional expression
+ if (value == 0)
+ {
+ return 0;
+ }
+
+ return value < 0 ? -1 : 1;
+#pragma warning restore IDE0046 // Convert to conditional expression
+ }
+
+ ///
+ /// Function to return the sign of a value.
+ ///
+ /// The value to evaluate.
+ /// 0 if the value is 0, -1 if the value is less than 0, and 1 if the value is greater than 0.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static int Sign(this long value)
+ {
+#pragma warning disable IDE0046 // Convert to conditional expression
+ if (value == 0)
+ {
+ return 0;
+ }
+
+ return value < 0 ? -1 : 1;
+#pragma warning restore IDE0046 // Convert to conditional expression
+ }
+
+ /* Disabled CLS Non Compliant
+ ///
+ /// Function to return the sign of a value.
+ ///
+ /// The value to evaluate.
+ /// 0 if the value is 0, -1 if the value is less than 0, and 1 if the value is greater than 0.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static int Sign(this sbyte value)
+ {
+#pragma warning disable IDE0046 // Convert to conditional expression
+ if (value == 0)
+ {
+ return 0;
+ }
+
+ return value < 0 ? -1 : 1;
+#pragma warning restore IDE0046 // Convert to conditional expression
+ }
+ */
+
+ ///
+ /// Function to return the sign of a value.
+ ///
+ /// The value to evaluate.
+ /// 0 if the value is 0, -1 if the value is less than 0, and 1 if the value is greater than 0.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static int Sign(this short value)
+ {
+#pragma warning disable IDE0046 // Convert to conditional expression
+ if (value == 0)
+ {
+ return 0;
+ }
+
+ return value < 0 ? -1 : 1;
+#pragma warning restore IDE0046 // Convert to conditional expression
+ }
+
+ ///
+ /// Function to return the sign of a value.
+ ///
+ /// The value to evaluate.
+ /// 0 if the value is 0, -1 if the value is less than 0, and 1 if the value is greater than 0.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static int Sign(this decimal value)
+ {
+#pragma warning disable IDE0046 // Convert to conditional expression
+ if (value == 0)
+ {
+ return 0;
+ }
+
+ return value < 0 ? -1 : 1;
+#pragma warning restore IDE0046 // Convert to conditional expression
+ }
+
+ ///
+ /// Function to return the sign of a value.
+ ///
+ /// The value to evaluate.
+ /// 0 if the value is 0, -1 if the value is less than 0, and 1 if the value is greater than 0.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static int Sign(this float value)
+ {
+#pragma warning disable IDE0046 // Convert to conditional expression
+ if (value.EqualsEpsilon(0))
+ {
+ return 0;
+ }
+
+ return value < 0 ? -1 : 1;
+#pragma warning restore IDE0046 // Convert to conditional expression
+ }
+
+ ///
+ /// Function to return the sign of a value.
+ ///
+ /// The value to evaluate.
+ /// 0 if the value is 0, -1 if the value is less than 0, and 1 if the value is greater than 0.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static int Sign(this double value)
+ {
+#pragma warning disable IDE0046 // Convert to conditional expression
+ if (value.EqualsEpsilon(0))
+ {
+ return 0;
+ }
+
+ return value < 0 ? -1 : 1;
+#pragma warning restore IDE0046 // Convert to conditional expression
+ }
+
+ ///
+ /// Function to clamp a value to the range specified by the minimum and maximum value.
+ ///
+ /// The value to clamp.
+ /// The minimum value.
+ /// The maximum value.
+ /// The clamped value.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static byte Clamp(this byte value, byte minValue, byte maxValue)
+ {
+ value = value.Min(maxValue);
+ return value.Max(minValue);
+ }
+
+ ///
+ /// Function to clamp a value to the range specified by the minimum and maximum value.
+ ///
+ /// The value to clamp.
+ /// The minimum value.
+ /// The maximum value.
+ /// The clamped value.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static short Clamp(this short value, short minValue, short maxValue)
+ {
+ value = value.Min(maxValue);
+ return value.Max(minValue);
+ }
+
+ /* Disabled CLS Non Compliant
+ ///
+ /// Function to clamp a value to the range specified by the minimum and maximum value.
+ ///
+ /// The value to clamp.
+ /// The minimum value.
+ /// The maximum value.
+ /// The clamped value.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static ushort Clamp(this ushort value, ushort minValue, ushort maxValue)
+ {
+ value = value.Min(maxValue);
+ return value.Max(minValue);
+ }
+ */
+ ///
+ /// Function to clamp a value to the range specified by the minimum and maximum value.
+ ///
+ /// The value to clamp.
+ /// The minimum value.
+ /// The maximum value.
+ /// The clamped value.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static int Clamp(this int value, int minValue, int maxValue)
+ {
+ value = value.Min(maxValue);
+ return value.Max(minValue);
+ }
+
+ /* Disabled CLS Non Compliant
+ ///
+ /// Function to clamp a value to the range specified by the minimum and maximum value.
+ ///
+ /// The value to clamp.
+ /// The minimum value.
+ /// The maximum value.
+ /// The clamped value.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static uint Clamp(this uint value, uint minValue, uint maxValue)
+ {
+ value = value.Min(maxValue);
+ return value.Max(minValue);
+ }
+ */
+
+ ///
+ /// Function to clamp a value to the range specified by the minimum and maximum value.
+ ///
+ /// The value to clamp.
+ /// The minimum value.
+ /// The maximum value.
+ /// The clamped value.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static long Clamp(this long value, long minValue, long maxValue)
+ {
+ value = value.Min(maxValue);
+ return value.Max(minValue);
+ }
+
+ /* Disabled CLS Non Compliant
+ ///
+ /// Function to clamp a value to the range specified by the minimum and maximum value.
+ ///
+ /// The value to clamp.
+ /// The minimum value.
+ /// The maximum value.
+ /// The clamped value.
+ [methodimpl(methodimploptions.aggressiveinlining)]
+ public static ulong clamp(this ulong value, ulong minvalue, ulong maxvalue)
+ {
+ value = value.min(maxvalue);
+ return value.max(minvalue);
+ }
+ */
+
+ ///
+ /// Function to clamp a value to the range specified by the minimum and maximum value.
+ ///
+ /// The value to clamp.
+ /// The minimum value.
+ /// The maximum value.
+ /// The clamped value.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float Clamp(this float value, float minValue, float maxValue)
+ {
+ value = value.Min(maxValue);
+ return value.Max(minValue);
+ }
+
+ ///
+ /// Function to clamp a value to the range specified by the minimum and maximum value.
+ ///
+ /// The value to clamp.
+ /// The minimum value.
+ /// The maximum value.
+ /// The clamped value.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static double Clamp(this double value, double minValue, double maxValue)
+ {
+ value = value.Min(maxValue);
+ return value.Max(minValue);
+ }
+
+ ///
+ /// Function to clamp a value to the range specified by the minimum and maximum value.
+ ///
+ /// The value to clamp.
+ /// The minimum value.
+ /// The maximum value.
+ /// The clamped value.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static decimal Clamp(this decimal value, decimal minValue, decimal maxValue)
+ {
+ value = value.Min(maxValue);
+ return value.Max(minValue);
+ }
+
+ ///
+ /// Function to limit an angle to the specified minimum and maximum.
+ ///
+ /// The angle to limit.
+ /// [Optional] The minimum value for the angle.
+ /// [Optional] The maxmum value for the angle.
+ /// The limited angle value.
+ public static float LimitAngle(this float angle, float min = 0, float max = 360)
+ {
+ if (min.EqualsEpsilon(max))
+ {
+ return angle.Max(min).Min(max);
+ }
+
+ if (min > max)
+ {
+ (min, max) = (max, min);
+ }
+
+ if (angle > max)
+ {
+ angle = max - angle;
+ }
+
+ if (angle < min)
+ {
+ angle -= min;
+ }
+
+ return angle;
+ }
+
+ ///
+ /// Function to limit an angle to the specified minimum and maximum.
+ ///
+ /// The angle to limit.
+ /// [Optional] The minimum value for the angle.
+ /// [Optional] The maxmum value for the angle.
+ /// The limited angle value.
+ public static double LimitAngle(this double angle, double min = 0, double max = 360)
+ {
+ if (min.EqualsEpsilon(max))
+ {
+ return angle.Max(min).Min(max);
+ }
+
+ if (min > max)
+ {
+ (min, max) = (max, min);
+ }
+
+ if (angle > max)
+ {
+ angle = max - angle;
+ }
+
+ if (angle < min)
+ {
+ angle -= min;
+ }
+
+ return angle;
+ }
+
+ ///
+ /// Function to limit an angle to the specified minimum and maximum.
+ ///
+ /// The angle to limit.
+ /// [Optional] The minimum value for the angle.
+ /// [Optional] The maxmum value for the angle.
+ /// The limited angle value.
+ public static decimal LimitAngle(this decimal angle, decimal min = 0, decimal max = 360)
+ {
+ if (min == max)
+ {
+ return angle.Max(min).Min(max);
+ }
+
+ if (min > max)
+ {
+ (min, max) = (max, min);
+ }
+
+ if (angle > max)
+ {
+ angle = max - angle;
+ }
+
+ if (angle < min)
+ {
+ angle -= min;
+ }
+
+ return angle;
+ }
+
+ ///
+ /// Function to limit an angle to the specified minimum and maximum.
+ ///
+ /// The angle to limit.
+ /// [Optional] The minimum value for the angle.
+ /// [Optional] The maxmum value for the angle.
+ /// The limited angle value.
+ public static short LimitAngle(this short angle, short min = 0, short max = 360)
+ {
+ if (min == max)
+ {
+ return angle.Max(min).Min(max);
+ }
+
+ if (min > max)
+ {
+ (min, max) = (max, min);
+ }
+
+ if (angle > max)
+ {
+ angle = (short)(max - angle);
+ }
+
+ if (angle < min)
+ {
+ angle -= min;
+ }
+
+ return angle;
+ }
+
+ ///
+ /// Function to limit an angle to the specified minimum and maximum.
+ ///
+ /// The angle to limit.
+ /// [Optional] The minimum value for the angle.
+ /// [Optional] The maxmum value for the angle.
+ /// The limited angle value.
+ public static int LimitAngle(this int angle, int min = 0, int max = 360)
+ {
+ if (min == max)
+ {
+ return angle.Max(min).Min(max);
+ }
+
+ if (min > max)
+ {
+ (min, max) = (max, min);
+ }
+
+
+ if (angle > max)
+ {
+ angle = max - angle;
+ }
+
+ if (angle < min)
+ {
+ angle -= min;
+ }
+
+ return angle;
+ }
+
+ ///
+ /// Function to limit an angle to the specified minimum and maximum.
+ ///
+ /// The angle to limit.
+ /// [Optional] The minimum value for the angle.
+ /// [Optional] The maxmum value for the angle.
+ /// The limited angle value.
+ public static long LimitAngle(this long angle, long min = 0, long max = 360)
+ {
+ if (min == max)
+ {
+ return angle.Max(min).Min(max);
+ }
+
+ if (min > max)
+ {
+ (min, max) = (max, min);
+ }
+
+ if (angle > max)
+ {
+ angle = max - angle;
+ }
+
+ if (angle < min)
+ {
+ angle -= min;
+ }
+
+ return angle;
+ }
+
+ ///
+ /// Function to linearly interpolate between two values given a weight amount.
+ ///
+ /// The value to start from.
+ /// The ending value.
+ /// The weighting amount.
+ /// The linearly interpolated value.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float Lerp(this float from, float to, float amount) => ((1.0f - amount) * from) + (amount * to);
+
+ ///
+ /// Function to linearly interpolate between two values given a weight amount.
+ ///
+ /// The value to start from.
+ /// The ending value.
+ /// The weighting amount.
+ /// The linearly interpolated value.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static double Lerp(this double from, double to, double amount) => ((1.0 - amount) * from) + (amount * to);
+
+ ///
+ /// Function to linearly interpolate between two values given a weight amount.
+ ///
+ /// The value to start from.
+ /// The ending value.
+ /// The weighting amount.
+ /// The linearly interpolated value.
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static decimal Lerp(this decimal from, decimal to, decimal amount) => ((1.0M - amount) * from) + (amount * to);
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Base/ViewRibbonManager.cs b/Source/Krypton Components/Krypton.Ribbon/View Base/ViewRibbonManager.cs
index 2070a0107..b5499d9c4 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Base/ViewRibbonManager.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Base/ViewRibbonManager.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -18,8 +18,8 @@ internal class ViewRibbonManager : ViewManager
{
#region Instance Fields
private readonly KryptonRibbon _ribbon;
- private readonly ViewDrawRibbonGroupsBorderSynch _viewGroups;
- private ViewDrawRibbonGroup _activeGroup;
+ private readonly ViewDrawRibbonGroupsBorderSynch? _viewGroups;
+ private ViewDrawRibbonGroup? _activeGroup;
private readonly NeedPaintHandler? _needPaintDelegate;
private readonly bool _minimizedMode;
private bool _active;
@@ -105,7 +105,7 @@ public override void Layout(ViewLayoutContext context)
// Prevent reentrancy
if (!_layingOut)
{
- Form ownerForm = _ribbon.FindForm();
+ Form? ownerForm = _ribbon.FindForm();
// We do not need to layout if inside a control that is minimized or if we are not inside a form at all
if ((ownerForm == null) || (ownerForm.WindowState == FormWindowState.Minimized))
@@ -151,7 +151,7 @@ public override void MouseMove([DisallowNull] MouseEventArgs e, Point rawPt)
if (_minimizedMode == _ribbon.RealMinimizedMode)
{
// Get the view group instance that matches this point
- ViewDrawRibbonGroup viewGroup = _viewGroups.ViewGroupFromPoint(new Point(e.X, e.Y));
+ ViewDrawRibbonGroup? viewGroup = _viewGroups!.ViewGroupFromPoint(new Point(e.X, e.Y));
// Is there a change in active group?
if (viewGroup != _activeGroup)
@@ -227,7 +227,7 @@ protected override void UpdateViewFromPoint(Control control, Point pt)
if (!MouseCaptured)
{
// Then get the view under the mouse
- ViewBase mouseView = Root.ViewFromPoint(pt);
+ ViewBase? mouseView = Root.ViewFromPoint(pt);
// We only allow application button views to be interacted with
ActiveView = mouseView is ViewDrawRibbonAppButton ? mouseView : null;
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Base/ViewRibbonMinimizedManager.cs b/Source/Krypton Components/Krypton.Ribbon/View Base/ViewRibbonMinimizedManager.cs
index 521c3d447..f4d65808c 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Base/ViewRibbonMinimizedManager.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Base/ViewRibbonMinimizedManager.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -18,8 +18,8 @@ internal class ViewRibbonMinimizedManager : ViewManager
{
#region Instance Fields
private readonly KryptonRibbon _ribbon;
- private readonly ViewDrawRibbonGroupsBorderSynch _viewGroups;
- private ViewDrawRibbonGroup _activeGroup;
+ private readonly ViewDrawRibbonGroupsBorderSynch? _viewGroups;
+ private ViewDrawRibbonGroup? _activeGroup;
private readonly NeedPaintHandler? _needPaintDelegate;
private readonly bool _minimizedMode;
private bool _active;
@@ -36,20 +36,20 @@ internal class ViewRibbonMinimizedManager : ViewManager
/// Root of the view hierarchy.
/// Is this manager for handling the minimized mode popup.
/// Delegate for requesting paint changes.
- public ViewRibbonMinimizedManager(KryptonRibbon control,
- [DisallowNull] ViewDrawRibbonGroupsBorderSynch viewGroups,
- [DisallowNull] ViewBase root,
+ public ViewRibbonMinimizedManager([DisallowNull] KryptonRibbon control,
+ [DisallowNull] ViewDrawRibbonGroupsBorderSynch viewGroups,
+ [DisallowNull] ViewBase root,
bool minimizedMode,
[DisallowNull] NeedPaintHandler needPaintDelegate)
: base(control, root)
{
- Debug.Assert(viewGroups != null);
- Debug.Assert(root != null);
- Debug.Assert(needPaintDelegate != null);
+ Debug.Assert(viewGroups is not null);
+ Debug.Assert(root is not null);
+ Debug.Assert(needPaintDelegate is not null);
- _ribbon = control;
- _viewGroups = viewGroups;
- _needPaintDelegate = needPaintDelegate;
+ _ribbon = control ?? throw new ArgumentNullException(nameof(_ribbon));
+ _viewGroups = viewGroups ?? throw new ArgumentNullException(nameof(_viewGroups));
+ _needPaintDelegate = needPaintDelegate ?? throw new ArgumentNullException(nameof(needPaintDelegate));
_active = true;
_minimizedMode = minimizedMode;
}
@@ -119,7 +119,7 @@ public override void Layout(ViewLayoutContext context)
{
_layingOut = true;
- Form ownerForm = _ribbon.FindForm();
+ Form? ownerForm = _ribbon.FindForm();
// We do not need to layout if inside a control that is minimized
if (ownerForm is { WindowState: FormWindowState.Minimized })
@@ -161,7 +161,7 @@ public override void MouseMove([DisallowNull] MouseEventArgs e, Point rawPt)
if (_minimizedMode == _ribbon.RealMinimizedMode)
{
// Get the view group instance that matches this point
- ViewDrawRibbonGroup viewGroup = _viewGroups.ViewGroupFromPoint(new Point(e.X, e.Y));
+ ViewDrawRibbonGroup? viewGroup = _viewGroups!.ViewGroupFromPoint(new Point(e.X, e.Y));
// Is there a change in active group?
if (viewGroup != _activeGroup)
@@ -274,7 +274,7 @@ protected override void UpdateViewFromPoint(Control control, Point pt)
if (!MouseCaptured)
{
// Then get the view under the mouse
- ViewBase mouseView = Root.ViewFromPoint(pt);
+ ViewBase? mouseView = Root.ViewFromPoint(pt);
// We only allow application button views to be interacted with
ActiveView = mouseView is ViewDrawRibbonAppButton ? mouseView : null;
@@ -301,12 +301,12 @@ public ViewBase? FocusView
if (_focusView != value)
{
// Remove focus from existing view
- _focusView?.LostFocus(Root.OwningControl);
+ _focusView?.LostFocus(Root.OwningControl!);
_focusView = value;
// Add focus to the new view
- _focusView?.GotFocus(Root.OwningControl);
+ _focusView?.GotFocus(Root.OwningControl!);
}
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Base/ViewRibbonPopupGroupManager.cs b/Source/Krypton Components/Krypton.Ribbon/View Base/ViewRibbonPopupGroupManager.cs
index 8b8e23fe2..3c3436a75 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Base/ViewRibbonPopupGroupManager.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Base/ViewRibbonPopupGroupManager.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -34,19 +34,19 @@ internal class ViewRibbonPopupGroupManager : ViewManager
/// Group to track.
/// Delegate for performing painting.
public ViewRibbonPopupGroupManager(Control control,
- [DisallowNull] KryptonRibbon ribbon,
+ [DisallowNull] KryptonRibbon ribbon,
ViewBase root,
[DisallowNull] ViewDrawRibbonGroup viewGroup,
[DisallowNull] NeedPaintHandler needPaintDelegate)
: base(control, root)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(viewGroup != null);
- Debug.Assert(needPaintDelegate != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(viewGroup is not null);
+ Debug.Assert(needPaintDelegate is not null);
- _ribbon = ribbon;
- _viewGroup = viewGroup;
- _needPaintDelegate = needPaintDelegate;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _viewGroup = viewGroup ?? throw new ArgumentNullException(nameof(viewGroup));
+ _needPaintDelegate = needPaintDelegate ?? throw new ArgumentNullException(nameof(needPaintDelegate));
}
///
@@ -118,7 +118,7 @@ public override void MouseMove([DisallowNull] MouseEventArgs e, Point rawPt)
}
// Should the group be active
- var tracking = _viewGroup.ClientRectangle.Contains(new Point(e.X, e.Y));
+ var tracking = _viewGroup!.ClientRectangle.Contains(new Point(e.X, e.Y));
// Is there a change in active group?
if (tracking != _viewGroup.Tracking)
@@ -146,7 +146,7 @@ public override void MouseLeave([DisallowNull] EventArgs e)
}
// Do we need to remove tracking
- if (_viewGroup.Tracking)
+ if (_viewGroup!.Tracking)
{
_viewGroup.Tracking = false;
_viewGroup.PerformNeedPaint(false, _viewGroup.ClientRectangle);
@@ -202,12 +202,12 @@ public ViewBase? FocusView
if (_focusView != value)
{
// Remove focus from existing view
- _focusView?.LostFocus(Root?.OwningControl);
+ _focusView?.LostFocus(Root?.OwningControl!);
_focusView = value;
// Add focus to the new view
- _focusView?.GotFocus(Root.OwningControl);
+ _focusView?.GotFocus(Root?.OwningControl!);
}
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Base/ViewRibbonQATOverflowManager.cs b/Source/Krypton Components/Krypton.Ribbon/View Base/ViewRibbonQATOverflowManager.cs
index 230e8eb74..72abc3792 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Base/ViewRibbonQATOverflowManager.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Base/ViewRibbonQATOverflowManager.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -36,11 +36,11 @@ public ViewRibbonQATOverflowManager([DisallowNull] KryptonRibbon ribbon,
ViewBase root)
: base(control, root)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(qatContents != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(qatContents is not null);
- _ribbon = ribbon;
- QATContents = qatContents;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ QATContents = qatContents ?? throw new ArgumentNullException(nameof(qatContents));
}
///
@@ -59,7 +59,7 @@ public override void Dispose()
///
/// Gets a the view that handles the overflow items.
///
- public ViewLayoutRibbonQATContents QATContents { get; }
+ public ViewLayoutRibbonQATContents? QATContents { get; }
#endregion
@@ -73,7 +73,7 @@ public override Size GetPreferredSize(IRenderer renderer,
Size proposedSize)
{
// Update the calculated values used during layout calls
- _ribbon.CalculatedValues.Recalculate();
+ _ribbon!.CalculatedValues.Recalculate();
// Let base class perform standard preferred sizing actions
return base.GetPreferredSize(renderer, proposedSize);
@@ -93,7 +93,7 @@ public override void Layout(ViewLayoutContext context)
_layingOut = true;
// Update the calculated values used during layout calls
- _ribbon.CalculatedValues.Recalculate();
+ _ribbon!.CalculatedValues.Recalculate();
// Let base class perform standard layout actions
base.Layout(context);
@@ -148,12 +148,12 @@ public ViewBase? FocusView
if (_focusView != value)
{
// Remove focus from existing view
- _focusView?.LostFocus(Root.OwningControl);
+ _focusView?.LostFocus(Root.OwningControl!);
_focusView = value;
// Add focus to the new view
- _focusView?.GotFocus(Root.OwningControl);
+ _focusView?.GotFocus(Root.OwningControl!);
}
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonAppButton.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonAppButton.cs
index 711cd5b2e..64bf0d698 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonAppButton.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonAppButton.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -26,9 +26,8 @@ internal class ViewDrawRibbonAppButton : ViewLeaf
private readonly bool _bottomHalf;
private Rectangle _clipRect;
private readonly Size _size;
- private readonly Size SIZE_FULL; // = new(39, 39);
- private readonly Size SIZE_TOP; // = new(39, 22);
- private readonly Size SIZE_BOTTOM; // = new(39, 17);
+ private readonly Size _sizeFull; // = new(39, 39);
+ private readonly Size _sizeBottom; // = new(39, 17);
#endregion
#region Identity
@@ -41,13 +40,13 @@ public ViewDrawRibbonAppButton([DisallowNull] KryptonRibbon ribbon, bool bottomH
{
Debug.Assert(ribbon != null);
- SIZE_FULL = new Size((int)(39 * FactorDpiX), (int)(39 * FactorDpiY));
- SIZE_TOP = new Size((int)(39 * FactorDpiX), (int)(22 * FactorDpiY));
- SIZE_BOTTOM = new Size((int)(39 * FactorDpiX), (int)(17 * FactorDpiY));
+ _sizeFull = new Size((int)(39 * FactorDpiX), (int)(39 * FactorDpiY));
+ var sizeTop = new Size((int)(39 * FactorDpiX), (int)(22 * FactorDpiY));
+ _sizeBottom = new Size((int)(39 * FactorDpiX), (int)(17 * FactorDpiY));
_ribbon = ribbon!;
_bottomHalf = bottomHalf;
- _size = _bottomHalf ? SIZE_BOTTOM : SIZE_TOP;
+ _size = _bottomHalf ? _sizeBottom : sizeTop;
_mementos = new IDisposable[3];
}
@@ -109,18 +108,18 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
Debug.Assert(context != null);
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
_clipRect = ClientRectangle;
// Update to reflect full size of actual button
if (_bottomHalf)
{
Rectangle client = ClientRectangle;
- client.Y -= SIZE_FULL.Height - SIZE_BOTTOM.Height;
+ client.Y -= _sizeFull.Height - _sizeBottom.Height;
ClientRectangle = client;
}
- ClientHeight = SIZE_FULL.Height;
+ ClientHeight = _sizeFull.Height;
}
#endregion
@@ -129,8 +128,13 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
/// Perform rendering before child elements are rendered.
///
/// Rendering context.
- public override void RenderBefore(RenderContext context)
+ public override void RenderBefore([DisallowNull] RenderContext context)
{
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
// New clipping region is at most our own client size
using var combineRegion = new Region(_clipRect);
// Remember the current clipping region
@@ -166,32 +170,35 @@ public override void RenderBefore(RenderContext context)
// Draw the background
_mementos[memento] = context.Renderer.RenderRibbon.DrawRibbonApplicationButton(_ribbon.RibbonShape, context, ClientRectangle, State, palette, _mementos[memento]);
- // If there is an application button to be drawn
- if (_ribbon.RibbonAppButton.AppButtonImage != null)
+ // If there is an application button image to be drawn
+ Image? localImage = _ribbon.RibbonFileAppButton.AppButtonImage;
+ if (localImage != null)
{
// We always draw the image a 24x24 image (if dpi = 1!)
- var localImage = _ribbon.RibbonAppButton.AppButtonImage;
localImage = CommonHelper.ScaleImageForSizedDisplay(localImage, localImage.Width * FactorDpiX,
localImage.Height * FactorDpiY);
- var imageRect = new Rectangle(ClientLocation.X + (int)(7 * FactorDpiX),
- ClientLocation.Y + (int)(6 * FactorDpiY), (int)(24 * FactorDpiX), (int)(24 * FactorDpiY));
-
- if (_ribbon.Enabled)
- {
- context.Graphics.DrawImage(localImage, imageRect);
- }
- else
+ if (localImage != null)
{
- // Use a color matrix to convert to black and white
- using var attribs = new ImageAttributes();
- attribs.SetColorMatrix(CommonHelper.MatrixDisabled);
-
- context.Graphics.DrawImage(localImage,
- imageRect, 0, 0,
- localImage.Width,
- localImage.Height,
- GraphicsUnit.Pixel, attribs);
+ var imageRect = new Rectangle(ClientLocation.X + (int)(7 * FactorDpiX),
+ ClientLocation.Y + (int)(6 * FactorDpiY), (int)(24 * FactorDpiX), (int)(24 * FactorDpiY));
+
+ if (_ribbon.Enabled)
+ {
+ context.Graphics.DrawImage(localImage, imageRect);
+ }
+ else
+ {
+ // Use a color matrix to convert to black and white
+ using var attribs = new ImageAttributes();
+ attribs.SetColorMatrix(CommonHelper.MatrixDisabled);
+
+ context.Graphics.DrawImage(localImage,
+ imageRect, 0, 0,
+ localImage.Width,
+ localImage.Height,
+ GraphicsUnit.Pixel, attribs);
+ }
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonAppMenu.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonAppMenu.cs
index 2d79ab04a..f37b4a0ea 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonAppMenu.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonAppMenu.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -57,8 +57,18 @@ public override string ToString() =>
/// Perform rendering after child elements are rendered.
///
/// Rendering context.
- public override void RenderAfter(RenderContext renderContext)
+ public override void RenderAfter([DisallowNull] RenderContext renderContext)
{
+ if (renderContext.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(renderContext.Renderer));
+ }
+
+ if (renderContext.TopControl is null)
+ {
+ throw new ArgumentNullException(nameof(renderContext.TopControl));
+ }
+
base.RenderAfter(renderContext);
// Convert our rectangle to the screen
@@ -69,7 +79,7 @@ public override void RenderAfter(RenderContext renderContext)
{
// Position the element appropriately
using (var layoutContext =
- new ViewLayoutContext(renderContext.Control, renderContext.Renderer))
+ new ViewLayoutContext(renderContext.Control!, renderContext.Renderer))
{
layoutContext.DisplayRectangle = renderContext.TopControl.RectangleToClient(_fixedScreenRect);
_fixedElement.Layout(layoutContext);
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonAppMenuDocs.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonAppMenuDocs.cs
index deae02caf..645e144f5 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonAppMenuDocs.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonAppMenuDocs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -21,7 +21,7 @@ internal class ViewDrawRibbonAppMenuDocs : ViewLayoutDocker
{
#region Instance Fields
private readonly KryptonRibbon _ribbon;
- private IDisposable _memento;
+ private IDisposable? _memento;
#endregion
#region Identity
@@ -63,11 +63,18 @@ protected override void Dispose(bool disposing)
/// Perform rendering before child elements are rendered.
///
/// Rendering context.
- public override void RenderBefore(RenderContext context) =>
+ public override void RenderBefore(RenderContext context)
+ {
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
// Draw the application menu outer background
_memento = context.Renderer.RenderRibbon.DrawRibbonBack(_ribbon.RibbonShape, context, ClientRectangle, State,
_ribbon.StateCommon.RibbonAppMenuDocs,
- VisualOrientation.Top, false, _memento);
+ VisualOrientation.Top, _memento);
+ }
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonAppMenuInner.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonAppMenuInner.cs
index 40aa3d2f8..5898a1857 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonAppMenuInner.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonAppMenuInner.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -21,7 +21,7 @@ internal class ViewDrawRibbonAppMenuInner : ViewLayoutDocker
{
#region Instance Fields
private readonly KryptonRibbon _ribbon;
- private IDisposable _memento;
+ private IDisposable? _memento;
#endregion
#region Identity
@@ -63,11 +63,18 @@ protected override void Dispose(bool disposing)
/// Perform rendering before child elements are rendered.
///
/// Rendering context.
- public override void RenderBefore(RenderContext context) =>
+ public override void RenderBefore([DisallowNull] RenderContext context)
+ {
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
// Draw the application menu outer background
_memento = context.Renderer.RenderRibbon.DrawRibbonBack(_ribbon.RibbonShape, context, ClientRectangle, State,
_ribbon.StateCommon.RibbonAppMenuInner,
- VisualOrientation.Top, false, _memento);
+ VisualOrientation.Top, _memento);
+ }
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonAppMenuOuter.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonAppMenuOuter.cs
index b014db9e7..b78c08713 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonAppMenuOuter.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonAppMenuOuter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -21,7 +21,7 @@ internal class ViewDrawRibbonAppMenuOuter : ViewLayoutDocker
{
#region Instance Fields
private readonly KryptonRibbon _ribbon;
- private IDisposable _memento;
+ private IDisposable? _memento;
#endregion
#region Identity
@@ -63,14 +63,19 @@ protected override void Dispose(bool disposing)
/// Perform rendering before child elements are rendered.
///
/// Rendering context.
- public override void RenderBefore(RenderContext context)
+ public override void RenderBefore([DisallowNull] RenderContext context)
{
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
base.RenderBefore(context);
// Draw the application menu outer background
_memento = context.Renderer.RenderRibbon.DrawRibbonBack(_ribbon.RibbonShape, context, ClientRectangle, State,
_ribbon.StateCommon.RibbonAppMenuOuter,
- VisualOrientation.Top, false, _memento);
+ VisualOrientation.Top, _memento);
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonAppMenuRecentDoc.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonAppMenuRecentDoc.cs
index e94b512ff..07a7fbcee 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonAppMenuRecentDoc.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonAppMenuRecentDoc.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonCaptionArea.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonCaptionArea.cs
index 6ae48668c..c16eacdf6 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonCaptionArea.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonCaptionArea.cs
@@ -5,675 +5,13 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
- *
- * Modified: Monday 12th April, 2021 @ 18:00 GMT
- *
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*/
#endregion
// ReSharper disable InconsistentNaming
namespace Krypton.Ribbon
{
- #region Old Class
- /*
- ///
- /// Ribbon area that contains the context titles, minibar and top half of application button.
- ///
- internal class ViewDrawRibbonCaptionArea : ViewDrawDocker
- {
- #region Static Fields
-
- private const int MIN_INTEGRATED_HEIGHT = 26; // MiniBar, 16 image + 2 * (2 gap + 1 border + 2 border)
- private const int CAPTION_TEXT_GAPS = 10; // 4 below and 6 above
- private const int MIN_SELF_HEIGHT = 28; // Min height to show application button and the mini bar and context tabs
-
- #endregion
-
- #region Instance Fields
- private readonly KryptonRibbon _ribbon;
- private readonly NeedPaintHandler _needIntegratedDelegate;
- private readonly PaletteCaptionRedirect _redirect;
- private PaletteDoubleRedirect _redirectCaption;
- private readonly ViewDrawRibbonComposition _compositionArea;
- private ViewLayoutRibbonAppButton _captionAppButton;
- private ViewLayoutRibbonAppButton _otherAppButton;
- private ViewLayoutSeparator _spaceInsteadOfAppButton;
- private ViewLayoutRibbonQATMini _captionQAT;
- private ViewLayoutRibbonQATMini _nonCaptionQAT;
- private ViewDrawRibbonCompoRightBorder _compRightBorder;
- private bool _preventIntegration;
- private bool _compoRightInjected;
- private int _calculatedHeight;
- private Font _cacheRibbonFont;
- private int _cacheRibbonFontHeight;
- #endregion
-
- #region Identity
- ///
- /// Initialize a new instance of the ViewDrawRibbonCaptionArea class.
- ///
- /// Reference to owning ribbon control.
- /// Reference to redirector for palette settings.
- /// Reference to the composition element.
- /// Delegate for notifying paint/layout changes.
- public ViewDrawRibbonCaptionArea(KryptonRibbon ribbon,
- PaletteRedirect redirect,
- ViewDrawRibbonComposition compositionArea,
- NeedPaintHandler needPaintDelegate)
- {
- Debug.Assert(ribbon != null);
- Debug.Assert(redirect != null);
- Debug.Assert(compositionArea != null);
- Debug.Assert(needPaintDelegate != null);
-
- // Remember incoming references
- _ribbon = ribbon;
- _compositionArea = compositionArea;
- NeedPaintDelegate = needPaintDelegate;
- _needIntegratedDelegate = OnIntegratedNeedPaint;
-
- // Create a special redirector for overriding the border setting
- _redirect = new PaletteCaptionRedirect(redirect);
-
- CreateViewElements();
- SetupParentMonitoring();
- }
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing)
- {
- // Unhook from any current krypton form monitoring
- if (KryptonForm != null)
- {
- // Remove our elements from the custom chrome
- if (UsingCustomChrome)
- {
- _captionAppButton.OwnerForm = null;
- KryptonForm.AllowIconDisplay = true;
- KryptonForm.RevokeViewElement(ContextTitles, ViewDockStyle.Fill);
- KryptonForm.RevokeViewElement(_captionAppButton, ViewDockStyle.Left);
- KryptonForm.RevokeViewElement(_captionQAT, ViewDockStyle.Left);
- UsingCustomChrome = false;
- }
-
- KryptonForm.ApplyCustomChromeChanged -= OnFormChromeCheck;
- KryptonForm.ClientSizeChanged -= OnFormChromeCheck;
- KryptonForm.WindowActiveChanged -= OnWindowActiveChanged;
- KryptonForm = null;
- }
- }
-
- base.Dispose(disposing);
- }
-
- ///
- /// Obtains the String representation of this instance.
- ///
- /// User readable name of the instance.
- public override string ToString()
- {
- // Return the class name and instance identifier
- return "ViewDrawRibbonCaptionArea:" + Id;
- }
- #endregion
-
- #region AppButtonController
- ///
- /// Gets the single reference to the application button controller.
- ///
- public AppButtonController AppButtonController { get; private set; }
-
- #endregion
-
- #region AppTabController
- ///
- /// Gets the single reference to the application tab controller.
- ///
- public AppTabController AppTabController { get; private set; }
-
- #endregion
-
- #region HookToolTipHandling
- ///
- /// Perform steps to generate a tooltip event when mouse is over the application button.
- ///
- public void HookToolTipHandling()
- {
- _captionAppButton.MouseController = new ToolTipController(_ribbon.TabsArea.ButtonSpecManager.ToolTipManager, _captionAppButton, _captionAppButton.MouseController);
- _otherAppButton.MouseController = new ToolTipController(_ribbon.TabsArea.ButtonSpecManager.ToolTipManager, _otherAppButton, _otherAppButton.MouseController);
- }
- #endregion
-
- #region PreventIntegration
- ///
- /// Gets and sets the integration override value.
- ///
- public bool PreventIntegration
- {
- get => _preventIntegration;
-
- set
- {
- if (_preventIntegration != value)
- {
- // Store new override value
- _preventIntegration = value;
-
- // Request the integration check be reapplied
- OnFormChromeCheck(this, EventArgs.Empty);
- }
- }
- }
- #endregion
-
- #region DrawBorderLast
- ///
- /// Gets the drawing of the border before or after children.
- ///
- public override bool DrawBorderLast => false;
-
- #endregion
-
- #region AppButtonChanged
- ///
- /// Notify a change in the application button image.
- ///
- public void AppButtonChanged()
- {
- // Requests a repaint to show the change.
- OnAppButtonNeedPaint(this, new NeedLayoutEventArgs(false));
- }
- #endregion
-
- #region AppButtonChanged
- ///
- /// Update the visible state of the caption area based on integration, app button, contexts and qat location.
- ///
- public void UpdateVisible()
- {
- Visible = !UsingCustomChrome &&
- (_ribbon.RibbonAppButton.AppButtonVisible ||
- (_ribbon.QATLocation == QATLocation.Above) ||
- (_ribbon.RibbonContexts.Count > 0));
- }
- #endregion
-
- #region VisibleQAT
- ///
- /// Get the quick access toolbar view that is currently visible
- ///
- public ViewLayoutRibbonQATMini VisibleQAT => UsingCustomChrome ? _captionQAT : _nonCaptionQAT;
-
- #endregion
-
- #region UpdateQAT
- ///
- /// Update display elements to reflect latest QAT setting.
- ///
- public void UpdateQAT()
- {
- bool before = _captionQAT.Visible;
- _captionQAT.Visible = _ribbon.Visible && (_ribbon.QATLocation == QATLocation.Above);
- _nonCaptionQAT.Visible = _ribbon.Visible && (_ribbon.QATLocation == QATLocation.Above);
- UpdateVisible();
-
- // A change in integrated caption visibility
- if (before != _captionQAT.Visible)
- {
- QATButtonsChanged();
- }
- }
- #endregion
-
- #region AppButtonVisibleChanged
- ///
- /// A change in the app button visibility needs to be processed.
- ///
- public void AppButtonVisibleChanged()
- {
- bool appButtonVisible = (_ribbon.RibbonAppButton.AppButtonVisible && (_ribbon.RibbonShape == PaletteRibbonShape.Office2007));
- if (_captionAppButton.Visible != appButtonVisible)
- {
- // Update visible state of the app button to reflect current state
- _captionAppButton.Visible = appButtonVisible;
- _spaceInsteadOfAppButton.Visible = !_captionAppButton.Visible;
- _otherAppButton.Visible = _captionAppButton.Visible;
- _captionQAT.OverlapAppButton = _captionAppButton.Visible;
- _nonCaptionQAT.OverlapAppButton = _captionAppButton.Visible;
- UpdateVisible();
-
- // Relayout and redraw to show the change
- OnAppButtonNeedPaint(this, new NeedLayoutEventArgs(true));
- }
- }
- #endregion
-
- #region QATButtonsChanged
- ///
- /// Notification that the collection of QAT buttons has changed.
- ///
- public void QATButtonsChanged()
- {
- // Do we need to layout and paint the custom chrome?
- if (UsingCustomChrome)
- {
- OnIntegratedNeedPaint(this, new NeedLayoutEventArgs(true));
- }
- }
- #endregion
-
- #region UsingCustomChrome
- ///
- /// Gets a value indicating if the ribbon is integrated into the custom chrome.
- ///
- public bool UsingCustomChrome { get; private set; }
-
- #endregion
-
- #region RedrawCustomChrome
- ///
- /// Causes the custom chrome to be repainted.
- ///
- /// Is a layout required.
- public void RedrawCustomChrome(bool layout)
- {
- if (UsingCustomChrome)
- {
- KryptonForm.PerformNeedPaint(layout);
- }
- }
- #endregion
-
- #region DrawCaptionOnComposition
- ///
- /// Gets a value indicating if drawing on the composition element.
- ///
- public bool DrawCaptionOnComposition => UsingCustomChrome && KryptonForm.ApplyComposition;
-
- #endregion
-
- #region KryptonForm
- ///
- /// Gets access to the integration form.
- ///
- public KryptonForm KryptonForm { get; private set; }
-
- #endregion
-
- #region RealWindowBorders
- ///
- /// Gets the window borders of the krypton form.
- ///
- public Padding RealWindowBorders => KryptonForm?.RealWindowBorders ?? Padding.Empty;
-
- #endregion
-
- #region ContextTitles
- ///
- /// Gets access to the layout view used for the context titles.
- ///
- public ViewLayoutRibbonContextTitles ContextTitles { get; private set; }
-
- #endregion
-
- #region PerformFormChromeCheck
- ///
- /// Redecide if the custom chrome and integration can occur.
- ///
- public void PerformFormChromeCheck()
- {
- // Update decision about integrating or providing caption functionality
- OnFormChromeCheck(null, EventArgs.Empty);
- }
- #endregion
-
- #region DoesClientMouseDownEndAllTracking
- ///
- /// Should a mouse down at the provided point cause an end to popup tracking.
- ///
- /// Client coordinates point.
- /// True to end tracking; otherwise false.
- public bool DoesCurrentMouseDownEndAllTracking(Point pt)
- {
- // If integrated into custom chrome...
- if (UsingCustomChrome)
- {
- // Convert point to the form coordinates
- Point formPt = KryptonForm.PointToClient(pt);
- Padding formPadding =KryptonForm.RealWindowBorders;
- formPt.X += formPadding.Left;
- formPt.Y += formPadding.Top;
-
- if (ContextTitles != null)
- {
- // Search the context title elements for a match
- foreach (ViewBase child in ContextTitles)
- {
- if ((child is ViewDrawRibbonContextTitle) && child.ClientRectangle.Contains(formPt))
- {
- return false;
- }
- }
- }
- }
-
- return true;
- }
- #endregion
-
- #region Layout
- ///
- /// Discover the preferred size of the element.
- ///
- /// Layout context.
- public override Size GetPreferredSize(ViewLayoutContext context)
- {
- Debug.Assert(context != null);
-
- // Enforce the minimum height
- Size preferredSize = base.GetPreferredSize(context);
- preferredSize.Height = Math.Max(_calculatedHeight, preferredSize.Height);
-
- return preferredSize;
- }
- #endregion
-
- #region Protected
- ///
- /// Gets access to the need paint delegate.
- ///
- protected NeedPaintHandler NeedPaintDelegate
- {
- [DebuggerStepThrough]
- get;
- }
-
- ///
- /// Fires a request to have painting/layout performed.
- ///
- /// Does the palette change require a layout.
- protected void PerformNeedPaint(bool needLayout)
- {
- NeedPaintDelegate(this, new NeedLayoutEventArgs(needLayout));
- }
- #endregion
-
- #region Implementation
- private void CreateViewElements()
- {
- // Create redirector for the accessing the background palette
- _redirectCaption = new PaletteDoubleRedirect(_redirect, PaletteBackStyle.HeaderForm, PaletteBorderStyle.HeaderForm, NeedPaintDelegate);
-
- // Create a top half for use in KryptonForm and another for use inside this caption area
- _captionAppButton = new ViewLayoutRibbonAppButton(_ribbon, false);
- _otherAppButton = new ViewLayoutRibbonAppButton(_ribbon, false);
-
- // Connect up the application button controller to the two button elements
- AppButtonController = new AppButtonController(_ribbon)
- {
- Target1 = _captionAppButton.AppButton,
- Target2 = _otherAppButton.AppButton
- };
- AppButtonController.NeedPaint += OnAppButtonNeedPaint;
- _captionAppButton.MouseController = AppButtonController;
- _otherAppButton.MouseController = AppButtonController;
- AppTabController = new AppTabController(_ribbon);
- AppTabController.NeedPaint += OnAppButtonNeedPaint;
-
- // When not showing the app button we show this spacer instead
- _spaceInsteadOfAppButton = new ViewLayoutSeparator(0)
- {
- Visible = false
- };
-
- // Quick access toolbar, minibar versions
- _captionQAT = new ViewLayoutRibbonQATMini(_ribbon, _needIntegratedDelegate);
- _nonCaptionQAT = new ViewLayoutRibbonQATMini(_ribbon, NeedPaintDelegate);
-
- // Layout needed to position and draw the context titles
- ContextTitles = new ViewLayoutRibbonContextTitles(_ribbon, this)
- {
- ReverseRenderOrder = true
- };
-
- // Create composition right border and attach to composition area
- _compRightBorder = new ViewDrawRibbonCompoRightBorder();
- _compositionArea.CompRightBorder = _compRightBorder;
-
- // Place app button on left side and fill remainder with context titles
- Add(ContextTitles, ViewDockStyle.Fill);
- Add(_nonCaptionQAT, ViewDockStyle.Left);
- Add(_otherAppButton, ViewDockStyle.Left);
-
- // ReSharper disable RedundantBaseQualifier
- // Update base class to use correct palette interface
- base.SetPalettes(_redirectCaption.PaletteBack, _redirectCaption.PaletteBorder);
- // ReSharper restore RedundantBaseQualifier
- }
-
- private void SetupParentMonitoring()
- {
- // We have to know when the parent of the ribbon changes so we can then hook
- // into monitoring the top level custom chrome control. We need information this
- // decide if we integrate with top chrome or show this control instead.
- _ribbon.ParentChanged += OnRibbonParentChanged;
- }
-
- private void OnRibbonParentChanged(object sender, EventArgs e)
- {
- // Unhook from any current krypton form monitoring
- if (KryptonForm != null)
- {
- KryptonForm.ApplyCustomChromeChanged -= OnFormChromeCheck;
- KryptonForm.ClientSizeChanged -= OnFormChromeCheck;
- KryptonForm.WindowActiveChanged -= OnWindowActiveChanged;
- KryptonForm = null;
- }
-
- if (!_ribbon.IsDisposed && !_ribbon.Disposing)
- {
- // Find the new owning level form we are hosted inside
-
- // Should always be inside a form, but you never know!
- if (_ribbon.Parent is Form ownerForm)
- {
- // We only care if the owner form is a KryptonForm instance
- if (ownerForm is KryptonForm)
- {
- KryptonForm = ownerForm as KryptonForm;
- KryptonForm.Composition = _compositionArea;
- KryptonForm.ApplyCustomChromeChanged += OnFormChromeCheck;
- KryptonForm.ClientSizeChanged += OnFormChromeCheck;
- KryptonForm.WindowActiveChanged += OnWindowActiveChanged;
- }
- }
-
- // Update decision about integrating or providing caption functionality
- OnFormChromeCheck(null, EventArgs.Empty);
- }
- }
-
- private void OnFormChromeCheck(object sender, EventArgs e)
- {
- bool needLayout = false;
- bool integrated = false;
-
- // Are we inside a KryptonForm instance that is using custom chrome?
- if ((KryptonForm != null) && KryptonForm.ApplyCustomChrome)
- {
- // Ribbon must be placed at the top left of the forms client area
- if (_ribbon.Location == Point.Empty)
- {
- // Find the height of the top caption area for the form
- int height = KryptonForm.RealWindowBorders.Top;
-
- // Must be at least the minimum for the application button and spacing gap above it
- if (height >= MIN_INTEGRATED_HEIGHT)
- {
- integrated = true;
- }
-
- // Update width of the separator used in place of the app button when app button not visible
- _spaceInsteadOfAppButton.SeparatorSize = new Size(KryptonForm.RealWindowBorders.Left, 0);
- }
- }
-
- if (KryptonForm != null)
- {
- bool overrideIntegrated = integrated;
-
- // If told to prevent the integration, then prevent it now
- if (PreventIntegration && overrideIntegrated)
- {
- overrideIntegrated = false;
- }
-
- // Is there a change in integrated requirements?
- if (overrideIntegrated != UsingCustomChrome)
- {
- // Do we need to inject our application button into the caption?
- if (!UsingCustomChrome)
- {
- _captionAppButton.OwnerForm = KryptonForm;
- _captionQAT.OwnerForm = KryptonForm;
- KryptonForm.InjectViewElement(_captionQAT, ViewDockStyle.Left);
- KryptonForm.InjectViewElement(_spaceInsteadOfAppButton, ViewDockStyle.Left);
- KryptonForm.InjectViewElement(_captionAppButton, ViewDockStyle.Left);
-
- // Only inject if not already present
- if (!_compoRightInjected)
- {
- KryptonForm.InjectViewElement(_compRightBorder, ViewDockStyle.Right);
- _compoRightInjected = true;
- }
-
- KryptonForm.InjectViewElement(ContextTitles, ViewDockStyle.Fill);
- }
- else
- {
- _captionAppButton.OwnerForm = null;
- _captionQAT.OwnerForm = null;
- KryptonForm.RevokeViewElement(ContextTitles, ViewDockStyle.Fill);
-
- // At runtime under vista we do not remove the compo right border
- if (_ribbon.InDesignMode ||
- (Environment.OSVersion.Version.Major < 6) ||
- !DWM.IsCompositionEnabled)
- {
- KryptonForm.RevokeViewElement(_compRightBorder, ViewDockStyle.Right);
- _compoRightInjected = true;
- }
-
- KryptonForm.RevokeViewElement(_captionAppButton, ViewDockStyle.Left);
- KryptonForm.RevokeViewElement(_spaceInsteadOfAppButton, ViewDockStyle.Left);
- KryptonForm.RevokeViewElement(_captionQAT, ViewDockStyle.Left);
- }
-
- UsingCustomChrome = overrideIntegrated;
- UpdateVisible();
- needLayout = true;
- }
-
- KryptonForm.AllowComposition = _ribbon.AllowFormIntegrate && !_ribbon.InDesignMode;
-
- //TODO call this function when palette is changing
- /*bool newAllowIconDisplay = (!UsingCustomChrome || !_ribbon.RibbonAppButton.AppButtonVisible
- || (_ribbon.RibbonAppButton.AppButtonVisible && (_ribbon.RibbonShape == PaletteRibbonShape.Office2010 || _ribbon.RibbonShape == PaletteRibbonShape.Office2013)));
- if (KryptonForm.AllowIconDisplay != newAllowIconDisplay)
- {
- KryptonForm.AllowIconDisplay = newAllowIconDisplay;
- needLayout = true;
- }*
-
- bool newAllowIconDisplay = (!_integrated || !_ribbon.RibbonAppButton.AppButtonVisible || (_ribbon.RibbonAppButton.AppButtonVisible && (_ribbon.RibbonShape == PaletteRibbonShape.Office2010 || _ribbon.RibbonShape == PaletteRibbonShape.Office2013)));
- if (_kryptonForm.AllowIconDisplay != newAllowIconDisplay)
- {
- _kryptonForm.AllowIconDisplay = newAllowIconDisplay;
- needLayout = true;
- }
- }
-
- // If not integrated
- if (!UsingCustomChrome)
- {
- // Get the font we used to draw the context tab text
- Font ribbonFont = _ribbon.StateCommon.RibbonGeneral.GetRibbonTextFont(PaletteState.Normal);
-
- // Can we use the cached font height?
- if (ribbonFont != _cacheRibbonFont)
- {
- _cacheRibbonFont = ribbonFont;
- _cacheRibbonFontHeight = ribbonFont.Height;
- }
-
- // Calculate the desired height of our own area
- int calculatedHeight = Math.Max(_cacheRibbonFontHeight + CAPTION_TEXT_GAPS, MIN_SELF_HEIGHT);
-
- // If a change in desired height then request layout to effect change
- if (_calculatedHeight != calculatedHeight)
- {
- _calculatedHeight = calculatedHeight;
- needLayout = true;
- }
- }
-
- if (needLayout)
- {
- PerformNeedPaint(true);
-
- if (KryptonForm != null)
- {
- KryptonForm.RecreateMinMaxCloseButtons();
- KryptonForm.PerformNeedPaint(true);
- }
- }
- }
-
- private void OnWindowActiveChanged(object sender, EventArgs e)
- {
- if (KryptonForm != null)
- {
- // When integrated into composition we need to repaint whenever the
- // owning form changes active status, as we are drawing the caption
- if (KryptonForm.ApplyCustomChrome && KryptonForm.ApplyComposition)
- {
- PerformNeedPaint(true);
- }
- }
- }
-
- private void OnAppButtonNeedPaint(object sender, NeedLayoutEventArgs e)
- {
- // Redraw the ribbon control to show change
- PerformNeedPaint(e.NeedLayout);
- _ribbon.Refresh();
-
- // If we have integrated the button into the custom chrome caption area
- if (UsingCustomChrome)
- {
- KryptonForm.PerformNeedPaint(e.NeedLayout);
- }
- }
-
- private void OnIntegratedNeedPaint(object sender, NeedLayoutEventArgs e)
- {
- // If we have integrated the button into the custom chrome caption area
- if (UsingCustomChrome)
- {
- KryptonForm.PerformNeedPaint(e.NeedLayout);
- }
-}
- #endregion
- }*/
- #endregion
-
- #region New Class
///
/// Ribbon area that contains the context titles, minibar and top half of application button.
///
@@ -690,13 +28,12 @@ internal class ViewDrawRibbonCaptionArea : ViewDrawDocker
private readonly NeedPaintHandler _needIntegratedDelegate;
private readonly PaletteCaptionRedirect _redirect;
private PaletteDoubleRedirect _redirectCaption;
- private readonly ViewDrawRibbonComposition _compositionArea;
private ViewLayoutRibbonAppButton _captionAppButton;
private ViewLayoutRibbonAppButton _otherAppButton;
private ViewLayoutSeparator _spaceInsteadOfAppButton;
private ViewLayoutRibbonQATMini _captionQAT;
private ViewLayoutRibbonQATMini _nonCaptionQAT;
- private ViewLayoutRibbonContextTitles? _contextTiles;
+ private ViewLayoutRibbonContextTitles _contextTiles;
private ViewDrawRibbonCompoRightBorder _compRightBorder;
private AppButtonController? _appButtonController;
private AppTabController? _appTabController;
@@ -710,34 +47,31 @@ internal class ViewDrawRibbonCaptionArea : ViewDrawDocker
#endregion
#region Identity
+
///
/// Initialize a new instance of the ViewDrawRibbonCaptionArea class.
///
/// Reference to owning ribbon control.
/// Reference to redirector for palette settings.
- /// Reference to the composition element.
/// Delegate for notifying paint/layout changes.
public ViewDrawRibbonCaptionArea([DisallowNull] KryptonRibbon ribbon,
[DisallowNull] PaletteRedirect redirect,
- [DisallowNull] ViewDrawRibbonComposition compositionArea,
[DisallowNull] NeedPaintHandler needPaintDelegate)
{
Debug.Assert(ribbon != null);
Debug.Assert(redirect != null);
- Debug.Assert(compositionArea != null);
Debug.Assert(needPaintDelegate != null);
MIN_INTEGRATED_HEIGHT = (int)(FactorDpiY * 26); // MiniBar, 16 image + 2 * (2 gap + 1 border + 2 border)
CAPTION_TEXT_GAPS = (int)(FactorDpiX * 10); // 4 below and 6 above
MIN_SELF_HEIGHT = (int)(FactorDpiY * 28); // Min height to show application button and the mini bar and context tabs
// Remember incoming references
- _ribbon = ribbon;
- _compositionArea = compositionArea;
- _needPaintDelegate = needPaintDelegate;
+ _ribbon = ribbon!;
+ _needPaintDelegate = needPaintDelegate!;
_needIntegratedDelegate = OnIntegratedNeedPaint;
// Create a special redirector for overriding the border setting
- _redirect = new PaletteCaptionRedirect(redirect);
+ _redirect = new PaletteCaptionRedirect(redirect!);
CreateViewElements();
SetupParentMonitoring();
@@ -765,9 +99,8 @@ protected override void Dispose(bool disposing)
_integrated = false;
}
- _kryptonForm.ApplyCustomChromeChanged -= OnFormChromeCheck;
+ _kryptonForm.ApplyUseThemeFormChromeBorderWidthChanged -= OnFormChromeCheck;
_kryptonForm.ClientSizeChanged -= OnFormChromeCheck;
- _kryptonForm.WindowActiveChanged -= OnWindowActiveChanged;
_kryptonForm = null;
}
}
@@ -807,8 +140,8 @@ public override string ToString() =>
///
public void HookToolTipHandling()
{
- _captionAppButton.MouseController = new ToolTipController(_ribbon.TabsArea.ButtonSpecManager.ToolTipManager!, _captionAppButton, _captionAppButton.MouseController!);
- _otherAppButton.MouseController = new ToolTipController(_ribbon.TabsArea.ButtonSpecManager.ToolTipManager!, _otherAppButton, _otherAppButton.MouseController!);
+ _captionAppButton.MouseController = new ToolTipController(_ribbon.TabsArea?.ButtonSpecManager?.ToolTipManager!, _captionAppButton, _captionAppButton.MouseController!);
+ _otherAppButton.MouseController = new ToolTipController(_ribbon.TabsArea?.ButtonSpecManager?.ToolTipManager!, _otherAppButton, _otherAppButton.MouseController!);
}
#endregion
@@ -859,7 +192,7 @@ public void AppButtonChanged() =>
/// Update the visible state of the caption area based on integration, app button, contexts and qat location.
///
public void UpdateVisible() => Visible = !_integrated &&
- (_ribbon.RibbonAppButton.AppButtonVisible ||
+ (_ribbon.RibbonFileAppButton.AppButtonVisible ||
(_ribbon.QATLocation == QATLocation.Above) ||
(_ribbon.RibbonContexts.Count > 0));
#endregion
@@ -909,7 +242,7 @@ public void UpdateQAT()
///
public void AppButtonVisibleChanged()
{
- var appButtonVisible = _ribbon.RibbonAppButton.AppButtonVisible && (_ribbon.RibbonShape == PaletteRibbonShape.Office2007);
+ var appButtonVisible = _ribbon.RibbonFileAppButton.AppButtonVisible && (_ribbon.RibbonShape == PaletteRibbonShape.Office2007);
if (_captionAppButton.Visible != appButtonVisible)
{
// Update visible state of the app button to reflect current state
@@ -962,14 +295,6 @@ public void RedrawCustomChrome(bool layout)
}
#endregion
- #region DrawCaptionOnComposition
- ///
- /// Gets a value indicating if drawing on the composition element.
- ///
- public bool DrawCaptionOnComposition => UsingCustomChrome && KryptonForm is { ApplyComposition: true };
-
- #endregion
-
#region KryptonForm
///
/// Gets access to the integration form.
@@ -1003,7 +328,7 @@ public Padding RealWindowBorders
///
/// Gets access to the layout view used for the context titles.
///
- public ViewLayoutRibbonContextTitles? ContextTitles => _contextTiles;
+ public ViewLayoutRibbonContextTitles ContextTitles => _contextTiles;
#endregion
@@ -1062,7 +387,7 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
Debug.Assert(context != null);
// Enforce the minimum height
- Size preferredSize = base.GetPreferredSize(context);
+ Size preferredSize = base.GetPreferredSize(context!);
preferredSize.Height = Math.Max(_calculatedHeight, preferredSize.Height);
return preferredSize;
@@ -1126,7 +451,6 @@ private void CreateViewElements()
// Create composition right border and attach to composition area
_compRightBorder = new ViewDrawRibbonCompoRightBorder();
- _compositionArea.CompRightBorder = _compRightBorder;
// Place app button on left side and fill remainder with context titles
Add(_contextTiles, ViewDockStyle.Fill);
@@ -1138,19 +462,18 @@ private void CreateViewElements()
}
private void SetupParentMonitoring() =>
- // We have to know when the parent of the ribbon changes so we can then hook
+ // We have to know when the parent of the ribbon changes, so we can then hook
// into monitoring the top level custom chrome control. We need information this
// decide if we integrate with top chrome or show this control instead.
_ribbon.ParentChanged += OnRibbonParentChanged;
- private void OnRibbonParentChanged(object sender, EventArgs e)
+ private void OnRibbonParentChanged(object? sender, EventArgs e)
{
// Unhook from any current krypton form monitoring
if (_kryptonForm != null)
{
- _kryptonForm.ApplyCustomChromeChanged -= OnFormChromeCheck;
+ _kryptonForm.ApplyUseThemeFormChromeBorderWidthChanged -= OnFormChromeCheck;
_kryptonForm.ClientSizeChanged -= OnFormChromeCheck;
- _kryptonForm.WindowActiveChanged -= OnWindowActiveChanged;
_kryptonForm = null;
}
@@ -1164,10 +487,8 @@ private void OnRibbonParentChanged(object sender, EventArgs e)
if (ownerForm is KryptonForm form)
{
_kryptonForm = form;
- _kryptonForm.Composition = _compositionArea;
- _kryptonForm.ApplyCustomChromeChanged += OnFormChromeCheck;
+ _kryptonForm.ApplyUseThemeFormChromeBorderWidthChanged += OnFormChromeCheck;
_kryptonForm.ClientSizeChanged += OnFormChromeCheck;
- _kryptonForm.WindowActiveChanged += OnWindowActiveChanged;
}
// Update decision about integrating or providing caption functionality
@@ -1181,7 +502,7 @@ private void OnFormChromeCheck(object? sender, EventArgs e)
var integrated = false;
// Are we inside a KryptonForm instance that is using custom chrome?
- if (_kryptonForm is { ApplyCustomChrome: true })
+ if (_kryptonForm != null)
{
// Ribbon must be placed at the top left of the forms client area
if (_ribbon.Location == Point.Empty)
@@ -1198,10 +519,7 @@ private void OnFormChromeCheck(object? sender, EventArgs e)
// Update width of the separator used in place of the app button when app button not visible
_spaceInsteadOfAppButton.SeparatorSize = new Size(_kryptonForm.RealWindowBorders.Left, 0);
}
- }
- if (_kryptonForm != null)
- {
var overrideIntegrated = integrated;
// If told to prevent the integration, then prevent it now
@@ -1238,9 +556,7 @@ private void OnFormChromeCheck(object? sender, EventArgs e)
_kryptonForm.RevokeViewElement(_contextTiles, ViewDockStyle.Fill);
// At runtime under vista we do not remove the compo right border
- if (_ribbon.InDesignMode ||
- (Environment.OSVersion.Version.Major < 6) ||
- !DWM.IsCompositionEnabled)
+ if (_ribbon.InDesignMode)
{
_kryptonForm.RevokeViewElement(_compRightBorder, ViewDockStyle.Right);
_compoRightInjected = true;
@@ -1256,12 +572,10 @@ private void OnFormChromeCheck(object? sender, EventArgs e)
needLayout = true;
}
- _kryptonForm.AllowComposition = _ribbon is { AllowFormIntegrate: true, InDesignMode: false };
-
//TODO: call this function when palette is changing
var newAllowIconDisplay = !_integrated
- || !_ribbon.RibbonAppButton.AppButtonVisible
- || (_ribbon.RibbonAppButton.AppButtonVisible
+ || !_ribbon.RibbonFileAppButton.AppButtonVisible
+ || (_ribbon.RibbonFileAppButton.AppButtonVisible
&& _ribbon.RibbonShape is PaletteRibbonShape.Office2010 or PaletteRibbonShape.VisualStudio2010 or PaletteRibbonShape.Office2013 or PaletteRibbonShape.Microsoft365 or PaletteRibbonShape.VisualStudio
)
;
@@ -1279,7 +593,7 @@ private void OnFormChromeCheck(object? sender, EventArgs e)
Font ribbonFont = _ribbon.StateCommon.RibbonGeneral.GetRibbonTextFont(PaletteState.Normal);
// Can we use the cached font height?
- if (ribbonFont != _cacheRibbonFont)
+ if (!Equals(ribbonFont, _cacheRibbonFont))
{
_cacheRibbonFont = ribbonFont;
_cacheRibbonFontHeight = ribbonFont.Height;
@@ -1308,16 +622,6 @@ private void OnFormChromeCheck(object? sender, EventArgs e)
}
}
- private void OnWindowActiveChanged(object sender, EventArgs e)
- {
- if (_kryptonForm is { ApplyCustomChrome: true, ApplyComposition: true })
- // When integrated into composition we need to repaint whenever the
- // owning form changes active status, as we are drawing the caption
- {
- PerformNeedPaint(true);
- }
- }
-
private void OnAppButtonNeedPaint(object sender, NeedLayoutEventArgs e)
{
// Redraw the ribbon control to show change
@@ -1331,7 +635,7 @@ private void OnAppButtonNeedPaint(object sender, NeedLayoutEventArgs e)
}
}
- private void OnIntegratedNeedPaint(object sender, NeedLayoutEventArgs e)
+ private void OnIntegratedNeedPaint(object? sender, NeedLayoutEventArgs e)
{
// If we have integrated the button into the custom chrome caption area
if (_integrated)
@@ -1341,5 +645,4 @@ private void OnIntegratedNeedPaint(object sender, NeedLayoutEventArgs e)
}
#endregion
}
- #endregion
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonCompoRightBorder.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonCompoRightBorder.cs
index 92214b836..aecc4ee7b 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonCompoRightBorder.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonCompoRightBorder.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -21,15 +21,16 @@ internal class ViewDrawRibbonCompoRightBorder : ViewLeaf
{
#region Instance Fields
- private int _width;
- private readonly int SPACING_GAP; // = 10;
+ // Note: Do we need _width?
+ // private int _width;
+ private readonly int _spacingGap; // = 10;
#endregion
#region Identity
///
/// Initialize a new instance of the ViewDrawRibbonCompoRightBorder class.
///
- public ViewDrawRibbonCompoRightBorder() => SPACING_GAP = (int)(10 * FactorDpiX);
+ public ViewDrawRibbonCompoRightBorder() => _spacingGap = (int)(10 * FactorDpiX);
///
/// Obtains the String representation of this instance.
@@ -58,64 +59,6 @@ public override Size GetPreferredSize(ViewLayoutContext context)
{
var preferredSize = Size.Empty;
- // We need an owning form to perform calculations
- if (CompOwnerForm is { ApplyCustomChrome: true, ApplyComposition: true })
- // We only have size if custom chrome is being used with composition
- {
- try
- {
- // Create structure that will be populated by call to WM_GETTITLEBARINFOEX
- var tbi = new PI.TITLEBARINFOEX();
- tbi.cbSize = (uint) Marshal.SizeOf(tbi);
-
- // Ask the window for the title bar information
- PI.SendMessage(CompOwnerForm.Handle, PI.WM_.GETTITLEBARINFOEX, IntPtr.Zero, ref tbi);
-
- // Find width of the button rectangle
- var closeWidth = tbi.rcCloseButton.right - tbi.rcCloseButton.left;
- var helpWidth = tbi.rcHelpButton.right - tbi.rcHelpButton.left;
- var minWidth = tbi.rcMinimizeButton.right - tbi.rcMinimizeButton.left;
- var maxWidth = tbi.rcMaximizeButton.right - tbi.rcMaximizeButton.left;
-
- var clientWidth = CompOwnerForm.ClientSize.Width;
- var clientScreenRight = CompOwnerForm.RectangleToScreen(CompOwnerForm.ClientRectangle).Right;
- var leftMost = clientScreenRight;
-
- // Find the left most button edge (start with right side of client area)
- if ((closeWidth > 0) && (closeWidth < clientWidth))
- {
- leftMost = Math.Min(leftMost, tbi.rcCloseButton.left);
- }
-
- if ((helpWidth > 0) && (helpWidth < clientWidth))
- {
- leftMost = Math.Min(leftMost, tbi.rcHelpButton.left);
- }
-
- if ((minWidth > 0) && (minWidth < clientWidth))
- {
- leftMost = Math.Min(leftMost, tbi.rcMinimizeButton.left);
- }
-
- if ((maxWidth > 0) && (maxWidth < clientWidth))
- {
- leftMost = Math.Min(leftMost, tbi.rcMaximizeButton.left);
- }
-
- // Our width is the distance between the left most button edge and the right
- // side of the client area (this space the buttons are taking up). Plus a small
- // extra gap between the first button and the caption elements to its left.
- _width = clientScreenRight - leftMost + SPACING_GAP;
-
- preferredSize.Width = _width;
- }
- catch(ObjectDisposedException)
- {
- // Asking for the WM_GETTITLEBARINFOEX can cause exception if the form level
- // Icon has already been disposed. This happens in rare circumstances.
- }
- }
-
return preferredSize;
}
@@ -128,7 +71,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
Debug.Assert(context != null);
// Start with all the provided space
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
}
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonComposition.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonComposition.cs
deleted file mode 100644
index c85ae2cbd..000000000
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonComposition.cs
+++ /dev/null
@@ -1,191 +0,0 @@
-#region BSD License
-/*
- *
- * Original BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE)
- * © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
- *
- * New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
- *
- * Modified: Monday 12th April, 2021 @ 18:00 GMT
- *
- */
-#endregion
-
-namespace Krypton.Ribbon
-{
- ///
- /// Allocate space for the location of the composition caption area.
- ///
- internal class ViewDrawRibbonComposition : ViewLeaf,
- IKryptonComposition
- {
- #region Instance Fields
- private readonly int CONSTANT_COMPOSITION_HEIGHT;
- private readonly KryptonRibbon _ribbon;
- private VisualForm _ownerForm;
- private readonly NeedPaintHandler _needPaint;
- private readonly Blend _compBlend;
- #endregion
-
- #region Identity
- ///
- /// Initialize a new instance of the ViewDrawRibbonComposition class.
- ///
- /// Owning control instance.
- /// Delegate for requested a paint.
- public ViewDrawRibbonComposition([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] NeedPaintHandler needPaint)
- {
- Debug.Assert(ribbon != null);
- Debug.Assert(needPaint != null);
-
- CONSTANT_COMPOSITION_HEIGHT = (int)(30 * FactorDpiY);
-
- _ribbon = ribbon;
- _needPaint = needPaint;
-
- _compBlend = new Blend
- {
- Positions = new[] { 0.0f, 0.25f, 1.0f },
- Factors = new[] { 0.0f, 0.0f, 0.40f }
- };
- }
-
- ///
- /// Obtains the String representation of this instance.
- ///
- /// User readable name of the instance.
- public override string ToString() =>
- // Return the class name and instance identifier
- $@"ViewDrawRibbonComposition:{Id}";
-
- #endregion
-
- #region CompHeight
- ///
- /// Gets the pixel height of the composition extension into the client area.
- ///
- public int CompHeight
- {
- get
- {
- if (_ribbon is { RibbonShape: PaletteRibbonShape.Office2010, MainPanel.Visible: true })
- {
- return _ribbon.TabsArea.ClientHeight + CONSTANT_COMPOSITION_HEIGHT;
- }
- else
- {
- return CONSTANT_COMPOSITION_HEIGHT;
- }
- }
- }
- #endregion
-
- #region CompRightBorder
- ///
- /// Gets and sets the associated right border for composition layout.
- ///
- public ViewDrawRibbonCompoRightBorder CompRightBorder { get; set; }
-
- #endregion
-
- #region CompHandle
- ///
- /// Gets the handle of the composition element control.
- ///
- public IntPtr CompHandle => _ribbon.Handle;
-
- #endregion
-
- #region CompVisible
- ///
- /// Gets and sets the visible state.
- ///
- public bool CompVisible
- {
- get => Visible;
- set => Visible = value;
- }
- #endregion
-
- #region CompOwnerForm
- ///
- /// Gets and sets the owner form to use when compositing.
- ///
- public VisualForm CompOwnerForm
- {
- get => _ownerForm;
-
- set
- {
- _ownerForm = value;
- CompRightBorder.CompOwnerForm = value;
- }
- }
- #endregion
-
- #region CompNeedPaint
- ///
- /// Request a repaint and optional layout.
- ///
- /// Is a layout required.
- public void CompNeedPaint(bool needLayout) =>
- // Pass request onto the ribbon instance
- _needPaint(this, new NeedLayoutEventArgs(needLayout));
- #endregion
-
- #region Layout
- ///
- /// Discover the preferred size of the element.
- ///
- /// Layout context.
- public override Size GetPreferredSize(ViewLayoutContext context) => new Size(0, CONSTANT_COMPOSITION_HEIGHT);
-
- ///
- /// Perform a layout of the elements.
- ///
- /// Layout context.
- public override void Layout([DisallowNull] ViewLayoutContext context)
- {
- Debug.Assert(context != null);
-
- // We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
-
- Rectangle contextRect = ClientRectangle;
-
- // Use the entire height of the control and not just the composition height
- contextRect.Height = context.TopControl.Height;
-
- // Make bigger by the left and right borders, so that the application button is shifted
- // to match up with the client area of the actual ribbon control in the client area
- Padding realBorders = _ownerForm.RealWindowBorders;
- contextRect.X -= realBorders.Left;
- contextRect.Width += realBorders.Horizontal;
-
- context.DisplayRectangle = contextRect;
-
- // Ask the integrated form to perform layout in our area
- _ownerForm.WindowChromeCompositionLayout(context, ClientRectangle);
-
- // Put back the original display rectangle
- context.DisplayRectangle = ClientRectangle;
- }
- #endregion
-
- #region Paint
- ///
- /// Perform rendering before child elements are rendered.
- ///
- /// Rendering context.
- public override void RenderBefore([DisallowNull] RenderContext context)
- {
- Debug.Assert(_ownerForm != null);
-
- // Ask the owning form to perform rendering in this element
- _ownerForm.WindowChromeCompositionPaint(context);
- }
- #endregion
- }
-}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonContextTitle.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonContextTitle.cs
index bda94fcbc..a22f9a1f0 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonContextTitle.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonContextTitle.cs
@@ -5,10 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
- *
- * Modified: Monday 12th April, 2021 @ 18:00 GMT
- *
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*/
#endregion
@@ -32,9 +29,8 @@ internal class ViewDrawRibbonContextTitle : ViewLeaf,
private IDisposable? _mementoContentShadow1;
private IDisposable? _mementoContentShadow2;
private Rectangle _textRect;
- private readonly int TEXT_SIDE_GAP; // = 4;
- private readonly int TEXT_SIDE_GAP_COMPOSITION; // = 2;
- private readonly int TEXT_BOTTOM_GAP; // = 3;
+ private readonly int _textSideGap; // = 4;
+ private readonly int _textBottomGap; // = 3;
#endregion
#region Identity
@@ -42,23 +38,22 @@ internal class ViewDrawRibbonContextTitle : ViewLeaf,
/// Initialize a new instance of the ViewDrawRibbonContextTitle class.
///
/// Source ribbon control.
- /// Source for inheriting the ribbon bacgkground colors.
+ /// Source for inheriting the ribbon background colors.
public ViewDrawRibbonContextTitle([DisallowNull] KryptonRibbon ribbon,
[DisallowNull] IPaletteRibbonBack inherit)
{
Debug.Assert(ribbon != null);
Debug.Assert(inherit != null);
- TEXT_SIDE_GAP = (int)(4 * FactorDpiX);
- TEXT_SIDE_GAP_COMPOSITION = (int)(2 * FactorDpiX);
- TEXT_BOTTOM_GAP = (int)(3 * FactorDpiY);
+ _textSideGap = (int)(4 * FactorDpiX);
+ _textBottomGap = (int)(3 * FactorDpiY);
// Remember incoming references
- _inherit = inherit;
- _ribbon = ribbon;
+ _inherit = inherit!;
+ _ribbon = ribbon!;
// Use a class to convert from ribbon tab to content interface
- _contentProvider = new ContextToContent(ribbon.StateCommon.RibbonGeneral);
+ _contentProvider = new ContextToContent(_ribbon.StateCommon.RibbonGeneral);
}
///
@@ -110,7 +105,7 @@ protected override void Dispose(bool disposing)
///
/// Gets and sets the context to display.
///
- public ContextTabSet ContextTabSet
+ public ContextTabSet? ContextTabSet
{
get => _context;
@@ -150,15 +145,25 @@ public override Size GetPreferredSize(ViewLayoutContext context) =>
/// Layout context.
public override void Layout([DisallowNull] ViewLayoutContext context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
- ClientRectangle = context.DisplayRectangle;
+ if (context is null)
+ {
+ throw new ArgumentNullException(nameof(context));
+ }
+
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
+ ClientRectangle = context!.DisplayRectangle;
// We always extend an extra pixel downwards to draw over the containers border
var adjustRect = new Rectangle(ClientRectangle.X, ClientRectangle.Y, ClientWidth, ClientHeight + 1);
// Get the client rect of the parent
- Rectangle parentRect = Parent.ClientRectangle;
+ Rectangle parentRect = Parent!.ClientRectangle;
// If we are only partially visible on the right hand side
if ((adjustRect.X < parentRect.Right) && (adjustRect.Right >= parentRect.Right))
@@ -180,9 +185,9 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
// Use the font height to decide on the text rectangle
var fontHeight = _ribbon.CalculatedValues.DrawFontHeight;
- _textRect = new Rectangle(ClientLocation.X + TEXT_SIDE_GAP,
- ClientLocation.Y + (ClientHeight - fontHeight - TEXT_BOTTOM_GAP),
- ClientWidth - (TEXT_SIDE_GAP * 2),
+ _textRect = new Rectangle(ClientLocation.X + _textSideGap,
+ ClientLocation.Y + (ClientHeight - fontHeight - _textBottomGap),
+ ClientWidth - (_textSideGap * 2),
fontHeight);
// Remember to dispose of old memento
@@ -212,20 +217,17 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
_contentProvider.OverrideTextColor = Color.FromArgb(128, ControlPaint.Dark(GetRibbonBackColor1(PaletteState.Normal)));
- if (DrawOnComposition)
- {
- _contentProvider.OverrideTextHint = PaletteTextHint.SingleBitPerPixelGridFit;
- }
+ _contentProvider.OverrideTextHint = PaletteTextHint.SingleBitPerPixelGridFit;
_mementoContentShadow1 = context.Renderer.RenderStandardContent.LayoutContent(context, shadowTextRect1,
_contentProvider, this,
VisualOrientation.Top,
- PaletteState.Normal, false, false);
+ PaletteState.Normal);
_mementoContentShadow2 = context.Renderer.RenderStandardContent.LayoutContent(context, shadowTextRect2,
_contentProvider, this,
VisualOrientation.Top,
- PaletteState.Normal, false, false);
+ PaletteState.Normal);
_contentProvider.OverrideTextColor = Color.Empty;
}
@@ -233,7 +235,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
_mementoContentText = context.Renderer.RenderStandardContent.LayoutContent(context, _textRect,
_contentProvider, this,
VisualOrientation.Top,
- PaletteState.Normal, false, false);
+ PaletteState.Normal);
_contentProvider.OverrideTextHint = PaletteTextHint.Inherit;
}
@@ -246,33 +248,40 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
/// Rendering context.
public override void RenderBefore(RenderContext context)
{
+ if (context is null)
+ {
+ throw new ArgumentNullException(nameof(context));
+ }
+
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
// Office 2010 draws a shadow effect of the text
if ((_ribbon.RibbonShape == PaletteRibbonShape.Office2010) && (_mementoContentShadow1 != null))
{
PaletteState state = _ribbon.Enabled ? PaletteState.Normal : PaletteState.Disabled;
// Use renderer to draw the tab background
- _mementoBack = context.Renderer.RenderRibbon.DrawRibbonTabContextTitle(_ribbon.RibbonShape, context, ClientRectangle, _ribbon.StateCommon.RibbonGeneral, this, _mementoBack);
+ _mementoBack = context.Renderer.RenderRibbon.DrawRibbonTabContextTitle(_ribbon.RibbonShape, context, ClientRectangle, _ribbon.StateCommon.RibbonGeneral, this, _mementoBack!);
var shadowTextRect1 = _textRect with { X = _textRect.X - 1, Y = _textRect.Y + 1 };
var shadowTextRect2 = _textRect with { X = _textRect.X + 1, Y = _textRect.Y + 1 };
_contentProvider.OverrideTextColor = Color.FromArgb(128, ControlPaint.Dark(GetRibbonBackColor1(PaletteState.Normal)));
- if (DrawOnComposition)
- {
- _contentProvider.OverrideTextHint = PaletteTextHint.SingleBitPerPixelGridFit;
- }
+ _contentProvider.OverrideTextHint = PaletteTextHint.SingleBitPerPixelGridFit;
context.Renderer.RenderStandardContent.DrawContent(context, shadowTextRect1,
_contentProvider, _mementoContentShadow1,
VisualOrientation.Top,
- state, false, false, true);
+ state, true);
context.Renderer.RenderStandardContent.DrawContent(context, shadowTextRect2,
- _contentProvider, _mementoContentShadow2,
+ _contentProvider, _mementoContentShadow2!,
VisualOrientation.Top,
- state, false, false, true);
+ state, true);
_contentProvider.OverrideTextColor = Color.Empty;
@@ -282,32 +291,25 @@ public override void RenderBefore(RenderContext context)
context.Renderer.RenderStandardContent.DrawContent(context, _textRect,
_contentProvider, _mementoContentText,
VisualOrientation.Top,
- state, false, false, true);
+ state, true);
}
_contentProvider.OverrideTextHint = PaletteTextHint.Inherit;
}
else
{
- if (DrawOnComposition)
- {
- RenderOnComposition(context);
- }
- else
+ PaletteState state = _ribbon.Enabled ? PaletteState.Normal : PaletteState.Disabled;
+
+ // Use renderer to draw the tab background
+ _mementoBack = context.Renderer.RenderRibbon.DrawRibbonTabContextTitle(_ribbon.RibbonShape, context, ClientRectangle, _ribbon.StateCommon.RibbonGeneral, this, _mementoBack!);
+
+ // Use renderer to draw the text content
+ if (_mementoContentText != null)
{
- PaletteState state = _ribbon.Enabled ? PaletteState.Normal : PaletteState.Disabled;
-
- // Use renderer to draw the tab background
- _mementoBack = context.Renderer.RenderRibbon.DrawRibbonTabContextTitle(_ribbon.RibbonShape, context, ClientRectangle, _ribbon.StateCommon.RibbonGeneral, this, _mementoBack);
-
- // Use renderer to draw the text content
- if (_mementoContentText != null)
- {
- context.Renderer.RenderStandardContent.DrawContent(context, _textRect,
- _contentProvider, _mementoContentText,
- VisualOrientation.Top,
- state, DrawOnComposition, DrawOnComposition, true);
- }
+ context.Renderer.RenderStandardContent.DrawContent(context, _textRect,
+ _contentProvider, _mementoContentText,
+ VisualOrientation.Top,
+ state, true);
}
}
}
@@ -413,98 +415,6 @@ public Color GetRibbonBackColor5(PaletteState state)
#endregion
#region Implementation
- private void RenderOnComposition(RenderContext context)
- {
- // Convert the clipping rectangle from floating to int version
- RectangleF rectClipF = context.Graphics.ClipBounds;
- var rectClip = new Rectangle((int)rectClipF.X, (int)rectClipF.Y, (int)rectClipF.Width,
- (int)rectClipF.Height);
-
- // No point drawing unless some of the client fits into the clipping area
- if (rectClip.IntersectsWith(ClientRectangle))
- {
- // Get the hDC for the graphics instance and create a memory DC
- var gDC = context.Graphics.GetHdc();
- var mDC = PI.CreateCompatibleDC(gDC);
-
- var bmi = new PI.BITMAPINFO();
- bmi.biSize = (uint)Marshal.SizeOf(bmi);
- bmi.biWidth = ClientWidth;
- bmi.biHeight = -ClientHeight;
- bmi.biCompression = 0;
- bmi.biBitCount = 32;
- bmi.biPlanes = 1;
-
- // Create a device independant bitmp and select into the memory DC
- var hDIB = PI.CreateDIBSection(gDC, ref bmi, 0, out _, IntPtr.Zero, 0);
- PI.SelectObject(mDC, hDIB);
-
- // To call the renderer we need to convert from Win32 HDC to Graphics object
- using (Graphics bitmapG = Graphics.FromHdc(mDC))
- {
- var renderClientRect = new Rectangle(0, 0, ClientWidth, ClientHeight);
-
- // Create new render context that uses the bitmap graphics instance
- using (var bitmapContext = new RenderContext(context.Control,
- bitmapG, renderClientRect, context.Renderer))
- {
- // Finally we get the renderer to draw the background for the bitmap
- _mementoBack = context.Renderer.RenderRibbon.DrawRibbonTabContextTitle(_ribbon.RibbonShape, bitmapContext, renderClientRect, _ribbon.StateCommon.RibbonGeneral, this, _mementoBack);
- }
- }
-
- // Select the font for use when drawing
- var hFont = _contentProvider.GetContentShortTextFont(State).ToHfont();
- PI.SelectObject(mDC, hFont);
-
- // Get renderer for the correct state
- var renderer = new VisualStyleRenderer(VisualStyleElement.Window.Caption.Active);
-
- // Create structures needed for theme drawing call
- var textBounds = new PI.RECT
- {
- left = TEXT_SIDE_GAP_COMPOSITION,
- top = 0,
- right = ClientWidth - (TEXT_SIDE_GAP_COMPOSITION * 2),
- bottom = ClientHeight
- };
- var dttOpts = new PI.DTTOPTS
- {
- dwSize = Marshal.SizeOf(typeof(PI.DTTOPTS)),
- dwFlags = PI.DTT_COMPOSITED | PI.DTT_GLOWSIZE | PI.DTT_TEXTCOLOR,
- crText = ColorTranslator.ToWin32(SystemColors.ActiveCaptionText),
- iGlowSize = _ribbon.Enabled ? 12 : 2
- };
-
- // Always draw text centered
- const TextFormatFlags TEXT_FORMAT = TextFormatFlags.SingleLine |
- TextFormatFlags.HorizontalCenter |
- TextFormatFlags.VerticalCenter |
- TextFormatFlags.EndEllipsis;
-
- // Perform actual drawing
- PI.DrawThemeTextEx(renderer.Handle,
- mDC, 0, 0,
- GetShortText(), -1, (int)TEXT_FORMAT,
- ref textBounds, ref dttOpts);
-
- // Copy to foreground
- PI.BitBlt(gDC,
- ClientLocation.X, ClientLocation.Y,
- ClientWidth, ClientHeight,
- mDC, 0, 0, 0x00CC0020);
-
- // Dispose of allocated objects
- PI.DeleteObject(hFont);
- PI.DeleteObject(hDIB);
- PI.DeleteDC(mDC);
-
- // Must remember to release the hDC
- context.Graphics.ReleaseHdc(gDC);
- }
- }
-
- private bool DrawOnComposition => _ribbon is { CaptionArea.DrawCaptionOnComposition: true };
private Color CheckForContextColor() =>
// We need an associated context
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonDesignBase.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonDesignBase.cs
index 9045e35e4..8137006e9 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonDesignBase.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonDesignBase.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -39,15 +39,15 @@ public ViewDrawRibbonDesignBase([DisallowNull] KryptonRibbon ribbon,
Debug.Assert(needPaint != null);
// Cache incoming values
- Ribbon = ribbon;
- _needPaint = needPaint;
+ Ribbon = ribbon!;
+ _needPaint = needPaint!;
// Create and add the draw content for display inside the tab
- _contentProvider = new DesignTextToContent(ribbon);
+ _contentProvider = new DesignTextToContent(ribbon!);
Add(new ViewDrawContent(_contentProvider, this, VisualOrientation.Top));
// Use a controller to change state because of mouse movement
- var controller = new ViewHightlightController(this, needPaint);
+ var controller = new ViewHightlightController(this, needPaint!);
controller.Click += OnClick;
MouseController = controller;
}
@@ -94,7 +94,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
Debug.Assert(context != null);
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// Reduce our size by a padding around the element
ClientRectangle = new Rectangle(ClientLocation.X + OuterPadding.Left,
@@ -124,7 +124,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
public override void RenderBefore(RenderContext context)
{
// Ensure the child text view has same state as us
- this[0].ElementState = ElementState;
+ this[0]!.ElementState = ElementState;
// Draw background using the design time colors
DesignTimeDraw.DrawArea(Ribbon, context, ClientRectangle, State);
@@ -183,7 +183,7 @@ public override void RenderBefore(RenderContext context)
///
/// Source of the event.
/// An EventArgs containing the event data.
- protected virtual void OnClick(object sender, EventArgs e)
+ protected virtual void OnClick(object? sender, EventArgs e)
{
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonDesignCluster.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonDesignCluster.cs
index e8d2b2fb9..0b1d7b465 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonDesignCluster.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonDesignCluster.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -37,11 +37,10 @@ static ViewDrawRibbonDesignCluster()
{
TransparentColor = Color.Magenta
};
- _imageList.Images.AddRange(new Image[]
- {
+ _imageList.Images.AddRange([
GenericImageResources.KryptonRibbonGroupClusterButton,
GenericImageResources.KryptonRibbonGroupClusterColorButton
- });
+ ]);
}
///
@@ -56,7 +55,7 @@ public ViewDrawRibbonDesignCluster(KryptonRibbon ribbon,
: base(ribbon, needPaint)
{
Debug.Assert(ribbonCluster != null);
- _ribbonCluster = ribbonCluster;
+ _ribbonCluster = ribbonCluster!;
_padding = new Padding((int)(1 * FactorDpiX), (int)(2 * FactorDpiY), 0, (int)(2 * FactorDpiY));
}
@@ -97,7 +96,7 @@ public override string ToString() =>
///
/// Source of the event.
/// An EventArgs containing the event data.
- protected override void OnClick(object sender, EventArgs e)
+ protected override void OnClick(object? sender, EventArgs e)
{
// Create the context strip the first time around
if (_cms == null)
@@ -131,9 +130,9 @@ protected override void OnClick(object sender, EventArgs e)
#endregion
#region Implementation
- private void OnAddButton(object sender, EventArgs e) => _ribbonCluster.OnDesignTimeAddButton();
+ private void OnAddButton(object? sender, EventArgs e) => _ribbonCluster.OnDesignTimeAddButton();
- private void OnAddColorButton(object sender, EventArgs e) => _ribbonCluster.OnDesignTimeAddColorButton();
+ private void OnAddColorButton(object? sender, EventArgs e) => _ribbonCluster.OnDesignTimeAddColorButton();
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonDesignGroup.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonDesignGroup.cs
index 207f4fade..30a1148c3 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonDesignGroup.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonDesignGroup.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -69,7 +69,7 @@ public override string ToString() =>
///
/// Source of the event.
/// An EventArgs containing the event data.
- protected override void OnClick(object sender, EventArgs e) => Ribbon.SelectedTab.OnDesignTimeAddGroup();
+ protected override void OnClick(object? sender, EventArgs e) => Ribbon.SelectedTab?.OnDesignTimeAddGroup();
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonDesignGroupContainer.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonDesignGroupContainer.cs
index af5f43633..0aae5eb75 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonDesignGroupContainer.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonDesignGroupContainer.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -37,13 +37,12 @@ static ViewDrawRibbonDesignGroupContainer()
{
TransparentColor = Color.Magenta
};
- _imageList.Images.AddRange(new Image[]
- {
+ _imageList.Images.AddRange([
GenericImageResources.KryptonRibbonGroupTriple,
GenericImageResources.KryptonRibbonGroupLines,
GenericImageResources.KryptonRibbonGroupSeparator,
GenericImageResources.KryptonGallery
- });
+ ]);
}
///
@@ -58,7 +57,7 @@ public ViewDrawRibbonDesignGroupContainer(KryptonRibbon ribbon,
: base(ribbon, needPaint)
{
Debug.Assert(ribbonGroup != null);
- _ribbonGroup = ribbonGroup;
+ _ribbonGroup = ribbonGroup!;
_padding = new Padding((int)(1 * FactorDpiX), 0, 0, 0);
}
@@ -99,7 +98,7 @@ public override string ToString() =>
///
/// Source of the event.
/// An EventArgs containing the event data.
- protected override void OnClick(object sender, EventArgs e)
+ protected override void OnClick(object? sender, EventArgs e)
{
// Create the context strip the first time around
if (_cms == null)
@@ -137,13 +136,13 @@ protected override void OnClick(object sender, EventArgs e)
#endregion
#region Implementation
- private void OnAddTriple(object sender, EventArgs e) => _ribbonGroup.OnDesignTimeAddTriple();
+ private void OnAddTriple(object? sender, EventArgs e) => _ribbonGroup.OnDesignTimeAddTriple();
- private void OnAddLines(object sender, EventArgs e) => _ribbonGroup.OnDesignTimeAddLines();
+ private void OnAddLines(object? sender, EventArgs e) => _ribbonGroup.OnDesignTimeAddLines();
- private void OnAddSeparator(object sender, EventArgs e) => _ribbonGroup.OnDesignTimeAddSeparator();
+ private void OnAddSeparator(object? sender, EventArgs e) => _ribbonGroup.OnDesignTimeAddSeparator();
- private void OnAddGallery(object sender, EventArgs e) => _ribbonGroup.OnDesignTimeAddGallery();
+ private void OnAddGallery(object? sender, EventArgs e) => _ribbonGroup.OnDesignTimeAddGallery();
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonDesignGroupLines.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonDesignGroupLines.cs
index 98a3e7581..8ce623c19 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonDesignGroupLines.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonDesignGroupLines.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -15,7 +15,7 @@
namespace Krypton.Ribbon
{
///
- /// Draws an design time only for adding a new item to a lines container.
+ /// Draws a design time only for adding a new item to a lines' container.
///
internal class ViewDrawRibbonDesignGroupLines : ViewDrawRibbonDesignBase
{
@@ -37,8 +37,7 @@ static ViewDrawRibbonDesignGroupLines()
{
TransparentColor = Color.Magenta
};
- _imageList.Images.AddRange(new Image[]
- {
+ _imageList.Images.AddRange([
GenericImageResources.KryptonRibbonGroupButton,
GenericImageResources.KryptonRibbonGroupColorButton,
GenericImageResources.KryptonRibbonGroupCheckBox,
@@ -54,7 +53,7 @@ static ViewDrawRibbonDesignGroupLines()
GenericImageResources.KryptonRibbonGroupDomainUpDown,
GenericImageResources.KryptonRibbonGroupDateTimePicker,
GenericImageResources.KryptonRibbonGroupTrackBar
- });
+ ]);
}
///
@@ -72,7 +71,7 @@ public ViewDrawRibbonDesignGroupLines(KryptonRibbon ribbon,
{
Debug.Assert(ribbonLines != null);
- _ribbonLines = ribbonLines;
+ _ribbonLines = ribbonLines!;
CurrentSize = currentSize;
_padding = new Padding(0, (int)(2 * FactorDpiY), (int)(2 * FactorDpiX), (int)(4 * FactorDpiY));
}
@@ -122,7 +121,7 @@ public override string ToString() =>
///
/// Source of the event.
/// An EventArgs containing the event data.
- protected override void OnClick(object sender, EventArgs e)
+ protected override void OnClick(object? sender, EventArgs e)
{
// Create the context strip the first time around
if (_cms == null)
@@ -148,6 +147,7 @@ protected override void OnClick(object sender, EventArgs e)
var menuDomainUpDown = new ToolStripMenuItem("Add DomainUpDown", null, OnAddDomainUpDown);
var menuDateTimePicker = new ToolStripMenuItem("Add DateTimePicker", null, OnAddDateTimePicker);
var menuTrackBar = new ToolStripMenuItem("Add TrackBar", null, OnAddTrackBar);
+ var menuThemeComboBox = new ToolStripMenuItem("Add Theme ComboBox", null, OnAddThemeComboBox);
// Assign correct images
menuButton.ImageIndex = 0;
@@ -165,9 +165,10 @@ protected override void OnClick(object sender, EventArgs e)
menuDomainUpDown.ImageIndex = 12;
menuDateTimePicker.ImageIndex = 13;
menuTrackBar.ImageIndex = 13;
+ menuThemeComboBox.ImageIndex = 14;
// Finally, add all items to the strip
- _cms.Items.AddRange(new ToolStripItem[] { menuButton, menuColorButton, menuCheckBox, menuCluster, menuComboBox, menuCustomControl, menuDateTimePicker, menuDomainUpDown, menuLabel, menuNumericUpDown, menuRadioButton, menuRichTextBox, menuTextBox, menuTrackBar, menuMaskedTextBox });
+ _cms.Items.AddRange(new ToolStripItem[] { menuButton, menuColorButton, menuCheckBox, menuCluster, menuComboBox, menuCustomControl, menuDateTimePicker, menuDomainUpDown, menuLabel, menuNumericUpDown, menuRadioButton, menuRichTextBox, menuTextBox, menuTrackBar, menuMaskedTextBox, menuThemeComboBox });
}
if (CommonHelper.ValidContextMenuStrip(_cms))
@@ -182,35 +183,38 @@ protected override void OnClick(object sender, EventArgs e)
#endregion
#region Implementation
- private void OnAddButton(object sender, EventArgs e) => _ribbonLines.OnDesignTimeAddButton();
+ private void OnAddButton(object? sender, EventArgs e) => _ribbonLines.OnDesignTimeAddButton();
+
+ private void OnAddColorButton(object? sender, EventArgs e) => _ribbonLines.OnDesignTimeAddColorButton();
+
+ private void OnAddCheckBox(object? sender, EventArgs e) => _ribbonLines.OnDesignTimeAddCheckBox();
- private void OnAddColorButton(object sender, EventArgs e) => _ribbonLines.OnDesignTimeAddColorButton();
+ private void OnAddRadioButton(object? sender, EventArgs e) => _ribbonLines.OnDesignTimeAddRadioButton();
- private void OnAddCheckBox(object sender, EventArgs e) => _ribbonLines.OnDesignTimeAddCheckBox();
+ private void OnAddCluster(object? sender, EventArgs e) => _ribbonLines.OnDesignTimeAddCluster();
- private void OnAddRadioButton(object sender, EventArgs e) => _ribbonLines.OnDesignTimeAddRadioButton();
+ private void OnAddLabel(object? sender, EventArgs e) => _ribbonLines.OnDesignTimeAddLabel();
- private void OnAddCluster(object sender, EventArgs e) => _ribbonLines.OnDesignTimeAddCluster();
+ private void OnAddCustomControl(object? sender, EventArgs e) => _ribbonLines.OnDesignTimeAddCustomControl();
- private void OnAddLabel(object sender, EventArgs e) => _ribbonLines.OnDesignTimeAddLabel();
+ private void OnAddTextBox(object? sender, EventArgs e) => _ribbonLines.OnDesignTimeAddTextBox();
- private void OnAddCustomControl(object sender, EventArgs e) => _ribbonLines.OnDesignTimeAddCustomControl();
+ private void OnAddMaskedTextBox(object? sender, EventArgs e) => _ribbonLines.OnDesignTimeAddMaskedTextBox();
- private void OnAddTextBox(object sender, EventArgs e) => _ribbonLines.OnDesignTimeAddTextBox();
+ private void OnAddRichTextBox(object? sender, EventArgs e) => _ribbonLines.OnDesignTimeAddRichTextBox();
- private void OnAddMaskedTextBox(object sender, EventArgs e) => _ribbonLines.OnDesignTimeAddMaskedTextBox();
+ private void OnAddComboBox(object? sender, EventArgs e) => _ribbonLines.OnDesignTimeAddComboBox();
- private void OnAddRichTextBox(object sender, EventArgs e) => _ribbonLines.OnDesignTimeAddRichTextBox();
+ private void OnAddNumericUpDown(object? sender, EventArgs e) => _ribbonLines.OnDesignTimeAddNumericUpDown();
- private void OnAddComboBox(object sender, EventArgs e) => _ribbonLines.OnDesignTimeAddComboBox();
+ private void OnAddDomainUpDown(object? sender, EventArgs e) => _ribbonLines.OnDesignTimeAddDomainUpDown();
- private void OnAddNumericUpDown(object sender, EventArgs e) => _ribbonLines.OnDesignTimeAddNumericUpDown();
+ private void OnAddDateTimePicker(object? sender, EventArgs e) => _ribbonLines.OnDesignTimeAddDateTimePicker();
- private void OnAddDomainUpDown(object sender, EventArgs e) => _ribbonLines.OnDesignTimeAddDomainUpDown();
+ private void OnAddTrackBar(object? sender, EventArgs e) => _ribbonLines.OnDesignTimeAddTrackBar();
- private void OnAddDateTimePicker(object sender, EventArgs e) => _ribbonLines.OnDesignTimeAddDateTimePicker();
+ private void OnAddThemeComboBox(object? sender, EventArgs e) => _ribbonLines.OnDesignTimeAddThemeComboBox();
- private void OnAddTrackBar(object sender, EventArgs e) => _ribbonLines.OnDesignTimeAddTrackBar();
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonDesignGroupTriple.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonDesignGroupTriple.cs
index 7d3a597f7..fbccd7e96 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonDesignGroupTriple.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonDesignGroupTriple.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -29,7 +29,7 @@ internal class ViewDrawRibbonDesignGroupTriple : ViewDrawRibbonDesignBase
private readonly Padding _preferredPaddingL; // = new(1, 3, 1, 3);
private readonly Padding _layoutPaddingL; // = new(1);
private readonly Padding _outerPaddingL; // = new(0, 2, 0, 2);
- private readonly Padding _paddingMS; // = new(0, 2, 0, 2);
+ private readonly Padding _paddingMs; // = new(0, 2, 0, 2);
#endregion
#region Identity
@@ -40,8 +40,7 @@ static ViewDrawRibbonDesignGroupTriple()
{
TransparentColor = Color.Magenta
};
- _imageList.Images.AddRange(new Image[]
- {
+ _imageList.Images.AddRange([
GenericImageResources.KryptonRibbonGroupButton,
GenericImageResources.KryptonRibbonGroupColorButton,
GenericImageResources.KryptonRibbonGroupCheckBox,
@@ -56,7 +55,7 @@ static ViewDrawRibbonDesignGroupTriple()
GenericImageResources.KryptonRibbonGroupDomainUpDown,
GenericImageResources.KryptonRibbonGroupDateTimePicker,
GenericImageResources.KryptonRibbonGroupTrackBar
- });
+ ]);
}
///
@@ -74,12 +73,12 @@ public ViewDrawRibbonDesignGroupTriple(KryptonRibbon ribbon,
{
Debug.Assert(ribbonTriple != null);
- _ribbonTriple = ribbonTriple;
+ _ribbonTriple = ribbonTriple!;
CurrentSize = currentSize;
_preferredPaddingL = new Padding((int)(1 * FactorDpiX), (int)(3 * FactorDpiY), (int)(1 * FactorDpiX), (int)(3 * FactorDpiY));
_layoutPaddingL = new Padding((int)(1 * FactorDpiX), (int)(1 * FactorDpiY), (int)(1 * FactorDpiX), (int)(1 * FactorDpiY));
_outerPaddingL = new Padding(0, (int)(2 * FactorDpiY), 0, (int)(2 * FactorDpiY));
- _paddingMS = new Padding(0, (int)(2 * FactorDpiY), 0, (int)(2 * FactorDpiY));
+ _paddingMs = new Padding(0, (int)(2 * FactorDpiY), 0, (int)(2 * FactorDpiY));
}
///
@@ -110,7 +109,7 @@ public override string ToString() =>
///
/// Gets the padding to use when calculating the preferred size.
///
- protected override Padding PreferredPadding => CurrentSize == GroupItemSize.Large ? _preferredPaddingL : _paddingMS;
+ protected override Padding PreferredPadding => CurrentSize == GroupItemSize.Large ? _preferredPaddingL : _paddingMs;
///
/// Gets the padding to use when laying out the view.
@@ -120,14 +119,14 @@ public override string ToString() =>
///
/// Gets the padding to shrink the client area by when laying out.
///
- protected override Padding OuterPadding => CurrentSize == GroupItemSize.Large ? _outerPaddingL : _paddingMS;
+ protected override Padding OuterPadding => CurrentSize == GroupItemSize.Large ? _outerPaddingL : _paddingMs;
///
/// Raises the Click event.
///
/// Source of the event.
/// An EventArgs containing the event data.
- protected override void OnClick(object sender, EventArgs e)
+ protected override void OnClick(object? sender, EventArgs e)
{
// Create the context strip the first time around
if (_cms == null)
@@ -187,35 +186,35 @@ protected override void OnClick(object sender, EventArgs e)
#endregion
#region Implementation
- private void OnAddButton(object sender, EventArgs e) => _ribbonTriple.OnDesignTimeAddButton();
+ private void OnAddButton(object? sender, EventArgs e) => _ribbonTriple.OnDesignTimeAddButton();
- private void OnAddColorButton(object sender, EventArgs e) => _ribbonTriple.OnDesignTimeAddColorButton();
+ private void OnAddColorButton(object? sender, EventArgs e) => _ribbonTriple.OnDesignTimeAddColorButton();
- private void OnAddCheckBox(object sender, EventArgs e) => _ribbonTriple.OnDesignTimeAddCheckBox();
+ private void OnAddCheckBox(object? sender, EventArgs e) => _ribbonTriple.OnDesignTimeAddCheckBox();
- private void OnAddRadioButton(object sender, EventArgs e) => _ribbonTriple.OnDesignTimeAddRadioButton();
+ private void OnAddRadioButton(object? sender, EventArgs e) => _ribbonTriple.OnDesignTimeAddRadioButton();
- private void OnAddLabel(object sender, EventArgs e) => _ribbonTriple.OnDesignTimeAddLabel();
+ private void OnAddLabel(object? sender, EventArgs e) => _ribbonTriple.OnDesignTimeAddLabel();
- private void OnAddCustomControl(object sender, EventArgs e) => _ribbonTriple.OnDesignTimeAddCustomControl();
+ private void OnAddCustomControl(object? sender, EventArgs e) => _ribbonTriple.OnDesignTimeAddCustomControl();
- private void OnAddTextBox(object sender, EventArgs e) => _ribbonTriple.OnDesignTimeAddTextBox();
+ private void OnAddTextBox(object? sender, EventArgs e) => _ribbonTriple.OnDesignTimeAddTextBox();
- private void OnAddMaskedTextBox(object sender, EventArgs e) => _ribbonTriple.OnDesignTimeAddMaskedTextBox();
+ private void OnAddMaskedTextBox(object? sender, EventArgs e) => _ribbonTriple.OnDesignTimeAddMaskedTextBox();
- private void OnAddRichTextBox(object sender, EventArgs e) => _ribbonTriple.OnDesignTimeAddRichTextBox();
+ private void OnAddRichTextBox(object? sender, EventArgs e) => _ribbonTriple.OnDesignTimeAddRichTextBox();
- private void OnAddComboBox(object sender, EventArgs e) => _ribbonTriple.OnDesignTimeAddComboBox();
+ private void OnAddComboBox(object? sender, EventArgs e) => _ribbonTriple.OnDesignTimeAddComboBox();
- private void OnAddNumericUpDown(object sender, EventArgs e) => _ribbonTriple.OnDesignTimeAddNumericUpDown();
+ private void OnAddNumericUpDown(object? sender, EventArgs e) => _ribbonTriple.OnDesignTimeAddNumericUpDown();
- private void OnAddDomainUpDown(object sender, EventArgs e) => _ribbonTriple.OnDesignTimeAddDomainUpDown();
+ private void OnAddDomainUpDown(object? sender, EventArgs e) => _ribbonTriple.OnDesignTimeAddDomainUpDown();
- private void OnAddDateTimePicker(object sender, EventArgs e) => _ribbonTriple.OnDesignTimeAddDateTimePicker();
+ private void OnAddDateTimePicker(object? sender, EventArgs e) => _ribbonTriple.OnDesignTimeAddDateTimePicker();
- private void OnAddTrackBar(object sender, EventArgs e) => _ribbonTriple.OnDesignTimeAddTrackBar();
+ private void OnAddTrackBar(object? sender, EventArgs e) => _ribbonTriple.OnDesignTimeAddTrackBar();
- private void OnAddThemeComboBox(object sender, EventArgs e) => _ribbonTriple.OnDesignTimeAddThemeComboBox();
+ private void OnAddThemeComboBox(object? sender, EventArgs e) => _ribbonTriple.OnDesignTimeAddThemeComboBox();
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonDesignTab.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonDesignTab.cs
index 9c00284b4..340f733f1 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonDesignTab.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonDesignTab.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -69,7 +69,7 @@ public override string ToString() =>
///
/// Source of the event.
/// An EventArgs containing the event data.
- protected override void OnClick(object sender, EventArgs e) =>
+ protected override void OnClick(object? sender, EventArgs e) =>
// Ask the ribbon to add a new tab at design time
Ribbon.OnDesignTimeAddTab();
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonDropArrow.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonDropArrow.cs
index abb1ff580..2913c2959 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonDropArrow.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonDropArrow.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -32,7 +32,7 @@ internal class ViewDrawRibbonDropArrow : ViewLeaf
public ViewDrawRibbonDropArrow([DisallowNull] KryptonRibbon ribbon)
{
Debug.Assert(ribbon != null);
- _ribbon = ribbon;
+ _ribbon = ribbon!;
_arrowSize = new Size((int)(5 * FactorDpiX), (int)(4 * FactorDpiY));
}
@@ -62,7 +62,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
Debug.Assert(context != null);
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
}
#endregion
@@ -71,13 +71,21 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
/// Perform rendering before child elements are rendered.
///
/// Rendering context.
- public override void RenderBefore(RenderContext context) =>
+ public override void RenderBefore([DisallowNull] RenderContext context)
+ {
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
+
// Use renderer to draw the drop arrow in the provided space
context.Renderer.RenderGlyph.DrawRibbonDropArrow(_ribbon.RibbonShape,
context,
ClientRectangle,
_ribbon.StateCommon.RibbonGeneral,
State);
+ }
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonAppTab.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonFileAppTab.cs
similarity index 71%
rename from Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonAppTab.cs
rename to Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonFileAppTab.cs
index cc0aaf212..e5447c79b 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonAppTab.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonFileAppTab.cs
@@ -1,30 +1,26 @@
#region BSD License
/*
- *
* Original BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE)
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
- *
- * Modified: Monday 12th April, 2021 @ 18:00 GMT
- *
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*/
#endregion
namespace Krypton.Ribbon
{
///
- /// Draws half of an application tab.
+ /// Draws the "File Application tab"
///
- internal class ViewDrawRibbonAppTab : ViewComposite,
+ internal class ViewDrawRibbonFileAppTab : ViewComposite,
IContentValues
{
#region Instance Fields
private readonly KryptonRibbon _ribbon;
private IDisposable?[] _mementos;
private readonly PaletteRibbonGeneral _paletteGeneral;
- private readonly ApplicationTabToContent _contentProvider;
+ private readonly FileApplicationTabToContent _contentProvider;
private readonly Padding _preferredBorder; // = new(17, 4, 17, 3);
#endregion
@@ -33,7 +29,7 @@ internal class ViewDrawRibbonAppTab : ViewComposite,
/// Initialize a new instance of the ViewDrawRibbonAppTab class.
///
/// Owning control instance.
- public ViewDrawRibbonAppTab([DisallowNull] KryptonRibbon ribbon)
+ public ViewDrawRibbonFileAppTab([DisallowNull] KryptonRibbon ribbon)
{
Debug.Assert(ribbon != null);
@@ -43,7 +39,7 @@ public ViewDrawRibbonAppTab([DisallowNull] KryptonRibbon ribbon)
// Use a class to convert from application tab to content interface
_paletteGeneral = _ribbon.StateCommon.RibbonGeneral;
- _contentProvider = new ApplicationTabToContent(_ribbon, _paletteGeneral);
+ _contentProvider = new FileApplicationTabToContent(_ribbon, _paletteGeneral);
// Create and add the draw content for display inside the tab
Add(new ViewDrawContent(_contentProvider, this, VisualOrientation.Top));
@@ -120,19 +116,46 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
/// Rendering context.
public override void RenderBefore([DisallowNull] RenderContext context)
{
- var memento = State switch
+ if (context.Renderer is null)
{
- PaletteState.Tracking => 1,
- PaletteState.Tracking | PaletteState.FocusOverride => 2,
- PaletteState.Pressed => 3,
- _ => 0
- };
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
+ IPaletteRibbonFileAppTab palette;
+ int memento;
+ var localState = State;
+ // Find the correct palette to use that matches the button state
+ switch (State)
+ {
+ default:
+ case PaletteState.Normal:
+ if (_ribbon.Enabled)
+ {
+ palette = _ribbon.StateNormal.RibbonFileAppTab;
+ memento = 0;
+ }
+ else
+ {
+ localState = PaletteState.Disabled;
+ palette = _ribbon.StateNormal.RibbonFileAppTab;
+ memento = 3;
+ }
+ break;
+ case PaletteState.Tracking:
+ palette = _ribbon.StateNormal.RibbonFileAppTab;
+ memento = 1;
+ break;
+ case PaletteState.Pressed:
+ palette = _ribbon.StateNormal.RibbonFileAppTab;
+ memento = 2;
+ break;
+ }
// Draw the background
- _mementos[memento] = context.Renderer.RenderRibbon.DrawRibbonApplicationTab(_ribbon.RibbonShape, context, ClientRectangle, State,
- _ribbon.RibbonAppButton.AppButtonBaseColorDark,
- _ribbon.RibbonAppButton.AppButtonBaseColorLight,
- _mementos[memento]!);
+ _mementos[memento] = context.Renderer.RenderRibbon.DrawRibbonFileApplicationTab(_ribbon.RibbonShape, context, ClientRectangle,
+ localState,
+ palette,
+ _mementos[memento]);
}
#endregion
@@ -156,8 +179,8 @@ public override void RenderBefore([DisallowNull] RenderContext context)
///
/// Title string.
public string GetShortText() => _ribbon.RibbonShape == PaletteRibbonShape.Office2013
- ? _ribbon.RibbonAppButton.AppButtonText.ToUpper()
- : _ribbon.RibbonAppButton.AppButtonText;
+ ? _ribbon.RibbonFileAppTab.FileAppTabText.ToUpper()
+ : _ribbon.RibbonFileAppTab.FileAppTabText;
///
/// Gets the long text used as the secondary ribbon title.
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGalleryButton.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGalleryButton.cs
index ac7c56ca2..43175457f 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGalleryButton.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGalleryButton.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -20,7 +20,7 @@ namespace Krypton.Ribbon
internal class ViewDrawRibbonGalleryButton : ViewLeaf, IContentValues
{
#region Instance Fields
- private readonly PaletteBase? _palette;
+ private readonly PaletteBase _palette;
private readonly GalleryImages _images;
private readonly GalleryButtonController _controller;
private readonly PaletteRibbonGalleryButton _button;
@@ -29,7 +29,7 @@ internal class ViewDrawRibbonGalleryButton : ViewLeaf, IContentValues
private readonly PaletteContentToPalette _paletteContent;
private readonly PaletteRelativeAlign _alignment;
private IDisposable? _mementoBack;
- private IDisposable _mementoContent;
+ private IDisposable? _mementoContent;
private readonly NeedPaintHandler _needPaint;
#endregion
@@ -49,7 +49,7 @@ internal class ViewDrawRibbonGalleryButton : ViewLeaf, IContentValues
/// Button content to display.
/// Button images.
/// Paint event delegate.
- public ViewDrawRibbonGalleryButton(PaletteBase? palette,
+ public ViewDrawRibbonGalleryButton(PaletteBase palette,
PaletteRelativeAlign alignment,
PaletteRibbonGalleryButton button,
GalleryImages images,
@@ -106,11 +106,18 @@ protected override void Dispose(bool disposing)
/// Discover the preferred size of the element.
///
/// Layout context.
- public override Size GetPreferredSize(ViewLayoutContext context) =>
+ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
+ {
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
// Grab the required size for the content images
- context.Renderer.RenderStandardContent.GetContentPreferredSize(context, _paletteContent,
+ return context.Renderer.RenderStandardContent.GetContentPreferredSize(context, _paletteContent,
this, VisualOrientation.Top,
- State, false, false);
+ State);
+ }
///
/// Perform a layout of the elements.
@@ -118,13 +125,24 @@ public override Size GetPreferredSize(ViewLayoutContext context) =>
/// Layout context.
public override void Layout([DisallowNull] ViewLayoutContext context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
+
+ if (context is null)
+ {
+ throw new ArgumentNullException(nameof(context));
+ }
+
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// Dispose of any current memento
- if (_mementoContent != null)
+ if (_mementoContent is not null)
{
_mementoContent.Dispose();
_mementoContent = null;
@@ -134,7 +152,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
_mementoContent = context.Renderer.RenderStandardContent.LayoutContent(context, ClientRectangle,
_paletteContent, this,
VisualOrientation.Top,
- State, false, false);
+ State);
}
#endregion
@@ -143,8 +161,13 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
/// Perform rendering before child elements are rendered.
///
/// Rendering context.
- public override void RenderBefore(RenderContext context)
+ public override void RenderBefore([DisallowNull] RenderContext context)
{
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
// Reduce background to fit inside the border
Rectangle backRect = ClientRectangle;
backRect.Inflate(-1, -1);
@@ -172,8 +195,8 @@ public override void RenderBefore(RenderContext context)
if (_paletteContent.GetContentDraw(State) == InheritBool.True)
{
context.Renderer.RenderStandardContent.DrawContent(context, ClientRectangle, _paletteContent,
- _mementoContent, VisualOrientation.Top,
- State, false, false, false);
+ _mementoContent!, VisualOrientation.Top,
+ State, false);
}
// Are we allowed to draw border?
@@ -302,7 +325,7 @@ private GraphicsPath CreateBorderPath(Rectangle rect)
#endregion
#region Private
- private void OnButtonClick(object sender, MouseEventArgs e) => Click?.Invoke(this, e);
+ private void OnButtonClick(object? sender, MouseEventArgs e) => Click?.Invoke(this, e);
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGalleryItem.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGalleryItem.cs
index 73de4c304..1c2a4239f 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGalleryItem.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGalleryItem.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -23,8 +23,8 @@ internal class ViewDrawRibbonGalleryItem : ViewDrawButton,
#region Instance Fields
private readonly KryptonGallery _gallery;
private readonly GalleryItemController _controller;
- private ImageList _imageList;
- private Image _image;
+ private ImageList? _imageList;
+ private Image? _image;
private int _imageIndex;
#endregion
@@ -119,7 +119,7 @@ public ImageList? ImageList
{
if (_imageList != value)
{
- if (_image != null)
+ if (_image is not null)
{
_image.Dispose();
_image = null;
@@ -158,9 +158,14 @@ public int ImageIndex
/// Perform a render of the elements.
///
/// Rendering context.
- public override void Render([DisallowNull] RenderContext context)
+ public override void Render([DisallowNull] RenderContext? context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
+
+ if ( context is null)
+ {
+ throw new ArgumentNullException(nameof(context));
+ }
// If this item is being tracked, then show as tracking
PaletteState tempState = ElementState;
@@ -220,7 +225,7 @@ public override void Render([DisallowNull] RenderContext context)
#endregion
#region Private
- private void OnItemClick(object sender, MouseEventArgs e) => _gallery.SelectedIndex = _imageIndex;
+ private void OnItemClick(object? sender, MouseEventArgs e) => _gallery.SelectedIndex = _imageIndex;
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroup.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroup.cs
index 73e96c499..159be39d4 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroup.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroup.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -21,22 +21,22 @@ internal class ViewDrawRibbonGroup : ViewComposite,
IRibbonViewGroupSize
{
#region Instance Fields
- private readonly int MINIMUM_GROUP_WIDTH; // = 32;
- private readonly int NORMAL_BORDER_TOPLEFT2007; // = 2;
- private readonly int NORMAL_BORDER_RIGHT2007; // = 4;
- private readonly int NORMAL_BORDER_TOP2010; // = 3;
- private readonly int NORMAL_BORDER_LEFT2010; // = 3;
- private readonly int NORMAL_BORDER_RIGHT2010; // = 6;
- private readonly int TOTAL_LEFT_RIGHT_BORDERS_2007; // = 7;
- private readonly int TOTAL_LEFT_RIGHT_BORDERS_2010; // = 10;
- private readonly int VERT_OFFSET_2007; // = 0;
- private readonly int VERT_OFFSET_2010; // = 2;
- private readonly Padding COLLAPSED_PADDING; // = new(2);
- private readonly Padding COLLAPSED_IMAGE_PADDING_2007; // = new(3, 3, 3, 4);
- private readonly Padding COLLAPSED_IMAGE_PADDING_2010; // = new(3, 1, 5, 5);
+ private readonly int _minimumGroupWidth; // = 32;
+ private readonly int _normalBorderTopleft2007; // = 2;
+ private readonly int _normalBorderRight2007; // = 4;
+ private readonly int _normalBorderTop2010; // = 3;
+ private readonly int _normalBorderLeft2010; // = 3;
+ private readonly int _normalBorderRight2010; // = 6;
+ private readonly int _totalLeftRightBorders2007; // = 7;
+ private readonly int _totalLeftRightBorders2010; // = 10;
+ private readonly int _vertOffset2007; // = 0;
+ private readonly int _vertOffset2010; // = 2;
+ private readonly Padding _collapsedPadding; // = new(2);
+ private readonly Padding _collapsedImagePadding2007; // = new(3, 3, 3, 4);
+ private readonly Padding _collapsedImagePadding2010; // = new(3, 1, 5, 5);
private readonly KryptonRibbon _ribbon;
private readonly KryptonRibbonGroup _ribbonGroup;
- private VisualPopupGroup _popupGroup;
+ private VisualPopupGroup? _popupGroup;
private ViewLayoutDocker _layoutCollapsedMain;
private ViewDrawRibbonGroupText _viewCollapsedText1;
private ViewDrawRibbonGroupText _viewCollapsedText2;
@@ -54,9 +54,9 @@ internal class ViewDrawRibbonGroup : ViewComposite,
private PaletteRibbonContextBack _paletteContextBorder;
private PaletteRibbonShape _lastRibbonShape;
private readonly NeedPaintHandler _needPaint;
- private IDisposable _mementoRibbonBackArea;
- private IDisposable _mementoRibbonBackBorder;
- private IDisposable _mementoRibbonBack2;
+ private IDisposable? _mementoRibbonBackArea;
+ private IDisposable? _mementoRibbonBackBorder;
+ private IDisposable? _mementoRibbonBack2;
private IDisposable? _mementoStandardBack;
private Control _container;
private bool _collapsed;
@@ -74,14 +74,14 @@ public ViewDrawRibbonGroup([DisallowNull] KryptonRibbon ribbon,
[DisallowNull] KryptonRibbonGroup ribbonGroup,
[DisallowNull] NeedPaintHandler needPaint)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(ribbonGroup != null);
- Debug.Assert(needPaint != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(ribbonGroup is not null);
+ Debug.Assert(needPaint is not null);
// Cache source of state specific settings
- _ribbon = ribbon;
- _ribbonGroup = ribbonGroup;
- _needPaint = needPaint;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _ribbonGroup = ribbonGroup ?? throw new ArgumentNullException(nameof(ribbonGroup));
+ _needPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
// Associate this view with the source component (required for design time selection)
Component = _ribbonGroup;
@@ -97,19 +97,19 @@ public ViewDrawRibbonGroup([DisallowNull] KryptonRibbon ribbon,
// Hook into changes in the ribbon button definition
_ribbonGroup.PropertyChanged += OnGroupPropertyChanged;
- MINIMUM_GROUP_WIDTH = (int)(32 * FactorDpiX);
- NORMAL_BORDER_TOPLEFT2007 = (int)(2 * FactorDpiY);
- NORMAL_BORDER_RIGHT2007 = (int)(4 * FactorDpiX);
- NORMAL_BORDER_TOP2010 = (int)(3 * FactorDpiY);
- NORMAL_BORDER_LEFT2010 = (int)(3 * FactorDpiX);
- NORMAL_BORDER_RIGHT2010 = (int)(6 * FactorDpiX);
- TOTAL_LEFT_RIGHT_BORDERS_2007 = (int)(7 * FactorDpiX);
- TOTAL_LEFT_RIGHT_BORDERS_2010 = (int)(10 * FactorDpiX);
- VERT_OFFSET_2007 = (int)(0 * FactorDpiY);
- VERT_OFFSET_2010 = (int)(2 * FactorDpiY);
- COLLAPSED_PADDING = new Padding((int)(2 * FactorDpiX), (int)(2 * FactorDpiY), (int)(2 * FactorDpiX), (int)(2 * FactorDpiY));
- COLLAPSED_IMAGE_PADDING_2007 = new Padding((int)(3 * FactorDpiX), (int)(3 * FactorDpiY), (int)(3 * FactorDpiX), (int)(4 * FactorDpiY));
- COLLAPSED_IMAGE_PADDING_2010 = new Padding((int)(3 * FactorDpiX), (int)(1 * FactorDpiY), (int)(5 * FactorDpiX), (int)(5 * FactorDpiY));
+ _minimumGroupWidth = (int)(32 * FactorDpiX);
+ _normalBorderTopleft2007 = (int)(2 * FactorDpiY);
+ _normalBorderRight2007 = (int)(4 * FactorDpiX);
+ _normalBorderTop2010 = (int)(3 * FactorDpiY);
+ _normalBorderLeft2010 = (int)(3 * FactorDpiX);
+ _normalBorderRight2010 = (int)(6 * FactorDpiX);
+ _totalLeftRightBorders2007 = (int)(7 * FactorDpiX);
+ _totalLeftRightBorders2010 = (int)(10 * FactorDpiX);
+ _vertOffset2007 = (int)(0 * FactorDpiY);
+ _vertOffset2010 = (int)(2 * FactorDpiY);
+ _collapsedPadding = new Padding((int)(2 * FactorDpiX), (int)(2 * FactorDpiY), (int)(2 * FactorDpiX), (int)(2 * FactorDpiY));
+ _collapsedImagePadding2007 = new Padding((int)(3 * FactorDpiX), (int)(3 * FactorDpiY), (int)(3 * FactorDpiX), (int)(4 * FactorDpiY));
+ _collapsedImagePadding2010 = new Padding((int)(3 * FactorDpiX), (int)(1 * FactorDpiY), (int)(5 * FactorDpiX), (int)(5 * FactorDpiY));
}
///
@@ -221,9 +221,9 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList)
/// Gets the first focus item from the group.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetFirstFocusItem()
+ public ViewBase GetFirstFocusItem()
{
- ViewBase? view = Collapsed ? _layoutCollapsedMain : _layoutNormalContent.GetFirstFocusItem();
+ ViewBase view = Collapsed ? _layoutCollapsedMain : _layoutNormalContent.GetFirstFocusItem();
return view;
}
@@ -234,9 +234,9 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList)
/// Gets the last focus item from the group.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetLastFocusItem()
+ public ViewBase GetLastFocusItem()
{
- ViewBase? view = Collapsed ? _layoutCollapsedMain : _layoutNormalContent.GetLastFocusItem();
+ ViewBase view = Collapsed ? _layoutCollapsedMain : _layoutNormalContent.GetLastFocusItem();
return view;
}
@@ -249,10 +249,15 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetNextFocusItem(ViewBase current, ref bool matched)
+ public ViewBase? GetNextFocusItem(ViewBase? current, ref bool matched)
{
ViewBase? view = null;
+ if (current is null)
+ {
+ throw new ArgumentNullException(nameof(current));
+ }
+
if (Collapsed)
{
if (matched)
@@ -284,6 +289,11 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList)
{
ViewBase? view = null;
+ if (current is null)
+ {
+ throw new ArgumentNullException(nameof(current));
+ }
+
if (Collapsed)
{
if (matched)
@@ -442,7 +452,7 @@ public GroupSizeWidth[] GetPossibleSizes(ViewLayoutContext context)
if (_ribbonGroup.AllowCollapsed && !_ribbon.InDesignHelperMode)
{
// We never allow a collapsed state if that is bigger than the smallest valid permutation
- if (smallestWidth > MINIMUM_GROUP_WIDTH)
+ if (smallestWidth > _minimumGroupWidth)
{
// Find the size of the group when collapsed
var collapsed = Collapsed;
@@ -465,7 +475,7 @@ public GroupSizeWidth[] GetPossibleSizes(ViewLayoutContext context)
/// Update the group with the provided sizing solution.
///
/// Solution size.
- public void SetSolutionSize(ItemSizeWidth[] size)
+ public void SetSolutionSize(ItemSizeWidth[]? size)
{
// Should we become collapsed?
Collapsed = size == null;
@@ -482,7 +492,7 @@ public void SetSolutionSize(ItemSizeWidth[] size)
public override Size GetPreferredSize(ViewLayoutContext context)
{
Size preferredSize = base.GetPreferredSize(context);
- preferredSize.Width = Math.Max(preferredSize.Width, MINIMUM_GROUP_WIDTH);
+ preferredSize.Width = Math.Max(preferredSize.Width, _minimumGroupWidth);
preferredSize.Height = _ribbon.CalculatedValues.GroupHeight;
return preferredSize;
}
@@ -493,10 +503,10 @@ public override Size GetPreferredSize(ViewLayoutContext context)
/// Layout context.
public override void Layout([DisallowNull] ViewLayoutContext context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// Update the title element with the height of the group title area
_viewNormalTitle.Height = _ribbon.CalculatedValues.GroupTitleHeight;
@@ -520,7 +530,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
public override void RenderBefore(RenderContext context)
{
// Cache the control that we are showing inside
- _container = context.Control;
+ _container = context.Control!;
if (Collapsed)
{
@@ -577,21 +587,21 @@ private void UpdateShapeValues()
{
default:
case PaletteRibbonShape.Office2007:
- _totalBorders = TOTAL_LEFT_RIGHT_BORDERS_2007;
- _layoutNormalMain.VertOffset = VERT_OFFSET_2007;
- _layoutNormalSepTop.SeparatorSize = new Size(NORMAL_BORDER_TOPLEFT2007, NORMAL_BORDER_TOPLEFT2007);
- _layoutNormalSepLeft.SeparatorSize = new Size(NORMAL_BORDER_TOPLEFT2007, NORMAL_BORDER_TOPLEFT2007);
- _layoutNormalSepRight.SeparatorSize = new Size(NORMAL_BORDER_RIGHT2007, NORMAL_BORDER_RIGHT2007);
- _layoutCollapsedImagePadding.PreferredPadding = COLLAPSED_IMAGE_PADDING_2007;
+ _totalBorders = _totalLeftRightBorders2007;
+ _layoutNormalMain.VertOffset = _vertOffset2007;
+ _layoutNormalSepTop.SeparatorSize = new Size(_normalBorderTopleft2007, _normalBorderTopleft2007);
+ _layoutNormalSepLeft.SeparatorSize = new Size(_normalBorderTopleft2007, _normalBorderTopleft2007);
+ _layoutNormalSepRight.SeparatorSize = new Size(_normalBorderRight2007, _normalBorderRight2007);
+ _layoutCollapsedImagePadding.PreferredPadding = _collapsedImagePadding2007;
_lastRibbonShape = PaletteRibbonShape.Office2007;
break;
case PaletteRibbonShape.Office2010:
- _totalBorders = TOTAL_LEFT_RIGHT_BORDERS_2010;
- _layoutNormalMain.VertOffset = VERT_OFFSET_2010;
- _layoutNormalSepTop.SeparatorSize = new Size(NORMAL_BORDER_TOP2010, NORMAL_BORDER_TOP2010);
- _layoutNormalSepLeft.SeparatorSize = new Size(NORMAL_BORDER_LEFT2010, NORMAL_BORDER_LEFT2010);
- _layoutNormalSepRight.SeparatorSize = new Size(NORMAL_BORDER_RIGHT2010, NORMAL_BORDER_RIGHT2010);
- _layoutCollapsedImagePadding.PreferredPadding = COLLAPSED_IMAGE_PADDING_2010;
+ _totalBorders = _totalLeftRightBorders2010;
+ _layoutNormalMain.VertOffset = _vertOffset2010;
+ _layoutNormalSepTop.SeparatorSize = new Size(_normalBorderTop2010, _normalBorderTop2010);
+ _layoutNormalSepLeft.SeparatorSize = new Size(_normalBorderLeft2010, _normalBorderLeft2010);
+ _layoutNormalSepRight.SeparatorSize = new Size(_normalBorderRight2010, _normalBorderRight2010);
+ _layoutCollapsedImagePadding.PreferredPadding = _collapsedImagePadding2010;
_lastRibbonShape = PaletteRibbonShape.Office2010;
break;
}
@@ -615,9 +625,9 @@ private void CreateNormalView()
// Create layout elements
_layoutNormalTitle = new ViewLayoutDocker();
_layoutNormalContent = new ViewLayoutRibbonGroupContent(_ribbon, _ribbonGroup, _needPaint);
- _layoutNormalSepTop = new ViewLayoutRibbonSeparator(NORMAL_BORDER_TOPLEFT2007, true);
- _layoutNormalSepLeft = new ViewLayoutRibbonSeparator(NORMAL_BORDER_TOPLEFT2007, true);
- _layoutNormalSepRight = new ViewLayoutRibbonSeparator(NORMAL_BORDER_RIGHT2007, true);
+ _layoutNormalSepTop = new ViewLayoutRibbonSeparator(_normalBorderTopleft2007, true);
+ _layoutNormalSepLeft = new ViewLayoutRibbonSeparator(_normalBorderTopleft2007, true);
+ _layoutNormalSepRight = new ViewLayoutRibbonSeparator(_normalBorderRight2007, true);
// Add layout elements to correct areas of the normal group
_layoutNormalMain.Add(_layoutNormalTitle, ViewDockStyle.Bottom);
@@ -641,7 +651,7 @@ private void CreateNormalView()
// All values are equal to a default of Office 2007 shape
_lastRibbonShape = PaletteRibbonShape.Office2007;
- _totalBorders = TOTAL_LEFT_RIGHT_BORDERS_2007;
+ _totalBorders = _totalLeftRightBorders2007;
}
private void CreateCollapsedView()
@@ -657,7 +667,7 @@ private void CreateCollapsedView()
_layoutCollapsedMain.KeyController = _collapsedController;
// Reduce layout area to remove the group border
- var layoutCollapsedInsidePadding = new ViewLayoutRibbonPadding(COLLAPSED_PADDING);
+ var layoutCollapsedInsidePadding = new ViewLayoutRibbonPadding(_collapsedPadding);
_layoutCollapsedMain.Add(layoutCollapsedInsidePadding, ViewDockStyle.Fill);
// Position at top an area that is padded for containing the image
@@ -678,7 +688,7 @@ private void CreateCollapsedView()
layoutCollapsedInside.Add(_viewCollapsedText1, ViewDockStyle.Top);
// Add group image frame
- _layoutCollapsedImagePadding = new ViewLayoutRibbonCenterPadding(COLLAPSED_IMAGE_PADDING_2007);
+ _layoutCollapsedImagePadding = new ViewLayoutRibbonCenterPadding(_collapsedImagePadding2007);
layoutCollapsedInside.Add(_layoutCollapsedImagePadding, ViewDockStyle.Top);
// Finally we add the actual drawing element for the collapsed group image
@@ -686,8 +696,13 @@ private void CreateCollapsedView()
_layoutCollapsedImagePadding.Add(drawCollapsedImage);
}
- private void RenderNormalBefore(RenderContext context)
+ private void RenderNormalBefore([DisallowNull] RenderContext context)
{
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
Rectangle drawRect = ClientRectangle;
IPaletteRibbonBack paletteBackArea;
@@ -743,13 +758,13 @@ private void RenderNormalBefore(RenderContext context)
{
_paletteContextBackArea.SetInherit(paletteBackArea);
_mementoRibbonBackArea = context.Renderer.RenderRibbon.DrawRibbonBack(_ribbon.RibbonShape, context,
- drawRect, elementState, _paletteContextBackArea, VisualOrientation.Top, false,
+ drawRect, elementState, _paletteContextBackArea, VisualOrientation.Top,
_mementoRibbonBackArea);
}
// Draw the group border
_paletteContextBorder.SetInherit(paletteBorder);
- _mementoRibbonBackBorder = context.Renderer.RenderRibbon.DrawRibbonBack(_ribbon.RibbonShape, context, drawRect, elementState, _paletteContextBorder, VisualOrientation.Top, false, _mementoRibbonBackBorder);
+ _mementoRibbonBackBorder = context.Renderer.RenderRibbon.DrawRibbonBack(_ribbon.RibbonShape, context, drawRect, elementState, _paletteContextBorder, VisualOrientation.Top, _mementoRibbonBackBorder);
// Reduce the drawing rectangle to just the title area
Rectangle titleRect = drawRect;
@@ -767,17 +782,22 @@ private void RenderNormalBefore(RenderContext context)
}
// Draw the group title
- _mementoRibbonBack2 = context.Renderer.RenderRibbon.DrawRibbonBack(_ribbon.RibbonShape, context, titleRect, State, paletteTitle, VisualOrientation.Top, false, _mementoRibbonBack2);
+ _mementoRibbonBack2 = context.Renderer.RenderRibbon.DrawRibbonBack(_ribbon.RibbonShape, context, titleRect, State, paletteTitle, VisualOrientation.Top, _mementoRibbonBack2);
}
- private void RenderCollapsedBefore(RenderContext context)
+ private void RenderCollapsedBefore([DisallowNull] RenderContext context)
{
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
Rectangle drawRect = ClientRectangle;
IPaletteRibbonBack paletteBack;
IPaletteRibbonBack paletteBorder;
- if (_collapsedController.HasFocus)
+ if (_collapsedController!.HasFocus)
{
ElementState = PaletteState.Tracking;
}
@@ -818,44 +838,50 @@ private void RenderCollapsedBefore(RenderContext context)
// Draw the group border
_paletteContextBorder.SetInherit(paletteBorder);
- _mementoRibbonBackBorder = context.Renderer.RenderRibbon.DrawRibbonBack(_ribbon.RibbonShape, context, drawRect, State, _paletteContextBorder, VisualOrientation.Top, false, _mementoRibbonBackBorder);
+ _mementoRibbonBackBorder = context.Renderer.RenderRibbon.DrawRibbonBack(_ribbon.RibbonShape, context, drawRect, State, _paletteContextBorder, VisualOrientation.Top, _mementoRibbonBackBorder);
//_mementoRibbonBackArea = context.Renderer.RenderRibbon.DrawRibbonBack(_ribbon.RibbonShape, context, drawRect, State, _paletteContextBorder, VisualOrientation.Top, false, _mementoRibbonBackArea);
Rectangle backRect = drawRect;
backRect.Inflate(-2, -2);
// Draw the inside background
- _mementoRibbonBack2 = context.Renderer.RenderRibbon.DrawRibbonBack(_ribbon.RibbonShape, context, backRect, State, paletteBack, VisualOrientation.Top, false, _mementoRibbonBack2);
+ _mementoRibbonBack2 = context.Renderer.RenderRibbon.DrawRibbonBack(_ribbon.RibbonShape, context, backRect, State, paletteBack, VisualOrientation.Top, _mementoRibbonBack2);
}
- private void RenderCollapsedPressedBefore(RenderContext context)
+ private void RenderCollapsedPressedBefore([DisallowNull] RenderContext context)
{
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
switch (_lastRibbonShape)
{
default:
case PaletteRibbonShape.Office2007:
{
- IPaletteBack paletteBack = _ribbon.StateCommon.RibbonGroupCollapsedButton.PaletteBack;
- IPaletteBorder paletteBorder = _ribbon.StateCommon.RibbonGroupCollapsedButton.PaletteBorder;
+ IPaletteBack? paletteBack = _ribbon.StateCommon.RibbonGroupCollapsedButton.PaletteBack;
+ IPaletteBorder? paletteBorder = _ribbon.StateCommon.RibbonGroupCollapsedButton.PaletteBorder;
// Do we need to draw the background?
if (paletteBack.GetBackDraw(PaletteState.Pressed) == InheritBool.True)
{
// Get the border path which the background is clipped to drawing within
- using GraphicsPath borderPath = context.Renderer.RenderStandardBorder.GetBackPath(context, ClientRectangle, paletteBorder, VisualOrientation.Top, PaletteState.Pressed);
- Padding borderPadding = context.Renderer.RenderStandardBorder.GetBorderRawPadding(paletteBorder, PaletteState.Pressed, VisualOrientation.Top);
+ using GraphicsPath borderPath = context.Renderer.RenderStandardBorder.GetBackPath(context, ClientRectangle, paletteBorder!, VisualOrientation.Top, PaletteState.Pressed);
+ Padding borderPadding = context.Renderer.RenderStandardBorder.GetBorderRawPadding(paletteBorder!, PaletteState.Pressed, VisualOrientation.Top);
// Apply the padding depending on the orientation
Rectangle enclosingRect = CommonHelper.ApplyPadding(VisualOrientation.Top, ClientRectangle, borderPadding);
// Render the background inside the border path
+ using var gh = new GraphicsHint(context.Graphics, paletteBorder!.GetBorderGraphicsHint(PaletteState.Normal));
_mementoStandardBack = context.Renderer.RenderStandardBack.DrawBack(context, enclosingRect, borderPath,
paletteBack, VisualOrientation.Top,
PaletteState.Pressed, _mementoStandardBack);
}
// Do we need to draw the border?
- if (paletteBorder.GetBorderDraw(PaletteState.Pressed) == InheritBool.True)
+ if (paletteBorder!.GetBorderDraw(PaletteState.Pressed) == InheritBool.True)
{
context.Renderer.RenderStandardBorder.DrawBorder(context, ClientRectangle, paletteBorder,
VisualOrientation.Top, PaletteState.Pressed);
@@ -879,13 +905,13 @@ private void RenderCollapsedPressedBefore(RenderContext context)
// Draw the group border
_paletteContextBorder.SetInherit(paletteBorder);
- _mementoRibbonBackBorder = context.Renderer.RenderRibbon.DrawRibbonBack(_ribbon.RibbonShape, context, drawRect, state, _paletteContextBorder, VisualOrientation.Top, false, _mementoRibbonBackBorder);
+ _mementoRibbonBackBorder = context.Renderer.RenderRibbon.DrawRibbonBack(_ribbon.RibbonShape, context, drawRect, state, _paletteContextBorder, VisualOrientation.Top, _mementoRibbonBackBorder);
Rectangle backRect = drawRect;
backRect.Inflate(-2, -2);
// Draw the inside background
- _mementoRibbonBack2 = context.Renderer.RenderRibbon.DrawRibbonBack(_ribbon.RibbonShape, context, backRect, state, paletteBack, VisualOrientation.Top, false, _mementoRibbonBack2);
+ _mementoRibbonBack2 = context.Renderer.RenderRibbon.DrawRibbonBack(_ribbon.RibbonShape, context, backRect, state, paletteBack, VisualOrientation.Top, _mementoRibbonBack2);
}
break;
}
@@ -918,7 +944,7 @@ private void DisposeMementos()
}
}
- private void OnCollapsedClick(object sender, MouseEventArgs e)
+ private void OnCollapsedClick(object? sender, MouseEventArgs e)
{
// We do not operate the collapsed button at design time
if (!_ribbon.InDesignMode)
@@ -938,7 +964,7 @@ private void OnCollapsedClick(object sender, MouseEventArgs e)
}
}
- private void OnVisualPopupGroupDisposed(object sender, EventArgs e)
+ private void OnVisualPopupGroupDisposed(object? sender, EventArgs e)
{
// Not pressed any more
_popupGroup = null;
@@ -947,7 +973,7 @@ private void OnVisualPopupGroupDisposed(object sender, EventArgs e)
_container.Refresh();
}
- private void OnGroupPropertyChanged(object sender, PropertyChangedEventArgs e)
+ private void OnGroupPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
var updateLayout = false;
var updatePaint = false;
@@ -1003,7 +1029,7 @@ private void OnGroupPropertyChanged(object sender, PropertyChangedEventArgs e)
}
}
- private void OnContextClick(object sender, MouseEventArgs e) => _ribbonGroup.OnDesignTimeContextMenu(new MouseEventArgs(MouseButtons.Right, 1, e.X, e.Y, 0));
+ private void OnContextClick(object? sender, MouseEventArgs e) => _ribbonGroup.OnDesignTimeContextMenu(new MouseEventArgs(MouseButtons.Right, 1, e.X, e.Y, 0));
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupButton.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupButton.cs
index 2ba80ea71..d7aae87d7 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupButton.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupButton.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -51,18 +51,18 @@ internal class ViewDrawRibbonGroupButton : ViewComposite,
/// Reference to owning ribbon control.
/// Reference to source button definition.
/// Delegate for notifying paint requests.
- public ViewDrawRibbonGroupButton([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupButton ribbonButton,
- [DisallowNull] NeedPaintHandler needPaint)
+ public ViewDrawRibbonGroupButton([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupButton? ribbonButton,
+ [DisallowNull] NeedPaintHandler? needPaint)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(ribbonButton != null);
- Debug.Assert(needPaint != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(ribbonButton is not null);
+ Debug.Assert(needPaint is not null);
// Remember incoming references
- _ribbon = ribbon;
- GroupButton = ribbonButton;
- _needPaint = needPaint;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ GroupButton = ribbonButton ?? throw new ArgumentNullException(nameof(ribbonButton));
+ _needPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
_currentSize = GroupButton.ItemSizeCurrent;
_largeImagePadding = new Padding((int)(3 * FactorDpiX), (int)(2 * FactorDpiY), (int)(3 * FactorDpiX), (int)(3 * FactorDpiY));
@@ -121,7 +121,7 @@ protected override void Dispose(bool disposing)
///
/// Gets access to the connected button definition.
///
- public KryptonRibbonGroupButton GroupButton { get; private set; }
+ public KryptonRibbonGroupButton? GroupButton { get; private set; }
#endregion
@@ -130,7 +130,7 @@ protected override void Dispose(bool disposing)
/// Gets the first focus item from the item.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetFirstFocusItem()
+ public ViewBase GetFirstFocusItem()
{
// Only take focus if we are visible and enabled
if (GroupButton is { Visible: true, Enabled: true })
@@ -139,7 +139,7 @@ protected override void Dispose(bool disposing)
}
else
{
- return null;
+ return null!;
}
}
#endregion
@@ -149,7 +149,7 @@ protected override void Dispose(bool disposing)
/// Gets the last focus item from the item.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetLastFocusItem()
+ public ViewBase GetLastFocusItem()
{
// Only take focus if we are visible and enabled
if (GroupButton is { Visible: true, Enabled: true })
@@ -158,7 +158,7 @@ protected override void Dispose(bool disposing)
}
else
{
- return null;
+ return null!;
}
}
#endregion
@@ -170,11 +170,11 @@ protected override void Dispose(bool disposing)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetNextFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetNextFocusItem(ViewBase current, ref bool matched)
{
// Do we match the current item?
matched = (current == _viewLarge) || (current == _viewMediumSmall);
- return null;
+ return null!;
}
#endregion
@@ -185,11 +185,11 @@ protected override void Dispose(bool disposing)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetPreviousFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetPreviousFocusItem(ViewBase current, ref bool matched)
{
// Do we match the current item?
matched = (current == _viewLarge) || (current == _viewMediumSmall);
- return null;
+ return null!;
}
#endregion
@@ -205,7 +205,7 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
if (Visible)
{
// Get the screen location of the button
- Rectangle viewRect = _ribbon.KeyTipToScreen(this[0]);
+ Rectangle viewRect = _ribbon!.KeyTipToScreen(this[0]);
var screenPt = Point.Empty;
GroupButtonController? controller = null;
@@ -224,8 +224,8 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
break;
}
- keyTipList.Add(new KeyTipInfo(GroupButton.Enabled, GroupButton.KeyTip,
- screenPt, this[0].ClientRectangle, controller));
+ keyTipList.Add(new KeyTipInfo(GroupButton!.Enabled, GroupButton.KeyTip,
+ screenPt, this[0]!.ClientRectangle, controller));
}
}
#endregion
@@ -248,10 +248,10 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
/// Layout context.
public override Size GetPreferredSize(ViewLayoutContext context)
{
- var drawNonTrackingAreas = _ribbon.RibbonShape is not PaletteRibbonShape.Office2010 or PaletteRibbonShape.Office2013 or PaletteRibbonShape.Microsoft365 or PaletteRibbonShape.VisualStudio;
+ var drawNonTrackingAreas = _ribbon!.RibbonShape is not PaletteRibbonShape.Office2010 or PaletteRibbonShape.Office2013 or PaletteRibbonShape.Microsoft365 or PaletteRibbonShape.VisualStudio;
// Update the views with the type of button being used
- _viewLarge.ButtonType = GroupButton.ButtonType;
+ _viewLarge.ButtonType = GroupButton!.ButtonType;
_viewLarge.DrawNonTrackingAreas = drawNonTrackingAreas;
_viewMediumSmall.ButtonType = GroupButton.ButtonType;
_viewMediumSmall.DrawNonTrackingAreas = drawNonTrackingAreas;
@@ -270,9 +270,9 @@ public override Size GetPreferredSize(ViewLayoutContext context)
/// Perform a layout of the elements.
///
/// Layout context.
- public override void Layout([DisallowNull] ViewLayoutContext context)
+ public override void Layout([DisallowNull] ViewLayoutContext? context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
// Update our enabled and checked state
UpdateEnabledState();
@@ -280,13 +280,13 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
UpdateDropDownState();
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// Let child elements layout in given space
base.Layout(context);
// For split buttons we need to calculate the split button areas
- if (GroupButton.ButtonType == GroupButtonType.Split)
+ if (GroupButton!.ButtonType == GroupButtonType.Split)
{
// Find the start positions of the split areas for both views
var largeSplitTop = _viewLargeImage.ClientRectangle.Bottom + 1;
@@ -318,13 +318,13 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
/// Rectangle to invalidate.
protected virtual void OnNeedPaint(bool needLayout, Rectangle invalidRect)
{
- if (_needPaint != null)
+ if (_needPaint is not null)
{
_needPaint(this, new NeedLayoutEventArgs(needLayout, invalidRect));
if (needLayout)
{
- _ribbon.PerformLayout();
+ _ribbon!.PerformLayout();
}
}
}
@@ -334,9 +334,9 @@ protected virtual void OnNeedPaint(bool needLayout, Rectangle invalidRect)
private void CreateLargeButtonView()
{
// Create the background and border view
- _viewLarge = new ViewDrawRibbonGroupButtonBackBorder(_ribbon, GroupButton,
- _ribbon.StateCommon.RibbonGroupButton.PaletteBack,
- _ribbon.StateCommon.RibbonGroupButton.PaletteBorder,
+ _viewLarge = new ViewDrawRibbonGroupButtonBackBorder(_ribbon!, GroupButton!,
+ _ribbon!.StateCommon.RibbonGroupButton.PaletteBack,
+ _ribbon.StateCommon.RibbonGroupButton.PaletteBorder!,
false, _needPaint)
{
SplitVertical = true
@@ -353,7 +353,7 @@ private void CreateLargeButtonView()
var contentLayout = new ViewLayoutDocker();
// Add the large button at the top
- _viewLargeImage = new ViewDrawRibbonGroupButtonImage(_ribbon, GroupButton, true);
+ _viewLargeImage = new ViewDrawRibbonGroupButtonImage(_ribbon, GroupButton!, true);
var largeImagePadding = new ViewLayoutRibbonCenterPadding(_largeImagePadding)
{
_viewLargeImage
@@ -361,12 +361,12 @@ private void CreateLargeButtonView()
contentLayout.Add(largeImagePadding, ViewDockStyle.Top);
// Add the first line of text
- _viewLargeText1 = new ViewDrawRibbonGroupButtonText(_ribbon, GroupButton, true);
+ _viewLargeText1 = new ViewDrawRibbonGroupButtonText(_ribbon, GroupButton!, true);
contentLayout.Add(_viewLargeText1, ViewDockStyle.Bottom);
// Add the second line of text
_viewLargeCenter = new ViewLayoutRibbonRowCenter();
- _viewLargeText2 = new ViewDrawRibbonGroupButtonText(_ribbon, GroupButton, false);
+ _viewLargeText2 = new ViewDrawRibbonGroupButtonText(_ribbon, GroupButton!, false);
_viewLargeDropArrow = new ViewDrawRibbonDropArrow(_ribbon);
_viewLargeText2Sep1 = new ViewLayoutRibbonSeparator(4, false);
_viewLargeText2Sep2 = new ViewLayoutRibbonSeparator(4, false);
@@ -383,16 +383,16 @@ private void CreateLargeButtonView()
_viewLarge.Add(contentLayout);
// Create controller for intercepting events to determine tool tip handling
- _viewLarge.MouseController = new ToolTipController(_ribbon.TabsArea.ButtonSpecManager.ToolTipManager,
+ _viewLarge.MouseController = new ToolTipController(_ribbon.TabsArea!.ButtonSpecManager!.ToolTipManager!,
_viewLarge, _viewLarge.MouseController);
}
private void CreateMediumSmallButtonView()
{
// Create the background and border view
- _viewMediumSmall = new ViewDrawRibbonGroupButtonBackBorder(_ribbon, GroupButton,
- _ribbon.StateCommon.RibbonGroupButton.PaletteBack,
- _ribbon.StateCommon.RibbonGroupButton.PaletteBorder,
+ _viewMediumSmall = new ViewDrawRibbonGroupButtonBackBorder(_ribbon!, GroupButton!,
+ _ribbon!.StateCommon.RibbonGroupButton.PaletteBack,
+ _ribbon.StateCommon.RibbonGroupButton.PaletteBorder!,
false, _needPaint)
{
SplitVertical = false
@@ -409,9 +409,9 @@ private void CreateMediumSmallButtonView()
var contentLayout = new ViewLayoutDocker();
// Create the image and drop down content
- _viewMediumSmallImage = new ViewDrawRibbonGroupButtonImage(_ribbon, GroupButton, false);
- _viewMediumSmallText1 = new ViewDrawRibbonGroupButtonText(_ribbon, GroupButton, true);
- _viewMediumSmallText2 = new ViewDrawRibbonGroupButtonText(_ribbon, GroupButton, false);
+ _viewMediumSmallImage = new ViewDrawRibbonGroupButtonImage(_ribbon, GroupButton!, false);
+ _viewMediumSmallText1 = new ViewDrawRibbonGroupButtonText(_ribbon, GroupButton!, true);
+ _viewMediumSmallText2 = new ViewDrawRibbonGroupButtonText(_ribbon, GroupButton!, false);
_viewMediumSmallDropArrow = new ViewDrawRibbonDropArrow(_ribbon);
_viewMediumSmallText2Sep2 = new ViewLayoutRibbonSeparator(3, false);
_viewMediumSmallText2Sep3 = new ViewLayoutRibbonSeparator(3, false);
@@ -438,7 +438,7 @@ private void CreateMediumSmallButtonView()
_viewMediumSmall.Add(contentLayout);
// Create controller for intercepting events to determine tool tip handling
- _viewMediumSmall.MouseController = new ToolTipController(_ribbon.TabsArea.ButtonSpecManager.ToolTipManager,
+ _viewMediumSmall.MouseController = new ToolTipController(_ribbon.TabsArea!.ButtonSpecManager!.ToolTipManager!,
_viewMediumSmall, _viewMediumSmall.MouseController);
}
@@ -451,20 +451,20 @@ private void DefineRootView(ViewBase view)
Add(view);
// Provide back reference to the button definition
- GroupButton.ButtonView = view;
+ GroupButton!.ButtonView = view;
}
private void UpdateEnabledState()
{
// Get the correct enabled state from the button definition
- var buttonEnabled = GroupButton.Enabled;
+ var buttonEnabled = GroupButton!.Enabled;
if (GroupButton.KryptonCommand != null)
{
buttonEnabled = GroupButton.KryptonCommand.Enabled;
}
// Take into account the ribbon state and mode
- var enabled = _ribbon.InDesignHelperMode || (buttonEnabled && _ribbon.Enabled);
+ var enabled = _ribbon!.InDesignHelperMode || (buttonEnabled && _ribbon.Enabled);
// Update enabled for the large button view
_viewLarge.Enabled = enabled;
@@ -486,7 +486,7 @@ private void UpdateCheckedState()
var checkedState = false;
// Only show as checked if also a check type button
- if (GroupButton.ButtonType == GroupButtonType.Check)
+ if (GroupButton!.ButtonType == GroupButtonType.Check)
{
checkedState = GroupButton.KryptonCommand?.Checked ?? GroupButton.Checked;
}
@@ -497,7 +497,7 @@ private void UpdateCheckedState()
private void UpdateDropDownState()
{
- var dropDown = GroupButton.ButtonType == GroupButtonType.DropDown;
+ var dropDown = GroupButton!.ButtonType == GroupButtonType.DropDown;
var splitButton = GroupButton.ButtonType == GroupButtonType.Split;
// Only show text line 2 separators is a drop down is showing with no text
@@ -514,7 +514,7 @@ private void UpdateDropDownState()
_viewMediumSmallText2Sep3.Visible = dropDown || splitButton;
}
- private void UpdateItemSizeState() => UpdateItemSizeState(GroupButton.ItemSizeCurrent);
+ private void UpdateItemSizeState() => UpdateItemSizeState(GroupButton!.ItemSizeCurrent);
private void UpdateItemSizeState(GroupItemSize size)
{
@@ -537,17 +537,17 @@ private void UpdateItemSizeState(GroupItemSize size)
}
}
- private void OnLargeButtonClick(object sender, EventArgs e) => GroupButton.PerformClick(_viewLarge.FinishDelegate);
+ private void OnLargeButtonClick(object? sender, EventArgs e) => GroupButton!.PerformClick(_viewLarge.FinishDelegate);
- private void OnLargeButtonDropDown(object sender, EventArgs e) => GroupButton.PerformDropDown(_viewLarge.FinishDelegate);
+ private void OnLargeButtonDropDown(object? sender, EventArgs e) => GroupButton!.PerformDropDown(_viewLarge.FinishDelegate);
- private void OnMediumSmallButtonClick(object sender, EventArgs e) => GroupButton.PerformClick(_viewMediumSmall.FinishDelegate);
+ private void OnMediumSmallButtonClick(object? sender, EventArgs e) => GroupButton!.PerformClick(_viewMediumSmall.FinishDelegate);
- private void OnMediumSmallButtonDropDown(object sender, EventArgs e) => GroupButton.PerformDropDown(_viewMediumSmall.FinishDelegate);
+ private void OnMediumSmallButtonDropDown(object? sender, EventArgs e) => GroupButton!.PerformDropDown(_viewMediumSmall.FinishDelegate);
- private void OnContextClick(object sender, MouseEventArgs e) => GroupButton.OnDesignTimeContextMenu(e);
+ private void OnContextClick(object? sender, MouseEventArgs e) => GroupButton!.OnDesignTimeContextMenu(e);
- private void OnButtonPropertyChanged(object sender, PropertyChangedEventArgs e)
+ private void OnButtonPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
var updateLayout = false;
var updatePaint = false;
@@ -604,8 +604,8 @@ private void OnButtonPropertyChanged(object sender, PropertyChangedEventArgs e)
if (updateLayout)
{
// If we are on the currently selected tab then...
- if ((GroupButton.RibbonTab != null) &&
- (_ribbon.SelectedTab == GroupButton.RibbonTab))
+ if ((GroupButton!.RibbonTab != null) &&
+ (_ribbon!.SelectedTab == GroupButton.RibbonTab))
{
// ...layout so the visible change is made
OnNeedPaint(true);
@@ -615,11 +615,11 @@ private void OnButtonPropertyChanged(object sender, PropertyChangedEventArgs e)
if (updatePaint)
{
// If this button is actually defined as visible...
- if (GroupButton.Visible || _ribbon.InDesignMode)
+ if (GroupButton!.Visible || _ribbon!.InDesignMode)
{
// ...and on the currently selected tab then...
if ((GroupButton.RibbonTab != null) &&
- (_ribbon.SelectedTab == GroupButton.RibbonTab))
+ (_ribbon!.SelectedTab == GroupButton.RibbonTab))
{
// ...repaint it right now
OnNeedPaint(false, ClientRectangle);
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupButtonBackBorder.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupButtonBackBorder.cs
index ac3c6b403..436b35320 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupButtonBackBorder.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupButtonBackBorder.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -58,10 +58,10 @@ internal class ViewDrawRibbonGroupButtonBackBorder : ViewComposite
/// Palette to use for the border.
/// Should the border be a constant normal state.
/// Delegate for notifying paint requests.
- public ViewDrawRibbonGroupButtonBackBorder([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupItem groupItem,
- [DisallowNull] IPaletteBack paletteBack,
- [DisallowNull] IPaletteBorder paletteBorder,
+ public ViewDrawRibbonGroupButtonBackBorder([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupItem? groupItem,
+ [DisallowNull] IPaletteBack? paletteBack,
+ [DisallowNull] IPaletteBorder? paletteBorder,
bool constantBorder,
NeedPaintHandler needPaint)
{
@@ -71,17 +71,20 @@ public ViewDrawRibbonGroupButtonBackBorder([DisallowNull] KryptonRibbon ribbon,
Debug.Assert(paletteBorder != null);
// Remember incoming references
- _ribbon = ribbon;
- GroupItem = groupItem;
- _paletteBack = paletteBack;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ GroupItem = groupItem ?? throw new ArgumentNullException(nameof(groupItem));
+ _paletteBack = paletteBack ?? throw new ArgumentNullException(nameof(paletteBack));
+
_paletteBackDraw = new PaletteBackInheritForced(paletteBack)
{
ForceDraw = InheritBool.True
};
+
_paletteBackLight = new PaletteBackLightenColors(paletteBack);
_paletteBorderAll = new PaletteBorderInheritForced(paletteBorder);
_paletteBorderAll.ForceBorderEdges(PaletteDrawBorders.All);
- _paletteBorder = paletteBorder;
+
+ _paletteBorder = paletteBorder ?? throw new ArgumentNullException(nameof(paletteBorder));
ConstantBorder = constantBorder;
// Default other fields
@@ -159,8 +162,8 @@ protected override void Dispose(bool disposing)
///
public Rectangle SplitRectangle
{
- get => Controller.SplitRectangle;
- set => Controller.SplitRectangle = value;
+ get => Controller!.SplitRectangle;
+ set => Controller!.SplitRectangle = value;
}
#endregion
@@ -170,8 +173,8 @@ public Rectangle SplitRectangle
///
public GroupButtonType ButtonType
{
- get => Controller.ButtonType;
- set => Controller.ButtonType = value;
+ get => Controller!.ButtonType;
+ set => Controller!.ButtonType = value;
}
#endregion
@@ -212,12 +215,12 @@ public GroupButtonType ButtonType
/// Perform a layout of the elements.
///
/// Layout context.
- public override void Layout([DisallowNull] ViewLayoutContext context)
+ public override void Layout([DisallowNull] ViewLayoutContext? context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// Let child elements layout in given space
base.Layout(context);
@@ -292,7 +295,7 @@ private void DrawVerticalSplit(RenderContext context, PaletteState drawState)
// We need the rectangle that represents just the split area
var partialHeight = ClientHeight / 3 * 2;
var partialRect = new Rectangle(ClientLocation, new Size(ClientWidth, partialHeight));
- var splitRectangle = Controller.SplitRectangle;
+ var splitRectangle = Controller!.SplitRectangle;
var aboveSplitRect = new Rectangle(ClientLocation, new Size(ClientWidth, splitRectangle.Y - ClientLocation.Y));
var splitterRect = new Rectangle(splitRectangle.Location, new Size(ClientWidth, 1));
var belowSplitRect = splitRectangle with { X = ClientLocation.X, Width = ClientWidth };
@@ -308,6 +311,7 @@ private void DrawVerticalSplit(RenderContext context, PaletteState drawState)
DrawBorder(_paletteBorder, context, ClientRectangle, PaletteState.Normal);
}
break;
+
case PaletteState.Tracking:
// Draw the background for the click and split areas
if (Controller.MouseInSplit)
@@ -380,6 +384,7 @@ private void DrawVerticalSplit(RenderContext context, PaletteState drawState)
// Draw the entire border around the button
DrawBorder(_paletteBorder, context, ClientRectangle, PaletteState.Tracking);
break;
+
case PaletteState.Pressed:
// Draw the background for the click and split areas
if (Controller.MouseInSplit)
@@ -464,9 +469,11 @@ private void DrawVerticalSplit(RenderContext context, PaletteState drawState)
DrawBorder(_paletteBorder, context, ClientRectangle, PaletteState.Pressed);
}
break;
+
default:
// Should never happen
Debug.Assert(false);
+ DebugTools.NotImplemented(drawState.ToString());
break;
}
}
@@ -474,7 +481,7 @@ private void DrawVerticalSplit(RenderContext context, PaletteState drawState)
private void DrawHorizontalSplit(RenderContext context, PaletteState drawState)
{
// We need the rectangle that represents just the split area
- var splitRectangle = Controller.SplitRectangle;
+ var splitRectangle = Controller!.SplitRectangle;
var beforeSplitRect = new Rectangle(ClientLocation, new Size(splitRectangle.X - ClientLocation.X, ClientHeight));
var splitterRect = new Rectangle(splitRectangle.Location, new Size(1, ClientHeight));
var afterSplitRect = splitRectangle with { Y = ClientLocation.Y, Height = ClientHeight };
@@ -490,6 +497,7 @@ private void DrawHorizontalSplit(RenderContext context, PaletteState drawState)
DrawBorder(_paletteBorder, context, ClientRectangle, PaletteState.Normal);
}
break;
+
case PaletteState.Tracking:
// Draw the background for the click and split areas
if (Controller.MouseInSplit)
@@ -572,6 +580,7 @@ private void DrawHorizontalSplit(RenderContext context, PaletteState drawState)
DrawBorder(_paletteBorder, context, ClientRectangle, PaletteState.Tracking);
}
break;
+
case PaletteState.Pressed:
// Draw the background for the click and split areas
if (Controller.MouseInSplit)
@@ -666,18 +675,25 @@ private void DrawHorizontalSplit(RenderContext context, PaletteState drawState)
}
}
break;
+
default:
// Should never happen
Debug.Assert(false);
+ DebugTools.NotImplemented(drawState.ToString());
break;
}
}
private void DrawBackground(IPaletteBack paletteBack,
- RenderContext context,
+ [DisallowNull] RenderContext context,
Rectangle rect,
PaletteState state)
{
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
// Do we need to draw the background?
if (paletteBack.GetBackDraw(state) == InheritBool.True)
{
@@ -689,6 +705,7 @@ private void DrawBackground(IPaletteBack paletteBack,
Rectangle enclosingRect = CommonHelper.ApplyPadding(VisualOrientation.Top, rect, borderPadding);
// Render the background inside the border path
+ using var gh = new GraphicsHint(context.Graphics, _paletteBorder.GetBorderGraphicsHint(PaletteState.Normal));
_mementoBack = context.Renderer.RenderStandardBack.DrawBack(context, enclosingRect, borderPath,
paletteBack, VisualOrientation.Top,
state, _mementoBack);
@@ -696,10 +713,15 @@ private void DrawBackground(IPaletteBack paletteBack,
}
private void DrawBorder(IPaletteBorder paletteBorder,
- RenderContext context,
+ [DisallowNull] RenderContext context,
Rectangle rect,
PaletteState state)
{
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
// Do we need to draw the border?
if (paletteBorder.GetBorderDraw(state) == InheritBool.True)
{
@@ -714,7 +736,7 @@ private bool SplitWithFading(PaletteState drawState)
return palette.GetMetricBool(drawState, PaletteMetricBool.SplitWithFading) == InheritBool.True;
}
- private void ActionFinished(object sender, EventArgs e)
+ private void ActionFinished(object? sender, EventArgs e)
{
var fireAction = true;
@@ -733,14 +755,14 @@ private void ActionFinished(object sender, EventArgs e)
}
// Remove the fixed pressed appearance
- Controller.RemoveFixed();
+ Controller!.RemoveFixed();
}
- private void OnClick(object sender, EventArgs e) => Click?.Invoke(this, e);
+ private void OnClick(object? sender, EventArgs e) => Click?.Invoke(this, e);
- private void OnContextClick(object sender, MouseEventArgs e) => ContextClick?.Invoke(this, e);
+ private void OnContextClick(object? sender, MouseEventArgs e) => ContextClick?.Invoke(this, e);
- private void OnDropDown(object sender, EventArgs e) => DropDown?.Invoke(this, e);
+ private void OnDropDown(object? sender, EventArgs e) => DropDown?.Invoke(this, e);
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupButtonImage.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupButtonImage.cs
index 67e2794c4..c24d52d84 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupButtonImage.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupButtonImage.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -33,14 +33,14 @@ internal class ViewDrawRibbonGroupButtonImage : ViewDrawRibbonGroupImageBase
/// Reference to owning ribbon control.
/// Reference to ribbon group button definition.
/// Show the large image.
- public ViewDrawRibbonGroupButtonImage(KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupButton ribbonButton,
+ public ViewDrawRibbonGroupButtonImage([DisallowNull] KryptonRibbon ribbon,
+ [DisallowNull] KryptonRibbonGroupButton ribbonButton,
bool large)
: base(ribbon)
{
- Debug.Assert(ribbonButton != null);
+ Debug.Assert(ribbonButton is not null);
- _ribbonButton = ribbonButton;
+ _ribbonButton = ribbonButton ?? throw new ArgumentNullException(nameof(ribbonButton));
_large = large;
_smallSize = new Size((int)(16 * FactorDpiX), (int)(16 * FactorDpiY));
_largeSize = new Size((int)(32 * FactorDpiX), (int)(32 * FactorDpiY));
@@ -65,7 +65,7 @@ public override string ToString() =>
///
/// Gets the image to be drawn.
///
- protected override Image DrawImage
+ protected override Image? DrawImage
{
get
{
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupButtonText.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupButtonText.cs
index 6e1f6d585..18cf8339a 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupButtonText.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupButtonText.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -24,7 +24,7 @@ internal class ViewDrawRibbonGroupButtonText : ViewLeaf,
private readonly KryptonRibbon _ribbon;
private readonly KryptonRibbonGroupButton _ribbonButton;
private readonly RibbonGroupNormalDisabledTextToContent _contentProvider;
- private IDisposable _memento;
+ private IDisposable? _memento;
private readonly bool _firstText;
private int _heightExtra;
private Size _preferredSize;
@@ -48,8 +48,8 @@ public ViewDrawRibbonGroupButtonText([DisallowNull] KryptonRibbon ribbon,
Debug.Assert(ribbon != null);
Debug.Assert(ribbonButton != null);
- _ribbon = ribbon;
- _ribbonButton = ribbonButton;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _ribbonButton = ribbonButton ?? throw new ArgumentNullException(nameof(ribbonButton));
_firstText = firstText;
// Use a class to convert from ribbon group to content interface
@@ -74,7 +74,7 @@ protected override void Dispose(bool disposing)
{
if (disposing)
{
- if (_memento != null)
+ if (_memento is not null)
{
_memento.Dispose();
_memento = null;
@@ -103,7 +103,7 @@ public void MakeDirty()
/// Layout context.
public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
// Validate incoming reference
if (context == null)
@@ -111,6 +111,11 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
throw new ArgumentNullException(nameof(context));
}
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
// A change in state always causes a size and layout calculation
if (_cacheState != State)
{
@@ -124,7 +129,7 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
// Ask the renderer for the contents preferred size
_preferredSize = context.Renderer.RenderStandardContent.GetContentPreferredSize(context, _contentProvider,
this, VisualOrientation.Top,
- State, false, false);
+ State);
// Subtract the extra space used to ensure it draws
_heightExtra = (_ribbon.CalculatedValues.DrawFontHeight - _ribbon.CalculatedValues.RawFontHeight) * 2;
@@ -152,10 +157,20 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
/// Layout context.
public override void Layout([DisallowNull] ViewLayoutContext context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
+
+ if (context is null)
+ {
+ throw new ArgumentNullException(nameof(context));
+ }
+
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// A change in state always causes a size and layout calculation
if (_cacheState != State)
@@ -188,7 +203,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
_memento = context.Renderer.RenderStandardContent.LayoutContent(context, drawRect,
_contentProvider, this,
VisualOrientation.Top,
- PaletteState.Normal, false, false);
+ PaletteState.Normal);
// Cache values that are needed to decide if relayout is needed
_displayRect = ClientRectangle;
@@ -202,8 +217,13 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
/// Perform rendering before child elements are rendered.
///
/// Rendering context.
- public override void RenderBefore(RenderContext context)
+ public override void RenderBefore([DisallowNull] RenderContext context)
{
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
Rectangle drawRect = ClientRectangle;
// Adjust the client rect so the text has enough room to be drawn
@@ -216,7 +236,7 @@ public override void RenderBefore(RenderContext context)
context.Renderer.RenderStandardContent.DrawContent(context, drawRect,
_contentProvider, _memento,
VisualOrientation.Top,
- State, false, false, true);
+ State, true);
}
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupCheckBox.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupCheckBox.cs
index fc298c46b..7addd1ce2 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupCheckBox.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupCheckBox.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -49,18 +49,18 @@ internal class ViewDrawRibbonGroupCheckBox : ViewComposite,
/// Reference to owning ribbon control.
/// Reference to source check box definition.
/// Delegate for notifying paint requests.
- public ViewDrawRibbonGroupCheckBox([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupCheckBox ribbonCheckBox,
- [DisallowNull] NeedPaintHandler needPaint)
+ public ViewDrawRibbonGroupCheckBox([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupCheckBox? ribbonCheckBox,
+ [DisallowNull] NeedPaintHandler? needPaint)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(ribbonCheckBox != null);
- Debug.Assert(needPaint != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(ribbonCheckBox is not null);
+ Debug.Assert(needPaint is not null);
// Remember incoming references
- _ribbon = ribbon;
- GroupCheckBox = ribbonCheckBox;
- _needPaint = needPaint;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ GroupCheckBox = ribbonCheckBox ?? throw new ArgumentNullException(nameof(ribbonCheckBox));
+ _needPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
_currentSize = GroupCheckBox.ItemSizeCurrent;
// Create delegate used to process end of click action
@@ -129,7 +129,7 @@ protected override void Dispose(bool disposing)
/// Gets the first focus item from the item.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetFirstFocusItem()
+ public ViewBase GetFirstFocusItem()
{
// Only take focus if we are visible and enabled
if (GroupCheckBox is { Visible: true, Enabled: true })
@@ -138,7 +138,7 @@ protected override void Dispose(bool disposing)
}
else
{
- return null;
+ return null!;
}
}
#endregion
@@ -148,7 +148,7 @@ protected override void Dispose(bool disposing)
/// Gets the last focus item from the item.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetLastFocusItem()
+ public ViewBase GetLastFocusItem()
{
// Only take focus if we are visible and enabled
if (GroupCheckBox is { Visible: true, Enabled: true })
@@ -157,7 +157,7 @@ protected override void Dispose(bool disposing)
}
else
{
- return null;
+ return null!;
}
}
#endregion
@@ -169,11 +169,11 @@ protected override void Dispose(bool disposing)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetNextFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetNextFocusItem(ViewBase current, ref bool matched)
{
// Do we match the current item?
matched = (current == _viewLarge) || (current == _viewMediumSmall);
- return null;
+ return null!;
}
#endregion
@@ -184,11 +184,11 @@ protected override void Dispose(bool disposing)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetPreviousFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetPreviousFocusItem(ViewBase current, ref bool matched)
{
// Do we match the current item?
matched = (current == _viewLarge) || (current == _viewMediumSmall);
- return null;
+ return null!;
}
#endregion
@@ -224,7 +224,7 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
}
keyTipList.Add(new KeyTipInfo(GroupCheckBox.Enabled, GroupCheckBox.KeyTip,
- screenPt, this[0].ClientRectangle, controller));
+ screenPt, this[0]!.ClientRectangle, controller));
}
}
#endregion
@@ -271,7 +271,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
UpdateItemSizeState();
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// Let child elements layout in given space
base.Layout(context);
@@ -330,7 +330,7 @@ private void CreateLargeCheckBoxView()
_viewLarge.Add(new ViewLayoutRibbonSeparator(1, false), ViewDockStyle.Bottom);
// Create controller for handling mouse, keyboard and focus
- _viewLargeController = new GroupCheckBoxController(_ribbon, _viewLarge, _viewLargeImage, _needPaint);
+ _viewLargeController = new GroupCheckBoxController(_ribbon, _viewLarge, _viewLargeImage, _needPaint!);
_viewLargeController.Click += OnLargeCheckBoxClick;
_viewLargeController.ContextClick += OnContextClick;
_viewLarge.MouseController = _viewLargeController;
@@ -338,7 +338,7 @@ private void CreateLargeCheckBoxView()
_viewLarge.KeyController = _viewLargeController;
// Create controller for intercepting events to determine tool tip handling
- _viewLarge.MouseController = new ToolTipController(_ribbon.TabsArea.ButtonSpecManager.ToolTipManager,
+ _viewLarge.MouseController = new ToolTipController(_ribbon.TabsArea!.ButtonSpecManager!.ToolTipManager!,
_viewLarge, _viewLarge.MouseController);
}
@@ -368,7 +368,7 @@ private void CreateMediumSmallCheckBoxView()
_viewMediumSmall.Add(_viewMediumSmallCenter, ViewDockStyle.Fill);
// Create controller for handling mouse, keyboard and focus
- _viewMediumSmallController = new GroupCheckBoxController(_ribbon, _viewMediumSmall, _viewMediumSmallImage, _needPaint);
+ _viewMediumSmallController = new GroupCheckBoxController(_ribbon, _viewMediumSmall, _viewMediumSmallImage, _needPaint!);
_viewMediumSmallController.Click += OnMediumSmallCheckBoxClick;
_viewMediumSmallController.ContextClick += OnContextClick;
_viewMediumSmall.MouseController = _viewMediumSmallController;
@@ -376,7 +376,7 @@ private void CreateMediumSmallCheckBoxView()
_viewMediumSmall.KeyController = _viewMediumSmallController;
// Create controller for intercepting events to determine tool tip handling
- _viewMediumSmall.MouseController = new ToolTipController(_ribbon.TabsArea.ButtonSpecManager.ToolTipManager,
+ _viewMediumSmall.MouseController = new ToolTipController(_ribbon.TabsArea!.ButtonSpecManager!.ToolTipManager!,
_viewMediumSmall, _viewMediumSmall.MouseController);
}
@@ -443,13 +443,13 @@ private void UpdateItemSizeState(GroupItemSize size)
}
}
- private void OnLargeCheckBoxClick(object sender, EventArgs e) => GroupCheckBox.PerformClick(_finishDelegateLarge);
+ private void OnLargeCheckBoxClick(object? sender, EventArgs e) => GroupCheckBox.PerformClick(_finishDelegateLarge);
- private void OnMediumSmallCheckBoxClick(object sender, EventArgs e) => GroupCheckBox.PerformClick(_finishDelegateMediumSmall);
+ private void OnMediumSmallCheckBoxClick(object? sender, EventArgs e) => GroupCheckBox.PerformClick(_finishDelegateMediumSmall);
- private void OnContextClick(object sender, MouseEventArgs e) => GroupCheckBox.OnDesignTimeContextMenu(e);
+ private void OnContextClick(object? sender, MouseEventArgs e) => GroupCheckBox.OnDesignTimeContextMenu(e);
- private void ActionFinishedLarge(object sender, EventArgs e)
+ private void ActionFinishedLarge(object? sender, EventArgs e)
{
// Remove any popups that result from an action occurring
_ribbon.ActionOccurred();
@@ -458,7 +458,7 @@ private void ActionFinishedLarge(object sender, EventArgs e)
_viewLargeController?.RemoveFixed();
}
- private void ActionFinishedMediumSmall(object sender, EventArgs e)
+ private void ActionFinishedMediumSmall(object? sender, EventArgs e)
{
// Remove any popups that result from an action occurring
_ribbon.ActionOccurred();
@@ -467,7 +467,7 @@ private void ActionFinishedMediumSmall(object sender, EventArgs e)
_viewMediumSmallController?.RemoveFixed();
}
- private void OnCheckBoxPropertyChanged(object sender, PropertyChangedEventArgs e)
+ private void OnCheckBoxPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
var updateLayout = false;
var updatePaint = false;
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupCheckBoxImage.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupCheckBoxImage.cs
index 3843dc413..6d79f798b 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupCheckBoxImage.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupCheckBoxImage.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -34,14 +34,19 @@ internal class ViewDrawRibbonGroupCheckBoxImage : ViewComposite
/// Reference to owning ribbon control.
/// Reference to ribbon group check box definition.
/// Show the large image.
- public ViewDrawRibbonGroupCheckBoxImage(KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupCheckBox ribbonCheckBox,
+ public ViewDrawRibbonGroupCheckBoxImage([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupCheckBox? ribbonCheckBox,
bool large)
{
- Debug.Assert(ribbonCheckBox != null);
+ Debug.Assert(ribbonCheckBox is not null);
+
+ if (ribbon is null)
+ {
+ throw new ArgumentNullException(nameof(ribbon));
+ }
// Remember incoming parameters
- _ribbonCheckBox = ribbonCheckBox;
+ _ribbonCheckBox = ribbonCheckBox ?? throw new ArgumentNullException(nameof(ribbonCheckBox));
_large = large;
// Use redirector to get the check box images and redirect to parent palette
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupCheckBoxText.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupCheckBoxText.cs
index 5062f1866..caea6b2d4 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupCheckBoxText.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupCheckBoxText.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -24,7 +24,7 @@ internal class ViewDrawRibbonGroupCheckBoxText : ViewLeaf,
private readonly KryptonRibbon _ribbon;
private readonly KryptonRibbonGroupCheckBox _ribbonCheckBox;
private readonly RibbonGroupNormalDisabledTextToContent _contentProvider;
- private IDisposable _memento;
+ private IDisposable? _memento;
private readonly bool _firstText;
private int _heightExtra;
private Size _preferredSize;
@@ -45,11 +45,11 @@ public ViewDrawRibbonGroupCheckBoxText([DisallowNull] KryptonRibbon ribbon,
[DisallowNull] KryptonRibbonGroupCheckBox ribbonCheckBox,
bool firstText)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(ribbonCheckBox != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(ribbonCheckBox is not null);
- _ribbon = ribbon;
- _ribbonCheckBox = ribbonCheckBox;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _ribbonCheckBox = ribbonCheckBox ?? throw new ArgumentNullException(nameof(ribbonCheckBox ));
_firstText = firstText;
// Use a class to convert from ribbon group to content interface
@@ -103,14 +103,19 @@ public void MakeDirty()
/// Layout context.
public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
// Validate incoming reference
- if (context == null)
+ if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
// A change in state always causes a size and layout calculation
if (_cacheState != State)
{
@@ -124,7 +129,7 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
// Ask the renderer for the contents preferred size
_preferredSize = context.Renderer.RenderStandardContent.GetContentPreferredSize(context, _contentProvider,
this, VisualOrientation.Top,
- State, false, false);
+ State);
// Subtract the extra space used to ensure it draws
_heightExtra = (_ribbon.CalculatedValues.DrawFontHeight - _ribbon.CalculatedValues.RawFontHeight) * 2;
@@ -147,12 +152,22 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
/// Perform a layout of the elements.
///
/// Layout context.
- public override void Layout([DisallowNull] ViewLayoutContext context)
+ public override void Layout([DisallowNull] ViewLayoutContext? context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
+
+ if (context is null)
+ {
+ throw new ArgumentNullException(nameof(context));
+ }
+
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// A change in state always causes a size and layout calculation
if (_cacheState != State)
@@ -182,7 +197,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
_memento = context.Renderer.RenderStandardContent.LayoutContent(context, drawRect,
_contentProvider, this,
VisualOrientation.Top,
- PaletteState.Normal, false, false);
+ PaletteState.Normal);
// Cache values that are needed to decide if layout is needed
_displayRect = ClientRectangle;
@@ -196,8 +211,13 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
/// Perform rendering before child elements are rendered.
///
/// Rendering context.
- public override void RenderBefore(RenderContext context)
+ public override void RenderBefore([DisallowNull] RenderContext context)
{
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
Rectangle drawRect = ClientRectangle;
// Adjust the client rect so the text has enough room to be drawn
@@ -210,7 +230,7 @@ public override void RenderBefore(RenderContext context)
context.Renderer.RenderStandardContent.DrawContent(context, drawRect,
_contentProvider, _memento,
VisualOrientation.Top,
- State, false, false, true);
+ State, true);
}
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupClusterButton.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupClusterButton.cs
index 45c1f17c9..896bb2c4c 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupClusterButton.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupClusterButton.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -43,18 +43,18 @@ internal class ViewDrawRibbonGroupClusterButton : ViewComposite,
/// Reference to owning ribbon control.
/// Reference to source button definition.
/// Delegate for notifying paint requests.
- public ViewDrawRibbonGroupClusterButton([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupClusterButton ribbonButton,
- [DisallowNull] NeedPaintHandler needPaint)
+ public ViewDrawRibbonGroupClusterButton([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupClusterButton? ribbonButton,
+ [DisallowNull] NeedPaintHandler? needPaint)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(ribbonButton != null);
- Debug.Assert(needPaint != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(ribbonButton is not null);
+ Debug.Assert(needPaint is not null);
// Remember incoming references
- _ribbon = ribbon;
- GroupClusterButton = ribbonButton;
- _needPaint = needPaint;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon ));
+ GroupClusterButton = ribbonButton ?? throw new ArgumentNullException(nameof(ribbonButton));
+ _needPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
_currentSize = GroupClusterButton.ItemSizeCurrent;
// Associate this view with the source component (required for design time selection)
@@ -109,7 +109,7 @@ protected override void Dispose(bool disposing)
///
/// Gets access to the connected button definition.
///
- public KryptonRibbonGroupClusterButton GroupClusterButton { get; private set; }
+ public KryptonRibbonGroupClusterButton? GroupClusterButton { get; private set; }
#endregion
@@ -167,7 +167,7 @@ public bool DrawNonTrackingAreas
/// Gets the first focus item from the container.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetFirstFocusItem()
+ public ViewBase GetFirstFocusItem()
{
// Only take focus if we are visible and enabled
if (GroupClusterButton is { Visible: true, Enabled: true })
@@ -176,7 +176,7 @@ public bool DrawNonTrackingAreas
}
else
{
- return null;
+ return null!;
}
}
#endregion
@@ -186,7 +186,7 @@ public bool DrawNonTrackingAreas
/// Gets the last focus item from the item.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetLastFocusItem()
+ public ViewBase GetLastFocusItem()
{
// Only take focus if we are visible and enabled
if (GroupClusterButton is { Visible: true, Enabled: true })
@@ -195,7 +195,7 @@ public bool DrawNonTrackingAreas
}
else
{
- return null;
+ return null!;
}
}
#endregion
@@ -207,11 +207,11 @@ public bool DrawNonTrackingAreas
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetNextFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetNextFocusItem(ViewBase current, ref bool matched)
{
// Do we match the current item?
matched = current == _viewMediumSmall;
- return null;
+ return null!;
}
#endregion
@@ -222,11 +222,11 @@ public bool DrawNonTrackingAreas
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetPreviousFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetPreviousFocusItem(ViewBase current, ref bool matched)
{
// Do we match the current item?
matched = current == _viewMediumSmall;
- return null;
+ return null!;
}
#endregion
@@ -247,8 +247,8 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
// Determine the screen position of the key tip dependant on item location
Point screenPt = _ribbon.CalculatedValues.KeyTipRectToPoint(viewRect, lineHint);
- keyTipList.Add(new KeyTipInfo(GroupClusterButton.Enabled, GroupClusterButton.KeyTip, screenPt,
- this[0].ClientRectangle, _viewMediumSmall.Controller));
+ keyTipList.Add(new KeyTipInfo(GroupClusterButton!.Enabled, GroupClusterButton.KeyTip, screenPt,
+ this[0]!.ClientRectangle, _viewMediumSmall.Controller));
}
}
#endregion
@@ -283,7 +283,7 @@ public override Size GetPreferredSize(ViewLayoutContext context)
/// Layout context.
public override void Layout([DisallowNull] ViewLayoutContext context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
// Update our enabled and checked state
UpdateEnabledState();
@@ -291,13 +291,13 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
UpdateDropDownState();
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// Let child elements layout in given space
base.Layout(context);
// For split buttons we need to calculate the split button areas
- if (GroupClusterButton.ButtonType == GroupButtonType.Split)
+ if (GroupClusterButton!.ButtonType == GroupButtonType.Split)
{
// Find the position of the split area
var smallSplitRight = _viewMediumSmallText2Sep1.ClientLocation.X;
@@ -344,7 +344,7 @@ private void CreateView()
_borderForced = new PaletteBorderInheritForced(_ribbon.StateCommon.RibbonGroupClusterButton.PaletteBorder);
// Create the background and border view
- _viewMediumSmall = new ViewDrawRibbonGroupButtonBackBorder(_ribbon, GroupClusterButton, _backForced, _borderForced, true, _needPaint)
+ _viewMediumSmall = new ViewDrawRibbonGroupButtonBackBorder(_ribbon, GroupClusterButton!, _backForced, _borderForced, true, _needPaint)
{
SplitVertical = false
};
@@ -360,8 +360,8 @@ private void CreateView()
var contentLayout = new ViewLayoutDocker();
// Create the image and drop down content
- _viewMediumSmallImage = new ViewDrawRibbonGroupClusterButtonImage(_ribbon, GroupClusterButton);
- _viewMediumSmallText1 = new ViewDrawRibbonGroupClusterButtonText(_ribbon, GroupClusterButton)
+ _viewMediumSmallImage = new ViewDrawRibbonGroupClusterButtonImage(_ribbon, GroupClusterButton!);
+ _viewMediumSmallText1 = new ViewDrawRibbonGroupClusterButtonText(_ribbon, GroupClusterButton!)
{
Visible = _currentSize != GroupItemSize.Small
};
@@ -390,17 +390,17 @@ private void CreateView()
_viewMediumSmall.Add(contentLayout);
// Create controller for intercepting events to determine tool tip handling
- _viewMediumSmall.MouseController = new ToolTipController(_ribbon.TabsArea.ButtonSpecManager.ToolTipManager,
+ _viewMediumSmall.MouseController = new ToolTipController(_ribbon.TabsArea!.ButtonSpecManager!.ToolTipManager!,
_viewMediumSmall, _viewMediumSmall.MouseController);
// Provide back reference to the button definition
- GroupClusterButton.ClusterButtonView = _viewMediumSmall;
+ GroupClusterButton!.ClusterButtonView = _viewMediumSmall;
// Define the actual view
Add(_viewMediumSmall);
}
- private void UpdateItemSizeState() => UpdateItemSizeState(GroupClusterButton.ItemSizeCurrent);
+ private void UpdateItemSizeState() => UpdateItemSizeState(GroupClusterButton!.ItemSizeCurrent);
private void UpdateItemSizeState(GroupItemSize size)
{
@@ -412,7 +412,7 @@ private void UpdateItemSizeState(GroupItemSize size)
private void UpdateEnabledState()
{
// Get the correct enabled state from the button definition
- var buttonEnabled = GroupClusterButton.Enabled;
+ var buttonEnabled = GroupClusterButton!.Enabled;
if (GroupClusterButton.KryptonCommand != null)
{
buttonEnabled = GroupClusterButton.KryptonCommand.Enabled;
@@ -432,7 +432,7 @@ private void UpdateCheckedState()
var checkedState = false;
// Only show as checked if also a check type button
- if (GroupClusterButton.ButtonType == GroupButtonType.Check)
+ if (GroupClusterButton!.ButtonType == GroupButtonType.Check)
{
checkedState = GroupClusterButton.KryptonCommand?.Checked ?? GroupClusterButton.Checked;
}
@@ -442,7 +442,7 @@ private void UpdateCheckedState()
private void UpdateDropDownState()
{
- var dropDown = GroupClusterButton.ButtonType is GroupButtonType.DropDown or GroupButtonType.Split;
+ var dropDown = GroupClusterButton!.ButtonType is GroupButtonType.DropDown or GroupButtonType.Split;
var splitDown = GroupClusterButton.ButtonType == GroupButtonType.Split;
@@ -454,13 +454,13 @@ private void UpdateDropDownState()
_viewMediumSmall.ButtonType = GroupClusterButton.ButtonType;
}
- private void OnSmallButtonClick(object sender, EventArgs e) => GroupClusterButton.PerformClick(_viewMediumSmall.FinishDelegate);
+ private void OnSmallButtonClick(object? sender, EventArgs e) => GroupClusterButton!.PerformClick(_viewMediumSmall.FinishDelegate);
- private void OnSmallButtonDropDown(object sender, EventArgs e) => GroupClusterButton.PerformDropDown(_viewMediumSmall.FinishDelegate);
+ private void OnSmallButtonDropDown(object? sender, EventArgs e) => GroupClusterButton!.PerformDropDown(_viewMediumSmall.FinishDelegate);
- private void OnContextClick(object sender, MouseEventArgs e) => GroupClusterButton.OnDesignTimeContextMenu(e);
+ private void OnContextClick(object? sender, MouseEventArgs e) => GroupClusterButton!.OnDesignTimeContextMenu(e);
- private void OnButtonPropertyChanged(object sender, PropertyChangedEventArgs e)
+ private void OnButtonPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
var updateLayout = false;
var updatePaint = false;
@@ -506,7 +506,7 @@ private void OnButtonPropertyChanged(object sender, PropertyChangedEventArgs e)
if (updateLayout)
{
// If we are on the currently selected tab then...
- if ((GroupClusterButton.RibbonTab != null) &&
+ if ((GroupClusterButton!.RibbonTab != null) &&
(_ribbon.SelectedTab == GroupClusterButton.RibbonTab))
{
// ...layout so the visible change is made
@@ -517,7 +517,7 @@ private void OnButtonPropertyChanged(object sender, PropertyChangedEventArgs e)
if (updatePaint)
{
// If this button is actually defined as visible...
- if (GroupClusterButton.Visible || _ribbon.InDesignMode)
+ if (GroupClusterButton!.Visible || _ribbon.InDesignMode)
{
// ...and on the currently selected tab then...
if ((GroupClusterButton.RibbonTab != null) &&
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupClusterButtonImage.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupClusterButtonImage.cs
index 7de7671f4..a5b03adc4 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupClusterButtonImage.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupClusterButtonImage.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -31,13 +31,13 @@ internal class ViewDrawRibbonGroupClusterButtonImage : ViewDrawRibbonGroupImageB
///
/// Reference to owning ribbon control.
/// Reference to ribbon group button definition.
- public ViewDrawRibbonGroupClusterButtonImage(KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupClusterButton ribbonButton)
+ public ViewDrawRibbonGroupClusterButtonImage([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupClusterButton? ribbonButton)
: base(ribbon)
{
- Debug.Assert(ribbonButton != null);
+ Debug.Assert(ribbonButton is not null);
- _ribbonButton = ribbonButton;
+ _ribbonButton = ribbonButton ?? throw new ArgumentNullException(nameof(ribbonButton));
_smallSize = new Size((int)(16 * FactorDpiX), (int)(16 * FactorDpiY));
}
@@ -60,7 +60,7 @@ public override string ToString() =>
///
/// Gets the image to be drawn.
///
- protected override Image DrawImage => _ribbonButton.KryptonCommand != null ? _ribbonButton.KryptonCommand.ImageSmall : _ribbonButton.ImageSmall;
+ protected override Image? DrawImage => _ribbonButton.KryptonCommand != null ? _ribbonButton.KryptonCommand.ImageSmall : _ribbonButton.ImageSmall;
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupClusterButtonText.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupClusterButtonText.cs
index 80ecc3907..400610875 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupClusterButtonText.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupClusterButtonText.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -24,7 +24,7 @@ internal class ViewDrawRibbonGroupClusterButtonText : ViewLeaf,
private readonly KryptonRibbon _ribbon;
private readonly KryptonRibbonGroupClusterButton _ribbonButton;
private readonly RibbonGroupNormalDisabledTextToContent _contentProvider;
- private IDisposable _memento;
+ private IDisposable? _memento;
private int _heightExtra;
private Size _preferredSize;
private Rectangle _displayRect;
@@ -39,15 +39,15 @@ internal class ViewDrawRibbonGroupClusterButtonText : ViewLeaf,
///
/// Source ribbon control.
/// Group cluster button to display title for.
- public ViewDrawRibbonGroupClusterButtonText([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupClusterButton ribbonButton)
+ public ViewDrawRibbonGroupClusterButtonText([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupClusterButton? ribbonButton)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(ribbonButton != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(ribbonButton is not null);
- _ribbon = ribbon;
- _ribbonButton = ribbonButton;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _ribbonButton = ribbonButton ?? throw new ArgumentNullException(nameof(ribbonButton));
// Use a class to convert from ribbon group to content interface
_contentProvider = new RibbonGroupNormalDisabledTextToContent(ribbon.StateCommon.RibbonGeneral,
@@ -100,7 +100,17 @@ public void MakeDirty()
/// Layout context.
public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
+
+ if (context is null)
+ {
+ throw new ArgumentNullException(nameof(context));
+ }
+
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
// Validate incoming reference
if (context == null)
@@ -121,7 +131,7 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
// Ask the renderer for the contents preferred size
_preferredSize = context.Renderer.RenderStandardContent.GetContentPreferredSize(context, _contentProvider,
this, VisualOrientation.Top,
- State, false, false);
+ State);
// Subtract the extra space used to ensure it draws
_heightExtra = (_ribbon.CalculatedValues.DrawFontHeight - _ribbon.CalculatedValues.RawFontHeight) * 2;
@@ -144,12 +154,22 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
/// Perform a layout of the elements.
///
/// Layout context.
- public override void Layout([DisallowNull] ViewLayoutContext context)
+ public override void Layout([DisallowNull] ViewLayoutContext? context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
+
+ if (context is null)
+ {
+ throw new ArgumentNullException(nameof(context));
+ }
+
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// A change in state always causes a size and layout calculation
if (_cacheState != State)
@@ -179,7 +199,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
_memento = context.Renderer.RenderStandardContent.LayoutContent(context, drawRect,
_contentProvider, this,
VisualOrientation.Top,
- PaletteState.Normal, false, false);
+ PaletteState.Normal);
// Cache values that are needed to decide if layout is needed
_displayRect = ClientRectangle;
@@ -193,8 +213,13 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
/// Perform rendering before child elements are rendered.
///
/// Rendering context.
- public override void RenderBefore(RenderContext context)
+ public override void RenderBefore([DisallowNull] RenderContext context)
{
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
Rectangle drawRect = ClientRectangle;
// Adjust the client rect so the text has enough room to be drawn
@@ -207,7 +232,7 @@ public override void RenderBefore(RenderContext context)
context.Renderer.RenderStandardContent.DrawContent(context, drawRect,
_contentProvider, _memento,
VisualOrientation.Top,
- State, false, false, true);
+ State, true);
}
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupClusterColorButton.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupClusterColorButton.cs
index fe0dde65b..d101a0ce2 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupClusterColorButton.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupClusterColorButton.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -43,18 +43,18 @@ internal class ViewDrawRibbonGroupClusterColorButton : ViewComposite,
/// Reference to owning ribbon control.
/// Reference to source button definition.
/// Delegate for notifying paint requests.
- public ViewDrawRibbonGroupClusterColorButton([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupClusterColorButton ribbonButton,
- [DisallowNull] NeedPaintHandler needPaint)
+ public ViewDrawRibbonGroupClusterColorButton([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupClusterColorButton? ribbonButton,
+ [DisallowNull] NeedPaintHandler? needPaint)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(ribbonButton != null);
- Debug.Assert(needPaint != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(ribbonButton is not null);
+ Debug.Assert(needPaint is not null);
// Remember incoming references
- _ribbon = ribbon;
- GroupClusterColorButton = ribbonButton;
- _needPaint = needPaint;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon ));
+ GroupClusterColorButton = ribbonButton ?? throw new ArgumentNullException(nameof(ribbonButton));
+ _needPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
_currentSize = GroupClusterColorButton.ItemSizeCurrent;
// Associate this view with the source component (required for design time selection)
@@ -109,7 +109,7 @@ protected override void Dispose(bool disposing)
///
/// Gets access to the connected button definition.
///
- public KryptonRibbonGroupClusterColorButton GroupClusterColorButton { get; private set; }
+ public KryptonRibbonGroupClusterColorButton? GroupClusterColorButton { get; private set; }
#endregion
@@ -167,7 +167,7 @@ public bool DrawNonTrackingAreas
/// Gets the first focus item from the container.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetFirstFocusItem()
+ public ViewBase GetFirstFocusItem()
{
// Only take focus if we are visible and enabled
if (GroupClusterColorButton is { Visible: true, Enabled: true })
@@ -176,7 +176,7 @@ public bool DrawNonTrackingAreas
}
else
{
- return null;
+ return null!;
}
}
#endregion
@@ -186,7 +186,7 @@ public bool DrawNonTrackingAreas
/// Gets the last focus item from the item.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetLastFocusItem()
+ public ViewBase GetLastFocusItem()
{
// Only take focus if we are visible and enabled
if (GroupClusterColorButton is { Visible: true, Enabled: true })
@@ -195,7 +195,7 @@ public bool DrawNonTrackingAreas
}
else
{
- return null;
+ return null!;
}
}
#endregion
@@ -207,11 +207,11 @@ public bool DrawNonTrackingAreas
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetNextFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetNextFocusItem(ViewBase current, ref bool matched)
{
// Do we match the current item?
matched = current == _viewMediumSmall;
- return null;
+ return null!;
}
#endregion
@@ -222,11 +222,11 @@ public bool DrawNonTrackingAreas
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetPreviousFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetPreviousFocusItem(ViewBase current, ref bool matched)
{
// Do we match the current item?
matched = current == _viewMediumSmall;
- return null;
+ return null!;
}
#endregion
@@ -247,8 +247,8 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
// Determine the screen position of the key tip dependant on item location
Point screenPt = _ribbon.CalculatedValues.KeyTipRectToPoint(viewRect, lineHint);
- keyTipList.Add(new KeyTipInfo(GroupClusterColorButton.Enabled, GroupClusterColorButton.KeyTip, screenPt,
- this[0].ClientRectangle, _viewMediumSmall.Controller));
+ keyTipList.Add(new KeyTipInfo(GroupClusterColorButton!.Enabled, GroupClusterColorButton.KeyTip, screenPt,
+ this[0]!.ClientRectangle, _viewMediumSmall.Controller));
}
}
#endregion
@@ -283,7 +283,7 @@ public override Size GetPreferredSize(ViewLayoutContext context)
/// Layout context.
public override void Layout([DisallowNull] ViewLayoutContext context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
// Update our enabled and checked state
UpdateEnabledState();
@@ -291,13 +291,13 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
UpdateDropDownState();
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// Let child elements layout in given space
base.Layout(context);
// For split buttons we need to calculate the split button areas
- if (GroupClusterColorButton.ButtonType == GroupButtonType.Split)
+ if (GroupClusterColorButton!.ButtonType == GroupButtonType.Split)
{
// Find the position of the split area
var smallSplitRight = _viewMediumSmallText2Sep1.ClientLocation.X;
@@ -344,7 +344,7 @@ private void CreateView()
_borderForced = new PaletteBorderInheritForced(_ribbon.StateCommon.RibbonGroupClusterButton.PaletteBorder);
// Create the background and border view
- _viewMediumSmall = new ViewDrawRibbonGroupButtonBackBorder(_ribbon, GroupClusterColorButton, _backForced, _borderForced, true, _needPaint)
+ _viewMediumSmall = new ViewDrawRibbonGroupButtonBackBorder(_ribbon, GroupClusterColorButton!, _backForced, _borderForced, true, _needPaint)
{
SplitVertical = false
};
@@ -360,8 +360,8 @@ private void CreateView()
var contentLayout = new ViewLayoutDocker();
// Create the image and drop down content
- _viewMediumSmallImage = new ViewDrawRibbonGroupClusterColorButtonImage(_ribbon, GroupClusterColorButton);
- _viewMediumSmallText1 = new ViewDrawRibbonGroupClusterColorButtonText(_ribbon, GroupClusterColorButton)
+ _viewMediumSmallImage = new ViewDrawRibbonGroupClusterColorButtonImage(_ribbon, GroupClusterColorButton!);
+ _viewMediumSmallText1 = new ViewDrawRibbonGroupClusterColorButtonText(_ribbon, GroupClusterColorButton!)
{
Visible = _currentSize != GroupItemSize.Small
};
@@ -390,17 +390,17 @@ private void CreateView()
_viewMediumSmall.Add(contentLayout);
// Create controller for intercepting events to determine tool tip handling
- _viewMediumSmall.MouseController = new ToolTipController(_ribbon.TabsArea.ButtonSpecManager.ToolTipManager,
+ _viewMediumSmall.MouseController = new ToolTipController(_ribbon.TabsArea!.ButtonSpecManager!.ToolTipManager!,
_viewMediumSmall, _viewMediumSmall.MouseController);
// Provide back reference to the button definition
- GroupClusterColorButton.ClusterColorButtonView = _viewMediumSmall;
+ GroupClusterColorButton!.ClusterColorButtonView = _viewMediumSmall;
// Define the actual view
Add(_viewMediumSmall);
}
- private void UpdateItemSizeState() => UpdateItemSizeState(GroupClusterColorButton.ItemSizeCurrent);
+ private void UpdateItemSizeState() => UpdateItemSizeState(GroupClusterColorButton!.ItemSizeCurrent);
private void UpdateItemSizeState(GroupItemSize size)
{
@@ -412,7 +412,7 @@ private void UpdateItemSizeState(GroupItemSize size)
private void UpdateEnabledState()
{
// Get the correct enabled state from the button definition
- var buttonEnabled = GroupClusterColorButton.Enabled;
+ var buttonEnabled = GroupClusterColorButton!.Enabled;
if (GroupClusterColorButton.KryptonCommand != null)
{
buttonEnabled = GroupClusterColorButton.KryptonCommand.Enabled;
@@ -431,7 +431,7 @@ private void UpdateCheckedState()
var checkedState = false;
// Only show as checked if also a check type button
- if (GroupClusterColorButton.ButtonType == GroupButtonType.Check)
+ if (GroupClusterColorButton!.ButtonType == GroupButtonType.Check)
{
checkedState = GroupClusterColorButton.KryptonCommand?.Checked ?? GroupClusterColorButton.Checked;
}
@@ -442,7 +442,7 @@ private void UpdateCheckedState()
private void UpdateDropDownState()
{
// Only show the drop down if the button is the correct type
- var dropDown = GroupClusterColorButton.ButtonType is GroupButtonType.DropDown or GroupButtonType.Split;
+ var dropDown = GroupClusterColorButton!.ButtonType is GroupButtonType.DropDown or GroupButtonType.Split;
_viewMediumSmallDropArrow.Visible = dropDown;
_viewMediumSmallText2Sep2.Visible = dropDown;
@@ -452,13 +452,13 @@ private void UpdateDropDownState()
}
- private void OnSmallButtonClick(object sender, EventArgs e) => GroupClusterColorButton.PerformClick(_viewMediumSmall.FinishDelegate);
+ private void OnSmallButtonClick(object? sender, EventArgs e) => GroupClusterColorButton!.PerformClick(_viewMediumSmall.FinishDelegate);
- private void OnSmallButtonDropDown(object sender, EventArgs e) => GroupClusterColorButton.PerformDropDown(_viewMediumSmall.FinishDelegate);
+ private void OnSmallButtonDropDown(object? sender, EventArgs e) => GroupClusterColorButton!.PerformDropDown(_viewMediumSmall.FinishDelegate);
- private void OnContextClick(object sender, MouseEventArgs e) => GroupClusterColorButton.OnDesignTimeContextMenu(e);
+ private void OnContextClick(object? sender, MouseEventArgs e) => GroupClusterColorButton!.OnDesignTimeContextMenu(e);
- private void OnButtonPropertyChanged(object sender, PropertyChangedEventArgs e)
+ private void OnButtonPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
var updateLayout = false;
var updatePaint = false;
@@ -512,7 +512,7 @@ private void OnButtonPropertyChanged(object sender, PropertyChangedEventArgs e)
if (updateLayout)
{
// If we are on the currently selected tab then...
- if ((GroupClusterColorButton.RibbonTab != null) &&
+ if ((GroupClusterColorButton!.RibbonTab != null) &&
(_ribbon.SelectedTab == GroupClusterColorButton.RibbonTab))
{
// ...layout so the visible change is made
@@ -523,7 +523,7 @@ private void OnButtonPropertyChanged(object sender, PropertyChangedEventArgs e)
if (updatePaint)
{
// If this button is actually defined as visible...
- if (GroupClusterColorButton.Visible || _ribbon.InDesignMode)
+ if (GroupClusterColorButton!.Visible || _ribbon.InDesignMode)
{
// ...and on the currently selected tab then...
if ((GroupClusterColorButton.RibbonTab != null) &&
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupClusterColorButtonImage.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupClusterColorButtonImage.cs
index ca86116ac..22fcf40f5 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupClusterColorButtonImage.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupClusterColorButtonImage.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -23,7 +23,7 @@ internal class ViewDrawRibbonGroupClusterColorButtonImage : ViewDrawRibbonGroupI
#region Instance Fields
private readonly Size _smallSize;// = new Size(16, 16);
private readonly KryptonRibbonGroupClusterColorButton _ribbonColorButton;
- private Image _compositeImage;
+ private Image? _compositeImage;
private Color _selectedColor;
private Color _emptyBorderColor;
private Rectangle _selectedRect;
@@ -35,12 +35,12 @@ internal class ViewDrawRibbonGroupClusterColorButtonImage : ViewDrawRibbonGroupI
///
/// Reference to owning ribbon control.
/// Reference to ribbon group color button definition.
- public ViewDrawRibbonGroupClusterColorButtonImage(KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupClusterColorButton ribbonColorButton)
+ public ViewDrawRibbonGroupClusterColorButtonImage([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupClusterColorButton? ribbonColorButton)
: base(ribbon)
{
- Debug.Assert(ribbonColorButton != null);
- _ribbonColorButton = ribbonColorButton;
+ Debug.Assert(ribbonColorButton is not null);
+ _ribbonColorButton = ribbonColorButton ?? throw new ArgumentNullException(nameof(ribbonColorButton));
_selectedColor = ribbonColorButton.SelectedColor;
_emptyBorderColor = ribbonColorButton.EmptyBorderColor;
_selectedRect = ribbonColorButton.SelectedRect;
@@ -95,7 +95,7 @@ public void SelectedColorRectChanged()
///
/// Gets the image to be drawn.
///
- protected override Image DrawImage
+ protected override Image? DrawImage
{
get
{
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupClusterColorButtonText.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupClusterColorButtonText.cs
index b71b1c14a..13b7892a7 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupClusterColorButtonText.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupClusterColorButtonText.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -24,7 +24,7 @@ internal class ViewDrawRibbonGroupClusterColorButtonText : ViewLeaf,
private readonly KryptonRibbon _ribbon;
private readonly KryptonRibbonGroupClusterColorButton _ribbonColorButton;
private readonly RibbonGroupNormalDisabledTextToContent _contentProvider;
- private IDisposable _memento;
+ private IDisposable? _memento;
private int _heightExtra;
private Size _preferredSize;
private Rectangle _displayRect;
@@ -39,15 +39,15 @@ internal class ViewDrawRibbonGroupClusterColorButtonText : ViewLeaf,
///
/// Source ribbon control.
/// Group cluster color button to display title for.
- public ViewDrawRibbonGroupClusterColorButtonText([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupClusterColorButton ribbonColorButton)
+ public ViewDrawRibbonGroupClusterColorButtonText([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupClusterColorButton? ribbonColorButton)
{
Debug.Assert(ribbon != null);
Debug.Assert(ribbonColorButton != null);
- _ribbon = ribbon;
- _ribbonColorButton = ribbonColorButton;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _ribbonColorButton = ribbonColorButton ?? throw new ArgumentNullException(nameof(ribbonColorButton));
// Use a class to convert from ribbon group to content interface
_contentProvider = new RibbonGroupNormalDisabledTextToContent(ribbon.StateCommon.RibbonGeneral,
@@ -100,12 +100,14 @@ public void MakeDirty()
/// Layout context.
public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
{
- Debug.Assert(context != null);
+ // Debug.Assert() causes the null assignment warning.
+ // Suppressed by the null forgiving operator
+ Debug.Assert(context is not null);
// Validate incoming reference
- if (context == null)
+ if (context!.Renderer is null)
{
- throw new ArgumentNullException(nameof(context));
+ throw new ArgumentNullException(nameof(context.Renderer));
}
// A change in state always causes a size and layout calculation
@@ -121,7 +123,7 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
// Ask the renderer for the contents preferred size
_preferredSize = context.Renderer.RenderStandardContent.GetContentPreferredSize(context, _contentProvider,
this, VisualOrientation.Top,
- State, false, false);
+ State);
// Subtract the extra space used to ensure it draws
_heightExtra = (_ribbon.CalculatedValues.DrawFontHeight - _ribbon.CalculatedValues.RawFontHeight) * 2;
@@ -146,10 +148,20 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
/// Layout context.
public override void Layout([DisallowNull] ViewLayoutContext context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
+
+ if (context is null)
+ {
+ throw new ArgumentNullException(nameof(context));
+ }
+
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// A change in state always causes a size and layout calculation
if (_cacheState != State)
@@ -179,7 +191,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
_memento = context.Renderer.RenderStandardContent.LayoutContent(context, drawRect,
_contentProvider, this,
VisualOrientation.Top,
- PaletteState.Normal, false, false);
+ PaletteState.Normal);
// Cache values that are needed to decide if layout is needed
_displayRect = ClientRectangle;
@@ -193,8 +205,13 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
/// Perform rendering before child elements are rendered.
///
/// Rendering context.
- public override void RenderBefore(RenderContext context)
+ public override void RenderBefore([DisallowNull] RenderContext context)
{
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
Rectangle drawRect = ClientRectangle;
// Adjust the client rect so the text has enough room to be drawn
@@ -207,7 +224,7 @@ public override void RenderBefore(RenderContext context)
context.Renderer.RenderStandardContent.DrawContent(context, drawRect,
_contentProvider, _memento,
VisualOrientation.Top,
- State, false, false, true);
+ State, true);
}
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupClusterEdge.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupClusterEdge.cs
index bba6da71e..5653fdc9f 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupClusterEdge.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupClusterEdge.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -30,15 +30,15 @@ internal class ViewDrawRibbonGroupClusterEdge : ViewDrawBorderEdge
///
/// Reference to owning ribbon..
/// Palette source for drawing details.
- public ViewDrawRibbonGroupClusterEdge([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] PaletteBorderEdge palette)
+ public ViewDrawRibbonGroupClusterEdge([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] PaletteBorderEdge? palette)
: base(palette, Orientation.Vertical)
{
Debug.Assert(ribbon != null);
Debug.Assert(palette != null);
- _ribbon = ribbon;
- _palette = palette;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon ));
+ _palette = palette ?? throw new ArgumentNullException(nameof(palette));
}
#endregion
@@ -47,8 +47,13 @@ public ViewDrawRibbonGroupClusterEdge([DisallowNull] KryptonRibbon ribbon,
/// Perform rendering before child elements are rendered.
///
/// Rendering context.
- public override void RenderBefore(RenderContext context)
+ public override void RenderBefore([DisallowNull]RenderContext context)
{
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
// Let base class perform standard drawing first
base.RenderBefore(context);
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupClusterSeparator.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupClusterSeparator.cs
index 77fad61ed..e03d2be23 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupClusterSeparator.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupClusterSeparator.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -31,10 +31,11 @@ internal class ViewDrawRibbonGroupClusterSeparator : ViewLeaf
///
/// Reference to owning ribbon control.
/// Is this is cluster start separator.
- public ViewDrawRibbonGroupClusterSeparator([DisallowNull] KryptonRibbon ribbon, bool start)
+ public ViewDrawRibbonGroupClusterSeparator([DisallowNull] KryptonRibbon? ribbon, bool start)
{
- Debug.Assert(ribbon != null);
- _ribbon = ribbon;
+ Debug.Assert(ribbon is not null);
+
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon ));
_start = start;
_preferredSize = new Size((int)(1 * FactorDpiX), (int)(4 * FactorDpiY));
}
@@ -62,10 +63,10 @@ public override string ToString() =>
/// Layout context.
public override void Layout([DisallowNull] ViewLayoutContext context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
}
#endregion
@@ -74,8 +75,13 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
/// Perform rendering before child elements are rendered.
///
/// Rendering context.
- public override void RenderBefore(RenderContext context)
+ public override void RenderBefore([DisallowNull] RenderContext context)
{
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
Rectangle drawRect = ClientRectangle;
if (_start)
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupColorButton.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupColorButton.cs
index b943d7ff3..3d628959e 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupColorButton.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupColorButton.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -51,18 +51,18 @@ internal class ViewDrawRibbonGroupColorButton : ViewComposite,
/// Reference to owning ribbon control.
/// Reference to source color button definition.
/// Delegate for notifying paint requests.
- public ViewDrawRibbonGroupColorButton([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupColorButton ribbonColorButton,
- [DisallowNull] NeedPaintHandler needPaint)
+ public ViewDrawRibbonGroupColorButton([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupColorButton? ribbonColorButton,
+ [DisallowNull] NeedPaintHandler? needPaint)
{
Debug.Assert(ribbon != null);
Debug.Assert(ribbonColorButton != null);
Debug.Assert(needPaint != null);
// Remember incoming references
- _ribbon = ribbon;
- GroupColorButton = ribbonColorButton;
- _needPaint = needPaint;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon ));
+ GroupColorButton = ribbonColorButton ?? throw new ArgumentNullException(nameof(ribbonColorButton));
+ _needPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
_currentSize = GroupColorButton.ItemSizeCurrent;
// Associate this view with the source component (required for design time selection)
@@ -119,7 +119,7 @@ protected override void Dispose(bool disposing)
///
/// Gets access to the connected color button definition.
///
- public KryptonRibbonGroupColorButton GroupColorButton { get; private set; }
+ public KryptonRibbonGroupColorButton? GroupColorButton { get; private set; }
#endregion
@@ -128,7 +128,7 @@ protected override void Dispose(bool disposing)
/// Gets the first focus item from the item.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetFirstFocusItem()
+ public ViewBase GetFirstFocusItem()
{
// Only take focus if we are visible and enabled
if (GroupColorButton is { Visible: true, Enabled: true })
@@ -137,7 +137,7 @@ protected override void Dispose(bool disposing)
}
else
{
- return null;
+ return null!;
}
}
#endregion
@@ -147,7 +147,7 @@ protected override void Dispose(bool disposing)
/// Gets the last focus item from the item.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetLastFocusItem()
+ public ViewBase GetLastFocusItem()
{
// Only take focus if we are visible and enabled
if (GroupColorButton is { Visible: true, Enabled: true })
@@ -156,7 +156,7 @@ protected override void Dispose(bool disposing)
}
else
{
- return null;
+ return null!;
}
}
#endregion
@@ -168,11 +168,11 @@ protected override void Dispose(bool disposing)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetNextFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetNextFocusItem(ViewBase current, ref bool matched)
{
// Do we match the current item?
matched = (current == _viewLarge) || (current == _viewMediumSmall);
- return null;
+ return null!;
}
#endregion
@@ -183,11 +183,11 @@ protected override void Dispose(bool disposing)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetPreviousFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetPreviousFocusItem(ViewBase current, ref bool matched)
{
// Do we match the current item?
matched = (current == _viewLarge) || (current == _viewMediumSmall);
- return null;
+ return null!;
}
#endregion
@@ -222,8 +222,8 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
break;
}
- keyTipList.Add(new KeyTipInfo(GroupColorButton.Enabled, GroupColorButton.KeyTip,
- screenPt, this[0].ClientRectangle, controller));
+ keyTipList.Add(new KeyTipInfo(GroupColorButton!.Enabled, GroupColorButton.KeyTip,
+ screenPt, this[0]!.ClientRectangle, controller));
}
}
#endregion
@@ -249,9 +249,9 @@ public override Size GetPreferredSize(ViewLayoutContext context)
var drawNonTrackingAreas = _ribbon.RibbonShape is not PaletteRibbonShape.Office2010 or PaletteRibbonShape.VisualStudio2010 or PaletteRibbonShape.Office2013 or PaletteRibbonShape.VisualStudio2010 or PaletteRibbonShape.Microsoft365 or PaletteRibbonShape.VisualStudio;
// Update the views with the type of button being used
- _viewLarge.ButtonType = GroupColorButton.ButtonType;
+ _viewLarge.ButtonType = GroupColorButton!.ButtonType;
_viewLarge.DrawNonTrackingAreas = drawNonTrackingAreas;
- _viewMediumSmall.ButtonType = GroupColorButton.ButtonType;
+ _viewMediumSmall.ButtonType = GroupColorButton!.ButtonType;
_viewMediumSmall.DrawNonTrackingAreas = drawNonTrackingAreas;
// Get the preferred size of button view
@@ -270,7 +270,7 @@ public override Size GetPreferredSize(ViewLayoutContext context)
/// Layout context.
public override void Layout([DisallowNull] ViewLayoutContext context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
// Update our enabled and checked state
UpdateEnabledState();
@@ -278,13 +278,13 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
UpdateDropDownState();
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// Let child elements layout in given space
base.Layout(context);
// For split buttons we need to calculate the split button areas
- if (GroupColorButton.ButtonType == GroupButtonType.Split)
+ if (GroupColorButton!.ButtonType == GroupButtonType.Split)
{
// Find the start positions of the split areas for both views
var largeSplitTop = _viewLargeImage.ClientRectangle.Bottom + 2;
@@ -332,9 +332,9 @@ protected virtual void OnNeedPaint(bool needLayout, Rectangle invalidRect)
private void CreateLargeButtonView()
{
// Create the background and border view
- _viewLarge = new ViewDrawRibbonGroupButtonBackBorder(_ribbon, GroupColorButton,
+ _viewLarge = new ViewDrawRibbonGroupButtonBackBorder(_ribbon, GroupColorButton!,
_ribbon.StateCommon.RibbonGroupButton.PaletteBack,
- _ribbon.StateCommon.RibbonGroupButton.PaletteBorder,
+ _ribbon.StateCommon.RibbonGroupButton.PaletteBorder!,
false, _needPaint)
{
SplitVertical = true
@@ -351,7 +351,7 @@ private void CreateLargeButtonView()
var contentLayout = new ViewLayoutDocker();
// Add the large button at the top
- _viewLargeImage = new ViewDrawRibbonGroupColorButtonImage(_ribbon, GroupColorButton, true);
+ _viewLargeImage = new ViewDrawRibbonGroupColorButtonImage(_ribbon, GroupColorButton!, true);
var largeImagePadding = new ViewLayoutRibbonCenterPadding(_largeImagePadding)
{
_viewLargeImage
@@ -359,12 +359,12 @@ private void CreateLargeButtonView()
contentLayout.Add(largeImagePadding, ViewDockStyle.Top);
// Add the first line of text
- _viewLargeText1 = new ViewDrawRibbonGroupColorButtonText(_ribbon, GroupColorButton, true);
+ _viewLargeText1 = new ViewDrawRibbonGroupColorButtonText(_ribbon, GroupColorButton!, true);
contentLayout.Add(_viewLargeText1, ViewDockStyle.Bottom);
// Add the second line of text
_viewLargeCenter = new ViewLayoutRibbonRowCenter();
- _viewLargeText2 = new ViewDrawRibbonGroupColorButtonText(_ribbon, GroupColorButton, false);
+ _viewLargeText2 = new ViewDrawRibbonGroupColorButtonText(_ribbon, GroupColorButton!, false);
_viewLargeDropArrow = new ViewDrawRibbonDropArrow(_ribbon);
_viewLargeText2Sep1 = new ViewLayoutRibbonSeparator(4, false);
_viewLargeText2Sep2 = new ViewLayoutRibbonSeparator(4, false);
@@ -381,16 +381,16 @@ private void CreateLargeButtonView()
_viewLarge.Add(contentLayout);
// Create controller for intercepting events to determine tool tip handling
- _viewLarge.MouseController = new ToolTipController(_ribbon.TabsArea.ButtonSpecManager.ToolTipManager,
+ _viewLarge.MouseController = new ToolTipController(_ribbon.TabsArea!.ButtonSpecManager!.ToolTipManager!,
_viewLarge, _viewLarge.MouseController);
}
private void CreateMediumSmallButtonView()
{
// Create the background and border view
- _viewMediumSmall = new ViewDrawRibbonGroupButtonBackBorder(_ribbon, GroupColorButton,
+ _viewMediumSmall = new ViewDrawRibbonGroupButtonBackBorder(_ribbon, GroupColorButton!,
_ribbon.StateCommon.RibbonGroupButton.PaletteBack,
- _ribbon.StateCommon.RibbonGroupButton.PaletteBorder,
+ _ribbon.StateCommon.RibbonGroupButton.PaletteBorder!,
false, _needPaint)
{
SplitVertical = false
@@ -407,9 +407,9 @@ private void CreateMediumSmallButtonView()
var contentLayout = new ViewLayoutDocker();
// Create the image and drop down content
- _viewMediumSmallImage = new ViewDrawRibbonGroupColorButtonImage(_ribbon, GroupColorButton, false);
- _viewMediumSmallText1 = new ViewDrawRibbonGroupColorButtonText(_ribbon, GroupColorButton, true);
- _viewMediumSmallText2 = new ViewDrawRibbonGroupColorButtonText(_ribbon, GroupColorButton, false);
+ _viewMediumSmallImage = new ViewDrawRibbonGroupColorButtonImage(_ribbon, GroupColorButton!, false);
+ _viewMediumSmallText1 = new ViewDrawRibbonGroupColorButtonText(_ribbon, GroupColorButton!, true);
+ _viewMediumSmallText2 = new ViewDrawRibbonGroupColorButtonText(_ribbon, GroupColorButton!, false);
_viewMediumSmallDropArrow = new ViewDrawRibbonDropArrow(_ribbon);
_viewMediumSmallText2Sep2 = new ViewLayoutRibbonSeparator(3, false);
_viewMediumSmallText2Sep3 = new ViewLayoutRibbonSeparator(3, false);
@@ -436,7 +436,7 @@ private void CreateMediumSmallButtonView()
_viewMediumSmall.Add(contentLayout);
// Create controller for intercepting events to determine tool tip handling
- _viewMediumSmall.MouseController = new ToolTipController(_ribbon.TabsArea.ButtonSpecManager.ToolTipManager,
+ _viewMediumSmall.MouseController = new ToolTipController(_ribbon.TabsArea!.ButtonSpecManager!.ToolTipManager!,
_viewMediumSmall, _viewMediumSmall.MouseController);
}
@@ -449,13 +449,13 @@ private void DefineRootView(ViewBase view)
Add(view);
// Provide back reference to the button definition
- GroupColorButton.ColorButtonView = view;
+ GroupColorButton!.ColorButtonView = view;
}
private void UpdateEnabledState()
{
// Get the correct enabled state from the button definition
- var buttonEnabled = GroupColorButton.Enabled;
+ var buttonEnabled = GroupColorButton!.Enabled;
if (GroupColorButton.KryptonCommand != null)
{
buttonEnabled = GroupColorButton.KryptonCommand.Enabled;
@@ -483,7 +483,7 @@ private void UpdateCheckedState()
var checkedState = false;
// Only show as checked if also a check type button
- if (GroupColorButton.ButtonType == GroupButtonType.Check)
+ if (GroupColorButton!.ButtonType == GroupButtonType.Check)
{
checkedState = GroupColorButton.KryptonCommand?.Checked ?? GroupColorButton.Checked;
}
@@ -495,7 +495,7 @@ private void UpdateCheckedState()
private void UpdateDropDownState()
{
// Only show the drop down if the button is the correct type
- var dropDown = GroupColorButton.ButtonType is GroupButtonType.DropDown or GroupButtonType.Split;
+ var dropDown = GroupColorButton!.ButtonType is GroupButtonType.DropDown or GroupButtonType.Split;
// Only show text line 2 separators is a drop down is showing with no text
var separators = dropDown && (!string.IsNullOrEmpty(GroupColorButton.TextLine2));
@@ -511,7 +511,7 @@ private void UpdateDropDownState()
_viewMediumSmallText2Sep3.Visible = dropDown;
}
- private void UpdateItemSizeState() => UpdateItemSizeState(GroupColorButton.ItemSizeCurrent);
+ private void UpdateItemSizeState() => UpdateItemSizeState(GroupColorButton!.ItemSizeCurrent);
private void UpdateItemSizeState(GroupItemSize size)
{
@@ -534,17 +534,17 @@ private void UpdateItemSizeState(GroupItemSize size)
}
}
- private void OnLargeButtonClick(object sender, EventArgs e) => GroupColorButton.PerformClick(_viewLarge.FinishDelegate);
+ private void OnLargeButtonClick(object? sender, EventArgs e) => GroupColorButton!.PerformClick(_viewLarge.FinishDelegate);
- private void OnLargeButtonDropDown(object sender, EventArgs e) => GroupColorButton.PerformDropDown(_viewLarge.FinishDelegate);
+ private void OnLargeButtonDropDown(object? sender, EventArgs e) => GroupColorButton!.PerformDropDown(_viewLarge.FinishDelegate);
- private void OnMediumSmallButtonClick(object sender, EventArgs e) => GroupColorButton.PerformClick(_viewMediumSmall.FinishDelegate);
+ private void OnMediumSmallButtonClick(object? sender, EventArgs e) => GroupColorButton!.PerformClick(_viewMediumSmall.FinishDelegate);
- private void OnMediumSmallButtonDropDown(object sender, EventArgs e) => GroupColorButton.PerformDropDown(_viewMediumSmall.FinishDelegate);
+ private void OnMediumSmallButtonDropDown(object? sender, EventArgs e) => GroupColorButton!.PerformDropDown(_viewMediumSmall.FinishDelegate);
- private void OnContextClick(object sender, MouseEventArgs e) => GroupColorButton.OnDesignTimeContextMenu(e);
+ private void OnContextClick(object? sender, MouseEventArgs e) => GroupColorButton!.OnDesignTimeContextMenu(e);
- private void OnButtonPropertyChanged(object sender, PropertyChangedEventArgs e)
+ private void OnButtonPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
var updateLayout = false;
var updatePaint = false;
@@ -613,7 +613,7 @@ private void OnButtonPropertyChanged(object sender, PropertyChangedEventArgs e)
if (updateLayout)
{
// If we are on the currently selected tab then...
- if ((GroupColorButton.RibbonTab != null) &&
+ if ((GroupColorButton!.RibbonTab != null) &&
(_ribbon.SelectedTab == GroupColorButton.RibbonTab))
{
// ...layout so the visible change is made
@@ -624,7 +624,7 @@ private void OnButtonPropertyChanged(object sender, PropertyChangedEventArgs e)
if (updatePaint)
{
// If this button is actually defined as visible...
- if (GroupColorButton.Visible || _ribbon.InDesignMode)
+ if (GroupColorButton!.Visible || _ribbon.InDesignMode)
{
// ...and on the currently selected tab then...
if ((GroupColorButton.RibbonTab != null) &&
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupColorButtonImage.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupColorButtonImage.cs
index 04bb30ec7..d1aba79a2 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupColorButtonImage.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupColorButtonImage.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -25,7 +25,7 @@ internal class ViewDrawRibbonGroupColorButtonImage : ViewDrawRibbonGroupImageBas
private readonly Size _largeSize;//new Size(32, 32);
private readonly KryptonRibbonGroupColorButton _ribbonColorButton;
private readonly bool _large;
- private Image _compositeImage;
+ private Image? _compositeImage;
private Color _selectedColor;
private Color _emptyBorderColor;
private Rectangle _selectedRectSmall;
@@ -39,14 +39,14 @@ internal class ViewDrawRibbonGroupColorButtonImage : ViewDrawRibbonGroupImageBas
/// Reference to owning ribbon control.
/// Reference to ribbon group color button definition.
/// Show the large image.
- public ViewDrawRibbonGroupColorButtonImage(KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupColorButton ribbonColorButton,
+ public ViewDrawRibbonGroupColorButtonImage([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupColorButton? ribbonColorButton,
bool large)
: base(ribbon)
{
- Debug.Assert(ribbonColorButton != null);
+ Debug.Assert(ribbonColorButton is not null);
- _ribbonColorButton = ribbonColorButton;
+ _ribbonColorButton = ribbonColorButton ?? throw new ArgumentNullException(nameof(ribbonColorButton));
_selectedColor = ribbonColorButton.SelectedColor;
_emptyBorderColor = ribbonColorButton.EmptyBorderColor;
_selectedRectSmall = ribbonColorButton.SelectedRectSmall;
@@ -96,7 +96,7 @@ public void SelectedColorRectChanged()
///
/// Gets the image to be drawn.
///
- protected override Image DrawImage
+ protected override Image? DrawImage
{
get
{
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupColorButtonText.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupColorButtonText.cs
index 0721bd5fd..758ca466e 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupColorButtonText.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupColorButtonText.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -24,7 +24,7 @@ internal class ViewDrawRibbonGroupColorButtonText : ViewLeaf,
private readonly KryptonRibbon _ribbon;
private readonly KryptonRibbonGroupColorButton _ribbonColorButton;
private readonly RibbonGroupNormalDisabledTextToContent _contentProvider;
- private IDisposable _memento;
+ private IDisposable? _memento;
private readonly bool _firstText;
private int _heightExtra;
private Size _preferredSize;
@@ -41,15 +41,15 @@ internal class ViewDrawRibbonGroupColorButtonText : ViewLeaf,
/// Source ribbon control.
/// Group color button to display title for.
/// Should show the first button text.
- public ViewDrawRibbonGroupColorButtonText([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupColorButton ribbonColorButton,
+ public ViewDrawRibbonGroupColorButtonText([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupColorButton? ribbonColorButton,
bool firstText)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(ribbonColorButton != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(ribbonColorButton is not null);
- _ribbon = ribbon;
- _ribbonColorButton = ribbonColorButton;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _ribbonColorButton = ribbonColorButton ?? throw new ArgumentNullException(nameof(ribbonColorButton));
_firstText = firstText;
// Use a class to convert from ribbon group to content interface
@@ -103,14 +103,19 @@ public void MakeDirty()
/// Layout context.
public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
// Validate incoming reference
- if (context == null)
+ if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
// A change in state always causes a size and layout calculation
if (_cacheState != State)
{
@@ -124,7 +129,7 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
// Ask the renderer for the contents preferred size
_preferredSize = context.Renderer.RenderStandardContent.GetContentPreferredSize(context, _contentProvider,
this, VisualOrientation.Top,
- State, false, false);
+ State);
// Subtract the extra space used to ensure it draws
_heightExtra = (_ribbon.CalculatedValues.DrawFontHeight - _ribbon.CalculatedValues.RawFontHeight) * 2;
@@ -149,10 +154,20 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
/// Layout context.
public override void Layout([DisallowNull] ViewLayoutContext context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
+
+ if (context is null)
+ {
+ throw new ArgumentNullException(nameof(context));
+ }
+
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// A change in state always causes a size and layout calculation
if (_cacheState != State)
@@ -182,7 +197,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
_memento = context.Renderer.RenderStandardContent.LayoutContent(context, drawRect,
_contentProvider, this,
VisualOrientation.Top,
- PaletteState.Normal, false, false);
+ PaletteState.Normal);
// Cache values that are needed to decide if layout is needed
_displayRect = ClientRectangle;
@@ -196,8 +211,13 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
/// Perform rendering before child elements are rendered.
///
/// Rendering context.
- public override void RenderBefore(RenderContext context)
+ public override void RenderBefore([DisallowNull] RenderContext context)
{
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
Rectangle drawRect = ClientRectangle;
// Adjust the client rect so the text has enough room to be drawn
@@ -210,7 +230,7 @@ public override void RenderBefore(RenderContext context)
context.Renderer.RenderStandardContent.DrawContent(context, drawRect,
_contentProvider, _memento,
VisualOrientation.Top,
- State, false, false, true);
+ State, true);
}
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupComboBox.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupComboBox.cs
index 11877372f..41738557f 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupComboBox.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupComboBox.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -21,11 +21,11 @@ internal class ViewDrawRibbonGroupComboBox : ViewComposite,
IRibbonViewGroupItemView
{
#region Instance Fields
- private readonly int NULL_CONTROL_WIDTH; // = 50;
+ private readonly int _nullControlWidth; // = 50;
private readonly KryptonRibbon _ribbon;
private ViewDrawRibbonGroup? _activeGroup;
private readonly ComboBoxController? _controller;
- private readonly NeedPaintHandler _needPaint;
+ private readonly NeedPaintHandler? _needPaint;
private GroupItemSize _currentSize;
#endregion
@@ -36,18 +36,18 @@ internal class ViewDrawRibbonGroupComboBox : ViewComposite,
/// Reference to owning ribbon control.
/// Reference to source combobox.
/// Delegate for notifying paint requests.
- public ViewDrawRibbonGroupComboBox([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupComboBox ribbonComboBox,
- [DisallowNull] NeedPaintHandler needPaint)
+ public ViewDrawRibbonGroupComboBox([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupComboBox? ribbonComboBox,
+ [DisallowNull] NeedPaintHandler? needPaint)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(ribbonComboBox != null);
- Debug.Assert(needPaint != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(ribbonComboBox is not null);
+ Debug.Assert(needPaint is not null);
// Remember incoming references
- _ribbon = ribbon;
- GroupComboBox = ribbonComboBox;
- _needPaint = needPaint;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ GroupComboBox = ribbonComboBox ?? throw new ArgumentNullException(nameof(ribbonComboBox));
+ _needPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
_currentSize = GroupComboBox.ItemSizeCurrent;
// Hook into the combobox events
@@ -59,7 +59,7 @@ public ViewDrawRibbonGroupComboBox([DisallowNull] KryptonRibbon ribbon,
if (_ribbon.InDesignMode)
{
- // At design time we need to know when the user right clicks the combobox
+ // At design time we need to know when the user right-clicks the combobox
var controller = new ContextClickController();
controller.ContextClick += OnContextClick;
MouseController = controller;
@@ -71,7 +71,7 @@ public ViewDrawRibbonGroupComboBox([DisallowNull] KryptonRibbon ribbon,
KeyController = _controller;
// We need to rest visibility of the combobox for each layout cycle
- _ribbon.ViewRibbonManager.LayoutBefore += OnLayoutAction;
+ _ribbon.ViewRibbonManager!.LayoutBefore += OnLayoutAction;
_ribbon.ViewRibbonManager.LayoutAfter += OnLayoutAction;
// Define back reference to view for the combo box definition
@@ -80,10 +80,14 @@ public ViewDrawRibbonGroupComboBox([DisallowNull] KryptonRibbon ribbon,
// Give paint delegate to combobox so its palette changes are redrawn
GroupComboBox.ViewPaintDelegate = needPaint;
+ // Update all views to reflect current state
+ UpdateEnabled(GroupComboBox.ComboBox);
+ UpdateVisible(GroupComboBox.ComboBox);
+
// Hook into changes in the ribbon custom definition
GroupComboBox.PropertyChanged += OnComboBoxPropertyChanged;
- NULL_CONTROL_WIDTH = (int)(50 * FactorDpiX);
+ _nullControlWidth = (int)(50 * FactorDpiX);
}
///
@@ -109,7 +113,7 @@ protected override void Dispose(bool disposing)
GroupComboBox.MouseLeaveControl -= OnMouseLeaveControl;
GroupComboBox.ViewPaintDelegate = null;
GroupComboBox.PropertyChanged -= OnComboBoxPropertyChanged;
- _ribbon.ViewRibbonManager.LayoutAfter -= OnLayoutAction;
+ _ribbon.ViewRibbonManager!.LayoutAfter -= OnLayoutAction;
_ribbon.ViewRibbonManager.LayoutBefore -= OnLayoutAction;
// Remove association with definition
@@ -138,7 +142,7 @@ protected override void Dispose(bool disposing)
public override void LostFocus(Control c)
{
// Ask ribbon to shift focus to the hidden control
- _ribbon.HideFocus(GroupComboBox.ComboBox);
+ _ribbon.HideFocus(GroupComboBox?.ComboBox);
base.LostFocus(c);
}
#endregion
@@ -148,7 +152,7 @@ public override void LostFocus(Control c)
/// Gets the first focus item from the container.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetFirstFocusItem()
+ public ViewBase GetFirstFocusItem()
{
if (GroupComboBox is { Visible: true, LastComboBox.ComboBox.CanSelect: true })
{
@@ -156,7 +160,7 @@ public override void LostFocus(Control c)
}
else
{
- return null;
+ return null!;
}
}
#endregion
@@ -166,7 +170,7 @@ public override void LostFocus(Control c)
/// Gets the last focus item from the item.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetLastFocusItem()
+ public ViewBase GetLastFocusItem()
{
if (GroupComboBox is { Visible: true, LastComboBox.ComboBox.CanSelect: true })
{
@@ -174,7 +178,7 @@ public override void LostFocus(Control c)
}
else
{
- return null;
+ return null!;
}
}
#endregion
@@ -186,11 +190,11 @@ public override void LostFocus(Control c)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetNextFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetNextFocusItem(ViewBase current, ref bool matched)
{
// Do we match the current item?
matched = current == this;
- return null;
+ return null!;
}
#endregion
@@ -201,11 +205,11 @@ public override void LostFocus(Control c)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetPreviousFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetPreviousFocusItem(ViewBase current, ref bool matched)
{
// Do we match the current item?
matched = current == this;
- return null;
+ return null!;
}
#endregion
@@ -218,7 +222,7 @@ public override void LostFocus(Control c)
public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
{
// Only provide a key tip if we are visible and the target control can accept focus
- if (Visible && LastComboBox.CanFocus)
+ if (Visible && LastComboBox!.CanFocus)
{
// Get the screen location of the button
Rectangle viewRect = _ribbon.KeyTipToScreen(this);
@@ -226,7 +230,7 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
// Determine the screen position of the key tip
var screenPt = Point.Empty;
- // Determine the screen position of the key tip dependant on item location/size
+ // Determine the screen position of the key tip dependent on item location/size
switch (_currentSize)
{
case GroupItemSize.Large:
@@ -238,7 +242,7 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
break;
}
- keyTipList.Add(new KeyTipInfo(GroupComboBox.Enabled,
+ keyTipList.Add(new KeyTipInfo(GroupComboBox!.Enabled,
GroupComboBox.KeyTip,
screenPt,
ClientRectangle,
@@ -257,7 +261,7 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
///
/// Reset the group item size to the item definition.
///
- public void ResetGroupItemSize() => _currentSize = GroupComboBox.ItemSizeCurrent;
+ public void ResetGroupItemSize() => _currentSize = GroupComboBox!.ItemSizeCurrent;
///
/// Discover the preferred size of the element.
@@ -268,7 +272,7 @@ public override Size GetPreferredSize(ViewLayoutContext context)
var preferredSize = Size.Empty;
// Ensure the control has the correct parent
- UpdateParent(context.Control);
+ UpdateParent(context.Control!);
// If there is a combobox associated then ask for its requested size
if (LastComboBox != null)
@@ -283,7 +287,7 @@ public override Size GetPreferredSize(ViewLayoutContext context)
}
else
{
- preferredSize.Width = NULL_CONTROL_WIDTH;
+ preferredSize.Width = _nullControlWidth;
}
preferredSize.Height = _currentSize == GroupItemSize.Large
@@ -302,10 +306,10 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
Debug.Assert(context != null);
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// Are we allowed to change the layout of controls?
- if (!context.ViewManager.DoNotLayoutControls)
+ if (!context.ViewManager!.DoNotLayoutControls)
{
// If we have an actual control, position it with a pixel padding all around
LastComboBox?.SetBounds(ClientLocation.X + 1,
@@ -329,7 +333,7 @@ public override void Render([DisallowNull] RenderContext context)
Debug.Assert(context != null);
// If we do not have a combobox
- if (GroupComboBox.ComboBox == null)
+ if (GroupComboBox?.ComboBox == null)
{
// And we are in design time
if (_ribbon.InDesignMode)
@@ -340,7 +344,7 @@ public override void Render([DisallowNull] RenderContext context)
drawRect.Height--;
// Draw an indication of where the combobox will be
- context.Graphics.FillRectangle(Brushes.Goldenrod, drawRect);
+ context!.Graphics.FillRectangle(Brushes.Goldenrod, drawRect);
context.Graphics.DrawRectangle(Pens.Gold, drawRect);
}
}
@@ -374,9 +378,9 @@ protected virtual void OnNeedPaint(bool needLayout, Rectangle invalidRect)
#endregion
#region Implementation
- private void OnContextClick(object sender, MouseEventArgs e) => GroupComboBox.OnDesignTimeContextMenu(e);
+ private void OnContextClick(object? sender, MouseEventArgs e) => GroupComboBox?.OnDesignTimeContextMenu(e);
- private void OnComboBoxPropertyChanged(object sender, PropertyChangedEventArgs e)
+ private void OnComboBoxPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
var updateLayout = false;
const bool UPDATE_PAINT = false;
@@ -398,7 +402,7 @@ private void OnComboBoxPropertyChanged(object sender, PropertyChangedEventArgs e
if (updateLayout)
{
// If we are on the currently selected tab then...
- if ((GroupComboBox.RibbonTab != null) &&
+ if ((GroupComboBox?.RibbonTab != null) &&
(_ribbon.SelectedTab == GroupComboBox.RibbonTab))
{
// ...layout so the visible change is made
@@ -410,7 +414,7 @@ private void OnComboBoxPropertyChanged(object sender, PropertyChangedEventArgs e
#pragma warning disable 162
{
// If this button is actually defined as visible...
- if (GroupComboBox.Visible || _ribbon.InDesignMode)
+ if (GroupComboBox!.Visible || _ribbon.InDesignMode)
{
// ...and on the currently selected tab then...
if ((GroupComboBox.RibbonTab != null) &&
@@ -427,13 +431,13 @@ private void OnComboBoxPropertyChanged(object sender, PropertyChangedEventArgs e
private Control? LastParentControl
{
get => GroupComboBox?.LastParentControl;
- set => GroupComboBox.LastParentControl = value;
+ set => GroupComboBox!.LastParentControl = value;
}
private KryptonComboBox? LastComboBox
{
get => GroupComboBox?.LastComboBox;
- set => GroupComboBox.LastComboBox = value;
+ set => GroupComboBox!.LastComboBox = value;
}
private void UpdateParent(Control parentControl)
@@ -444,7 +448,7 @@ private void UpdateParent(Control parentControl)
(LastComboBox != GroupComboBox?.ComboBox))
{
// We only modify the parent and visible state if processing for correct container
- if ((GroupComboBox.RibbonContainer.RibbonGroup.ShowingAsPopup && (parentControl is VisualPopupGroup)) ||
+ if ((GroupComboBox!.RibbonContainer!.RibbonGroup!.ShowingAsPopup && (parentControl is VisualPopupGroup)) ||
(!GroupComboBox.RibbonContainer.RibbonGroup.ShowingAsPopup && parentControl is not VisualPopupGroup))
{
// If we have added the custom control to a parent before
@@ -484,10 +488,10 @@ private void UpdateEnabled(Control? c)
if (c != null)
{
// Start with the enabled state of the group element
- var enabled = GroupComboBox.Enabled;
+ var enabled = GroupComboBox!.Enabled;
// If we have an associated designer setup...
- if (!_ribbon.InDesignHelperMode && (GroupComboBox.ComboBoxDesigner != null))
+ if (!_ribbon.InDesignHelperMode && (GroupComboBox?.ComboBoxDesigner != null))
{
// And we are not using the design helpers, then use the design specified value
enabled = GroupComboBox.ComboBoxDesigner.DesignEnabled;
@@ -502,10 +506,10 @@ private bool ActualVisible(Control? c)
if (c != null)
{
// Start with the visible state of the group element
- var visible = GroupComboBox.Visible;
+ var visible = GroupComboBox!.Visible;
// If we have an associated designer setup...
- if (!_ribbon.InDesignHelperMode && (GroupComboBox.ComboBoxDesigner != null))
+ if (!_ribbon.InDesignHelperMode && (GroupComboBox?.ComboBoxDesigner != null))
{
// And we are not using the design helpers, then use the design specified value
visible = GroupComboBox.ComboBoxDesigner.DesignVisible;
@@ -522,10 +526,10 @@ private void UpdateVisible(Control? c)
if (c != null)
{
// Start with the visible state of the group element
- var visible = GroupComboBox.Visible;
+ var visible = GroupComboBox!.Visible;
// If we have an associated designer setup...
- if (!_ribbon.InDesignHelperMode && (GroupComboBox.ComboBoxDesigner != null))
+ if (!_ribbon.InDesignHelperMode && (GroupComboBox?.ComboBoxDesigner != null))
{
// And we are not using the design helpers, then use the design specified value
visible = GroupComboBox.ComboBoxDesigner.DesignVisible;
@@ -534,7 +538,7 @@ private void UpdateVisible(Control? c)
if (visible)
{
// Only visible if on the currently selected page
- if ((GroupComboBox.RibbonTab == null) ||
+ if ((GroupComboBox?.RibbonTab == null) ||
(_ribbon.SelectedTab != GroupComboBox.RibbonTab))
{
visible = false;
@@ -551,7 +555,7 @@ private void UpdateVisible(Control? c)
else
{
// Check that the group is not collapsed
- if (GroupComboBox.RibbonContainer.RibbonGroup.IsCollapsed &&
+ if (GroupComboBox.RibbonContainer!.RibbonGroup!.IsCollapsed &&
((_ribbon.GetControllerControl(GroupComboBox.ComboBox) is KryptonRibbon) ||
(_ribbon.GetControllerControl(GroupComboBox.ComboBox) is VisualPopupMinimized)))
{
@@ -573,7 +577,7 @@ private void UpdateVisible(Control? c)
}
// Move up a level
- container = container.RibbonContainer;
+ container = container.RibbonContainer!;
}
}
}
@@ -584,7 +588,7 @@ private void UpdateVisible(Control? c)
}
}
- private void OnLayoutAction(object sender, EventArgs e)
+ private void OnLayoutAction(object? sender, EventArgs e)
{
// If not disposed then we still have a element reference
if (GroupComboBox != null)
@@ -594,7 +598,7 @@ private void OnLayoutAction(object sender, EventArgs e)
}
}
- private void OnMouseEnterControl(object sender, EventArgs e)
+ private void OnMouseEnterControl(object? sender, EventArgs e)
{
// Reset the active group setting
_activeGroup = null;
@@ -619,17 +623,17 @@ private void OnMouseEnterControl(object sender, EventArgs e)
if (_activeGroup != null)
{
_activeGroup.Tracking = true;
- _needPaint(this, new NeedLayoutEventArgs(false, _activeGroup.ClientRectangle));
+ _needPaint?.Invoke(this, new NeedLayoutEventArgs(false, _activeGroup.ClientRectangle));
}
}
- private void OnMouseLeaveControl(object sender, EventArgs e)
+ private void OnMouseLeaveControl(object? sender, EventArgs e)
{
// If we have a cached group we made active
if (_activeGroup != null)
{
_activeGroup.Tracking = false;
- _needPaint(this, new NeedLayoutEventArgs(false, _activeGroup.ClientRectangle));
+ _needPaint?.Invoke(this, new NeedLayoutEventArgs(false, _activeGroup.ClientRectangle));
_activeGroup = null;
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupCustomControl.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupCustomControl.cs
index 6361a29d0..990a98859 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupCustomControl.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupCustomControl.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -21,9 +21,9 @@ internal class ViewDrawRibbonGroupCustomControl : ViewComposite,
IRibbonViewGroupItemView
{
#region Instance Fields
- private readonly int NULL_CONTROL_WIDTH; // = 50;
+ private readonly int _nullControlWidth; // = 50;
private readonly KryptonRibbon _ribbon;
- private ViewDrawRibbonGroup _activeGroup;
+ private ViewDrawRibbonGroup? _activeGroup;
private readonly CustomControlController? _controller;
private readonly NeedPaintHandler _needPaint;
private GroupItemSize _currentSize;
@@ -36,18 +36,18 @@ internal class ViewDrawRibbonGroupCustomControl : ViewComposite,
/// Reference to owning ribbon control.
/// Reference to source custom definition.
/// Delegate for notifying paint requests.
- public ViewDrawRibbonGroupCustomControl([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupCustomControl ribbonCustom,
- [DisallowNull] NeedPaintHandler needPaint)
+ public ViewDrawRibbonGroupCustomControl([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupCustomControl? ribbonCustom,
+ [DisallowNull] NeedPaintHandler? needPaint)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(ribbonCustom != null);
- Debug.Assert(needPaint != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(ribbonCustom is not null);
+ Debug.Assert(needPaint is not null);
// Remember incoming references
- _ribbon = ribbon;
- GroupCustomControl = ribbonCustom;
- _needPaint = needPaint;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ GroupCustomControl = ribbonCustom ?? throw new ArgumentNullException(nameof(ribbonCustom));
+ _needPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
_currentSize = GroupCustomControl.ItemSizeCurrent;
// Hook into the custom control events
@@ -71,7 +71,7 @@ public ViewDrawRibbonGroupCustomControl([DisallowNull] KryptonRibbon ribbon,
KeyController = _controller;
// We need to rest visibility of the custom control for each layout cycle
- _ribbon.ViewRibbonManager.LayoutBefore += OnLayoutAction;
+ _ribbon.ViewRibbonManager!.LayoutBefore += OnLayoutAction;
_ribbon.ViewRibbonManager.LayoutAfter += OnLayoutAction;
// Provide back reference to the custom control definition
@@ -80,9 +80,13 @@ public ViewDrawRibbonGroupCustomControl([DisallowNull] KryptonRibbon ribbon,
// Give paint delegate to label so its palette changes are redrawn
GroupCustomControl.ViewPaintDelegate = needPaint;
+ // Update all views to reflect current state
+ UpdateEnabled(GroupCustomControl.CustomControl);
+ UpdateVisible(GroupCustomControl.CustomControl);
+
// Hook into changes in the ribbon custom definition
GroupCustomControl.PropertyChanged += OnCustomPropertyChanged;
- NULL_CONTROL_WIDTH = (int)(50 * FactorDpiX);
+ _nullControlWidth = (int)(50 * FactorDpiX);
}
///
@@ -108,11 +112,11 @@ protected override void Dispose(bool disposing)
GroupCustomControl.MouseLeaveControl -= OnMouseLeaveControl;
GroupCustomControl.ViewPaintDelegate = null;
GroupCustomControl.PropertyChanged -= OnCustomPropertyChanged;
- _ribbon.ViewRibbonManager.LayoutAfter -= OnLayoutAction;
+ _ribbon.ViewRibbonManager!.LayoutAfter -= OnLayoutAction;
_ribbon.ViewRibbonManager.LayoutBefore -= OnLayoutAction;
// Remove association with definition
- GroupCustomControl.CustomControlView = null;
+ GroupCustomControl.CustomControlView = null!;
GroupCustomControl = null;
}
}
@@ -125,7 +129,7 @@ protected override void Dispose(bool disposing)
///
/// Gets access to the owning group custom instance.
///
- public KryptonRibbonGroupCustomControl GroupCustomControl { get; private set; }
+ public KryptonRibbonGroupCustomControl? GroupCustomControl { get; private set; }
#endregion
@@ -137,7 +141,7 @@ protected override void Dispose(bool disposing)
public override void LostFocus(Control c)
{
// Ask ribbon to shift focus to the hidden control
- _ribbon.HideFocus(GroupCustomControl.CustomControl);
+ _ribbon.HideFocus(GroupCustomControl!.CustomControl);
base.LostFocus(c);
}
#endregion
@@ -147,7 +151,7 @@ public override void LostFocus(Control c)
/// Gets the first focus item from the container.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetFirstFocusItem()
+ public ViewBase GetFirstFocusItem()
{
if (GroupCustomControl is { Visible: true, LastCustomControl: { CanSelect: true } })
{
@@ -155,7 +159,7 @@ public override void LostFocus(Control c)
}
else
{
- return null;
+ return null!;
}
}
#endregion
@@ -165,7 +169,7 @@ public override void LostFocus(Control c)
/// Gets the last focus item from the item.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetLastFocusItem()
+ public ViewBase GetLastFocusItem()
{
if (GroupCustomControl is { Visible: true, LastCustomControl: { CanSelect: true } })
{
@@ -173,7 +177,7 @@ public override void LostFocus(Control c)
}
else
{
- return null;
+ return null!;
}
}
#endregion
@@ -185,11 +189,11 @@ public override void LostFocus(Control c)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetNextFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetNextFocusItem(ViewBase current, ref bool matched)
{
// Do we match the current item?
matched = current == this;
- return null;
+ return null!;
}
#endregion
@@ -200,11 +204,11 @@ public override void LostFocus(Control c)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetPreviousFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetPreviousFocusItem(ViewBase current, ref bool matched)
{
// Do we match the current item?
matched = current == this;
- return null;
+ return null!;
}
#endregion
@@ -237,7 +241,7 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
break;
}
- keyTipList.Add(new KeyTipInfo(GroupCustomControl.Enabled,
+ keyTipList.Add(new KeyTipInfo(GroupCustomControl!.Enabled,
GroupCustomControl.KeyTip,
screenPt,
ClientRectangle,
@@ -256,7 +260,7 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
///
/// Reset the group item size to the item definition.
///
- public void ResetGroupItemSize() => _currentSize = GroupCustomControl.ItemSizeCurrent;
+ public void ResetGroupItemSize() => _currentSize = GroupCustomControl!.ItemSizeCurrent;
///
/// Discover the preferred size of the element.
@@ -267,7 +271,7 @@ public override Size GetPreferredSize(ViewLayoutContext context)
var preferredSize = Size.Empty;
// Ensure the control has the correct parent
- UpdateParent(context.Control);
+ UpdateParent(context.Control!);
// If there is a custom control associated then ask for its requested size
if (LastCustomControl != null)
@@ -282,7 +286,7 @@ public override Size GetPreferredSize(ViewLayoutContext context)
}
else
{
- preferredSize.Width = NULL_CONTROL_WIDTH;
+ preferredSize.Width = _nullControlWidth;
}
preferredSize.Height = _currentSize == GroupItemSize.Large
@@ -301,10 +305,10 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
Debug.Assert(context != null);
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// Are we allowed to change the layout of controls?
- if (!context.ViewManager.DoNotLayoutControls)
+ if (!context.ViewManager!.DoNotLayoutControls)
{
// If we have an actual control, position it with a pixel padding all around
LastCustomControl?.SetBounds(ClientLocation.X + 1,
@@ -328,7 +332,7 @@ public override void Render([DisallowNull] RenderContext context)
Debug.Assert(context != null);
// If we do not have a custom control
- if (GroupCustomControl.CustomControl == null)
+ if (GroupCustomControl!.CustomControl == null)
{
// And we are in design time
if (_ribbon.InDesignMode)
@@ -339,7 +343,7 @@ public override void Render([DisallowNull] RenderContext context)
drawRect.Height--;
// Draw an indication of where the custom control will be
- context.Graphics.FillRectangle(Brushes.Salmon, drawRect);
+ context!.Graphics.FillRectangle(Brushes.Salmon, drawRect);
context.Graphics.DrawRectangle(Pens.Red, drawRect);
}
}
@@ -373,9 +377,9 @@ protected virtual void OnNeedPaint(bool needLayout, Rectangle invalidRect)
#endregion
#region Implementation
- private void OnContextClick(object sender, MouseEventArgs e) => GroupCustomControl.OnDesignTimeContextMenu(e);
+ private void OnContextClick(object? sender, MouseEventArgs e) => GroupCustomControl!.OnDesignTimeContextMenu(e);
- private void OnCustomPropertyChanged(object sender, PropertyChangedEventArgs e)
+ private void OnCustomPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
var updateLayout = false;
const bool UPDATE_PAINT = false;
@@ -383,10 +387,10 @@ private void OnCustomPropertyChanged(object sender, PropertyChangedEventArgs e)
switch (e.PropertyName)
{
case nameof(Enabled):
- UpdateEnabled(LastCustomControl);
+ UpdateEnabled(LastCustomControl!);
break;
case nameof(Visible):
- UpdateVisible(LastCustomControl);
+ UpdateVisible(LastCustomControl!);
updateLayout = true;
break;
case "CustomControl":
@@ -397,7 +401,7 @@ private void OnCustomPropertyChanged(object sender, PropertyChangedEventArgs e)
if (updateLayout)
{
// If we are on the currently selected tab then...
- if ((GroupCustomControl.RibbonTab != null) &&
+ if ((GroupCustomControl!.RibbonTab != null) &&
(_ribbon.SelectedTab == GroupCustomControl.RibbonTab))
{
// ...layout so the visible change is made
@@ -425,14 +429,14 @@ private void OnCustomPropertyChanged(object sender, PropertyChangedEventArgs e)
private Control LastParentControl
{
- get => GroupCustomControl.LastParentControl;
- set => GroupCustomControl.LastParentControl = value;
+ get => GroupCustomControl!.LastParentControl;
+ set => GroupCustomControl!.LastParentControl = value;
}
private Control? LastCustomControl
{
- get => GroupCustomControl.LastCustomControl;
- set => GroupCustomControl.LastCustomControl = value;
+ get => GroupCustomControl!.LastCustomControl;
+ set => GroupCustomControl!.LastCustomControl = value;
}
private void UpdateParent(Control parentControl)
@@ -440,10 +444,10 @@ private void UpdateParent(Control parentControl)
// Is there a change in the custom control or a change in
// the parent control that is hosting the control...
if ((parentControl != LastParentControl) ||
- (LastCustomControl != GroupCustomControl.CustomControl))
+ (LastCustomControl != GroupCustomControl!.CustomControl))
{
// We only modify the parent and visible state if processing for correct container
- if ((GroupCustomControl.RibbonContainer.RibbonGroup.ShowingAsPopup && (parentControl is VisualPopupGroup)) ||
+ if ((GroupCustomControl!.RibbonContainer!.RibbonGroup!.ShowingAsPopup && (parentControl is VisualPopupGroup)) ||
(!GroupCustomControl.RibbonContainer.RibbonGroup.ShowingAsPopup && parentControl is not VisualPopupGroup))
{
// If we have added the custrom control to a parent before
@@ -478,15 +482,15 @@ private void UpdateParent(Control parentControl)
}
}
- private void UpdateEnabled(Control c)
+ private void UpdateEnabled(Control? c)
{
if (c != null)
{
// Start with the enabled state of the group element
- var enabled = GroupCustomControl.Enabled;
+ var enabled = GroupCustomControl!.Enabled;
// If we have an associated designer setup...
- if (!_ribbon.InDesignHelperMode && (GroupCustomControl.CustomControlDesigner != null))
+ if (!_ribbon.InDesignHelperMode && (GroupCustomControl?.CustomControlDesigner != null))
{
// And we are not using the design helpers, then use the design specified value
enabled = GroupCustomControl.CustomControlDesigner.DesignEnabled;
@@ -496,15 +500,15 @@ private void UpdateEnabled(Control c)
}
}
- private bool ActualVisible(Control c)
+ private bool ActualVisible(Control? c)
{
if (c != null)
{
// Start with the visible state of the group element
- var visible = GroupCustomControl.Visible;
+ var visible = GroupCustomControl!.Visible;
// If we have an associated designer setup...
- if (!_ribbon.InDesignHelperMode && (GroupCustomControl.CustomControlDesigner != null))
+ if (!_ribbon.InDesignHelperMode && (GroupCustomControl?.CustomControlDesigner != null))
{
// And we are not using the design helpers, then use the design specified value
visible = GroupCustomControl.CustomControlDesigner.DesignVisible;
@@ -516,15 +520,15 @@ private bool ActualVisible(Control c)
return false;
}
- private void UpdateVisible(Control c)
+ private void UpdateVisible(Control? c)
{
if (c != null)
{
// Start with the visible state of the group element
- var visible = GroupCustomControl.Visible;
+ var visible = GroupCustomControl!.Visible;
// If we have an associated designer setup...
- if (!_ribbon.InDesignHelperMode && (GroupCustomControl.CustomControlDesigner != null))
+ if (!_ribbon.InDesignHelperMode && (GroupCustomControl?.CustomControlDesigner != null))
{
// And we are not using the design helpers, then use the design specified value
visible = GroupCustomControl.CustomControlDesigner.DesignVisible;
@@ -533,7 +537,7 @@ private void UpdateVisible(Control c)
if (visible)
{
// Only visible if on the currently selected page
- if ((GroupCustomControl.RibbonTab == null) ||
+ if ((GroupCustomControl?.RibbonTab == null) ||
(_ribbon.SelectedTab != GroupCustomControl.RibbonTab))
{
visible = false;
@@ -548,7 +552,7 @@ private void UpdateVisible(Control c)
else
{
// Check that the group is not collapsed
- if (GroupCustomControl.RibbonContainer.RibbonGroup.IsCollapsed &&
+ if (GroupCustomControl.RibbonContainer!.RibbonGroup!.IsCollapsed &&
((_ribbon.GetControllerControl(GroupCustomControl.LastCustomControl) is KryptonRibbon) ||
(_ribbon.GetControllerControl(GroupCustomControl.LastCustomControl) is VisualPopupMinimized)))
{
@@ -570,7 +574,7 @@ private void UpdateVisible(Control c)
}
// Move up a level
- container = container.RibbonContainer;
+ container = container.RibbonContainer!;
}
}
}
@@ -581,27 +585,27 @@ private void UpdateVisible(Control c)
}
}
- private void OnLayoutAction(object sender, EventArgs e)
+ private void OnLayoutAction(object? sender, EventArgs e)
{
// If not disposed then we still have a element reference
if (GroupCustomControl != null)
{
// Change in selected tab requires a retest of the control visibility/enabled
- UpdateVisible(LastCustomControl);
- UpdateEnabled(LastCustomControl);
+ UpdateVisible(LastCustomControl!);
+ UpdateEnabled(LastCustomControl!);
}
}
- private void OnMouseEnterControl(object sender, EventArgs e)
+ private void OnMouseEnterControl(object? sender, EventArgs e)
{
// Reset the active group setting
_activeGroup = null;
// Find the parent group instance
- ViewBase parent = Parent;
+ ViewBase? parent = Parent;
// Keep going till we get to the top or find a group
- while (parent != null)
+ while (parent is not null)
{
if (parent is ViewDrawRibbonGroup popGroup)
{
@@ -621,7 +625,7 @@ private void OnMouseEnterControl(object sender, EventArgs e)
}
}
- private void OnMouseLeaveControl(object sender, EventArgs e)
+ private void OnMouseLeaveControl(object? sender, EventArgs e)
{
// If we have a cached group we made active
if (_activeGroup != null)
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupDateTimePicker.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupDateTimePicker.cs
index ff670285a..a28922056 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupDateTimePicker.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupDateTimePicker.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -21,9 +21,9 @@ internal class ViewDrawRibbonGroupDateTimePicker : ViewComposite,
IRibbonViewGroupItemView
{
#region Instance Fields
- private readonly int NULL_CONTROL_WIDTH; // = 50;
+ private readonly int _nullControlWidth; // = 50;
private readonly KryptonRibbon _ribbon;
- private ViewDrawRibbonGroup _activeGroup;
+ private ViewDrawRibbonGroup? _activeGroup;
private readonly DateTimePickerController? _controller;
private readonly NeedPaintHandler _needPaint;
private GroupItemSize _currentSize;
@@ -36,18 +36,18 @@ internal class ViewDrawRibbonGroupDateTimePicker : ViewComposite,
/// Reference to owning ribbon control.
/// Reference to source date time picker.
/// Delegate for notifying paint requests.
- public ViewDrawRibbonGroupDateTimePicker([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupDateTimePicker ribbonDateTimePicker,
- [DisallowNull] NeedPaintHandler needPaint)
+ public ViewDrawRibbonGroupDateTimePicker([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupDateTimePicker? ribbonDateTimePicker,
+ [DisallowNull] NeedPaintHandler? needPaint)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(ribbonDateTimePicker != null);
- Debug.Assert(needPaint != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(ribbonDateTimePicker is not null);
+ Debug.Assert(needPaint is not null);
// Remember incoming references
- _ribbon = ribbon;
- GroupDateTimePicker = ribbonDateTimePicker;
- _needPaint = needPaint;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ GroupDateTimePicker = ribbonDateTimePicker ?? throw new (nameof(ribbonDateTimePicker));
+ _needPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
_currentSize = GroupDateTimePicker.ItemSizeCurrent;
// Hook into the date time picker events
@@ -71,7 +71,7 @@ public ViewDrawRibbonGroupDateTimePicker([DisallowNull] KryptonRibbon ribbon,
KeyController = _controller;
// We need to rest visibility of the date time picker for each layout cycle
- _ribbon.ViewRibbonManager.LayoutBefore += OnLayoutAction;
+ _ribbon.ViewRibbonManager!.LayoutBefore += OnLayoutAction;
_ribbon.ViewRibbonManager.LayoutAfter += OnLayoutAction;
// Define back reference to view for the text box definition
@@ -80,9 +80,13 @@ public ViewDrawRibbonGroupDateTimePicker([DisallowNull] KryptonRibbon ribbon,
// Give paint delegate to date time picker so its palette changes are redrawn
GroupDateTimePicker.ViewPaintDelegate = needPaint;
+ // Update all views to reflect current state
+ UpdateEnabled(GroupDateTimePicker.DateTimePicker);
+ UpdateVisible(GroupDateTimePicker.DateTimePicker);
+
// Hook into changes in the ribbon custom definition
GroupDateTimePicker.PropertyChanged += OnDateTimePickerPropertyChanged;
- NULL_CONTROL_WIDTH = (int)(50 * FactorDpiX);
+ _nullControlWidth = (int)(50 * FactorDpiX);
}
///
@@ -101,18 +105,18 @@ protected override void Dispose(bool disposing)
{
if (disposing)
{
- if (GroupDateTimePicker != null)
+ if (GroupDateTimePicker is not null)
{
// Must unhook to prevent memory leaks
GroupDateTimePicker.MouseEnterControl -= OnMouseEnterControl;
GroupDateTimePicker.MouseLeaveControl -= OnMouseLeaveControl;
GroupDateTimePicker.ViewPaintDelegate = null;
GroupDateTimePicker.PropertyChanged -= OnDateTimePickerPropertyChanged;
- _ribbon.ViewRibbonManager.LayoutAfter -= OnLayoutAction;
+ _ribbon.ViewRibbonManager!.LayoutAfter -= OnLayoutAction;
_ribbon.ViewRibbonManager.LayoutBefore -= OnLayoutAction;
// Remove association with definition
- GroupDateTimePicker.DateTimePickerView = null;
+ GroupDateTimePicker.DateTimePickerView = null!;
GroupDateTimePicker = null;
}
}
@@ -125,7 +129,7 @@ protected override void Dispose(bool disposing)
///
/// Gets access to the owning group date time picker instance.
///
- public KryptonRibbonGroupDateTimePicker GroupDateTimePicker { get; private set; }
+ public KryptonRibbonGroupDateTimePicker? GroupDateTimePicker { get; private set; }
#endregion
@@ -137,7 +141,7 @@ protected override void Dispose(bool disposing)
public override void LostFocus(Control c)
{
// Ask ribbon to shift focus to the hidden control
- _ribbon.HideFocus(GroupDateTimePicker.DateTimePicker);
+ _ribbon.HideFocus(GroupDateTimePicker!.DateTimePicker);
base.LostFocus(c);
}
#endregion
@@ -147,7 +151,7 @@ public override void LostFocus(Control c)
/// Gets the first focus item from the container.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetFirstFocusItem()
+ public ViewBase GetFirstFocusItem()
{
if (GroupDateTimePicker is { Visible: true, LastDateTimePicker: { CanSelect: true } })
{
@@ -155,7 +159,7 @@ public override void LostFocus(Control c)
}
else
{
- return null;
+ return null!;
}
}
#endregion
@@ -165,7 +169,7 @@ public override void LostFocus(Control c)
/// Gets the last focus item from the item.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetLastFocusItem()
+ public ViewBase GetLastFocusItem()
{
if (GroupDateTimePicker is { Visible: true, LastDateTimePicker: { CanSelect: true } })
{
@@ -173,7 +177,7 @@ public override void LostFocus(Control c)
}
else
{
- return null;
+ return null!;
}
}
#endregion
@@ -185,11 +189,11 @@ public override void LostFocus(Control c)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetNextFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetNextFocusItem(ViewBase current, ref bool matched)
{
// Do we match the current item?
matched = current == this;
- return null;
+ return null!;
}
#endregion
@@ -200,11 +204,11 @@ public override void LostFocus(Control c)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetPreviousFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetPreviousFocusItem(ViewBase current, ref bool matched)
{
// Do we match the current item?
matched = current == this;
- return null;
+ return null!;
}
#endregion
@@ -217,7 +221,7 @@ public override void LostFocus(Control c)
public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
{
// Only provide a key tip if we are visible and the target control can accept focus
- if (Visible && LastDateTimePicker.CanFocus)
+ if (Visible && LastDateTimePicker!.CanFocus)
{
// Get the screen location of the button
Rectangle viewRect = _ribbon.KeyTipToScreen(this);
@@ -237,7 +241,7 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
break;
}
- keyTipList.Add(new KeyTipInfo(GroupDateTimePicker.Enabled,
+ keyTipList.Add(new KeyTipInfo(GroupDateTimePicker!.Enabled,
GroupDateTimePicker.KeyTip,
screenPt,
ClientRectangle,
@@ -256,7 +260,7 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
///
/// Reset the group item size to the item definition.
///
- public void ResetGroupItemSize() => _currentSize = GroupDateTimePicker.ItemSizeCurrent;
+ public void ResetGroupItemSize() => _currentSize = GroupDateTimePicker!.ItemSizeCurrent;
///
/// Discover the preferred size of the element.
@@ -267,7 +271,7 @@ public override Size GetPreferredSize(ViewLayoutContext context)
var preferredSize = Size.Empty;
// Ensure the control has the correct parent
- UpdateParent(context.Control);
+ UpdateParent(context.Control!);
// If there is a date time picker associated then ask for its requested size
if (LastDateTimePicker != null)
@@ -282,7 +286,7 @@ public override Size GetPreferredSize(ViewLayoutContext context)
}
else
{
- preferredSize.Width = NULL_CONTROL_WIDTH;
+ preferredSize.Width = _nullControlWidth;
}
preferredSize.Height = _currentSize == GroupItemSize.Large
@@ -301,10 +305,10 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
Debug.Assert(context != null);
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// Are we allowed to change the layout of controls?
- if (!context.ViewManager.DoNotLayoutControls)
+ if (!context.ViewManager!.DoNotLayoutControls)
{
// If we have an actual control, position it with a pixel padding all around
LastDateTimePicker?.SetBounds(ClientLocation.X + 1,
@@ -328,7 +332,7 @@ public override void Render([DisallowNull] RenderContext context)
Debug.Assert(context != null);
// If we do not have a date time picker
- if (GroupDateTimePicker.DateTimePicker == null)
+ if (GroupDateTimePicker!.DateTimePicker == null)
{
// And we are in design time
if (_ribbon.InDesignMode)
@@ -339,7 +343,7 @@ public override void Render([DisallowNull] RenderContext context)
drawRect.Height--;
// Draw an indication of where the date time picker will be
- context.Graphics.FillRectangle(Brushes.Goldenrod, drawRect);
+ context!.Graphics.FillRectangle(Brushes.Goldenrod, drawRect);
context.Graphics.DrawRectangle(Pens.Gold, drawRect);
}
}
@@ -373,9 +377,9 @@ protected virtual void OnNeedPaint(bool needLayout, Rectangle invalidRect)
#endregion
#region Implementation
- private void OnContextClick(object sender, MouseEventArgs e) => GroupDateTimePicker.OnDesignTimeContextMenu(e);
+ private void OnContextClick(object? sender, MouseEventArgs e) => GroupDateTimePicker!.OnDesignTimeContextMenu(e);
- private void OnDateTimePickerPropertyChanged(object sender, PropertyChangedEventArgs e)
+ private void OnDateTimePickerPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
var updateLayout = false;
const bool UPDATE_PAINT = false;
@@ -383,10 +387,10 @@ private void OnDateTimePickerPropertyChanged(object sender, PropertyChangedEvent
switch (e.PropertyName)
{
case nameof(Enabled):
- UpdateEnabled(LastDateTimePicker);
+ UpdateEnabled(LastDateTimePicker!);
break;
case nameof(Visible):
- UpdateVisible(LastDateTimePicker);
+ UpdateVisible(LastDateTimePicker!);
updateLayout = true;
break;
case "CustomControl":
@@ -397,8 +401,8 @@ private void OnDateTimePickerPropertyChanged(object sender, PropertyChangedEvent
if (updateLayout)
{
// If we are on the currently selected tab then...
- if ((GroupDateTimePicker.RibbonTab != null) &&
- (_ribbon.SelectedTab == GroupDateTimePicker.RibbonTab))
+ if ((GroupDateTimePicker!.RibbonTab != null) &&
+ (_ribbon.SelectedTab == GroupDateTimePicker!.RibbonTab))
{
// ...layout so the visible change is made
OnNeedPaint(true);
@@ -425,14 +429,14 @@ private void OnDateTimePickerPropertyChanged(object sender, PropertyChangedEvent
private Control LastParentControl
{
- get => GroupDateTimePicker.LastParentControl;
- set => GroupDateTimePicker.LastParentControl = value;
+ get => GroupDateTimePicker!.LastParentControl;
+ set => GroupDateTimePicker!.LastParentControl = value;
}
private KryptonDateTimePicker? LastDateTimePicker
{
- get => GroupDateTimePicker.LastDateTimePicker;
- set => GroupDateTimePicker.LastDateTimePicker = value;
+ get => GroupDateTimePicker!.LastDateTimePicker;
+ set => GroupDateTimePicker!.LastDateTimePicker = value;
}
private void UpdateParent(Control parentControl)
@@ -440,10 +444,10 @@ private void UpdateParent(Control parentControl)
// Is there a change in the date time picker or a change in
// the parent control that is hosting the control...
if ((parentControl != LastParentControl) ||
- (LastDateTimePicker != GroupDateTimePicker.DateTimePicker))
+ (LastDateTimePicker != GroupDateTimePicker!.DateTimePicker))
{
// We only modify the parent and visible state if processing for correct container
- if ((GroupDateTimePicker.RibbonContainer.RibbonGroup.ShowingAsPopup && (parentControl is VisualPopupGroup)) ||
+ if ((GroupDateTimePicker!.RibbonContainer!.RibbonGroup!.ShowingAsPopup && (parentControl is VisualPopupGroup)) ||
(!GroupDateTimePicker.RibbonContainer.RibbonGroup.ShowingAsPopup && parentControl is not VisualPopupGroup))
{
// If we have added the custrom control to a parent before
@@ -477,15 +481,15 @@ private void UpdateParent(Control parentControl)
}
}
- private void UpdateEnabled(Control c)
+ private void UpdateEnabled(Control? c)
{
if (c != null)
{
// Start with the enabled state of the group element
- var enabled = GroupDateTimePicker.Enabled;
+ var enabled = GroupDateTimePicker!.Enabled;
// If we have an associated designer setup...
- if (!_ribbon.InDesignHelperMode && (GroupDateTimePicker.DateTimePickerDesigner != null))
+ if (!_ribbon.InDesignHelperMode && (GroupDateTimePicker?.DateTimePickerDesigner != null))
{
// And we are not using the design helpers, then use the design specified value
enabled = GroupDateTimePicker.DateTimePickerDesigner.DesignEnabled;
@@ -495,15 +499,15 @@ private void UpdateEnabled(Control c)
}
}
- private bool ActualVisible(Control c)
+ private bool ActualVisible(Control? c)
{
if (c != null)
{
// Start with the visible state of the group element
- var visible = GroupDateTimePicker.Visible;
+ var visible = GroupDateTimePicker!.Visible;
// If we have an associated designer setup...
- if (!_ribbon.InDesignHelperMode && (GroupDateTimePicker.DateTimePickerDesigner != null))
+ if (!_ribbon.InDesignHelperMode && (GroupDateTimePicker?.DateTimePickerDesigner != null))
{
// And we are not using the design helpers, then use the design specified value
visible = GroupDateTimePicker.DateTimePickerDesigner.DesignVisible;
@@ -520,7 +524,7 @@ private void UpdateVisible(Control c)
if (c != null)
{
// Start with the visible state of the group element
- var visible = GroupDateTimePicker.Visible;
+ var visible = GroupDateTimePicker!.Visible;
// If we have an associated designer setup...
if (!_ribbon.InDesignHelperMode && (GroupDateTimePicker.DateTimePickerDesigner != null))
@@ -547,7 +551,7 @@ private void UpdateVisible(Control c)
else
{
// Check that the group is not collapsed
- if (GroupDateTimePicker.RibbonContainer.RibbonGroup.IsCollapsed &&
+ if (GroupDateTimePicker.RibbonContainer!.RibbonGroup!.IsCollapsed &&
((_ribbon.GetControllerControl(GroupDateTimePicker.DateTimePicker) is KryptonRibbon) ||
(_ribbon.GetControllerControl(GroupDateTimePicker.DateTimePicker) is VisualPopupMinimized)))
{
@@ -569,7 +573,7 @@ private void UpdateVisible(Control c)
}
// Move up a level
- container = container.RibbonContainer;
+ container = container.RibbonContainer!;
}
}
}
@@ -580,26 +584,26 @@ private void UpdateVisible(Control c)
}
}
- private void OnLayoutAction(object sender, EventArgs e)
+ private void OnLayoutAction(object? sender, EventArgs e)
{
// If not disposed then we still have a element reference
if (GroupDateTimePicker != null)
{
// Change in selected tab requires a retest of the control visibility
- UpdateVisible(LastDateTimePicker);
+ UpdateVisible(LastDateTimePicker!);
}
}
- private void OnMouseEnterControl(object sender, EventArgs e)
+ private void OnMouseEnterControl(object? sender, EventArgs e)
{
// Reset the active group setting
_activeGroup = null;
// Find the parent group instance
- ViewBase parent = Parent;
+ ViewBase? parent = Parent;
// Keep going till we get to the top or find a group
- while (parent != null)
+ while (parent is not null)
{
if (parent is ViewDrawRibbonGroup popGroup)
{
@@ -619,7 +623,7 @@ private void OnMouseEnterControl(object sender, EventArgs e)
}
}
- private void OnMouseLeaveControl(object sender, EventArgs e)
+ private void OnMouseLeaveControl(object? sender, EventArgs e)
{
// If we have a cached group we made active
if (_activeGroup != null)
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupDialogButton.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupDialogButton.cs
index 25a1a3dcc..53c296e0f 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupDialogButton.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupDialogButton.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -36,19 +36,19 @@ internal class ViewDrawRibbonGroupDialogButton : ViewLeaf
/// Reference to owning ribbon control.
/// Reference to ribbon group this represents.
/// Delegate for notifying paint requests.
- public ViewDrawRibbonGroupDialogButton([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroup ribbonGroup,
- NeedPaintHandler needPaint)
+ public ViewDrawRibbonGroupDialogButton([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroup? ribbonGroup,
+ NeedPaintHandler? needPaint)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(ribbonGroup != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(ribbonGroup is not null);
// Remember incoming references
- _ribbon = ribbon;
- _ribbonGroup = ribbonGroup;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _ribbonGroup = ribbonGroup ?? throw new ArgumentNullException(nameof(ribbonGroup));
// Attach a controller to this element for the pressing of the button
- var controller = new DialogLauncherButtonController(ribbon, this, needPaint);
+ var controller = new DialogLauncherButtonController(ribbon, this, needPaint!);
controller.Click += OnClick;
MouseController = controller;
SourceController = controller;
@@ -110,7 +110,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
Debug.Assert(context != null);
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
}
#endregion
@@ -119,10 +119,15 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
/// Perform rendering before child elements are rendered.
///
/// Rendering context.
- public override void RenderBefore(RenderContext context)
+ public override void RenderBefore([DisallowNull] RenderContext context)
{
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
IPaletteBack paletteBack = _ribbon.StateCommon.RibbonGroupDialogButton.PaletteBack;
- IPaletteBorder paletteBorder = _ribbon.StateCommon.RibbonGroupDialogButton.PaletteBorder;
+ IPaletteBorder paletteBorder = _ribbon.StateCommon.RibbonGroupDialogButton.PaletteBorder!;
IPaletteRibbonGeneral paletteGeneral = _ribbon.StateCommon.RibbonGeneral;
// Do we need to draw the background?
@@ -136,6 +141,7 @@ public override void RenderBefore(RenderContext context)
Rectangle enclosingRect = CommonHelper.ApplyPadding(VisualOrientation.Top, ClientRectangle, borderPadding);
// Render the background inside the border path
+ using var gh = new GraphicsHint(context.Graphics, paletteBorder.GetBorderGraphicsHint(PaletteState.Normal));
_mementoBack = context.Renderer.RenderStandardBack.DrawBack(context, enclosingRect, borderPath,
paletteBack, VisualOrientation.Top,
State, _mementoBack);
@@ -158,7 +164,7 @@ public override void RenderBefore(RenderContext context)
#endregion
#region Implementation
- private void OnClick(object sender, MouseEventArgs e)
+ private void OnClick(object? sender, MouseEventArgs e)
{
// We do not operate the dialog launcher at design time
if (!_ribbon.InDesignMode)
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupDomainUpDown.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupDomainUpDown.cs
index cf74ad162..8af75b9af 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupDomainUpDown.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupDomainUpDown.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -21,10 +21,10 @@ internal class ViewDrawRibbonGroupDomainUpDown : ViewComposite,
IRibbonViewGroupItemView
{
#region Instance Fields
- private readonly int NULL_CONTROL_WIDTH; // = 50;
+ private readonly int _nullControlWidth; // = 50;
private readonly KryptonRibbon _ribbon;
- private ViewDrawRibbonGroup _activeGroup;
- private readonly DomainUpDownController? _controller;
+ private ViewDrawRibbonGroup? _activeGroup;
+ private readonly DomainUpDownController _controller;
private readonly NeedPaintHandler _needPaint;
private GroupItemSize _currentSize;
#endregion
@@ -36,18 +36,18 @@ internal class ViewDrawRibbonGroupDomainUpDown : ViewComposite,
/// Reference to owning ribbon control.
/// Reference to source domain up-down.
/// Delegate for notifying paint requests.
- public ViewDrawRibbonGroupDomainUpDown([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupDomainUpDown ribbonDomainUpDown,
- [DisallowNull] NeedPaintHandler needPaint)
+ public ViewDrawRibbonGroupDomainUpDown([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupDomainUpDown? ribbonDomainUpDown,
+ [DisallowNull] NeedPaintHandler? needPaint)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(ribbonDomainUpDown != null);
- Debug.Assert(needPaint != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(ribbonDomainUpDown is not null);
+ Debug.Assert(needPaint is not null);
// Remember incoming references
- _ribbon = ribbon;
- GroupDomainUpDown = ribbonDomainUpDown;
- _needPaint = needPaint;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ GroupDomainUpDown = ribbonDomainUpDown ?? throw new ArgumentNullException(nameof(ribbonDomainUpDown));
+ _needPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
_currentSize = GroupDomainUpDown.ItemSizeCurrent;
// Hook into the domain up-down events
@@ -71,7 +71,7 @@ public ViewDrawRibbonGroupDomainUpDown([DisallowNull] KryptonRibbon ribbon,
KeyController = _controller;
// We need to rest visibility of the domain up-down for each layout cycle
- _ribbon.ViewRibbonManager.LayoutBefore += OnLayoutAction;
+ _ribbon.ViewRibbonManager!.LayoutBefore += OnLayoutAction;
_ribbon.ViewRibbonManager.LayoutAfter += OnLayoutAction;
// Define back reference to view for the domain up-down definition
@@ -80,9 +80,13 @@ public ViewDrawRibbonGroupDomainUpDown([DisallowNull] KryptonRibbon ribbon,
// Give paint delegate to domain up-down so its palette changes are redrawn
GroupDomainUpDown.ViewPaintDelegate = needPaint;
+ // Update all views to reflect current state
+ UpdateEnabled(GroupDomainUpDown.DomainUpDown);
+ UpdateVisible(GroupDomainUpDown.DomainUpDown);
+
// Hook into changes in the ribbon custom definition
GroupDomainUpDown.PropertyChanged += OnDomainUpDownPropertyChanged;
- NULL_CONTROL_WIDTH = (int)(50 * FactorDpiX);
+ _nullControlWidth = (int)(50 * FactorDpiX);
}
///
@@ -108,7 +112,7 @@ protected override void Dispose(bool disposing)
GroupDomainUpDown.MouseLeaveControl -= OnMouseLeaveControl;
GroupDomainUpDown.ViewPaintDelegate = null;
GroupDomainUpDown.PropertyChanged -= OnDomainUpDownPropertyChanged;
- _ribbon.ViewRibbonManager.LayoutAfter -= OnLayoutAction;
+ _ribbon.ViewRibbonManager!.LayoutAfter -= OnLayoutAction;
_ribbon.ViewRibbonManager.LayoutBefore -= OnLayoutAction;
// Remove association with definition
@@ -125,7 +129,7 @@ protected override void Dispose(bool disposing)
///
/// Gets access to the owning group domain up-down instance.
///
- public KryptonRibbonGroupDomainUpDown GroupDomainUpDown { get; private set; }
+ public KryptonRibbonGroupDomainUpDown? GroupDomainUpDown { get; private set; }
#endregion
@@ -137,7 +141,7 @@ protected override void Dispose(bool disposing)
public override void LostFocus(Control c)
{
// Ask ribbon to shift focus to the hidden control
- _ribbon.HideFocus(GroupDomainUpDown.DomainUpDown);
+ _ribbon.HideFocus(GroupDomainUpDown!.DomainUpDown);
base.LostFocus(c);
}
#endregion
@@ -147,7 +151,7 @@ public override void LostFocus(Control c)
/// Gets the first focus item from the container.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetFirstFocusItem()
+ public ViewBase GetFirstFocusItem()
{
if (GroupDomainUpDown is { Visible: true, LastDomainUpDown.DomainUpDown.CanSelect: true })
{
@@ -155,7 +159,7 @@ public override void LostFocus(Control c)
}
else
{
- return null;
+ return null!;
}
}
#endregion
@@ -165,9 +169,9 @@ public override void LostFocus(Control c)
/// Gets the last focus item from the item.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetLastFocusItem() => GroupDomainUpDown is { Visible: true, LastDomainUpDown.DomainUpDown.CanSelect: true }
+ public ViewBase GetLastFocusItem() => GroupDomainUpDown is { Visible: true, LastDomainUpDown.DomainUpDown.CanSelect: true }
? this
- : null;
+ : null!;
#endregion
#region GetNextFocusItem
@@ -177,11 +181,11 @@ public override void LostFocus(Control c)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetNextFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetNextFocusItem(ViewBase current, ref bool matched)
{
// Do we match the current item?
matched = current == this;
- return null;
+ return null!;
}
#endregion
@@ -192,11 +196,11 @@ public override void LostFocus(Control c)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetPreviousFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetPreviousFocusItem(ViewBase current, ref bool matched)
{
// Do we match the current item?
matched = current == this;
- return null;
+ return null!;
}
#endregion
@@ -209,7 +213,7 @@ public override void LostFocus(Control c)
public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
{
// Only provide a key tip if we are visible and the target control can accept focus
- if (Visible && LastDomainUpDown.CanFocus)
+ if (Visible && LastDomainUpDown!.CanFocus)
{
// Get the screen location of the button
Rectangle viewRect = _ribbon.KeyTipToScreen(this);
@@ -229,7 +233,7 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
break;
}
- keyTipList.Add(new KeyTipInfo(GroupDomainUpDown.Enabled,
+ keyTipList.Add(new KeyTipInfo(GroupDomainUpDown!.Enabled,
GroupDomainUpDown.KeyTip,
screenPt,
ClientRectangle,
@@ -248,7 +252,7 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
///
/// Reset the group item size to the item definition.
///
- public void ResetGroupItemSize() => _currentSize = GroupDomainUpDown.ItemSizeCurrent;
+ public void ResetGroupItemSize() => _currentSize = GroupDomainUpDown!.ItemSizeCurrent;
///
/// Discover the preferred size of the element.
@@ -259,7 +263,7 @@ public override Size GetPreferredSize(ViewLayoutContext context)
var preferredSize = Size.Empty;
// Ensure the control has the correct parent
- UpdateParent(context.Control);
+ UpdateParent(context.Control!);
// If there is a domain up-down associated then ask for its requested size
if (LastDomainUpDown != null)
@@ -274,7 +278,7 @@ public override Size GetPreferredSize(ViewLayoutContext context)
}
else
{
- preferredSize.Width = NULL_CONTROL_WIDTH;
+ preferredSize.Width = _nullControlWidth;
}
preferredSize.Height = _currentSize == GroupItemSize.Large
@@ -293,10 +297,10 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
Debug.Assert(context != null);
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// Are we allowed to change the layout of controls?
- if (!context.ViewManager.DoNotLayoutControls)
+ if (!context.ViewManager!.DoNotLayoutControls)
{
// If we have an actual control, position it with a pixel padding all around
LastDomainUpDown?.SetBounds(ClientLocation.X + 1,
@@ -320,7 +324,7 @@ public override void Render([DisallowNull] RenderContext context)
Debug.Assert(context != null);
// If we do not have a domain up-down
- if (GroupDomainUpDown.DomainUpDown == null)
+ if (GroupDomainUpDown!.DomainUpDown == null)
{
// And we are in design time
if (_ribbon.InDesignMode)
@@ -331,7 +335,7 @@ public override void Render([DisallowNull] RenderContext context)
drawRect.Height--;
// Draw an indication of where the domain up-down will be
- context.Graphics.FillRectangle(Brushes.Goldenrod, drawRect);
+ context!.Graphics.FillRectangle(Brushes.Goldenrod, drawRect);
context.Graphics.DrawRectangle(Pens.Gold, drawRect);
}
}
@@ -365,9 +369,9 @@ protected virtual void OnNeedPaint(bool needLayout, Rectangle invalidRect)
#endregion
#region Implementation
- private void OnContextClick(object sender, MouseEventArgs e) => GroupDomainUpDown.OnDesignTimeContextMenu(e);
+ private void OnContextClick(object? sender, MouseEventArgs e) => GroupDomainUpDown!.OnDesignTimeContextMenu(e);
- private void OnDomainUpDownPropertyChanged(object sender, PropertyChangedEventArgs e)
+ private void OnDomainUpDownPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
var updateLayout = false;
const bool UPDATE_PAINT = false;
@@ -375,10 +379,10 @@ private void OnDomainUpDownPropertyChanged(object sender, PropertyChangedEventAr
switch (e.PropertyName)
{
case nameof(Enabled):
- UpdateEnabled(LastDomainUpDown);
+ UpdateEnabled(LastDomainUpDown!);
break;
case nameof(Visible):
- UpdateVisible(LastDomainUpDown);
+ UpdateVisible(LastDomainUpDown!);
updateLayout = true;
break;
case "CustomControl":
@@ -389,7 +393,7 @@ private void OnDomainUpDownPropertyChanged(object sender, PropertyChangedEventAr
if (updateLayout)
{
// If we are on the currently selected tab then...
- if ((GroupDomainUpDown.RibbonTab != null) &&
+ if ((GroupDomainUpDown!.RibbonTab != null) &&
(_ribbon.SelectedTab == GroupDomainUpDown.RibbonTab))
{
// ...layout so the visible change is made
@@ -417,14 +421,14 @@ private void OnDomainUpDownPropertyChanged(object sender, PropertyChangedEventAr
private Control LastParentControl
{
- get => GroupDomainUpDown.LastParentControl;
- set => GroupDomainUpDown.LastParentControl = value;
+ get => GroupDomainUpDown!.LastParentControl;
+ set => GroupDomainUpDown!.LastParentControl = value;
}
private KryptonDomainUpDown? LastDomainUpDown
{
- get => GroupDomainUpDown.LastDomainUpDown;
- set => GroupDomainUpDown.LastDomainUpDown = value;
+ get => GroupDomainUpDown!.LastDomainUpDown;
+ set => GroupDomainUpDown!.LastDomainUpDown = value;
}
private void UpdateParent(Control parentControl)
@@ -432,10 +436,10 @@ private void UpdateParent(Control parentControl)
// Is there a change in the domain up-down or a change in
// the parent control that is hosting the control...
if ((parentControl != LastParentControl) ||
- (LastDomainUpDown != GroupDomainUpDown.DomainUpDown))
+ (LastDomainUpDown != GroupDomainUpDown!.DomainUpDown))
{
// We only modify the parent and visible state if processing for correct container
- if ((GroupDomainUpDown.RibbonContainer.RibbonGroup.ShowingAsPopup && (parentControl is VisualPopupGroup)) ||
+ if ((GroupDomainUpDown!.RibbonContainer!.RibbonGroup!.ShowingAsPopup && (parentControl is VisualPopupGroup)) ||
(!GroupDomainUpDown.RibbonContainer.RibbonGroup.ShowingAsPopup && parentControl is not VisualPopupGroup))
{
// If we have added the custrom control to a parent before
@@ -469,15 +473,15 @@ private void UpdateParent(Control parentControl)
}
}
- private void UpdateEnabled(Control c)
+ private void UpdateEnabled(Control? c)
{
if (c != null)
{
// Start with the enabled state of the group element
- var enabled = GroupDomainUpDown.Enabled;
+ var enabled = GroupDomainUpDown!.Enabled;
// If we have an associated designer setup...
- if (!_ribbon.InDesignHelperMode && (GroupDomainUpDown.DomainUpDownDesigner != null))
+ if (!_ribbon.InDesignHelperMode && (GroupDomainUpDown?.DomainUpDownDesigner != null))
{
// And we are not using the design helpers, then use the design specified value
enabled = GroupDomainUpDown.DomainUpDownDesigner.DesignEnabled;
@@ -487,15 +491,15 @@ private void UpdateEnabled(Control c)
}
}
- private bool ActualVisible(Control c)
+ private bool ActualVisible(Control? c)
{
if (c != null)
{
// Start with the visible state of the group element
- var visible = GroupDomainUpDown.Visible;
+ var visible = GroupDomainUpDown!.Visible;
// If we have an associated designer setup...
- if (!_ribbon.InDesignHelperMode && (GroupDomainUpDown.DomainUpDownDesigner != null))
+ if (!_ribbon.InDesignHelperMode && (GroupDomainUpDown?.DomainUpDownDesigner != null))
{
// And we are not using the design helpers, then use the design specified value
visible = GroupDomainUpDown.DomainUpDownDesigner.DesignVisible;
@@ -507,15 +511,15 @@ private bool ActualVisible(Control c)
return false;
}
- private void UpdateVisible(Control c)
+ private void UpdateVisible(Control? c)
{
if (c != null)
{
// Start with the visible state of the group element
- var visible = GroupDomainUpDown.Visible;
+ var visible = GroupDomainUpDown!.Visible;
// If we have an associated designer setup...
- if (!_ribbon.InDesignHelperMode && (GroupDomainUpDown.DomainUpDownDesigner != null))
+ if (!_ribbon.InDesignHelperMode && (GroupDomainUpDown?.DomainUpDownDesigner != null))
{
// And we are not using the design helpers, then use the design specified value
visible = GroupDomainUpDown.DomainUpDownDesigner.DesignVisible;
@@ -524,7 +528,7 @@ private void UpdateVisible(Control c)
if (visible)
{
// Only visible if on the currently selected page
- if ((GroupDomainUpDown.RibbonTab == null) ||
+ if ((GroupDomainUpDown?.RibbonTab == null) ||
(_ribbon.SelectedTab != GroupDomainUpDown.RibbonTab))
{
visible = false;
@@ -539,7 +543,7 @@ private void UpdateVisible(Control c)
else
{
// Check that the group is not collapsed
- if (GroupDomainUpDown.RibbonContainer.RibbonGroup.IsCollapsed &&
+ if (GroupDomainUpDown.RibbonContainer!.RibbonGroup!.IsCollapsed &&
((_ribbon.GetControllerControl(GroupDomainUpDown.DomainUpDown) is KryptonRibbon) ||
(_ribbon.GetControllerControl(GroupDomainUpDown.DomainUpDown) is VisualPopupMinimized)))
{
@@ -561,7 +565,7 @@ private void UpdateVisible(Control c)
}
// Move up a level
- container = container.RibbonContainer;
+ container = container.RibbonContainer!;
}
}
}
@@ -572,26 +576,26 @@ private void UpdateVisible(Control c)
}
}
- private void OnLayoutAction(object sender, EventArgs e)
+ private void OnLayoutAction(object? sender, EventArgs e)
{
// If not disposed then we still have a element reference
if (GroupDomainUpDown != null)
{
// Change in selected tab requires a retest of the control visibility
- UpdateVisible(LastDomainUpDown);
+ UpdateVisible(LastDomainUpDown!);
}
}
- private void OnMouseEnterControl(object sender, EventArgs e)
+ private void OnMouseEnterControl(object? sender, EventArgs e)
{
// Reset the active group setting
_activeGroup = null;
// Find the parent group instance
- ViewBase parent = Parent;
+ ViewBase? parent = Parent;
// Keep going till we get to the top or find a group
- while (parent != null)
+ while (parent is not null)
{
if (parent is ViewDrawRibbonGroup ribGroup)
{
@@ -604,14 +608,14 @@ private void OnMouseEnterControl(object sender, EventArgs e)
}
// If we found a group we are inside
- if (_activeGroup != null)
+ if (_activeGroup is not null)
{
_activeGroup.Tracking = true;
_needPaint(this, new NeedLayoutEventArgs(false, _activeGroup.ClientRectangle));
}
}
- private void OnMouseLeaveControl(object sender, EventArgs e)
+ private void OnMouseLeaveControl(object? sender, EventArgs e)
{
// If we have a cached group we made active
if (_activeGroup != null)
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupGallery.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupGallery.cs
index 3c2c3ed1b..1c7aaa87a 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupGallery.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupGallery.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -22,12 +22,12 @@ internal class ViewDrawRibbonGroupGallery : ViewComposite,
{
#region Instance Fields
- private readonly int NULL_CONTROL_WIDTH; // = 50;
+ private readonly int _nullControlWidth; // = 50;
private readonly Padding _largeImagePadding; // = new(3, 2, 3, 3);
private readonly KryptonRibbon _ribbon;
private ViewDrawRibbonGroup? _activeGroup;
private readonly GalleryController? _controller;
- private readonly NeedPaintHandler _needPaint;
+ private readonly NeedPaintHandler? _needPaint;
private GroupItemSize _currentSize;
private ViewDrawRibbonGroupButtonBackBorder _viewLarge;
private ViewLayoutRibbonRowCenter _viewLargeCenter;
@@ -46,18 +46,18 @@ internal class ViewDrawRibbonGroupGallery : ViewComposite,
/// Reference to owning ribbon control.
/// Reference to source gallery.
/// Delegate for notifying paint requests.
- public ViewDrawRibbonGroupGallery([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupGallery ribbonGallery,
- [DisallowNull] NeedPaintHandler needPaint)
+ public ViewDrawRibbonGroupGallery([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupGallery? ribbonGallery,
+ [DisallowNull] NeedPaintHandler? needPaint)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(ribbonGallery != null);
- Debug.Assert(needPaint != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(ribbonGallery is not null);
+ Debug.Assert(needPaint is not null);
// Remember incoming references
- _ribbon = ribbon;
- GroupGallery = ribbonGallery;
- _needPaint = needPaint;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ GroupGallery = ribbonGallery ?? throw new ArgumentNullException(nameof(ribbonGallery));
+ _needPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
_currentSize = GroupGallery.ItemSizeCurrent;
// Create the button view used in small setting
@@ -72,7 +72,7 @@ public ViewDrawRibbonGroupGallery([DisallowNull] KryptonRibbon ribbon,
if (_ribbon.InDesignMode)
{
- // At design time we need to know when the user right clicks the gallery
+ // At design time we need to know when the user right-clicks the gallery
var controller = new ContextClickController();
controller.ContextClick += OnContextClick;
MouseController = controller;
@@ -84,7 +84,7 @@ public ViewDrawRibbonGroupGallery([DisallowNull] KryptonRibbon ribbon,
KeyController = _controller;
// We need to rest visibility of the gallery for each layout cycle
- _ribbon.ViewRibbonManager.LayoutBefore += OnLayoutAction;
+ _ribbon.ViewRibbonManager!.LayoutBefore += OnLayoutAction;
_ribbon.ViewRibbonManager.LayoutAfter += OnLayoutAction;
// Define back reference to view for the gallery definition
@@ -93,9 +93,13 @@ public ViewDrawRibbonGroupGallery([DisallowNull] KryptonRibbon ribbon,
// Give paint delegate to gallery so its palette changes are redrawn
GroupGallery.ViewPaintDelegate = needPaint;
+ // Update all views to reflect current state
+ UpdateEnabled(GroupGallery.Gallery);
+ UpdateVisible(GroupGallery.Gallery);
+
// Hook into changes in the ribbon custom definition
GroupGallery.PropertyChanged += OnGalleryPropertyChanged;
- NULL_CONTROL_WIDTH = (int)(50 * FactorDpiX);
+ _nullControlWidth = (int)(50 * FactorDpiX);
_largeImagePadding = new Padding((int)(3 * FactorDpiX), (int)(2 * FactorDpiY), (int)(3 * FactorDpiX), (int)(3 * FactorDpiY));
}
@@ -127,7 +131,7 @@ protected override void Dispose(bool disposing)
GroupGallery.MouseLeaveControl -= OnMouseLeaveControl;
GroupGallery.ViewPaintDelegate = null;
GroupGallery.PropertyChanged -= OnGalleryPropertyChanged;
- _ribbon.ViewRibbonManager.LayoutAfter -= OnLayoutAction;
+ _ribbon.ViewRibbonManager!.LayoutAfter -= OnLayoutAction;
_ribbon.ViewRibbonManager.LayoutBefore -= OnLayoutAction;
// Remove association with definition
@@ -144,7 +148,7 @@ protected override void Dispose(bool disposing)
///
/// Perform action expected when a key tip is used to select the item.
///
- public void KeyTipSelect() => GroupGallery.LastGallery?.ShownGalleryDropDown(GroupGallery.LastGallery.RectangleToScreen(GroupGallery.LastGallery.ClientRectangle),
+ public void KeyTipSelect() => GroupGallery?.LastGallery?.ShownGalleryDropDown(GroupGallery.LastGallery.RectangleToScreen(GroupGallery.LastGallery.ClientRectangle),
KryptonContextMenuPositionH.Left,
KryptonContextMenuPositionV.Top,
null,
@@ -177,7 +181,7 @@ public override void LostFocus(Control c)
/// Gets the first focus item from the container.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetFirstFocusItem()
+ public ViewBase GetFirstFocusItem()
{
if (_viewLarge.Visible)
{
@@ -194,7 +198,7 @@ public override void LostFocus(Control c)
}
}
- return null;
+ return null!;
}
#endregion
@@ -203,7 +207,7 @@ public override void LostFocus(Control c)
/// Gets the last focus item from the item.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetLastFocusItem()
+ public ViewBase GetLastFocusItem()
{
if (_viewLarge.Visible)
{
@@ -220,7 +224,7 @@ public override void LostFocus(Control c)
}
}
- return null;
+ return null!;
}
#endregion
@@ -231,10 +235,10 @@ public override void LostFocus(Control c)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetNextFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetNextFocusItem(ViewBase current, ref bool matched)
{
matched = (current == this) || (current == _viewLarge);
- return null;
+ return null!;
}
#endregion
@@ -245,10 +249,10 @@ public override void LostFocus(Control c)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetPreviousFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetPreviousFocusItem(ViewBase current, ref bool matched)
{
matched = (current == this) || (current == _viewLarge);
- return null;
+ return null!;
}
#endregion
@@ -271,7 +275,7 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList)
ClientRectangle,
_viewLarge.Controller));
}
- else if (LastGallery.CanFocus)
+ else if (LastGallery!.CanFocus)
{
// Get the screen location of the button
Rectangle viewRect = _ribbon.KeyTipToScreen(this);
@@ -294,9 +298,9 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList)
public ItemSizeWidth[] GetPossibleSizes(ViewLayoutContext context)
{
// Ensure the control has the correct parent
- UpdateParent(context.Control);
+ UpdateParent(context.Control!);
- if (LastGallery != null)
+ if (LastGallery is not null)
{
Size originalItemSize = LastGallery.PreferredItemSize;
GroupItemSize originalSize = _currentSize;
@@ -305,7 +309,7 @@ public ItemSizeWidth[] GetPossibleSizes(ViewLayoutContext context)
var results = new List();
// Are we allowed to be in the large size?
- if (GroupGallery.ItemSizeMaximum == GroupItemSize.Large)
+ if (GroupGallery!.ItemSizeMaximum == GroupItemSize.Large)
{
// Allow a maximum of 39 steps between the large and medium values (with a minimum of 1)
var step = Math.Max(1, (GroupGallery.LargeItemCount - GroupGallery.MediumItemCount) / 20);
@@ -385,7 +389,7 @@ public ItemSizeWidth[] GetPossibleSizes(ViewLayoutContext context)
}
else
{
- return new ItemSizeWidth[] { new ItemSizeWidth(GroupItemSize.Large, NULL_CONTROL_WIDTH) };
+ return [new ItemSizeWidth(GroupItemSize.Large, _nullControlWidth)];
}
}
@@ -396,7 +400,7 @@ public ItemSizeWidth[] GetPossibleSizes(ViewLayoutContext context)
public void SetSolutionSize(ItemSizeWidth size)
{
// Update the container definition
- GroupGallery.ItemSizeCurrent = size.GroupItemSize;
+ GroupGallery!.ItemSizeCurrent = size.GroupItemSize;
GroupGallery.InternalItemCount = size.Tag;
_viewLarge.Visible = size.GroupItemSize == GroupItemSize.Small;
}
@@ -407,7 +411,7 @@ public void SetSolutionSize(ItemSizeWidth size)
public void ResetSolutionSize()
{
// Restore the container back to the defined size
- GroupGallery.ItemSizeCurrent = GroupGallery.ItemSizeMaximum;
+ GroupGallery!.ItemSizeCurrent = GroupGallery.ItemSizeMaximum;
GroupGallery.InternalItemCount = GroupGallery.LargeItemCount;
_viewLarge.Visible = GroupGallery.ItemSizeCurrent == GroupItemSize.Small;
}
@@ -421,7 +425,7 @@ public override Size GetPreferredSize(ViewLayoutContext context)
var preferredSize = Size.Empty;
// Ensure the control has the correct parent
- UpdateParent(context.Control);
+ UpdateParent(context.Control!);
if (_currentSize == GroupItemSize.Small)
{
@@ -442,7 +446,7 @@ public override Size GetPreferredSize(ViewLayoutContext context)
}
else
{
- preferredSize.Width = NULL_CONTROL_WIDTH;
+ preferredSize.Width = _nullControlWidth;
}
}
@@ -462,10 +466,10 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
Debug.Assert(context != null);
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// Are we allowed to change the layout of controls?
- if (!context.ViewManager.DoNotLayoutControls)
+ if (!context.ViewManager!.DoNotLayoutControls)
{
// If we have an actual control, position it with a pixel padding all around
LastGallery?.SetBounds(ClientLocation.X + 1,
@@ -489,7 +493,7 @@ public override void Render([DisallowNull] RenderContext context)
Debug.Assert(context != null);
// If we do not have a gallery
- if (GroupGallery.Gallery == null)
+ if (GroupGallery?.Gallery == null)
{
// And we are in design time
if (_ribbon.InDesignMode)
@@ -500,12 +504,12 @@ public override void Render([DisallowNull] RenderContext context)
drawRect.Height--;
// Draw an indication of where the gallery will be
- context.Graphics.FillRectangle(Brushes.Goldenrod, drawRect);
+ context!.Graphics.FillRectangle(Brushes.Goldenrod, drawRect);
context.Graphics.DrawRectangle(Pens.Gold, drawRect);
}
}
- base.Render(context);
+ base.Render(context!);
}
#endregion
@@ -539,10 +543,10 @@ protected virtual void OnNeedPaint(bool needLayout, Rectangle invalidRect)
private void CreateLargeButtonView()
{
// Create the background and border view
- _viewLarge = new ViewDrawRibbonGroupButtonBackBorder(_ribbon, GroupGallery,
+ _viewLarge = new ViewDrawRibbonGroupButtonBackBorder(_ribbon, GroupGallery!,
_ribbon.StateCommon.RibbonGroupButton.PaletteBack,
- _ribbon.StateCommon.RibbonGroupButton.PaletteBorder,
- false, _needPaint)
+ _ribbon.StateCommon.RibbonGroupButton.PaletteBorder!,
+ false, _needPaint!)
{
ButtonType = GroupButtonType.DropDown
};
@@ -557,7 +561,7 @@ private void CreateLargeButtonView()
var contentLayout = new ViewLayoutDocker();
// Add the large button at the top
- _viewLargeImage = new ViewDrawRibbonGroupGalleryImage(_ribbon, GroupGallery);
+ _viewLargeImage = new ViewDrawRibbonGroupGalleryImage(_ribbon, GroupGallery!);
var largeImagePadding = new ViewLayoutRibbonCenterPadding(_largeImagePadding)
{
_viewLargeImage
@@ -565,12 +569,12 @@ private void CreateLargeButtonView()
contentLayout.Add(largeImagePadding, ViewDockStyle.Top);
// Add the first line of text
- _viewLargeText1 = new ViewDrawRibbonGroupGalleryText(_ribbon, GroupGallery, true);
+ _viewLargeText1 = new ViewDrawRibbonGroupGalleryText(_ribbon, GroupGallery!, true);
contentLayout.Add(_viewLargeText1, ViewDockStyle.Bottom);
// Add the second line of text
_viewLargeCenter = new ViewLayoutRibbonRowCenter();
- _viewLargeText2 = new ViewDrawRibbonGroupGalleryText(_ribbon, GroupGallery, false);
+ _viewLargeText2 = new ViewDrawRibbonGroupGalleryText(_ribbon, GroupGallery!, false);
_viewLargeDropArrow = new ViewDrawRibbonDropArrow(_ribbon);
_viewLargeText2Sep1 = new ViewLayoutRibbonSeparator(4, false);
_viewLargeText2Sep2 = new ViewLayoutRibbonSeparator(4, false);
@@ -587,7 +591,7 @@ private void CreateLargeButtonView()
_viewLarge.Add(contentLayout);
// Create controller for intercepting events to determine tool tip handling
- _viewLarge.MouseController = new ToolTipController(_ribbon.TabsArea.ButtonSpecManager.ToolTipManager,
+ _viewLarge.MouseController = new ToolTipController(_ribbon.TabsArea!.ButtonSpecManager?.ToolTipManager!,
_viewLarge, _viewLarge.MouseController);
// Add as a child view but as hidden, will become visible only in small mode
@@ -595,15 +599,15 @@ private void CreateLargeButtonView()
Add(_viewLarge);
}
- private void OnLargeButtonDropDown(object sender, EventArgs e) => GroupGallery.LastGallery.ShownGalleryDropDown(_ribbon.ViewRectangleToScreen(_viewLarge),
+ private void OnLargeButtonDropDown(object? sender, EventArgs e) => GroupGallery?.LastGallery?.ShownGalleryDropDown(_ribbon.ViewRectangleToScreen(_viewLarge),
KryptonContextMenuPositionH.Left,
KryptonContextMenuPositionV.Below,
_viewLarge.FinishDelegate,
GroupGallery.DropButtonItemWidth);
- private void OnContextClick(object sender, MouseEventArgs e) => GroupGallery.OnDesignTimeContextMenu(e);
+ private void OnContextClick(object? sender, MouseEventArgs e) => GroupGallery?.OnDesignTimeContextMenu(e);
- private void OnGalleryPropertyChanged(object sender, PropertyChangedEventArgs e)
+ private void OnGalleryPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
var updateLayout = false;
const bool UPDATE_PAINT = false;
@@ -643,7 +647,7 @@ private void OnGalleryPropertyChanged(object sender, PropertyChangedEventArgs e)
if (updateLayout)
{
// If we are on the currently selected tab then...
- if ((GroupGallery.RibbonTab != null) &&
+ if ((GroupGallery?.RibbonTab != null) &&
(_ribbon.SelectedTab == GroupGallery.RibbonTab))
{
// ...layout so the visible change is made
@@ -671,14 +675,14 @@ private void OnGalleryPropertyChanged(object sender, PropertyChangedEventArgs e)
private Control? LastParentControl
{
- get => GroupGallery.LastParentControl;
- set => GroupGallery.LastParentControl = value;
+ get => GroupGallery?.LastParentControl;
+ set => GroupGallery!.LastParentControl = value;
}
private KryptonGallery? LastGallery
{
- get => GroupGallery.LastGallery;
- set => GroupGallery.LastGallery = value;
+ get => GroupGallery?.LastGallery;
+ set => GroupGallery!.LastGallery = value;
}
private void UpdateParent(Control parentControl)
@@ -686,10 +690,10 @@ private void UpdateParent(Control parentControl)
// Is there a change in the gallery or a change in
// the parent control that is hosting the control...
if ((parentControl != LastParentControl) ||
- (LastGallery != GroupGallery.Gallery))
+ (LastGallery != GroupGallery?.Gallery))
{
// We only modify the parent and visible state if processing for correct container
- if ((GroupGallery.RibbonGroup.ShowingAsPopup && (parentControl is VisualPopupGroup)) ||
+ if ((GroupGallery!.RibbonGroup!.ShowingAsPopup && (parentControl is VisualPopupGroup)) ||
(!GroupGallery.RibbonGroup.ShowingAsPopup && parentControl is not VisualPopupGroup))
{
// If we have added the custom control to a parent before
@@ -741,7 +745,7 @@ private void UpdateEnabled(Control? c)
if (c != null)
{
// Start with the enabled state of the group element
- var enabled = GroupGallery.Enabled;
+ var enabled = GroupGallery!.Enabled;
// If we have an associated designer setup...
if (!_ribbon.InDesignHelperMode && (GroupGallery.GalleryDesigner != null))
@@ -759,7 +763,7 @@ private bool ActualVisible(Control? c)
if (c != null)
{
// Start with the visible state of the group element
- var visible = GroupGallery.Visible;
+ var visible = GroupGallery!.Visible;
// If we have an associated designer setup...
if (!_ribbon.InDesignHelperMode && (GroupGallery.GalleryDesigner != null))
@@ -779,7 +783,7 @@ private void UpdateVisible(Control? c)
if (c != null)
{
// Start with the visible state of the group element
- var visible = GroupGallery.Visible;
+ var visible = GroupGallery!.Visible;
// If we have an associated designer setup...
if (!_ribbon.InDesignHelperMode && (GroupGallery.GalleryDesigner != null))
@@ -806,7 +810,7 @@ private void UpdateVisible(Control? c)
else
{
// Check that the group is not collapsed
- if (GroupGallery.RibbonGroup.IsCollapsed &&
+ if (GroupGallery.RibbonGroup!.IsCollapsed &&
((_ribbon.GetControllerControl(GroupGallery.Gallery) is KryptonRibbon) ||
(_ribbon.GetControllerControl(GroupGallery.Gallery) is VisualPopupMinimized)))
{
@@ -820,7 +824,7 @@ private void UpdateVisible(Control? c)
}
}
- private void OnLayoutAction(object sender, EventArgs e)
+ private void OnLayoutAction(object? sender, EventArgs e)
{
// If not disposed then we still have a element reference
if (GroupGallery != null)
@@ -831,7 +835,7 @@ private void OnLayoutAction(object sender, EventArgs e)
}
}
- private void OnMouseEnterControl(object sender, EventArgs e)
+ private void OnMouseEnterControl(object? sender, EventArgs e)
{
// Reset the active group setting
_activeGroup = null;
@@ -856,17 +860,17 @@ private void OnMouseEnterControl(object sender, EventArgs e)
if (_activeGroup != null)
{
_activeGroup.Tracking = true;
- _needPaint(this, new NeedLayoutEventArgs(false, _activeGroup.ClientRectangle));
+ _needPaint?.Invoke(this, new NeedLayoutEventArgs(false, _activeGroup.ClientRectangle));
}
}
- private void OnMouseLeaveControl(object sender, EventArgs e)
+ private void OnMouseLeaveControl(object? sender, EventArgs e)
{
// If we have a cached group we made active
if (_activeGroup != null)
{
_activeGroup.Tracking = false;
- _needPaint(this, new NeedLayoutEventArgs(false, _activeGroup.ClientRectangle));
+ _needPaint?.Invoke(this, new NeedLayoutEventArgs(false, _activeGroup.ClientRectangle));
_activeGroup = null;
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupGalleryImage.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupGalleryImage.cs
index ff9f9af05..cad339ae8 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupGalleryImage.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupGalleryImage.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -31,13 +31,13 @@ internal class ViewDrawRibbonGroupGalleryImage : ViewDrawRibbonGroupImageBase
///
/// Reference to owning ribbon control.
/// Reference to ribbon group gallery definition.
- public ViewDrawRibbonGroupGalleryImage(KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupGallery ribbonGallery)
+ public ViewDrawRibbonGroupGalleryImage([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupGallery? ribbonGallery)
: base(ribbon)
{
- Debug.Assert(ribbonGallery != null);
+ Debug.Assert(ribbonGallery is not null);
- _ribbonGallery = ribbonGallery;
+ _ribbonGallery = ribbonGallery ?? throw new ArgumentNullException(nameof(ribbonGallery));
_largeSize = new Size((int)(32 * FactorDpiX), (int)(32 * FactorDpiY));
}
@@ -60,7 +60,7 @@ public override string ToString() =>
///
/// Gets the image to be drawn.
///
- protected override Image DrawImage => _ribbonGallery.ImageLarge;
+ protected override Image? DrawImage => _ribbonGallery.ImageLarge;
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupGalleryText.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupGalleryText.cs
index b314d0917..66937f7a7 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupGalleryText.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupGalleryText.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -24,7 +24,7 @@ internal class ViewDrawRibbonGroupGalleryText : ViewLeaf,
private readonly KryptonRibbon _ribbon;
private readonly KryptonRibbonGroupGallery _ribbonGallery;
private readonly RibbonGroupNormalDisabledTextToContent _contentProvider;
- private IDisposable _memento;
+ private IDisposable? _memento;
private readonly bool _firstText;
private int _heightExtra;
private Size _preferredSize;
@@ -41,15 +41,15 @@ internal class ViewDrawRibbonGroupGalleryText : ViewLeaf,
/// Source ribbon control.
/// Group gallery button to display title for.
/// Should show the first button text.
- public ViewDrawRibbonGroupGalleryText([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupGallery ribbonGallery,
+ public ViewDrawRibbonGroupGalleryText([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupGallery? ribbonGallery,
bool firstText)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(ribbonGallery != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(ribbonGallery is not null);
- _ribbon = ribbon;
- _ribbonGallery = ribbonGallery;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _ribbonGallery = ribbonGallery ?? throw new ArgumentNullException(nameof(ribbonGallery));
_firstText = firstText;
// Use a class to convert from ribbon group to content interface
@@ -103,14 +103,19 @@ public void MakeDirty()
/// Layout context.
public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
// Validate incoming reference
- if (context == null)
+ if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
// A change in state always causes a size and layout calculation
if (_cacheState != State)
{
@@ -124,7 +129,7 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
// Ask the renderer for the contents preferred size
_preferredSize = context.Renderer.RenderStandardContent.GetContentPreferredSize(context, _contentProvider,
this, VisualOrientation.Top,
- State, false, false);
+ State);
// Subtract the extra space used to ensure it draws
_heightExtra = (_ribbon.CalculatedValues.DrawFontHeight - _ribbon.CalculatedValues.RawFontHeight) * 2;
@@ -149,10 +154,20 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
/// Layout context.
public override void Layout([DisallowNull] ViewLayoutContext context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
+
+ if (context is null)
+ {
+ throw new ArgumentNullException(nameof(context));
+ }
+
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// A change in state always causes a size and layout calculation
if (_cacheState != State)
@@ -182,7 +197,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
_memento = context.Renderer.RenderStandardContent.LayoutContent(context, drawRect,
_contentProvider, this,
VisualOrientation.Top,
- PaletteState.Normal, false, false);
+ PaletteState.Normal);
// Cache values that are needed to decide if layout is needed
_displayRect = ClientRectangle;
@@ -196,8 +211,13 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
/// Perform rendering before child elements are rendered.
///
/// Rendering context.
- public override void RenderBefore(RenderContext context)
+ public override void RenderBefore([DisallowNull] RenderContext context)
{
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
Rectangle drawRect = ClientRectangle;
// Adjust the client rect so the text has enough room to be drawn
@@ -210,7 +230,7 @@ public override void RenderBefore(RenderContext context)
context.Renderer.RenderStandardContent.DrawContent(context, drawRect,
_contentProvider, _memento,
VisualOrientation.Top,
- State, false, false, true);
+ State, true);
}
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupImage.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupImage.cs
index 92c7ab2d0..b1266cbd2 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupImage.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupImage.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -21,17 +21,17 @@ internal class ViewDrawRibbonGroupImage : ViewLeaf
{
#region Instance Fields
- private readonly Size _viewSize_2007; // = new(30, 31);
- private readonly Size _viewSize_2010; // = new(31, 31);
+ private readonly Size _viewSize2007; // = new(30, 31);
+ private readonly Size _viewSize2010; // = new(31, 31);
private readonly Size _imageSize; // = new(16, 16);
- private readonly int IMAGE_OFFSET_X; // = 7;
- private readonly int IMAGE_OFFSET_Y_2007; // = 4;
- private readonly int IMAGE_OFFSET_Y_2010; // = 7;
+ private readonly int _imageOffsetX; // = 7;
+ private readonly int _imageOffsetY2007; // = 4;
+ private readonly int _imageOffsetY2010; // = 7;
private readonly KryptonRibbon _ribbon;
private readonly KryptonRibbonGroup _ribbonGroup;
private readonly ViewDrawRibbonGroup _viewGroup;
- private IDisposable _memento1;
- private IDisposable _memento2;
+ private IDisposable? _memento1;
+ private IDisposable? _memento2;
private Size _viewSize;
private int _offsetY;
#endregion
@@ -43,23 +43,23 @@ internal class ViewDrawRibbonGroupImage : ViewLeaf
/// Reference to owning ribbon control.
/// Reference to ribbon group definition.
/// Reference to top level group element.
- public ViewDrawRibbonGroupImage([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroup ribbonGroup,
- [DisallowNull] ViewDrawRibbonGroup viewGroup)
+ public ViewDrawRibbonGroupImage([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroup? ribbonGroup,
+ [DisallowNull] ViewDrawRibbonGroup? viewGroup)
{
Debug.Assert(ribbon != null);
Debug.Assert(ribbonGroup != null);
Debug.Assert(viewGroup != null);
- _ribbon = ribbon;
- _ribbonGroup = ribbonGroup;
- _viewGroup = viewGroup;
- _viewSize_2007 = new Size((int)(30 * FactorDpiX), (int)(31 * FactorDpiY));
- _viewSize_2010 = new Size((int)(31 * FactorDpiX), (int)(31 * FactorDpiY));
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _ribbonGroup = ribbonGroup ?? throw new ArgumentNullException(nameof(ribbonGroup));
+ _viewGroup = viewGroup ?? throw new ArgumentNullException(nameof(viewGroup));
+ _viewSize2007 = new Size((int)(30 * FactorDpiX), (int)(31 * FactorDpiY));
+ _viewSize2010 = new Size((int)(31 * FactorDpiX), (int)(31 * FactorDpiY));
_imageSize = new Size((int)(16 * FactorDpiX), (int)(16 * FactorDpiY));
- IMAGE_OFFSET_X = (int)(7 * FactorDpiX);
- IMAGE_OFFSET_Y_2007 = (int)(4 * FactorDpiY);
- IMAGE_OFFSET_Y_2010 = (int)(7 * FactorDpiY);
+ _imageOffsetX = (int)(7 * FactorDpiX);
+ _imageOffsetY2007 = (int)(4 * FactorDpiY);
+ _imageOffsetY2010 = (int)(7 * FactorDpiY);
}
///
@@ -106,12 +106,12 @@ public override Size GetPreferredSize(ViewLayoutContext context)
{
default:
case PaletteRibbonShape.Office2007:
- _viewSize = _viewSize_2007;
- _offsetY = IMAGE_OFFSET_Y_2007;
+ _viewSize = _viewSize2007;
+ _offsetY = _imageOffsetY2007;
break;
case PaletteRibbonShape.Office2010:
- _viewSize = _viewSize_2010;
- _offsetY = IMAGE_OFFSET_Y_2010;
+ _viewSize = _viewSize2010;
+ _offsetY = _imageOffsetY2010;
break;
}
@@ -132,8 +132,18 @@ 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([DisallowNull] RenderContext context)
{
+ if (context is null)
+ {
+ throw new ArgumentNullException(nameof(context));
+ }
+
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
IPaletteRibbonBack paletteBorder;
IPaletteRibbonBack paletteBack;
@@ -178,16 +188,16 @@ public override void RenderBefore(RenderContext context)
backRect.Inflate(-1, -1);
// Draw the background for the group image area
- _memento1 = context.Renderer.RenderRibbon.DrawRibbonBack(_ribbon.RibbonShape, context, backRect, State, paletteBack, VisualOrientation.Top, false, _memento1);
+ _memento1 = context!.Renderer.RenderRibbon.DrawRibbonBack(_ribbon.RibbonShape, context, backRect, State, paletteBack, VisualOrientation.Top, _memento1);
// Draw the border around the group image area
- _memento2 = context.Renderer.RenderRibbon.DrawRibbonBack(_ribbon.RibbonShape, context, ClientRectangle, State, paletteBorder, VisualOrientation.Top, false, _memento2);
+ _memento2 = context.Renderer.RenderRibbon.DrawRibbonBack(_ribbon.RibbonShape, context, ClientRectangle, State, paletteBorder, VisualOrientation.Top, _memento2);
// If we have an image for drawing
if (_ribbonGroup.Image != null)
{
// Determine the rectangle for the fixed size of image drawing
- var drawRect = new Rectangle(new Point(ClientLocation.X + IMAGE_OFFSET_X, ClientLocation.Y + _offsetY), _imageSize);
+ var drawRect = new Rectangle(new Point(ClientLocation.X + _imageOffsetX, ClientLocation.Y + _offsetY), _imageSize);
context.Graphics.DrawImage(_ribbonGroup.Image, drawRect);
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupImageBase.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupImageBase.cs
index 85ec39019..7d3f60e58 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupImageBase.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupImageBase.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -25,10 +25,10 @@ internal abstract class ViewDrawRibbonGroupImageBase : ViewLeaf
/// Initialize a new instance of the ViewDrawRibbonGroupImageBase class.
///
/// Reference to owning ribbon control.
- public ViewDrawRibbonGroupImageBase([DisallowNull] KryptonRibbon ribbon)
+ public ViewDrawRibbonGroupImageBase([DisallowNull] KryptonRibbon? ribbon)
{
- Debug.Assert(ribbon != null);
- Ribbon = ribbon;
+ Debug.Assert(ribbon is not null);
+ Ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
}
///
@@ -100,7 +100,7 @@ public override void RenderBefore(RenderContext context)
///
/// Gets the image to be drawn.
///
- protected abstract Image DrawImage { get; }
+ protected abstract Image? DrawImage { get; }
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupLabel.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupLabel.cs
index 0882855a0..f31319691 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupLabel.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupLabel.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -46,18 +46,18 @@ internal class ViewDrawRibbonGroupLabel : ViewComposite,
/// Reference to owning ribbon control.
/// Reference to source label definition.
/// Delegate for notifying paint requests.
- public ViewDrawRibbonGroupLabel([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupLabel ribbonLabel,
- [DisallowNull] NeedPaintHandler needPaint)
+ public ViewDrawRibbonGroupLabel([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupLabel? ribbonLabel,
+ [DisallowNull] NeedPaintHandler? needPaint)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(ribbonLabel != null);
- Debug.Assert(needPaint != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(ribbonLabel is not null);
+ Debug.Assert(needPaint is not null);
// Remember incoming references
- _ribbon = ribbon;
- GroupLabel = ribbonLabel;
- _needPaint = needPaint;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ GroupLabel = ribbonLabel ?? throw new ArgumentNullException(nameof(ribbonLabel));
+ _needPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
// Associate this view with the source component (required for design time selection)
Component = GroupLabel;
@@ -118,7 +118,7 @@ protected override void Dispose(bool disposing)
///
/// Gets access to the owning group label instance.
///
- public KryptonRibbonGroupLabel GroupLabel { get; private set; }
+ public KryptonRibbonGroupLabel? GroupLabel { get; private set; }
#endregion
@@ -127,9 +127,9 @@ protected override void Dispose(bool disposing)
/// Gets the first focus item from the container.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetFirstFocusItem() =>
+ public ViewBase GetFirstFocusItem() =>
// A label can never have the focus
- null;
+ null!;
#endregion
@@ -138,9 +138,9 @@ protected override void Dispose(bool disposing)
/// Gets the last focus item from the item.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetLastFocusItem() =>
+ public ViewBase GetLastFocusItem() =>
// A label can never have the focus
- null;
+ null!;
#endregion
@@ -151,9 +151,9 @@ protected override void Dispose(bool disposing)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetNextFocusItem(ViewBase current, ref bool matched) =>
+ public ViewBase GetNextFocusItem(ViewBase current, ref bool matched) =>
// We have nothing to provide even if we are the selected item
- null;
+ null!;
#endregion
@@ -164,9 +164,9 @@ protected override void Dispose(bool disposing)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetPreviousFocusItem(ViewBase current, ref bool matched) =>
+ public ViewBase GetPreviousFocusItem(ViewBase current, ref bool matched) =>
// We have nothing to provide even if we are the selected item
- null;
+ null!;
#endregion
@@ -223,7 +223,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
UpdateImageSmallState();
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// Let child elements layout in given space
base.Layout(context);
@@ -271,7 +271,7 @@ private void CreateLargeLabelView()
}
// Add the large button at the top
- _viewLargeLabelImage = new ViewDrawRibbonGroupLabelImage(_ribbon, GroupLabel, true);
+ _viewLargeLabelImage = new ViewDrawRibbonGroupLabelImage(_ribbon, GroupLabel!, true);
_viewLargeImage = new ViewLayoutRibbonCenterPadding(_largeImagePadding)
{
_viewLargeLabelImage
@@ -279,18 +279,18 @@ private void CreateLargeLabelView()
_viewLarge.Add(_viewLargeImage, ViewDockStyle.Top);
// Add the first line of text
- _viewLargeText1 = new ViewDrawRibbonGroupLabelText(_ribbon, GroupLabel, true);
+ _viewLargeText1 = new ViewDrawRibbonGroupLabelText(_ribbon, GroupLabel!, true);
_viewLarge.Add(_viewLargeText1, ViewDockStyle.Bottom);
// Add the second line of text
- _viewLargeText2 = new ViewDrawRibbonGroupLabelText(_ribbon, GroupLabel, false);
+ _viewLargeText2 = new ViewDrawRibbonGroupLabelText(_ribbon, GroupLabel!, false);
_viewLarge.Add(_viewLargeText2, ViewDockStyle.Bottom);
// Add a 1 pixel separator at bottom of button before the text
_viewLarge.Add(new ViewLayoutRibbonSeparator(1, false), ViewDockStyle.Bottom);
// Create controller for intercepting events to determine tool tip handling
- _viewLarge.MouseController = new ToolTipController(_ribbon.TabsArea.ButtonSpecManager.ToolTipManager,
+ _viewLarge.MouseController = new ToolTipController(_ribbon.TabsArea!.ButtonSpecManager!.ToolTipManager!,
_viewLarge, _viewLarge.MouseController);
}
@@ -308,9 +308,9 @@ private void CreateMediumSmallLabelView()
}
// Create the image and drop down content
- _viewMediumSmallLabelImage = new ViewDrawRibbonGroupLabelImage(_ribbon, GroupLabel, false);
- _viewMediumSmallText1 = new ViewDrawRibbonGroupLabelText(_ribbon, GroupLabel, true);
- _viewMediumSmallText2 = new ViewDrawRibbonGroupLabelText(_ribbon, GroupLabel, false);
+ _viewMediumSmallLabelImage = new ViewDrawRibbonGroupLabelImage(_ribbon, GroupLabel!, false);
+ _viewMediumSmallText1 = new ViewDrawRibbonGroupLabelText(_ribbon, GroupLabel!, true);
+ _viewMediumSmallText2 = new ViewDrawRibbonGroupLabelText(_ribbon, GroupLabel!, false);
_viewMediumSmallImage = new ViewLayoutRibbonCenterPadding(_smallImagePadding)
{
_viewMediumSmallLabelImage
@@ -328,7 +328,7 @@ private void CreateMediumSmallLabelView()
_viewMediumSmall.Add(_viewMediumSmallCenter, ViewDockStyle.Fill);
// Create controller for intercepting events to determine tool tip handling
- _viewMediumSmall.MouseController = new ToolTipController(_ribbon.TabsArea.ButtonSpecManager.ToolTipManager,
+ _viewMediumSmall.MouseController = new ToolTipController(_ribbon.TabsArea!.ButtonSpecManager!.ToolTipManager!,
_viewMediumSmall, _viewMediumSmall.MouseController);
}
@@ -341,14 +341,14 @@ private void DefineRootView(ViewBase view)
Add(view);
// Provide back reference to the button definition
- GroupLabel.LabelView = view;
+ GroupLabel!.LabelView = view;
}
private void UpdateEnabledState()
{
// Get the correct enabled state from the button definition
- var buttonEnabled = GroupLabel.Enabled;
- if (GroupLabel.KryptonCommand != null)
+ var buttonEnabled = GroupLabel!.Enabled;
+ if (GroupLabel.KryptonCommand is not null)
{
buttonEnabled = GroupLabel.KryptonCommand.Enabled;
}
@@ -371,9 +371,9 @@ private void UpdateEnabledState()
_viewMediumSmallText2.Enabled = enabled;
}
- private void UpdateImageSmallState() => _viewMediumSmallImage.Visible = GroupLabel.ImageSmall != null;
+ private void UpdateImageSmallState() => _viewMediumSmallImage.Visible = GroupLabel!.ImageSmall != null;
- private void UpdateItemSizeState() => UpdateItemSizeState(GroupLabel.ItemSizeCurrent);
+ private void UpdateItemSizeState() => UpdateItemSizeState(GroupLabel!.ItemSizeCurrent);
private void UpdateItemSizeState(GroupItemSize size)
{
@@ -395,9 +395,9 @@ private void UpdateItemSizeState(GroupItemSize size)
}
}
- private void OnContextClick(object sender, MouseEventArgs e) => GroupLabel.OnDesignTimeContextMenu(e);
+ private void OnContextClick(object? sender, MouseEventArgs e) => GroupLabel!.OnDesignTimeContextMenu(e);
- private void OnLabelPropertyChanged(object sender, PropertyChangedEventArgs e)
+ private void OnLabelPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
var updateLayout = false;
var updatePaint = false;
@@ -446,7 +446,7 @@ private void OnLabelPropertyChanged(object sender, PropertyChangedEventArgs e)
if (updateLayout)
{
// If we are on the currently selected tab then...
- if ((GroupLabel.RibbonTab != null) &&
+ if ((GroupLabel!.RibbonTab != null) &&
(_ribbon.SelectedTab == GroupLabel.RibbonTab))
{
// ...layout so the visible change is made
@@ -457,7 +457,7 @@ private void OnLabelPropertyChanged(object sender, PropertyChangedEventArgs e)
if (updatePaint)
{
// If this button is actually defined as visible...
- if (GroupLabel.Visible || _ribbon.InDesignMode)
+ if (GroupLabel!.Visible || _ribbon.InDesignMode)
{
// ...and on the currently selected tab then...
if ((GroupLabel.RibbonTab != null) &&
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupLabelImage.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupLabelImage.cs
index bcc3c94e5..82e91463c 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupLabelImage.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupLabelImage.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -34,14 +34,14 @@ internal class ViewDrawRibbonGroupLabelImage : ViewDrawRibbonGroupImageBase
/// Reference to owning ribbon control.
/// Reference to ribbon group label definition.
/// Show the large image.
- public ViewDrawRibbonGroupLabelImage(KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupLabel ribbonLabel,
+ public ViewDrawRibbonGroupLabelImage([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupLabel? ribbonLabel,
bool large)
: base(ribbon)
{
- Debug.Assert(ribbonLabel != null);
+ Debug.Assert(ribbonLabel is not null);
- _ribbonLabel = ribbonLabel;
+ _ribbonLabel = ribbonLabel ?? throw new ArgumentNullException(nameof(ribbonLabel));
_large = large;
_smallSize = new Size((int)(16 * FactorDpiX), (int)(16 * FactorDpiY));
_largeSize = new Size((int)(32 * FactorDpiX), (int)(32 * FactorDpiY));
@@ -66,7 +66,7 @@ public override string ToString() =>
///
/// Gets the image to be drawn.
///
- protected override Image DrawImage => _large ? _ribbonLabel.ImageLarge : _ribbonLabel.ImageSmall;
+ protected override Image? DrawImage => _large ? _ribbonLabel.ImageLarge : _ribbonLabel.ImageSmall;
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupLabelText.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupLabelText.cs
index bafaba12c..dc1ed5833 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupLabelText.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupLabelText.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -24,7 +24,7 @@ internal class ViewDrawRibbonGroupLabelText : ViewLeaf,
private readonly KryptonRibbon _ribbon;
private readonly KryptonRibbonGroupLabel _ribbonLabel;
private readonly RibbonGroupLabelTextToContent _contentProvider;
- private IDisposable _memento;
+ private IDisposable? _memento;
private readonly bool _firstText;
private int _heightExtra;
private Size _preferredSize;
@@ -41,15 +41,15 @@ internal class ViewDrawRibbonGroupLabelText : ViewLeaf,
/// Source ribbon control.
/// Group label to display title for.
/// Should show the first button text.
- public ViewDrawRibbonGroupLabelText([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupLabel ribbonLabel,
+ public ViewDrawRibbonGroupLabelText([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupLabel? ribbonLabel,
bool firstText)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(ribbonLabel != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(ribbonLabel is not null);
- _ribbon = ribbon;
- _ribbonLabel = ribbonLabel;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _ribbonLabel = ribbonLabel ?? throw new ArgumentNullException(nameof(ribbonLabel));
_firstText = firstText;
// Use a class to convert from ribbon group to content interface
@@ -105,14 +105,19 @@ public void MakeDirty()
/// Layout context.
public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
// Validate incoming reference
- if (context == null)
+ if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
// A change in state always causes a size and layout calculation
if (_cacheState != State)
{
@@ -126,7 +131,7 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
// Ask the renderer for the contents preferred size
_preferredSize = context.Renderer.RenderStandardContent.GetContentPreferredSize(context, _contentProvider,
this, VisualOrientation.Top,
- State, false, false);
+ State);
// Subtract the extra space used to ensure it draws
_heightExtra = (_ribbon.CalculatedValues.DrawFontHeight - _ribbon.CalculatedValues.RawFontHeight) * 2;
@@ -151,10 +156,20 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
/// Layout context.
public override void Layout([DisallowNull] ViewLayoutContext context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
+
+ if (context is null)
+ {
+ throw new ArgumentNullException(nameof(context));
+ }
+
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// A change in state always causes a size and layout calculation
if (_cacheState != State)
@@ -184,7 +199,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
_memento = context.Renderer.RenderStandardContent.LayoutContent(context, drawRect,
_contentProvider, this,
VisualOrientation.Top,
- PaletteState.Normal, false, false);
+ PaletteState.Normal);
// Cache values that are needed to decide if layout is needed
_displayRect = ClientRectangle;
@@ -198,8 +213,13 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
/// Perform rendering before child elements are rendered.
///
/// Rendering context.
- public override void RenderBefore(RenderContext context)
+ public override void RenderBefore([DisallowNull] RenderContext context)
{
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
Rectangle drawRect = ClientRectangle;
// Adjust the client rect so the text has enough room to be drawn
@@ -212,7 +232,7 @@ public override void RenderBefore(RenderContext context)
context.Renderer.RenderStandardContent.DrawContent(context, drawRect,
_contentProvider, _memento,
VisualOrientation.Top,
- State, false, false, true);
+ State, true);
}
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupMaskedTextBox.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupMaskedTextBox.cs
index 52b441da4..98c8b432a 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupMaskedTextBox.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupMaskedTextBox.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -21,10 +21,10 @@ internal class ViewDrawRibbonGroupMaskedTextBox : ViewComposite,
IRibbonViewGroupItemView
{
#region Instance Fields
- private readonly int NULL_CONTROL_WIDTH; // = 50;
+ private readonly int _nullControlWidth; // = 50;
private readonly KryptonRibbon _ribbon;
- private ViewDrawRibbonGroup _activeGroup;
- private readonly MaskedTextBoxController? _controller;
+ private ViewDrawRibbonGroup? _activeGroup;
+ private readonly MaskedTextBoxController _controller;
private readonly NeedPaintHandler _needPaint;
private GroupItemSize _currentSize;
#endregion
@@ -36,18 +36,18 @@ internal class ViewDrawRibbonGroupMaskedTextBox : ViewComposite,
/// Reference to owning ribbon control.
/// Reference to source masked textbox.
/// Delegate for notifying paint requests.
- public ViewDrawRibbonGroupMaskedTextBox([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupMaskedTextBox ribbonMaskedTextBox,
- [DisallowNull] NeedPaintHandler needPaint)
+ public ViewDrawRibbonGroupMaskedTextBox([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupMaskedTextBox? ribbonMaskedTextBox,
+ [DisallowNull] NeedPaintHandler? needPaint)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(ribbonMaskedTextBox != null);
- Debug.Assert(needPaint != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(ribbonMaskedTextBox is not null);
+ Debug.Assert(needPaint is not null);
// Remember incoming references
- _ribbon = ribbon;
- GroupMaskedTextBox = ribbonMaskedTextBox;
- _needPaint = needPaint;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ GroupMaskedTextBox = ribbonMaskedTextBox ?? throw new (nameof(ribbonMaskedTextBox));
+ _needPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
_currentSize = GroupMaskedTextBox.ItemSizeCurrent;
// Hook into the masked textbox events
@@ -71,7 +71,7 @@ public ViewDrawRibbonGroupMaskedTextBox([DisallowNull] KryptonRibbon ribbon,
KeyController = _controller;
// We need to rest visibility of the masked textbox for each layout cycle
- _ribbon.ViewRibbonManager.LayoutBefore += OnLayoutAction;
+ _ribbon.ViewRibbonManager!.LayoutBefore += OnLayoutAction;
_ribbon.ViewRibbonManager.LayoutAfter += OnLayoutAction;
// Define back reference to view for the masked text box definition
@@ -80,9 +80,13 @@ public ViewDrawRibbonGroupMaskedTextBox([DisallowNull] KryptonRibbon ribbon,
// Give paint delegate to masked textbox so its palette changes are redrawn
GroupMaskedTextBox.ViewPaintDelegate = needPaint;
+ // Update all views to reflect current state
+ UpdateEnabled(GroupMaskedTextBox.MaskedTextBox);
+ UpdateVisible(GroupMaskedTextBox.MaskedTextBox);
+
// Hook into changes in the ribbon custom definition
GroupMaskedTextBox.PropertyChanged += OnMaskedTextBoxPropertyChanged;
- NULL_CONTROL_WIDTH = (int)(50 * FactorDpiX);
+ _nullControlWidth = (int)(50 * FactorDpiX);
}
///
@@ -108,7 +112,7 @@ protected override void Dispose(bool disposing)
GroupMaskedTextBox.MouseLeaveControl -= OnMouseLeaveControl;
GroupMaskedTextBox.ViewPaintDelegate = null;
GroupMaskedTextBox.PropertyChanged -= OnMaskedTextBoxPropertyChanged;
- _ribbon.ViewRibbonManager.LayoutAfter -= OnLayoutAction;
+ _ribbon.ViewRibbonManager!.LayoutAfter -= OnLayoutAction;
_ribbon.ViewRibbonManager.LayoutBefore -= OnLayoutAction;
// Remove association with definition
@@ -125,7 +129,7 @@ protected override void Dispose(bool disposing)
///
/// Gets access to the owning group masked textbox instance.
///
- public KryptonRibbonGroupMaskedTextBox GroupMaskedTextBox { get; private set; }
+ public KryptonRibbonGroupMaskedTextBox? GroupMaskedTextBox { get; private set; }
#endregion
@@ -137,7 +141,7 @@ protected override void Dispose(bool disposing)
public override void LostFocus(Control c)
{
// Ask ribbon to shift focus to the hidden control
- _ribbon.HideFocus(GroupMaskedTextBox.MaskedTextBox);
+ _ribbon.HideFocus(GroupMaskedTextBox!.MaskedTextBox);
base.LostFocus(c);
}
#endregion
@@ -147,7 +151,7 @@ public override void LostFocus(Control c)
/// Gets the first focus item from the container.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetFirstFocusItem()
+ public ViewBase GetFirstFocusItem()
{
if (GroupMaskedTextBox is { Visible: true, LastMaskedTextBox.MaskedTextBox.CanSelect: true })
{
@@ -155,7 +159,7 @@ public override void LostFocus(Control c)
}
else
{
- return null;
+ return null!;
}
}
#endregion
@@ -165,7 +169,7 @@ public override void LostFocus(Control c)
/// Gets the last focus item from the item.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetLastFocusItem()
+ public ViewBase GetLastFocusItem()
{
if (GroupMaskedTextBox is { Visible: true, LastMaskedTextBox.MaskedTextBox.CanSelect: true })
{
@@ -173,7 +177,7 @@ public override void LostFocus(Control c)
}
else
{
- return null;
+ return null!;
}
}
#endregion
@@ -185,11 +189,11 @@ public override void LostFocus(Control c)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetNextFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetNextFocusItem(ViewBase current, ref bool matched)
{
// Do we match the current item?
matched = current == this;
- return null;
+ return null!;
}
#endregion
@@ -200,11 +204,11 @@ public override void LostFocus(Control c)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetPreviousFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetPreviousFocusItem(ViewBase current, ref bool matched)
{
// Do we match the current item?
matched = current == this;
- return null;
+ return null!;
}
#endregion
@@ -217,7 +221,7 @@ public override void LostFocus(Control c)
public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
{
// Only provide a key tip if we are visible and the target control can accept focus
- if (Visible && LastMaskedTextBox.CanFocus)
+ if (Visible && LastMaskedTextBox!.CanFocus)
{
// Get the screen location of the button
Rectangle viewRect = _ribbon.KeyTipToScreen(this);
@@ -237,8 +241,8 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
break;
}
- keyTipList.Add(new KeyTipInfo(GroupMaskedTextBox.Enabled,
- GroupMaskedTextBox.KeyTip,
+ keyTipList.Add(new KeyTipInfo(GroupMaskedTextBox!.Enabled,
+ GroupMaskedTextBox.KeyTip!,
screenPt,
ClientRectangle,
_controller));
@@ -256,7 +260,7 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
///
/// Reset the group item size to the item definition.
///
- public void ResetGroupItemSize() => _currentSize = GroupMaskedTextBox.ItemSizeCurrent;
+ public void ResetGroupItemSize() => _currentSize = GroupMaskedTextBox!.ItemSizeCurrent;
///
/// Discover the preferred size of the element.
@@ -267,7 +271,7 @@ public override Size GetPreferredSize(ViewLayoutContext context)
var preferredSize = Size.Empty;
// Ensure the control has the correct parent
- UpdateParent(context.Control);
+ UpdateParent(context.Control!);
// If there is a masked textbox associated then ask for its requested size
if (LastMaskedTextBox != null)
@@ -282,7 +286,7 @@ public override Size GetPreferredSize(ViewLayoutContext context)
}
else
{
- preferredSize.Width = NULL_CONTROL_WIDTH;
+ preferredSize.Width = _nullControlWidth;
}
preferredSize.Height = _currentSize == GroupItemSize.Large
@@ -301,10 +305,10 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
Debug.Assert(context != null);
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// Are we allowed to change the layout of controls?
- if (!context.ViewManager.DoNotLayoutControls)
+ if (!context.ViewManager!.DoNotLayoutControls)
{
// If we have an actual control, position it with a pixel padding all around
LastMaskedTextBox?.SetBounds(ClientLocation.X + 1,
@@ -328,7 +332,7 @@ public override void Render([DisallowNull] RenderContext context)
Debug.Assert(context != null);
// If we do not have a masked textbox
- if (GroupMaskedTextBox.MaskedTextBox == null)
+ if (GroupMaskedTextBox!.MaskedTextBox == null)
{
// And we are in design time
if (_ribbon.InDesignMode)
@@ -339,7 +343,7 @@ public override void Render([DisallowNull] RenderContext context)
drawRect.Height--;
// Draw an indication of where the masked textbox will be
- context.Graphics.FillRectangle(Brushes.Goldenrod, drawRect);
+ context!.Graphics.FillRectangle(Brushes.Goldenrod, drawRect);
context.Graphics.DrawRectangle(Pens.Gold, drawRect);
}
}
@@ -373,9 +377,9 @@ protected virtual void OnNeedPaint(bool needLayout, Rectangle invalidRect)
#endregion
#region Implementation
- private void OnContextClick(object sender, MouseEventArgs e) => GroupMaskedTextBox.OnDesignTimeContextMenu(e);
+ private void OnContextClick(object? sender, MouseEventArgs e) => GroupMaskedTextBox!.OnDesignTimeContextMenu(e);
- private void OnMaskedTextBoxPropertyChanged(object sender, PropertyChangedEventArgs e)
+ private void OnMaskedTextBoxPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
var updateLayout = false;
const bool UPDATE_PAINT = false;
@@ -383,10 +387,10 @@ private void OnMaskedTextBoxPropertyChanged(object sender, PropertyChangedEventA
switch (e.PropertyName)
{
case nameof(Enabled):
- UpdateEnabled(LastMaskedTextBox);
+ UpdateEnabled(LastMaskedTextBox!);
break;
case nameof(Visible):
- UpdateVisible(LastMaskedTextBox);
+ UpdateVisible(LastMaskedTextBox!);
updateLayout = true;
break;
case "CustomControl":
@@ -397,7 +401,7 @@ private void OnMaskedTextBoxPropertyChanged(object sender, PropertyChangedEventA
if (updateLayout)
{
// If we are on the currently selected tab then...
- if ((GroupMaskedTextBox.RibbonTab != null) &&
+ if ((GroupMaskedTextBox!.RibbonTab != null) &&
(_ribbon.SelectedTab == GroupMaskedTextBox.RibbonTab))
{
// ...layout so the visible change is made
@@ -425,14 +429,14 @@ private void OnMaskedTextBoxPropertyChanged(object sender, PropertyChangedEventA
private Control LastParentControl
{
- get => GroupMaskedTextBox.LastParentControl;
- set => GroupMaskedTextBox.LastParentControl = value;
+ get => GroupMaskedTextBox!.LastParentControl;
+ set => GroupMaskedTextBox!.LastParentControl = value;
}
private KryptonMaskedTextBox? LastMaskedTextBox
{
- get => GroupMaskedTextBox.LastMaskedTextBox;
- set => GroupMaskedTextBox.LastMaskedTextBox = value;
+ get => GroupMaskedTextBox!.LastMaskedTextBox;
+ set => GroupMaskedTextBox!.LastMaskedTextBox = value;
}
private void UpdateParent(Control parentControl)
@@ -440,10 +444,10 @@ private void UpdateParent(Control parentControl)
// Is there a change in the masked textbox or a change in
// the parent control that is hosting the control...
if ((parentControl != LastParentControl) ||
- (LastMaskedTextBox != GroupMaskedTextBox.MaskedTextBox))
+ (LastMaskedTextBox != GroupMaskedTextBox!.MaskedTextBox))
{
// We only modify the parent and visible state if processing for correct container
- if ((GroupMaskedTextBox.RibbonContainer.RibbonGroup.ShowingAsPopup && (parentControl is VisualPopupGroup)) ||
+ if ((GroupMaskedTextBox!.RibbonContainer!.RibbonGroup!.ShowingAsPopup && (parentControl is VisualPopupGroup)) ||
(!GroupMaskedTextBox.RibbonContainer.RibbonGroup.ShowingAsPopup && parentControl is not VisualPopupGroup))
{
// If we have added the custrom control to a parent before
@@ -483,7 +487,7 @@ private void UpdateEnabled(Control c)
if (c != null)
{
// Start with the enabled state of the group element
- var enabled = GroupMaskedTextBox.Enabled;
+ var enabled = GroupMaskedTextBox!.Enabled;
// If we have an associated designer setup...
if (!_ribbon.InDesignHelperMode && (GroupMaskedTextBox.MaskedTextBoxDesigner != null))
@@ -501,7 +505,7 @@ private bool ActualVisible(Control c)
if (c != null)
{
// Start with the visible state of the group element
- var visible = GroupMaskedTextBox.Visible;
+ var visible = GroupMaskedTextBox!.Visible;
// If we have an associated designer setup...
if (!_ribbon.InDesignHelperMode && (GroupMaskedTextBox.MaskedTextBoxDesigner != null))
@@ -521,7 +525,7 @@ private void UpdateVisible(Control c)
if (c != null)
{
// Start with the visible state of the group element
- var visible = GroupMaskedTextBox.Visible;
+ var visible = GroupMaskedTextBox!.Visible;
// If we have an associated designer setup...
if (!_ribbon.InDesignHelperMode && (GroupMaskedTextBox.MaskedTextBoxDesigner != null))
@@ -548,7 +552,7 @@ private void UpdateVisible(Control c)
else
{
// Check that the group is not collapsed
- if (GroupMaskedTextBox.RibbonContainer.RibbonGroup.IsCollapsed &&
+ if (GroupMaskedTextBox.RibbonContainer!.RibbonGroup!.IsCollapsed &&
((_ribbon.GetControllerControl(GroupMaskedTextBox.MaskedTextBox) is KryptonRibbon) ||
(_ribbon.GetControllerControl(GroupMaskedTextBox.MaskedTextBox) is VisualPopupMinimized)))
{
@@ -570,7 +574,7 @@ private void UpdateVisible(Control c)
}
// Move up a level
- container = container.RibbonContainer;
+ container = container.RibbonContainer!;
}
}
}
@@ -581,26 +585,26 @@ private void UpdateVisible(Control c)
}
}
- private void OnLayoutAction(object sender, EventArgs e)
+ private void OnLayoutAction(object? sender, EventArgs e)
{
// If not disposed then we still have a element reference
if (GroupMaskedTextBox != null)
{
// Change in selected tab requires a retest of the control visibility
- UpdateVisible(LastMaskedTextBox);
+ UpdateVisible(LastMaskedTextBox!);
}
}
- private void OnMouseEnterControl(object sender, EventArgs e)
+ private void OnMouseEnterControl(object? sender, EventArgs e)
{
// Reset the active group setting
_activeGroup = null;
// Find the parent group instance
- ViewBase parent = Parent;
+ ViewBase? parent = Parent;
// Keep going till we get to the top or find a group
- while (parent != null)
+ while (parent is not null)
{
if (parent is ViewDrawRibbonGroup ribGroup)
{
@@ -620,7 +624,7 @@ private void OnMouseEnterControl(object sender, EventArgs e)
}
}
- private void OnMouseLeaveControl(object sender, EventArgs e)
+ private void OnMouseLeaveControl(object? sender, EventArgs e)
{
// If we have a cached group we made active
if (_activeGroup != null)
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupNumericUpDown.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupNumericUpDown.cs
index 3f9873b68..a33a1674b 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupNumericUpDown.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupNumericUpDown.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -21,11 +21,11 @@ internal class ViewDrawRibbonGroupNumericUpDown : ViewComposite,
IRibbonViewGroupItemView
{
#region Instance Fields
- private readonly int NULL_CONTROL_WIDTH; // = 50;
+ private readonly int _nullControlWidth; // = 50;
private readonly KryptonRibbon _ribbon;
- private ViewDrawRibbonGroup _activeGroup;
+ private ViewDrawRibbonGroup? _activeGroup;
private readonly NumericUpDownController? _controller;
- private readonly NeedPaintHandler _needPaint;
+ private readonly NeedPaintHandler? _needPaint;
private GroupItemSize _currentSize;
#endregion
@@ -36,18 +36,18 @@ internal class ViewDrawRibbonGroupNumericUpDown : ViewComposite,
/// Reference to owning ribbon control.
/// Reference to source numeric up-down.
/// Delegate for notifying paint requests.
- public ViewDrawRibbonGroupNumericUpDown([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupNumericUpDown ribbonNumericUpDown,
- [DisallowNull] NeedPaintHandler needPaint)
+ public ViewDrawRibbonGroupNumericUpDown([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupNumericUpDown? ribbonNumericUpDown,
+ [DisallowNull] NeedPaintHandler? needPaint)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(ribbonNumericUpDown != null);
- Debug.Assert(needPaint != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(ribbonNumericUpDown is not null);
+ Debug.Assert(needPaint is not null);
// Remember incoming references
- _ribbon = ribbon;
- GroupNumericUpDown = ribbonNumericUpDown;
- _needPaint = needPaint;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ GroupNumericUpDown = ribbonNumericUpDown ?? throw new (nameof(ribbonNumericUpDown));
+ _needPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
_currentSize = GroupNumericUpDown.ItemSizeCurrent;
// Hook into the numeric up-down events
@@ -71,7 +71,7 @@ public ViewDrawRibbonGroupNumericUpDown([DisallowNull] KryptonRibbon ribbon,
KeyController = _controller;
// We need to rest visibility of the numeric up-down for each layout cycle
- _ribbon.ViewRibbonManager.LayoutBefore += OnLayoutAction;
+ _ribbon.ViewRibbonManager!.LayoutBefore += OnLayoutAction;
_ribbon.ViewRibbonManager.LayoutAfter += OnLayoutAction;
// Define back reference to view for the numeric up-down definition
@@ -80,9 +80,13 @@ public ViewDrawRibbonGroupNumericUpDown([DisallowNull] KryptonRibbon ribbon,
// Give paint delegate to numeric up-down so its palette changes are redrawn
GroupNumericUpDown.ViewPaintDelegate = needPaint;
+ // Update all views to reflect current state
+ UpdateEnabled(GroupNumericUpDown.NumericUpDown);
+ UpdateVisible(GroupNumericUpDown.NumericUpDown);
+
// Hook into changes in the ribbon custom definition
GroupNumericUpDown.PropertyChanged += OnNumericUpDownPropertyChanged;
- NULL_CONTROL_WIDTH = (int)(50 * FactorDpiX);
+ _nullControlWidth = (int)(50 * FactorDpiX);
}
///
@@ -108,7 +112,7 @@ protected override void Dispose(bool disposing)
GroupNumericUpDown.MouseLeaveControl -= OnMouseLeaveControl;
GroupNumericUpDown.ViewPaintDelegate = null;
GroupNumericUpDown.PropertyChanged -= OnNumericUpDownPropertyChanged;
- _ribbon.ViewRibbonManager.LayoutAfter -= OnLayoutAction;
+ _ribbon.ViewRibbonManager!.LayoutAfter -= OnLayoutAction;
_ribbon.ViewRibbonManager.LayoutBefore -= OnLayoutAction;
// Remove association with definition
@@ -125,7 +129,7 @@ protected override void Dispose(bool disposing)
///
/// Gets access to the owning group numeric up-down instance.
///
- public KryptonRibbonGroupNumericUpDown GroupNumericUpDown { get; private set; }
+ public KryptonRibbonGroupNumericUpDown? GroupNumericUpDown { get; private set; }
#endregion
@@ -137,7 +141,7 @@ protected override void Dispose(bool disposing)
public override void LostFocus(Control c)
{
// Ask ribbon to shift focus to the hidden control
- _ribbon.HideFocus(GroupNumericUpDown.NumericUpDown);
+ _ribbon.HideFocus(GroupNumericUpDown?.NumericUpDown);
base.LostFocus(c);
}
#endregion
@@ -147,7 +151,7 @@ public override void LostFocus(Control c)
/// Gets the first focus item from the container.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetFirstFocusItem()
+ public ViewBase GetFirstFocusItem()
{
if (GroupNumericUpDown is { Visible: true, LastNumericUpDown.NumericUpDown.CanSelect: true })
{
@@ -155,7 +159,7 @@ public override void LostFocus(Control c)
}
else
{
- return null;
+ return null!;
}
}
#endregion
@@ -165,7 +169,7 @@ public override void LostFocus(Control c)
/// Gets the last focus item from the item.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetLastFocusItem()
+ public ViewBase GetLastFocusItem()
{
if (GroupNumericUpDown is { Visible: true, LastNumericUpDown.NumericUpDown.CanSelect: true })
{
@@ -173,7 +177,7 @@ public override void LostFocus(Control c)
}
else
{
- return null;
+ return null!;
}
}
#endregion
@@ -185,11 +189,11 @@ public override void LostFocus(Control c)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetNextFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetNextFocusItem(ViewBase current, ref bool matched)
{
// Do we match the current item?
matched = current == this;
- return null;
+ return null!;
}
#endregion
@@ -200,11 +204,11 @@ public override void LostFocus(Control c)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetPreviousFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetPreviousFocusItem(ViewBase current, ref bool matched)
{
// Do we match the current item?
matched = current == this;
- return null;
+ return null!;
}
#endregion
@@ -217,7 +221,7 @@ public override void LostFocus(Control c)
public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
{
// Only provide a key tip if we are visible and the target control can accept focus
- if (Visible && LastNumericUpDown.CanFocus)
+ if (Visible && LastNumericUpDown!.CanFocus)
{
// Get the screen location of the button
Rectangle viewRect = _ribbon.KeyTipToScreen(this);
@@ -225,7 +229,7 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
// Determine the screen position of the key tip
var screenPt = Point.Empty;
- // Determine the screen position of the key tip dependant on item location/size
+ // Determine the screen position of the key tip dependent on item location/size
switch (_currentSize)
{
case GroupItemSize.Large:
@@ -237,7 +241,7 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
break;
}
- keyTipList.Add(new KeyTipInfo(GroupNumericUpDown.Enabled,
+ keyTipList.Add(new KeyTipInfo(GroupNumericUpDown!.Enabled,
GroupNumericUpDown.KeyTip,
screenPt,
ClientRectangle,
@@ -256,7 +260,7 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
///
/// Reset the group item size to the item definition.
///
- public void ResetGroupItemSize() => _currentSize = GroupNumericUpDown.ItemSizeCurrent;
+ public void ResetGroupItemSize() => _currentSize = GroupNumericUpDown!.ItemSizeCurrent;
///
/// Discover the preferred size of the element.
@@ -267,7 +271,7 @@ public override Size GetPreferredSize(ViewLayoutContext context)
var preferredSize = Size.Empty;
// Ensure the control has the correct parent
- UpdateParent(context.Control);
+ UpdateParent(context.Control!);
// If there is a numeric up-down associated then ask for its requested size
if (LastNumericUpDown != null)
@@ -282,7 +286,7 @@ public override Size GetPreferredSize(ViewLayoutContext context)
}
else
{
- preferredSize.Width = NULL_CONTROL_WIDTH;
+ preferredSize.Width = _nullControlWidth;
}
preferredSize.Height = _currentSize == GroupItemSize.Large
@@ -301,10 +305,10 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
Debug.Assert(context != null);
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// Are we allowed to change the layout of controls?
- if (!context.ViewManager.DoNotLayoutControls)
+ if (!context.ViewManager!.DoNotLayoutControls)
{
// If we have an actual control, position it with a pixel padding all around
LastNumericUpDown?.SetBounds(ClientLocation.X + 1,
@@ -328,7 +332,7 @@ public override void Render([DisallowNull] RenderContext context)
Debug.Assert(context != null);
// If we do not have a numeric up-down
- if (GroupNumericUpDown.NumericUpDown == null)
+ if (GroupNumericUpDown?.NumericUpDown == null)
{
// And we are in design time
if (_ribbon.InDesignMode)
@@ -339,8 +343,8 @@ public override void Render([DisallowNull] RenderContext context)
drawRect.Height--;
// Draw an indication of where the numeric up-down will be
- context.Graphics.FillRectangle(Brushes.Goldenrod, drawRect);
- context.Graphics.DrawRectangle(Pens.Gold, drawRect);
+ context?.Graphics.FillRectangle(Brushes.Goldenrod, drawRect);
+ context?.Graphics.DrawRectangle(Pens.Gold, drawRect);
}
}
}
@@ -373,9 +377,9 @@ protected virtual void OnNeedPaint(bool needLayout, Rectangle invalidRect)
#endregion
#region Implementation
- private void OnContextClick(object sender, MouseEventArgs e) => GroupNumericUpDown.OnDesignTimeContextMenu(e);
+ private void OnContextClick(object? sender, MouseEventArgs e) => GroupNumericUpDown?.OnDesignTimeContextMenu(e);
- private void OnNumericUpDownPropertyChanged(object sender, PropertyChangedEventArgs e)
+ private void OnNumericUpDownPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
var updateLayout = false;
const bool UPDATE_PAINT = false;
@@ -383,10 +387,10 @@ private void OnNumericUpDownPropertyChanged(object sender, PropertyChangedEventA
switch (e.PropertyName)
{
case nameof(Enabled):
- UpdateEnabled(LastNumericUpDown);
+ UpdateEnabled(LastNumericUpDown!);
break;
case nameof(Visible):
- UpdateVisible(LastNumericUpDown);
+ UpdateVisible(LastNumericUpDown!);
updateLayout = true;
break;
case "CustomControl":
@@ -397,7 +401,7 @@ private void OnNumericUpDownPropertyChanged(object sender, PropertyChangedEventA
if (updateLayout)
{
// If we are on the currently selected tab then...
- if ((GroupNumericUpDown.RibbonTab != null) &&
+ if ((GroupNumericUpDown?.RibbonTab != null) &&
(_ribbon.SelectedTab == GroupNumericUpDown.RibbonTab))
{
// ...layout so the visible change is made
@@ -423,16 +427,16 @@ private void OnNumericUpDownPropertyChanged(object sender, PropertyChangedEventA
#pragma warning restore 162
}
- private Control LastParentControl
+ private Control? LastParentControl
{
- get => GroupNumericUpDown.LastParentControl;
- set => GroupNumericUpDown.LastParentControl = value;
+ get => GroupNumericUpDown!.LastParentControl;
+ set => GroupNumericUpDown!.LastParentControl = value;
}
private KryptonNumericUpDown? LastNumericUpDown
{
- get => GroupNumericUpDown.LastNumericUpDown;
- set => GroupNumericUpDown.LastNumericUpDown = value;
+ get => GroupNumericUpDown!.LastNumericUpDown;
+ set => GroupNumericUpDown!.LastNumericUpDown = value;
}
private void UpdateParent(Control parentControl)
@@ -440,13 +444,13 @@ private void UpdateParent(Control parentControl)
// Is there a change in the numeric up-down or a change in
// the parent control that is hosting the control...
if ((parentControl != LastParentControl) ||
- (LastNumericUpDown != GroupNumericUpDown.NumericUpDown))
+ (LastNumericUpDown != GroupNumericUpDown!.NumericUpDown))
{
// We only modify the parent and visible state if processing for correct container
- if ((GroupNumericUpDown.RibbonContainer.RibbonGroup.ShowingAsPopup && (parentControl is VisualPopupGroup)) ||
+ if ((GroupNumericUpDown!.RibbonContainer!.RibbonGroup!.ShowingAsPopup && (parentControl is VisualPopupGroup)) ||
(!GroupNumericUpDown.RibbonContainer.RibbonGroup.ShowingAsPopup && parentControl is not VisualPopupGroup))
{
- // If we have added the custrom control to a parent before
+ // If we have added the custom control to a parent before
if ((LastNumericUpDown != null) && (LastParentControl != null))
{
// If that control is still a child of the old parent
@@ -477,12 +481,12 @@ private void UpdateParent(Control parentControl)
}
}
- private void UpdateEnabled(Control c)
+ private void UpdateEnabled(Control? c)
{
if (c != null)
{
// Start with the enabled state of the group element
- var enabled = GroupNumericUpDown.Enabled;
+ var enabled = GroupNumericUpDown!.Enabled;
// If we have an associated designer setup...
if (!_ribbon.InDesignHelperMode && (GroupNumericUpDown.NumericUpDownDesigner != null))
@@ -495,12 +499,12 @@ private void UpdateEnabled(Control c)
}
}
- private bool ActualVisible(Control c)
+ private bool ActualVisible(Control? c)
{
if (c != null)
{
// Start with the visible state of the group element
- var visible = GroupNumericUpDown.Visible;
+ var visible = GroupNumericUpDown!.Visible;
// If we have an associated designer setup...
if (!_ribbon.InDesignHelperMode && (GroupNumericUpDown.NumericUpDownDesigner != null))
@@ -515,12 +519,12 @@ private bool ActualVisible(Control c)
return false;
}
- private void UpdateVisible(Control c)
+ private void UpdateVisible(Control? c)
{
if (c != null)
{
// Start with the visible state of the group element
- var visible = GroupNumericUpDown.Visible;
+ var visible = GroupNumericUpDown!.Visible;
// If we have an associated designer setup...
if (!_ribbon.InDesignHelperMode && (GroupNumericUpDown.NumericUpDownDesigner != null))
@@ -549,7 +553,7 @@ private void UpdateVisible(Control c)
else
{
// Check that the group is not collapsed
- if (GroupNumericUpDown.RibbonContainer.RibbonGroup.IsCollapsed &&
+ if (GroupNumericUpDown!.RibbonContainer!.RibbonGroup!.IsCollapsed &&
((_ribbon.GetControllerControl(GroupNumericUpDown.NumericUpDown) is KryptonRibbon) ||
(_ribbon.GetControllerControl(GroupNumericUpDown.NumericUpDown) is VisualPopupMinimized))
)
@@ -572,7 +576,7 @@ private void UpdateVisible(Control c)
}
// Move up a level
- container = container.RibbonContainer;
+ container = container.RibbonContainer!;
}
}
}
@@ -583,7 +587,7 @@ private void UpdateVisible(Control c)
}
}
- private void OnLayoutAction(object sender, EventArgs e)
+ private void OnLayoutAction(object? sender, EventArgs e)
{
// If not disposed then we still have a element reference
if (GroupNumericUpDown != null)
@@ -593,13 +597,13 @@ private void OnLayoutAction(object sender, EventArgs e)
}
}
- private void OnMouseEnterControl(object sender, EventArgs e)
+ private void OnMouseEnterControl(object? sender, EventArgs e)
{
// Reset the active group setting
_activeGroup = null;
// Find the parent group instance
- ViewBase parent = Parent;
+ ViewBase? parent = Parent;
// Keep going till we get to the top or find a group
while (parent != null)
@@ -618,17 +622,17 @@ private void OnMouseEnterControl(object sender, EventArgs e)
if (_activeGroup != null)
{
_activeGroup.Tracking = true;
- _needPaint(this, new NeedLayoutEventArgs(false, _activeGroup.ClientRectangle));
+ _needPaint!(this, new NeedLayoutEventArgs(false, _activeGroup.ClientRectangle));
}
}
- private void OnMouseLeaveControl(object sender, EventArgs e)
+ private void OnMouseLeaveControl(object? sender, EventArgs e)
{
// If we have a cached group we made active
if (_activeGroup != null)
{
_activeGroup.Tracking = false;
- _needPaint(this, new NeedLayoutEventArgs(false, _activeGroup.ClientRectangle));
+ _needPaint!(this, new NeedLayoutEventArgs(false, _activeGroup.ClientRectangle));
_activeGroup = null;
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupRadioButton.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupRadioButton.cs
index 670ed9c1f..25c7f4655 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupRadioButton.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupRadioButton.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -49,18 +49,18 @@ internal class ViewDrawRibbonGroupRadioButton : ViewComposite,
/// Reference to owning ribbon control.
/// Reference to source radio button definition.
/// Delegate for notifying paint requests.
- public ViewDrawRibbonGroupRadioButton([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupRadioButton ribbonRadioButton,
- [DisallowNull] NeedPaintHandler needPaint)
+ public ViewDrawRibbonGroupRadioButton([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupRadioButton? ribbonRadioButton,
+ [DisallowNull] NeedPaintHandler? needPaint)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(ribbonRadioButton != null);
- Debug.Assert(needPaint != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(ribbonRadioButton is not null);
+ Debug.Assert(needPaint is not null);
// Remember incoming references
- _ribbon = ribbon;
- GroupRadioButton = ribbonRadioButton;
- _needPaint = needPaint;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ GroupRadioButton = ribbonRadioButton ?? throw new ArgumentNullException(nameof(ribbonRadioButton));
+ _needPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
_currentSize = GroupRadioButton.ItemSizeCurrent;
// Create delegate used to process end of click action
@@ -129,7 +129,7 @@ protected override void Dispose(bool disposing)
/// Gets the first focus item from the item.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetFirstFocusItem()
+ public ViewBase GetFirstFocusItem()
{
// Only take focus if we are visible and enabled
if (GroupRadioButton is { Visible: true, Enabled: true })
@@ -138,7 +138,7 @@ protected override void Dispose(bool disposing)
}
else
{
- return null;
+ return null!;
}
}
#endregion
@@ -148,7 +148,7 @@ protected override void Dispose(bool disposing)
/// Gets the last focus item from the item.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetLastFocusItem()
+ public ViewBase GetLastFocusItem()
{
// Only take focus if we are visible and enabled
if (GroupRadioButton is { Visible: true, Enabled: true })
@@ -157,7 +157,7 @@ protected override void Dispose(bool disposing)
}
else
{
- return null;
+ return null!;
}
}
#endregion
@@ -169,11 +169,11 @@ protected override void Dispose(bool disposing)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetNextFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetNextFocusItem(ViewBase current, ref bool matched)
{
// Do we match the current item?
matched = (current == _viewLarge) || (current == _viewMediumSmall);
- return null;
+ return null!;
}
#endregion
@@ -184,11 +184,11 @@ protected override void Dispose(bool disposing)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetPreviousFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetPreviousFocusItem(ViewBase current, ref bool matched)
{
// Do we match the current item?
matched = (current == _viewLarge) || (current == _viewMediumSmall);
- return null;
+ return null!;
}
#endregion
@@ -224,7 +224,7 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
}
keyTipList.Add(new KeyTipInfo(GroupRadioButton.Enabled, GroupRadioButton.KeyTip,
- screenPt, this[0].ClientRectangle, controller));
+ screenPt, this[0]!.ClientRectangle, controller));
}
}
#endregion
@@ -271,7 +271,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
UpdateItemSizeState();
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// Let child elements layout in given space
base.Layout(context);
@@ -330,7 +330,7 @@ private void CreateLargeRadioButtonView()
_viewLarge.Add(new ViewLayoutRibbonSeparator(1, false), ViewDockStyle.Bottom);
// Create controller for handling mouse, keyboard and focus
- _viewLargeController = new GroupRadioButtonController(_ribbon, _viewLarge, _viewLargeImage, _needPaint);
+ _viewLargeController = new GroupRadioButtonController(_ribbon, _viewLarge, _viewLargeImage, _needPaint!);
_viewLargeController.Click += OnLargeRadioButtonClick;
_viewLargeController.ContextClick += OnContextClick;
_viewLarge.MouseController = _viewLargeController;
@@ -338,7 +338,7 @@ private void CreateLargeRadioButtonView()
_viewLarge.KeyController = _viewLargeController;
// Create controller for intercepting events to determine tool tip handling
- _viewLarge.MouseController = new ToolTipController(_ribbon.TabsArea.ButtonSpecManager.ToolTipManager,
+ _viewLarge.MouseController = new ToolTipController(_ribbon.TabsArea!.ButtonSpecManager!.ToolTipManager!,
_viewLarge, _viewLarge.MouseController);
}
@@ -368,7 +368,7 @@ private void CreateMediumSmallRadioButtonView()
_viewMediumSmall.Add(_viewMediumSmallCenter, ViewDockStyle.Fill);
// Create controller for handling mouse, keyboard and focus
- _viewMediumSmallController = new GroupRadioButtonController(_ribbon, _viewMediumSmall, _viewMediumSmallImage, _needPaint);
+ _viewMediumSmallController = new GroupRadioButtonController(_ribbon, _viewMediumSmall, _viewMediumSmallImage, _needPaint!);
_viewMediumSmallController.Click += OnMediumSmallRadioButtonClick;
_viewMediumSmallController.ContextClick += OnContextClick;
_viewMediumSmall.MouseController = _viewMediumSmallController;
@@ -376,7 +376,7 @@ private void CreateMediumSmallRadioButtonView()
_viewMediumSmall.KeyController = _viewMediumSmallController;
// Create controller for intercepting events to determine tool tip handling
- _viewMediumSmall.MouseController = new ToolTipController(_ribbon.TabsArea.ButtonSpecManager.ToolTipManager,
+ _viewMediumSmall.MouseController = new ToolTipController(_ribbon.TabsArea!.ButtonSpecManager!.ToolTipManager!,
_viewMediumSmall, _viewMediumSmall.MouseController);
}
@@ -433,13 +433,13 @@ private void UpdateItemSizeState(GroupItemSize size)
}
}
- private void OnLargeRadioButtonClick(object sender, EventArgs e) => GroupRadioButton.PerformClick(_finishDelegateLarge);
+ private void OnLargeRadioButtonClick(object? sender, EventArgs e) => GroupRadioButton.PerformClick(_finishDelegateLarge);
- private void OnMediumSmallRadioButtonClick(object sender, EventArgs e) => GroupRadioButton.PerformClick(_finishDelegateMediumSmall);
+ private void OnMediumSmallRadioButtonClick(object? sender, EventArgs e) => GroupRadioButton.PerformClick(_finishDelegateMediumSmall);
- private void OnContextClick(object sender, MouseEventArgs e) => GroupRadioButton.OnDesignTimeContextMenu(e);
+ private void OnContextClick(object? sender, MouseEventArgs e) => GroupRadioButton.OnDesignTimeContextMenu(e);
- private void ActionFinishedLarge(object sender, EventArgs e)
+ private void ActionFinishedLarge(object? sender, EventArgs e)
{
// Remove any popups that result from an action occurring
_ribbon.ActionOccurred();
@@ -448,7 +448,7 @@ private void ActionFinishedLarge(object sender, EventArgs e)
_viewLargeController?.RemoveFixed();
}
- private void ActionFinishedMediumSmall(object sender, EventArgs e)
+ private void ActionFinishedMediumSmall(object? sender, EventArgs e)
{
// Remove any popups that result from an action occurring
_ribbon.ActionOccurred();
@@ -457,7 +457,7 @@ private void ActionFinishedMediumSmall(object sender, EventArgs e)
_viewMediumSmallController?.RemoveFixed();
}
- private void OnRadioButtonPropertyChanged(object sender, PropertyChangedEventArgs e)
+ private void OnRadioButtonPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
var updateLayout = false;
var updatePaint = false;
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupRadioButtonImage.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupRadioButtonImage.cs
index 16af7f422..7812b7ccc 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupRadioButtonImage.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupRadioButtonImage.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -34,14 +34,14 @@ internal class ViewDrawRibbonGroupRadioButtonImage : ViewComposite
/// Reference to owning ribbon control.
/// Reference to ribbon group radio button definition.
/// Show the large image.
- public ViewDrawRibbonGroupRadioButtonImage(KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupRadioButton ribbonRadioButton,
+ public ViewDrawRibbonGroupRadioButtonImage([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupRadioButton? ribbonRadioButton,
bool large)
{
- Debug.Assert(ribbonRadioButton != null);
+ Debug.Assert(ribbonRadioButton is not null);
// Remember incoming parameters
- _ribbonRadioButton = ribbonRadioButton;
+ _ribbonRadioButton = ribbonRadioButton ?? throw new ArgumentNullException(nameof(ribbonRadioButton));
_large = large;
// Use redirector to get the radio button images and redirect to parent palette
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupRadioButtonText.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupRadioButtonText.cs
index 5eb97a75c..3c51b6e60 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupRadioButtonText.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupRadioButtonText.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -24,7 +24,7 @@ internal class ViewDrawRibbonGroupRadioButtonText : ViewLeaf,
private readonly KryptonRibbon _ribbon;
private readonly KryptonRibbonGroupRadioButton _ribbonRadioButton;
private readonly RibbonGroupNormalDisabledTextToContent _contentProvider;
- private IDisposable _memento;
+ private IDisposable? _memento;
private readonly bool _firstText;
private int _heightExtra;
private Size _preferredSize;
@@ -41,15 +41,15 @@ internal class ViewDrawRibbonGroupRadioButtonText : ViewLeaf,
/// Source ribbon control.
/// Group radio button to display title for.
/// Should show the first button text.
- public ViewDrawRibbonGroupRadioButtonText([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupRadioButton ribbonRadioButton,
+ public ViewDrawRibbonGroupRadioButtonText([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupRadioButton? ribbonRadioButton,
bool firstText)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(ribbonRadioButton != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(ribbonRadioButton is not null);
- _ribbon = ribbon;
- _ribbonRadioButton = ribbonRadioButton;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _ribbonRadioButton = ribbonRadioButton ?? throw new ArgumentNullException(nameof(ribbonRadioButton));
_firstText = firstText;
// Use a class to convert from ribbon group to content interface
@@ -103,7 +103,17 @@ public void MakeDirty()
/// Layout context.
public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
+
+ if (context is null)
+ {
+ throw new ArgumentNullException(nameof(context));
+ }
+
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
// Validate incoming reference
if (context == null)
@@ -124,7 +134,7 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
// Ask the renderer for the contents preferred size
_preferredSize = context.Renderer.RenderStandardContent.GetContentPreferredSize(context, _contentProvider,
this, VisualOrientation.Top,
- State, false, false);
+ State);
// Subtract the extra space used to ensure it draws
_heightExtra = (_ribbon.CalculatedValues.DrawFontHeight - _ribbon.CalculatedValues.RawFontHeight) * 2;
@@ -150,10 +160,20 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
/// Layout context.
public override void Layout([DisallowNull] ViewLayoutContext context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
+
+ if (context is null)
+ {
+ throw new ArgumentNullException(nameof(context));
+ }
+
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// A change in state always causes a size and layout calculation
if (_cacheState != State)
@@ -183,7 +203,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
_memento = context.Renderer.RenderStandardContent.LayoutContent(context, drawRect,
_contentProvider, this,
VisualOrientation.Top,
- PaletteState.Normal, false, false);
+ PaletteState.Normal);
// Cache values that are needed to decide if layout is needed
_displayRect = ClientRectangle;
@@ -199,6 +219,11 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
/// Rendering context.
public override void RenderBefore(RenderContext context)
{
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
Rectangle drawRect = ClientRectangle;
// Adjust the client rect so the text has enough room to be drawn
@@ -211,7 +236,7 @@ public override void RenderBefore(RenderContext context)
context.Renderer.RenderStandardContent.DrawContent(context, drawRect,
_contentProvider, _memento,
VisualOrientation.Top,
- State, false, false, true);
+ State, true);
}
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupRichTextBox.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupRichTextBox.cs
index cae0ce6f7..596935dff 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupRichTextBox.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupRichTextBox.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -21,9 +21,9 @@ internal class ViewDrawRibbonGroupRichTextBox : ViewComposite,
IRibbonViewGroupItemView
{
#region Instance Fields
- private readonly int NULL_CONTROL_WIDTH; // = 50;
+ private readonly int _nullControlWidth; // = 50;
private readonly KryptonRibbon _ribbon;
- private ViewDrawRibbonGroup _activeGroup;
+ private ViewDrawRibbonGroup? _activeGroup;
private readonly RichTextBoxController? _controller;
private readonly NeedPaintHandler _needPaint;
private GroupItemSize _currentSize;
@@ -36,18 +36,18 @@ internal class ViewDrawRibbonGroupRichTextBox : ViewComposite,
/// Reference to owning ribbon control.
/// Reference to source richtextbox.
/// Delegate for notifying paint requests.
- public ViewDrawRibbonGroupRichTextBox([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupRichTextBox ribbonRichTextBox,
- [DisallowNull] NeedPaintHandler needPaint)
+ public ViewDrawRibbonGroupRichTextBox([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupRichTextBox? ribbonRichTextBox,
+ [DisallowNull] NeedPaintHandler? needPaint)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(ribbonRichTextBox != null);
- Debug.Assert(needPaint != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(ribbonRichTextBox is not null);
+ Debug.Assert(needPaint is not null);
// Remember incoming references
- _ribbon = ribbon;
- GroupRichTextBox = ribbonRichTextBox;
- _needPaint = needPaint;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ GroupRichTextBox = ribbonRichTextBox ?? throw new ArgumentNullException(nameof(ribbonRichTextBox));
+ _needPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
_currentSize = GroupRichTextBox.ItemSizeCurrent;
// Hook into the richtextbox events
@@ -71,7 +71,7 @@ public ViewDrawRibbonGroupRichTextBox([DisallowNull] KryptonRibbon ribbon,
KeyController = _controller;
// We need to rest visibility of the richtextbox for each layout cycle
- _ribbon.ViewRibbonManager.LayoutBefore += OnLayoutAction;
+ _ribbon.ViewRibbonManager!.LayoutBefore += OnLayoutAction;
_ribbon.ViewRibbonManager.LayoutAfter += OnLayoutAction;
// Define back reference to view for the rich text box definition
@@ -80,9 +80,13 @@ public ViewDrawRibbonGroupRichTextBox([DisallowNull] KryptonRibbon ribbon,
// Give paint delegate to richtextbox so its palette changes are redrawn
GroupRichTextBox.ViewPaintDelegate = needPaint;
+ // Update all views to reflect current state
+ UpdateEnabled(GroupRichTextBox.RichTextBox);
+ UpdateVisible(GroupRichTextBox.RichTextBox);
+
// Hook into changes in the ribbon custom definition
GroupRichTextBox.PropertyChanged += OnRichTextBoxPropertyChanged;
- NULL_CONTROL_WIDTH = (int)(50 * FactorDpiX);
+ _nullControlWidth = (int)(50 * FactorDpiX);
}
///
@@ -108,7 +112,7 @@ protected override void Dispose(bool disposing)
GroupRichTextBox.MouseLeaveControl -= OnMouseLeaveControl;
GroupRichTextBox.ViewPaintDelegate = null;
GroupRichTextBox.PropertyChanged -= OnRichTextBoxPropertyChanged;
- _ribbon.ViewRibbonManager.LayoutAfter -= OnLayoutAction;
+ _ribbon.ViewRibbonManager!.LayoutAfter -= OnLayoutAction;
_ribbon.ViewRibbonManager.LayoutBefore -= OnLayoutAction;
// Remove association with definition
@@ -125,7 +129,7 @@ protected override void Dispose(bool disposing)
///
/// Gets access to the owning group richtextbox instance.
///
- public KryptonRibbonGroupRichTextBox GroupRichTextBox { get; private set; }
+ public KryptonRibbonGroupRichTextBox? GroupRichTextBox { get; private set; }
#endregion
@@ -137,7 +141,7 @@ protected override void Dispose(bool disposing)
public override void LostFocus(Control c)
{
// Ask ribbon to shift focus to the hidden control
- _ribbon.HideFocus(GroupRichTextBox.RichTextBox);
+ _ribbon.HideFocus(GroupRichTextBox!.RichTextBox);
base.LostFocus(c);
}
#endregion
@@ -147,7 +151,7 @@ public override void LostFocus(Control c)
/// Gets the first focus item from the container.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetFirstFocusItem()
+ public ViewBase GetFirstFocusItem()
{
if (GroupRichTextBox is { Visible: true, LastRichTextBox.RichTextBox.CanSelect: true })
{
@@ -155,7 +159,7 @@ public override void LostFocus(Control c)
}
else
{
- return null;
+ return null!;
}
}
#endregion
@@ -165,7 +169,7 @@ public override void LostFocus(Control c)
/// Gets the last focus item from the item.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetLastFocusItem()
+ public ViewBase GetLastFocusItem()
{
if (GroupRichTextBox is { Visible: true, LastRichTextBox.RichTextBox.CanSelect: true })
{
@@ -173,7 +177,7 @@ public override void LostFocus(Control c)
}
else
{
- return null;
+ return null!;
}
}
#endregion
@@ -185,11 +189,11 @@ public override void LostFocus(Control c)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetNextFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetNextFocusItem(ViewBase current, ref bool matched)
{
// Do we match the current item?
matched = current == this;
- return null;
+ return null!;
}
#endregion
@@ -200,11 +204,11 @@ public override void LostFocus(Control c)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetPreviousFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetPreviousFocusItem(ViewBase current, ref bool matched)
{
// Do we match the current item?
matched = current == this;
- return null;
+ return null!;
}
#endregion
@@ -217,10 +221,10 @@ public override void LostFocus(Control c)
public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
{
// Only provide a key tip if we are visible and the target control can accept focus
- if (Visible && LastRichTextBox.CanFocus)
+ if (Visible && LastRichTextBox!.CanFocus)
{
// Get the screen location of the button
- Rectangle viewRect = LastRichTextBox.Parent.RectangleToScreen(ClientRectangle);
+ Rectangle viewRect = LastRichTextBox.Parent!.RectangleToScreen(ClientRectangle);
// Determine the screen position of the key tip
var screenPt = Point.Empty;
@@ -237,7 +241,7 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
break;
}
- keyTipList.Add(new KeyTipInfo(GroupRichTextBox.Enabled,
+ keyTipList.Add(new KeyTipInfo(GroupRichTextBox!.Enabled,
GroupRichTextBox.KeyTip,
screenPt,
ClientRectangle,
@@ -256,7 +260,7 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
///
/// Reset the group item size to the item definition.
///
- public void ResetGroupItemSize() => _currentSize = GroupRichTextBox.ItemSizeCurrent;
+ public void ResetGroupItemSize() => _currentSize = GroupRichTextBox!.ItemSizeCurrent;
///
/// Discover the preferred size of the element.
@@ -267,7 +271,7 @@ public override Size GetPreferredSize(ViewLayoutContext context)
var preferredSize = Size.Empty;
// Ensure the control has the correct parent
- UpdateParent(context.Control);
+ UpdateParent(context.Control!);
// If there is a richtextbox associated then ask for its requested size
if (LastRichTextBox != null)
@@ -282,7 +286,7 @@ public override Size GetPreferredSize(ViewLayoutContext context)
}
else
{
- preferredSize.Width = NULL_CONTROL_WIDTH;
+ preferredSize.Width = _nullControlWidth;
}
preferredSize.Height = _currentSize == GroupItemSize.Large
@@ -301,10 +305,10 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
Debug.Assert(context != null);
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// Are we allowed to change the layout of controls?
- if (!context.ViewManager.DoNotLayoutControls)
+ if (!context.ViewManager!.DoNotLayoutControls)
{
// If we have an actual control, position it with a pixel padding all around
LastRichTextBox?.SetBounds(ClientLocation.X + 1,
@@ -328,7 +332,7 @@ public override void Render([DisallowNull] RenderContext context)
Debug.Assert(context != null);
// If we do not have a richtextbox
- if (GroupRichTextBox.RichTextBox == null)
+ if (GroupRichTextBox!.RichTextBox == null)
{
// And we are in design time
if (_ribbon.InDesignMode)
@@ -339,7 +343,7 @@ public override void Render([DisallowNull] RenderContext context)
drawRect.Height--;
// Draw an indication of where the richtextbox will be
- context.Graphics.FillRectangle(Brushes.Goldenrod, drawRect);
+ context!.Graphics.FillRectangle(Brushes.Goldenrod, drawRect);
context.Graphics.DrawRectangle(Pens.Gold, drawRect);
}
}
@@ -373,9 +377,9 @@ protected virtual void OnNeedPaint(bool needLayout, Rectangle invalidRect)
#endregion
#region Implementation
- private void OnContextClick(object sender, MouseEventArgs e) => GroupRichTextBox.OnDesignTimeContextMenu(e);
+ private void OnContextClick(object? sender, MouseEventArgs e) => GroupRichTextBox!.OnDesignTimeContextMenu(e);
- private void OnRichTextBoxPropertyChanged(object sender, PropertyChangedEventArgs e)
+ private void OnRichTextBoxPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
var updateLayout = false;
const bool UPDATE_PAINT = false;
@@ -383,10 +387,10 @@ private void OnRichTextBoxPropertyChanged(object sender, PropertyChangedEventArg
switch (e.PropertyName)
{
case nameof(Enabled):
- UpdateEnabled(LastRichTextBox);
+ UpdateEnabled(LastRichTextBox!);
break;
case nameof(Visible):
- UpdateVisible(LastRichTextBox);
+ UpdateVisible(LastRichTextBox!);
updateLayout = true;
break;
case "CustomControl":
@@ -397,7 +401,7 @@ private void OnRichTextBoxPropertyChanged(object sender, PropertyChangedEventArg
if (updateLayout)
{
// If we are on the currently selected tab then...
- if ((GroupRichTextBox.RibbonTab != null) &&
+ if ((GroupRichTextBox!.RibbonTab != null) &&
(_ribbon.SelectedTab == GroupRichTextBox.RibbonTab))
{
// ...layout so the visible change is made
@@ -425,14 +429,14 @@ private void OnRichTextBoxPropertyChanged(object sender, PropertyChangedEventArg
private Control LastParentControl
{
- get => GroupRichTextBox.LastParentControl;
- set => GroupRichTextBox.LastParentControl = value;
+ get => GroupRichTextBox!.LastParentControl;
+ set => GroupRichTextBox!.LastParentControl = value;
}
private KryptonRichTextBox? LastRichTextBox
{
- get => GroupRichTextBox.LastRichTextBox;
- set => GroupRichTextBox.LastRichTextBox = value;
+ get => GroupRichTextBox!.LastRichTextBox;
+ set => GroupRichTextBox!.LastRichTextBox = value;
}
private void UpdateParent(Control parentControl)
@@ -440,10 +444,10 @@ private void UpdateParent(Control parentControl)
// Is there a change in the richtextbox or a change in
// the parent control that is hosting the control...
if ((parentControl != LastParentControl) ||
- (LastRichTextBox != GroupRichTextBox.RichTextBox))
+ (LastRichTextBox != GroupRichTextBox!.RichTextBox))
{
// We only modify the parent and visible state if processing for correct container
- if ((GroupRichTextBox.RibbonContainer.RibbonGroup.ShowingAsPopup && (parentControl is VisualPopupGroup)) ||
+ if ((GroupRichTextBox!.RibbonContainer!.RibbonGroup!.ShowingAsPopup && (parentControl is VisualPopupGroup)) ||
(!GroupRichTextBox.RibbonContainer.RibbonGroup.ShowingAsPopup && parentControl is not VisualPopupGroup))
{
// If we have added the custrom control to a parent before
@@ -478,15 +482,15 @@ private void UpdateParent(Control parentControl)
}
}
- private void UpdateEnabled(Control c)
+ private void UpdateEnabled(Control? c)
{
if (c != null)
{
// Start with the enabled state of the group element
- var enabled = GroupRichTextBox.Enabled;
+ var enabled = GroupRichTextBox!.Enabled;
// If we have an associated designer setup...
- if (!_ribbon.InDesignHelperMode && (GroupRichTextBox.RichTextBoxDesigner != null))
+ if (!_ribbon.InDesignHelperMode && (GroupRichTextBox?.RichTextBoxDesigner != null))
{
// And we are not using the design helpers, then use the design specified value
enabled = GroupRichTextBox.RichTextBoxDesigner.DesignEnabled;
@@ -496,15 +500,15 @@ private void UpdateEnabled(Control c)
}
}
- private bool ActualVisible(Control c)
+ private bool ActualVisible(Control? c)
{
if (c != null)
{
// Start with the visible state of the group element
- var visible = GroupRichTextBox.Visible;
+ var visible = GroupRichTextBox!.Visible;
// If we have an associated designer setup...
- if (!_ribbon.InDesignHelperMode && (GroupRichTextBox.RichTextBoxDesigner != null))
+ if (!_ribbon.InDesignHelperMode && (GroupRichTextBox?.RichTextBoxDesigner != null))
{
// And we are not using the design helpers, then use the design specified value
visible = GroupRichTextBox.RichTextBoxDesigner.DesignVisible;
@@ -516,15 +520,15 @@ private bool ActualVisible(Control c)
return false;
}
- private void UpdateVisible(Control c)
+ private void UpdateVisible(Control? c)
{
if (c != null)
{
// Start with the visible state of the group element
- var visible = GroupRichTextBox.Visible;
+ var visible = GroupRichTextBox!.Visible;
// If we have an associated designer setup...
- if (!_ribbon.InDesignHelperMode && (GroupRichTextBox.RichTextBoxDesigner != null))
+ if (!_ribbon.InDesignHelperMode && (GroupRichTextBox?.RichTextBoxDesigner != null))
{
// And we are not using the design helpers, then use the design specified value
visible = GroupRichTextBox.RichTextBoxDesigner.DesignVisible;
@@ -533,7 +537,7 @@ private void UpdateVisible(Control c)
if (visible)
{
// Only visible if on the currently selected page
- if ((GroupRichTextBox.RibbonTab == null) ||
+ if ((GroupRichTextBox?.RibbonTab == null) ||
(_ribbon.SelectedTab != GroupRichTextBox.RibbonTab))
{
visible = false;
@@ -550,7 +554,7 @@ private void UpdateVisible(Control c)
else
{
// Check that the group is not collapsed
- if (GroupRichTextBox.RibbonContainer.RibbonGroup.IsCollapsed &&
+ if (GroupRichTextBox.RibbonContainer!.RibbonGroup!.IsCollapsed &&
((_ribbon.GetControllerControl(GroupRichTextBox.RichTextBox) is KryptonRibbon) ||
(_ribbon.GetControllerControl(GroupRichTextBox.RichTextBox) is VisualPopupMinimized))
)
@@ -560,10 +564,10 @@ private void UpdateVisible(Control c)
else
{
// Check that the hierarchy of containers are all visible
- KryptonRibbonGroupContainer container = GroupRichTextBox.RibbonContainer;
+ KryptonRibbonGroupContainer? container = GroupRichTextBox.RibbonContainer;
// Keep going until we have searched the entire parent chain of containers
- while (container != null)
+ while (container is not null)
{
// If any parent container is not visible, then we are not visible
if (!container.Visible)
@@ -584,23 +588,23 @@ private void UpdateVisible(Control c)
}
}
- private void OnLayoutAction(object sender, EventArgs e)
+ private void OnLayoutAction(object? sender, EventArgs e)
{
// If not disposed then we still have a element reference
if (GroupRichTextBox != null)
{
// Change in selected tab requires a retest of the control visibility
- UpdateVisible(LastRichTextBox);
+ UpdateVisible(LastRichTextBox!);
}
}
- private void OnMouseEnterControl(object sender, EventArgs e)
+ private void OnMouseEnterControl(object? sender, EventArgs e)
{
// Reset the active group setting
_activeGroup = null;
// Find the parent group instance
- ViewBase parent = Parent;
+ ViewBase? parent = Parent;
// Keep going till we get to the top or find a group
while (parent != null)
@@ -623,7 +627,7 @@ private void OnMouseEnterControl(object sender, EventArgs e)
}
}
- private void OnMouseLeaveControl(object sender, EventArgs e)
+ private void OnMouseLeaveControl(object? sender, EventArgs e)
{
// If we have a cached group we made active
if (_activeGroup != null)
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupSeparator.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupSeparator.cs
index 046bf9bb1..2f5349678 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupSeparator.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupSeparator.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -24,7 +24,7 @@ internal class ViewDrawRibbonGroupSeparator : ViewLeaf,
private readonly Size _preferredSize2007; // = new(4, 4);
private readonly Size _preferredSize2010; // = new(7, 4);
private readonly KryptonRibbon _ribbon;
- private KryptonRibbonGroupSeparator _ribbonSeparator;
+ private KryptonRibbonGroupSeparator? _ribbonSeparator;
private readonly NeedPaintHandler _needPaint;
private Size _preferredSize;
private PaletteRibbonShape _lastShape;
@@ -37,17 +37,17 @@ internal class ViewDrawRibbonGroupSeparator : ViewLeaf,
/// Reference to owning ribbon control.
/// Reference to group separator definition.
/// Delegate for notifying paint requests.
- public ViewDrawRibbonGroupSeparator([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupSeparator ribbonSeparator,
- [DisallowNull] NeedPaintHandler needPaint)
+ public ViewDrawRibbonGroupSeparator([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupSeparator? ribbonSeparator,
+ [DisallowNull] NeedPaintHandler? needPaint)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(ribbonSeparator != null);
- Debug.Assert(needPaint != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(ribbonSeparator is not null);
+ Debug.Assert(needPaint is not null);
- _ribbon = ribbon;
- _ribbonSeparator = ribbonSeparator;
- _needPaint = needPaint;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _ribbonSeparator = ribbonSeparator ?? throw new ArgumentNullException(nameof(ribbonSeparator));
+ _needPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
// Associate this view with the source component (required for design time selection)
Component = _ribbonSeparator;
@@ -91,7 +91,7 @@ protected override void Dispose(bool disposing)
if (disposing)
{
// Must unhook to prevent memory leaks
- _ribbonSeparator.PropertyChanged -= OnSeparatorPropertyChanged;
+ _ribbonSeparator!.PropertyChanged -= OnSeparatorPropertyChanged;
// Remove association with definition
_ribbonSeparator.SeparatorView = null;
@@ -107,9 +107,9 @@ protected override void Dispose(bool disposing)
/// Gets the first focus item from the container.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetFirstFocusItem() =>
+ public ViewBase GetFirstFocusItem() =>
// We never have any child items that can take focus
- null;
+ null!;
#endregion
@@ -118,9 +118,9 @@ protected override void Dispose(bool disposing)
/// Gets the last focus item from the item.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetLastFocusItem() =>
+ public ViewBase GetLastFocusItem() =>
// We never have any child items that can take focus
- null;
+ null!;
#endregion
@@ -131,9 +131,9 @@ protected override void Dispose(bool disposing)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetNextFocusItem(ViewBase current, ref bool matched) =>
+ public ViewBase GetNextFocusItem(ViewBase current, ref bool matched) =>
// We never have any child items that can take focus
- null;
+ null!;
#endregion
@@ -144,9 +144,9 @@ protected override void Dispose(bool disposing)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetPreviousFocusItem(ViewBase current, ref bool matched) =>
+ public ViewBase GetPreviousFocusItem(ViewBase current, ref bool matched) =>
// We never have any child items that can take focus
- null;
+ null!;
#endregion
@@ -186,7 +186,7 @@ public ItemSizeWidth[] GetPossibleSizes(ViewLayoutContext context)
}
// Return the one possible size allowed
- return new ItemSizeWidth[] { new ItemSizeWidth(GroupItemSize.Large, _preferredSize.Width) };
+ return [new ItemSizeWidth(GroupItemSize.Large, _preferredSize.Width)];
}
///
@@ -219,7 +219,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
Debug.Assert(context != null);
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
}
#endregion
@@ -228,11 +228,19 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
/// Perform rendering before child elements are rendered.
///
/// Rendering context.
- public override void RenderBefore(RenderContext context) => context.Renderer.RenderGlyph.DrawRibbonGroupSeparator(_ribbon.RibbonShape,
+ public override void RenderBefore(RenderContext context)
+ {
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
+ context.Renderer.RenderGlyph.DrawRibbonGroupSeparator(_ribbon.RibbonShape,
context,
ClientRectangle,
_ribbon.StateCommon.RibbonGeneral,
State);
+ }
#endregion
#region Protected
@@ -255,15 +263,15 @@ protected virtual void OnNeedPaint(bool needLayout)
#endregion
#region Implementation
- private void OnContextClick(object sender, MouseEventArgs e) => _ribbonSeparator.OnDesignTimeContextMenu(e);
+ private void OnContextClick(object? sender, MouseEventArgs e) => _ribbonSeparator!.OnDesignTimeContextMenu(e);
- private void OnSeparatorPropertyChanged(object sender, PropertyChangedEventArgs e)
+ private void OnSeparatorPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
switch (e.PropertyName)
{
case nameof(Visible):
// If we are on the currently selected tab then...
- if ((_ribbonSeparator.RibbonTab != null) &&
+ if ((_ribbonSeparator!.RibbonTab != null) &&
(_ribbon.SelectedTab == _ribbonSeparator.RibbonTab))
{
// ...layout so the visible change is made
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupText.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupText.cs
index 78d31ce58..900f6758b 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupText.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupText.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -24,7 +24,7 @@ internal class ViewDrawRibbonGroupText : ViewLeaf,
private readonly KryptonRibbon _ribbon;
private readonly KryptonRibbonGroup _ribbonGroup;
private readonly RibbonGroupTextToContent _contentProvider;
- private IDisposable _memento;
+ private IDisposable? _memento;
private readonly bool _firstText;
private int _heightExtra;
private Size _preferredSize;
@@ -41,15 +41,15 @@ internal class ViewDrawRibbonGroupText : ViewLeaf,
/// Source ribbon control.
/// Ribbon group to display title for.
/// Should show the first group text.
- public ViewDrawRibbonGroupText([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroup ribbonGroup,
+ public ViewDrawRibbonGroupText([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroup? ribbonGroup,
bool firstText)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(ribbonGroup != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(ribbonGroup is not null);
- _ribbon = ribbon;
- _ribbonGroup = ribbonGroup;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _ribbonGroup = ribbonGroup ?? throw new ArgumentNullException(nameof(ribbonGroup));
_firstText = firstText;
// Use a class to convert from ribbon group to content interface
@@ -102,14 +102,19 @@ public void MakeDirty()
/// Layout context.
public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
// Validate incoming reference
- if (context == null)
+ if (context is null)
{
throw new ArgumentNullException(nameof(context));
}
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
// A change in state always causes a size and layout calculation
if (_cacheState != State)
{
@@ -123,7 +128,7 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
// Ask the renderer for the contents preferred size
_preferredSize = context.Renderer.RenderStandardContent.GetContentPreferredSize(context, _contentProvider, this,
VisualOrientation.Top,
- PaletteState.Normal, false, false);
+ PaletteState.Normal);
// Subtract the extra space used to ensure it draws
_heightExtra = (_ribbon.CalculatedValues.DrawFontHeight - _ribbon.CalculatedValues.RawFontHeight) * 2;
@@ -142,10 +147,20 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
/// Layout context.
public override void Layout([DisallowNull] ViewLayoutContext context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
+
+ if (context is null)
+ {
+ throw new ArgumentNullException(nameof(context));
+ }
+
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// A change in state always causes a size and layout calculation
if (_cacheState != State)
@@ -175,7 +190,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
_memento = context.Renderer.RenderStandardContent.LayoutContent(context, drawRect,
_contentProvider, this,
VisualOrientation.Top,
- PaletteState.Normal, false, false);
+ PaletteState.Normal);
// Cache values that are needed to decide if layout is needed
_displayRect = ClientRectangle;
_dirtyPaletteLayout = _ribbon.DirtyPaletteCounter;
@@ -190,6 +205,11 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
/// Rendering context.
public override void RenderBefore(RenderContext context)
{
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
Rectangle drawRect = ClientRectangle;
// Adjust the client rect so the text has enough room to be drawn
@@ -202,7 +222,7 @@ public override void RenderBefore(RenderContext context)
context.Renderer.RenderStandardContent.DrawContent(context, drawRect,
_contentProvider, _memento,
VisualOrientation.Top,
- PaletteState.Normal, false, false, true);
+ PaletteState.Normal, true);
}
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupTextBox.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupTextBox.cs
index 46efa4ccc..174f956a3 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupTextBox.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupTextBox.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -21,9 +21,9 @@ internal class ViewDrawRibbonGroupTextBox : ViewComposite,
IRibbonViewGroupItemView
{
#region Instance Fields
- private readonly int NULL_CONTROL_WIDTH; // = 50;
+ private readonly int _nullControlWidth; // = 50;
private readonly KryptonRibbon _ribbon;
- private ViewDrawRibbonGroup _activeGroup;
+ private ViewDrawRibbonGroup? _activeGroup;
private readonly TextBoxController? _controller;
private readonly NeedPaintHandler _needPaint;
private GroupItemSize _currentSize;
@@ -45,9 +45,9 @@ public ViewDrawRibbonGroupTextBox([DisallowNull] KryptonRibbon ribbon,
Debug.Assert(needPaint != null);
// Remember incoming references
- _ribbon = ribbon;
- GroupTextBox = ribbonTextBox;
- _needPaint = needPaint;
+ _ribbon = ribbon!;
+ GroupTextBox = ribbonTextBox!;
+ _needPaint = needPaint!;
_currentSize = GroupTextBox.ItemSizeCurrent;
// Hook into the textbox events
@@ -71,7 +71,7 @@ public ViewDrawRibbonGroupTextBox([DisallowNull] KryptonRibbon ribbon,
KeyController = _controller;
// We need to rest visibility of the textbox for each layout cycle
- _ribbon.ViewRibbonManager.LayoutBefore += OnLayoutAction;
+ _ribbon.ViewRibbonManager!.LayoutBefore += OnLayoutAction;
_ribbon.ViewRibbonManager.LayoutAfter += OnLayoutAction;
// Define back reference to view for the text box definition
@@ -80,9 +80,13 @@ public ViewDrawRibbonGroupTextBox([DisallowNull] KryptonRibbon ribbon,
// Give paint delegate to textbox so its palette changes are redrawn
GroupTextBox.ViewPaintDelegate = needPaint;
+ // Update all views to reflect current state
+ UpdateEnabled(GroupTextBox.TextBox);
+ UpdateVisible(GroupTextBox.TextBox);
+
// Hook into changes in the ribbon custom definition
GroupTextBox.PropertyChanged += OnTextBoxPropertyChanged;
- NULL_CONTROL_WIDTH = (int)(50 * FactorDpiX);
+ _nullControlWidth = (int)(50 * FactorDpiX);
}
///
@@ -108,7 +112,7 @@ protected override void Dispose(bool disposing)
GroupTextBox.MouseLeaveControl -= OnMouseLeaveControl;
GroupTextBox.ViewPaintDelegate = null;
GroupTextBox.PropertyChanged -= OnTextBoxPropertyChanged;
- _ribbon.ViewRibbonManager.LayoutAfter -= OnLayoutAction;
+ _ribbon.ViewRibbonManager!.LayoutAfter -= OnLayoutAction;
_ribbon.ViewRibbonManager.LayoutBefore -= OnLayoutAction;
// Remove association with definition
@@ -125,7 +129,7 @@ protected override void Dispose(bool disposing)
///
/// Gets access to the owning group textbox instance.
///
- public KryptonRibbonGroupTextBox GroupTextBox { get; private set; }
+ public KryptonRibbonGroupTextBox? GroupTextBox { get; private set; }
#endregion
@@ -137,7 +141,7 @@ protected override void Dispose(bool disposing)
public override void LostFocus(Control c)
{
// Ask ribbon to shift focus to the hidden control
- _ribbon.HideFocus(GroupTextBox.TextBox);
+ _ribbon.HideFocus(GroupTextBox?.TextBox);
base.LostFocus(c);
}
#endregion
@@ -147,7 +151,7 @@ public override void LostFocus(Control c)
/// Gets the first focus item from the container.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetFirstFocusItem()
+ public ViewBase GetFirstFocusItem()
{
if (GroupTextBox is { Visible: true, LastTextBox.TextBox.CanSelect: true })
{
@@ -155,7 +159,7 @@ public override void LostFocus(Control c)
}
else
{
- return null;
+ return null!;
}
}
#endregion
@@ -165,7 +169,7 @@ public override void LostFocus(Control c)
/// Gets the last focus item from the item.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetLastFocusItem()
+ public ViewBase GetLastFocusItem()
{
if (GroupTextBox is { Visible: true, LastTextBox.TextBox.CanSelect: true })
{
@@ -173,7 +177,7 @@ public override void LostFocus(Control c)
}
else
{
- return null;
+ return null!;
}
}
#endregion
@@ -185,11 +189,11 @@ public override void LostFocus(Control c)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetNextFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetNextFocusItem(ViewBase current, ref bool matched)
{
// Do we match the current item?
matched = current == this;
- return null;
+ return null!;
}
#endregion
@@ -200,11 +204,11 @@ public override void LostFocus(Control c)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetPreviousFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetPreviousFocusItem(ViewBase current, ref bool matched)
{
// Do we match the current item?
matched = current == this;
- return null;
+ return null!;
}
#endregion
@@ -217,7 +221,7 @@ public override void LostFocus(Control c)
public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
{
// Only provide a key tip if we are visible and the target control can accept focus
- if (Visible && LastTextBox.CanFocus)
+ if (Visible && LastTextBox!.CanFocus)
{
// Get the screen location of the button
Rectangle viewRect = _ribbon.KeyTipToScreen(this);
@@ -237,7 +241,7 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
break;
}
- keyTipList.Add(new KeyTipInfo(GroupTextBox.Enabled,
+ keyTipList.Add(new KeyTipInfo(GroupTextBox!.Enabled,
GroupTextBox.KeyTip,
screenPt,
ClientRectangle,
@@ -256,7 +260,7 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
///
/// Reset the group item size to the item definition.
///
- public void ResetGroupItemSize() => _currentSize = GroupTextBox.ItemSizeCurrent;
+ public void ResetGroupItemSize() => _currentSize = GroupTextBox!.ItemSizeCurrent;
///
/// Discover the preferred size of the element.
@@ -267,7 +271,7 @@ public override Size GetPreferredSize(ViewLayoutContext context)
var preferredSize = Size.Empty;
// Ensure the control has the correct parent
- UpdateParent(context.Control);
+ UpdateParent(context.Control!);
// If there is a textbox associated then ask for its requested size
if (LastTextBox != null)
@@ -282,7 +286,7 @@ public override Size GetPreferredSize(ViewLayoutContext context)
}
else
{
- preferredSize.Width = NULL_CONTROL_WIDTH;
+ preferredSize.Width = _nullControlWidth;
}
preferredSize.Height = _currentSize == GroupItemSize.Large
@@ -301,10 +305,10 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
Debug.Assert(context != null);
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// Are we allowed to change the layout of controls?
- if (!context.ViewManager.DoNotLayoutControls)
+ if (!context.ViewManager!.DoNotLayoutControls)
{
// If we have an actual control, position it with a pixel padding all around
LastTextBox?.SetBounds(ClientLocation.X + 1,
@@ -325,10 +329,10 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
/// Rendering context.
public override void Render([DisallowNull] RenderContext context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
// If we do not have a textbox
- if (GroupTextBox.TextBox == null)
+ if (GroupTextBox!.TextBox is null)
{
// And we are in design time
if (_ribbon.InDesignMode)
@@ -339,7 +343,7 @@ public override void Render([DisallowNull] RenderContext context)
drawRect.Height--;
// Draw an indication of where the textbox will be
- context.Graphics.FillRectangle(Brushes.Goldenrod, drawRect);
+ context!.Graphics.FillRectangle(Brushes.Goldenrod, drawRect);
context.Graphics.DrawRectangle(Pens.Gold, drawRect);
}
}
@@ -373,9 +377,9 @@ protected virtual void OnNeedPaint(bool needLayout, Rectangle invalidRect)
#endregion
#region Implementation
- private void OnContextClick(object sender, MouseEventArgs e) => GroupTextBox.OnDesignTimeContextMenu(e);
+ private void OnContextClick(object? sender, MouseEventArgs e) => GroupTextBox!.OnDesignTimeContextMenu(e);
- private void OnTextBoxPropertyChanged(object sender, PropertyChangedEventArgs e)
+ private void OnTextBoxPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
var updateLayout = false;
const bool UPDATE_PAINT = false;
@@ -397,7 +401,7 @@ private void OnTextBoxPropertyChanged(object sender, PropertyChangedEventArgs e)
if (updateLayout)
{
// If we are on the currently selected tab then...
- if ((GroupTextBox.RibbonTab != null) &&
+ if ((GroupTextBox!.RibbonTab != null) &&
(_ribbon.SelectedTab == GroupTextBox.RibbonTab))
{
// ...layout so the visible change is made
@@ -425,14 +429,14 @@ private void OnTextBoxPropertyChanged(object sender, PropertyChangedEventArgs e)
private Control LastParentControl
{
- get => GroupTextBox.LastParentControl;
- set => GroupTextBox.LastParentControl = value;
+ get => GroupTextBox!.LastParentControl;
+ set => GroupTextBox!.LastParentControl = value;
}
private KryptonTextBox? LastTextBox
{
- get => GroupTextBox.LastTextBox;
- set => GroupTextBox.LastTextBox = value;
+ get => GroupTextBox!.LastTextBox;
+ set => GroupTextBox!.LastTextBox = value;
}
private void UpdateParent(Control parentControl)
@@ -440,10 +444,10 @@ private void UpdateParent(Control parentControl)
// Is there a change in the textbox or a change in
// the parent control that is hosting the control...
if ((parentControl != LastParentControl) ||
- (LastTextBox != GroupTextBox.TextBox))
+ (LastTextBox != GroupTextBox!.TextBox))
{
// We only modify the parent and visible state if processing for correct container
- if ((GroupTextBox.RibbonContainer.RibbonGroup.ShowingAsPopup && (parentControl is VisualPopupGroup)) ||
+ if ((GroupTextBox!.RibbonContainer!.RibbonGroup!.ShowingAsPopup && (parentControl is VisualPopupGroup)) ||
(!GroupTextBox.RibbonContainer.RibbonGroup.ShowingAsPopup && parentControl is not VisualPopupGroup))
{
// If we have added the custrom control to a parent before
@@ -477,15 +481,15 @@ private void UpdateParent(Control parentControl)
}
}
- private void UpdateEnabled(Control c)
+ private void UpdateEnabled(Control? c)
{
if (c != null)
{
// Start with the enabled state of the group element
- var enabled = GroupTextBox.Enabled;
+ var enabled = GroupTextBox!.Enabled;
// If we have an associated designer setup...
- if (!_ribbon.InDesignHelperMode && (GroupTextBox.TextBoxDesigner != null))
+ if (!_ribbon.InDesignHelperMode && (GroupTextBox?.TextBoxDesigner != null))
{
// And we are not using the design helpers, then use the design specified value
enabled = GroupTextBox.TextBoxDesigner.DesignEnabled;
@@ -495,15 +499,15 @@ private void UpdateEnabled(Control c)
}
}
- private bool ActualVisible(Control c)
+ private bool ActualVisible(Control? c)
{
if (c != null)
{
// Start with the visible state of the group element
- var visible = GroupTextBox.Visible;
+ var visible = GroupTextBox!.Visible;
// If we have an associated designer setup...
- if (!_ribbon.InDesignHelperMode && (GroupTextBox.TextBoxDesigner != null))
+ if (!_ribbon.InDesignHelperMode && (GroupTextBox?.TextBoxDesigner != null))
{
// And we are not using the design helpers, then use the design specified value
visible = GroupTextBox.TextBoxDesigner.DesignVisible;
@@ -515,24 +519,25 @@ private bool ActualVisible(Control c)
return false;
}
- private void UpdateVisible(Control c)
+ private void UpdateVisible(Control? c)
{
if (c != null)
{
// Start with the visible state of the group element
- var visible = GroupTextBox.Visible;
+ var visible = GroupTextBox!.Visible;
// If we have an associated designer setup...
- if (!_ribbon.InDesignHelperMode && (GroupTextBox.TextBoxDesigner != null))
+ var textBoxDesigner = GroupTextBox.TextBoxDesigner;
+ if (!_ribbon.InDesignHelperMode && (GroupTextBox?.TextBoxDesigner != null))
{
// And we are not using the design helpers, then use the design specified value
- visible = GroupTextBox.TextBoxDesigner.DesignVisible;
+ visible = textBoxDesigner.DesignVisible;
}
if (visible)
{
// Only visible if on the currently selected page
- if ((GroupTextBox.RibbonTab == null) ||
+ if ((GroupTextBox!.RibbonTab == null) ||
(_ribbon.SelectedTab != GroupTextBox.RibbonTab))
{
visible = false;
@@ -549,7 +554,7 @@ private void UpdateVisible(Control c)
else
{
// Check that the group is not collapsed
- if (GroupTextBox.RibbonContainer.RibbonGroup.IsCollapsed &&
+ if (GroupTextBox.RibbonContainer!.RibbonGroup!.IsCollapsed &&
((_ribbon.GetControllerControl(GroupTextBox.TextBox) is KryptonRibbon) ||
(_ribbon.GetControllerControl(GroupTextBox.TextBox) is VisualPopupMinimized))
)
@@ -559,7 +564,7 @@ private void UpdateVisible(Control c)
else
{
// Check that the hierarchy of containers are all visible
- KryptonRibbonGroupContainer container = GroupTextBox.RibbonContainer;
+ var container = GroupTextBox.RibbonContainer;
// Keep going until we have searched the entire parent chain of containers
while (container != null)
@@ -583,23 +588,23 @@ private void UpdateVisible(Control c)
}
}
- private void OnLayoutAction(object sender, EventArgs e)
+ private void OnLayoutAction(object? sender, EventArgs e)
{
// If not disposed then we still have a element reference
if (GroupTextBox != null)
{
// Change in selected tab requires a retest of the control visibility
- UpdateVisible(LastTextBox);
+ UpdateVisible(LastTextBox!);
}
}
- private void OnMouseEnterControl(object sender, EventArgs e)
+ private void OnMouseEnterControl(object? sender, EventArgs e)
{
// Reset the active group setting
_activeGroup = null;
// Find the parent group instance
- ViewBase parent = Parent;
+ var parent = Parent;
// Keep going till we get to the top or find a group
while (parent != null)
@@ -622,7 +627,7 @@ private void OnMouseEnterControl(object sender, EventArgs e)
}
}
- private void OnMouseLeaveControl(object sender, EventArgs e)
+ private void OnMouseLeaveControl(object? sender, EventArgs e)
{
// If we have a cached group we made active
if (_activeGroup != null)
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupTitle.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupTitle.cs
index df16f84ad..60741a48d 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupTitle.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupTitle.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -24,7 +24,7 @@ internal class ViewDrawRibbonGroupTitle : ViewLeaf,
private readonly KryptonRibbon _ribbon;
private readonly KryptonRibbonGroup _ribbonGroup;
private readonly RibbonGroupTextToContent _contentProvider;
- private IDisposable _memento;
+ private IDisposable? _memento;
private Rectangle _displayRect;
private int _dirtyPaletteLayout;
private PaletteState _cacheState;
@@ -42,11 +42,11 @@ public ViewDrawRibbonGroupTitle([DisallowNull] KryptonRibbon ribbon,
Debug.Assert(ribbon != null);
Debug.Assert(ribbonGroup != null);
- _ribbon = ribbon;
- _ribbonGroup = ribbonGroup;
+ _ribbon = ribbon!;
+ _ribbonGroup = ribbonGroup!;
// Use a class to convert from ribbon group to content interface
- _contentProvider = new RibbonGroupTextToContent(ribbon.StateCommon.RibbonGeneral,
+ _contentProvider = new RibbonGroupTextToContent(ribbon!.StateCommon.RibbonGeneral,
ribbon.StateNormal.RibbonGroupNormalTitle);
}
@@ -116,10 +116,20 @@ public IPaletteRibbonText PaletteRibbonGroup
/// Layout context.
public override void Layout([DisallowNull] ViewLayoutContext context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
+
+ if (context is null)
+ {
+ throw new ArgumentNullException(nameof(context));
+ }
+
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// A change in state always causes a size and layout calculation
if (_cacheState != State)
@@ -143,7 +153,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
_memento = context.Renderer.RenderStandardContent.LayoutContent(context, ClientRectangle,
_contentProvider, this,
VisualOrientation.Top,
- PaletteState.Normal, false, false);
+ PaletteState.Normal);
// Cache values that are needed to decide if layout is needed
_displayRect = ClientRectangle;
@@ -159,13 +169,18 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
/// Rendering context.
public override void RenderBefore(RenderContext context)
{
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
// Use renderer to draw the text content
if (_memento != null)
{
context.Renderer.RenderStandardContent.DrawContent(context, ClientRectangle,
_contentProvider, _memento,
VisualOrientation.Top,
- PaletteState.Normal, false, false, true);
+ PaletteState.Normal, true);
}
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupTrackBar.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupTrackBar.cs
index f8ff9148b..d78c51b85 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupTrackBar.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupTrackBar.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -21,11 +21,11 @@ internal class ViewDrawRibbonGroupTrackBar : ViewComposite,
IRibbonViewGroupItemView
{
#region Instance Fields
- private readonly int NULL_CONTROL_WIDTH; // = 50;
+ private readonly int _nullControlWidth; // = 50;
private readonly KryptonRibbon _ribbon;
- private ViewDrawRibbonGroup _activeGroup;
+ private ViewDrawRibbonGroup? _activeGroup;
private readonly TrackBarController? _controller;
- private readonly NeedPaintHandler _needPaint;
+ private readonly NeedPaintHandler? _needPaint;
private GroupItemSize _currentSize;
#endregion
@@ -45,10 +45,10 @@ public ViewDrawRibbonGroupTrackBar([DisallowNull] KryptonRibbon ribbon,
Debug.Assert(needPaint != null);
// Remember incoming references
- _ribbon = ribbon;
+ _ribbon = ribbon!;
GroupTrackBar = ribbonTrackBar;
_needPaint = needPaint;
- _currentSize = GroupTrackBar.ItemSizeCurrent;
+ _currentSize = GroupTrackBar!.ItemSizeCurrent;
// Hook into the textbox events
GroupTrackBar.MouseEnterControl += OnMouseEnterControl;
@@ -71,7 +71,7 @@ public ViewDrawRibbonGroupTrackBar([DisallowNull] KryptonRibbon ribbon,
KeyController = _controller;
// We need to rest visibility of the textbox for each layout cycle
- _ribbon.ViewRibbonManager.LayoutBefore += OnLayoutAction;
+ _ribbon.ViewRibbonManager!.LayoutBefore += OnLayoutAction;
_ribbon.ViewRibbonManager.LayoutAfter += OnLayoutAction;
// Define back reference to view for the text box definition
@@ -80,9 +80,13 @@ public ViewDrawRibbonGroupTrackBar([DisallowNull] KryptonRibbon ribbon,
// Give paint delegate to textbox so its palette changes are redrawn
GroupTrackBar.ViewPaintDelegate = needPaint;
+ // Update all views to reflect current state
+ UpdateEnabled(GroupTrackBar.TrackBar);
+ UpdateVisible(GroupTrackBar.TrackBar);
+
// Hook into changes in the ribbon custom definition
- GroupTrackBar.PropertyChanged += OnTextBoxPropertyChanged;
- NULL_CONTROL_WIDTH = (int)(50 * FactorDpiX);
+ GroupTrackBar.PropertyChanged += OnTrackBarPropertyChanged;
+ _nullControlWidth = (int)(50 * FactorDpiX);
}
///
@@ -107,8 +111,8 @@ protected override void Dispose(bool disposing)
GroupTrackBar.MouseEnterControl -= OnMouseEnterControl;
GroupTrackBar.MouseLeaveControl -= OnMouseLeaveControl;
GroupTrackBar.ViewPaintDelegate = null;
- GroupTrackBar.PropertyChanged -= OnTextBoxPropertyChanged;
- _ribbon.ViewRibbonManager.LayoutAfter -= OnLayoutAction;
+ GroupTrackBar.PropertyChanged -= OnTrackBarPropertyChanged;
+ _ribbon.ViewRibbonManager!.LayoutAfter -= OnLayoutAction;
_ribbon.ViewRibbonManager.LayoutBefore -= OnLayoutAction;
// Remove association with definition
@@ -125,7 +129,7 @@ protected override void Dispose(bool disposing)
///
/// Gets access to the owning group track bar instance.
///
- public KryptonRibbonGroupTrackBar GroupTrackBar { get; private set; }
+ public KryptonRibbonGroupTrackBar? GroupTrackBar { get; private set; }
#endregion
@@ -137,7 +141,7 @@ protected override void Dispose(bool disposing)
public override void LostFocus(Control c)
{
// Ask ribbon to shift focus to the hidden control
- _ribbon.HideFocus(GroupTrackBar.TrackBar);
+ _ribbon.HideFocus(GroupTrackBar?.TrackBar);
base.LostFocus(c);
}
#endregion
@@ -147,17 +151,8 @@ public override void LostFocus(Control c)
/// Gets the first focus item from the container.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetFirstFocusItem()
- {
- if (GroupTrackBar is { Visible: true, LastTrackBar: { CanSelect: true } })
- {
- return this;
- }
- else
- {
- return null;
- }
- }
+ public ViewBase GetFirstFocusItem() => GroupTrackBar is { Visible: true, LastTrackBar: { CanSelect: true } } ? this : null!;
+
#endregion
#region GetLastFocusItem
@@ -165,17 +160,8 @@ public override void LostFocus(Control c)
/// Gets the last focus item from the item.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetLastFocusItem()
- {
- if (GroupTrackBar is { Visible: true, LastTrackBar: { CanSelect: true } })
- {
- return this;
- }
- else
- {
- return null;
- }
- }
+ public ViewBase GetLastFocusItem() => GroupTrackBar is { Visible: true, LastTrackBar: { CanSelect: true } } ? this : null!;
+
#endregion
#region GetNextFocusItem
@@ -185,11 +171,11 @@ public override void LostFocus(Control c)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetNextFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetNextFocusItem(ViewBase current, ref bool matched)
{
// Do we match the current item?
matched = current == this;
- return null;
+ return null!;
}
#endregion
@@ -200,11 +186,11 @@ public override void LostFocus(Control c)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetPreviousFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetPreviousFocusItem(ViewBase current, ref bool matched)
{
// Do we match the current item?
matched = current == this;
- return null;
+ return null!;
}
#endregion
@@ -217,7 +203,7 @@ public override void LostFocus(Control c)
public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
{
// Only provide a key tip if we are visible and the target control can accept focus
- if (Visible && LastTrackBar.CanFocus)
+ if (Visible && LastTrackBar!.CanFocus)
{
// Get the screen location of the button
Rectangle viewRect = _ribbon.KeyTipToScreen(this);
@@ -225,7 +211,7 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
// Determine the screen position of the key tip
var screenPt = Point.Empty;
- // Determine the screen position of the key tip dependant on item location/size
+ // Determine the screen position of the key tip dependent on item location/size
switch (_currentSize)
{
case GroupItemSize.Large:
@@ -237,7 +223,7 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
break;
}
- keyTipList.Add(new KeyTipInfo(GroupTrackBar.Enabled,
+ keyTipList.Add(new KeyTipInfo(GroupTrackBar!.Enabled,
GroupTrackBar.KeyTip,
screenPt,
ClientRectangle,
@@ -256,7 +242,7 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList, int lineHint)
///
/// Reset the group item size to the item definition.
///
- public void ResetGroupItemSize() => _currentSize = GroupTrackBar.ItemSizeCurrent;
+ public void ResetGroupItemSize() => _currentSize = GroupTrackBar!.ItemSizeCurrent;
///
/// Discover the preferred size of the element.
@@ -267,7 +253,7 @@ public override Size GetPreferredSize(ViewLayoutContext context)
var preferredSize = Size.Empty;
// Ensure the control has the correct parent
- UpdateParent(context.Control);
+ UpdateParent(context.Control!);
// If there is a textbox associated then ask for its requested size
if (LastTrackBar != null)
@@ -282,7 +268,7 @@ public override Size GetPreferredSize(ViewLayoutContext context)
}
else
{
- preferredSize.Width = NULL_CONTROL_WIDTH;
+ preferredSize.Width = _nullControlWidth;
}
preferredSize.Height = _currentSize == GroupItemSize.Large
@@ -301,10 +287,10 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
Debug.Assert(context != null);
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// Are we allowed to change the layout of controls?
- if (!context.ViewManager.DoNotLayoutControls)
+ if (!context.ViewManager!.DoNotLayoutControls)
{
// If we have an actual control, position it with a pixel padding all around
LastTrackBar?.SetBounds(ClientLocation.X + 1,
@@ -328,7 +314,7 @@ public override void Render([DisallowNull] RenderContext context)
Debug.Assert(context != null);
// If we do not have a textbox
- if (GroupTrackBar.TrackBar == null)
+ if (GroupTrackBar?.TrackBar == null)
{
// And we are in design time
if (_ribbon.InDesignMode)
@@ -339,8 +325,8 @@ public override void Render([DisallowNull] RenderContext context)
drawRect.Height--;
// Draw an indication of where the textbox will be
- context.Graphics.FillRectangle(Brushes.Goldenrod, drawRect);
- context.Graphics.DrawRectangle(Pens.Gold, drawRect);
+ context?.Graphics.FillRectangle(Brushes.Goldenrod, drawRect);
+ context?.Graphics.DrawRectangle(Pens.Gold, drawRect);
}
}
}
@@ -373,9 +359,9 @@ protected virtual void OnNeedPaint(bool needLayout, Rectangle invalidRect)
#endregion
#region Implementation
- private void OnContextClick(object sender, MouseEventArgs e) => GroupTrackBar.OnDesignTimeContextMenu(e);
+ private void OnContextClick(object? sender, MouseEventArgs e) => GroupTrackBar?.OnDesignTimeContextMenu(e);
- private void OnTextBoxPropertyChanged(object sender, PropertyChangedEventArgs e)
+ private void OnTrackBarPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
var updateLayout = false;
const bool UPDATE_PAINT = false;
@@ -397,7 +383,7 @@ private void OnTextBoxPropertyChanged(object sender, PropertyChangedEventArgs e)
if (updateLayout)
{
// If we are on the currently selected tab then...
- if ((GroupTrackBar.RibbonTab != null) &&
+ if ((GroupTrackBar?.RibbonTab != null) &&
(_ribbon.SelectedTab == GroupTrackBar.RibbonTab))
{
// ...layout so the visible change is made
@@ -423,16 +409,16 @@ private void OnTextBoxPropertyChanged(object sender, PropertyChangedEventArgs e)
#pragma warning restore 162
}
- private Control LastParentControl
+ private Control? LastParentControl
{
- get => GroupTrackBar.LastParentControl;
- set => GroupTrackBar.LastParentControl = value;
+ get => GroupTrackBar?.LastParentControl;
+ set => GroupTrackBar!.LastParentControl = value;
}
private KryptonTrackBar? LastTrackBar
{
- get => GroupTrackBar.LastTrackBar;
- set => GroupTrackBar.LastTrackBar = value;
+ get => GroupTrackBar?.LastTrackBar;
+ set => GroupTrackBar!.LastTrackBar = value;
}
private void UpdateParent(Control parentControl)
@@ -440,13 +426,13 @@ private void UpdateParent(Control parentControl)
// Is there a change in the textbox or a change in
// the parent control that is hosting the control...
if ((parentControl != LastParentControl) ||
- (LastTrackBar != GroupTrackBar.TrackBar))
+ (LastTrackBar != GroupTrackBar?.TrackBar))
{
// We only modify the parent and visible state if processing for correct container
- if ((GroupTrackBar.RibbonContainer.RibbonGroup.ShowingAsPopup && (parentControl is VisualPopupGroup)) ||
+ if ((GroupTrackBar!.RibbonContainer!.RibbonGroup!.ShowingAsPopup && (parentControl is VisualPopupGroup)) ||
(!GroupTrackBar.RibbonContainer.RibbonGroup.ShowingAsPopup && parentControl is not VisualPopupGroup))
{
- // If we have added the custrom control to a parent before
+ // If we have added the custom control to a parent before
if ((LastTrackBar != null) && (LastParentControl != null))
{
// If that control is still a child of the old parent
@@ -477,15 +463,15 @@ private void UpdateParent(Control parentControl)
}
}
- private void UpdateEnabled(Control c)
+ private void UpdateEnabled(Control? c)
{
if (c != null)
{
// Start with the enabled state of the group element
- var enabled = GroupTrackBar.Enabled;
+ var enabled = GroupTrackBar!.Enabled;
// If we have an associated designer setup...
- if (!_ribbon.InDesignHelperMode && (GroupTrackBar.TrackBarDesigner != null))
+ if (!_ribbon.InDesignHelperMode && (GroupTrackBar?.TrackBarDesigner != null))
{
// And we are not using the design helpers, then use the design specified value
enabled = GroupTrackBar.TrackBarDesigner.DesignEnabled;
@@ -495,15 +481,15 @@ private void UpdateEnabled(Control c)
}
}
- private bool ActualVisible(Control c)
+ private bool ActualVisible(Control? c)
{
if (c != null)
{
// Start with the visible state of the group element
- var visible = GroupTrackBar.Visible;
+ var visible = GroupTrackBar!.Visible;
// If we have an associated designer setup...
- if (!_ribbon.InDesignHelperMode && (GroupTrackBar.TrackBarDesigner != null))
+ if (!_ribbon.InDesignHelperMode && (GroupTrackBar?.TrackBarDesigner != null))
{
// And we are not using the design helpers, then use the design specified value
visible = GroupTrackBar.TrackBarDesigner.DesignVisible;
@@ -515,15 +501,15 @@ private bool ActualVisible(Control c)
return false;
}
- private void UpdateVisible(Control c)
+ private void UpdateVisible(Control? c)
{
if (c != null)
{
// Start with the visible state of the group element
- var visible = GroupTrackBar.Visible;
+ var visible = GroupTrackBar!.Visible;
// If we have an associated designer setup...
- if (!_ribbon.InDesignHelperMode && (GroupTrackBar.TrackBarDesigner != null))
+ if (!_ribbon.InDesignHelperMode && (GroupTrackBar?.TrackBarDesigner != null))
{
// And we are not using the design helpers, then use the design specified value
visible = GroupTrackBar.TrackBarDesigner.DesignVisible;
@@ -532,7 +518,7 @@ private void UpdateVisible(Control c)
if (visible)
{
// Only visible if on the currently selected page
- if ((GroupTrackBar.RibbonTab == null) ||
+ if ((GroupTrackBar?.RibbonTab == null) ||
(_ribbon.SelectedTab != GroupTrackBar.RibbonTab))
{
visible = false;
@@ -549,7 +535,7 @@ private void UpdateVisible(Control c)
else
{
// Check that the group is not collapsed
- if (GroupTrackBar.RibbonContainer.RibbonGroup.IsCollapsed &&
+ if (GroupTrackBar.RibbonContainer!.RibbonGroup!.IsCollapsed &&
((_ribbon.GetControllerControl(GroupTrackBar.TrackBar) is KryptonRibbon) ||
(_ribbon.GetControllerControl(GroupTrackBar.TrackBar) is VisualPopupMinimized))
)
@@ -559,7 +545,7 @@ private void UpdateVisible(Control c)
else
{
// Check that the hierarchy of containers are all visible
- KryptonRibbonGroupContainer container = GroupTrackBar.RibbonContainer;
+ KryptonRibbonGroupContainer? container = GroupTrackBar.RibbonContainer;
// Keep going until we have searched the entire parent chain of containers
while (container != null)
@@ -583,7 +569,7 @@ private void UpdateVisible(Control c)
}
}
- private void OnLayoutAction(object sender, EventArgs e)
+ private void OnLayoutAction(object? sender, EventArgs e)
{
// If not disposed then we still have a element reference
if (GroupTrackBar != null)
@@ -593,13 +579,13 @@ private void OnLayoutAction(object sender, EventArgs e)
}
}
- private void OnMouseEnterControl(object sender, EventArgs e)
+ private void OnMouseEnterControl(object? sender, EventArgs e)
{
// Reset the active group setting
_activeGroup = null;
// Find the parent group instance
- ViewBase parent = Parent;
+ ViewBase? parent = Parent;
// Keep going till we get to the top or find a group
while (parent != null)
@@ -618,17 +604,17 @@ private void OnMouseEnterControl(object sender, EventArgs e)
if (_activeGroup != null)
{
_activeGroup.Tracking = true;
- _needPaint(this, new NeedLayoutEventArgs(false, _activeGroup.ClientRectangle));
+ _needPaint?.Invoke(this, new NeedLayoutEventArgs(false, _activeGroup.ClientRectangle));
}
}
- private void OnMouseLeaveControl(object sender, EventArgs e)
+ private void OnMouseLeaveControl(object? sender, EventArgs e)
{
// If we have a cached group we made active
if (_activeGroup != null)
{
_activeGroup.Tracking = false;
- _needPaint(this, new NeedLayoutEventArgs(false, _activeGroup.ClientRectangle));
+ _needPaint?.Invoke(this, new NeedLayoutEventArgs(false, _activeGroup.ClientRectangle));
_activeGroup = null;
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupsBorder.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupsBorder.cs
index 55beae98f..14be6e1c8 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupsBorder.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupsBorder.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -28,7 +28,7 @@ internal class ViewDrawRibbonGroupsBorder : ViewComposite,
private readonly Padding _borderPaddingVisualStudio2010;
private readonly Padding _borderPaddingVisualStudio;
private IPaletteRibbonBack _inherit;
- private IDisposable _memento;
+ private IDisposable? _memento;
private readonly bool _borderOutside;
#endregion
@@ -39,16 +39,16 @@ internal class ViewDrawRibbonGroupsBorder : ViewComposite,
/// Reference to owning ribbon control.
/// Should border be placed outside the contents.
/// Delegate for notifying paint/layout changes.
- public ViewDrawRibbonGroupsBorder([DisallowNull] KryptonRibbon ribbon,
+ public ViewDrawRibbonGroupsBorder([DisallowNull] KryptonRibbon? ribbon,
bool borderOutside,
- [DisallowNull] NeedPaintHandler needPaintDelegate)
+ [DisallowNull] NeedPaintHandler? needPaintDelegate)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(needPaintDelegate != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(needPaintDelegate is not null);
// Remember incoming references
- Ribbon = ribbon;
- NeedPaintDelegate = needPaintDelegate;
+ Ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ NeedPaintDelegate = needPaintDelegate ?? throw new ArgumentNullException(nameof(needPaintDelegate));
_borderOutside = borderOutside;
_borderPadding2007 = new Padding((int)(3 * FactorDpiX), (int)(3 * FactorDpiY), (int)(3 * FactorDpiX), (int)(2 * FactorDpiY));
_borderPadding2010 = new Padding((int)(1 * FactorDpiX), (int)(1 * FactorDpiY), (int)(1 * FactorDpiX), (int)(3 * FactorDpiY));
@@ -145,7 +145,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
Debug.Assert(context != null);
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// Do we need to add on our own border size
if (!_borderOutside)
@@ -169,6 +169,11 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
/// Rendering context.
public override void RenderBefore(RenderContext context)
{
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
// If there is a selected tab and it is a context tab use the context specific palette
if (!string.IsNullOrEmpty(Ribbon.SelectedTab?.ContextName))
{
@@ -192,8 +197,7 @@ public override void RenderBefore(RenderContext context)
drawRect.Width += borderPadding.Horizontal;
drawRect.Height += borderPadding.Vertical;
}
- else if (Ribbon.CaptionArea.DrawCaptionOnComposition &&
- (Ribbon.RibbonShape == PaletteRibbonShape.Office2010))
+ else if (Ribbon.RibbonShape == PaletteRibbonShape.Office2010)
{
// Prevent the left and right edges from being drawn
drawRect.X -= 1;
@@ -201,7 +205,7 @@ public override void RenderBefore(RenderContext context)
}
// Use renderer to draw the tab background
- _memento = context.Renderer.RenderRibbon.DrawRibbonBack(Ribbon.RibbonShape, context, drawRect, State, this, VisualOrientation.Top, false, _memento);
+ _memento = context.Renderer.RenderRibbon.DrawRibbonBack(Ribbon.RibbonShape, context, drawRect, State, this, VisualOrientation.Top, _memento);
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupsBorderSynch.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupsBorderSynch.cs
index ae06ade5f..0ba599932 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupsBorderSynch.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonGroupsBorderSynch.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -20,7 +20,7 @@ namespace Krypton.Ribbon
internal class ViewDrawRibbonGroupsBorderSynch : ViewDrawRibbonGroupsBorder
{
#region Classes
- private class TabToView : Dictionary { }
+ private class TabToView : Dictionary;
#endregion
#region Static Fields
@@ -64,10 +64,9 @@ public override string ToString() =>
public ViewDrawRibbonGroup? ViewGroupFromPoint(Point pt)
{
// There can only be groups showing for the currently selected tab
- if (Ribbon.SelectedTab != null && _tabToView.ContainsKey(Ribbon.SelectedTab))
+ if (Ribbon.SelectedTab != null && _tabToView.TryGetValue(Ribbon.SelectedTab, out ViewLayoutRibbonScrollPort? viewScrollPort))
{
// Get the scroll port for this tab
- ViewLayoutRibbonScrollPort viewScrollPort = _tabToView[Ribbon.SelectedTab];
// The first child of the scroll port is always the view control
var viewControl = viewScrollPort[0] as ViewLayoutControl;
@@ -100,7 +99,7 @@ public KeyTipInfo[] GetGroupKeyTips(KryptonRibbonTab tab) => _tabToView.Contains
/// Gets the first focus item within the currently selected tab.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetFirstFocusItem()
+ public ViewBase GetFirstFocusItem()
{
if ((Ribbon.SelectedTab != null) &&
_tabToView.ContainsKey(Ribbon.SelectedTab))
@@ -109,7 +108,7 @@ public KeyTipInfo[] GetGroupKeyTips(KryptonRibbonTab tab) => _tabToView.Contains
}
else
{
- return null;
+ return null!;
}
}
#endregion
@@ -119,7 +118,7 @@ public KeyTipInfo[] GetGroupKeyTips(KryptonRibbonTab tab) => _tabToView.Contains
/// Gets the last focus item within the currently selected tab.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetLastFocusItem()
+ public ViewBase GetLastFocusItem()
{
if ((Ribbon.SelectedTab != null) &&
_tabToView.ContainsKey(Ribbon.SelectedTab))
@@ -128,7 +127,7 @@ public KeyTipInfo[] GetGroupKeyTips(KryptonRibbonTab tab) => _tabToView.Contains
}
else
{
- return null;
+ return null!;
}
}
#endregion
@@ -139,7 +138,7 @@ public KeyTipInfo[] GetGroupKeyTips(KryptonRibbonTab tab) => _tabToView.Contains
///
/// The view that is currently focused.
/// ViewBase of item; otherwise false.
- public ViewBase? GetNextFocusItem(ViewBase current)
+ public ViewBase GetNextFocusItem(ViewBase current)
{
if ((Ribbon.SelectedTab != null) &&
_tabToView.ContainsKey(Ribbon.SelectedTab))
@@ -148,7 +147,7 @@ public KeyTipInfo[] GetGroupKeyTips(KryptonRibbonTab tab) => _tabToView.Contains
}
else
{
- return null;
+ return null!;
}
}
#endregion
@@ -159,7 +158,7 @@ public KeyTipInfo[] GetGroupKeyTips(KryptonRibbonTab tab) => _tabToView.Contains
///
/// The view that is currently focused.
/// ViewBase of item; otherwise false.
- public ViewBase? GetPreviousFocusItem(ViewBase current)
+ public ViewBase GetPreviousFocusItem(ViewBase current)
{
if ((Ribbon.SelectedTab != null) &&
_tabToView.ContainsKey(Ribbon.SelectedTab))
@@ -168,7 +167,7 @@ public KeyTipInfo[] GetGroupKeyTips(KryptonRibbonTab tab) => _tabToView.Contains
}
else
{
- return null;
+ return null!;
}
}
#endregion
@@ -212,9 +211,9 @@ private void SyncChildrenToRibbonTabs()
ViewLayoutRibbonScrollPort? view = null;
// Get the currently cached view for the tab
- if (_tabToView.ContainsKey(tab))
+ if (_tabToView.TryGetValue(tab, out ViewLayoutRibbonScrollPort? value))
{
- view = _tabToView[tab];
+ view = value;
}
// If a new tab, create a view for it now
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonKeyTip.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonKeyTip.cs
index 971422897..54cfa92fc 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonKeyTip.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonKeyTip.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonMinimizeBar.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonMinimizeBar.cs
index 01ffe7071..76142d459 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonMinimizeBar.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonMinimizeBar.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -36,7 +36,7 @@ public ViewDrawRibbonMinimizeBar([DisallowNull] IPaletteRibbonGeneral palette)
: base(SEP_WIDTH, true)
{
Debug.Assert(palette != null);
- _palette = palette;
+ _palette = palette!;
}
///
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonPanel.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonPanel.cs
index c7c0b391e..a0aeb93f0 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonPanel.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonPanel.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -29,6 +29,9 @@ internal class ViewDrawRibbonPanel : ViewDrawPanel
private readonly KryptonRibbon _ribbon;
private readonly NeedPaintHandler _paintDelegate;
private readonly Blend _compBlend;
+
+ private readonly IPaletteRibbonGeneral _palette;
+
#endregion
#region Identity
@@ -38,121 +41,26 @@ internal class ViewDrawRibbonPanel : ViewDrawPanel
/// Reference to owning ribbon instance.
/// Reference to palette for obtaining background colors.
/// Delegate for generating repaints.
+ /// Source for palette values.
public ViewDrawRibbonPanel(KryptonRibbon ribbon,
IPaletteBack paletteBack,
- NeedPaintHandler paintDelegate)
+ NeedPaintHandler paintDelegate,
+ IPaletteRibbonGeneral palette)
: base(paletteBack)
{
_ribbon = ribbon;
_paintDelegate = paintDelegate;
+ _palette = palette;
_compBlend = new Blend
{
//_compBlend.Positions = new float[] { 0.0f, 0.4f, 1.0f };
//_compBlend.Factors = new float[] { 0.0f, 0.87f, 1.0f };
- Positions = new[] { 0.0f, 0.2f, 0.4f, 0.6f, 0.8f, 1.0f },
- Factors = new[] { 0.0f, 0.10f, 0.25f, 0.50f, 0.70f, 0.80f }
+ Positions = [0.0f, 0.2f, 0.4f, 0.6f, 0.8f, 1.0f],
+ Factors = [0.0f, 0.10f, 0.25f, 0.50f, 0.70f, 0.80f]
};
}
#endregion
- #region Paint
- ///
- /// Perform rendering before child elements are rendered.
- ///
- /// Rendering context.
- public override void RenderBefore(RenderContext context)
- {
- // If we are rendering using desktop window composition and using the Office 2010 shape
- // of ribbon then we need to draw the tabs area as part of the window chromw
- if (DrawOnComposition && _ribbon.RibbonShape is PaletteRibbonShape.Office2010 or PaletteRibbonShape.Office2013 or PaletteRibbonShape.Microsoft365 or PaletteRibbonShape.VisualStudio)
- {
- var tabsHeight = _ribbon.TabsArea.ClientHeight;
-
- // Clip to prevent drawing over the tabs area
- using (var clip = new Clipping(context.Graphics,
- new Rectangle(ClientLocation.X, ClientLocation.Y + tabsHeight, ClientWidth,
- ClientHeight - tabsHeight)))
- {
- base.RenderBefore(context);
- }
-
- //context.Graphics.DrawRectangle(new Pen(Color.Blue), new Rectangle(ClientLocation.X, ClientLocation.Y, ClientWidth, tabsHeight));
- PaintRectangle(context.Graphics, new Rectangle(ClientLocation.X, ClientLocation.Y, ClientWidth, tabsHeight), true, null);
- }
- else
- {
- base.RenderBefore(context);
- }
- }
-
- ///
- /// Paint the provided rectangle.
- ///
- /// Graphics to use for drawing.
- /// Rectangle to be drawn.
- /// True if the edges needs to be drawn.
- /// Sender of the message..
- public void PaintRectangle(Graphics? g, Rectangle rect, bool edges, Control? sender)
- {
- // If we are rendering using desktop window composition and using the Office 2010 shape
- // of ribbon then we need to draw the tabs area as part of the window chrome
- // Not for 2007
- if (DrawOnComposition
- && _ribbon.RibbonShape is PaletteRibbonShape.Office2010 or PaletteRibbonShape.VisualStudio2010 or PaletteRibbonShape.Office2013 or PaletteRibbonShape.Microsoft365 or PaletteRibbonShape.VisualStudio
- )
- {
- if (edges)
- {
- rect.X += EDGE_GAP;
- rect.Width -= EDGE_GAP * 2;
- }
- else if ((sender != null) && !_ribbon.MinimizedMode)
- {
- using var border = new ViewDrawRibbonGroupsBorder(_ribbon, false, _paintDelegate);
- border.ClientRectangle = new Rectangle(-sender.Location.X, rect.Bottom - 1, _ribbon.Width, 10);
- using var context = new RenderContext(_ribbon, g, rect, _ribbon.Renderer);
- border.Render(context);
- }
-
- if (g == null)
- {
- return;
- }
-
- switch (_ribbon.RibbonShape)
- {
- case PaletteRibbonShape.Office2010:
- case PaletteRibbonShape.VisualStudio2010:
- {
- //Adjust Color of the gradient
- Color gradientColor = KryptonManager.CurrentGlobalPalette == KryptonManager.PaletteOffice2010Black
- ? Color.FromArgb(39, 39, 39)
- : Color.White;
-
- using var backBrush = new LinearGradientBrush(
- rect with { Y = rect.Y - 1, Height = rect.Height + 1 }, Color.Transparent,
- gradientColor, 90f);
- backBrush.Blend = _compBlend;
- g.FillRectangle(backBrush, rect with { Height = rect.Height - 1 });
- break;
- }
- case PaletteRibbonShape.Office2013:
- case PaletteRibbonShape.Microsoft365:
- case PaletteRibbonShape.VisualStudio:
- {
- using var backBrush = new SolidBrush(Color.White);
- g.FillRectangle(backBrush, rect with { Height = rect.Height - 1 });
- break;
- }
- }
- }
- }
- #endregion
-
- #region Implementation
- private bool DrawOnComposition => _ribbon is { CaptionArea.DrawCaptionOnComposition: true };
-
- #endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonQATBorder.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonQATBorder.cs
index d3c170366..0e19264f3 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonQATBorder.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonQATBorder.cs
@@ -5,10 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
- *
- * Modified: Monday 12th April, 2021 @ 18:00 GMT
- *
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*/
#endregion
@@ -31,7 +28,6 @@ internal class ViewDrawRibbonQATBorder : ViewComposite
private readonly Padding _fullbarBorderPadding_2010; // = new(2);
private readonly Padding _noBorderPadding; // = new(1, 0, 1, 0);
private readonly KryptonRibbon _ribbon;
- private readonly NeedPaintHandler _needPaintDelegate;
private IDisposable? _memento;
private readonly bool _minibar;
#endregion
@@ -60,8 +56,7 @@ public ViewDrawRibbonQATBorder([DisallowNull] KryptonRibbon ribbon,
_fullbarBorderPadding_2010 = new Padding((int)(2 * FactorDpiX), (int)(2 * FactorDpiY), (int)(2 * FactorDpiX), (int)(2 * FactorDpiY));
_noBorderPadding = new Padding((int)(1 * FactorDpiX), 0, (int)(1 * FactorDpiX), 0);
// Remember incoming references
- _ribbon = ribbon;
- _needPaintDelegate = needPaintDelegate;
+ _ribbon = ribbon!;
_minibar = minibar;
OverlapAppButton = true;
}
@@ -158,7 +153,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
{
Debug.Assert(context != null);
- Rectangle clientRect = context.DisplayRectangle;
+ Rectangle clientRect = context!.DisplayRectangle;
// For the minibar we have to position ourself at bottom of available area
if (_minibar)
@@ -187,6 +182,11 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
/// Rendering context.
public override void RenderBefore(RenderContext context)
{
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
// We never draw the background/border for Office 2010 shape QAT
if (_minibar && (_ribbon.RibbonShape == PaletteRibbonShape.Office2010))
{
@@ -232,11 +232,8 @@ public override void RenderBefore(RenderContext context)
palette = _ribbon.StateCommon.RibbonQATFullbar;
}
- // Decide if we need to draw onto a composition area
- var composition = OwnerForm is { ApplyComposition: true, ApplyCustomChrome: true };
-
// Perform actual drawing
- _memento = context.Renderer?.RenderRibbon.DrawRibbonBack(_ribbon.RibbonShape, context, drawRect, state, palette, VisualOrientation.Top, composition, _memento);
+ _memento = context.Renderer.RenderRibbon.DrawRibbonBack(_ribbon.RibbonShape, context, drawRect, state, palette, VisualOrientation.Top, _memento);
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonQATButton.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonQATButton.cs
index 043d9dfa0..9f7b8872c 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonQATButton.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonQATButton.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -44,8 +44,8 @@ public ViewDrawRibbonQATButton([DisallowNull] KryptonRibbon ribbon,
Debug.Assert(qatButton != null);
// Remember incoming references
- _ribbon = ribbon;
- QATButton = qatButton;
+ _ribbon = ribbon!;
+ QATButton = qatButton!;
_viewSize = new Size((int)(22 * FactorDpiX), (int)(22*FactorDpiY));
@@ -54,18 +54,18 @@ public ViewDrawRibbonQATButton([DisallowNull] KryptonRibbon ribbon,
Component = qatButton as Component;
// Attach a controller to this element for the pressing of the button
- var controller = new QATButtonController(ribbon, this, needPaint);
+ var controller = new QATButtonController(ribbon!, this, needPaint);
controller.Click += OnClick;
SourceController = controller;
KeyController = controller;
// Create controller for intercepting events to determine tool tip handling
- MouseController = new ToolTipController(_ribbon.TabsArea.ButtonSpecManager.ToolTipManager,
+ MouseController = new ToolTipController(_ribbon.TabsArea?.ButtonSpecManager?.ToolTipManager!,
this, controller);
// Use a class to convert from ribbon tab to content interface
- _contentProvider = new QATButtonToContent(qatButton);
+ _contentProvider = new QATButtonToContent(qatButton!);
// Create and add the draw content for display inside the button
_drawContent = new ViewDrawContent(_contentProvider, this, VisualOrientation.Top);
@@ -153,7 +153,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
Debug.Assert(context != null);
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// Let child elements layout in given space
base.Layout(context);
@@ -167,6 +167,11 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
/// Rendering context.
public override void RenderBefore(RenderContext context)
{
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
// Make sure we reflect the current enabled state
if (!Enabled && _ribbon.InDesignHelperMode)
{
@@ -174,26 +179,27 @@ public override void RenderBefore(RenderContext context)
}
IPaletteBack paletteBack = _ribbon.StateCommon.RibbonQATButton.PaletteBack;
- IPaletteBorder paletteBorder = _ribbon.StateCommon.RibbonQATButton.PaletteBorder;
+ IPaletteBorder? paletteBorder = _ribbon.StateCommon.RibbonQATButton.PaletteBorder;
// Do we need to draw the background?
if (paletteBack.GetBackDraw(State) == InheritBool.True)
{
// Get the border path which the background is clipped to drawing within
- using GraphicsPath borderPath = context.Renderer.RenderStandardBorder.GetBackPath(context, ClientRectangle, paletteBorder, VisualOrientation.Top, State);
- Padding borderPadding = context.Renderer.RenderStandardBorder.GetBorderRawPadding(paletteBorder, State, VisualOrientation.Top);
+ using GraphicsPath borderPath = context.Renderer.RenderStandardBorder.GetBackPath(context, ClientRectangle, paletteBorder!, VisualOrientation.Top, State);
+ Padding borderPadding = context.Renderer.RenderStandardBorder.GetBorderRawPadding(paletteBorder!, State, VisualOrientation.Top);
// Apply the padding depending on the orientation
Rectangle enclosingRect = CommonHelper.ApplyPadding(VisualOrientation.Top, ClientRectangle, borderPadding);
// Render the background inside the border path
+ using var gh = new GraphicsHint(context.Graphics, paletteBorder!.GetBorderGraphicsHint(PaletteState.Normal));
_mementoBack = context.Renderer.RenderStandardBack.DrawBack(context, enclosingRect, borderPath,
paletteBack, VisualOrientation.Top,
State, _mementoBack);
}
// Do we need to draw the border?
- if (paletteBorder.GetBorderDraw(State) == InheritBool.True)
+ if (paletteBorder?.GetBorderDraw(State) == InheritBool.True)
{
context.Renderer.RenderStandardBorder.DrawBorder(context, ClientRectangle, paletteBorder,
VisualOrientation.Top, State);
@@ -204,19 +210,19 @@ public override void RenderBefore(RenderContext context)
#endregion
#region Implementation
- private void OnRibbonEnableChanged(object sender, EventArgs e) => UpdateEnabled();
+ private void OnRibbonEnableChanged(object? sender, EventArgs e) => UpdateEnabled();
private void UpdateEnabled() =>
// Content is only enabled if the QAT button is enabled
// and the owning ribbon control is also enabled
_drawContent.Enabled = base.Enabled && _ribbon.Enabled;
- private void OnClick(object sender, MouseEventArgs e)
+ private void OnClick(object? sender, MouseEventArgs e)
{
// We do not operate the qat button at design time
if (!_ribbon.InDesignMode)
{
- Form ownerForm = _ribbon.FindForm();
+ Form? ownerForm = _ribbon.FindForm();
// Ensure the form we are inside is active
ownerForm?.Activate();
@@ -229,7 +235,7 @@ private void OnClick(object sender, MouseEventArgs e)
#region IContentValues
- private Image _cachedImage;
+ private Image? _cachedImage;
///
/// Gets the image used for the ribbon tab.
///
@@ -240,11 +246,11 @@ private void OnClick(object sender, MouseEventArgs e)
if (_cachedImage == null)
{
var sourceImage = QATButton.GetImage();
- var currentWidth = sourceImage.Width * FactorDpiX;
+ var currentWidth = sourceImage!.Width * FactorDpiX;
var currentHeight = sourceImage.Height * FactorDpiY;
/*if ((int)currentHeight == sourceImage.Height)
{
- // Need to workaround the image drawing off the bottom of the form title bar when scaling @ 100%
+ // Need to work around the image drawing off the bottom of the form title bar when scaling @ 100%
currentHeight -= 2; // Has to be even to ensure that horizontal lines are still drawn.
}
*/
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonQATExtraButton.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonQATExtraButton.cs
index d1275f1e1..a8ad7e550 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonQATExtraButton.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonQATExtraButton.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -49,13 +49,13 @@ public ViewDrawRibbonQATExtraButton([DisallowNull] KryptonRibbon ribbon,
Debug.Assert(ribbon != null);
// Remember incoming references
- _ribbon = ribbon;
+ _ribbon = ribbon!;
// Create delegate used to process end of click action
_finishDelegate = ClickFinished;
// Attach a controller to this element for the pressing of the button
- var controller = new QATExtraButtonController(ribbon, this, needPaint);
+ var controller = new QATExtraButtonController(ribbon!, this, needPaint);
controller.Click += OnClick;
MouseController = controller;
SourceController = controller;
@@ -133,7 +133,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
Debug.Assert(context != null);
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
}
#endregion
@@ -144,31 +144,37 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
/// Rendering context.
public override void RenderBefore(RenderContext context)
{
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
// Update the enabled state of the button
Enabled = _ribbon.Enabled;
IPaletteBack paletteBack = _ribbon.StateCommon.RibbonGroupDialogButton.PaletteBack;
- IPaletteBorder paletteBorder = _ribbon.StateCommon.RibbonGroupDialogButton.PaletteBorder;
+ IPaletteBorder? paletteBorder = _ribbon.StateCommon.RibbonGroupDialogButton.PaletteBorder;
IPaletteRibbonGeneral paletteGeneral = _ribbon.StateCommon.RibbonGeneral;
// Do we need to draw the background?
if (paletteBack.GetBackDraw(State) == InheritBool.True)
{
// Get the border path which the background is clipped to drawing within
- using GraphicsPath borderPath = context.Renderer.RenderStandardBorder.GetBackPath(context, ClientRectangle, paletteBorder, VisualOrientation.Top, State);
- Padding borderPadding = context.Renderer.RenderStandardBorder.GetBorderRawPadding(paletteBorder, State, VisualOrientation.Top);
+ using GraphicsPath borderPath = context.Renderer.RenderStandardBorder.GetBackPath(context, ClientRectangle, paletteBorder!, VisualOrientation.Top, State);
+ Padding borderPadding = context.Renderer.RenderStandardBorder.GetBorderRawPadding(paletteBorder!, State, VisualOrientation.Top);
// Apply the padding depending on the orientation
Rectangle enclosingRect = CommonHelper.ApplyPadding(VisualOrientation.Top, ClientRectangle, borderPadding);
// Render the background inside the border path
+ using var gh = new GraphicsHint(context.Graphics, paletteBorder!.GetBorderGraphicsHint(PaletteState.Normal));
_mementoBack = context.Renderer.RenderStandardBack.DrawBack(context, enclosingRect, borderPath,
paletteBack, VisualOrientation.Top,
State, _mementoBack);
}
// Do we need to draw the border?
- if (paletteBorder.GetBorderDraw(State) == InheritBool.True)
+ if (paletteBorder?.GetBorderDraw(State) == InheritBool.True)
{
context.Renderer.RenderStandardBorder.DrawBorder(context, ClientRectangle, paletteBorder,
VisualOrientation.Top, State);
@@ -191,16 +197,16 @@ public override void RenderBefore(RenderContext context)
#endregion
#region Implementation
- private void ClickFinished(object sender, EventArgs e)
+ private void ClickFinished(object? sender, EventArgs e)
{
// Get access to our mouse controller
- var controller = (LeftDownButtonController)MouseController;
+ var controller = MouseController as LeftDownButtonController;
// Remove the fixed pressed appearance
controller?.RemoveFixed();
}
- private void OnClick(object sender, MouseEventArgs e)
+ private void OnClick(object? sender, MouseEventArgs e)
{
Form? ownerForm = _ribbon.FindForm();
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonQATExtraButtonMini.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonQATExtraButtonMini.cs
index 9259b9ccf..38d83878c 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonQATExtraButtonMini.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonQATExtraButtonMini.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -19,8 +19,8 @@ namespace Krypton.Ribbon
///
internal class ViewDrawRibbonQATExtraButtonMini : ViewDrawRibbonQATExtraButton
{
- private readonly int MINI_BUTTON_HEIGHT; // = 22;
- private readonly int MINI_BUTTON_OFFSET; // = 24;
+ private readonly int _miniButtonHeight; // = 22;
+ private readonly int _miniButtonOffset; // = 24;
#region Identity
///
/// Initialize a new instance of the ViewDrawRibbonQATExtraButtonMini class.
@@ -31,8 +31,8 @@ public ViewDrawRibbonQATExtraButtonMini(KryptonRibbon ribbon,
NeedPaintHandler needPaint)
: base(ribbon, needPaint)
{
- MINI_BUTTON_HEIGHT = (int)(22 * FactorDpiY);
- MINI_BUTTON_OFFSET = (int)(24 * FactorDpiX);
+ _miniButtonHeight = (int)(22 * FactorDpiY);
+ _miniButtonOffset = (int)(24 * FactorDpiX);
}
///
@@ -54,11 +54,11 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
{
Debug.Assert(context != null);
- Rectangle clientRect = context.DisplayRectangle;
+ Rectangle clientRect = context!.DisplayRectangle;
// For the minibar we have to position ourself at bottom of available area
- clientRect.Y = clientRect.Bottom - 1 - MINI_BUTTON_OFFSET;
- clientRect.Height = MINI_BUTTON_HEIGHT;
+ clientRect.Y = clientRect.Bottom - 1 - _miniButtonOffset;
+ clientRect.Height = _miniButtonHeight;
// Use modified size to position base class and children
context.DisplayRectangle = clientRect;
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonQATOverflow.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonQATOverflow.cs
index 27abfa427..4bafffeef 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonQATOverflow.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonQATOverflow.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -17,14 +17,14 @@ namespace Krypton.Ribbon
///
/// Draws the border around the overflow popup of the quick access toolbar.
///
- internal class ViewDrawRibbonQATOverflow : ViewComposite
+ internal class ViewDrawRibbonQATOverflow : ViewComposite
{
#region Instance Fields
private readonly Padding _borderPadding; // = new(3);
- private readonly int QAT_HEIGHT_FULL; // = 28;
+ private readonly int _qatHeightFull; // = 28;
private readonly KryptonRibbon _ribbon;
private readonly NeedPaintHandler _needPaintDelegate;
- private IDisposable _memento;
+ private IDisposable? _memento;
#endregion
#region Identity
@@ -40,10 +40,10 @@ public ViewDrawRibbonQATOverflow([DisallowNull] KryptonRibbon ribbon,
Debug.Assert(needPaintDelegate != null);
// Remember incoming references
- _ribbon = ribbon;
- _needPaintDelegate = needPaintDelegate;
+ _ribbon = ribbon!;
+ _needPaintDelegate = needPaintDelegate!;
_borderPadding = new Padding((int)(3 * FactorDpiX), (int)(3 * FactorDpiY), (int)(3 * FactorDpiX), (int)(3 * FactorDpiY));
- QAT_HEIGHT_FULL = (int)(28 * FactorDpiY);
+ _qatHeightFull = (int)(28 * FactorDpiY);
}
///
@@ -85,11 +85,11 @@ public override Size GetPreferredSize(ViewLayoutContext context)
// Add on the border padding
preferredSize = CommonHelper.ApplyPadding(Orientation.Horizontal, preferredSize, _borderPadding);
- preferredSize.Height = Math.Max(preferredSize.Height, QAT_HEIGHT_FULL);
+ preferredSize.Height = Math.Max(preferredSize.Height, _qatHeightFull);
return preferredSize;
}
-
+
///
/// Perform a layout of the elements.
///
@@ -98,7 +98,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
{
Debug.Assert(context != null);
- Rectangle clientRect = context.DisplayRectangle;
+ Rectangle clientRect = context!.DisplayRectangle;
ClientRectangle = clientRect;
@@ -118,14 +118,21 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
/// Perform rendering before child elements are rendered.
///
/// Rendering context.
- public override void RenderBefore(RenderContext context) => _memento = context.Renderer.RenderRibbon.DrawRibbonBack(_ribbon.RibbonShape,
+ public override void RenderBefore(RenderContext context)
+ {
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
+ _memento = context.Renderer.RenderRibbon.DrawRibbonBack(_ribbon.RibbonShape,
context,
ClientRectangle,
PaletteState.Normal,
_ribbon.StateCommon.RibbonQATOverflow,
VisualOrientation.Top,
- false,
_memento);
+ }
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonRecentDocs.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonRecentDocs.cs
index 72146070d..9b78aa064 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonRecentDocs.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonRecentDocs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -23,7 +23,7 @@ internal class ViewDrawRibbonRecentDocs : ViewLeaf,
#region Instance Fields
private readonly KryptonRibbon _ribbon;
private readonly RibbonRecentDocsTitleToContent _contentProvider;
- private IDisposable _memento;
+ private IDisposable? _memento;
#endregion
#region Identity
@@ -34,10 +34,10 @@ internal class ViewDrawRibbonRecentDocs : ViewLeaf,
public ViewDrawRibbonRecentDocs([DisallowNull] KryptonRibbon ribbon)
{
Debug.Assert(ribbon != null);
- _ribbon = ribbon;
+ _ribbon = ribbon!;
// Use a class to convert from ribbon recent docs to content interface
- _contentProvider = new RibbonRecentDocsTitleToContent(ribbon.StateCommon.RibbonGeneral,
+ _contentProvider = new RibbonRecentDocsTitleToContent(ribbon!.StateCommon.RibbonGeneral,
ribbon.StateCommon.RibbonAppMenuDocsTitle);
}
@@ -75,10 +75,17 @@ protected override void Dispose(bool disposing)
/// Discover the preferred size of the element.
///
/// Layout context.
- public override Size GetPreferredSize(ViewLayoutContext context) =>
- context.Renderer.RenderStandardContent.GetContentPreferredSize(context, _contentProvider, this,
+ public override Size GetPreferredSize(ViewLayoutContext context)
+ {
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
+ return context.Renderer.RenderStandardContent.GetContentPreferredSize(context, _contentProvider, this,
VisualOrientation.Top,
- PaletteState.Normal, false, false);
+ PaletteState.Normal);
+ }
///
/// Perform a layout of the elements.
@@ -86,10 +93,20 @@ public override Size GetPreferredSize(ViewLayoutContext context) =>
/// Layout context.
public override void Layout([DisallowNull] ViewLayoutContext context)
{
- Debug.Assert(context != null);
+ Debug.Assert(context is not null);
+
+ if (context is null)
+ {
+ throw new ArgumentNullException(nameof(context));
+ }
+
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// Remember to dispose of old memento
if (_memento != null)
@@ -102,7 +119,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
_memento = context.Renderer.RenderStandardContent.LayoutContent(context, ClientRectangle,
_contentProvider, this,
VisualOrientation.Top,
- PaletteState.Normal, false, false);
+ PaletteState.Normal);
}
#endregion
@@ -113,13 +130,18 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
/// Rendering context.
public override void RenderBefore(RenderContext context)
{
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
// Use renderer to draw the text content
if (_memento != null)
{
context.Renderer.RenderStandardContent.DrawContent(context, ClientRectangle,
_contentProvider, _memento,
VisualOrientation.Top,
- PaletteState.Normal, false, false, true);
+ PaletteState.Normal, true);
}
}
#endregion
@@ -143,8 +165,8 @@ public override void RenderBefore(RenderContext context)
/// Gets the short text used as the main ribbon title.
///
/// Title string.
- public string GetShortText() => !string.IsNullOrEmpty(_ribbon.RibbonStrings.RecentDocuments)
- ? _ribbon.RibbonStrings.RecentDocuments
+ public string GetShortText() => !string.IsNullOrEmpty(KryptonManager.Strings.RibbonStrings.RecentDocuments)
+ ? KryptonManager.Strings.RibbonStrings.RecentDocuments
: string.Empty;
///
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonRecentShortcut.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonRecentShortcut.cs
index 30c33f3d0..0dca38513 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonRecentShortcut.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonRecentShortcut.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -57,11 +57,11 @@ public override void RenderBefore([DisallowNull] RenderContext context)
}
// Only draw the shortcut text if there is some defined
- var shortcut = Values.GetShortText();
+ var shortcut = Values?.GetShortText();
if (!string.IsNullOrEmpty(shortcut))
{
// Only draw shortcut if the shortcut is not equal to the fixed string 'A'
- if (!shortcut.Equals("A"))
+ if (!shortcut!.Equals("A"))
{
base.RenderBefore(context);
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonScrollButton.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonScrollButton.cs
index c070ec80e..e3190f051 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonScrollButton.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonScrollButton.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -88,7 +88,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
Debug.Assert(context != null);
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
}
#endregion
@@ -99,6 +99,11 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
/// Rendering context.
public override void RenderBefore(RenderContext context)
{
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
// Create a border offset down and right for drawing a shadow
Rectangle shadowRect = ClientRectangle;
shadowRect.X++;
@@ -112,7 +117,7 @@ public override void RenderBefore(RenderContext context)
using GraphicsPath borderPath = CreateBorderPath(ClientRectangle),
shadowPath = CreateBorderPath(shadowRect);
// Are we allowed to draw a border?
- if (_ribbon.StateCommon.RibbonScroller.PaletteBorder.GetBorderDraw(State) == InheritBool.True)
+ if (_ribbon.StateCommon.RibbonScroller.PaletteBorder!.GetBorderDraw(State) == InheritBool.True)
{
// Draw the border shadow
using var aa = new AntiAlias(context.Graphics);
@@ -129,7 +134,7 @@ public override void RenderBefore(RenderContext context)
}
// Are we allowed to draw the content?
- if (_ribbon.StateCommon.RibbonScroller.PaletteContent.GetContentDraw(State) == InheritBool.True)
+ if (_ribbon.StateCommon.RibbonScroller.PaletteContent!.GetContentDraw(State) == InheritBool.True)
{
// Get the text color from palette
Color textColor = _ribbon.StateCommon.RibbonScroller.PaletteContent.GetContentShortTextColor1(State);
@@ -201,7 +206,7 @@ private void DrawArrow(Graphics? g, Color textColor, Rectangle rect)
// Create path that describes the arrow in orientation needed
using GraphicsPath arrowPath = CreateArrowPath(rect);
using var arrowBrush = new SolidBrush(textColor);
- g.FillPath(arrowBrush, arrowPath);
+ g?.FillPath(arrowBrush, arrowPath);
}
private GraphicsPath CreateArrowPath(Rectangle rect)
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonTab.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonTab.cs
index 58f48673b..3f282d915 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonTab.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonTab.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -57,14 +57,14 @@ static ViewDrawRibbonTab()
{
_contextBlend2007 = new Blend
{
- Factors = new[] { 0.0f, 0.0f, 1.0f, 1.0f },
- Positions = new[] { 0.0f, 0.41f, 0.7f, 1.0f }
+ Factors = [0.0f, 0.0f, 1.0f, 1.0f],
+ Positions = [0.0f, 0.41f, 0.7f, 1.0f]
};
_contextBlend2010 = new Blend
{
- Factors = new[] { 0.0f, 1.0f, 1.0f },
- Positions = new[] { 0.0f, 0.6f, 1.0f }
+ Factors = [0.0f, 1.0f, 1.0f],
+ Positions = [0.0f, 0.6f, 1.0f]
};
}
@@ -117,7 +117,7 @@ public ViewDrawRibbonTab([DisallowNull] KryptonRibbon ribbon,
Component = _ribbonTab;
// Create and add the draw content for display inside the tab
- Add(new ViewDrawContent(_contentProvider, this, VisualOrientation.Top, true, false));
+ Add(new ViewDrawContent(_contentProvider, this, VisualOrientation.Top));
// Create the state specific memento array
_mementos = new IDisposable[Enum.GetValues(typeof(PaletteState)).Length];
@@ -366,7 +366,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
_cacheState = State;
}
- // Do we need to actually perform the relayout?
+ // Do we need to actually perform the re-layout?
if ((_displayRect != ClientRectangle) ||
(Ribbon.DirtyPaletteCounter != _dirtyPaletteLayout))
{
@@ -397,11 +397,16 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
/// Rendering context.
public override void RenderBefore(RenderContext context)
{
+ if (context.Renderer is null)
+ {
+ throw new ArgumentNullException(nameof(context.Renderer));
+ }
+
// Ensure that child elements have correct palette state
CheckPaletteState(context);
// Grab the context tab set that relates to this tab
- ContextTabSet? cts = ViewLayoutRibbonTabs.ContextTabSets[RibbonTab?.ContextName];
+ ContextTabSet? cts = ViewLayoutRibbonTabs.ContextTabSets[RibbonTab!.ContextName];
switch (Ribbon.RibbonShape)
{
@@ -423,15 +428,14 @@ public override void RenderBefore(RenderContext context)
RenderBefore2010ContextTab(context, cts);
}
- //_paletteContextCurrent.LightBackground = _ribbon.CaptionArea.DrawCaptionOnComposition;
- _paletteContextCurrent.LightBackground = Ribbon.CaptionArea.DrawCaptionOnComposition
- && (KryptonManager.CurrentGlobalPalette != KryptonManager.PaletteOffice2010Black);
+ _paletteContextCurrent.LightBackground = KryptonManager.CurrentGlobalPaletteMode.ToString()
+ .StartsWith(PaletteMode.Office2010Black.ToString());
break;
}
// Use renderer to draw the tab background
var mementoIndex = StateIndex(State);
- _mementos[mementoIndex] = context.Renderer.RenderRibbon.DrawRibbonBack(Ribbon.RibbonShape, context, ClientRectangle, State, _paletteContextCurrent, VisualOrientation.Top, false, _mementos[mementoIndex]);
+ _mementos[mementoIndex] = context.Renderer.RenderRibbon.DrawRibbonBack(Ribbon.RibbonShape, context, ClientRectangle, State, _paletteContextCurrent, VisualOrientation.Top, _mementos[mementoIndex]);
}
///
@@ -441,7 +445,7 @@ public override void RenderBefore(RenderContext context)
public override void RenderAfter(RenderContext context)
{
// Grab the context tab set that relates to this tab
- ContextTabSet cts = ViewLayoutRibbonTabs.ContextTabSets[RibbonTab.ContextName];
+ ContextTabSet? cts = ViewLayoutRibbonTabs.ContextTabSets[RibbonTab!.ContextName];
// Is this tab part of a context?
if (cts != null)
@@ -505,7 +509,7 @@ private void RenderBefore2007ContextTab(RenderContext context, ContextTabSet cts
// Grab the color we draw the context separator in
Color sepColor = _paletteGeneral.GetRibbonTabSeparatorContextColor(PaletteState.Normal);
- Rectangle parentRect = Parent.ClientRectangle;
+ Rectangle parentRect = Parent!.ClientRectangle;
var contextRect = parentRect with { X = ClientRectangle.X - 1, Width = ClientRectangle.Width + 2 };
var gradientRect = new Rectangle(ClientRectangle.X - 1, parentRect.Y - 1,
ClientRectangle.Width + 2, parentRect.Height + 2);
@@ -592,7 +596,7 @@ private int StateIndex(PaletteState state)
for (var i = 0; i < stateValues.Length; i++)
{
- if ((PaletteState)stateValues.GetValue(i) == state)
+ if ((PaletteState?)stateValues.GetValue(i) == state)
{
return i;
}
@@ -604,7 +608,7 @@ private int StateIndex(PaletteState state)
private void CheckPaletteState(ViewContext context)
{
// Should control be enabled or disabled
- var enabled = IsFixed || context.Control.Enabled;
+ var enabled = IsFixed || context.Control!.Enabled;
// Ensure we and child and in correct enabled state
Enabled = enabled;
@@ -612,7 +616,7 @@ private void CheckPaletteState(ViewContext context)
// Better check we have a child!
if (Count > 0)
{
- this[0].Enabled = enabled;
+ this[0]!.Enabled = enabled;
}
// If disabled...
@@ -630,7 +634,7 @@ private void CheckPaletteState(ViewContext context)
Checked = Ribbon.SelectedTab == RibbonTab;
// Is this tab a context tab?
- var contextTab = !string.IsNullOrEmpty(RibbonTab.ContextName);
+ var contextTab = !string.IsNullOrEmpty(RibbonTab!.ContextName);
// Apply the checked state if not fixed
if (!IsFixed)
@@ -675,27 +679,35 @@ private void CheckPaletteState(ViewContext context)
case PaletteState.Normal:
_overrideCurrent = _overrideStateNormal;
break;
+
case PaletteState.Tracking:
_overrideCurrent = _overrideStateTracking;
break;
+
case PaletteState.CheckedNormal:
_overrideCurrent = _overrideStateCheckedNormal;
break;
+
case PaletteState.CheckedTracking:
_overrideCurrent = _overrideStateCheckedTracking;
break;
+
case PaletteState.ContextTracking:
_overrideCurrent = _overrideStateContextTracking;
break;
+
case PaletteState.ContextCheckedNormal:
_overrideCurrent = _overrideStateContextCheckedNormal;
break;
+
case PaletteState.ContextCheckedTracking:
_overrideCurrent = _overrideStateContextCheckedTracking;
break;
+
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(buttonState.ToString());
break;
}
@@ -705,7 +717,7 @@ private void CheckPaletteState(ViewContext context)
// Better check we have a child!
if (Count > 0)
{
- this[0].ElementState = buttonState;
+ this[0]!.ElementState = buttonState;
}
// Update the actual source palette
@@ -713,9 +725,9 @@ private void CheckPaletteState(ViewContext context)
}
}
- private void OnTabPropertyChanged(object sender, PropertyChangedEventArgs e) => MakeDirty();
+ private void OnTabPropertyChanged(object? sender, PropertyChangedEventArgs e) => MakeDirty();
- private void OnTabClicked(object sender, MouseEventArgs e)
+ private void OnTabClicked(object? sender, MouseEventArgs e)
{
// We never click to become unchecked
if (!Checked)
@@ -729,16 +741,16 @@ private void OnTabClicked(object sender, MouseEventArgs e)
}
}
- private void OnTabContextClicked(object sender, MouseEventArgs e)
+ private void OnTabContextClicked(object? sender, MouseEventArgs e)
{
if (Ribbon.InDesignMode)
{
- _ribbonTab.OnDesignTimeContextMenu(new MouseEventArgs(MouseButtons.Right, 1, e.X, e.Y, 0));
+ _ribbonTab?.OnDesignTimeContextMenu(new MouseEventArgs(MouseButtons.Right, 1, e.X, e.Y, 0));
}
else
{
// Convert the mouse point to screen coords from the containing control
- Point screenPt = Ribbon.TabsArea.TabsContainerControl.ChildControl.PointToScreen(new Point(e.X, e.Y));
+ Point screenPt = Ribbon.TabsArea!.TabsContainerControl.ChildControl!.PointToScreen(new Point(e.X, e.Y));
// Convert back to ribbon client coords, needed for the show context menu call
Point clientPt = Ribbon.PointToClient(screenPt);
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonTabSep.cs b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonTabSep.cs
index 65b9c78d6..52a1dbabf 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonTabSep.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Draw/ViewDrawRibbonTabSep.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -36,8 +36,8 @@ static ViewDrawRibbonTabSep()
{
_fadeBlend = new Blend
{
- Factors = new[] { 0.0f, 1.0f, 1.0f },
- Positions = new[] { 0.0f, 0.33f, 1.0f }
+ Factors = [0.0f, 1.0f, 1.0f],
+ Positions = [0.0f, 0.33f, 1.0f]
};
}
@@ -49,7 +49,7 @@ public ViewDrawRibbonTabSep([DisallowNull] IPaletteRibbonGeneral palette)
: base(SEP_WIDTH, true)
{
Debug.Assert(palette != null);
- _palette = palette;
+ _palette = palette!;
}
///
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonAppButton.cs b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonAppButton.cs
index c6911fd87..a2cd58569 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonAppButton.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonAppButton.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -38,11 +38,11 @@ internal class ViewLayoutRibbonAppButton : ViewLayoutDocker
///
/// Owning control instance.
/// Scroller orientation.
- public ViewLayoutRibbonAppButton([DisallowNull] KryptonRibbon ribbon,
+ public ViewLayoutRibbonAppButton([DisallowNull] KryptonRibbon? ribbon,
bool bottomHalf)
{
- Debug.Assert(ribbon != null);
- _ribbon = ribbon;
+ Debug.Assert(ribbon is not null);
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
AppButton = new ViewDrawRibbonAppButton(ribbon, bottomHalf);
_separator = new ViewLayoutRibbonSeparator(APPBUTTON_GAP, true);
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonAppTab.cs b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonAppTab.cs
index a7ce453ab..3ee4bdfd1 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonAppTab.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonAppTab.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -31,10 +31,10 @@ internal class ViewLayoutRibbonAppTab : ViewLayoutDocker
/// Owning control instance.
public ViewLayoutRibbonAppTab([DisallowNull] KryptonRibbon ribbon)
{
- Debug.Assert(ribbon != null);
- _ribbon = ribbon;
+ Debug.Assert(ribbon is not null);
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
- AppTab = new ViewDrawRibbonAppTab(ribbon);
+ AppTab = new ViewDrawRibbonFileAppTab(ribbon);
// Dock it against the appropriate edge
Add(AppTab, ViewDockStyle.Bottom);
@@ -55,7 +55,7 @@ public override string ToString() =>
///
/// Gets the view element that represents the button.
///
- public ViewDrawRibbonAppTab AppTab { get; }
+ public ViewDrawRibbonFileAppTab AppTab { get; }
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonCenter.cs b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonCenter.cs
index e6b8fe42e..cdca4f6e3 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonCenter.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonCenter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonCenterPadding.cs b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonCenterPadding.cs
index fe1628c31..76c3bc625 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonCenterPadding.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonCenterPadding.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonCheckBox.cs b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonCheckBox.cs
index eed1b0b9e..b51d97783 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonCheckBox.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonCheckBox.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -17,7 +17,5 @@ namespace Krypton.Ribbon
///
/// Position the contenst of the ribbon check box.
///
- internal class ViewLayoutRibbonCheckBox : ViewLayoutDocker
- {
- }
+ internal class ViewLayoutRibbonCheckBox : ViewLayoutDocker;
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonContextTitles.cs b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonContextTitles.cs
index 2d7fd9add..38798b55e 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonContextTitles.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonContextTitles.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -21,9 +21,7 @@ internal class ViewLayoutRibbonContextTitles : ViewLayoutDocker
{
#region Classes
- private class ViewDrawRibbonContextTitleList : List
- {
- };
+ private class ViewDrawRibbonContextTitleList : List;
#endregion
@@ -39,16 +37,17 @@ private class ViewDrawRibbonContextTitleList : List
///
/// Reference to source ribbon control.
/// Reference to view element that tracks the top level form.
- public ViewLayoutRibbonContextTitles([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] ViewDrawRibbonCaptionArea captionArea)
+ public ViewLayoutRibbonContextTitles([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] ViewDrawRibbonCaptionArea? captionArea)
{
- Debug.Assert(captionArea != null);
- Debug.Assert(ribbon != null);
- _ribbon = ribbon;
- _captionArea = captionArea;
+ Debug.Assert(captionArea is not null);
+ Debug.Assert(ribbon is not null);
+
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _captionArea = captionArea ?? throw new ArgumentNullException(nameof(captionArea));
// Create cache of draw elements
- _contextTitlesCache = new ViewDrawRibbonContextTitleList();
+ _contextTitlesCache = [];
}
///
@@ -102,10 +101,10 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
SyncChildrenToContexts();
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// Find any filler child
- ViewBase filler = this.FirstOrDefault(child => GetDock(child) == ViewDockStyle.Fill);
+ ViewBase? filler = this.FirstOrDefault(child => GetDock(child) == ViewDockStyle.Fill);
var xLeftMost = ClientRectangle.Right;
var xRightMost = ClientRectangle.Left;
@@ -115,14 +114,14 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
foreach (ViewDrawRibbonContextTitle childContextTitle in this.Where(static child => child.Visible).OfType())
{
// Get the context set it is representing
- ContextTabSet tabContext = childContextTitle.ContextTabSet;
+ ContextTabSet tabContext = childContextTitle.ContextTabSet!;
// Get the screen position of the left and right hand positions
Point leftTab = tabContext.GetLeftScreenPosition();
Point rightTab = tabContext.GetRightScreenPosition();
// If our position is above the ribbon control we must be in the chrome
- if (_captionArea is { UsingCustomChrome: true, KryptonForm.ApplyComposition: false })
+ if (_captionArea is { UsingCustomChrome: true})
{
var leftPadding = _captionArea.RealWindowBorders.Left;
leftTab.X += leftPadding;
@@ -130,7 +129,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
}
// Convert the screen to our own coordinates
- leftTab = context.TopControl.PointToClient(leftTab);
+ leftTab = context.TopControl!.PointToClient(leftTab);
rightTab = context.TopControl.PointToClient(rightTab);
// Calculate the position of the child and layout
@@ -214,9 +213,9 @@ private void SyncChildrenToContexts()
for (var i = 0; i < ViewLayoutRibbonTabs.ContextTabSets.Count; i++)
{
ViewDrawRibbonContextTitle viewContext = _contextTitlesCache[i];
- var viewController = (ContextTitleController)viewContext.MouseController;
+ var viewController = viewContext.MouseController as ContextTitleController;
viewContext.ContextTabSet = ViewLayoutRibbonTabs.ContextTabSets[i];
- viewController.ContextTabSet = viewContext.ContextTabSet;
+ viewController!.ContextTabSet = viewContext.ContextTabSet;
Add(viewContext);
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGalleryButtons.cs b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGalleryButtons.cs
index ea028a52d..d5e7111c2 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGalleryButtons.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGalleryButtons.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGalleryItems.cs b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGalleryItems.cs
index 79862cb3a..f924138e4 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGalleryItems.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGalleryItems.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -56,25 +56,30 @@ internal class ViewLayoutRibbonGalleryItems : ViewComposite
/// Reference to the up button.
/// Reference to the down button.
/// Reference to the context button.
- public ViewLayoutRibbonGalleryItems([DisallowNull] PaletteBase palette,
- [DisallowNull] KryptonGallery gallery,
- [DisallowNull] NeedPaintHandler needPaint,
- [DisallowNull] ViewDrawRibbonGalleryButton buttonUp,
- [DisallowNull] ViewDrawRibbonGalleryButton buttonDown,
- [DisallowNull] ViewDrawRibbonGalleryButton buttonContext)
+ public ViewLayoutRibbonGalleryItems([DisallowNull] PaletteBase? palette,
+ [DisallowNull] KryptonGallery? gallery,
+ [DisallowNull] NeedPaintHandler? needPaint,
+ [DisallowNull] ViewDrawRibbonGalleryButton? buttonUp,
+ [DisallowNull] ViewDrawRibbonGalleryButton? buttonDown,
+ [DisallowNull] ViewDrawRibbonGalleryButton? buttonContext)
{
- Debug.Assert(palette != null);
- Debug.Assert(gallery != null);
- Debug.Assert(needPaint != null);
- Debug.Assert(buttonUp != null);
- Debug.Assert(buttonDown != null);
- Debug.Assert(buttonContext != null);
-
- _gallery = gallery;
- _needPaint = needPaint;
- _buttonUp = buttonUp;
- _buttonDown = buttonDown;
- _buttonContext = buttonContext;
+ Debug.Assert(palette is not null);
+ Debug.Assert(gallery is not null);
+ Debug.Assert(needPaint is not null);
+ Debug.Assert(buttonUp is not null);
+ Debug.Assert(buttonDown is not null);
+ Debug.Assert(buttonContext is not null);
+
+ if (palette is null)
+ {
+ throw new ArgumentNullException(nameof(palette));
+ }
+
+ _gallery = gallery ?? throw new ArgumentNullException(nameof(gallery));
+ _needPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
+ _buttonUp = buttonUp ?? throw new ArgumentNullException(nameof(buttonUp));
+ _buttonDown = buttonDown ?? throw new ArgumentNullException(nameof(buttonDown));
+ _buttonContext = buttonContext ?? throw new ArgumentNullException(nameof(buttonContext));
_bringIntoView = -1;
ScrollIntoView = true;
@@ -370,8 +375,8 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
// Find size of the first item, if there is one
if (Count > 0)
{
- // Ask child for it's own preferred size
- preferredSize = this[0].GetPreferredSize(context);
+ // Ask child for its own preferred size
+ preferredSize = this[0]!.GetPreferredSize(context!);
// Find preferred size from the preferred item size
preferredSize.Width *= _gallery.PreferredItemSize.Width;
@@ -412,7 +417,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
Rectangle displayRect = CommonHelper.ApplyPadding(Orientation.Horizontal, ClientRectangle, _gallery.Padding);
// Get size of the first child, assume all others are same size
- _itemSize = this[0].GetPreferredSize(context);
+ _itemSize = this[0]!.GetPreferredSize(context);
// Number of items that can be placed on a single line
_lineItems = Math.Max(1, displayRect.Width / _itemSize.Width);
@@ -426,7 +431,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
// Index of last line that can be the top line
_endLine = _layoutLines - _displayLines;
- // Update topline and offset to reflect any outstanding bring into view request
+ // Update top-line and offset to reflect any outstanding bring into view request
ProcessBringIntoView();
// Limit check the top line is within the valid range
@@ -489,16 +494,16 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
// Position all children on single line from left to right
for (var i = 0; i < Count; i++)
{
- ViewBase childItem = this[i];
+ ViewBase? childItem = this[i];
// Should this item be visible
if ((i < start) || (i >= end))
{
- childItem.Visible = false;
+ childItem!.Visible = false;
}
else
{
- childItem.Visible = true;
+ childItem!.Visible = true;
// Find rectangle for the child
context.DisplayRectangle = new Rectangle(nextPoint, _itemSize);
@@ -537,12 +542,12 @@ public void SyncChildren()
{
var required = 0;
var selectedIndex = _gallery.SelectedIndex;
- ImageList imageList = _gallery.ImageList;
+ ImageList? imageList = _gallery.ImageList;
// Find out how many children we need
if (imageList != null)
{
- required = _gallery.ImageList.Images.Count;
+ required = _gallery.ImageList!.Images.Count;
}
// If we do not have enough already
@@ -568,32 +573,32 @@ public void SyncChildren()
// Tell each item the image it should be displaying
for (var i = 0; i < required; i++)
{
- var item = (ViewDrawRibbonGalleryItem)this[i];
- item.ImageList = imageList;
+ var item = this[i] as ViewDrawRibbonGalleryItem;
+ item!.ImageList = imageList;
item.ImageIndex = i;
item.Checked = selectedIndex == i;
}
}
- private void OnButtonUp(object sender, MouseEventArgs e)
+ private void OnButtonUp(object? sender, MouseEventArgs e)
{
PrevLine();
_gallery.PerformNeedPaint(true);
}
- private void OnButtonDown(object sender, MouseEventArgs e)
+ private void OnButtonDown(object? sender, MouseEventArgs e)
{
NextLine();
_gallery.PerformNeedPaint(true);
}
- private void OnButtonContext(object sender, MouseEventArgs e)
+ private void OnButtonContext(object? sender, MouseEventArgs e)
{
_buttonContext.ForceLeave();
_gallery.OnDropButton();
}
- private void OnScrollTick(object sender, EventArgs e)
+ private void OnScrollTick(object? sender, EventArgs e)
{
// Update the offset by scroll move amount
if (_offset != 0)
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGroupButton.cs b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGroupButton.cs
index 890587026..e80e76960 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGroupButton.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGroupButton.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -68,7 +68,7 @@ public override string ToString() =>
/// Gets the view to use for the group dialog button.
///
/// ViewBase if valid as a focus item; otherwise false.
- public ViewBase? GetFocusView()
+ public ViewBase GetFocusView()
{
if (Visible && Enabled && _groupButton is { Visible: true, Enabled: true })
{
@@ -76,7 +76,7 @@ public override string ToString() =>
}
else
{
- return null;
+ return null!;
}
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGroupCluster.cs b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGroupCluster.cs
index 93e15bdba..b162f76fe 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGroupCluster.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGroupCluster.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -22,15 +22,15 @@ internal class ViewLayoutRibbonGroupCluster : ViewComposite,
{
#region Type Definitions
- private class ItemToView : Dictionary { }
- private class ViewToEdge : Dictionary { }
- private class ViewToSize : Dictionary { }
+ private class ItemToView : Dictionary;
+ private class ViewToEdge : Dictionary;
+ private class ViewToSize : Dictionary;
#endregion
#region Instance Fields
private readonly KryptonRibbon _ribbon;
private readonly KryptonRibbonGroupCluster _ribbonCluster;
- private ViewDrawRibbonDesignCluster? _viewAddItem;
+ private ViewDrawRibbonDesignCluster _viewAddItem;
private readonly ViewDrawRibbonGroupClusterSeparator _startSep;
private readonly ViewDrawRibbonGroupClusterSeparator _endSep;
private readonly PaletteBorderEdge _paletteBorderEdge;
@@ -52,18 +52,18 @@ private class ViewToSize : Dictionary { }
/// Owning ribbon control instance.
/// Reference to cluster definition.
/// Delegate for notifying paint requests.
- public ViewLayoutRibbonGroupCluster([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupCluster ribbonCluster,
- [DisallowNull] NeedPaintHandler needPaint)
+ public ViewLayoutRibbonGroupCluster([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupCluster? ribbonCluster,
+ [DisallowNull] NeedPaintHandler? needPaint)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(ribbonCluster != null);
- Debug.Assert(needPaint != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(ribbonCluster is not null);
+ Debug.Assert(needPaint is not null);
// Cache references
- _ribbon = ribbon;
- _ribbonCluster = ribbonCluster;
- _needPaint = needPaint;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _ribbonCluster = ribbonCluster ?? throw new ArgumentNullException(nameof(ribbonCluster));
+ _needPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
_currentSize = GroupItemSize.Medium;
// Associate the component with this view element for design time selection
@@ -129,7 +129,7 @@ protected override void Dispose(bool disposing)
/// Gets the first focus item from the container.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetFirstFocusItem()
+ public ViewBase GetFirstFocusItem()
{
ViewBase? view = null;
@@ -153,7 +153,7 @@ protected override void Dispose(bool disposing)
}
}
- return view;
+ return view!;
}
#endregion
@@ -162,7 +162,7 @@ protected override void Dispose(bool disposing)
/// Gets the last focus item from the container.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetLastFocusItem()
+ public ViewBase GetLastFocusItem()
{
ViewBase? view = null;
@@ -186,7 +186,7 @@ protected override void Dispose(bool disposing)
}
}
- return view;
+ return view!;
}
#endregion
@@ -197,7 +197,7 @@ protected override void Dispose(bool disposing)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetNextFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetNextFocusItem(ViewBase current, ref bool matched)
{
ViewBase? view = null;
@@ -222,7 +222,7 @@ protected override void Dispose(bool disposing)
}
}
- return view;
+ return view!;
}
#endregion
@@ -233,12 +233,12 @@ protected override void Dispose(bool disposing)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetPreviousFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetPreviousFocusItem(ViewBase current, ref bool matched)
{
ViewBase? view = null;
// Scan all the children, which must be containers
- foreach (ViewBase child in Reverse())
+ foreach (ViewBase? child in Reverse())
{
// Only interested in visible children!
if (child.Visible)
@@ -258,7 +258,7 @@ protected override void Dispose(bool disposing)
}
}
- return view;
+ return view!;
}
#endregion
@@ -336,8 +336,8 @@ public void ResetGroupItemSize()
}
// Our current size is based on the parent one
- var viewLines = (ViewLayoutRibbonGroupLines)Parent;
- _currentSize = viewLines.CurrentSize == GroupItemSize.Small ? GroupItemSize.Small : GroupItemSize.Medium;
+ var viewLines = Parent as ViewLayoutRibbonGroupLines;
+ _currentSize = viewLines?.CurrentSize == GroupItemSize.Small ? GroupItemSize.Small : GroupItemSize.Medium;
}
///
@@ -360,10 +360,10 @@ public override Size GetPreferredSize(ViewLayoutContext context)
// Find total width and maximum height across all child elements
for (var i = 0; i < Count; i++)
{
- ViewBase child = this[i];
+ ViewBase? child = this[i];
// Only interested in visible items
- if (child.Visible)
+ if (child!.Visible)
{
// Cache preferred size of the child
Size childSize = child.GetPreferredSize(context);
@@ -397,7 +397,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
Debug.Assert(context != null);
// Store the provided client area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// Define visible state of the separators
_startSep.Visible = _startSepVisible && (_lastShape == PaletteRibbonShape.Office2010);
@@ -422,10 +422,10 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
// Position each item from left/top to right/bottom
for (var i = 0; i < Count; i++)
{
- ViewBase child = this[i];
+ ViewBase? child = this[i];
// We only position visible items
- if (child.Visible)
+ if (child!.Visible)
{
// Cache preferred size of the child
Size childSize = viewToSize[child];
@@ -434,7 +434,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
context.DisplayRectangle = new Rectangle(x, y, childSize.Width, ClientHeight);
// Position the element
- this[i].Layout(context);
+ this[i]?.Layout(context);
// Move across to next position
x += childSize.Width;
@@ -528,7 +528,7 @@ private void SyncChildrenToRibbonGroupItems()
else
{
// Ask the item definition to return an appropriate view
- itemView = item.CreateView(_ribbon, _needPaint);
+ itemView = item.CreateView(_ribbon, _needPaint!);
// Create a border edge to go with the item view
itemEdge = new ViewDrawRibbonGroupClusterEdge(_ribbon, _paletteBorderEdge);
@@ -621,12 +621,12 @@ private void SyncChildrenToRibbonGroupItems()
view.Dispose();
}
- foreach (ViewBase view in _viewToEdge.Values)
+ foreach (var view in _viewToEdge.Values)
{
view.Dispose();
}
- // Always add the end separator as the last view element (excluding any desing time additions)
+ // Always add the end separator as the last view element (excluding any design time additions)
Add(_endSep);
// Define visible state of the separators
@@ -639,7 +639,7 @@ private void SyncChildrenToRibbonGroupItems()
// Create the design time 'Item' first time it is needed
_viewAddItem ??= new ViewDrawRibbonDesignCluster(_ribbon,
_ribbonCluster,
- _needPaint);
+ _needPaint!);
// Always add at end of the list of items
Add(_viewAddItem);
@@ -650,7 +650,7 @@ private void SyncChildrenToRibbonGroupItems()
_viewToEdge = regenEdge;
}
- private void OnClusterPropertyChanged(object sender, PropertyChangedEventArgs e)
+ private void OnClusterPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
var updateLayout = false;
@@ -673,7 +673,7 @@ private void OnClusterPropertyChanged(object sender, PropertyChangedEventArgs e)
}
}
- private void OnContextClick(object sender, MouseEventArgs e)
+ private void OnContextClick(object? sender, MouseEventArgs e)
{
if (_ribbon.InDesignMode)
{
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGroupContent.cs b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGroupContent.cs
index 18715c226..f6f4625c1 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGroupContent.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGroupContent.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -21,7 +21,7 @@ internal class ViewLayoutRibbonGroupContent : ViewComposite,
IRibbonViewGroupSize
{
#region Type Definitions
- private class ContainerToView : Dictionary { }
+ private class ContainerToView : Dictionary;
#endregion
#region Static Fields
@@ -37,7 +37,7 @@ private class ContainerToView : Dictionary { }
private readonly NeedPaintHandler _needPaint;
private ContainerToView _containerToView;
private List _listWidths;
- private int[] _containerWidths;
+ private int[]? _containerWidths;
#endregion
#region Identity
@@ -47,18 +47,18 @@ private class ContainerToView : Dictionary { }
/// Owning ribbon control instance.
/// The ribbon group this layout is used to display.
/// Delegate for notifying paint requests.
- public ViewLayoutRibbonGroupContent([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroup ribbonGroup,
- [DisallowNull] NeedPaintHandler needPaint)
+ public ViewLayoutRibbonGroupContent([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroup? ribbonGroup,
+ [DisallowNull] NeedPaintHandler? needPaint)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(ribbonGroup != null);
- Debug.Assert(needPaint != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(ribbonGroup is not null);
+ Debug.Assert(needPaint is not null);
// Cache references
- _ribbon = ribbon;
- _ribbonGroup = ribbonGroup;
- _needPaint = needPaint;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _ribbonGroup = ribbonGroup ?? throw new ArgumentNullException(nameof(ribbonGroup));
+ _needPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
// Use hashtable to store relationships
_containerToView = new ContainerToView();
@@ -125,7 +125,7 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList)
/// Gets the first focus item from the group content.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetFirstFocusItem()
+ public ViewBase GetFirstFocusItem()
{
ViewBase? view = null;
@@ -156,7 +156,7 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList)
view = DialogView.GetFocusView();
}
- return view;
+ return view!;
}
#endregion
@@ -165,7 +165,7 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList)
/// Gets the last focus item from the group.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetLastFocusItem()
+ public ViewBase GetLastFocusItem()
{
ViewBase? view = null;
@@ -209,7 +209,7 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList)
}
}
- return view;
+ return view!;
}
#endregion
@@ -220,7 +220,7 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetNextFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetNextFocusItem(ViewBase current, ref bool matched)
{
ViewBase? view = null;
@@ -276,7 +276,7 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList)
}
}
- return view;
+ return view!;
}
#endregion
@@ -287,7 +287,7 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetPreviousFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetPreviousFocusItem(ViewBase current, ref bool matched)
{
ViewBase? view = null;
@@ -339,7 +339,7 @@ public void GetGroupKeyTips(KeyTipInfoList keyTipList)
}
}
- return view;
+ return view!;
}
#endregion
@@ -355,14 +355,14 @@ public GroupSizeWidth[] GetPossibleSizes(ViewLayoutContext context)
SyncChildrenToRibbonGroupItems();
// Get the permutations available for each child container
- _listWidths = new List();
+ _listWidths = [];
// Scan all child containers
var pixelGaps = 0;
var maxEntries = 0;
for (var i = 0; i < Count; i++)
{
- if (this[i].Visible
+ if (this[i]!.Visible
&& (this[i] is IRibbonViewGroupContainerView container)
)
{
@@ -526,7 +526,7 @@ public GroupSizeWidth[] GetPossibleSizes(ViewLayoutContext context)
/// Update the group with the provided sizing solution.
///
/// Solution size.
- public void SetSolutionSize(ItemSizeWidth[] size)
+ public void SetSolutionSize(ItemSizeWidth[]? size)
{
// Do we need to restore each container to its default size?
if ((size == null) || (size.Length == 0))
@@ -534,7 +534,7 @@ public void SetSolutionSize(ItemSizeWidth[] size)
// Look for visible child containers
for (var i = 0; i < Count; i++)
{
- if (this[i].Visible
+ if (this[i]!.Visible
&& (this[i] is IRibbonViewGroupContainerView container)
)
{
@@ -552,7 +552,7 @@ public void SetSolutionSize(ItemSizeWidth[] size)
// Look for visible child containers
for (int i = 0, j = 0; i < Count; i++)
{
- if (this[i].Visible
+ if (this[i]!.Visible
&& (this[i] is IRibbonViewGroupContainerView container)
)
{
@@ -580,10 +580,10 @@ public override Size GetPreferredSize(ViewLayoutContext context)
// Find total width and maximum height across all child elements
for (int i = 0, j = 0; i < Count; i++)
{
- ViewBase child = this[i];
+ ViewBase? child = this[i];
// Only interested in visible items
- if (child.Visible)
+ if (child!.Visible)
{
Size childSize;
@@ -628,7 +628,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
Debug.Assert(context != null);
// We take on all the available display area and then remove our constant padding
- ClientRectangle = CommonHelper.ApplyPadding(Orientation.Horizontal, context.DisplayRectangle, _padding);
+ ClientRectangle = CommonHelper.ApplyPadding(Orientation.Horizontal, context!.DisplayRectangle, _padding);
var x = ClientLocation.X;
@@ -641,10 +641,10 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
// Position each item from left to right taking up entire height
for (int i = 0, j = 0; i < Count; i++)
{
- ViewBase child = this[i];
+ ViewBase? child = this[i];
// We only position visible items
- if (child.Visible)
+ if (child!.Visible)
{
Size childSize;
@@ -664,7 +664,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
context.DisplayRectangle = new Rectangle(x, y, childSize.Width, height);
// Position the element
- this[i].Layout(context);
+ this[i]!.Layout(context);
// Move across to next position (add 1 extra as the spacing gap)
x += childSize.Width + 1;
@@ -690,8 +690,8 @@ private void SyncChildrenToRibbonGroupItems()
foreach (KryptonRibbonGroupContainer container in _ribbonGroup.Items)
{
// Do we already have a view for this container definition
- ViewBase containerView = _containerToView.ContainsKey(container)
- ? _containerToView[container]
+ ViewBase containerView = _containerToView.TryGetValue(container, out ViewBase? value)
+ ? value
: container.CreateView(_ribbon, _needPaint);
// Update the visible state of the item
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGroupLines.cs b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGroupLines.cs
index 82ac9d331..4a942fe14 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGroupLines.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGroupLines.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -27,18 +27,18 @@ internal class ViewLayoutRibbonGroupLines : ViewComposite,
#endregion
#region Type Definitions
- private class ItemToView : Dictionary { }
- private class ViewToItem : Dictionary { }
- private class ViewToGap : Dictionary { }
- private class SizeList : List { }
- private class ViewList : List { }
+ private class ItemToView : Dictionary;
+ private class ViewToItem : Dictionary;
+ private class ViewToGap : Dictionary;
+ private class SizeList : List;
+ private class ViewList : List;
#endregion
#region Instance Fields
private readonly KryptonRibbon _ribbon;
private readonly KryptonRibbonGroupLines _ribbonLines;
- private ViewDrawRibbonDesignGroupLines? _viewAddItem;
- private readonly NeedPaintHandler _needPaint;
+ private ViewDrawRibbonDesignGroupLines _viewAddItem;
+ private readonly NeedPaintHandler? _needPaint;
private GroupItemSize _currentSize;
private ItemToView _itemToView;
private ViewToItem _viewToItem;
@@ -67,18 +67,18 @@ private class ViewList : List { }
/// Owning ribbon control instance.
/// Reference to lines definition.
/// Delegate for notifying paint requests.
- public ViewLayoutRibbonGroupLines([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupLines ribbonLines,
- [DisallowNull] NeedPaintHandler needPaint)
+ public ViewLayoutRibbonGroupLines([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupLines? ribbonLines,
+ [DisallowNull] NeedPaintHandler? needPaint)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(ribbonLines != null);
- Debug.Assert(needPaint != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(ribbonLines is not null);
+ Debug.Assert(needPaint is not null);
// Cache references
- _ribbon = ribbon;
- _ribbonLines = ribbonLines;
- _needPaint = needPaint;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _ribbonLines = ribbonLines ?? throw new ArgumentNullException(nameof(ribbonLines));
+ _needPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
// Associate the component with this view element for design time selection
Component = _ribbonLines;
@@ -86,12 +86,12 @@ public ViewLayoutRibbonGroupLines([DisallowNull] KryptonRibbon ribbon,
// Use hashtable to store relationships
_itemToView = new ItemToView();
_viewToItem = new ViewToItem();
- _sizeLargeList = new SizeList();
- _sizeMediumList = new SizeList();
- _sizeSmallList = new SizeList();
- _viewLargeList = new ViewList();
- _viewMediumList = new ViewList();
- _viewSmallList = new ViewList();
+ _sizeLargeList = [];
+ _sizeMediumList = [];
+ _sizeSmallList = [];
+ _viewLargeList = [];
+ _viewMediumList = [];
+ _viewSmallList = [];
_viewToLargeGap = new ViewToGap();
_viewToMediumGap = new ViewToGap();
_viewToSmallGap = new ViewToGap();
@@ -161,7 +161,7 @@ public GroupItemSize CurrentSize
/// Gets the first focus item from the container.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetFirstFocusItem()
+ public ViewBase GetFirstFocusItem()
{
ViewBase? view = null;
@@ -196,7 +196,7 @@ public GroupItemSize CurrentSize
}
}
- return view;
+ return view!;
}
#endregion
@@ -205,7 +205,7 @@ public GroupItemSize CurrentSize
/// Gets the last focus item from the container.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetLastFocusItem()
+ public ViewBase GetLastFocusItem()
{
ViewBase? view = null;
@@ -240,7 +240,7 @@ public GroupItemSize CurrentSize
}
}
- return view;
+ return view!;
}
#endregion
@@ -251,7 +251,7 @@ public GroupItemSize CurrentSize
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetNextFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetNextFocusItem(ViewBase current, ref bool matched)
{
ViewBase? view = null;
@@ -290,7 +290,7 @@ public GroupItemSize CurrentSize
}
}
- return view;
+ return view!;
}
#endregion
@@ -301,7 +301,7 @@ public GroupItemSize CurrentSize
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetPreviousFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetPreviousFocusItem(ViewBase current, ref bool matched)
{
ViewBase? view = null;
@@ -340,7 +340,7 @@ public GroupItemSize CurrentSize
}
}
- return view;
+ return view!;
}
#endregion
@@ -529,10 +529,10 @@ public override Size GetPreferredSize(ViewLayoutContext context)
// Find the size of each individual visible child item
for (var i = 0; i < Count; i++)
{
- ViewBase child = this[i];
+ ViewBase? child = this[i];
// Only interested in visible items
- if (child.Visible)
+ if (child!.Visible)
{
// Inform cluster if it is immediately after another cluster (and so potentially needs a separator)
// Are we positioning a cluster?
@@ -546,11 +546,10 @@ public override Size GetPreferredSize(ViewLayoutContext context)
if (previousChild != null)
{
if (_viewToItem.ContainsKey(child) &&
- _viewToItem.ContainsKey(previousChild))
+ _viewToItem.TryGetValue(previousChild, out IRibbonGroupItem? previousItem))
{
// Cast to correct type
IRibbonGroupItem childItem = _viewToItem[child];
- IRibbonGroupItem previousItem = _viewToItem[previousChild];
// Find the requested gap between them
_viewToGap.Add(child, childItem.ItemGap(previousItem));
@@ -587,8 +586,9 @@ public override Size GetPreferredSize(ViewLayoutContext context)
case GroupItemSize.Small:
return SmallPreferredSize(totalWidth);
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(_currentSize.ToString());
return Size.Empty;
}
}
@@ -602,7 +602,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
Debug.Assert(context != null);
// Store the provided client area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// Are there any children to layout?
if (Count > 0)
@@ -613,15 +613,19 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
case GroupItemSize.Large:
LargeMediumLayout(context, ref _split1Large);
break;
+
case GroupItemSize.Medium:
LargeMediumLayout(context, ref _split1Medium);
break;
+
case GroupItemSize.Small:
SmallLayout(context);
break;
+
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(_currentSize.ToString());
break;
}
}
@@ -682,21 +686,25 @@ private void ApplySize(GroupItemSize size)
_viewToGap = _viewToLargeGap;
itemSize = GroupItemSize.Medium;
break;
+
case GroupItemSize.Medium:
_sizeList = _sizeMediumList;
_viewList = _viewMediumList;
_viewToGap = _viewToMediumGap;
itemSize = GroupItemSize.Small;
break;
+
case GroupItemSize.Small:
_sizeList = _sizeSmallList;
_viewList = _viewSmallList;
_viewToGap = _viewToSmallGap;
itemSize = GroupItemSize.Small;
break;
+
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(size.ToString());
break;
}
@@ -731,7 +739,7 @@ private void SyncChildrenToRibbonGroupItems()
var regenViewToItem = new ViewToItem();
// Add a view element for each group item
- foreach (IRibbonGroupItem item in _ribbonLines.Items)
+ foreach (IRibbonGroupItem item in _ribbonLines.Items!)
{
ViewBase? itemView;
@@ -746,7 +754,7 @@ private void SyncChildrenToRibbonGroupItems()
else
{
// Ask the item definition to return an appropriate view
- itemView = item.CreateView(_ribbon, _needPaint);
+ itemView = item.CreateView(_ribbon, _needPaint!);
}
// Update the visible state of the item
@@ -766,14 +774,14 @@ private void SyncChildrenToRibbonGroupItems()
_viewAddItem ??= new ViewDrawRibbonDesignGroupLines(_ribbon,
_ribbonLines,
_currentSize,
- _needPaint);
+ _needPaint!);
// Always add at end of the list of items
Add(_viewAddItem);
}
// Dispose of all the items no longer needed
- foreach (ViewBase view in _itemToView.Values)
+ foreach (var view in _itemToView.Values)
{
view.Dispose();
}
@@ -977,10 +985,10 @@ private void LargeMediumLayout(ViewLayoutContext context, ref int split1)
// Position the visible items in turn
for (int i = 0, visibleIndex = 0; i < Count; i++)
{
- ViewBase child = this[i];
+ ViewBase? child = this[i];
// We only position visible items
- if (child.Visible)
+ if (child!.Visible)
{
// Are we positioning a cluster?
if (child is ViewLayoutRibbonGroupCluster clusterChild1)
@@ -1001,9 +1009,9 @@ private void LargeMediumLayout(ViewLayoutContext context, ref int split1)
}
// If not the first item on the line, then get the pixel gap between them
- if ((previousChild != null) && _viewToGap.ContainsKey(child))
+ if ((previousChild != null) && _viewToGap.TryGetValue(child, out var value))
{
- x += _viewToGap[child];
+ x += value;
}
// Get the size of the child item
@@ -1013,7 +1021,7 @@ private void LargeMediumLayout(ViewLayoutContext context, ref int split1)
context.DisplayRectangle = new Rectangle(x, y, childSize.Width, childSize.Height);
// Position the element
- this[i].Layout(context);
+ this[i]?.Layout(context);
// Do we need to split after this item
if (split1 == visibleIndex)
@@ -1064,10 +1072,10 @@ private void SmallLayout(ViewLayoutContext context)
// Position the visible items in turn
for (int i = 0, visibleIndex = 0; i < Count; i++)
{
- ViewBase child = this[i];
+ ViewBase? child = this[i];
// We only position visible items
- if (child.Visible)
+ if (child!.Visible)
{
// Are we positioning a cluster?
if (child is ViewLayoutRibbonGroupCluster clusterChild1)
@@ -1088,9 +1096,9 @@ private void SmallLayout(ViewLayoutContext context)
}
// If not the first item on the line, then get the pixel gap between them
- if ((previousChild != null) && _viewToGap.ContainsKey(child))
+ if ((previousChild != null) && _viewToGap.TryGetValue(child, out var value))
{
- x += _viewToGap[child];
+ x += value;
}
// Get the size of the child item
@@ -1100,7 +1108,7 @@ private void SmallLayout(ViewLayoutContext context)
context.DisplayRectangle = new Rectangle(x, y, childSize.Width, childSize.Height);
// Position the element
- this[i].Layout(context);
+ this[i]?.Layout(context);
// Do we need to split after this item
if ((_split1Small == visibleIndex) || (_split2Small == visibleIndex))
@@ -1147,7 +1155,7 @@ private int GetItemSpacingGap(int start, int end)
return gapTotal;
}
- private void OnLinesPropertyChanged(object sender, PropertyChangedEventArgs e)
+ private void OnLinesPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
var updateLayout = false;
@@ -1177,7 +1185,7 @@ private void OnLinesPropertyChanged(object sender, PropertyChangedEventArgs e)
}
}
- private void OnContextClick(object sender, MouseEventArgs e)
+ private void OnContextClick(object? sender, MouseEventArgs e)
{
if (_ribbon.InDesignMode)
{
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGroupTriple.cs b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGroupTriple.cs
index 7954cff61..d374af58e 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGroupTriple.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGroupTriple.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -21,8 +21,8 @@ internal class ViewLayoutRibbonGroupTriple : ViewComposite,
IRibbonViewGroupContainerView
{
#region Type Definitions
- private class ItemToView : Dictionary { }
- private class ViewToSize : Dictionary { }
+ private class ItemToView : Dictionary;
+ private class ViewToSize : Dictionary;
#endregion
#region Instance Fields
@@ -46,18 +46,18 @@ private class ViewToSize : Dictionary { }
/// Owning ribbon control instance.
/// Reference to triple definition.
/// Delegate for notifying paint requests.
- public ViewLayoutRibbonGroupTriple([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonGroupTriple ribbonTriple,
- [DisallowNull] NeedPaintHandler needPaint)
+ public ViewLayoutRibbonGroupTriple([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonGroupTriple? ribbonTriple,
+ [DisallowNull] NeedPaintHandler? needPaint)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(ribbonTriple != null);
- Debug.Assert(needPaint != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(ribbonTriple is not null);
+ Debug.Assert(needPaint is not null);
// Cache references
- _ribbon = ribbon;
- _ribbonTriple = ribbonTriple;
- _needPaint = needPaint;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _ribbonTriple = ribbonTriple ?? throw new ArgumentNullException(nameof(ribbonTriple));
+ _needPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
// Associate the component with this view element for design time selection
Component = _ribbonTriple;
@@ -69,16 +69,16 @@ public ViewLayoutRibbonGroupTriple([DisallowNull] KryptonRibbon ribbon,
_largeCache = new ViewToSize();
// Get the initial size used for sizing and positioning
- SetCurrentSize(ribbonTriple.ItemSizeCurrent);
+ SetCurrentSize(ribbonTriple!.ItemSizeCurrent);
// Hook into changes in the ribbon triple definition
- _ribbonTriple.PropertyChanged += OnTriplePropertyChanged;
+ _ribbonTriple!.PropertyChanged += OnTriplePropertyChanged;
_ribbonTriple.TripleView = this;
// At design time we want to track the mouse and show feedback
- if (_ribbon.InDesignMode)
+ if (_ribbon!.InDesignMode)
{
- var controller = new ViewHightlightController(this, needPaint);
+ var controller = new ViewHightlightController(this, needPaint!);
controller.ContextClick += OnContextClick;
MouseController = controller;
}
@@ -113,7 +113,7 @@ protected override void Dispose(bool disposing)
/// Gets the first focus item from the container.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetFirstFocusItem()
+ public ViewBase GetFirstFocusItem()
{
ViewBase? view = null;
@@ -137,7 +137,7 @@ protected override void Dispose(bool disposing)
}
}
- return view;
+ return view!;
}
#endregion
@@ -146,7 +146,7 @@ protected override void Dispose(bool disposing)
/// Gets the last focus item from the container.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetLastFocusItem()
+ public ViewBase GetLastFocusItem()
{
ViewBase? view = null;
@@ -170,7 +170,7 @@ protected override void Dispose(bool disposing)
}
}
- return view;
+ return view!;
}
#endregion
@@ -181,7 +181,7 @@ protected override void Dispose(bool disposing)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetNextFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetNextFocusItem(ViewBase current, ref bool matched)
{
ViewBase? view = null;
@@ -206,7 +206,7 @@ protected override void Dispose(bool disposing)
}
}
- return view;
+ return view!;
}
#endregion
@@ -217,7 +217,7 @@ protected override void Dispose(bool disposing)
/// The view that is currently focused.
/// Has the current focus item been matched yet.
/// ViewBase of item; otherwise false.
- public ViewBase? GetPreviousFocusItem(ViewBase current, ref bool matched)
+ public ViewBase GetPreviousFocusItem(ViewBase current, ref bool matched)
{
ViewBase? view = null;
@@ -242,7 +242,7 @@ protected override void Dispose(bool disposing)
}
}
- return view;
+ return view!;
}
#endregion
@@ -400,10 +400,10 @@ public override Size GetPreferredSize(ViewLayoutContext context)
// Find total width and maximum height across all child elements
for (var i = 0; i < Count; i++)
{
- ViewBase child = this[i];
+ ViewBase? child = this[i];
// Only interested in visible items
- if (child.Visible)
+ if (child!.Visible)
{
// Cache preferred size of the child
Size childSize = child.GetPreferredSize(context);
@@ -468,7 +468,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
Debug.Assert(context != null);
// Store the provided client area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// Are we sizing horizontal or vertical?
var horizontal = _currentSize == GroupItemSize.Large;
@@ -489,10 +489,10 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
// Position each item from left/top to right/bottom
for (var i = 0; i < Count; i++)
{
- ViewBase child = this[i];
+ ViewBase? child = this[i];
// We only position visible items
- if (child.Visible)
+ if (child!.Visible)
{
// Get the cached size of this view
var childSize = Size.Empty;
@@ -515,7 +515,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
context.DisplayRectangle = new Rectangle(x, y, childSize.Width, ClientHeight);
// Position the element
- this[i].Layout(context);
+ this[i]?.Layout(context);
// Move across to next position (add 1 extra as the spacing gap)
x += childSize.Width + 1;
@@ -537,7 +537,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
}
// Position the element
- this[i].Layout(context);
+ this[i]?.Layout(context);
// Move down to next position
y += childSize.Height;
@@ -633,7 +633,7 @@ private void SyncChildrenToRibbonGroupItems()
var regenerate = new ItemToView();
// Add a view element for each group item
- foreach (IRibbonGroupItem item in _ribbonTriple.Items)
+ foreach (IRibbonGroupItem item in _ribbonTriple.Items!)
{
ViewBase itemView;
@@ -683,7 +683,7 @@ private void SyncChildrenToRibbonGroupItems()
_itemToView = regenerate;
}
- private void OnTriplePropertyChanged(object sender, PropertyChangedEventArgs e)
+ private void OnTriplePropertyChanged(object? sender, PropertyChangedEventArgs e)
{
var updateLayout = false;
@@ -714,7 +714,7 @@ private void OnTriplePropertyChanged(object sender, PropertyChangedEventArgs e)
}
}
- private void OnContextClick(object sender, MouseEventArgs e)
+ private void OnContextClick(object? sender, MouseEventArgs e)
{
if (_ribbon.InDesignMode)
{
@@ -723,4 +723,4 @@ private void OnContextClick(object sender, MouseEventArgs e)
}
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGroups.cs b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGroups.cs
index f1bf4aa57..a646df849 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGroups.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGroups.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -20,8 +20,8 @@ namespace Krypton.Ribbon
internal class ViewLayoutRibbonGroups : ViewComposite
{
#region Classes
- private class GroupToView : Dictionary { }
- private class ViewDrawRibbonGroupSepList : List { }
+ private class GroupToView : Dictionary;
+ private class ViewDrawRibbonGroupSepList : List;
#endregion
#region Statis Fields
@@ -48,24 +48,24 @@ private class ViewDrawRibbonGroupSepList : List { }
/// Owning ribbon control instance.
/// RibbonTab to organize groups.
/// Delegate for notifying paint requests.
- public ViewLayoutRibbonGroups([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] KryptonRibbonTab ribbonTab,
- [DisallowNull] NeedPaintHandler needPaint)
+ public ViewLayoutRibbonGroups([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] KryptonRibbonTab? ribbonTab,
+ [DisallowNull] NeedPaintHandler? needPaint)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(ribbonTab != null);
- Debug.Assert(needPaint != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(ribbonTab is not null);
+ Debug.Assert(needPaint is not null);
// Cache references
- _ribbon = ribbon;
- _ribbonTab = ribbonTab;
- _needPaint = needPaint;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _ribbonTab = ribbonTab ?? throw new ArgumentNullException(nameof(ribbonTab));
+ _needPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
// Create initial lookup table
_groupToView = new GroupToView();
// Create cache of group separator elements
- _groupSepCache = new ViewDrawRibbonGroupSepList();
+ _groupSepCache = [];
}
///
@@ -123,10 +123,10 @@ public NeedPaintHandler NeedPaintDelegate
public ViewDrawRibbonGroup? ViewGroupFromPoint(Point pt)
{
// Parent element should be a view layout
- var layoutControl = (ViewLayoutControl)Parent;
+ var layoutControl = Parent as ViewLayoutControl;
// Get the location of the child control it contains
- Point layoutLocation = layoutControl.ChildControl.Location;
+ Point layoutLocation = layoutControl!.ChildControl!.Location;
// Adjust the incoming point for the location of the child control
pt.X -= layoutLocation.X;
@@ -182,7 +182,7 @@ public KeyTipInfo[] GetGroupKeyTips()
/// Gets the first focus item from the groups.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetFirstFocusItem()
+ public ViewBase GetFirstFocusItem()
{
ViewBase? view = null;
@@ -196,7 +196,7 @@ public KeyTipInfo[] GetGroupKeyTips()
}
}
- return view;
+ return view!;
}
#endregion
@@ -205,7 +205,7 @@ public KeyTipInfo[] GetGroupKeyTips()
/// Gets the last focus item from the groups.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetLastFocusItem()
+ public ViewBase GetLastFocusItem()
{
ViewBase? view = null;
@@ -222,7 +222,7 @@ public KeyTipInfo[] GetGroupKeyTips()
}
}
- return view;
+ return view!;
}
#endregion
@@ -232,7 +232,7 @@ public KeyTipInfo[] GetGroupKeyTips()
///
/// The view that is currently focused.
/// ViewBase of item; otherwise false.
- public ViewBase? GetNextFocusItem(ViewBase current)
+ public ViewBase GetNextFocusItem(ViewBase current)
{
ViewBase? view = null;
var matched = false;
@@ -250,7 +250,7 @@ public KeyTipInfo[] GetGroupKeyTips()
}
}
- return view;
+ return view!;
}
#endregion
@@ -260,7 +260,7 @@ public KeyTipInfo[] GetGroupKeyTips()
///
/// The view that is currently focused.
/// ViewBase of item; otherwise false.
- public ViewBase? GetPreviousFocusItem(ViewBase current)
+ public ViewBase GetPreviousFocusItem(ViewBase current)
{
ViewBase? view = null;
var matched = false;
@@ -273,7 +273,9 @@ public KeyTipInfo[] GetGroupKeyTips()
{
// Already matched means we need the next item we come across,
// otherwise we continue with the attempt to find previous
- view = matched ? groups[i].GetLastFocusItem() : groups[i].GetPreviousFocusItem(current, ref matched);
+ view = matched
+ ? groups[i].GetLastFocusItem()
+ : groups[i].GetPreviousFocusItem(current, ref matched);
if (view != null)
{
@@ -281,7 +283,7 @@ public KeyTipInfo[] GetGroupKeyTips()
}
}
- return view;
+ return view!;
}
#endregion
@@ -296,7 +298,7 @@ public override Size GetPreferredSize(ViewLayoutContext context)
SyncChildrenToRibbonGroups();
// Find best size for groups to fill available space
- return new Size(AdjustGroupStateToMatchSpace(context), _ribbon.CalculatedValues.GroupHeight);
+ return new Size(AdjustGroupStateToMatchSpace(context), _ribbon!.CalculatedValues.GroupHeight);
}
///
@@ -308,7 +310,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
Debug.Assert(context != null);
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
var x = ClientLocation.X;
@@ -321,17 +323,17 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
// Position each item from left to right taking up entire height
for (int i = 0, j = 0; i < Count; i++)
{
- ViewBase child = this[i];
+ ViewBase? child = this[i];
// We only position visible items
- if (child.Visible)
+ if (child!.Visible)
{
// Cache preferred size of the child
// If a group then pull in the cached value
Size childSize = child is ViewDrawRibbonGroup
- ? new Size(_groupWidths[j++], _ribbon.CalculatedValues.GroupHeight)
- : this[i].GetPreferredSize(context);
+ ? new Size(_groupWidths[j++], _ribbon!.CalculatedValues.GroupHeight)
+ : this[i]!.GetPreferredSize(context);
// Only interested in items with some width
if (childSize.Width > 0)
@@ -340,7 +342,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
context.DisplayRectangle = new Rectangle(x, y, childSize.Width, height);
// Position the element
- this[i].Layout(context);
+ this[i]?.Layout(context);
// Move across to next position
x += childSize.Width;
@@ -391,13 +393,13 @@ private void SyncChildrenToRibbonGroups()
ViewDrawRibbonGroup? view = null;
// Get the currently cached view for the group
- if (_groupToView.ContainsKey(ribGroup))
+ if (_groupToView.TryGetValue(ribGroup, out ViewDrawRibbonGroup? value))
{
- view = _groupToView[ribGroup];
+ view = value;
}
// If a new group, create a view for it now
- view ??= new ViewDrawRibbonGroup(_ribbon, ribGroup, _needPaint);
+ view ??= new ViewDrawRibbonGroup(_ribbon!, ribGroup, _needPaint);
// Add to the lookup for future reference
regenerate.Add(ribGroup, view);
@@ -427,7 +429,7 @@ private void SyncChildrenToRibbonGroups()
KryptonRibbonGroup ribbonGroup = _ribbonTab.Groups[i];
// Only make the separator visible if the group is and not the first sep
- var groupVisible = _ribbon.InDesignHelperMode || ribbonGroup.Visible;
+ var groupVisible = _ribbon!.InDesignHelperMode || ribbonGroup.Visible;
_groupSepCache[i].Visible = groupVisible && !ignoreSep;
regenerate[ribbonGroup].Visible = groupVisible;
@@ -553,7 +555,7 @@ private int AdjustGroupStateToMatchSpace(ViewLayoutContext context)
_groupWidths = new int[listGroups.Count];
for (var i = 0; i < listGroups.Count; i++)
{
- _groupWidths[i] = listWidths[i][bestIndexes[i]].Width;
+ _groupWidths[i] = listWidths[i][bestIndexes![i]].Width;
listGroups[i].SetSolutionSize(listWidths[i][bestIndexes[i]].Sizing);
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGroupsArea.cs b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGroupsArea.cs
index 00ffe8ca5..c72c0555d 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGroupsArea.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonGroupsArea.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -38,16 +38,27 @@ internal class ViewLayoutRibbonGroupsArea : ViewDrawPanel
/// Reference to owning ribbon control.
/// Reference to redirector for palette settings.
/// Delegate for notifying paint/layout changes.
- public ViewLayoutRibbonGroupsArea([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] PaletteRedirect redirect,
- [DisallowNull] NeedPaintHandler needPaintDelegate)
+ public ViewLayoutRibbonGroupsArea([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] PaletteRedirect? redirect,
+ [DisallowNull] NeedPaintHandler? needPaintDelegate)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(redirect != null);
- Debug.Assert(needPaintDelegate != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(redirect is not null);
+ Debug.Assert(needPaintDelegate is not null);
// Remember the incoming reference
- _ribbon = ribbon;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+
+ if (redirect is null)
+ {
+ throw new ArgumentNullException(nameof(redirect));
+ }
+
+ if (needPaintDelegate is null)
+ {
+ throw new ArgumentNullException(nameof(needPaintDelegate));
+ }
+
// Create access to the redirector and use as our palette source
_backInherit = new PaletteBackInheritRedirect(redirect, PaletteBackStyle.PanelClient);
@@ -119,7 +130,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
Debug.Assert(context != null);
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// Find the correct padding to use
Padding padding = _ribbon.RealMinimizedMode ? _layoutMinimizedPadding : _layoutNormalPadding;
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonPadding.cs b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonPadding.cs
index d89fdb6ec..27be732c0 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonPadding.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonPadding.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonQATContents.cs b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonQATContents.cs
index b66bd82fd..e8e9e4db5 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonQATContents.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonQATContents.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -20,7 +20,7 @@ namespace Krypton.Ribbon
internal abstract class ViewLayoutRibbonQATContents : ViewComposite
{
#region Classes
- private class QATButtonToView : Dictionary { }
+ private class QATButtonToView : Dictionary;
#endregion
#region Instance Fields
@@ -38,19 +38,19 @@ private class QATButtonToView : DictionaryOwning ribbon control instance.
/// Delegate for notifying paint requests.
/// Should the extra button be shown.
- public ViewLayoutRibbonQATContents([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] NeedPaintHandler needPaint,
+ public ViewLayoutRibbonQATContents([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] NeedPaintHandler? needPaint,
bool showExtraButton)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(needPaint != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(needPaint is not null);
- Ribbon = ribbon;
- _needPaint = needPaint;
+ Ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _needPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
// Create initial lookup table
_qatButtonToView = new QATButtonToView();
-
+
// Create the extra button for customization/overflow
if (showExtraButton)
{
@@ -109,8 +109,14 @@ protected override void Dispose(bool disposing)
///
/// KryptonForm instance that owns this view.
/// Array of KeyTipInfo instances.
- public KeyTipInfo[] GetQATKeyTips(KryptonForm? ownerForm)
+ public KeyTipInfo[] GetQATKeyTips(KryptonForm ownerForm)
{
+ // ownerForm cannot be null
+ if (ownerForm is null)
+ {
+ throw new ArgumentNullException(nameof(ownerForm));
+ }
+
// Create all the list of all possible QAT key tip strings
var keyTipsPool = new Stack();
@@ -133,19 +139,15 @@ public KeyTipInfo[] GetQATKeyTips(KryptonForm? ownerForm)
}
// If integrated into the caption area then get the caption area height
- var borders = Padding.Empty;
- if (ownerForm is { ApplyComposition: false })
- {
- borders = ownerForm.RealWindowBorders;
- }
+ var borders = ownerForm.RealWindowBorders;
var keyTipList = new KeyTipInfoList();
foreach (ViewBase child in this)
{
// If visible and we have another key tip available on stack
- if (child.Visible
- && (keyTipsPool.Count > 0)
+ if (child.Visible
+ && (keyTipsPool.Count > 0)
&& (child is ViewDrawRibbonQATButton viewQAT)
)
{
@@ -157,7 +159,7 @@ public KeyTipInfo[] GetQATKeyTips(KryptonForm? ownerForm)
viewRect.Bottom - 2 - borders.Top);
// Create new key tip that invokes the qat controller
- keyTipList.Add(new KeyTipInfo(viewQAT.Enabled, keyTipsPool.Pop(), screenPt,
+ keyTipList.Add(new KeyTipInfo(viewQAT.Enabled, keyTipsPool.Pop(), screenPt,
viewQAT.ClientRectangle, viewQAT.KeyTipTarget));
}
}
@@ -203,19 +205,19 @@ public override Size GetPreferredSize(ViewLayoutContext context)
// Find total width and maximum height across all child elements
for (var i = 0; i < Count; i++)
{
- ViewBase child = this[i];
+ ViewBase? child = this[i];
// Only interested in visible items that are not the extra button
if (child != _extraButton)
{
// Cast child to correct type
- var view = (ViewDrawRibbonQATButton)child;
+ var view = child as ViewDrawRibbonQATButton;
// If the quick access toolbar button wants to be visible
- if (view.QATButton.GetVisible() || Ribbon.InDesignHelperMode)
+ if (view!.QATButton.GetVisible() || Ribbon.InDesignHelperMode)
{
// Cache preferred size of the child
- Size childSize = child.GetPreferredSize(context);
+ Size childSize = child!.GetPreferredSize(context);
// Only need extra processing for children that have some width
if (childSize.Width > 0)
@@ -261,7 +263,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
SyncChildren(true);
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
var x = ClientLocation.X;
var right = ClientRectangle.Right;
@@ -286,15 +288,15 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
// Position each item from left to right taking up entire height
for (var i = 0; i < Count; i++)
{
- ViewBase child = this[i];
+ ViewBase? child = this[i];
- // We only position visible items and we always ignore the extra button
+ // We only position visible items, and we always ignore the extra button
if (child != _extraButton)
{
- if (child.Visible)
+ if (child!.Visible)
{
// Cache preferred size of the child
- Size childSize = this[i].GetPreferredSize(context);
+ Size childSize = this[i]!.GetPreferredSize(context);
// Is there enough width for this item to be displayed
if ((childSize.Width + x) <= right)
@@ -303,7 +305,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
context.DisplayRectangle = new Rectangle(x, y, childSize.Width, height);
// Position the element
- this[i].Layout(context);
+ this[i]!.Layout(context);
// Move across to next position
x += childSize.Width;
@@ -386,7 +388,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
/// Gets the view element for the first visible and enabled quick access toolbar button.
///
/// ViewBase if found; otherwise false.
- public ViewBase? GetFirstQATView()
+ public ViewBase GetFirstQATView()
{
// Scan all the buttons looking for one that is enabled and visible
foreach (ViewBase qatView in _qatButtonToView.Values)
@@ -398,7 +400,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
}
// If showing the extra button, then use that
- return _extraButton;
+ return _extraButton!;
}
#endregion
@@ -407,7 +409,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
/// Gets the view element for the first visible and enabled quick access toolbar button.
///
///
- public ViewBase? GetLastQATView()
+ public ViewBase GetLastQATView()
{
// If showing the extra button, then use that
if (_extraButton != null)
@@ -432,7 +434,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
}
}
- return null;
+ return null!;
}
#endregion
@@ -442,7 +444,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
///
/// Search for entry after this view.
/// ViewBase if found; otherwise false.
- public ViewBase? GetNextQATView(ViewBase qatButton)
+ public ViewBase GetNextQATView(ViewBase qatButton)
{
var found = false;
@@ -465,7 +467,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
return _extraButton;
}
- return null;
+ return null!;
}
#endregion
@@ -475,7 +477,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
///
/// Search for entry after this view.
/// ViewBase if found; otherwise false.
- public ViewBase? GetPreviousQATView(ViewBase? qatButton)
+ public ViewBase GetPreviousQATView(ViewBase qatButton)
{
// If the provided view is the extra button, then implicitly already found previous entry
var found = (qatButton != null) && (qatButton == _extraButton);
@@ -483,13 +485,13 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
// Extract the set of views into an array
var qatViews = new ViewDrawRibbonQATButton[_qatButtonToView.Count];
_qatButtonToView.Values.CopyTo(qatViews, 0);
-
+
// Search the list in reverse order
for (var i = qatViews.Length - 1; i >= 0; i--)
{
// Extract the correct view to test
ViewDrawRibbonQATButton qatView = qatViews[i];
-
+
if (!found)
{
found = qatView == qatButton;
@@ -500,7 +502,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
}
}
- return null;
+ return null!;
}
#endregion
@@ -529,7 +531,7 @@ private void SyncChildren(bool layout)
foreach (IQuickAccessToolbarButton qatButton in qatButtons)
{
// Get the currently cached view for the button
- if (!_qatButtonToView.TryGetValue(qatButton, out ViewDrawRibbonQATButton view))
+ if (!_qatButtonToView.TryGetValue(qatButton, out var view))
{
// If a new button, create a view for it now
view = new ViewDrawRibbonQATButton(Ribbon, qatButton, _needPaint);
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonQATFromOverflow.cs b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonQATFromOverflow.cs
index 8cf1de472..87278663b 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonQATFromOverflow.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonQATFromOverflow.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -33,18 +33,18 @@ internal class ViewLayoutRibbonQATFromOverflow : ViewLayoutRibbonQATContents
/// Delegate for notifying paint requests.
/// Should the extra button be shown.
/// Source for finding buttons that are overflowing.
- public ViewLayoutRibbonQATFromOverflow([DisallowNull] Control parentControl,
- KryptonRibbon ribbon,
- NeedPaintHandler needPaint,
+ public ViewLayoutRibbonQATFromOverflow([DisallowNull] Control? parentControl,
+ [DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] NeedPaintHandler? needPaint,
bool showExtraButton,
- [DisallowNull] ViewLayoutRibbonQATContents contents)
+ [DisallowNull] ViewLayoutRibbonQATContents? contents)
: base(ribbon, needPaint, showExtraButton)
{
- Debug.Assert(parentControl != null);
- Debug.Assert(contents != null);
+ Debug.Assert(parentControl is not null);
+ Debug.Assert(contents is not null);
- _contents = contents;
- ParentControl = parentControl;
+ _contents = contents ?? throw new ArgumentNullException(nameof(contents));
+ ParentControl = parentControl ?? throw new ArgumentNullException(nameof(parentControl));
}
#endregion
@@ -64,7 +64,7 @@ public override IQuickAccessToolbarButton[] QATButtons
// If the button requests to be shown...
if (qatButton.GetVisible())
{
- ViewBase qatView = _contents.ViewForButton(qatButton);
+ ViewBase? qatView = _contents.ViewForButton(qatButton);
//...but the view is not displayed, then show on overflow
if (qatView is { Visible: false })
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonQATFromRibbon.cs b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonQATFromRibbon.cs
index 3211c5c9c..3991d5d27 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonQATFromRibbon.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonQATFromRibbon.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonQATMini.cs b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonQATMini.cs
index 62e725b6d..8230b4df2 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonQATMini.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonQATMini.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -26,7 +26,7 @@ internal class ViewLayoutRibbonQATMini : ViewLayoutDocker
private readonly KryptonRibbon _ribbon;
private readonly ViewDrawRibbonQATBorder _border;
private readonly ViewLayoutRibbonQATFromRibbon _borderContents;
- private readonly ViewDrawRibbonQATExtraButtonMini? _extraButton;
+ private readonly ViewDrawRibbonQATExtraButtonMini _extraButton;
private readonly ViewLayoutSeparator _extraSeparator;
#endregion
@@ -37,10 +37,17 @@ internal class ViewLayoutRibbonQATMini : ViewLayoutDocker
/// Owning control instance.
/// Delegate for notifying paint/layout changes.
public ViewLayoutRibbonQATMini([DisallowNull] KryptonRibbon ribbon,
- NeedPaintHandler needPaintDelegate)
+ [DisallowNull] NeedPaintHandler needPaintDelegate)
{
- Debug.Assert(ribbon != null);
- _ribbon = ribbon;
+ Debug.Assert(ribbon is not null);
+
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+
+ if (needPaintDelegate is null)
+ {
+ throw new ArgumentNullException(nameof(needPaintDelegate));
+ }
+
SEP_GAP = (int)(2 * FactorDpiX);
// Create the minibar border suitable for a caption area
_border = new ViewDrawRibbonQATBorder(_ribbon, needPaintDelegate, true);
@@ -60,6 +67,9 @@ public ViewLayoutRibbonQATMini([DisallowNull] KryptonRibbon ribbon,
Add(_border, ViewDockStyle.Fill);
Add(_extraSeparator, ViewDockStyle.Right);
Add(_extraButton, ViewDockStyle.Right);
+
+ // OwnerForm property can be intialized after _ribbon has been assigned.
+ OwnerForm ??= _ribbon.FindKryptonForm();
}
///
@@ -131,17 +141,13 @@ public KeyTipInfo[] GetQATKeyTips()
var keyTipList = new KeyTipInfoList();
// Add all the entries for the contents
- keyTipList.AddRange(_borderContents.GetQATKeyTips(OwnerForm));
+ keyTipList.AddRange(_borderContents.GetQATKeyTips(_ribbon.FindKryptonForm()!));
// If we have the extra button and it is in overflow appearance
if (_extraButton is {Overflow : true })
{
// If integrated into the caption area then get the caption area height
- var borders = Padding.Empty;
- if (OwnerForm is { ApplyComposition: false })
- {
- borders = OwnerForm.RealWindowBorders;
- }
+ var borders = OwnerForm!.RealWindowBorders;
// Get the screen location of the extra button
Rectangle viewRect = _borderContents.ParentControl.RectangleToScreen(_extraButton.ClientRectangle);
@@ -165,10 +171,10 @@ public KeyTipInfo[] GetQATKeyTips()
/// Gets the view element for the first visible and enabled quick access toolbar button.
///
///
- public ViewBase? GetFirstQATView()
+ public ViewBase GetFirstQATView()
{
// Find the first qat button
- ViewBase? view = _borderContents.GetFirstQATView() ?? _extraButton;
+ ViewBase view = _borderContents.GetFirstQATView() ?? _extraButton;
// If defined then use the extra button
@@ -181,7 +187,7 @@ public KeyTipInfo[] GetQATKeyTips()
/// Gets the view element for the first visible and enabled quick access toolbar button.
///
///
- public ViewBase? GetLastQATView() =>
+ public ViewBase GetLastQATView() =>
// Last view is the extra button if defined
_extraButton ?? _borderContents.GetLastQATView();
@@ -195,9 +201,9 @@ public KeyTipInfo[] GetQATKeyTips()
///
/// Search for entry after this view.
/// ViewBase if found; otherwise false.
- public ViewBase? GetNextQATView(ViewBase qatButton)
+ public ViewBase GetNextQATView(ViewBase qatButton)
{
- ViewBase? view = _borderContents.GetNextQATView(qatButton);
+ ViewBase view = _borderContents.GetNextQATView(qatButton);
// If no qat button is found and not already at the extra button
if ((view == null) && (_extraButton != qatButton))
@@ -205,7 +211,7 @@ public KeyTipInfo[] GetQATKeyTips()
view = _extraButton;
}
- return view;
+ return view!;
}
#endregion
@@ -215,7 +221,7 @@ public KeyTipInfo[] GetQATKeyTips()
///
/// Search for entry after this view.
/// ViewBase if found; otherwise false.
- public ViewBase? GetPreviousQATView(ViewBase qatButton) =>
+ public ViewBase GetPreviousQATView(ViewBase qatButton) =>
// If on the extra button then find the right most qat button instead
qatButton == _extraButton ? _borderContents.GetLastQATView() : _borderContents.GetPreviousQATView(qatButton);
@@ -245,7 +251,7 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
}
}
- return base.GetPreferredSize(context);
+ return base.GetPreferredSize(context!);
}
///
@@ -286,11 +292,12 @@ private void OnExtraButtonClick(object sender, EventHandler? finishDelegate)
// Convert the button rectangle to screen coordinates
Rectangle screenRect = _ribbon.RectangleToScreen(button.ClientRectangle);
- // If integrated into the caption area
- if (OwnerForm is { ApplyComposition: false })
+ // Only if the ribbon is on a KForm this adjustment is needed.
+ if (OwnerForm is not null)
{
+ // If integrated into the caption area
// Adjust for the height/width of borders
- Padding borders = OwnerForm.RealWindowBorders;
+ Padding borders = OwnerForm!.RealWindowBorders;
screenRect.X -= borders.Left;
screenRect.Y -= borders.Top;
}
@@ -303,6 +310,7 @@ private void OnExtraButtonClick(object sender, EventHandler? finishDelegate)
{
_ribbon.DisplayQATCustomizeMenu(screenRect, _borderContents, finishDelegate);
}
+
}
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonRadioButton.cs b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonRadioButton.cs
index 21550e0d6..43f93a5da 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonRadioButton.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonRadioButton.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -17,7 +17,5 @@ namespace Krypton.Ribbon
///
/// Position the contenst of the ribbon radio button.
///
- internal class ViewLayoutRibbonRadioButton : ViewLayoutDocker
- {
- }
+ internal class ViewLayoutRibbonRadioButton : ViewLayoutDocker;
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonRowCenter.cs b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonRowCenter.cs
index 3769f2cf3..85ec889a6 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonRowCenter.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonRowCenter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -20,8 +20,8 @@ namespace Krypton.Ribbon
internal class ViewLayoutRibbonRowCenter : ViewComposite
{
#region Type Definitions
- private class ItemToView : Dictionary { }
- private class ViewToSize : Dictionary { }
+ private class ItemToView : Dictionary;
+ private class ViewToSize : Dictionary;
#endregion
#region Instance Fields
@@ -78,15 +78,19 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
case GroupItemSize.Small:
_viewToSmall.Clear();
break;
+
case GroupItemSize.Medium:
_viewToMedium.Clear();
break;
+
case GroupItemSize.Large:
_viewToLarge.Clear();
break;
+
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(CurrentSize.ToString());
break;
}
@@ -98,7 +102,7 @@ public override Size GetPreferredSize([DisallowNull] ViewLayoutContext context)
if (child.Visible)
{
// Ask child for it's own preferred size
- Size childPreferred = child.GetPreferredSize(context);
+ Size childPreferred = child.GetPreferredSize(context!);
// Cache the child preferred size for use in layout
switch (CurrentSize)
@@ -187,18 +191,18 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
switch (CurrentSize)
{
case GroupItemSize.Small:
- childPreferred = _viewToSmall.ContainsKey(child)
- ? _viewToSmall[child]
+ childPreferred = _viewToSmall.TryGetValue(child, out Size value)
+ ? value
: child.GetPreferredSize(context);
break;
case GroupItemSize.Medium:
- childPreferred = _viewToMedium.ContainsKey(child)
- ? _viewToMedium[child]
+ childPreferred = _viewToMedium.TryGetValue(child, out Size value1)
+ ? value1
: child.GetPreferredSize(context);
break;
case GroupItemSize.Large:
- childPreferred = _viewToLarge.ContainsKey(child)
- ? _viewToLarge[child]
+ childPreferred = _viewToLarge.TryGetValue(child, out Size value2)
+ ? value2
: child.GetPreferredSize(context);
break;
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonScrollPort.cs b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonScrollPort.cs
index c81279275..6fb4f6971 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonScrollPort.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonScrollPort.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -24,7 +24,7 @@ public class RibbonViewControl : ViewControl
{
#region Instance Fields
private readonly KryptonRibbon _ribbon;
- private readonly Button _hiddenFocusTarget;
+ private readonly Button? _hiddenFocusTarget;
#endregion
#region Identity
@@ -32,11 +32,12 @@ public class RibbonViewControl : ViewControl
/// Initialize a new instance of the ViewControl class.
///
/// Top level ribbon control.
- public RibbonViewControl([DisallowNull] KryptonRibbon ribbon)
+ public RibbonViewControl([DisallowNull] KryptonRibbon? ribbon)
: base(ribbon)
{
- Debug.Assert(ribbon != null);
- _ribbon = ribbon;
+ Debug.Assert(ribbon is not null);
+
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
// Create and add a hidden button to act as the focus target
_hiddenFocusTarget = new Button
@@ -52,7 +53,7 @@ public RibbonViewControl([DisallowNull] KryptonRibbon ribbon)
///
/// Hide focus by giving it to the hidden control.
///
- public void HideFocus() => _hiddenFocusTarget.Focus();
+ public void HideFocus() => _hiddenFocusTarget!.Focus();
#endregion
#region Protected
@@ -65,7 +66,7 @@ public RibbonViewControl([DisallowNull] KryptonRibbon ribbon)
protected override bool ProcessDialogKey(Keys keyData)
{
// Grab the controlling control that is a parent
- Control c = _ribbon.GetControllerControl(this);
+ Control? c = _ribbon.GetControllerControl(this);
// Grab the view manager handling the focus view
ViewBase? focusView = null;
@@ -73,14 +74,14 @@ protected override bool ProcessDialogKey(Keys keyData)
{
case VisualPopupGroup popGroup:
{
- var manager = (ViewRibbonPopupGroupManager)popGroup.GetViewManager();
- focusView = manager.FocusView;
+ var manager = popGroup.GetViewManager() as ViewRibbonPopupGroupManager;
+ focusView = manager?.FocusView;
break;
}
case VisualPopupMinimized minimized:
{
- var manager = (ViewRibbonMinimizedManager)minimized.GetViewManager();
- focusView = manager.FocusView;
+ var manager = minimized.GetViewManager() as ViewRibbonMinimizedManager;
+ focusView = manager?.FocusView;
break;
}
}
@@ -124,7 +125,7 @@ protected override bool ProcessDialogKey(Keys keyData)
private readonly ViewBase _viewFiller;
private readonly ViewLayoutRibbonScroller _nearScroller;
private readonly ViewLayoutRibbonScroller _farScroller;
- private readonly ViewLayoutRibbonTabs _ribbonTabs;
+ private readonly ViewLayoutRibbonTabs? _ribbonTabs;
private readonly RibbonViewControl _viewControlContent;
private Rectangle _viewClipRect;
private int _scrollOffset;
@@ -148,35 +149,35 @@ protected override bool ProcessDialogKey(Keys keyData)
/// Should scoller be inset for use in tabs area.
/// Scrolling speed.
/// Delegate for notifying paint/layout requests.
- public ViewLayoutRibbonScrollPort([DisallowNull] KryptonRibbon ribbon,
+ public ViewLayoutRibbonScrollPort([DisallowNull] KryptonRibbon? ribbon,
Orientation orientation,
- [DisallowNull] ViewBase viewFiller,
+ [DisallowNull] ViewBase? viewFiller,
bool insetForTabs,
int scrollSpeed,
- [DisallowNull] NeedPaintHandler needPaintDelegate)
+ [DisallowNull] NeedPaintHandler? needPaintDelegate)
{
Debug.Assert(ribbon != null);
Debug.Assert(viewFiller != null);
Debug.Assert(needPaintDelegate != null);
// Remember initial settings
- _ribbon = ribbon;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
_orientation = orientation;
- _viewFiller = viewFiller;
- _needPaintDelegate = needPaintDelegate;
+ _viewFiller = viewFiller ?? throw new ArgumentNullException(nameof(viewFiller));
+ _needPaintDelegate = needPaintDelegate ?? throw new ArgumentNullException(nameof(needPaintDelegate));
_scrollSpeed = scrollSpeed;
_ribbonTabs = viewFiller as ViewLayoutRibbonTabs;
// Default to left hand scroll position
_scrollOffset = 0;
- // Place the child view inside a actual control, so that the contents of the
+ // Place the child view inside an actual control, so that the contents of the
// filler are clipped to the control size. This is needed if the child view
// contains controls and need clipping inside this area and so prevent them
// from drawing over the end scrollers.
- _viewControlContent = new RibbonViewControl(ribbon);
+ _viewControlContent = new RibbonViewControl(ribbon!);
_viewControlContent.PaintBackground += OnViewControlPaintBackground;
- ViewLayoutControl = new ViewLayoutControl(_viewControlContent, ribbon, _viewFiller);
+ ViewLayoutControl = new ViewLayoutControl(_viewControlContent, ribbon!, _viewFiller!);
// Removed because of this
// https://github.com/Krypton-Suite/Standard-Toolkit/issues/372
@@ -189,8 +190,8 @@ public ViewLayoutRibbonScrollPort([DisallowNull] KryptonRibbon ribbon,
//}
// Create the two scrollers used when not enough space for filler
- _nearScroller = new ViewLayoutRibbonScroller(ribbon, NearOrientation, insetForTabs, needPaintDelegate);
- _farScroller = new ViewLayoutRibbonScroller(ribbon, FarOrientation, insetForTabs, needPaintDelegate);
+ _nearScroller = new ViewLayoutRibbonScroller(ribbon!, NearOrientation, insetForTabs, needPaintDelegate!);
+ _farScroller = new ViewLayoutRibbonScroller(ribbon!, FarOrientation, insetForTabs, needPaintDelegate!);
// Hook into scroller events
_nearScroller.Click += OnNearClick;
@@ -216,7 +217,7 @@ public override string ToString() =>
///
/// Gets access to the paint delegate to redraw the owning control.
///
- public NeedPaintHandler ViewControlPaintDelegate => ViewLayoutControl.ChildPaintDelegate;
+ public NeedPaintHandler ViewControlPaintDelegate => ViewLayoutControl.ChildPaintDelegate!;
#endregion
@@ -337,7 +338,7 @@ public KeyTipInfo[] GetGroupKeyTips()
/// Gets the first focus item within the scroll port.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetFirstFocusItem()
+ public ViewBase GetFirstFocusItem()
{
ViewBase? view = null;
@@ -354,7 +355,7 @@ public KeyTipInfo[] GetGroupKeyTips()
}
}
- return view;
+ return view!;
}
#endregion
@@ -363,7 +364,7 @@ public KeyTipInfo[] GetGroupKeyTips()
/// Gets the last focus item within the scroll port.
///
/// ViewBase of item; otherwise false.
- public ViewBase? GetLastFocusItem()
+ public ViewBase GetLastFocusItem()
{
ViewBase? view = null;
@@ -380,7 +381,7 @@ public KeyTipInfo[] GetGroupKeyTips()
}
}
- return view;
+ return view!;
}
#endregion
@@ -390,7 +391,7 @@ public KeyTipInfo[] GetGroupKeyTips()
///
/// The view that is currently focused.
/// ViewBase of item; otherwise false.
- public ViewBase? GetNextFocusItem(ViewBase current)
+ public ViewBase GetNextFocusItem(ViewBase current)
{
ViewBase? view = null;
@@ -407,7 +408,7 @@ public KeyTipInfo[] GetGroupKeyTips()
}
}
- return view;
+ return view!;
}
#endregion
@@ -417,7 +418,7 @@ public KeyTipInfo[] GetGroupKeyTips()
///
/// The view that is currently focused.
/// ViewBase of item; otherwise false.
- public ViewBase? GetPreviousFocusItem(ViewBase current)
+ public ViewBase GetPreviousFocusItem(ViewBase current)
{
ViewBase? view = null;
@@ -434,7 +435,7 @@ public KeyTipInfo[] GetGroupKeyTips()
}
}
- return view;
+ return view!;
}
#endregion
@@ -459,18 +460,18 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
Enabled = _ribbon.Enabled;
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
Rectangle layoutRect = ClientRectangle;
var controlRect = new Rectangle(Point.Empty, ClientSize);
- // Reset the the view control layout offset to be zero again
+ // Reset the view control layout offset to be zero again
ViewLayoutControl.LayoutOffset = Point.Empty;
// Ask the view control the size it would like to be, this is the requested filler
// size of the control. If it wants more than we can give then scroll buttons are
// needed, otherwise we can give it the requested size and any extra available.
- _ribbon.GetViewManager().DoNotLayoutControls = true;
+ _ribbon.GetViewManager()!.DoNotLayoutControls = true;
ViewLayoutControl.GetPreferredSize(context);
// Ensure context has the correct control
@@ -480,7 +481,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
_viewFiller.Layout(context);
}
- _ribbon.GetViewManager().DoNotLayoutControls = false;
+ _ribbon.GetViewManager()!.DoNotLayoutControls = false;
Size fillerSize = _viewFiller.ClientSize;
// Limit check the scroll offset
@@ -611,7 +612,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
if (_ribbon.SelectedTab != null)
{
// Cast to correct type
- ViewBase viewTab = layoutTabs.GetViewForRibbonTab(_ribbon.SelectedTab);
+ ViewBase viewTab = layoutTabs.GetViewForRibbonTab(_ribbon.SelectedTab)!;
// If a scroll change is required to bring it into view
if (ScrollIntoView(viewTab.ClientRectangle, false))
@@ -645,13 +646,13 @@ public override void Render([DisallowNull] RenderContext context)
// New clipping region is at most our own client size
using var combineRegion = new Region(_viewClipRect);
// Remember the current clipping region
- Region clipRegion = context.Graphics.Clip.Clone();
+ Region clipRegion = context?.Graphics.Clip.Clone()!;
// Reduce clipping region down by the existing clipping region
combineRegion.Intersect(clipRegion);
// Use new region that restricts drawing to our client size only
- context.Graphics.Clip = combineRegion;
+ context!.Graphics.Clip = combineRegion;
child.Render(context);
@@ -660,7 +661,7 @@ public override void Render([DisallowNull] RenderContext context)
}
else
{
- child.Render(context);
+ child.Render(context!);
}
}
}
@@ -721,11 +722,14 @@ private VisualOrientation NearOrientation
{
case Orientation.Horizontal:
return VisualOrientation.Left;
+
case Orientation.Vertical:
return VisualOrientation.Top;
+
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(Orientation.ToString());
return VisualOrientation.Left;
}
}
@@ -739,17 +743,20 @@ private VisualOrientation FarOrientation
{
case Orientation.Horizontal:
return VisualOrientation.Right;
+
case Orientation.Vertical:
return VisualOrientation.Bottom;
+
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(Orientation.ToString());
return VisualOrientation.Right;
}
}
}
- private void OnNearClick(object sender, EventArgs e)
+ private void OnNearClick(object? sender, EventArgs e)
{
// Scroll left/up
_scrollOffset -= _scrollSpeed;
@@ -758,7 +765,7 @@ private void OnNearClick(object sender, EventArgs e)
_needPaintDelegate(this, new NeedLayoutEventArgs(true));
}
- private void OnFarClick(object sender, EventArgs e)
+ private void OnFarClick(object? sender, EventArgs e)
{
// Scroll down/right
_scrollOffset += _scrollSpeed;
@@ -767,7 +774,7 @@ private void OnFarClick(object sender, EventArgs e)
_needPaintDelegate(this, new NeedLayoutEventArgs(true));
}
- private void OnViewControlPaintBackground(object sender, PaintEventArgs e) => PaintBackground?.Invoke(sender, e);
+ private void OnViewControlPaintBackground(object? sender, PaintEventArgs e) => PaintBackground?.Invoke(sender, e);
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonScroller.cs b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonScroller.cs
index 37792602f..9d8a38734 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonScroller.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonScroller.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -115,7 +115,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
Debug.Assert(context != null);
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
// Layout depends on orientation
switch (Orientation)
@@ -169,7 +169,7 @@ private Rectangle AdjustRectForTabs(Rectangle rect)
return rect;
}
- private void OnButtonClick(object sender, MouseEventArgs e) => Click?.Invoke(this, EventArgs.Empty);
+ private void OnButtonClick(object? sender, MouseEventArgs e) => Click?.Invoke(this, EventArgs.Empty);
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonSeparator.cs b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonSeparator.cs
index 986cd782c..4cd7c00f7 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonSeparator.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonSeparator.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -98,7 +98,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
Debug.Assert(context != null);
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
}
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonTabs.cs b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonTabs.cs
index 17ea64e6c..da5168fcd 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonTabs.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonTabs.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
@@ -20,9 +20,9 @@ namespace Krypton.Ribbon
internal class ViewLayoutRibbonTabs : ViewComposite
{
#region Type Definitions
- private class ViewDrawRibbonTabList : List { }
- private class ViewDrawRibbonTabSepList : List { }
- private class ContextNameList : List { }
+ private class ViewDrawRibbonTabList : List;
+ private class ViewDrawRibbonTabSepList : List;
+ private class ContextNameList : List;
#endregion
#region Static Fields
@@ -36,7 +36,7 @@ private class ContextNameList : List { }
private readonly KryptonRibbon _ribbon;
private readonly ViewDrawRibbonTabList _tabCache;
private readonly ViewDrawRibbonTabSepList _tabSepCache;
- private ViewDrawRibbonDesignTab? _viewAddTab;
+ private ViewDrawRibbonDesignTab _viewAddTab;
private NeedPaintHandler _needPaint;
private ContextNameList _cachedSelectedContext;
private Size[] _cachedSizes;
@@ -48,26 +48,26 @@ private class ContextNameList : List { }
#endregion
#region Identity
- static ViewLayoutRibbonTabs() => ContextTabSets = new ContextTabSetCollection();
+ static ViewLayoutRibbonTabs() => ContextTabSets = [];
///
/// Initialize a new instance of the ViewLayoutRibbonTabs class.
///
/// Owning ribbon control instance.
/// Delegate for notifying paint requests.
- public ViewLayoutRibbonTabs([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] NeedPaintHandler needPaint)
+ public ViewLayoutRibbonTabs([DisallowNull] KryptonRibbon? ribbon,
+ [DisallowNull] NeedPaintHandler? needPaint)
{
- Debug.Assert(ribbon != null);
- Debug.Assert(needPaint != null);
+ Debug.Assert(ribbon is not null);
+ Debug.Assert(needPaint is not null);
// Cache references
- _ribbon = ribbon;
- _needPaint = needPaint;
+ _ribbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon));
+ _needPaint = needPaint ?? throw new ArgumentNullException(nameof(needPaint));
// Create cache of draw elements
- _tabCache = new ViewDrawRibbonTabList();
- _tabSepCache = new ViewDrawRibbonTabSepList();
+ _tabCache = [];
+ _tabSepCache = [];
}
///
@@ -120,7 +120,7 @@ public NeedPaintHandler NeedPaintDelegate
///
/// Gets and sets the parent control.
///
- public Control ParentControl { get; set; }
+ public Control? ParentControl { get; set; }
#endregion
@@ -128,7 +128,7 @@ public NeedPaintHandler NeedPaintDelegate
///
/// Gets access to the tabs spare area.
///
- public ViewLayoutRibbonTabsSpare? GetViewForSpare { get; private set; }
+ public ViewLayoutRibbonTabsSpare GetViewForSpare { get; private set; }
#endregion
@@ -138,7 +138,7 @@ public NeedPaintHandler NeedPaintDelegate
///
/// Tab for which view element is needed.
/// View element for tab; otherwise null.
- public ViewDrawRibbonTab? GetViewForRibbonTab(KryptonRibbonTab? ribbonTab) => ribbonTab == null
+ public ViewDrawRibbonTab? GetViewForRibbonTab(KryptonRibbonTab? ribbonTab) => ribbonTab is null
? null
: _tabCache.FirstOrDefault(viewTab => viewTab.RibbonTab == ribbonTab);
@@ -146,7 +146,7 @@ public NeedPaintHandler NeedPaintDelegate
/// Gets the view element for drawing the first visible ribbon tab.
///
/// View element for a tab; otherwise null.
- public ViewDrawRibbonTab? GetViewForFirstRibbonTab()
+ public ViewDrawRibbonTab GetViewForFirstRibbonTab()
{
foreach (ViewBase child in this)
{
@@ -156,7 +156,7 @@ public NeedPaintHandler NeedPaintDelegate
}
}
- return null;
+ return null!;
}
///
@@ -164,7 +164,7 @@ public NeedPaintHandler NeedPaintDelegate
///
/// Current ribbon tab to use when searching.
/// View element for a tab; otherwise null.
- public ViewDrawRibbonTab? GetViewForNextRibbonTab(KryptonRibbonTab ribbonTab)
+ public ViewDrawRibbonTab GetViewForNextRibbonTab(KryptonRibbonTab ribbonTab)
{
var found = false;
foreach (ViewBase child in this)
@@ -186,7 +186,7 @@ public NeedPaintHandler NeedPaintDelegate
}
}
- return null;
+ return null!;
}
///
@@ -194,7 +194,7 @@ public NeedPaintHandler NeedPaintDelegate
///
/// Current ribbon tab to use when searching.
/// View element for a tab; otherwise null.
- public ViewDrawRibbonTab? GetViewForPreviousRibbonTab(KryptonRibbonTab ribbonTab)
+ public ViewDrawRibbonTab GetViewForPreviousRibbonTab(KryptonRibbonTab ribbonTab)
{
var found = false;
foreach (ViewBase child in Reverse())
@@ -216,14 +216,14 @@ public NeedPaintHandler NeedPaintDelegate
}
}
- return null;
+ return null!;
}
///
/// Gets the view element for drawing the last visible ribbon tab.
///
/// View element for a tab; otherwise null.
- public ViewDrawRibbonTab? GetViewForLastRibbonTab()
+ public ViewDrawRibbonTab GetViewForLastRibbonTab()
{
foreach (ViewBase child in Reverse())
{
@@ -233,7 +233,7 @@ public NeedPaintHandler NeedPaintDelegate
}
}
- return null;
+ return null!;
}
#endregion
@@ -254,13 +254,13 @@ public KeyTipInfo[] GetTabKeyTips()
{
// Get the screen location of the view tab
- Rectangle tabRect = viewTab.OwningControl.RectangleToScreen(viewTab.ClientRectangle);
+ Rectangle tabRect = viewTab.OwningControl!.RectangleToScreen(viewTab.ClientRectangle);
// The keytip should be centered on the bottom center of the view
var screenPt = new Point(tabRect.Left + (tabRect.Width / 2), tabRect.Bottom + 2);
// Create new key tip that invokes the tab controller when selected
- keyTipList.Add(new KeyTipInfo(true, viewTab.RibbonTab.KeyTip,
+ keyTipList.Add(new KeyTipInfo(true, viewTab.RibbonTab!.KeyTip,
screenPt, viewTab.ClientRectangle,
viewTab.KeyTipTarget));
}
@@ -357,10 +357,10 @@ public override Size GetPreferredSize(ViewLayoutContext context)
// Find total width and maximum height across all child elements
for (var i = 0; i < Count; i++)
{
- ViewBase child = this[i];
+ ViewBase? child = this[i];
// Only interested in visible items
- if (child.Visible)
+ if (child!.Visible)
{
// Cache preferred size of the child
_cachedSizes[i] = child.GetPreferredSize(context);
@@ -443,7 +443,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
SyncChildrenToRibbonTabs();
// We take on all the available display area
- ClientRectangle = context.DisplayRectangle;
+ ClientRectangle = context!.DisplayRectangle;
var x = ClientLocation.X;
@@ -484,7 +484,7 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
}
// Position the element
- this[i].Layout(context);
+ this[i]?.Layout(context);
// Move across to next position
x += layoutSizes[i].Width;
@@ -511,12 +511,12 @@ public override void Layout([DisallowNull] ViewLayoutContext context)
}
// We have an owning form we need to update the custom area it treats as a caption
- if (_ribbon.CaptionArea.KryptonForm != null)
+ if (_ribbon.CaptionArea?.KryptonForm != null)
{
if (!customCaptionRect.IsEmpty)
{
// Convert the rectangle to the owning form coordinates
- customCaptionRect = ParentControl.RectangleToScreen(customCaptionRect);
+ customCaptionRect = ParentControl!.RectangleToScreen(customCaptionRect);
customCaptionRect = _ribbon.CaptionArea.KryptonForm.RectangleToClient(customCaptionRect);
}
@@ -627,7 +627,7 @@ private void AddTabsWithContextName(string contextName)
// Create tab set when first needed, otherwise this tab must be the last one
if (cts == null)
{
- cts = new ContextTabSet(drawTab, _ribbon.RibbonContexts[ribbonTab.ContextName]);
+ cts = new ContextTabSet(drawTab, _ribbon.RibbonContexts[ribbonTab.ContextName]!);
}
else
{
@@ -774,7 +774,7 @@ private void UpdateContextNameCache()
// Create list first time around, otherwise clear it down
if (_cachedSelectedContext == null)
{
- _cachedSelectedContext = new ContextNameList();
+ _cachedSelectedContext = [];
}
else
{
@@ -784,7 +784,7 @@ private void UpdateContextNameCache()
// In design mode
if (_ribbon.InDesignHelperMode)
{
- // All all the defined ribbon contexts
+ // All the defined ribbon contexts
foreach (KryptonRibbonContext context in _ribbon.RibbonContexts)
{
_cachedSelectedContext.Add(context.ContextName);
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonTabsArea.cs b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonTabsArea.cs
index 963dffebb..528753031 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonTabsArea.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonTabsArea.cs
@@ -1,14 +1,10 @@
#region BSD License
/*
- *
* Original BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE)
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
- *
- * Modified: Monday 12th April, 2021 @ 18:00 GMT
- *
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*/
#endregion
@@ -94,7 +90,7 @@ public RibbonButtonSpecFixedCollection(KryptonRibbon owner)
/// Reference to layout of the context area.
/// Delegate for notifying paint/layout changes.
public ViewLayoutRibbonTabsArea([DisallowNull] KryptonRibbon ribbon,
- [DisallowNull] PaletteRedirect? redirect,
+ [DisallowNull] PaletteRedirect redirect,
[DisallowNull] ViewDrawRibbonCaptionArea captionArea,
[DisallowNull] ViewLayoutRibbonContextTitles layoutContexts,
[DisallowNull] NeedPaintHandler needPaintDelegate)
@@ -119,7 +115,7 @@ public ViewLayoutRibbonTabsArea([DisallowNull] KryptonRibbon ribbon,
CreateController();
CreateButtonSpecs();
- CreateViewElements(redirect);
+ CreateViewElements(redirect!);
SetupParentMonitoring();
}
@@ -181,8 +177,8 @@ public override string ToString() =>
///
public void HookToolTipHandling()
{
- LayoutAppButton.MouseController = new ToolTipController(_ribbon.TabsArea.ButtonSpecManager.ToolTipManager, LayoutAppButton, _appButtonController);
- LayoutAppTab.MouseController = new ToolTipController(_ribbon.TabsArea.ButtonSpecManager.ToolTipManager, LayoutAppTab, _appTabController);
+ LayoutAppButton.MouseController = new ToolTipController(_ribbon.TabsArea!.ButtonSpecManager?.ToolTipManager!, LayoutAppButton, _appButtonController);
+ LayoutAppTab.MouseController = new ToolTipController(_ribbon.TabsArea?.ButtonSpecManager!.ToolTipManager!, LayoutAppTab, _appTabController);
}
#endregion
@@ -216,9 +212,6 @@ public void CheckRibbonSize()
{
_ribbon.MainPanel.Visible = show;
_captionArea.PreventIntegration = !show;
-
- // Need to recalcualte the composition and so the client area that is turned into glass
- _captionArea.KryptonForm?.RecalculateComposition();
}
}
else
@@ -232,7 +225,7 @@ public void CheckRibbonSize()
// If using custom chrome
if (_captionArea.UsingCustomChrome)
{
- _paintCount = _captionArea.KryptonForm.PaintCount;
+ _paintCount = _captionArea.KryptonForm!.PaintCount;
_invalidateTimer.Start();
}
}
@@ -250,12 +243,21 @@ public void CheckRibbonSize()
public void AppButtonVisibleChanged()
{
// Update visible state of the app button/tab to reflect current state
- LayoutAppButton.Visible = _ribbon.RibbonAppButton.AppButtonVisible && (_ribbon.RibbonShape == PaletteRibbonShape.Office2007);
- LayoutAppTab.Visible = _ribbon.RibbonAppButton.AppButtonVisible && (_ribbon.RibbonShape != PaletteRibbonShape.Office2007);
+ LayoutAppButton.Visible = _ribbon.RibbonFileAppButton.AppButtonVisible && (_ribbon.RibbonShape == PaletteRibbonShape.Office2007);
+ LayoutAppTab.Visible = _ribbon.RibbonFileAppButton.AppButtonVisible && (_ribbon.RibbonShape != PaletteRibbonShape.Office2007);
_leftSeparator.SeparatorSize = (_ribbon.RibbonShape == PaletteRibbonShape.Office2007) ? new Size(BUTTON_TAB_GAP_2007, BUTTON_TAB_GAP_2007) : new Size(BUTTON_TAB_GAP_2010, BUTTON_TAB_GAP_2010);
// If no app button then need separator to stop first tab being to close to the left edge
_layoutAppButtonSep.Visible = !LayoutAppButton.Visible;
+ ViewDrawRibbonCaptionArea? viewDrawRibbonCaptionArea = _ribbon.CaptionArea;
+ if (viewDrawRibbonCaptionArea?.KryptonForm != null)
+ {
+ if (viewDrawRibbonCaptionArea.KryptonForm.CloseBox != _ribbon.RibbonFileAppButton.FormCloseBoxVisible)
+ {
+ viewDrawRibbonCaptionArea.KryptonForm.CloseBox = _ribbon.RibbonFileAppButton.FormCloseBoxVisible;
+ viewDrawRibbonCaptionArea.PerformFormChromeCheck();
+ }
+ }
}
#endregion
@@ -305,7 +307,7 @@ public KeyTipInfo GetAppButtonKeyTip()
var screenPt = new Point(buttonRect.Left + (buttonRect.Width / 2), buttonRect.Top);
// Return key tip details
- return new KeyTipInfo(true, _ribbon.RibbonStrings.AppButtonKeyTip, screenPt,
+ return new KeyTipInfo(true, KryptonManager.Strings.RibbonStrings.AppButtonKeyTip, screenPt,
LayoutAppButton.ClientRectangle, _appButtonController);
}
@@ -321,7 +323,7 @@ public KeyTipInfo GetAppTabKeyTip()
var screenPt = new Point(buttonRect.Left + (buttonRect.Width / 2), buttonRect.Bottom + 2);
// Return key tip details
- return new KeyTipInfo(true, _ribbon.RibbonStrings.AppButtonKeyTip, screenPt,
+ return new KeyTipInfo(true, KryptonManager.Strings.RibbonStrings.AppButtonKeyTip, screenPt,
LayoutAppTab.ClientRectangle, _appTabController);
}
@@ -367,10 +369,10 @@ public override void Layout(ViewLayoutContext context)
_layoutContexts.Layout(context);
context.DisplayRectangle = temp;
- // If using custom chrome but not using the composition (which does not need an extra draw)
- if (_captionArea is { UsingCustomChrome: true, KryptonForm.ApplyComposition: false })
+ // If using custom chrome
+ if (_captionArea is { UsingCustomChrome: true })
{
- _paintCount = _captionArea.KryptonForm.PaintCount;
+ _paintCount = _captionArea.KryptonForm!.PaintCount;
_invalidateTimer.Start();
}
}
@@ -460,7 +462,7 @@ private void CreateButtonSpecs()
_buttonSpecsFixed.AddRange(new ButtonSpec[] { _buttonSpecMinimize, _buttonSpecExpand, _buttonSpecMin, _buttonSpecRestore, _buttonSpecClose });
}
- private void CreateViewElements(PaletteRedirect? redirect)
+ private void CreateViewElements(PaletteRedirect redirect)
{
// Layout for individual tabs inside the header
LayoutTabs = new ViewLayoutRibbonTabs(_ribbon, NeedPaintDelegate);
@@ -529,12 +531,12 @@ private void CreateViewElements(PaletteRedirect? redirect)
// Create button specification collection manager
PaletteRedirect aeroOverrideText = new PaletteRedirectRibbonAeroOverride(_ribbon, redirect);
ButtonSpecManager = new ButtonSpecManagerLayoutRibbon(_ribbon, aeroOverrideText, _ribbon.ButtonSpecs, _buttonSpecsFixed,
- new[] { tabsDocker },
- new IPaletteMetric[] { _ribbon.StateCommon },
- new[] { PaletteMetricInt.HeaderButtonEdgeInsetPrimary },
- new[] { PaletteMetricPadding.RibbonButtonPadding },
- _ribbon.CreateToolStripRenderer,
- NeedPaintDelegate);
+ [tabsDocker],
+ [_ribbon.StateCommon],
+ [PaletteMetricInt.HeaderButtonEdgeInsetPrimary],
+ [PaletteMetricPadding.RibbonButtonPadding],
+ _ribbon.CreateToolStripRenderer,
+ NeedPaintDelegate);
// Create the manager for handling tooltips
ToolTipManager = new ToolTipManager(new ToolTipValues(null)); // use default, as each button "could" have different values ??!!??
@@ -545,7 +547,7 @@ private void CreateViewElements(PaletteRedirect? redirect)
private void SetupParentMonitoring()
{
- // We have to know when the parent of the ribbon changes so we can then hook
+ // We have to know when the parent of the ribbon changes, so we can then hook
// into monitoring the mdi active child status of the top level form, this is
// required to get the pendant buttons to operate as needed.
_ribbon.ParentChanged += OnRibbonParentChanged;
@@ -557,7 +559,7 @@ private void SetupParentMonitoring()
_invalidateTimer.Tick += OnRedrawTick;
}
- private void OnRibbonParentChanged(object sender, EventArgs e)
+ private void OnRibbonParentChanged(object? sender, EventArgs e)
{
// Unhook from watching any top level window
if (_formContainer != null)
@@ -568,7 +570,7 @@ private void OnRibbonParentChanged(object sender, EventArgs e)
_formContainer.MdiChildActivate -= OnRibbonMdiChildActivate;
}
- // Find the new top level form (which might be an mdi container)
+ // Find the new top level form (which might be a mdi container)
_formContainer = _ribbon.FindForm();
// Monitor changes in active mdi child
@@ -582,21 +584,21 @@ private void OnRibbonParentChanged(object sender, EventArgs e)
}
}
- private void OnRibbonFormActivated(object sender, EventArgs e)
+ private void OnRibbonFormActivated(object? sender, EventArgs e)
{
- _ribbon.ViewRibbonManager.Active();
+ _ribbon.ViewRibbonManager?.Active();
_ribbon.UpdateBackStyle();
}
- private void OnRibbonFormDeactivate(object sender, EventArgs e)
+ private void OnRibbonFormDeactivate(object? sender, EventArgs e)
{
- _ribbon.ViewRibbonManager.Inactive();
+ _ribbon.ViewRibbonManager?.Inactive();
_ribbon.UpdateBackStyle();
}
- private void OnRibbonFormSizeChanged(object sender, EventArgs e) => CheckRibbonSize();
+ private void OnRibbonFormSizeChanged(object? sender, EventArgs e) => CheckRibbonSize();
- private void OnRibbonMdiChildActivate(object sender, EventArgs e)
+ private void OnRibbonMdiChildActivate(object? sender, EventArgs e)
{
// Cast to correct type
var topForm = sender as Form;
@@ -624,7 +626,7 @@ private void OnRibbonMdiChildActivate(object sender, EventArgs e)
// We never want the mdi child window to have a system menu, we provide the
// pendant buttons as part of the ribbon and so replace the need for it.
- PI.SetMenu(new HandleRef(_ribbon, topForm.Handle), NullHandleRef);
+ PI.SetMenu(new HandleRef(_ribbon, topForm!.Handle), NullHandleRef);
if (_activeMdiChild != null)
{
@@ -634,14 +636,14 @@ private void OnRibbonMdiChildActivate(object sender, EventArgs e)
}
}
- private void OnRibbonMdiChildSizeChanged(object sender, EventArgs e)
+ private void OnRibbonMdiChildSizeChanged(object? sender, EventArgs e)
{
// Update pendant buttons to reflect new child state
ButtonSpecManager?.RecreateButtons();
PerformNeedPaint(true);
}
- private void OnRedrawTick(object sender, EventArgs e)
+ private void OnRedrawTick(object? sender, EventArgs e)
{
_invalidateTimer.Stop();
@@ -654,7 +656,7 @@ private void OnRedrawTick(object sender, EventArgs e)
}
}
- private void OnAppButtonReleased(object sender, EventArgs e)
+ private void OnAppButtonReleased(object? sender, EventArgs e)
{
// We do not operate the application button at design time
if (!_ribbon.InDesignMode)
@@ -663,7 +665,7 @@ private void OnAppButtonReleased(object sender, EventArgs e)
}
}
- private void OnAppButtonClicked(object sender, EventArgs e)
+ private void OnAppButtonClicked(object? sender, EventArgs e)
{
// We do not operate the application button at design time
if (_ribbon.InDesignMode)
@@ -716,16 +718,16 @@ private void OnAppButtonClicked(object sender, EventArgs e)
}
// Create the actual control used to show the context menu
- _appMenu = new VisualPopupAppMenu(_ribbon, _ribbon.RibbonAppButton,
- _ribbon.Palette, _ribbon.PaletteMode,
+ _appMenu = new VisualPopupAppMenu(_ribbon,
+ _ribbon.LocalCustomPalette, _ribbon.PaletteMode,
_ribbon.GetRedirector(),
appRectTop, appRectBottom,
- _appButtonController.Keyboard);
+ _appButtonController!.Keyboard);
// Need to know when the visual control is removed
_appMenu.Disposed += OnAppMenuDisposed;
- // Adjust the screen rect of the app button/tab, so we show half way down the button
+ // Adjust the screen rect of the app button/tab, so we show half-way down the button
appRectShow.X -= 3;
appRectShow.Height = 0;
@@ -739,7 +741,7 @@ private void OnAppButtonClicked(object sender, EventArgs e)
}
}
- private void OnAppMenuDisposed(object sender, EventArgs e)
+ private void OnAppMenuDisposed(object? sender, EventArgs e)
{
// We always kill keyboard mode when the app button menu is removed
_ribbon.KillKeyboardMode();
@@ -770,7 +772,7 @@ private void OnAppMenuDisposed(object sender, EventArgs e)
}
}
- private void OnContextClicked(object sender, MouseEventArgs e)
+ private void OnContextClicked(object? sender, MouseEventArgs e)
{
if (!_ribbon.InDesignMode)
{
@@ -778,7 +780,7 @@ private void OnContextClicked(object sender, MouseEventArgs e)
}
}
- private void OnShowToolTip(object sender, ToolTipEventArgs e)
+ private void OnShowToolTip(object? sender, ToolTipEventArgs e)
{
if (!_ribbon.IsDisposed)
{
@@ -802,45 +804,45 @@ private void OnShowToolTip(object sender, ToolTipEventArgs e)
{
case ViewLayoutRibbonAppButton:
case ViewLayoutRibbonAppTab:
- {
- // Create a content that recovers values from a the ribbon for the app button/tab
- var appButtonContent = new AppButtonToolTipToContent(_ribbon);
-
- // Is there actually anything to show for the tooltip
- if (appButtonContent.HasContent)
{
- sourceContent = appButtonContent;
+ // Create a content that recovers values from the ribbon for the app button/tab
+ var appButtonContent = new AppButtonToolTipToContent(_ribbon);
+
+ // Is there actually anything to show for the tooltip
+ if (appButtonContent.HasContent)
+ {
+ sourceContent = appButtonContent;
- // Grab the style from the app button settings
- toolTipStyle = _ribbon.RibbonAppButton.AppButtonToolTipStyle;
- shadow = _ribbon.RibbonAppButton.ToolTipShadow;
+ // Grab the style from the app button settings
+ toolTipStyle = _ribbon.RibbonFileAppButton.AppButtonToolTipStyle;
+ shadow = _ribbon.RibbonFileAppButton.ToolTipShadow;
- // Display below the mouse cursor
- screenRect.Height += SystemInformation.CursorSize.Height / 3 * 2;
+ // Display below the mouse cursor
+ screenRect.Height += SystemInformation.CursorSize.Height / 3 * 2;
+ }
}
- }
break;
case ViewDrawRibbonQATButton viewElement1:
- {
- // If the target is a QAT button
- // Cast to correct type
+ {
+ // If the target is a QAT button
+ // Cast to correct type
- // Create a content that recovers values from a IQuickAccessToolbarButton
- var qatButtonContent = new QATButtonToolTipToContent(viewElement1.QATButton);
+ // Create a content that recovers values from a IQuickAccessToolbarButton
+ var qatButtonContent = new QATButtonToolTipToContent(viewElement1.QATButton);
- // Is there actually anything to show for the tooltip
- if (qatButtonContent.HasContent)
- {
- sourceContent = qatButtonContent;
+ // Is there actually anything to show for the tooltip
+ if (qatButtonContent.HasContent)
+ {
+ sourceContent = qatButtonContent;
- // Grab the style from the QAT button settings
- toolTipStyle = viewElement1.QATButton.GetToolTipStyle();
- shadow = viewElement1.QATButton.GetToolTipShadow();
+ // Grab the style from the QAT button settings
+ toolTipStyle = viewElement1.QATButton.GetToolTipStyle();
+ shadow = viewElement1.QATButton.GetToolTipShadow();
- // Display below the mouse cursor
- screenRect.Height += SystemInformation.CursorSize.Height / 3 * 2;
+ // Display below the mouse cursor
+ screenRect.Height += SystemInformation.CursorSize.Height / 3 * 2;
+ }
}
- }
break;
default:
{
@@ -878,7 +880,7 @@ private void OnShowToolTip(object sender, ToolTipEventArgs e)
{
sourceContent = groupItem.ToolTipValues;
- // Grab the style from the group radio button button settings
+ // Grab the style from the group radio button settings
toolTipStyle = groupItem.ToolTipValues.ToolTipStyle;
shadow = groupItem.ToolTipValues.ToolTipShadow;
@@ -911,7 +913,7 @@ private void OnShowToolTip(object sender, ToolTipEventArgs e)
_visualPopupToolTip.Disposed += OnVisualPopupToolTipDisposed;
- // The popup tooltip control always adds on a border above/below so we negate that here.
+ // The popup tooltip control always adds on a border above/below, so we negate that here.
screenRect.Height -= 20;
_visualPopupToolTip.ShowRelativeTo(e.Target, screenRect.Location);
}
@@ -919,21 +921,23 @@ private void OnShowToolTip(object sender, ToolTipEventArgs e)
}
}
- private void OnCancelToolTip(object sender, EventArgs e) =>
+ private void OnCancelToolTip(object? sender, EventArgs e) =>
// Remove any currently showing tooltip
_visualPopupToolTip?.Dispose();
- private void OnVisualPopupToolTipDisposed(object sender, EventArgs e)
+ private void OnVisualPopupToolTipDisposed(object? sender, EventArgs e)
{
// Unhook events from the specific instance that generated event
- var popupToolTip = (VisualPopupToolTip)sender;
- popupToolTip.Disposed -= OnVisualPopupToolTipDisposed;
+ if (sender is VisualPopupToolTip popupToolTip && popupToolTip is not null)
+ {
+ popupToolTip.Disposed -= OnVisualPopupToolTipDisposed;
- // Not showing a popup page any more
- _visualPopupToolTip = null;
+ // Not showing a popup page anymore
+ _visualPopupToolTip = null;
+ }
}
- private void OnTabsPaintBackground(object sender, PaintEventArgs e) => PaintBackground?.Invoke(sender, e);
+ private void OnTabsPaintBackground(object? sender, PaintEventArgs e) => PaintBackground?.Invoke(sender, e);
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonTabsSpare.cs b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonTabsSpare.cs
index ab4bd2148..6154bd23d 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonTabsSpare.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonTabsSpare.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
diff --git a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonTitle.cs b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonTitle.cs
index 3d0f1ab66..29899fff3 100644
--- a/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonTitle.cs
+++ b/Source/Krypton Components/Krypton.Ribbon/View Layout/ViewLayoutRibbonTitle.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
* Modified: Monday 12th April, 2021 @ 18:00 GMT
*
diff --git a/Source/Krypton Components/Krypton.Toolkit/AccurateText/AccurateText.cs b/Source/Krypton Components/Krypton.Toolkit/AccurateText/AccurateText.cs
index d32341e7c..1d0570d75 100644
--- a/Source/Krypton Components/Krypton.Toolkit/AccurateText/AccurateText.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/AccurateText/AccurateText.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -42,21 +42,17 @@ public class AccurateText : GlobalId
/// How to align multi-line text.
/// How to process prefix characters.
/// Rendering hint.
- /// Should draw on a composition element.
- /// When on composition draw with glowing.
/// Dispose of font when finished with it.
///
/// A memento used to draw the text.
public static AccurateTextMemento MeasureString([DisallowNull] Graphics g,
RightToLeft rtl,
[DisallowNull] string text,
- [DisallowNull] Font font,
+ [DisallowNull] Font? font,
PaletteTextTrim trim,
PaletteRelativeAlign align,
PaletteTextHotkeyPrefix prefix,
TextRenderingHint hint,
- bool composition,
- bool glowing,
bool disposeFont)
{
Debug.Assert(g != null);
@@ -99,15 +95,19 @@ public static AccurateTextMemento MeasureString([DisallowNull] Graphics g,
case PaletteRelativeAlign.Near:
format.Alignment = (rtl == RightToLeft.Yes) ? StringAlignment.Far : StringAlignment.Near;
break;
+
case PaletteRelativeAlign.Center:
format.Alignment = StringAlignment.Center;
break;
+
case PaletteRelativeAlign.Far:
format.Alignment = (rtl == RightToLeft.Yes) ? StringAlignment.Near : StringAlignment.Far;
break;
+
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(align.ToString());
break;
}
@@ -117,24 +117,31 @@ public static AccurateTextMemento MeasureString([DisallowNull] Graphics g,
case PaletteTextTrim.Character:
format.Trimming = StringTrimming.Character;
break;
+
case PaletteTextTrim.EllipsisCharacter:
format.Trimming = StringTrimming.EllipsisCharacter;
break;
+
case PaletteTextTrim.EllipsisPath:
format.Trimming = StringTrimming.EllipsisPath;
break;
+
case PaletteTextTrim.EllipsisWord:
format.Trimming = StringTrimming.EllipsisWord;
break;
+
case PaletteTextTrim.Word:
format.Trimming = StringTrimming.Word;
break;
+
case PaletteTextTrim.Hide:
format.Trimming = StringTrimming.None;
break;
+
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(trim.ToString());
break;
}
@@ -144,15 +151,19 @@ public static AccurateTextMemento MeasureString([DisallowNull] Graphics g,
case PaletteTextHotkeyPrefix.None:
format.HotkeyPrefix = HotkeyPrefix.None;
break;
+
case PaletteTextHotkeyPrefix.Hide:
format.HotkeyPrefix = HotkeyPrefix.Hide;
break;
+
case PaletteTextHotkeyPrefix.Show:
format.HotkeyPrefix = HotkeyPrefix.Show;
break;
+
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(prefix.ToString());
break;
}
@@ -174,11 +185,6 @@ public static AccurateTextMemento MeasureString([DisallowNull] Graphics g,
// Declare a proposed size with dimensions set to the maximum integer value.
var proposedSize = new Size(int.MaxValue, int.MaxValue);
textSize = g.MeasureString(text, font, proposedSize, format);
-
- if (composition && glowing) //Seb
- {
- textSize.Width += GLOW_EXTRA_WIDTH;
- }
}
catch
{
@@ -200,10 +206,8 @@ public static AccurateTextMemento MeasureString([DisallowNull] Graphics g,
/// Rectangle to draw text inside.
/// Right to left setting for control.
/// Orientation for drawing text.
- /// Memento containing text context.
/// State of the source element.
- /// Should draw on a composition element.
- /// When on composition draw with glowing.
+ /// Memento containing text context.
///
/// True if draw succeeded; False is draw produced an error.
public static bool DrawString([DisallowNull] Graphics g,
@@ -211,8 +215,6 @@ public static bool DrawString([DisallowNull] Graphics g,
Rectangle rect,
RightToLeft rtl,
VisualOrientation orientation,
- bool composition,
- bool glowing,
PaletteState state,
[DisallowNull] AccurateTextMemento memento)
{
@@ -287,26 +289,8 @@ public static bool DrawString([DisallowNull] Graphics g,
try
{
- switch (Application.RenderWithVisualStyles)
- {
- case true when composition && glowing:
- DrawCompositionGlowingText(g, memento.Text, memento.Font, rect, state,
- SystemColors.ActiveCaptionText, true);
- break;
- case true when composition:
- {
- //Check if correct in all cases
- var tmpBrush = brush as SolidBrush;
- Color tmpColor = tmpBrush?.Color ?? SystemColors.ActiveCaptionText;
-
- DrawCompositionText(g, memento.Text, memento.Font, rect, state,
- tmpColor, true, memento.Format);
- break;
- }
- default:
- g.DrawString(memento.Text, memento.Font, brush, rect, memento.Format);
- break;
- }
+
+ g.DrawString(memento.Text, memento.Font!, brush, rect, memento.Format);
}
catch
{
@@ -350,221 +334,6 @@ private static Color ContrastColor(Color color)
#endregion
#region Implementation
- ///
- /// Draw text with a glowing background, for use on a composition element.
- ///
- /// Graphics reference.
- /// Text to be drawn.
- /// Font to use for text.
- /// Bounding area for the text.
- /// State of the source element.
- /// of the text.
- /// Should existing background be copied into the bitmap.
- public static void DrawCompositionGlowingText(Graphics? g,
- string text,
- Font font,
- Rectangle bounds,
- PaletteState state,
- Color color,
- bool copyBackground)
- {
- // Get the hDC for the graphics instance and create a memory DC
- var gDC = g?.GetHdc() ?? IntPtr.Zero;
- try
- {
- var mDC = PI.CreateCompatibleDC(gDC);
-
- var bmi = new PI.BITMAPINFO
- {
- biWidth = bounds.Width,
- biHeight = -(bounds.Height + (GLOW_EXTRA_HEIGHT * 2)),
- biCompression = 0,
- biBitCount = 32,
- biPlanes = 1
- };
- bmi.biSize = (uint) Marshal.SizeOf(bmi);
-
-
- // Create a device independent bitmap and select into the memory DC
- var hDIB = PI.CreateDIBSection(gDC, ref bmi, 0, out _, IntPtr.Zero, 0);
- PI.SelectObject(mDC, hDIB);
-
- if (copyBackground)
- {
- // Copy existing background into the bitmap
- PI.BitBlt(mDC, 0, 0, bounds.Width, bounds.Height + (GLOW_EXTRA_HEIGHT * 2),
- gDC, bounds.X, bounds.Y - GLOW_EXTRA_HEIGHT, 0x00CC0020);
- }
-
- // Select the font for use when drawing
- var hFont = font.ToHfont();
- PI.SelectObject(mDC, hFont);
-
- // Get renderer for the correct state
- var renderer = new VisualStyleRenderer(state == PaletteState.Normal
- ? VisualStyleElement.Window.Caption.Active
- : VisualStyleElement.Window.Caption.Inactive);
-
- // Create structures needed for theme drawing call
- var textBounds = new PI.RECT
- {
- left = 0,
- top = 0,
- right = bounds.Right - bounds.Left,
- bottom = bounds.Bottom - bounds.Top + (GLOW_EXTRA_HEIGHT * 2)
- };
- var dttOpts = new PI.DTTOPTS
- {
- dwSize = Marshal.SizeOf(typeof(PI.DTTOPTS)),
- dwFlags = PI.DTT_COMPOSITED | PI.DTT_GLOWSIZE | PI.DTT_TEXTCOLOR,
- crText = ColorTranslator.ToWin32(color),
- iGlowSize = 11
- };
-
- // Always draw text centered
- const TextFormatFlags TEXT_FORMAT = TextFormatFlags.SingleLine |
- TextFormatFlags.HorizontalCenter |
- TextFormatFlags.VerticalCenter |
- TextFormatFlags.EndEllipsis;
-
- // Perform actual drawing
- PI.DrawThemeTextEx(renderer.Handle,
- mDC, 0, 0,
- text, -1, (int)TEXT_FORMAT,
- ref textBounds, ref dttOpts);
-
- // Copy to foreground
- PI.BitBlt(gDC,
- bounds.Left, bounds.Top - GLOW_EXTRA_HEIGHT,
- bounds.Width, bounds.Height + (GLOW_EXTRA_HEIGHT * 2),
- mDC, 0, 0, 0x00CC0020);
-
- // Dispose of allocated objects
- PI.DeleteObject(hFont);
- PI.DeleteObject(hDIB);
- PI.DeleteDC(mDC);
- }
- catch
- {
- // ignored
- }
- finally
- {
- // Must remember to release the hDC
- g?.ReleaseHdc(gDC);
- }
- }
-
- ///
- /// Draw text without a glowing background, for use on a composition element.
- ///
- /// Graphics reference.
- /// Text to be drawn.
- /// Font to use for text.
- /// Bounding area for the text.
- /// State of the source element.
- /// of the text.
- /// Should existing background be copied into the bitmap.
- /// StringFormat of the memento.
- public static void DrawCompositionText(Graphics? g,
- string text,
- Font font,
- Rectangle bounds,
- PaletteState state,
- Color color,
- bool copyBackground,
- StringFormat sf)
- {
- // Get the hDC for the graphics instance and create a memory DC
- var gDC = g?.GetHdc() ?? IntPtr.Zero;
- try
- {
- var mDC = PI.CreateCompatibleDC(gDC);
-
- var bmi = new PI.BITMAPINFO
- {
- biWidth = bounds.Width,
- biHeight = -bounds.Height,
- biCompression = 0,
- biBitCount = 32,
- biPlanes = 1
- };
- bmi.biSize = (uint)Marshal.SizeOf(bmi);
-
- // Create a device independent bitmap and select into the memory DC
- var hDIB = PI.CreateDIBSection(gDC, ref bmi, 0, out _, IntPtr.Zero, 0);
- PI.SelectObject(mDC, hDIB);
-
- if (copyBackground)
- {
- // Copy existing background into the bitmap
- PI.BitBlt(mDC, 0, 0, bounds.Width, bounds.Height,
- gDC, bounds.X, bounds.Y, 0x00CC0020);
- }
-
- // Select the font for use when drawing
- var hFont = font.ToHfont();
- PI.SelectObject(mDC, hFont);
-
- // Get renderer for the correct state
- var renderer = new VisualStyleRenderer(state == PaletteState.Normal
- ? VisualStyleElement.Window.Caption.Active
- : VisualStyleElement.Window.Caption.Inactive);
-
- // Create structures needed for theme drawing call
- var textBounds = new PI.RECT
- {
- left = 0,
- top = 0,
- right = bounds.Right - bounds.Left,
- bottom = bounds.Bottom - bounds.Top
- };
- var dttOpts = new PI.DTTOPTS
- {
- dwSize = Marshal.SizeOf(typeof(PI.DTTOPTS)),
- dwFlags = PI.DTT_COMPOSITED | PI.DTT_TEXTCOLOR,
- crText = ColorTranslator.ToWin32(color)
- };
-
- // Always draw text centered
- TextFormatFlags textFormat = TextFormatFlags.SingleLine |
- TextFormatFlags.HorizontalCenter |
- TextFormatFlags.VerticalCenter;
- ////Seb | TextFormatFlags.EndEllipsis;
-
-
- // Perform actual drawing
- //PI.DrawThemeTextEx(renderer.Handle,
- // mDC, 0, 0,
- // text, -1, (int)StringFormatToFlags(sf),
- // ref textBounds, ref dttOpts);
- PI.DrawThemeTextEx(renderer.Handle,
- mDC, 0, 0,
- text, -1, (int)textFormat,
- ref textBounds, ref dttOpts);
-
- // Copy to foreground
- PI.BitBlt(gDC,
- bounds.Left, bounds.Top,
- bounds.Width, bounds.Height,
- mDC, 0, 0, 0x00CC0020);
-
- // Dispose of allocated objects
- PI.DeleteObject(hFont);
- PI.DeleteObject(hDIB);
- PI.DeleteDC(mDC);
- }
- catch
- {
- // ignored
- }
- finally
- {
- // Must remember to release the hDC
- g?.ReleaseHdc(gDC);
- }
- }
-
private static StringFormat FlagsToStringFormat(TextFormatFlags flags)
{
var sf = new StringFormat();
diff --git a/Source/Krypton Components/Krypton.Toolkit/AccurateText/AccurateTextMemento.cs b/Source/Krypton Components/Krypton.Toolkit/AccurateText/AccurateTextMemento.cs
index ae8e28fa9..b53414e8d 100644
--- a/Source/Krypton Components/Krypton.Toolkit/AccurateText/AccurateTextMemento.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/AccurateText/AccurateTextMemento.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -37,7 +37,7 @@ public class AccurateTextMemento : GlobalId,
/// Drawing hint.
/// Should the font be disposed.
internal AccurateTextMemento(string text,
- [DisallowNull] Font font,
+ [DisallowNull] Font? font,
SizeF sizeF,
StringFormat format,
TextRenderingHint hint, // TODO: What was this supposed to be used for ?
@@ -57,7 +57,7 @@ public void Dispose()
{
if (_disposeFont)
{
- Font.Dispose();
+ Font?.Dispose();
}
GC.SuppressFinalize(this);
}
@@ -73,7 +73,7 @@ public void Dispose()
/// Gets the drawing font.
///
[DisallowNull]
- public Font Font { get; set; }
+ public Font? Font { get; set; }
///
/// Gets the pixel size of the text area.
diff --git a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpec.cs b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpec.cs
index 6adfe2906..d045a18e6 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpec.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpec.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -74,9 +74,9 @@ protected ButtonSpec()
{
_image = null;
_toolTipImage = null;
- _colorMap = Color.Empty;
- _imageTransparentColor = Color.Empty;
- _toolTipImageTransparentColor = Color.Empty;
+ _colorMap = GlobalStaticValues.EMPTY_COLOR;
+ _imageTransparentColor = GlobalStaticValues.EMPTY_COLOR;
+ _toolTipImageTransparentColor = GlobalStaticValues.EMPTY_COLOR;
_text = string.Empty;
_extraText = string.Empty;
UniqueName = CommonHelper.UniqueString;
@@ -147,25 +147,27 @@ public virtual object Clone()
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
- public virtual bool IsDefault => _imageStates.IsDefault &&
- (Image == null) &&
- (ToolTipImage == null) &&
- (ColorMap == Color.Empty) &&
- (ImageTransparentColor == Color.Empty) &&
- (ToolTipImageTransparentColor == Color.Empty) &&
- (Text == string.Empty) &&
- (ExtraText == string.Empty) &&
- (ToolTipTitle == string.Empty) &&
- (ToolTipBody == string.Empty) &&
- (ToolTipStyle == LabelStyle.ToolTip) &&
- (Style == PaletteButtonStyle.Inherit) &&
- (Orientation == PaletteButtonOrientation.Inherit) &&
- (Edge == PaletteRelativeEdgeAlign.Inherit) &&
- (ContextMenuStrip == null) &&
- AllowInheritImage &&
- AllowInheritText &&
- AllowInheritExtraText &&
- AllowInheritToolTipTitle;
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public virtual bool IsDefault => !ShouldSerializeImageStates() &&
+ !ShouldSerializeImage() &&
+ !ShouldSerializeColorMap() &&
+ !ShouldSerializeImageTransparentColor() &&
+ !ShouldSerializeText() &&
+ !ShouldSerializeExtraText() &&
+ !ShouldSerializeToolTipImage() &&
+ !ShouldSerializeToolTipImageTransparentColor() &&
+ !ShouldSerializeToolTipTitle() &&
+ !ShouldSerializeToolTipBody() &&
+ !ShouldSerializeToolTipStyle() &&
+ !ShouldSerializeToolTipShadow() &&
+ !ShouldSerializeStyle() &&
+ !ShouldSerializeOrientation() &&
+ !ShouldSerializeEdge() &&
+ (ContextMenuStrip == null) &&
+ AllowInheritImage &&
+ AllowInheritText &&
+ AllowInheritExtraText &&
+ AllowInheritToolTipTitle;
#endregion
@@ -189,9 +191,7 @@ public Image? Image
}
}
}
-
private bool ShouldSerializeImage() => Image != null;
-
private void ResetImage() => Image = null;
#endregion
@@ -203,7 +203,7 @@ public Image? Image
[Localizable(true)]
[Category(@"Appearance")]
[Description(@"Button image transparent color.")]
- [KryptonDefaultColor()]
+ [KryptonDefaultColor]
public Color ImageTransparentColor
{
get => _imageTransparentColor;
@@ -217,11 +217,8 @@ public Color ImageTransparentColor
}
}
}
-
- private bool ShouldSerializeImageTransparentColor() => ImageTransparentColor != Color.Empty;
-
- private void ResetImageTransparentColor() => ImageTransparentColor = Color.Empty;
-
+ private bool ShouldSerializeImageTransparentColor() => ImageTransparentColor != GlobalStaticValues.EMPTY_COLOR;
+ private void ResetImageTransparentColor() => ImageTransparentColor = GlobalStaticValues.EMPTY_COLOR;
#endregion
#region ImageStates
@@ -232,9 +229,7 @@ public Color ImageTransparentColor
[Description(@"State specific images for the button.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public ButtonImageStates ImageStates => _imageStates;
-
private bool ShouldSerializeImageStates() => !_imageStates.IsDefault;
-
#endregion
#region Text
@@ -258,9 +253,7 @@ public string Text
}
}
}
-
private bool ShouldSerializeText() => Text != string.Empty;
-
private void ResetText() => Text = string.Empty;
#endregion
@@ -285,11 +278,8 @@ public string ExtraText
}
}
}
-
private bool ShouldSerializeExtraText() => ExtraText != string.Empty;
-
private void ResetExtraText() => ExtraText = string.Empty;
-
#endregion
#region ToolTipImage
@@ -313,11 +303,8 @@ public Image? ToolTipImage
}
}
}
-
private bool ShouldSerializeToolTipImage() => ToolTipImage != null;
-
private void ResetToolTipImage() => ToolTipImage = null;
-
#endregion
#region ToolTipImageTransparentColor
@@ -327,7 +314,7 @@ public Image? ToolTipImage
[Localizable(true)]
[Category(@"ToolTip")]
[Description(@"Button image transparent color.")]
- [KryptonDefaultColor()]
+ [KryptonDefaultColor]
public Color ToolTipImageTransparentColor
{
get => _toolTipImageTransparentColor;
@@ -341,11 +328,8 @@ public Color ToolTipImageTransparentColor
}
}
}
-
- private bool ShouldSerializeToolTipImageTransparentColor() => ToolTipImageTransparentColor != Color.Empty;
-
- private void ResetToolTipImageTransparentColor() => ToolTipImageTransparentColor = Color.Empty;
-
+ private bool ShouldSerializeToolTipImageTransparentColor() => ToolTipImageTransparentColor != GlobalStaticValues.EMPTY_COLOR;
+ private void ResetToolTipImageTransparentColor() => ToolTipImageTransparentColor = GlobalStaticValues.EMPTY_COLOR;
#endregion
#region ToolTipTitle
@@ -370,11 +354,8 @@ public string ToolTipTitle
}
}
}
-
private bool ShouldSerializeToolTipTitle() => ToolTipTitle != string.Empty;
-
private void ResetToolTipTitle() => ToolTipTitle = string.Empty;
-
#endregion
#region ToolTipBody
@@ -399,11 +380,8 @@ public string ToolTipBody
}
}
}
-
private bool ShouldSerializeToolTipBody() => ToolTipBody != string.Empty;
-
private void ResetToolTipBody() => ToolTipBody = string.Empty;
-
#endregion
#region ToolTipStyle
@@ -414,15 +392,11 @@ public string ToolTipBody
[Description(@"Button tooltip label style.")]
[DefaultValue(LabelStyle.ToolTip)]
public LabelStyle ToolTipStyle { get; set; }
-
private bool ShouldSerializeToolTipStyle() => ToolTipStyle != LabelStyle.ToolTip;
-
private void ResetToolTipStyle() => ToolTipStyle = LabelStyle.ToolTip;
-
#endregion
#region ToolTipShadow
-
///
/// Gets and sets the tooltip label style.
///
@@ -430,11 +404,8 @@ public string ToolTipBody
[Description(@"Button tooltip Shadow.")]
[DefaultValue(true)]
public bool ToolTipShadow { get; set; } = true;
-
private bool ShouldSerializeToolTipShadow() => !ToolTipShadow;
-
private void ResetToolTipShadow() => ToolTipShadow = true;
-
#endregion
#region UniqueName
@@ -444,12 +415,7 @@ public string ToolTipBody
[Category(@"Data")]
[Description(@"The unique name of the ButtonSpec.")]
public string? UniqueName { get; set; }
-
- ///
- /// Resets the UniqueName property to its default value.
- ///
- public void ResetUniqueName() => UniqueName = CommonHelper.UniqueString;
-
+ private void ResetUniqueName() => UniqueName = CommonHelper.UniqueString;
#endregion
#region AllowInheritImage
@@ -473,12 +439,7 @@ public bool AllowInheritImage
}
}
}
-
- ///
- /// Resets the AllowInheritImage property to its default value.
- ///
- public void ResetAllowInheritImage() => AllowInheritImage = true;
-
+ private void ResetAllowInheritImage() => AllowInheritImage = true;
#endregion
#region AllowInheritText
@@ -502,12 +463,7 @@ public bool AllowInheritText
}
}
}
-
- ///
- /// Resets the AllowInheritText property to its default value.
- ///
- public void ResetAllowInheritText() => AllowInheritText = true;
-
+ private void ResetAllowInheritText() => AllowInheritText = true;
#endregion
#region AllowInheritExtraText
@@ -531,12 +487,7 @@ public bool AllowInheritExtraText
}
}
}
-
- ///
- /// Resets the AllowInheritExtraText property to its default value.
- ///
- public void ResetAllowInheritExtraText() => AllowInheritExtraText = true;
-
+ private void ResetAllowInheritExtraText() => AllowInheritExtraText = true;
#endregion
#region AllowInheritToolTipTitle
@@ -560,12 +511,7 @@ public bool AllowInheritToolTipTitle
}
}
}
-
- ///
- /// Resets the AllowInheritToolTipTitle property to its default value.
- ///
- public void ResetAllowInheritToolTipTitle() => AllowInheritToolTipTitle = true;
-
+ private void ResetAllowInheritToolTipTitle() => AllowInheritToolTipTitle = true;
#endregion
#region AllowComponent
@@ -575,7 +521,6 @@ public bool AllowInheritToolTipTitle
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual bool AllowComponent => true;
-
#endregion
#region ColorMap
@@ -585,7 +530,7 @@ public bool AllowInheritToolTipTitle
[Localizable(true)]
[Category(@"Appearance")]
[Description(@"Image color to remap to container foreground.")]
- [KryptonDefaultColor()]
+ [KryptonDefaultColor]
public Color ColorMap
{
get => _colorMap;
@@ -599,14 +544,8 @@ public Color ColorMap
}
}
}
-
- private bool ShouldSerializeColorMap() => ColorMap != Color.Empty;
-
- ///
- /// Resets the ColorMap property to its default value.
- ///
- public void ResetColorMap() => ColorMap = Color.Empty;
-
+ private bool ShouldSerializeColorMap() => ColorMap != GlobalStaticValues.EMPTY_COLOR;
+ private void ResetColorMap() => ColorMap = GlobalStaticValues.EMPTY_COLOR;
#endregion
#region Style
@@ -630,12 +569,7 @@ public PaletteButtonStyle Style
}
}
}
-
private bool ShouldSerializeStyle() => Style != PaletteButtonStyle.Inherit;
-
- ///
- /// Resets the Style property to its default value.
- ///
private void ResetStyle() => Style = PaletteButtonStyle.Inherit;
#endregion
@@ -660,14 +594,8 @@ public PaletteButtonOrientation Orientation
}
}
}
-
private bool ShouldSerializeOrientation() => Orientation != PaletteButtonOrientation.Inherit;
-
- ///
- /// Resets the Orientation property to its default value.
- ///
- public void ResetOrientation() => Orientation = PaletteButtonOrientation.Inherit;
-
+ private void ResetOrientation() => Orientation = PaletteButtonOrientation.Inherit;
#endregion
#region Edge
@@ -691,11 +619,8 @@ public PaletteRelativeEdgeAlign Edge
}
}
}
-
private bool ShouldSerializeEdge() => Edge != PaletteRelativeEdgeAlign.Inherit;
-
private void ResetEdge() => Edge = PaletteRelativeEdgeAlign.Inherit;
-
#endregion
#region ContextMenuStrip
@@ -708,7 +633,6 @@ public PaletteRelativeEdgeAlign Edge
[RefreshProperties(RefreshProperties.All)]
[DefaultValue(null)]
public ContextMenuStrip? ContextMenuStrip { get; set; }
-
#endregion
#region KryptonContextMenu
@@ -721,7 +645,6 @@ public PaletteRelativeEdgeAlign Edge
[RefreshProperties(RefreshProperties.All)]
[DefaultValue(null)]
public KryptonContextMenu? KryptonContextMenu { get; set; }
-
#endregion
#region KryptonCommand
@@ -767,7 +690,6 @@ public virtual KryptonCommand? KryptonCommand
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public object? Owner { get; set; }
-
#endregion
#region Tag
@@ -779,7 +701,6 @@ public virtual KryptonCommand? KryptonCommand
[TypeConverter(typeof(StringConverter))]
[DefaultValue(null)]
public object? Tag { get; set; }
-
#endregion
#region CopyFrom
@@ -817,7 +738,6 @@ public virtual void CopyFrom(ButtonSpec source)
///
/// An EventArgs containing the event data.
public void PerformClick(EventArgs e) => OnClick(e);
-
#endregion
#region IButtonSpecValues
@@ -867,9 +787,9 @@ public virtual Color GetImageTransparentColor(PaletteBase? palette)
return KryptonCommand.ImageTransparentColor;
}
- return ImageTransparentColor != Color.Empty
+ return ImageTransparentColor != GlobalStaticValues.EMPTY_COLOR
? ImageTransparentColor
- : palette?.GetButtonSpecImageTransparentColor(ProtectedType) ?? Color.Empty;
+ : palette?.GetButtonSpecImageTransparentColor(ProtectedType) ?? GlobalStaticValues.EMPTY_COLOR;
}
///
@@ -912,19 +832,19 @@ public virtual string GetLongText(PaletteBase? palette)
///
/// Palette to use for inheriting values.
/// Tooltip title string.
- public virtual string GetToolTipTitle(PaletteBase? palette) => !string.IsNullOrEmpty(ToolTipTitle)
- || !AllowInheritToolTipTitle
+ public virtual string GetToolTipTitle(PaletteBase palette) => !string.IsNullOrEmpty(ToolTipTitle)
+ || !AllowInheritToolTipTitle
? ToolTipTitle
- : palette?.GetButtonSpecToolTipTitle(ProtectedType) ?? string.Empty;
+ : palette.GetButtonSpecToolTipTitle(ProtectedType) ?? string.Empty;
///
/// Gets the color to remap from the image to the container foreground.
///
/// Palette to use for inheriting values.
/// Color value.
- public virtual Color GetColorMap(PaletteBase? palette) => ColorMap != Color.Empty
- ? ColorMap
- : palette?.GetButtonSpecColorMap(ProtectedType) ?? Color.Empty;
+ public virtual Color GetColorMap(PaletteBase? palette) => ColorMap != GlobalStaticValues.EMPTY_COLOR
+ ? ColorMap
+ : palette!.GetButtonSpecColorMap(ProtectedType);
///
/// Gets the button style.
@@ -967,19 +887,19 @@ public virtual RelativeEdgeAlign GetEdge(PaletteBase? palette) =>
///
/// Palette to use for inheriting values.
/// Button enabled state.
- public abstract ButtonEnabled GetEnabled(PaletteBase? palette);
+ public abstract ButtonEnabled GetEnabled(PaletteBase palette);
///
/// Sets the current view associated with the button spec.
///
/// View element reference.
- public virtual void SetView(ViewBase? view) => _buttonSpecView = view;
+ public virtual void SetView(ViewBase view) => _buttonSpecView = view;
///
/// Get the current view associated with the button spec.
///
/// View element reference.
- public virtual ViewBase? GetView() => _buttonSpecView;
+ public virtual ViewBase GetView() => _buttonSpecView!;
///
/// Gets a value indicating if the associated view is enabled.
@@ -992,7 +912,7 @@ public virtual RelativeEdgeAlign GetEdge(PaletteBase? palette) =>
///
/// Palette to use for inheriting values.
/// Button visibility.
- public abstract bool GetVisible(PaletteBase? palette);
+ public abstract bool GetVisible(PaletteBase palette);
///
/// Gets the button checked state.
@@ -1042,7 +962,7 @@ protected virtual void OnClick(EventArgs e)
///
/// Source of the event.
/// A PropertyChangedEventArgs that contains the event data.
- protected virtual void OnCommandPropertyChanged(object sender, PropertyChangedEventArgs e)
+ protected virtual void OnCommandPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
switch (e.PropertyName)
{
@@ -1071,11 +991,14 @@ protected RelativeEdgeAlign ConvertToRelativeEdgeAlign(PaletteRelativeEdgeAlign
{
case PaletteRelativeEdgeAlign.Near:
return RelativeEdgeAlign.Near;
+
case PaletteRelativeEdgeAlign.Far:
return RelativeEdgeAlign.Far;
+
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(paletteRelativeEdgeAlign.ToString());
return RelativeEdgeAlign.Far;
}
}
@@ -1091,17 +1014,23 @@ protected ButtonOrientation ConvertToButtonOrientation(PaletteButtonOrientation
{
case PaletteButtonOrientation.Auto:
return ButtonOrientation.Auto;
+
case PaletteButtonOrientation.FixedBottom:
return ButtonOrientation.FixedBottom;
+
case PaletteButtonOrientation.FixedLeft:
return ButtonOrientation.FixedLeft;
+
case PaletteButtonOrientation.FixedRight:
return ButtonOrientation.FixedRight;
+
case PaletteButtonOrientation.FixedTop:
return ButtonOrientation.FixedTop;
+
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(paletteButtonOrientation.ToString());
return ButtonOrientation.Auto;
}
}
@@ -1150,8 +1079,9 @@ protected ButtonStyle ConvertToButtonStyle(PaletteButtonStyle? paletteButtonStyl
case PaletteButtonStyle.Custom3:
return ButtonStyle.Custom3;
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(paletteButtonStyle.ToString());
return ButtonStyle.Standalone;
}
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecAny.cs b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecAny.cs
index 68dc9de45..f5d33c866 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecAny.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecAny.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -61,10 +61,11 @@ public override object Clone()
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => base.IsDefault &&
- Visible &&
- (Enabled == ButtonEnabled.Container) &&
- (Checked == ButtonCheckState.NotCheckButton);
+ Visible &&
+ (Enabled == ButtonEnabled.Container) &&
+ (Checked == ButtonCheckState.NotCheckButton);
#endregion
@@ -167,7 +168,7 @@ public ButtonCheckState Checked
///
[Localizable(true)]
[Category(@"Behavior")]
- [Description(@"Defines if the button is checked or capable of being checked.")]
+ [Description(@"Displays a drop down arrow on the button.")]
[RefreshProperties(RefreshProperties.All)]
[DefaultValue(false)]
public bool ShowDrop
@@ -279,14 +280,14 @@ public void CopyFrom(ButtonSpecAny source)
///
/// Palette to use for inheriting values.
/// Button visibility.
- public override bool GetVisible(PaletteBase? 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(PaletteBase? palette) => Enabled;
+ public override ButtonEnabled GetEnabled(PaletteBase palette) => Enabled;
///
/// Gets the button checked state.
@@ -330,7 +331,7 @@ protected override void OnButtonSpecPropertyChanged(string propertyName)
///
/// Source of the event.
/// A PropertyChangedEventArgs that contains the event data.
- protected override void OnCommandPropertyChanged(object sender, PropertyChangedEventArgs e)
+ protected override void OnCommandPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
base.OnCommandPropertyChanged(sender, e);
diff --git a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecCalendar.cs b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecCalendar.cs
index acdbec895..db9ae10b3 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecCalendar.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecCalendar.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -65,14 +65,14 @@ public ButtonSpecCalendar(ViewDrawMonth month,
///
/// Palette to use for inheriting values.
/// Button visibility.
- public override bool GetVisible(PaletteBase? 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(PaletteBase? palette) => Enabled ? ButtonEnabled.Container : ButtonEnabled.False;
+ public override ButtonEnabled GetEnabled(PaletteBase palette) => Enabled ? ButtonEnabled.Container : ButtonEnabled.False;
///
/// Gets the button checked state.
diff --git a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecCollection.cs b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecCollection.cs
index 42fc0feb0..d59a2774f 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecCollection.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecCollection.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -210,7 +210,7 @@ public void Remove(object? value) =>
///
/// Object index.
/// Object at specified index.
- object IList.this[int index]
+ object? IList.this[int index]
{
get => _specs[index];
@@ -300,7 +300,7 @@ public T this[int index]
/// T at specified index.
public T? this[string uniqueName]
{
- get
+ get
{
// First priority is the UniqueName
foreach (T bs in this.Where(bs => bs.UniqueName == uniqueName))
@@ -391,16 +391,16 @@ public bool Remove([DisallowNull] T item)
Debug.Assert(item != null, nameof(item) + " != null");
// Cache the index of the button spec
- var index = IndexOf(item);
+ var index = IndexOf(item!);
// Generate before event
- OnRemoving(new ButtonSpecEventArgs(item, index));
+ OnRemoving(new ButtonSpecEventArgs(item!, index));
// Remove from the internal list
- var ret = _specs.Remove(item);
+ var ret = _specs.Remove(item!);
// Generate after event
- OnRemoved(new ButtonSpecEventArgs(item, index));
+ OnRemoved(new ButtonSpecEventArgs(item!, index));
return ret;
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecFormFixed.cs b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecFormFixed.cs
index 5034c6c65..4096e7e4d 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecFormFixed.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecFormFixed.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecFormWindowClose.cs b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecFormWindowClose.cs
index 40b5aa23b..afc9c6efc 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecFormWindowClose.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecFormWindowClose.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -60,15 +60,8 @@ public bool Enabled
///
/// Palette to use for inheriting values.
/// Button visibility.
- public override bool GetVisible(PaletteBase? 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
- if (KryptonForm is { ApplyComposition: true, ApplyCustomChrome: true })
- {
- return false;
- }
-
// Have all buttons been turned off?
return KryptonForm is { ControlBox: true, CloseBox: true };
}
@@ -78,7 +71,7 @@ public override bool GetVisible(PaletteBase? palette)
///
/// Palette to use for inheriting values.
/// Button enabled state.
- public override ButtonEnabled GetEnabled(PaletteBase? 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.
@@ -106,7 +99,7 @@ protected override void OnClick(EventArgs e)
{
// Only if the mouse is still within the button bounds do we perform action
var mea = (MouseEventArgs)e;
- if (GetView()!.ClientRectangle.Contains(mea.Location))
+ if (GetView().ClientRectangle.Contains(mea.Location))
{
PropertyInfo pi = typeof(Form).GetProperty(nameof(CloseReason),
BindingFlags.Instance |
diff --git a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecFormWindowMax.cs b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecFormWindowMax.cs
index 537e643ee..de99f008d 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecFormWindowMax.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecFormWindowMax.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -34,15 +34,8 @@ public ButtonSpecFormWindowMax(KryptonForm form)
///
/// Palette to use for inheriting values.
/// Button visibility.
- public override bool GetVisible(PaletteBase? 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
- if (KryptonForm is { ApplyComposition: true, ApplyCustomChrome: true })
- {
- return false;
- }
-
// The maximize button is never present on tool windows
switch (KryptonForm.FormBorderStyle)
{
@@ -58,7 +51,7 @@ public override bool GetVisible(PaletteBase? palette)
}
// Has the minimize/maximize buttons been turned off?
- return KryptonForm.MinimizeBox || KryptonForm.MaximizeBox;
+ return KryptonForm.MaximizeBox || KryptonForm.MinimizeBox;
}
///
@@ -66,7 +59,7 @@ public override bool GetVisible(PaletteBase? palette)
///
/// Palette to use for inheriting values.
/// Button enabled state.
- public override ButtonEnabled GetEnabled(PaletteBase? palette) =>
+ public override ButtonEnabled GetEnabled(PaletteBase palette) =>
// Has the maximize buttons been turned off?
KryptonForm.MaximizeBox ? ButtonEnabled.True : ButtonEnabled.False;
@@ -96,7 +89,7 @@ protected override void OnClick(EventArgs e)
{
// Only if the mouse is still within the button bounds do we perform action
var mea = (MouseEventArgs)e;
- if (GetView()!.ClientRectangle.Contains(mea.Location))
+ if (GetView().ClientRectangle.Contains(mea.Location))
{
// Toggle between maximized and restored
KryptonForm.SendSysCommand(KryptonForm.WindowState == FormWindowState.Maximized
diff --git a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecFormWindowMin.cs b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecFormWindowMin.cs
index 45b10e897..0e337a875 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecFormWindowMin.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecFormWindowMin.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -34,15 +34,8 @@ public ButtonSpecFormWindowMin(KryptonForm form)
///
/// Palette to use for inheriting values.
/// Button visibility.
- public override bool GetVisible(PaletteBase? 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
- if (KryptonForm is { ApplyComposition: true, ApplyCustomChrome: true })
- {
- return false;
- }
-
// The minimize button is never present on tool windows
switch (KryptonForm.FormBorderStyle)
{
@@ -66,7 +59,7 @@ public override bool GetVisible(PaletteBase? palette)
///
/// Palette to use for inheriting values.
/// Button enabled state.
- public override ButtonEnabled GetEnabled(PaletteBase? palette) =>
+ public override ButtonEnabled GetEnabled(PaletteBase palette) =>
// Has the minimize buttons been turned off?
!KryptonForm.MinimizeBox ? ButtonEnabled.False : ButtonEnabled.True;
@@ -96,7 +89,7 @@ protected override void OnClick(EventArgs e)
{
// Only if the mouse is still within the button bounds do we perform action
var mea = (MouseEventArgs)e;
- if (GetView()!.ClientRectangle.Contains(mea.Location))
+ if (GetView().ClientRectangle.Contains(mea.Location))
{
// Toggle between minimized and restored
KryptonForm.SendSysCommand(KryptonForm.WindowState == FormWindowState.Minimized
diff --git a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecHeaderGroup.cs b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecHeaderGroup.cs
index 9859678b3..fa3426bcd 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecHeaderGroup.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecHeaderGroup.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -34,8 +34,9 @@ public class ButtonSpecHeaderGroup : ButtonSpecAny
/// Gets a value indicating if all values are default.
///
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public override bool IsDefault => base.IsDefault &&
- (HeaderLocation == HeaderLocation.PrimaryHeader);
+ (HeaderLocation == HeaderLocation.PrimaryHeader);
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecManagerBase.cs b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecManagerBase.cs
index 020f67d0b..ef0a624ae 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecManagerBase.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecManagerBase.cs
@@ -5,11 +5,12 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
+// ReSharper disable RedundantNullableFlowAttribute
namespace Krypton.Toolkit
{
///
@@ -18,8 +19,8 @@ namespace Krypton.Toolkit
public abstract class ButtonSpecManagerBase : GlobalId
{
#region Type Definitions
- internal class ButtonSpecLookup : Dictionary { }
- internal class ListSpacers : List { }
+ internal class ButtonSpecLookup : Dictionary;
+ internal class ListSpacers : List;
#endregion
#region Instance Fields
@@ -33,7 +34,7 @@ internal class ListSpacers : List { }
private readonly PaletteMetricPadding[] _viewMetricPaddings;
private readonly ListSpacers[] _viewSpacers;
private readonly ButtonSpecLookup _specLookup;
- private readonly GetToolStripRenderer _getRenderer;
+ private readonly GetToolStripRenderer? _getRenderer;
#endregion
@@ -51,34 +52,33 @@ internal class ListSpacers : List { }
/// Array of target metrics for button padding.
/// Delegate for returning a tool strip renderer.
/// Delegate for notifying paint requests.
- protected ButtonSpecManagerBase([DisallowNull] Control control,
- [DisallowNull] PaletteRedirect? redirector,
- ButtonSpecCollectionBase? variableSpecs,
- ButtonSpecCollectionBase? fixedSpecs,
- IPaletteMetric[] viewMetrics,
- PaletteMetricInt[] viewMetricIntOutside,
- PaletteMetricInt[] viewMetricIntInside,
- PaletteMetricPadding[] viewMetricPaddings,
- [DisallowNull] GetToolStripRenderer getRenderer,
- NeedPaintHandler needPaint)
+ protected ButtonSpecManagerBase(Control control,
+ PaletteRedirect redirector,
+ ButtonSpecCollectionBase? variableSpecs,
+ ButtonSpecCollectionBase? fixedSpecs,
+ IPaletteMetric[] viewMetrics,
+ PaletteMetricInt[] viewMetricIntOutside,
+ PaletteMetricInt[] viewMetricIntInside,
+ PaletteMetricPadding[] viewMetricPaddings,
+ GetToolStripRenderer? getRenderer,
+ NeedPaintHandler needPaint)
{
- Debug.Assert(control != null);
- Debug.Assert(redirector != null);
- Debug.Assert(getRenderer != null);
-
- // Store the provided paint notification delegate
- NeedPaint = needPaint;
+ Debug.Assert(control is not null);
+ // Disabled to remove the warning
+ //Debug.Assert(redirector is not null);
+ Debug.Assert(getRenderer is not null);
// Remember references
Control = control;
- _redirector = redirector!;
+ _redirector = redirector;
_variableSpecs = variableSpecs;
_fixedSpecs = fixedSpecs;
_viewMetrics = viewMetrics;
_viewMetricIntOutside = viewMetricIntOutside;
_viewMetricIntInside = viewMetricIntInside;
_viewMetricPaddings = viewMetricPaddings;
- _getRenderer = getRenderer!;
+ _getRenderer = getRenderer;
+ NeedPaint = needPaint;
if (_viewMetrics != null)
{
@@ -153,7 +153,7 @@ public void Construct()
PaletteMetricInt viewMetricIntOutside = _viewMetricIntOutside[i];
// Create storage for the spacers
- _viewSpacers[i] = new ListSpacers();
+ _viewSpacers[i] = [];
// Always create the outside edge spacers
var spacerL1 = new ViewLayoutMetricSpacer(viewMetric, viewMetricIntOutside);
@@ -220,14 +220,7 @@ public void RecreateButtons()
/// Requests that all the buttons have state refreshed.
///
/// True if a state change was made.
- public bool RefreshButtons() => RefreshButtons(false);
-
- ///
- /// Requests that all the buttons have state refreshed.
- ///
- /// Composition value for the spec view.
- /// True if a state change was made.
- public bool RefreshButtons(bool composition)
+ public bool RefreshButtons()
{
var changed = false;
@@ -239,7 +232,6 @@ public bool RefreshButtons(bool composition)
changed |= buttonView.UpdateEnabled();
changed |= buttonView.UpdateChecked();
buttonView.UpdateShowDrop();
- buttonView.DrawButtonSpecOnComposition = composition;
}
return changed;
@@ -413,7 +405,7 @@ public bool DesignerGetHitTest(Point pt) =>
/// Get a tool strip renderer appropriate for the hosting control.
///
///
- public ToolStripRenderer RenderToolStrip() => _getRenderer();
+ public ToolStripRenderer? RenderToolStrip() => _getRenderer?.Invoke();
///
/// Requests a repaint and optional layout be performed.
@@ -446,11 +438,10 @@ select specView.ButtonSpec
///
/// Edge of buttons caller is interested in searching.
/// ViewDrawButton reference; otherwise false.
- public virtual ViewDrawButton? GetFirstVisibleViewButton(PaletteRelativeEdgeAlign align) => (from specView in _specLookup.Values
- where specView.ViewCenter.Visible && specView.ViewButton.Enabled
- where specView.ButtonSpec.Edge == align
- select specView.ViewButton
- )
+ public virtual ViewDrawButton? GetFirstVisibleViewButton(PaletteRelativeEdgeAlign align) => (_specLookup.Values
+ .Where(specView => specView.ViewButton != null && specView.ViewCenter.Visible && specView.ViewButton.Enabled)
+ .Where(specView => specView.ButtonSpec.Edge == align)
+ .Select(specView => specView.ViewButton))
.FirstOrDefault();
///
@@ -561,7 +552,7 @@ select specView.ViewButton
/// Base palette class.
/// ButtonSpec instance.
/// Palette redirector for the button spec instance.
- public virtual PaletteRedirect CreateButtonSpecRemap(PaletteRedirect? redirector,
+ public virtual PaletteRedirect CreateButtonSpecRemap(PaletteRedirect redirector,
[DisallowNull] ButtonSpec buttonSpec) =>
new ButtonSpecRemapByContentView(redirector, buttonSpec);
@@ -652,7 +643,7 @@ protected virtual void ButtonSpecCreated(ButtonSpec buttonSpec,
/// ButtonSpec instance.
/// ButtonSpecView derived class.
protected virtual ButtonSpecView CreateButtonSpecView([DisallowNull] PaletteRedirect redirector,
- IPaletteMetric? viewPaletteMetric,
+ IPaletteMetric viewPaletteMetric,
PaletteMetricPadding viewMetricPadding,
ButtonSpec buttonSpec) =>
new ButtonSpecView(redirector, viewPaletteMetric, viewMetricPadding, this, buttonSpec);
@@ -766,7 +757,7 @@ private void CreateFromCollection(ButtonSpecCollectionBase? specs,
(_viewMetrics.Length > viewDockerIndex) &&
(_viewMetricPaddings.Length > viewDockerIndex))
{
- IPaletteMetric? viewPaletteMetric = _viewMetrics[viewDockerIndex];
+ IPaletteMetric viewPaletteMetric = _viewMetrics[viewDockerIndex];
PaletteMetricPadding viewMetricPadding = _viewMetricPaddings[viewDockerIndex];
// Create an instance to manage the individual button spec
@@ -818,19 +809,19 @@ private void RemoveButtonSpec(ButtonSpec buttonSpec)
}
}
- private void OnButtonSpecInserted(object sender, ButtonSpecEventArgs e)
+ private void OnButtonSpecInserted(object? sender, ButtonSpecEventArgs e)
{
RecreateAll();
PerformNeedPaint(true);
}
- private void OnButtonSpecRemoved(object sender, ButtonSpecEventArgs e)
+ private void OnButtonSpecRemoved(object? sender, ButtonSpecEventArgs e)
{
RecreateAll();
PerformNeedPaint(true);
}
- private void OnPropertyChanged(object sender, PropertyChangedEventArgs e)
+ private void OnPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
switch (e.PropertyName)
{
@@ -853,8 +844,9 @@ private int GetTargetDockerIndex(HeaderLocation location)
case HeaderLocation.SecondaryHeader:
return 1;
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(location.ToString());
break;
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecManagerDraw.cs b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecManagerDraw.cs
index 6bb56ba88..4a94239da 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecManagerDraw.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecManagerDraw.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -36,10 +36,10 @@ public class ButtonSpecManagerDraw : ButtonSpecManagerBase
/// Delegate for returning a tool strip renderer.
/// Delegate for notifying paint requests.
public ButtonSpecManagerDraw(Control control,
- [DisallowNull] PaletteRedirect? redirector,
+ [DisallowNull] PaletteRedirect redirector,
ButtonSpecCollectionBase? variableSpecs,
ButtonSpecCollectionBase? fixedSpecs,
- ViewDrawDocker[] viewDockers,
+ [DisallowNull] ViewDrawDocker[] viewDockers,
IPaletteMetric[] viewMetrics,
PaletteMetricInt[] viewMetricInt,
PaletteMetricPadding[] viewMetricPaddings,
@@ -66,7 +66,7 @@ public ButtonSpecManagerDraw(Control control,
/// Delegate for returning a tool strip renderer.
/// Delegate for notifying paint requests.
public ButtonSpecManagerDraw(Control control,
- [DisallowNull] PaletteRedirect? redirector,
+ [DisallowNull] PaletteRedirect redirector,
ButtonSpecCollectionBase? variableSpecs,
ButtonSpecCollectionBase? fixedSpecs,
[DisallowNull] ViewDrawDocker[] viewDockers,
@@ -81,7 +81,7 @@ public ButtonSpecManagerDraw(Control control,
viewMetricPaddings, getRenderer, needPaint)
{
Debug.Assert(viewDockers != null);
- Debug.Assert(viewDockers.Length == viewMetrics.Length);
+ Debug.Assert(viewDockers!.Length == viewMetrics.Length);
Debug.Assert(viewDockers.Length == viewMetricPaddings.Length);
// Remember references
@@ -121,7 +121,7 @@ protected override int DockerIndex(ViewBase viewDocker)
///
/// Index.
/// View docker reference; otherwise null.
- protected override ViewBase? IndexDocker(int i) => _viewDockers[i];
+ protected override ViewBase IndexDocker(int i) => _viewDockers[i];
///
/// Gets the orientation of the docker at the specified index.
@@ -141,15 +141,7 @@ protected override int DockerIndex(ViewBase viewDocker)
ViewDrawDocker viewDocker = _viewDockers[i];
// Find the child that is used to fill docker
- foreach (ViewBase child in viewDocker)
- {
- if (viewDocker.GetDock(child) == ViewDockStyle.Fill)
- {
- return child as ViewDrawContent;
- }
- }
-
- return null;
+ return (from child in viewDocker where viewDocker.GetDock(child) == ViewDockStyle.Fill select child as ViewDrawContent).FirstOrDefault();
}
///
@@ -167,7 +159,7 @@ protected override void AddViewToDocker(int i,
// Get the indexed docker
ViewDrawDocker viewDocker = _viewDockers[i];
- // By default add to the end of the children
+ // By default, add to the end of the children
var insertIndex = viewDocker.Count;
// If using spacers, then insert before the first spacer
diff --git a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecManagerLayout.cs b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecManagerLayout.cs
index b8019a3bc..b05e973d1 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecManagerLayout.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecManagerLayout.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -36,7 +36,7 @@ public class ButtonSpecManagerLayout : ButtonSpecManagerBase
/// Delegate for returning a tool strip renderer.
/// Delegate for notifying paint requests.
public ButtonSpecManagerLayout(Control control,
- [DisallowNull] PaletteRedirect? redirector,
+ PaletteRedirect redirector,
ButtonSpecCollectionBase? variableSpecs,
ButtonSpecCollectionBase? fixedSpecs,
ViewLayoutDocker[] viewDockers,
@@ -66,7 +66,7 @@ public ButtonSpecManagerLayout(Control control,
/// Delegate for returning a tool strip renderer.
/// Delegate for notifying paint requests.
public ButtonSpecManagerLayout(Control control,
- [DisallowNull] PaletteRedirect? redirector,
+ PaletteRedirect redirector,
ButtonSpecCollectionBase? variableSpecs,
ButtonSpecCollectionBase? fixedSpecs,
ViewLayoutDocker[] viewDockers,
diff --git a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecRemapByContentBase.cs b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecRemapByContentBase.cs
index 1c0d66f9e..be0fe0b8d 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecRemapByContentBase.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecRemapByContentBase.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -27,12 +27,12 @@ public abstract class ButtonSpecRemapByContentBase : PaletteRedirect
///
/// Initial palette target for redirection.
/// Reference to button specification.
- protected ButtonSpecRemapByContentBase(PaletteBase? target,
+ protected ButtonSpecRemapByContentBase(PaletteBase target,
[DisallowNull] ButtonSpec buttonSpec)
: base(target)
{
Debug.Assert(buttonSpec != null);
- _buttonSpec = buttonSpec;
+ _buttonSpec = buttonSpec!;
}
#endregion
@@ -63,7 +63,7 @@ public override Color GetContentImageColorMap(PaletteContentStyle style, Palette
Color mapColor = OverrideImageColor(state);
// If a map color provided then return is
- return (mapColor != Color.Empty) && (PaletteContent != null) ? mapColor : base.GetContentImageColorMap(style, state);
+ return (mapColor != GlobalStaticValues.EMPTY_COLOR) && (PaletteContent != null) ? mapColor : base.GetContentImageColorMap(style, state);
}
#endregion
@@ -80,7 +80,7 @@ public override Color GetContentImageColorTo(PaletteContentStyle style, PaletteS
Color mapColor = OverrideImageColor(state);
// If mapping occurring then return the target remap color
- if ((mapColor != Color.Empty) && (PaletteContent != null))
+ if ((mapColor != GlobalStaticValues.EMPTY_COLOR) && (PaletteContent != null))
{
PaletteState getState = PaletteState;
@@ -144,7 +144,7 @@ private Color OverrideImageColor(PaletteState state)
// ReSharper restore RedundantBaseQualifier
// If we are supposed to remap a color
- if (mapColor != Color.Empty)
+ if (mapColor != GlobalStaticValues.EMPTY_COLOR)
{
// ReSharper disable RedundantBaseQualifier
// Get the button style requested
@@ -160,7 +160,7 @@ private Color OverrideImageColor(PaletteState state)
}
}
- return Color.Empty;
+ return GlobalStaticValues.EMPTY_COLOR;
}
private bool OverrideTextColor(PaletteState state)
diff --git a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecRemapByContentCache.cs b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecRemapByContentCache.cs
index 1c13452d0..710b8d2d2 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecRemapByContentCache.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecRemapByContentCache.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -28,7 +28,7 @@ public class ButtonSpecRemapByContentCache : ButtonSpecRemapByContentBase
///
/// Initial palette target for redirection.
/// Reference to button specification.
- public ButtonSpecRemapByContentCache(PaletteBase? 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 7b64966dd..dd2807604 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecRemapByContentView.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecRemapByContentView.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -23,7 +23,7 @@ public class ButtonSpecRemapByContentView : ButtonSpecRemapByContentBase
///
/// Initial palette target for redirection.
/// Reference to button specification.
- public ButtonSpecRemapByContentView(PaletteBase? target,
+ public ButtonSpecRemapByContentView(PaletteBase target,
[DisallowNull] 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 34eb0f087..08257297f 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecToContent.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecToContent.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -19,7 +19,7 @@ public class ButtonSpecToContent : IContentValues
{
#region Instance Fields
private readonly ButtonSpec _buttonSpec;
- private readonly PaletteBase? _palette;
+ private readonly PaletteBase _palette;
#endregion
#region Identity
@@ -28,13 +28,13 @@ public class ButtonSpecToContent : IContentValues
///
/// Palette for sourcing information.
/// Source button spec instance.
- public ButtonSpecToContent([DisallowNull] PaletteBase? palette,
+ public ButtonSpecToContent([DisallowNull] PaletteBase palette,
[DisallowNull] ButtonSpec buttonSpec)
{
Debug.Assert(palette != null);
Debug.Assert(buttonSpec != null);
- _palette = palette;
- _buttonSpec = buttonSpec;
+ _palette = palette!;
+ _buttonSpec = buttonSpec!;
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecView.cs b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecView.cs
index 4f5c7f14a..a39d47475 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecView.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecView.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -35,7 +35,7 @@ public class ButtonSpecView : GlobalId,
/// Reference to owning manager.
/// Access
public ButtonSpecView([DisallowNull] PaletteRedirect redirector,
- IPaletteMetric? paletteMetric,
+ IPaletteMetric paletteMetric,
PaletteMetricPadding metricPadding,
[DisallowNull] ButtonSpecManagerBase manager,
[DisallowNull] ButtonSpec buttonSpec)
@@ -55,7 +55,7 @@ public ButtonSpecView([DisallowNull] PaletteRedirect redirector,
// Intercept calls from the button for color remapping and instead use
// the button spec defined map and the container foreground color
- RemapPalette = Manager.CreateButtonSpecRemap(redirector, ButtonSpec);
+ RemapPalette = Manager.CreateButtonSpecRemap(redirector!, ButtonSpec);
// Use a redirector to get button values directly from palette
_palette = new PaletteTripleRedirect(RemapPalette,
@@ -126,21 +126,12 @@ public ButtonSpecView([DisallowNull] PaletteRedirect redirector,
///
/// Gets access to the view centering that contains the button.
///
- public ViewDrawButton? ViewButton { get; }
+ public ViewDrawButton ViewButton { get; }
///
/// Gets access to the remapping palette.
///
- public PaletteRedirect? RemapPalette { get; }
-
- ///
- /// Gets and sets the composition setting for the button.
- ///
- public bool DrawButtonSpecOnComposition
- {
- get => ViewButton?.DrawButtonComposition ?? false;
- set => ViewButton!.DrawButtonComposition = value;
- }
+ public PaletteRedirect RemapPalette { get; }
///
/// Requests a repaint and optional layout be performed.
@@ -197,23 +188,21 @@ public bool UpdateEnabled()
Debug.Assert(false);
newDependent = null;
newEnabled = false;
+ DebugTools.NotImplemented(ButtonSpec.GetEnabled(_redirector).ToString());
break;
}
// Only make change if the values have changed
- if (ViewButton != null)
+ if (newEnabled != ViewButton.Enabled)
{
- if (newEnabled != ViewButton.Enabled)
- {
- ViewButton.Enabled = newEnabled;
- changed = true;
- }
+ ViewButton.Enabled = newEnabled;
+ changed = true;
+ }
- if (newDependent != ViewButton.DependantEnabledState)
- {
- ViewButton.DependantEnabledState = newDependent;
- changed = true;
- }
+ if (newDependent != ViewButton.DependantEnabledState)
+ {
+ ViewButton.DependantEnabledState = newDependent;
+ changed = true;
}
return changed;
@@ -241,11 +230,12 @@ public bool UpdateChecked()
// Should never happen!
Debug.Assert(false);
newChecked = false;
+ DebugTools.NotImplemented(ButtonSpec.GetChecked(_redirector).ToString());
break;
}
// Only make change if the value has changed
- if (ViewButton != null && newChecked != ViewButton.Checked)
+ if (newChecked != ViewButton.Checked)
{
ViewButton.Checked = newChecked;
return true;
@@ -261,8 +251,7 @@ public bool UpdateChecked()
///
public void UpdateShowDrop()
{
- if (ButtonSpec is ButtonSpecAny buttonSpecAny
- && ViewButton != null)
+ if (ButtonSpec is ButtonSpecAny buttonSpecAny)
{
ViewButton.DropDown = buttonSpecAny.ShowDrop;
ViewButton.Splitter = buttonSpecAny.ShowDrop;
@@ -278,7 +267,7 @@ public void Destruct()
ButtonSpec.ButtonSpecPropertyChanged -= OnPropertyChanged;
// Remove ButtonSpec/view association
- ButtonSpec.SetView(null);
+ ButtonSpec.SetView(null!);
// Remove all view element resources
ViewCenter.Dispose();
@@ -320,7 +309,7 @@ public virtual ButtonSpecViewControllers CreateController(ViewDrawButton viewBut
///
/// Source of the event.
/// An EventArgs that contains the event data.
- protected virtual void OnFinishDelegate(object sender, EventArgs? e) =>
+ protected virtual void OnFinishDelegate(object? sender, EventArgs? e) =>
// Ask the button to remove the fixed pressed appearance
_controller?.RemoveFixed();
@@ -373,19 +362,16 @@ public string GetLongText() =>
#region Implementation
- private void OnClick(object sender, MouseEventArgs e)
+ private void OnClick(object? sender, MouseEventArgs e)
{
var performFinishDelegate = true;
// Never show a context menu in design mode
if (!CommonHelper.DesignMode(Manager.Control))
{
- var showMenu = false;
- var performDefaultClick = true;
- if (ButtonSpec is ButtonSpecAny { ShowDrop: true })
- {
- showMenu = ViewButton?.SplitRectangle.Contains(e.Location) ?? false;
- performDefaultClick = !showMenu;
- }
+ // ButtonSpec's used to drop menu's if they had a context menu;
+ // BUT; Disable default action, if this is a drop button and it is clicked
+ bool performDefaultClick = !(ButtonSpec is ButtonSpecAny { ShowDrop: true }
+ && ViewButton.SplitRectangle.Contains(e.Location));
if (performDefaultClick)
{
@@ -393,45 +379,42 @@ private void OnClick(object sender, MouseEventArgs e)
ButtonSpec.PerformClick(e);
}
- if (showMenu)
+ // Does the button spec define a krypton context menu?
+ if (ButtonSpec.KryptonContextMenu != null)
{
- // Does the button spec define a krypton context menu?
- if ((ButtonSpec.KryptonContextMenu != null) && (ViewButton != null))
+ performFinishDelegate = false;
+ // Convert from control coordinates to screen coordinates
+ Rectangle rect = ViewButton.ClientRectangle;
+
+ // If the button spec is on the chrome titlebar then find position manually
+ Point pt = Manager.Control is Form form
+ ? new Point(form.Left + rect.Left, form.Top + rect.Bottom + 3)
+ : Manager.Control!.PointToScreen(new Point(rect.Left, rect.Bottom + 3));
+
+ // Show the context menu just below the view itself
+ ButtonSpec.KryptonContextMenu.Closed += OnKryptonContextMenuClosed;
+ if (!ButtonSpec.KryptonContextMenu.Show(ButtonSpec, pt))
{
- performFinishDelegate = false;
- // Convert from control coordinates to screen coordinates
- Rectangle rect = ViewButton.ClientRectangle;
-
- // If the button spec is on the chrome titlebar then find position manually
- Point pt = Manager.Control is Form
- ? new Point(Manager.Control.Left + rect.Left, Manager.Control.Top + rect.Bottom + 3)
- : Manager.Control!.PointToScreen(new Point(rect.Left, rect.Bottom + 3));
-
- // Show the context menu just below the view itself
- ButtonSpec.KryptonContextMenu.Closed += OnKryptonContextMenuClosed;
- if (!ButtonSpec.KryptonContextMenu.Show(ButtonSpec, pt))
- {
- // Menu not being shown, so clean up
- ButtonSpec.KryptonContextMenu.Closed -= OnKryptonContextMenuClosed;
-
- // Not showing a context menu, so remove the fixed view immediately
- _finishDelegate?.Invoke(this, EventArgs.Empty);
- }
+ // Menu not being shown, so clean up
+ ButtonSpec.KryptonContextMenu.Closed -= OnKryptonContextMenuClosed;
+
+ // Not showing a context menu, so remove the fixed view immediately
+ _finishDelegate?.Invoke(this, EventArgs.Empty);
}
- else if ((ButtonSpec.ContextMenuStrip != null) && (ViewButton != null))
- {
- performFinishDelegate = false;
- // Set the correct renderer for the menu strip
- ButtonSpec.ContextMenuStrip.Renderer = Manager.RenderToolStrip();
+ }
+ else if (ButtonSpec.ContextMenuStrip != null)
+ {
+ performFinishDelegate = false;
+ // Set the correct renderer for the menu strip
+ ButtonSpec.ContextMenuStrip.Renderer = Manager.RenderToolStrip();
- // Convert from control coordinates to screen coordinates
- Rectangle rect = ViewButton.ClientRectangle;
- Point pt = Manager.Control!.PointToScreen(new Point(rect.Left, rect.Bottom + 3));
+ // Convert from control coordinates to screen coordinates
+ Rectangle rect = ViewButton.ClientRectangle;
+ Point pt = Manager.Control!.PointToScreen(new Point(rect.Left, rect.Bottom + 3));
- // Show the context menu just below the view itself
- VisualPopupManager.Singleton.ShowContextMenuStrip(ButtonSpec.ContextMenuStrip, pt,
- _finishDelegate);
- }
+ // Show the context menu just below the view itself
+ VisualPopupManager.Singleton.ShowContextMenuStrip(ButtonSpec.ContextMenuStrip, pt,
+ _finishDelegate);
}
}
@@ -442,10 +425,10 @@ private void OnClick(object sender, MouseEventArgs e)
}
}
- private void OnKryptonContextMenuClosed(object sender, ToolStripDropDownClosedEventArgs e)
+ private void OnKryptonContextMenuClosed(object? sender, ToolStripDropDownClosedEventArgs e)
{
- // Unhook from context menu event so it could garbage collected in the future
- var kcm = (KryptonContextMenu)sender;
+ // Unhook from context menu event, so that it can garbage collected in the future
+ var kcm = sender as KryptonContextMenu ?? throw new ArgumentNullException(nameof(sender));
kcm.Closed -= OnKryptonContextMenuClosed;
// Remove the fixed button appearance
@@ -454,7 +437,7 @@ private void OnKryptonContextMenuClosed(object sender, ToolStripDropDownClosedEv
private void OnNeedPaint(object? sender, NeedLayoutEventArgs e) => PerformNeedPaint(e.NeedLayout);
- private void OnPropertyChanged(object sender, PropertyChangedEventArgs e)
+ private void OnPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
switch (e.PropertyName)
{
diff --git a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecViewControllers.cs b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecViewControllers.cs
index 173e36e11..0c538f0ee 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecViewControllers.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecViewControllers.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuCheckBox.cs b/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuCheckBox.cs
index 8a0528975..7073feda3 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuCheckBox.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuCheckBox.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -29,7 +29,6 @@ public class KryptonContextMenuCheckBox : KryptonContextMenuItemBase
private bool _autoClose;
private bool _checked;
private bool _enabled;
- private string _text;
private string? _extraText;
private Image? _image;
private Color _imageTransparentColor;
@@ -83,7 +82,7 @@ public KryptonContextMenuCheckBox(string initialText)
_text = initialText;
_extraText = string.Empty;
_image = null;
- _imageTransparentColor = Color.Empty;
+ _imageTransparentColor = GlobalStaticValues.EMPTY_COLOR;
_checkState = CheckState.Unchecked;
_checked = false;
_threeState = false;
@@ -167,7 +166,7 @@ public bool AutoClose
{
get => _autoClose;
- set
+ set
{
if (_autoClose != value)
{
@@ -185,18 +184,10 @@ public bool AutoClose
[Description(@"Main check box text.")]
[DefaultValue(nameof(CheckBox))]
[Localizable(true)]
- public string Text
+ public override string Text
{
- get => _text;
-
- set
- {
- if (_text != value)
- {
- _text = value;
- OnPropertyChanged(new PropertyChangedEventArgs(nameof(Text)));
- }
- }
+ get => base.Text;
+ set => base.Text = value;
}
///
@@ -212,7 +203,7 @@ public string ExtraText
{
get => _extraText ?? string.Empty;
- set
+ set
{
if (_extraText != value)
{
@@ -234,7 +225,7 @@ public Image? Image
{
get => _image;
- set
+ set
{
if (_image != value)
{
@@ -251,12 +242,11 @@ public Image? Image
[Category(@"Appearance")]
[Description(@"Check box image color to make transparent.")]
[Localizable(true)]
- [DisallowNull]
public Color ImageTransparentColor
{
get => _imageTransparentColor;
- set
+ set
{
if (_imageTransparentColor != value)
{
@@ -266,7 +256,7 @@ public Color ImageTransparentColor
}
}
- private bool ShouldSerializeImageTransparentColor() => !_imageTransparentColor.Equals(Color.Empty);
+ private bool ShouldSerializeImageTransparentColor() => !_imageTransparentColor.Equals(GlobalStaticValues.EMPTY_COLOR);
///
/// Gets and sets the check box label style.
@@ -316,7 +306,7 @@ public bool Enabled
{
get => _enabled;
- set
+ set
{
if (_enabled != value)
{
@@ -399,7 +389,7 @@ public bool AutoCheck
{
get => _autoCheck;
- set
+ set
{
if (_autoCheck != value)
{
@@ -420,7 +410,7 @@ public bool ThreeState
{
get => _threeState;
- set
+ set
{
if (_threeState != value)
{
@@ -536,10 +526,10 @@ protected virtual void OnClick(EventArgs e)
internal PaletteRedirectCheckBox? StateCheckBoxImages { get; }
- internal void SetPaletteRedirect(PaletteRedirect? redirector)
+ internal void SetPaletteRedirect(PaletteRedirect redirector)
{
_stateCommonRedirect.SetRedirector(redirector);
- StateCheckBoxImages.Target = redirector;
+ StateCheckBoxImages!.Target = redirector;
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuCheckButton.cs b/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuCheckButton.cs
index c39bbd1f5..9fd72c11e 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuCheckButton.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuCheckButton.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -28,7 +28,6 @@ public class KryptonContextMenuCheckButton : KryptonContextMenuItemBase
private bool _autoClose;
private bool _checked;
private bool _enabled;
- private string _text;
private string _extraText;
private Image? _image;
private Color _imageTransparentColor;
@@ -73,7 +72,7 @@ public KryptonContextMenuCheckButton(string initialText)
_text = initialText;
_extraText = string.Empty;
_image = null;
- _imageTransparentColor = Color.Empty;
+ _imageTransparentColor = GlobalStaticValues.EMPTY_COLOR;
_checked = false;
_autoCheck = false;
_style = ButtonStyle.Standalone;
@@ -179,18 +178,10 @@ public bool AutoClose
[Description(@"Main check box text.")]
[DefaultValue(nameof(CheckBox))]
[Localizable(true)]
- public string Text
+ public override string Text
{
- get => _text;
-
- set
- {
- if (_text != value)
- {
- _text = value;
- OnPropertyChanged(new PropertyChangedEventArgs(nameof(Text)));
- }
- }
+ get => base.Text;
+ set => base.Text = value;
}
///
@@ -258,7 +249,7 @@ public Color ImageTransparentColor
}
}
- private bool ShouldSerializeImageTransparentColor() => (_imageTransparentColor == null) || !_imageTransparentColor.Equals(Color.Empty);
+ private bool ShouldSerializeImageTransparentColor() => (_imageTransparentColor == null) || !_imageTransparentColor.Equals(GlobalStaticValues.EMPTY_COLOR);
///
/// Gets and sets the check button style.
@@ -511,7 +502,7 @@ protected virtual void OnClick(EventArgs e)
internal PaletteTripleOverride OverridePressed { get; }
- internal void SetPaletteRedirect(PaletteRedirect? redirector)
+ internal void SetPaletteRedirect(PaletteRedirect redirector)
{
StateCommon.SetRedirector(redirector);
OverrideFocus.SetRedirector(redirector);
diff --git a/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuCollections.cs b/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuCollections.cs
index c38ca3672..cffa02799 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuCollections.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuCollections.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -19,16 +19,19 @@ namespace Krypton.Toolkit
public class KryptonContextMenuCollection : TypedRestrictCollection
{
#region Static Fields
- private static readonly Type[] _types = { typeof(KryptonContextMenuItems),
- typeof(KryptonContextMenuSeparator),
- typeof(KryptonContextMenuHeading),
- typeof(KryptonContextMenuLinkLabel),
- typeof(KryptonContextMenuCheckBox),
- typeof(KryptonContextMenuCheckButton),
- typeof(KryptonContextMenuRadioButton),
- typeof(KryptonContextMenuColorColumns),
- typeof(KryptonContextMenuMonthCalendar),
- typeof(KryptonContextMenuImageSelect)};
+ private static readonly Type[] _types = [
+ typeof(KryptonContextMenuItems),
+ typeof(KryptonContextMenuItem),
+ typeof(KryptonContextMenuSeparator),
+ typeof(KryptonContextMenuHeading),
+ typeof(KryptonContextMenuLinkLabel),
+ typeof(KryptonContextMenuCheckBox),
+ typeof(KryptonContextMenuCheckButton),
+ typeof(KryptonContextMenuRadioButton),
+ typeof(KryptonContextMenuColorColumns),
+ typeof(KryptonContextMenuMonthCalendar),
+ typeof(KryptonContextMenuImageSelect)
+ ];
#endregion
#region Restrict
@@ -137,7 +140,7 @@ protected override void OnRemoving(TypedCollectionEventArgs
{
#region Static Fields
- private static readonly Type[] _types = { typeof(KryptonContextMenuItem),
- typeof(KryptonContextMenuSeparator),
- typeof(KryptonContextMenuHeading) };
+ private static readonly Type[] _types =
+ [
+ typeof(KryptonContextMenuItems),
+ typeof(KryptonContextMenuItem),
+ typeof(KryptonContextMenuSeparator),
+ typeof(KryptonContextMenuHeading),
+ typeof(KryptonContextMenuLinkLabel),
+ typeof(KryptonContextMenuCheckBox),
+ typeof(KryptonContextMenuCheckButton),
+ typeof(KryptonContextMenuRadioButton),
+ typeof(KryptonContextMenuColorColumns),
+ typeof(KryptonContextMenuMonthCalendar),
+ typeof(KryptonContextMenuImageSelect)
+ ];
#endregion
#region Restrict
diff --git a/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuColorColumns.cs b/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuColorColumns.cs
index c0cdad971..3f159b362 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuColorColumns.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuColorColumns.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -27,48 +27,73 @@ public class KryptonContextMenuColorColumns : KryptonContextMenuItemBase
private static readonly Color[][] _noneScheme = Array.Empty();
- private static readonly Color[][] _mono2Scheme = { new[] { Color.White },
- new[] { Color.Black } };
-
- private static readonly Color[][] _mono8Scheme = { new[] { Color.White },
- new[] { Color.Silver },
- new[] { Color.FromArgb(160, 160, 160) },
- new[] { Color.Gray },
- new[] { Color.FromArgb( 96, 96, 96) },
- new[] { Color.FromArgb( 64, 64, 64) },
- new[] { Color.FromArgb( 32, 32, 32) },
- new[] { Color.Black }};
-
- private static readonly Color[][] _basic16Scheme = { new[] { Color.White, Color.Black },
- new[] { Color.Silver, Color.Gray },
- new[] { Color.Red, Color.Maroon },
- new[] { Color.Yellow, Color.Olive },
- new[] { Color.Lime, Color.Green },
- new[] { Color.Cyan, Color.Teal },
- new[] { Color.Blue, Color.Navy },
- new[] { Color.Fuchsia, Color.Purple } };
-
- private static readonly Color[][] _officeStandardScheme = { new[] { Color.FromArgb(192, 0, 0) },
- new[] { Color.Red },
- new[] { Color.FromArgb(255, 192, 0) },
- new[] { Color.Yellow },
- new[] { Color.FromArgb(146, 208, 80) },
- new[] { Color.FromArgb( 0, 176, 80) },
- new[] { Color.FromArgb( 0, 176, 240) },
- new[] { Color.FromArgb( 0, 112, 192) },
- new[] { Color.FromArgb( 0, 32, 96) },
- new[] { Color.FromArgb(112, 48, 160) } };
+ private static readonly Color[][] _mono2Scheme =
+ [
+ [Color.White],
+ [Color.Black]
+ ];
+
+ private static readonly Color[][] _mono8Scheme =
+ [
+ [Color.White],
+ [Color.Silver],
+ [Color.FromArgb(160, 160, 160)],
+ [Color.Gray],
+ [Color.FromArgb( 96, 96, 96)],
+ [Color.FromArgb( 64, 64, 64)],
+ [Color.FromArgb( 32, 32, 32)],
+ [Color.Black]
+ ];
+
+ private static readonly Color[][] _basic16Scheme =
+ [
+ [Color.White, Color.Black],
+ [Color.Silver, Color.Gray],
+ [Color.Red, Color.Maroon],
+ [Color.Yellow, Color.Olive],
+ [Color.Lime, Color.Green],
+ [Color.Cyan, Color.Teal],
+ [Color.Blue, Color.Navy],
+ [Color.Fuchsia, Color.Purple]
+ ];
+
+ private static readonly Color[][] _officeStandardScheme =
+ [
+ [Color.FromArgb(192, 0, 0)],
+ [Color.Red],
+ [Color.FromArgb(255, 192, 0)],
+ [Color.Yellow],
+ [Color.FromArgb(146, 208, 80)],
+ [Color.FromArgb( 0, 176, 80)],
+ [Color.FromArgb( 0, 176, 240)],
+ [Color.FromArgb( 0, 112, 192)],
+ [Color.FromArgb( 0, 32, 96)],
+ [Color.FromArgb(112, 48, 160)]
+ ];
- private static readonly Color[][] _officeThemeScheme = { new[] { Color.White, Color.FromArgb(242, 242, 242), Color.FromArgb(216, 216, 216), Color.FromArgb(191, 191, 191), Color.FromArgb(165, 165, 165), Color.Gray },
- new[] { Color.Black, Color.FromArgb(127, 127, 127), Color.FromArgb( 89, 89, 89), Color.FromArgb( 63, 63, 63), Color.FromArgb( 38, 38, 38), Color.FromArgb( 12, 12, 12) },
- new[] { Color.FromArgb(238, 236, 225), Color.FromArgb(221, 217, 195), Color.FromArgb(196, 189, 151), Color.FromArgb(147, 137, 83), Color.FromArgb( 73, 68, 41), Color.FromArgb( 29, 27, 16) },
- new[] { Color.FromArgb( 31, 73, 125), Color.FromArgb(198, 217, 240), Color.FromArgb(141, 179, 226), Color.FromArgb( 84, 141, 212), Color.FromArgb( 23, 54, 93), Color.FromArgb( 15, 36, 62) },
- new[] { Color.FromArgb( 79, 129, 189), Color.FromArgb(219, 229, 241), Color.FromArgb(184, 204, 228), Color.FromArgb(149, 179, 215), Color.FromArgb( 54, 96, 146), Color.FromArgb( 36, 64, 97) },
- new[] { Color.FromArgb(192, 80, 77), Color.FromArgb(242, 220, 219), Color.FromArgb(229, 185, 183), Color.FromArgb(217, 150, 148), Color.FromArgb(149, 55, 52), Color.FromArgb( 99, 36, 35) },
- new[] { Color.FromArgb(155, 187, 89), Color.FromArgb(235, 241, 221), Color.FromArgb(215, 227, 188), Color.FromArgb(195, 214, 155), Color.FromArgb(118, 146, 60), Color.FromArgb( 79, 97, 40) },
- new[] { Color.FromArgb(128, 100, 162), Color.FromArgb(229, 224, 236), Color.FromArgb(204, 193, 217), Color.FromArgb(178, 162, 199), Color.FromArgb( 95, 73, 122), Color.FromArgb( 63, 49, 81) },
- new[] { Color.FromArgb( 75, 172, 198), Color.FromArgb(219, 238, 243), Color.FromArgb(183, 221, 232), Color.FromArgb(146, 205, 220), Color.FromArgb( 49, 133, 155), Color.FromArgb( 32, 88, 103) },
- new[] { Color.FromArgb(247, 150, 70), Color.FromArgb(253, 234, 218), Color.FromArgb(251, 213, 181), Color.FromArgb(250, 192, 143), Color.FromArgb(227, 108, 9), Color.FromArgb(151, 72, 6) } };
+ private static readonly Color[][] _officeThemeScheme =
+ [
+ [Color.White, Color.FromArgb(242, 242, 242), Color.FromArgb(216, 216, 216), Color.FromArgb(191, 191, 191), Color.FromArgb(165, 165, 165), Color.Gray
+ ],
+ [Color.Black, Color.FromArgb(127, 127, 127), Color.FromArgb( 89, 89, 89), Color.FromArgb( 63, 63, 63), Color.FromArgb( 38, 38, 38), Color.FromArgb( 12, 12, 12)
+ ],
+ [Color.FromArgb(238, 236, 225), Color.FromArgb(221, 217, 195), Color.FromArgb(196, 189, 151), Color.FromArgb(147, 137, 83), Color.FromArgb( 73, 68, 41), Color.FromArgb( 29, 27, 16)
+ ],
+ [Color.FromArgb( 31, 73, 125), Color.FromArgb(198, 217, 240), Color.FromArgb(141, 179, 226), Color.FromArgb( 84, 141, 212), Color.FromArgb( 23, 54, 93), Color.FromArgb( 15, 36, 62)
+ ],
+ [Color.FromArgb( 79, 129, 189), Color.FromArgb(219, 229, 241), Color.FromArgb(184, 204, 228), Color.FromArgb(149, 179, 215), Color.FromArgb( 54, 96, 146), Color.FromArgb( 36, 64, 97)
+ ],
+ [Color.FromArgb(192, 80, 77), Color.FromArgb(242, 220, 219), Color.FromArgb(229, 185, 183), Color.FromArgb(217, 150, 148), Color.FromArgb(149, 55, 52), Color.FromArgb( 99, 36, 35)
+ ],
+ [Color.FromArgb(155, 187, 89), Color.FromArgb(235, 241, 221), Color.FromArgb(215, 227, 188), Color.FromArgb(195, 214, 155), Color.FromArgb(118, 146, 60), Color.FromArgb( 79, 97, 40)
+ ],
+ [Color.FromArgb(128, 100, 162), Color.FromArgb(229, 224, 236), Color.FromArgb(204, 193, 217), Color.FromArgb(178, 162, 199), Color.FromArgb( 95, 73, 122), Color.FromArgb( 63, 49, 81)
+ ],
+ [Color.FromArgb( 75, 172, 198), Color.FromArgb(219, 238, 243), Color.FromArgb(183, 221, 232), Color.FromArgb(146, 205, 220), Color.FromArgb( 49, 133, 155), Color.FromArgb( 32, 88, 103)
+ ],
+ [Color.FromArgb(247, 150, 70), Color.FromArgb(253, 234, 218), Color.FromArgb(251, 213, 181), Color.FromArgb(250, 192, 143), Color.FromArgb(227, 108, 9), Color.FromArgb(151, 72, 6)
+ ]
+ ];
#endregion
#region Instance Fields
@@ -112,7 +137,7 @@ public KryptonContextMenuColorColumns(ColorScheme scheme)
{
// Default fields
_autoClose = true;
- _selectedColor = Color.Empty;
+ _selectedColor = GlobalStaticValues.EMPTY_COLOR;
_groupNonFirstRows = true;
_blockSize = new Size(13, 13);
SetColorScheme(scheme);
diff --git a/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuComboBox.cs b/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuComboBox.cs
index 6225d2a9c..74b5215a4 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuComboBox.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuComboBox.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuHeading.cs b/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuHeading.cs
index f997b9170..f3a05308f 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuHeading.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuHeading.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -24,11 +24,10 @@ namespace Krypton.Toolkit
public class KryptonContextMenuHeading : KryptonContextMenuItemBase
{
#region Instance Fields
- private string _text;
private string? _extraText;
private Image? _image;
private Color _imageTransparentColor;
- private readonly PaletteRedirectTriple? _redirectHeading;
+ private readonly PaletteRedirectTriple _redirectHeading;
#endregion
///
@@ -55,10 +54,9 @@ public KryptonContextMenuHeading()
public KryptonContextMenuHeading(string initialText)
{
// Default fields
- _text = initialText;
_extraText = string.Empty;
_image = null;
- _imageTransparentColor = Color.Empty;
+ _imageTransparentColor = GlobalStaticValues.EMPTY_COLOR;
// Create the redirector that can get values from the krypton context menu
_redirectHeading = new PaletteRedirectTriple();
@@ -141,18 +139,10 @@ public override ViewBase GenerateView(IContextMenuProvider provider,
[Editor(typeof(MultilineStringEditor), typeof(UITypeEditor))]
[Localizable(true)]
[DefaultValue(@"Heading")]
- public string Text
+ public override string Text
{
- get => _text;
-
- set
- {
- if (_text != value)
- {
- _text = value;
- OnPropertyChanged(new PropertyChangedEventArgs(nameof(Text)));
- }
- }
+ get => base.Text;
+ set => base.Text = value;
}
///
@@ -222,7 +212,7 @@ public Color ImageTransparentColor
}
}
- private bool ShouldSerializeImageTransparentColor() => (_imageTransparentColor == null) || !_imageTransparentColor.Equals(Color.Empty);
+ private bool ShouldSerializeImageTransparentColor() => (_imageTransparentColor == null) || !_imageTransparentColor.Equals(GlobalStaticValues.EMPTY_COLOR);
///
/// Gets access to the header instance specific appearance values.
diff --git a/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuImageSelect.cs b/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuImageSelect.cs
index 44f840504..d5bf6c021 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuImageSelect.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuImageSelect.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -146,7 +146,7 @@ public Padding Padding
{
get => _padding;
- set
+ set
{
if (_padding != value)
{
@@ -336,8 +336,8 @@ internal int TrackingIndex
{
get => _trackingIndex;
- set
- {
+ set
+ {
if (_trackingIndex != value)
{
_trackingIndex = value;
@@ -352,7 +352,7 @@ internal int TrackingIndex
#endregion
#region Implementation
- private void OnTrackingTick(object sender, EventArgs e)
+ private void OnTrackingTick(object? sender, EventArgs e)
{
// If no change in tracking index over last interval
if (_trackingIndex == _cacheTrackingIndex)
diff --git a/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuItem.cs b/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuItem.cs
index c43497fce..216ec9bb2 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuItem.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuItem.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -31,7 +31,6 @@ public class KryptonContextMenuItem : KryptonContextMenuItemBase
private bool _showShortcutKeys;
private bool _autoClose;
private bool _largeKryptonCommandImage;
- private string _text;
private string _extraText;
private string _shortcutKeyDisplayString;
private Image? _image;
@@ -150,11 +149,11 @@ public KryptonContextMenuItem(string initialText,
_showShortcutKeys = true;
_largeKryptonCommandImage = false;
_extraText = string.Empty;
- _imageTransparentColor = Color.Empty;
+ _imageTransparentColor = GlobalStaticValues.EMPTY_COLOR;
_shortcutKeys = shortcut;
_shortcutKeyDisplayString = string.Empty;
_checkState = CheckState.Unchecked;
- Items = new KryptonContextMenuCollection();
+ Items = [];
// Create the common storage for palette override values
_stateRedirect = new PaletteContextMenuItemStateRedirect();
@@ -231,18 +230,10 @@ public override ViewBase GenerateView(IContextMenuProvider provider,
[DefaultValue(@"MenuItem")]
[Localizable(true)]
[Bindable(true)]
- public string Text
+ public override string Text
{
- get => _text;
-
- set
- {
- if (_text != value)
- {
- _text = value;
- OnPropertyChanged(new PropertyChangedEventArgs(nameof(Text)));
- }
- }
+ get => base.Text;
+ set => base.Text = value;
}
///
@@ -314,8 +305,8 @@ public Color ImageTransparentColor
}
}
- private bool ShouldSerializeImageTransparentColor() => !_imageTransparentColor.Equals(Color.Empty);
- private void ResetImageTransparentColor() => _imageTransparentColor = Color.Empty;
+ private bool ShouldSerializeImageTransparentColor() => !_imageTransparentColor.Equals(GlobalStaticValues.EMPTY_COLOR);
+ private void ResetImageTransparentColor() => _imageTransparentColor = GlobalStaticValues.EMPTY_COLOR;
///
/// Gets and sets the shortcut key combination associated with the menu item.
diff --git a/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuItemBase.cs b/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuItemBase.cs
index 1b9675bab..7465e78d5 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuItemBase.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuItemBase.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,10 +20,11 @@ public abstract class KryptonContextMenuItemBase : Component, INotifyPropertyCha
{
#region Instance Fields
+ private protected string _text;
private bool _visible;
- private ToolTipValues _toolTipValues = new ToolTipValues(null);
+ private ToolTipValues _toolTipValues = new(null);
private VisualPopupToolTip? _visualPopupToolTip;
- private IContextMenuProvider _provider;
+ private IContextMenuProvider? _provider;
#endregion
#region Events
@@ -48,6 +49,7 @@ public abstract class KryptonContextMenuItemBase : Component, INotifyPropertyCha
///
protected KryptonContextMenuItemBase()
{
+ _text = string.Empty;
_visible = true;
ToolTipManager = new ToolTipManager(_toolTipValues);
ToolTipManager.ShowToolTip += OnShowToolTip;
@@ -138,6 +140,25 @@ public bool Visible
}
}
+ ///
+ /// Gets and sets the standard menu item text.
+ ///
+ [Browsable(false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public virtual string Text
+ {
+ get => _text;
+
+ set
+ {
+ if (_text != value)
+ {
+ _text = value;
+ OnPropertyChanged(new PropertyChangedEventArgs(nameof(Text)));
+ }
+ }
+ }
+
///
/// Gets access to the ToolTipValues content.
///
@@ -181,9 +202,9 @@ public ToolTipValues ToolTipValues
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- internal ToolTipManager ToolTipManager { get; }
+ internal ToolTipManager? ToolTipManager { get; }
- internal void OnShowToolTip(object sender, ToolTipEventArgs e)
+ internal void OnShowToolTip(object? sender, ToolTipEventArgs e)
{
//if (!IsDisposed)
{
@@ -219,29 +240,31 @@ internal void OnShowToolTip(object sender, ToolTipEventArgs e)
_toolTipValues.Image = args.Icon;
// Create the actual tooltip popup object
- var renderer = _provider.ProviderRedirector.Target?.GetRenderer();
- _visualPopupToolTip = new VisualPopupToolTip(_provider.ProviderRedirector,
- _toolTipValues,
- renderer,
- PaletteBackStyle.ControlToolTip,
- PaletteBorderStyle.ControlToolTip,
- CommonHelper.ContentStyleFromLabelStyle(_toolTipValues.ToolTipStyle),
- _toolTipValues.ToolTipShadow);
-
- _visualPopupToolTip.Disposed += OnVisualPopupToolTipDisposed;
- _visualPopupToolTip.ShowRelativeTo(e.Target, e.ControlMousePosition);
+ if (_provider != null)
+ {
+ var renderer = _provider.ProviderRedirector.Target!.GetRenderer();
+ _visualPopupToolTip = new VisualPopupToolTip(_provider.ProviderRedirector,
+ _toolTipValues,
+ renderer,
+ PaletteBackStyle.ControlToolTip,
+ PaletteBorderStyle.ControlToolTip,
+ CommonHelper.ContentStyleFromLabelStyle(_toolTipValues.ToolTipStyle),
+ _toolTipValues.ToolTipShadow);
+ _visualPopupToolTip.Disposed += OnVisualPopupToolTipDisposed;
+ _visualPopupToolTip.ShowRelativeTo(e.Target, e.ControlMousePosition);
+ }
}
}
}
- internal void OnCancelToolTip(object sender, EventArgs e) =>
+ internal void OnCancelToolTip(object? _, EventArgs e) =>
// Remove any currently showing tooltip
_visualPopupToolTip?.Dispose();
- internal void OnVisualPopupToolTipDisposed(object sender, EventArgs e)
+ internal void OnVisualPopupToolTipDisposed(object? sender, EventArgs e)
{
// Unhook events from the specific instance that generated event
- var popupToolTip = (VisualPopupToolTip)sender;
+ var popupToolTip = sender as VisualPopupToolTip ?? throw new ArgumentNullException(nameof(sender));
popupToolTip.Disposed -= OnVisualPopupToolTipDisposed;
// Not showing a popup page any more
diff --git a/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuItems.cs b/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuItems.cs
index 4267df9a2..7371500db 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuItems.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuItems.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -26,7 +26,7 @@ public class KryptonContextMenuItems : KryptonContextMenuItemBase
#region Instance Fields
private bool _standardStyle;
private bool _imageColumn;
- private readonly PaletteRedirectDouble? _redirectImageColumn;
+ private readonly PaletteRedirectDouble _redirectImageColumn;
#endregion
#region Identity
@@ -47,7 +47,7 @@ public KryptonContextMenuItems(KryptonContextMenuItemBase[]? children)
// Default fields
_standardStyle = true;
_imageColumn = true;
- Items = new KryptonContextMenuItemCollection();
+ Items = [];
// Add any initial set of item
if (children != null)
@@ -122,7 +122,7 @@ public override ViewBase GenerateView(IContextMenuProvider provider,
[Category(@"Data")]
[Description(@"Collection of standard menu items.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- [Editor(typeof(KryptonContextMenuItemCollectionEditor), typeof(UITypeEditor))]
+ [Editor(typeof(KryptonContextMenuCollectionEditor), typeof(UITypeEditor))]
public KryptonContextMenuItemCollection Items { get; }
///
@@ -147,7 +147,7 @@ public bool StandardStyle
}
///
- /// Gets and sets if the an image column is provided for background of images.
+ /// Gets and sets if the image column is provided for background of images.
///
[KryptonPersist]
[Category(@"Appearance")]
@@ -181,7 +181,7 @@ public bool ImageColumn
#endregion
#region Internal
- internal void SetPaletteRedirect(PaletteDoubleRedirect? redirector) => _redirectImageColumn?.SetRedirectStates(redirector, redirector);
+ internal void SetPaletteRedirect(PaletteDoubleRedirect redirector) => _redirectImageColumn?.SetRedirectStates(redirector, redirector);
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuLinkLabel.cs b/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuLinkLabel.cs
index 89c919ea1..a93d2d4d4 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuLinkLabel.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuLinkLabel.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -25,7 +25,6 @@ public class KryptonContextMenuLinkLabel : KryptonContextMenuItemBase
{
#region Instance Fields
private bool _autoClose;
- private string _text;
private string? _extraText;
private Image? _image;
private Color _imageTransparentColor;
@@ -69,7 +68,7 @@ public KryptonContextMenuLinkLabel(string initialText)
_text = initialText;
_extraText = string.Empty;
_image = null;
- _imageTransparentColor = Color.Empty;
+ _imageTransparentColor = GlobalStaticValues.EMPTY_COLOR;
_style = LabelStyle.NormalPanel;
_autoClose = true;
@@ -240,18 +239,10 @@ public bool AutoClose
[Description(@"Main link label text.")]
[DefaultValue(nameof(LinkLabel))]
[Localizable(true)]
- public string Text
+ public override string Text
{
- get => _text;
-
- set
- {
- if (_text != value)
- {
- _text = value;
- OnPropertyChanged(new PropertyChangedEventArgs(nameof(Text)));
- }
- }
+ get => base.Text;
+ set => base.Text = value;
}
///
@@ -320,7 +311,7 @@ public Color ImageTransparentColor
}
}
- private bool ShouldSerializeImageTransparentColor() => !_imageTransparentColor.Equals(Color.Empty);
+ private bool ShouldSerializeImageTransparentColor() => !_imageTransparentColor.Equals(GlobalStaticValues.EMPTY_COLOR);
///
/// Gets access to the link label normal instance specific appearance values.
@@ -426,7 +417,7 @@ protected virtual void OnClick(EventArgs e)
internal PaletteContentInheritOverride OverridePressedFocus { get; }
- internal void SetPaletteRedirect(PaletteRedirect? redirector)
+ internal void SetPaletteRedirect(PaletteRedirect redirector)
{
_stateNormalRedirect.SetRedirector(redirector);
_stateVisitedRedirect.SetRedirector(redirector);
diff --git a/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuMonthCalendar.cs b/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuMonthCalendar.cs
index acebf2186..502f80b2e 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuMonthCalendar.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuMonthCalendar.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -116,9 +116,9 @@ public KryptonContextMenuMonthCalendar()
_maxDate = DateTimePicker.MaximumDateTime;
_maxSelectionCount = 7;
AnnuallyBoldedDatesMask = new int[12];
- _annualDates = new DateTimeList();
- _monthlyDates = new DateTimeList();
- BoldedDatesList = new DateTimeList();
+ _annualDates = [];
+ _monthlyDates = [];
+ BoldedDatesList = [];
_today = DEFAULT_TODAY;
_todayFormat = "d";
@@ -307,18 +307,14 @@ public int ScrollChange
[KryptonPersist]
[Category(@"Behavior")]
[Description(@"Today's date.")]
+ [AllowNull]
public DateTime TodayDate
{
get => _todayDate;
set
{
- if (value == null)
- {
- value = DateTime.Now.Date;
- }
-
- _todayDate = value;
+ _todayDate = value == null ? DateTime.Now.Date : value;
OnPropertyChanged(new PropertyChangedEventArgs(nameof(TodayDate)));
}
}
@@ -334,7 +330,7 @@ public DateTime TodayDate
[Localizable(true)]
[Description(@"Indicates which annual dates should be boldface.")]
[AllowNull]
- public DateTime[] AnnuallyBoldedDates
+ public DateTime[]? AnnuallyBoldedDates
{
get => _annualDates.ToArray();
@@ -371,7 +367,7 @@ public DateTime[] AnnuallyBoldedDates
[Localizable(true)]
[Description(@"Indicates which monthly dates should be boldface.")]
[AllowNull]
- public DateTime[] MonthlyBoldedDates
+ public DateTime[]? MonthlyBoldedDates
{
get => _monthlyDates.ToArray();
@@ -404,7 +400,7 @@ public DateTime[] MonthlyBoldedDates
[Localizable(true)]
[Description(@"Indicates which dates should be boldface.")]
[AllowNull]
- public DateTime[] BoldedDates
+ public DateTime[]? BoldedDates
{
get => BoldedDatesList.ToArray();
@@ -676,6 +672,7 @@ public string TodayFormat
[Description(@"Text used as label for todays date.")]
[DefaultValue(@"Today:")]
[Localizable(true)]
+ [AllowNull]
public string TodayText
{
get => _today;
@@ -930,7 +927,7 @@ public ButtonStyle DayOfWeekStyle
[Category(@"Visuals")]
[Description(@"Overrides for defining common month calendar appearance that other states can override.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public PaletteMonthCalendarRedirect? StateCommon { get; }
+ public PaletteMonthCalendarRedirect StateCommon { get; }
private bool ShouldSerializeStateCommon() => !StateCommon.IsDefault;
@@ -1295,7 +1292,7 @@ public void SetFocusOverride(bool focus)
#endregion
#region Internal
- internal void SetPaletteRedirect(PaletteRedirect? redirector)
+ internal void SetPaletteRedirect(PaletteRedirect redirector)
{
StateCommon.SetRedirector(redirector);
OverrideFocus.SetRedirector(redirector);
diff --git a/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuProgressBar.cs b/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuProgressBar.cs
index 72706feca..ca17e8f62 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuProgressBar.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuProgressBar.cs
@@ -1,7 +1,7 @@
#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. 2023 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2024. All rights reserved.
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuRadioButton.cs b/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuRadioButton.cs
index 4b4d8022f..8a6bdf2dc 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuRadioButton.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuRadioButton.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -28,7 +28,6 @@ public class KryptonContextMenuRadioButton : KryptonContextMenuItemBase
private bool _autoClose;
private bool _checked;
private bool _enabled;
- private string _text;
private string? _extraText;
private Image? _image;
private Color _imageTransparentColor;
@@ -74,7 +73,7 @@ public KryptonContextMenuRadioButton(string initialText)
_text = initialText;
_extraText = string.Empty;
_image = null;
- _imageTransparentColor = Color.Empty;
+ _imageTransparentColor = GlobalStaticValues.EMPTY_COLOR;
_checked = false;
_autoCheck = true;
_style = LabelStyle.NormalPanel;
@@ -173,18 +172,10 @@ public bool AutoClose
[Description(@"Main radio button text.")]
[DefaultValue(nameof(RadioButton))]
[Localizable(true)]
- public string Text
+ public override string Text
{
- get => _text;
-
- set
- {
- if (_text != value)
- {
- _text = value;
- OnPropertyChanged(new PropertyChangedEventArgs(nameof(Text)));
- }
- }
+ get => base.Text;
+ set => base.Text = value;
}
///
@@ -238,7 +229,6 @@ public Image? Image
[Category(@"Appearance")]
[Description(@"Radio button image color to make transparent.")]
[Localizable(true)]
- [DisallowNull]
public Color ImageTransparentColor
{
get => _imageTransparentColor;
@@ -253,7 +243,7 @@ public Color ImageTransparentColor
}
}
- private bool ShouldSerializeImageTransparentColor() => !_imageTransparentColor.Equals(Color.Empty);
+ private bool ShouldSerializeImageTransparentColor() => !_imageTransparentColor.Equals(GlobalStaticValues.EMPTY_COLOR);
///
/// Gets and sets the radio button label style.
@@ -456,7 +446,7 @@ protected virtual void OnClick(EventArgs e)
internal PaletteRedirectRadioButton StateRadioButtonImages { get; }
- internal void SetPaletteRedirect(PaletteRedirect? redirector)
+ internal void SetPaletteRedirect(PaletteRedirect redirector)
{
_stateCommonRedirect.SetRedirector(redirector);
StateRadioButtonImages.Target = redirector;
diff --git a/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuSeparator.cs b/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuSeparator.cs
index ad7fc2e53..c7907d576 100644
--- a/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuSeparator.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/ContextMenu/KryptonContextMenuSeparator.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -24,7 +24,7 @@ public class KryptonContextMenuSeparator : KryptonContextMenuItemBase
{
#region Instance Fields
private bool _horizontal;
- private readonly PaletteRedirectDouble? _redirectSeparator;
+ private readonly PaletteRedirectDouble _redirectSeparator;
#endregion
#region Identity
@@ -98,7 +98,7 @@ public override ViewBase GenerateView(IContextMenuProvider provider,
// Take up same space as the image column, so separator starts close to actual text
var imageContent = new ViewDrawContent(provider.ProviderStateCommon.ItemImage.Content,
- new FixedContentValue(null, null, null, Color.Empty), VisualOrientation.Top);
+ new FixedContentValue(null, null, null, GlobalStaticValues.EMPTY_COLOR), VisualOrientation.Top);
var imageCanvas = new ViewDrawMenuImageCanvas(provider.ProviderStateCommon.ItemImage.Back,
provider.ProviderStateCommon.ItemImage.Border, 0, true)
{
@@ -138,7 +138,7 @@ public bool Horizontal
{
get => _horizontal;
- set
+ set
{
if (_horizontal != value)
{
@@ -162,7 +162,7 @@ public bool Horizontal
#endregion
#region Internal
- internal void SetPaletteRedirect(PaletteDoubleRedirect? redirector) => _redirectSeparator.SetRedirectStates(redirector, redirector);
+ internal void SetPaletteRedirect(PaletteDoubleRedirect redirector) => _redirectSeparator?.SetRedirectStates(redirector, redirector);
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controller/ButtonController.cs b/Source/Krypton Components/Krypton.Toolkit/Controller/ButtonController.cs
index fd3c034e7..901d155d5 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controller/ButtonController.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controller/ButtonController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -44,7 +44,7 @@ public class ButtonController : GlobalId,
/// Occurs when the mouse is used to right click the target.
///
public event MouseEventHandler? RightClick;
-
+
///
/// Occurs when the mouse is used to left select the target.
///
@@ -87,10 +87,13 @@ public class ButtonController : GlobalId,
///
/// Target for state changes.
/// Delegate for notifying paint requests.
- public ButtonController([DisallowNull] ViewBase target,
+ public ButtonController(ViewBase target,
NeedPaintHandler needPaint)
{
- Debug.Assert(target != null);
+
+ // Debug.Assert() causes the null assignment warning.
+ // Suppressed by the null forgiving operator
+ Debug.Assert(target is not null);
MousePoint = CommonHelper.NullPoint;
SplitRectangle = CommonHelper.NullRectangle;
@@ -98,7 +101,7 @@ public ButtonController([DisallowNull] ViewBase target,
AllowDragging = false;
_dragging = false;
ClickOnDown = false;
- Target = target;
+ Target = target!;
Repeat = false;
NeedPaint = needPaint;
}
@@ -286,67 +289,67 @@ public virtual bool MouseDown(Control c, Point pt, MouseButtons button)
{
// Only interested in left mouse pressing down
case MouseButtons.Left:
- {
- // Capturing mouse input
- Captured = true;
- _draggingAttempt = false;
+ {
+ // Capturing mouse input
+ Captured = true;
+ _draggingAttempt = false;
// Use event to discover the rectangle that causes dragging to begin
var args = new ButtonDragRectangleEventArgs(pt);
- OnButtonDragRectangle(args);
- _dragRect = args.DragRect;
- _preDragOffset = args.PreDragOffset;
+ OnButtonDragRectangle(args);
+ _dragRect = args.DragRect;
+ _preDragOffset = args.PreDragOffset;
- if (!_fixedPressed)
- {
- // Update the visual state
- UpdateTargetState(pt);
-
- // Do we become fixed in the pressed state until RemoveFixed is called?
- if (BecomesFixed)
+ if (!_fixedPressed)
{
- _fixedPressed = true;
- }
+ // Update the visual state
+ UpdateTargetState(pt);
- // Indicate that the mouse wants to select the elment
- OnMouseSelect(new MouseEventArgs(MouseButtons.Left, 1, pt.X, pt.Y, 0));
+ // Do we become fixed in the pressed state until RemoveFixed is called?
+ if (BecomesFixed)
+ {
+ _fixedPressed = true;
+ }
- // Generate a click event if we generate click on mouse down
- if (ClickOnDown)
- {
- OnClick(new MouseEventArgs(MouseButtons.Left, 1, pt.X, pt.Y, 0));
+ // Indicate that the mouse wants to select the elment
+ OnMouseSelect(new MouseEventArgs(MouseButtons.Left, 1, pt.X, pt.Y, 0));
- // If we need to perform click repeats then use a timer...
- if (Repeat)
+ // Generate a click event if we generate click on mouse down
+ if (ClickOnDown)
{
- _repeatTimer = new System.Windows.Forms.Timer
+ OnClick(new MouseEventArgs(MouseButtons.Left, 1, pt.X, pt.Y, 0));
+
+ // If we need to perform click repeats then use a timer...
+ if (Repeat)
{
- Interval = SystemInformation.DoubleClickTime
- };
- _repeatTimer.Tick += OnRepeatTimer;
- _repeatTimer.Start();
+ _repeatTimer = new System.Windows.Forms.Timer
+ {
+ Interval = SystemInformation.DoubleClickTime
+ };
+ _repeatTimer.Tick += OnRepeatTimer;
+ _repeatTimer.Start();
+ }
}
}
- }
- break;
- }
+ break;
+ }
case MouseButtons.Right:
- {
- if (!_fixedPressed)
{
- // Do we become fixed in the pressed state until RemoveFixed is called?
- if (BecomesRightFixed)
+ if (!_fixedPressed)
{
- _fixedPressed = true;
+ // Do we become fixed in the pressed state until RemoveFixed is called?
+ if (BecomesRightFixed)
+ {
+ _fixedPressed = true;
+ }
+
+ // Indicate the right mouse was used on the button
+ OnRightClick(new MouseEventArgs(MouseButtons.Right, 1, pt.X, pt.Y, 0));
}
- // Indicate the right mouse was used on the button
- OnRightClick(new MouseEventArgs(MouseButtons.Right, 1, pt.X, pt.Y, 0));
+ break;
}
-
- break;
- }
}
}
}
@@ -457,7 +460,7 @@ public virtual void MouseLeave(Control c, ViewBase? next)
if (!_fixedPressed)
{
// Not tracking the mouse means a null value
- MousePoint = CommonHelper.NullPoint;
+ MousePoint = CommonHelper.NullPoint;
// If leaving the view then cannot be capturing mouse input anymore
Captured = false;
@@ -600,7 +603,7 @@ public virtual bool KeyUp([DisallowNull] Control c, [DisallowNull] KeyEventArgs
UpdateTargetState(c);
}
}
-
+
return Captured;
}
#endregion
@@ -633,7 +636,7 @@ public virtual void LostFocus([DisallowNull] Control c)
if (Captured)
{
// Quit out of any dragging operation
- if (_dragging)
+ if (_dragging)
{
// Do not release capture!
OnDragQuit();
@@ -748,7 +751,7 @@ protected void UpdateTargetState(Control c)
/// Mouse point.
protected virtual void UpdateTargetState(Point pt)
{
- // By default the button is in the normal state
+ // By default, the button is in the normal state
PaletteState newState;
// If the button is disabled then show as disabled
@@ -829,7 +832,10 @@ protected virtual void UpdateTargetState(Point pt)
protected virtual void OnDragStart(Point mousePt, Point offset, Control c)
{
// Convert point from client to screen coordinates
- mousePt = Target.OwningControl.PointToScreen(mousePt);
+ if (Target.OwningControl != null)
+ {
+ mousePt = Target.OwningControl.PointToScreen(mousePt);
+ }
var ce = new DragStartEventCancelArgs(mousePt, offset, c);
DragStart?.Invoke(this, ce);
@@ -847,7 +853,10 @@ protected virtual void OnDragMove(Point mousePt)
if (DragMove != null)
{
// Convert point from client to screen coordinates
- mousePt = Target.OwningControl.PointToScreen(mousePt);
+ if (Target.OwningControl != null)
+ {
+ mousePt = Target.OwningControl.PointToScreen(mousePt);
+ }
DragMove(this, new PointEventArgs(mousePt));
}
}
@@ -862,7 +871,10 @@ protected virtual void OnDragEnd(Point mousePt)
if (DragEnd != null)
{
// Convert point from client to screen coordinates
- mousePt = Target.OwningControl.PointToScreen(mousePt);
+ if (Target.OwningControl != null)
+ {
+ mousePt = Target.OwningControl.PointToScreen(mousePt);
+ }
DragEnd(this, new PointEventArgs(mousePt));
}
}
@@ -903,10 +915,10 @@ protected virtual void OnDragQuit()
#endregion
#region Implementation
- private void OnRepeatTimer(object sender, EventArgs e)
+ private void OnRepeatTimer(object? sender, EventArgs e)
{
// Modify subsequent repeat timing
- _t = (System.Windows.Forms.Timer)sender;
+ _t = sender as System.Windows.Forms.Timer ?? throw new ArgumentNullException(nameof(sender));
_t.Interval = Math.Max(SystemInformation.DoubleClickTime / 4, 100);
OnClick(new MouseEventArgs(MouseButtons.Left, 1, 0, 0, 0));
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controller/CheckBoxController.cs b/Source/Krypton Components/Krypton.Toolkit/Controller/CheckBoxController.cs
index b7f14a976..f75eafc70 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controller/CheckBoxController.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controller/CheckBoxController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -40,19 +40,19 @@ public class CheckBoxController : GlobalId,
/// Target for state changes.
/// Top element for the check box control.
/// Delegate for notifying paint requests.
- public CheckBoxController([DisallowNull] ViewDrawCheckBox target,
- [DisallowNull] ViewBase top,
+ public CheckBoxController(ViewDrawCheckBox target,
+ ViewBase top,
NeedPaintHandler needPaint)
{
- Debug.Assert(target != null);
- Debug.Assert(top != null);
-
- // Store the provided paint notification delegate
- NeedPaint = needPaint;
+ Debug.Assert(target is not null);
+ Debug.Assert(top is not null);
// Remember target for state changes
- _target = target;
- _top = top;
+ // Debug.Assert() causes the null assignment warning.
+ // Suppressed by the null forgiving operator
+ _target = target!;
+ _top = top!;
+ NeedPaint = needPaint;
}
#endregion
@@ -148,7 +148,7 @@ public virtual void MouseUp(Control c, Point pt, MouseButtons button)
{
// Only if check box is still pressed
if (_target is { Pressed: true, Enabled: true })
- // Can only click if enabled
+ // Can only click if enabled
{
OnClick(EventArgs.Empty);
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controller/ContextMenuController.cs b/Source/Krypton Components/Krypton.Toolkit/Controller/ContextMenuController.cs
index bce466f68..2e4d5a559 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controller/ContextMenuController.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controller/ContextMenuController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -19,7 +19,7 @@ public class ContextMenuController : GlobalId,
IKeyController
{
#region Instance Fields
- private readonly ViewContextMenuManager _viewManager;
+ private readonly ViewContextMenuManager? _viewManager;
#endregion
#region Identity
@@ -27,7 +27,7 @@ public class ContextMenuController : GlobalId,
/// Initialize a new instance of the ContextMenuController class.
///
/// Owning view manager instance.
- public ContextMenuController(ViewContextMenuManager viewManager) => _viewManager = viewManager;
+ public ContextMenuController(ViewContextMenuManager? viewManager) => _viewManager = viewManager;
#endregion
@@ -58,25 +58,25 @@ public virtual void KeyDown([DisallowNull] Control c, [DisallowNull] KeyEventArg
switch (e.KeyCode)
{
case Keys.Tab:
- _viewManager.KeyTab(e.Shift);
+ _viewManager?.KeyTab(e.Shift);
break;
case Keys.Home:
- _viewManager.KeyHome();
+ _viewManager?.KeyHome();
break;
case Keys.End:
- _viewManager.KeyEnd();
+ _viewManager?.KeyEnd();
break;
case Keys.Up:
- _viewManager.KeyUp();
+ _viewManager?.KeyUp();
break;
case Keys.Down:
- _viewManager.KeyDown();
+ _viewManager?.KeyDown();
break;
case Keys.Left:
- _viewManager.KeyLeft(false);
+ _viewManager?.KeyLeft(false);
break;
case Keys.Right:
- _viewManager.KeyRight();
+ _viewManager?.KeyRight();
break;
}
}
@@ -103,7 +103,7 @@ public virtual void KeyPress([DisallowNull] Control c, [DisallowNull] KeyPressEv
throw new ArgumentNullException(nameof(e));
}
- _viewManager.KeyMnemonic(e.KeyChar);
+ _viewManager?.KeyMnemonic(e.KeyChar);
}
///
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controller/ControllerDefinitions.cs b/Source/Krypton Components/Krypton.Toolkit/Controller/ControllerDefinitions.cs
index 933b8dbce..16af639a4 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controller/ControllerDefinitions.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controller/ControllerDefinitions.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controller/LinkLabelController.cs b/Source/Krypton Components/Krypton.Toolkit/Controller/LinkLabelController.cs
index 8766a20d8..7d4b7ad7f 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controller/LinkLabelController.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controller/LinkLabelController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -51,26 +51,27 @@ public class LinkLabelController : GlobalId,
/// Palette to use in the pressed state.
/// Override to update with the pressed state.
/// Delegate for notifying paint requests.
- public LinkLabelController([DisallowNull] ViewDrawContent target,
+ public LinkLabelController(ViewDrawContent target,
IPaletteContent paletteDisabled,
IPaletteContent paletteNormal,
IPaletteContent paletteTracking,
IPaletteContent palettePressed,
PaletteContentInheritOverride pressed,
- NeedPaintHandler needPaint)
+ NeedPaintHandler? needPaint)
{
- Debug.Assert(target != null);
-
- // Store the provided paint notification delegate
- NeedPaint = needPaint;
+ // Debug.Assert() causes the null assignment warning.
+ // Suppressed by the null forgiving operator
+ Debug.Assert(target is not null);
// Remember target for state changes
- _target = target;
+ _target = target!;
_paletteDisabled = paletteDisabled;
_paletteNormal = paletteNormal;
_paletteTracking = paletteTracking;
_palettePressed = palettePressed;
_pressed = pressed;
+ // Store the provided paint notification delegate
+ NeedPaint = needPaint;
// Default other properties
_clickTime = new DateTime();
@@ -411,7 +412,7 @@ protected void UpdateTargetState(Control c)
/// Mouse point.
protected void UpdateTargetState(Point pt)
{
- // By default the button is in the normal state
+ // By default, the button is in the normal state
PaletteState newState;
// If the button is disabled then show as disabled
@@ -466,8 +467,9 @@ protected virtual void UpdateTargetPalette()
_target.SetPalette(_palettePressed);
break;
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(_target.State.ToString());
break;
}
@@ -482,7 +484,7 @@ protected virtual void UpdateTargetPalette()
protected virtual void OnClick(MouseEventArgs e)
{
// Find how long since the last click occurred
- TimeSpan clickInterval = DateTime.Now - _clickTime;
+ TimeSpan clickInterval = DateTime.Now - _clickTime;
// If less than the double click interval then ignore
if (SystemInformation.DoubleClickTime < clickInterval.TotalMilliseconds)
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controller/MenuCheckBoxController.cs b/Source/Krypton Components/Krypton.Toolkit/Controller/MenuCheckBoxController.cs
index c9db91080..6d647b634 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controller/MenuCheckBoxController.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controller/MenuCheckBoxController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -44,19 +44,21 @@ internal class MenuCheckBoxController : GlobalId,
/// Target for state changes.
/// Drawing element that owns check box display.
/// Delegate for notifying paint requests.
- public MenuCheckBoxController([DisallowNull] ViewContextMenuManager viewManager,
- [DisallowNull] ViewBase target,
- [DisallowNull] ViewDrawMenuCheckBox checkBox,
- [DisallowNull] NeedPaintHandler needPaint)
+ public MenuCheckBoxController(ViewContextMenuManager viewManager,
+ ViewBase target,
+ ViewDrawMenuCheckBox checkBox,
+ NeedPaintHandler? needPaint)
{
- Debug.Assert(viewManager != null);
- Debug.Assert(target != null);
- Debug.Assert(checkBox != null);
- Debug.Assert(needPaint != null);
-
- ViewManager = viewManager;
- _target = target;
- _menuCheckBox = checkBox;
+ // Debug.Assert() causes the null assignment warning.
+ // Suppressed by the null forgiving operator
+ Debug.Assert(viewManager is not null);
+ Debug.Assert(target is not null);
+ Debug.Assert(checkBox is not null);
+ Debug.Assert(needPaint is not null);
+
+ ViewManager = viewManager!;
+ _target = target!;
+ _menuCheckBox = checkBox!;
NeedPaint = needPaint;
}
#endregion
@@ -131,7 +133,7 @@ public void MnemonicActivate()
public bool DoesStackedClientMouseDownBecomeCurrent(Point pt) => true;
#endregion
-
+
#region Mouse Notifications
///
/// Mouse has entered the view.
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controller/MenuCheckButtonController.cs b/Source/Krypton Components/Krypton.Toolkit/Controller/MenuCheckButtonController.cs
index a782d3e1c..4002cf3a5 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controller/MenuCheckButtonController.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controller/MenuCheckButtonController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -44,19 +44,21 @@ internal class MenuCheckButtonController : GlobalId,
/// Target for state changes.
/// Drawing element that owns check button display.
/// Delegate for notifying paint requests.
- public MenuCheckButtonController([DisallowNull] ViewContextMenuManager viewManager,
- [DisallowNull] ViewBase target,
- [DisallowNull] ViewDrawMenuCheckButton checkButton,
- [DisallowNull] NeedPaintHandler needPaint)
+ public MenuCheckButtonController(ViewContextMenuManager viewManager,
+ ViewBase target,
+ ViewDrawMenuCheckButton checkButton,
+ NeedPaintHandler? needPaint)
{
- Debug.Assert(viewManager != null);
- Debug.Assert(target != null);
- Debug.Assert(checkButton != null);
- Debug.Assert(needPaint != null);
-
- ViewManager = viewManager;
- _target = target;
- _menuCheckButton = checkButton;
+ // Debug.Assert() causes the null assignment warning.
+ // Suppressed by the null forgiving operator
+ Debug.Assert(viewManager is not null);
+ Debug.Assert(target is not null);
+ Debug.Assert(checkButton is not null);
+ Debug.Assert(needPaint is not null);
+
+ ViewManager = viewManager!;
+ _target = target!;
+ _menuCheckButton = checkButton!;
NeedPaint = needPaint;
// Set initial display state
@@ -134,7 +136,7 @@ public void MnemonicActivate()
public bool DoesStackedClientMouseDownBecomeCurrent(Point pt) => true;
#endregion
-
+
#region Mouse Notifications
///
/// Mouse has entered the view.
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controller/MenuColorBlockController.cs b/Source/Krypton Components/Krypton.Toolkit/Controller/MenuColorBlockController.cs
index 431bd6943..5873af6e1 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controller/MenuColorBlockController.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controller/MenuColorBlockController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -43,19 +43,21 @@ internal class MenuColorBlockController : GlobalId,
/// Target for state changes.
/// Drawing element that owns color block display.
/// Delegate for notifying paint requests.
- public MenuColorBlockController([DisallowNull] ViewContextMenuManager viewManager,
- [DisallowNull] ViewBase target,
- [DisallowNull] ViewDrawMenuColorBlock colorBlock,
- [DisallowNull] NeedPaintHandler needPaint)
+ public MenuColorBlockController(ViewContextMenuManager viewManager,
+ ViewBase target,
+ ViewDrawMenuColorBlock colorBlock,
+ NeedPaintHandler needPaint)
{
- Debug.Assert(viewManager != null);
- Debug.Assert(target != null);
- Debug.Assert(colorBlock != null);
- Debug.Assert(needPaint != null);
-
- ViewManager = viewManager;
- _target = target;
- _menuColorBlock = colorBlock;
+ // Debug.Assert() causes the null assignment warning.
+ // Suppressed by the null forgiving operator
+ Debug.Assert(viewManager is not null);
+ Debug.Assert(target is not null);
+ Debug.Assert(colorBlock is not null);
+ Debug.Assert(needPaint is not null);
+
+ ViewManager = viewManager!;
+ _target = target!;
+ _menuColorBlock = colorBlock!;
NeedPaint = needPaint;
// Set initial display state
@@ -126,7 +128,7 @@ public void MnemonicActivate()
public bool DoesStackedClientMouseDownBecomeCurrent(Point pt) => true;
#endregion
-
+
#region Mouse Notifications
///
/// Mouse has entered the view.
@@ -411,7 +413,7 @@ private void HighlightState()
private void NormalState()
{
_highlight = false;
- _menuColorBlock.KryptonContextMenuColorColumns.OnTrackingColor(new ColorEventArgs(Color.Empty));
+ _menuColorBlock.KryptonContextMenuColorColumns.OnTrackingColor(new ColorEventArgs(GlobalStaticValues.EMPTY_COLOR));
UpdateTarget();
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controller/MenuImageSelectController.cs b/Source/Krypton Components/Krypton.Toolkit/Controller/MenuImageSelectController.cs
index b0265a478..16cb92899 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controller/MenuImageSelectController.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controller/MenuImageSelectController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -45,21 +45,23 @@ internal class MenuImageSelectController : GlobalId,
/// Target for state changes.
/// Reference to layout of the image items.
/// Delegate for notifying paint requests.
- public MenuImageSelectController([DisallowNull] ViewContextMenuManager viewManager,
- [DisallowNull] ViewDrawMenuImageSelectItem target,
- [DisallowNull] ViewLayoutMenuItemSelect layout,
- [DisallowNull] NeedPaintHandler needPaint)
+ public MenuImageSelectController(ViewContextMenuManager viewManager,
+ ViewDrawMenuImageSelectItem target,
+ ViewLayoutMenuItemSelect layout,
+ NeedPaintHandler? needPaint)
{
- Debug.Assert(viewManager != null);
- Debug.Assert(target != null);
- Debug.Assert(layout != null);
- Debug.Assert(needPaint != null);
+ // Debug.Assert() causes the null assignment warning.
+ // Suppressed by the null forgiving operator
+ Debug.Assert(viewManager is not null);
+ Debug.Assert(target is not null);
+ Debug.Assert(layout is not null);
+ Debug.Assert(needPaint is not null);
MousePoint = CommonHelper.NullPoint;
- _viewManager = viewManager;
- _target = target;
- _layout = layout;
- NeedPaint = needPaint;
+ _viewManager = viewManager!;
+ _target = target!;
+ _layout = layout!;
+ NeedPaint = needPaint!;
}
#endregion
@@ -259,7 +261,7 @@ public virtual void MouseLeave(Control c, ViewBase? next)
_mouseOver = false;
// Not tracking the mouse means a null value
- MousePoint = CommonHelper.NullPoint;
+ MousePoint = CommonHelper.NullPoint;
// If leaving the view then cannot be capturing mouse input anymore
Captured = false;
@@ -478,7 +480,7 @@ protected void UpdateTargetState(Control c)
/// Mouse point.
protected virtual void UpdateTargetState(Point pt)
{
- // By default the button is in the normal state
+ // By default, the button is in the normal state
PaletteState newState;
// If the button is disabled then show as disabled
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controller/MenuItemController.cs b/Source/Krypton Components/Krypton.Toolkit/Controller/MenuItemController.cs
index 20c12f207..edcfe6c65 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controller/MenuItemController.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controller/MenuItemController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -32,16 +32,18 @@ internal class MenuItemController : GlobalId,
/// Owning view manager instance.
/// Target menu item view element.
/// Delegate for notifying paint requests.
- public MenuItemController([DisallowNull] ViewContextMenuManager viewManager,
- [DisallowNull] ViewDrawMenuItem menuItem,
- [DisallowNull] NeedPaintHandler needPaint)
+ public MenuItemController(ViewContextMenuManager viewManager,
+ ViewDrawMenuItem menuItem,
+ NeedPaintHandler? needPaint)
{
- Debug.Assert(viewManager != null);
- Debug.Assert(menuItem != null);
- Debug.Assert(needPaint != null);
-
- ViewManager = viewManager;
- _menuItem = menuItem;
+ // Debug.Assert() causes the null assignment warning.
+ // Suppressed by the null forgiving operator
+ Debug.Assert(viewManager is not null);
+ Debug.Assert(menuItem is not null);
+ Debug.Assert(needPaint is not null);
+
+ ViewManager = viewManager!;
+ _menuItem = menuItem!;
NeedPaint = needPaint;
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controller/MenuLinkLabelController.cs b/Source/Krypton Components/Krypton.Toolkit/Controller/MenuLinkLabelController.cs
index 12519e265..11eb607ed 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controller/MenuLinkLabelController.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controller/MenuLinkLabelController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -44,19 +44,21 @@ internal class MenuLinkLabelController : GlobalId,
/// Target for state changes.
/// Drawing element that owns link label display.
/// Delegate for notifying paint requests.
- public MenuLinkLabelController([DisallowNull] ViewContextMenuManager viewManager,
- [DisallowNull] ViewDrawContent target,
- [DisallowNull] ViewDrawMenuLinkLabel linkLabel,
- [DisallowNull] NeedPaintHandler needPaint)
+ public MenuLinkLabelController(ViewContextMenuManager viewManager,
+ ViewDrawContent target,
+ ViewDrawMenuLinkLabel linkLabel,
+ NeedPaintHandler? needPaint)
{
- Debug.Assert(viewManager != null);
- Debug.Assert(target != null);
- Debug.Assert(linkLabel != null);
- Debug.Assert(needPaint != null);
-
- ViewManager = viewManager;
- _target = target;
- _menuLinkLabel = linkLabel;
+ // Debug.Assert() causes the null assignment warning.
+ // Suppressed by the null forgiving operator
+ Debug.Assert(viewManager is not null);
+ Debug.Assert(target is not null);
+ Debug.Assert(linkLabel is not null);
+ Debug.Assert(needPaint is not null);
+
+ ViewManager = viewManager!;
+ _target = target!;
+ _menuLinkLabel = linkLabel!;
NeedPaint = needPaint;
}
#endregion
@@ -128,7 +130,7 @@ public void MnemonicActivate()
public bool DoesStackedClientMouseDownBecomeCurrent(Point pt) => true;
#endregion
-
+
#region Mouse Notifications
///
/// Mouse has entered the view.
@@ -382,7 +384,7 @@ private void PressMenuLinkLabel(bool keyboard)
{
if (keyboard)
{
- _target.ElementState = PaletteState.Pressed;
+ _target.ElementState = PaletteState.Pressed;
_menuLinkLabel.Pressed = true;
PerformNeedPaint();
Application.DoEvents();
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controller/MenuRadioButtonController.cs b/Source/Krypton Components/Krypton.Toolkit/Controller/MenuRadioButtonController.cs
index a7113b209..82f5e80e8 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controller/MenuRadioButtonController.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controller/MenuRadioButtonController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -44,19 +44,21 @@ internal class MenuRadioButtonController : GlobalId,
/// Target for state changes.
/// Drawing element that owns radio button display.
/// Delegate for notifying paint requests.
- public MenuRadioButtonController([DisallowNull] ViewContextMenuManager viewManager,
- [DisallowNull] ViewBase target,
- [DisallowNull] ViewDrawMenuRadioButton radioButton,
- [DisallowNull] NeedPaintHandler needPaint)
+ public MenuRadioButtonController(ViewContextMenuManager viewManager,
+ ViewBase target,
+ ViewDrawMenuRadioButton radioButton,
+ NeedPaintHandler? needPaint)
{
- Debug.Assert(viewManager != null);
- Debug.Assert(target != null);
- Debug.Assert(radioButton != null);
- Debug.Assert(needPaint != null);
-
- ViewManager = viewManager;
- _target = target;
- _menuRadioButton = radioButton;
+ // Debug.Assert() causes the null assignment warning.
+ // Suppressed by the null forgiving operator
+ Debug.Assert(viewManager is not null);
+ Debug.Assert(target is not null);
+ Debug.Assert(radioButton is not null);
+ Debug.Assert(needPaint is not null);
+
+ ViewManager = viewManager!;
+ _target = target!;
+ _menuRadioButton = radioButton!;
NeedPaint = needPaint;
}
#endregion
@@ -131,7 +133,7 @@ public void MnemonicActivate()
public bool DoesStackedClientMouseDownBecomeCurrent(Point pt) => true;
#endregion
-
+
#region Mouse Notifications
///
/// Mouse has entered the view.
@@ -410,7 +412,7 @@ private void PressMenuRadioButton(bool keyboard)
// Do we need to automatically change the checked state?
if (_menuRadioButton.KryptonContextMenuRadioButton is { AutoCheck: true, Checked: false })
- // We only alter state if it is currently not checked
+ // We only alter state if it is currently not checked
{
_menuRadioButton.KryptonContextMenuRadioButton.Checked = true;
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controller/MonthCalendarController.cs b/Source/Krypton Components/Krypton.Toolkit/Controller/MonthCalendarController.cs
index 21e7c3e4e..3dfbfc3c6 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controller/MonthCalendarController.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controller/MonthCalendarController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -40,7 +40,7 @@ public class MonthCalendarController : GlobalId,
/// Delegate for handling repainting requests.
public MonthCalendarController(KryptonContextMenuMonthCalendar monthCalendar,
ViewContextMenuManager viewManager,
- ViewLayoutMonths months,
+ ViewLayoutMonths months,
NeedPaintHandler needPaint)
{
_monthCalendar = monthCalendar;
@@ -63,7 +63,7 @@ public MonthCalendarController(KryptonContextMenuMonthCalendar monthCalendar,
///
public virtual void ShowTarget()
{
- _months.FocusDay = _monthCalendar.SelectionStart;
+ _months.FocusDay = _monthCalendar?.SelectionStart;
_needPaint(this, new NeedLayoutEventArgs(false));
}
@@ -400,7 +400,7 @@ public virtual void KeyDown([DisallowNull] Control c, [DisallowNull] KeyEventArg
{
ProviderCanCloseMenu: true
})
- // Is the menu capable of being closed?
+ // Is the menu capable of being closed?
{
// Ask the original context menu definition, if we can close
var cea = new CancelEventArgs();
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controller/RadioButtonController.cs b/Source/Krypton Components/Krypton.Toolkit/Controller/RadioButtonController.cs
index 6d15a2ed2..c1e887d59 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controller/RadioButtonController.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controller/RadioButtonController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -37,19 +37,19 @@ internal class RadioButtonController : GlobalId,
/// Target for state changes.
/// Top element for the radio button control.
/// Delegate for notifying paint requests.
- public RadioButtonController([DisallowNull] ViewDrawRadioButton target,
- [DisallowNull] ViewBase top,
- NeedPaintHandler needPaint)
+ public RadioButtonController(ViewDrawRadioButton target,
+ ViewBase top,
+ NeedPaintHandler? needPaint)
{
- Debug.Assert(target != null);
- Debug.Assert(top != null);
-
- // Store the provided paint notification delegate
- NeedPaint = needPaint;
+ // Debug.Assert() causes the null assignment warning.
+ // Suppressed by the null forgiving operator
+ Debug.Assert(target is not null);
+ Debug.Assert(top is not null);
// Remember target for state changes
- _target = target;
- _top = top;
+ _target = target!;
+ _top = top!;
+ NeedPaint = needPaint;
}
#endregion
@@ -145,7 +145,7 @@ public virtual void MouseUp(Control c, Point pt, MouseButtons button)
{
// Only if radio button is still pressed
if (_target is { Pressed: true, Enabled: true })
- // Can only click if enabled
+ // Can only click if enabled
{
OnClick(EventArgs.Empty);
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controller/SeparatorController.cs b/Source/Krypton Components/Krypton.Toolkit/Controller/SeparatorController.cs
index d948d8dd7..e8dd90c50 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controller/SeparatorController.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controller/SeparatorController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -70,7 +70,6 @@ public interface ISeparatorSource
///
public class SeparatorController : ButtonController,
IDisposable
-
{
#region Types
///
@@ -179,9 +178,9 @@ protected override void WndProc(ref Message m)
private int _separatorIncrements;
private Rectangle _separatorBox;
private Orientation _separatorOrientation;
- private SeparatorMessageFilter _filter;
+ private SeparatorMessageFilter? _filter;
private readonly ISeparatorSource _source;
- private SeparatorIndicator _indicator;
+ private SeparatorIndicator? _indicator;
#endregion
@@ -201,9 +200,9 @@ public SeparatorController([DisallowNull] ISeparatorSource source,
NeedPaintHandler needPaint)
: base(target, needPaint)
{
- Debug.Assert(source != null);
+ Debug.Assert(source is not null);
- _source = source;
+ _source = source ?? throw new ArgumentNullException(nameof(source));
_splitCursors = splitCursors;
_drawIndicator = drawIndicator;
}
@@ -213,7 +212,7 @@ public SeparatorController([DisallowNull] ISeparatorSource source,
///
public void Dispose()
{
- UnregisterFilter();
+ UnRegisterFilter();
GC.SuppressFinalize(this);
}
#endregion
@@ -315,7 +314,7 @@ public override bool MouseDown(Control c, Point pt, MouseButtons button)
// Remove the message filter, as long as it is registered
// it will prevent the class from being garbage collected.
- UnregisterFilter();
+ UnRegisterFilter();
// Callback to the source to show movement has finished
Point splitPt = RecalcClient(pt);
@@ -345,7 +344,7 @@ public override void MouseUp(Control c, Point pt, MouseButtons button)
// Remove the message filter, as long as it is registered
// it will prevent the class from being garbage collected.
- UnregisterFilter();
+ UnRegisterFilter();
// Remove any showing separator indicator
DrawSeparatorRemoved();
@@ -459,7 +458,7 @@ public void AbortMoving()
// Remove the message filter, as long as it is registered
// it will prevent the class from being garbage collected.
- UnregisterFilter();
+ UnRegisterFilter();
// Remove any showing separator indicator
DrawSeparatorRemoved();
@@ -649,7 +648,7 @@ private void RegisterFilter()
}
}
- private void UnregisterFilter()
+ private void UnRegisterFilter()
{
if (_filter != null)
{
@@ -680,9 +679,9 @@ internal class SeparatorMessageFilter : IMessageFilter
/// Owning class instance.
public SeparatorMessageFilter([DisallowNull] SeparatorController controller)
{
- Debug.Assert(controller != null);
+ Debug.Assert(controller is not null);
- _controller = controller;
+ _controller = controller ?? throw new ArgumentNullException(nameof(controller));
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controller/TooltipController.cs b/Source/Krypton Components/Krypton.Toolkit/Controller/TooltipController.cs
index 0173b5f54..a465c652c 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controller/TooltipController.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controller/TooltipController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -19,7 +19,7 @@ public class ToolTipController : GlobalId,
IMouseController
{
#region Instance Fields
- private readonly ToolTipManager _manager;
+ private readonly ToolTipManager? _manager;
private readonly ViewBase _targetElement;
private readonly IMouseController? _targetController;
#endregion
@@ -40,7 +40,7 @@ public ToolTipController([DisallowNull] ToolTipManager manager,
// Remember incoming references
_manager = manager;
- _targetElement = targetElement;
+ _targetElement = targetElement!;
_targetController = targetController;
}
#endregion
@@ -52,7 +52,7 @@ public ToolTipController([DisallowNull] ToolTipManager manager,
/// Reference to the source control instance.
public void MouseEnter(Control c)
{
- _manager.MouseEnter(_targetElement, c);
+ _manager?.MouseEnter(_targetElement, c);
_targetController?.MouseEnter(c);
}
@@ -64,7 +64,7 @@ public void MouseEnter(Control c)
/// Mouse position relative to control.
public void MouseMove(Control c, Point pt)
{
- _manager.MouseMove(_targetElement, c, pt);
+ _manager?.MouseMove(_targetElement, c, pt);
_targetController?.MouseMove(c, pt);
}
@@ -78,7 +78,7 @@ public void MouseMove(Control c, Point pt)
/// True if capturing input; otherwise false.
public bool MouseDown(Control c, Point pt, MouseButtons button)
{
- _manager.MouseDown(_targetElement, c, pt, button);
+ _manager?.MouseDown(_targetElement, c, pt, button);
return _targetController != null && _targetController.MouseDown(c, pt, button);
}
@@ -91,7 +91,7 @@ public bool MouseDown(Control c, Point pt, MouseButtons button)
/// Mouse button released.
public void MouseUp(Control c, Point pt, MouseButtons button)
{
- _manager.MouseUp(_targetElement, c, pt, button);
+ _manager?.MouseUp(_targetElement, c, pt, button);
_targetController?.MouseUp(c, pt, button);
}
@@ -103,7 +103,7 @@ public void MouseUp(Control c, Point pt, MouseButtons button)
/// Reference to view that is next to have the mouse.
public void MouseLeave(Control c, ViewBase? next)
{
- _manager.MouseLeave(_targetElement, c, next);
+ _manager?.MouseLeave(_targetElement, c, next);
_targetController?.MouseLeave(c, next);
}
@@ -114,7 +114,7 @@ public void MouseLeave(Control c, ViewBase? next)
/// Mouse position relative to control.
public void DoubleClick(Point pt)
{
- _manager.DoubleClick(_targetElement, pt);
+ _manager?.DoubleClick(_targetElement, pt);
_targetController?.DoubleClick(pt);
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controller/TrackBarController.cs b/Source/Krypton Components/Krypton.Toolkit/Controller/TrackBarController.cs
index e84dacb41..448fe1a27 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controller/TrackBarController.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controller/TrackBarController.cs
@@ -5,11 +5,13 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
+using Timer = System.Windows.Forms.Timer;
+
namespace Krypton.Toolkit
{
///
@@ -22,7 +24,7 @@ public class TrackBarController : GlobalId,
{
#region Instance Fields
private readonly ViewDrawTP _drawTB;
- private System.Windows.Forms.Timer _repeatTimer;
+ private Timer? _repeatTimer;
private bool _captured;
private int _targetValue;
private Point _lastMovePt;
@@ -307,7 +309,7 @@ public virtual void LostFocus([DisallowNull] Control c)
#endregion
#region Implementation
- private void OnRepeatTimer(object sender, EventArgs e)
+ private void OnRepeatTimer(object? sender, EventArgs e)
{
var current = _drawTB.ViewDrawTrackBar.Value;
if (current != _targetValue)
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controller/TrackPositionController.cs b/Source/Krypton Components/Krypton.Toolkit/Controller/TrackPositionController.cs
index 943cd3ca2..f7cb5d394 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controller/TrackPositionController.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controller/TrackPositionController.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonAboutBox.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonAboutBox.cs
new file mode 100644
index 000000000..ac4268a37
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonAboutBox.cs
@@ -0,0 +1,52 @@
+#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. 2023 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+namespace Krypton.Toolkit
+{
+ /// The public interface to the class.
+ [ToolboxItem(false)]
+ [DesignerCategory(@"code")]
+ public static class KryptonAboutBox
+ {
+ #region Public
+
+ /// Shows a new .
+ /// The data to pass through.
+ /// A new with the specified data.
+ public static DialogResult Show(KryptonAboutBoxData aboutBoxData)
+ => ShowCore(aboutBoxData);
+
+ /// Shows a new
+ /// The about box data.
+ /// The about toolkit data.
+ /// A new with the specified data.
+ public static DialogResult Show(KryptonAboutBoxData aboutBoxData, KryptonAboutToolkitData aboutToolkitData) =>
+ ShowCore(aboutBoxData, aboutToolkitData);
+
+ #endregion
+
+ #region Implementation
+
+ private static DialogResult ShowCore(KryptonAboutBoxData aboutBoxData)
+ {
+ using var kab = new VisualAboutBoxForm(aboutBoxData);
+
+ return kab.ShowDialog();
+ }
+
+ private static DialogResult ShowCore(KryptonAboutBoxData aboutBoxData, KryptonAboutToolkitData aboutToolkitData)
+ {
+ using var kab = new VisualAboutBoxForm(aboutBoxData, aboutToolkitData);
+
+ return kab.ShowDialog();
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonAlternateCommandLinkButton.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonAlternateCommandLinkButton.cs
new file mode 100644
index 000000000..16e68907d
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonAlternateCommandLinkButton.cs
@@ -0,0 +1,144 @@
+#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. 2017 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+namespace Krypton.Toolkit
+{
+ ///
+ /// A KryptonCommandLink button.
+ /// Boilerplate code from (https://blogs.msdn.microsoft.com/knom/2007/03/12/vista-command-link-control-with-c-windows-forms/)
+ ///
+ /// If used on Windows Vista or higher, the button will be a CommandLink: Basically the same functionality as a Button but looks different.
+ [DesignerCategory("Code")]
+ [DisplayName("Krypton Command Link")]
+ [Description("A Krypton Command Link Button.")]
+ [ToolboxItem(false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ [ToolboxBitmap(typeof(KryptonAlternateCommandLinkButton), @"ToolboxBitmaps.KryptonCommandLinkButton.bmp")]
+ public class KryptonAlternateCommandLinkButton : KryptonButton
+ {
+ #region Static Fields
+
+ private const int BS_COMMANDLINK = 0x0000000E;
+
+ private const int BCM_SETNOTE = 0x00001609;
+
+ private const int BCM_GETNOTE = 0x0000160A;
+
+ private const int BCM_GETNOTELENGTH = 0x0000160B;
+
+ private const int BCM_SETSHIELD = 0x0000160C;
+
+ #endregion
+
+ #region Instance Fields
+
+ private bool _showUACShield;
+
+ #endregion
+
+ #region Public
+
+ ///
+ /// Gets or sets the shield icon visibility of the command link.
+ ///
+ [Category("Command Link"), Description("Gets or sets the shield icon visibility of the command link."), DefaultValue(false)]
+ public bool ShowUACShield
+ {
+ get => _showUACShield;
+
+ set
+ {
+ _showUACShield = value;
+
+ SendMessage(new HandleRef(this, Handle), BCM_SETSHIELD, IntPtr.Zero, _showUACShield);
+ }
+ }
+
+ ///
+ /// Gets or sets the note text of the command link.
+ ///
+ [Category("Command Link"), Description("Gets or sets the note text of the command link."), DefaultValue("")]
+ public string NoteText
+ {
+ get => GetNoteText();
+
+ set => SetNoteText(value);
+ }
+ #endregion
+
+ #region WIN32 Calls
+
+ [DllImport(Libraries.User32, CharSet = CharSet.Unicode)]
+ static extern int SendMessage(HandleRef hWnd, uint msg, ref int wParam, StringBuilder lParam);
+
+ [DllImport(Libraries.User32, CharSet = CharSet.Unicode)]
+ static extern int SendMessage(HandleRef hWnd, uint msg, IntPtr wParam, string lParam);
+
+ [DllImport(Libraries.User32, CharSet = CharSet.Unicode)]
+ static extern int SendMessage(HandleRef hWnd, uint msg, IntPtr wParam, bool lParam);
+
+ [DllImport(Libraries.User32, CharSet = CharSet.Unicode)]
+ static extern int SendMessage(HandleRef hWnd, uint msg, IntPtr wParam, IntPtr lParam);
+
+ #endregion
+
+ #region Identity
+
+ /// Initializes a new instance of the class.
+ public KryptonAlternateCommandLinkButton()
+ {
+
+ }
+
+ #endregion
+
+ #region Protected
+
+ ///
+ protected override Size DefaultSize => new Size(160, 60);
+
+ ///
+ protected override CreateParams CreateParams
+ {
+ get
+ {
+ CreateParams createParams = base.CreateParams;
+
+ createParams.Style |= BS_COMMANDLINK;
+
+ return createParams;
+ }
+ }
+
+ #endregion
+
+ #region Implementation
+
+ /// Sets the NoteText to the value of value.
+ /// The desired value of NoteText.
+ private void SetNoteText(string value) => SendMessage(new HandleRef(this, Handle), BCM_SETNOTE, IntPtr.Zero, value);
+
+ ///
+ /// Returns the value of the NoteText.
+ ///
+ /// The value of the NoteText.
+ private string GetNoteText()
+ {
+ int length = SendMessage(new HandleRef(this, Handle), BCM_GETNOTELENGTH, IntPtr.Zero, IntPtr.Zero) + 1;
+
+ StringBuilder stringBuilder = new StringBuilder(length);
+
+ SendMessage(new HandleRef(this, Handle), BCM_GETNOTE, ref length, stringBuilder);
+
+ return stringBuilder.ToString();
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonBorderEdge.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonBorderEdge.cs
index 21ac682bb..d1a9d2a7f 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonBorderEdge.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonBorderEdge.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonBreadCrumb.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonBreadCrumb.cs
index 7ddf423e4..57632bd47 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonBreadCrumb.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonBreadCrumb.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -46,8 +46,7 @@ public BreadCrumbButtonSpecCollection(KryptonBreadCrumb owner)
#region Instance Fields
- private bool _dropDownNavigaton;
- private float _cornerRoundingRadius;
+ private bool _dropDownNavigation;
private readonly ViewDrawDocker _drawDocker;
private readonly ButtonSpecManagerDraw? _buttonManager;
private VisualPopupToolTip? _visualPopupToolTip;
@@ -97,7 +96,7 @@ public KryptonBreadCrumb()
// Set default values
_selectedItem = null;
- _dropDownNavigaton = true;
+ _dropDownNavigation = true;
_buttonStyle = ButtonStyle.BreadCrumb;
RootItem = new KryptonBreadCrumbItem("Root");
RootItem.PropertyChanged += OnCrumbItemChanged;
@@ -116,7 +115,7 @@ public KryptonBreadCrumb()
// Our view contains background and border with crumbs inside
_layoutCrumbs = new ViewLayoutCrumbs(this, NeedPaintDelegate);
- _drawDocker = new ViewDrawDocker(StateNormal.Back, StateNormal.Border, null)
+ _drawDocker = new ViewDrawDocker(StateNormal.Back, StateNormal.Border, null!)
{
{ _layoutCrumbs, ViewDockStyle.Fill }
};
@@ -126,10 +125,10 @@ public KryptonBreadCrumb()
// Create button specification collection manager
_buttonManager = new ButtonSpecManagerDraw(this, Redirector, ButtonSpecs, null,
- new[] { _drawDocker },
- new IPaletteMetric[] { StateCommon },
- new[] { PaletteMetricInt.HeaderButtonEdgeInsetPrimary },
- new[] { PaletteMetricPadding.None },
+ [_drawDocker],
+ [StateCommon],
+ [PaletteMetricInt.HeaderButtonEdgeInsetPrimary],
+ [PaletteMetricPadding.None],
CreateToolStripRenderer,
NeedPaintDelegate);
@@ -138,8 +137,6 @@ public KryptonBreadCrumb()
ToolTipManager.ShowToolTip += OnShowToolTip;
ToolTipManager.CancelToolTip += OnCancelToolTip;
_buttonManager.ToolTipManager = ToolTipManager;
-
- _cornerRoundingRadius = GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
}
///
@@ -154,7 +151,7 @@ protected override void Dispose(bool disposing)
OnCancelToolTip(this, EventArgs.Empty);
// Remember to pull down the manager instance
- _buttonManager.Destruct();
+ _buttonManager?.Destruct();
}
base.Dispose(disposing);
@@ -188,18 +185,6 @@ public virtual void EndInit()
OnInitialized(EventArgs.Empty);
}
- /// Gets or sets the corner rounding radius.
- /// The corner rounding radius.
- [Category(@"Visuals")]
- [Description(@"Gets or sets the corner rounding radius.")]
- [DefaultValue(GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE)]
- public float CornerRoundingRadius
- {
- get => _cornerRoundingRadius;
-
- set => SetCornerRoundingRadius(value);
- }
-
///
/// Gets a value indicating if the control is initialized.
///
@@ -262,13 +247,13 @@ public override bool AutoSize
[DefaultValue(true)]
public bool UseMnemonic
{
- get => _buttonManager?.UseMnemonic?? true;
+ get => _buttonManager?.UseMnemonic ?? true;
set
{
if (_buttonManager?.UseMnemonic != value)
{
- _buttonManager.UseMnemonic = value;
+ _buttonManager!.UseMnemonic = value;
PerformNeedPaint(true);
}
}
@@ -290,13 +275,13 @@ public bool UseMnemonic
[DefaultValue(true)]
public bool DropDownNavigation
{
- get => _dropDownNavigaton;
+ get => _dropDownNavigation;
set
{
- if (_dropDownNavigaton != value)
+ if (_dropDownNavigation != value)
{
- _dropDownNavigaton = value;
+ _dropDownNavigation = value;
PerformNeedPaint(true);
}
}
@@ -437,7 +422,7 @@ public KryptonBreadCrumbItem? SelectedItem
[Category(@"Visuals")]
[Description(@"Overrides for defining common bread crumb appearance that other states can override.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public PaletteBreadCrumbRedirect? StateCommon { get; }
+ public PaletteBreadCrumbRedirect StateCommon { get; }
private bool ShouldSerializeStateCommon() => !StateCommon.IsDefault;
@@ -556,7 +541,7 @@ protected override bool ProcessMnemonic(char charCode)
if (UseMnemonic && CanProcessMnemonic())
{
// Pass request onto the button spec manager
- if (_buttonManager.ProcessMnemonic(charCode))
+ if (_buttonManager!.ProcessMnemonic(charCode))
{
return true;
}
@@ -604,7 +589,7 @@ protected override void OnEnabledChanged(EventArgs e)
///
/// Source of notification.
/// An EventArgs containing event data.
- protected override void OnButtonSpecChanged(object sender, EventArgs e)
+ protected override void OnButtonSpecChanged(object? sender, EventArgs e)
{
// Recreate all the button specs with new values
_buttonManager?.RecreateButtons();
@@ -642,14 +627,14 @@ protected override void OnButtonSpecChanged(object sender, EventArgs e)
#endregion
#region Internal
- internal PaletteBreadCrumbRedirect? GetStateCommon() => StateCommon;
+ internal PaletteBreadCrumbRedirect GetStateCommon() => StateCommon;
- internal PaletteRedirect? GetRedirector() => Redirector;
+ internal PaletteRedirect GetRedirector() => Redirector;
#endregion
#region Implementation
- private void OnCrumbItemChanged(object sender, PropertyChangedEventArgs e)
+ private void OnCrumbItemChanged(object? sender, PropertyChangedEventArgs e)
{
// A change in the selected item hierarchy...
if (e.PropertyName == "Items")
@@ -676,7 +661,7 @@ private void OnCrumbItemChanged(object sender, PropertyChangedEventArgs e)
PerformNeedPaint(true);
}
- private void OnShowToolTip(object sender, ToolTipEventArgs e)
+ private void OnShowToolTip(object? sender, ToolTipEventArgs e)
{
if (!IsDisposed)
{
@@ -743,27 +728,19 @@ private void OnShowToolTip(object sender, ToolTipEventArgs e)
}
}
- private void OnCancelToolTip(object sender, EventArgs e) =>
+ private void OnCancelToolTip(object? sender, EventArgs e) =>
// Remove any currently showing tooltip
_visualPopupToolTip?.Dispose();
- private void OnVisualPopupToolTipDisposed(object sender, EventArgs e)
+ private void OnVisualPopupToolTipDisposed(object? sender, EventArgs e)
{
// Unhook events from the specific instance that generated event
- var popupToolTip = (VisualPopupToolTip)sender;
+ var popupToolTip = sender as VisualPopupToolTip ?? throw new ArgumentNullException(nameof(sender));
popupToolTip.Disposed -= OnVisualPopupToolTipDisposed;
// Not showing a popup page any more
_visualPopupToolTip = null;
}
-
- private void SetCornerRoundingRadius(float? radius)
- {
- _cornerRoundingRadius = radius ?? GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
- StateCommon.Border.Rounding = _cornerRoundingRadius;
- }
-
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonBreadCrumbItem.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonBreadCrumbItem.cs
index a695b8b4c..b88d8f5ac 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonBreadCrumbItem.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonBreadCrumbItem.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -82,7 +82,7 @@ public override KryptonBreadCrumbItem? this[string name]
protected override void OnInserting(TypedCollectionEventArgs e)
{
// Setup parent relationship
- e.Item.Parent = _owner;
+ e.Item!.Parent = _owner;
base.OnInserting(e);
}
@@ -96,7 +96,7 @@ protected override void OnInserted(TypedCollectionEventArgs
@@ -108,10 +108,10 @@ protected override void OnRemoved(TypedCollectionEventArgs
@@ -138,7 +138,7 @@ protected override void OnCleared(EventArgs e)
base.OnCleared(e);
// Notify a change in the owners items property
- _owner.OnPropertyChanged(new PropertyChangedEventArgs(nameof(Items)));
+ _owner?.OnPropertyChanged(new PropertyChangedEventArgs(nameof(Items)));
}
#endregion
}
@@ -149,7 +149,7 @@ protected override void OnCleared(EventArgs e)
/// Initialize a new instance of the KryptonBreadCrumbItem class.
///
public KryptonBreadCrumbItem()
- : this("ListItem", null, null, Color.Empty)
+ : this("ListItem", null, null, GlobalStaticValues.EMPTY_COLOR)
{
}
@@ -158,7 +158,7 @@ public KryptonBreadCrumbItem()
///
/// Initial short text value.
public KryptonBreadCrumbItem(string shortText)
- : this(shortText, null, null, Color.Empty)
+ : this(shortText, null, null, GlobalStaticValues.EMPTY_COLOR)
{
}
@@ -168,7 +168,7 @@ public KryptonBreadCrumbItem(string shortText)
/// Initial short text value.
/// Initial long text value.
public KryptonBreadCrumbItem(string shortText, string longText)
- : this(shortText, longText, null, Color.Empty)
+ : this(shortText, longText, null, GlobalStaticValues.EMPTY_COLOR)
{
}
@@ -180,8 +180,8 @@ public KryptonBreadCrumbItem(string shortText, string longText)
/// Initial image value.
public KryptonBreadCrumbItem(string shortText,
string longText,
- Image image)
- : this(shortText, longText, image, Color.Empty)
+ Image? image)
+ : this(shortText, longText, image, GlobalStaticValues.EMPTY_COLOR)
{
}
@@ -193,8 +193,8 @@ public KryptonBreadCrumbItem(string shortText,
/// Initial image value.
/// Initial transparent image color.
public KryptonBreadCrumbItem(string shortText,
- string longText,
- Image image,
+ string? longText,
+ Image? image,
Color imageTransparentColor)
: base(shortText, longText, image, imageTransparentColor) =>
// Create child collection
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButton.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButton.cs
index 151e01106..cfc37dc17 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButton.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButton.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -45,15 +45,12 @@ public class KryptonButton : VisualSimpleBase, IButtonControl, IContentValues
private readonly PaletteTripleOverride _overrideTracking;
private readonly PaletteTripleOverride _overridePressed;
private IKryptonCommand? _command;
- private bool _useAsDialogButton;
private bool _isDefault;
private bool _useMnemonic;
private bool _wasEnabled;
- private bool _useAsUACElevationButton;
private bool _skipNextOpen;
- private bool _showSplitOption;
+ //private bool _showSplitOption;
//private bool _useOSUACShieldIcon;
- private float _cornerRoundingRadius;
private Size _customUACShieldSize;
private UACShieldIconSize _uacShieldIconSize;
private Rectangle _dropDownRectangle;
@@ -135,22 +132,12 @@ public KryptonButton()
// Create the view manager instance
ViewManager = new ViewManager(this, _drawButton);
- _useAsDialogButton = false;
-
- _useAsUACElevationButton = false;
-
_uacShieldIconSize = GlobalStaticValues.DEFAULT_UAC_SHIELD_ICON_SIZE;
//_useOSUACShieldIcon = false;
_customUACShieldSize = GlobalStaticValues.DEFAULT_UAC_SHIELD_ICON_CUSTOM_SIZE;
- // Set `CornerRoundingRadius' to 'GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE' (-1)
- CornerRoundingRadius = GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
- // Split settings
- _showSplitOption = false;
-
_skipNextOpen = false;
_dropDownRectangle = new Rectangle();
@@ -158,18 +145,6 @@ public KryptonButton()
#endregion
#region Public
- /// Gets or sets the corner rounding radius.
- /// The corner rounding radius.
- [Category(@"Visuals")]
- [Description(@"Gets or sets the corner rounding radius.")]
- [DefaultValue(GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE)]
- public float CornerRoundingRadius
- {
- get => _cornerRoundingRadius;
-
- set => SetCornerRoundingRadius(value);
- }
-
///
/// Gets and sets the automatic resize of the control to fit contents.
///
@@ -268,65 +243,7 @@ public ButtonStyle ButtonStyle
private void ResetButtonStyle() => ButtonStyle = ButtonStyle.Standalone;
- [DefaultValue(false),
- Description(@"If set to true, the text will pair up with the equivalent KryptonManager's dialog button text result. (Note: You'll lose any previous text)")]
- public bool UseAsADialogButton
- {
- get => _useAsDialogButton;
- set => _useAsDialogButton = value;
- }
- [DefaultValue(false),
- Description(@"Transforms the button into a UAC elevated button.")]
- public bool UseAsUACElevationButton
- {
- get => _useAsUACElevationButton;
- set
- {
- _useAsUACElevationButton = value;
-
- switch (_uacShieldIconSize)
- {
- //if (_customUACShieldSize.Height > 0 && _customUACShieldSize.Width > 0)
- //{
- // ShowUACShield(value, UACShieldIconSize.Custom, _customUACShieldSize.Width, _customUACShieldSize.Height);
- //}
- //else if (_uacShieldIconSize != UACShieldIconSize.Custom)
- //{
- // ShowUACShield(value, _uacShieldIconSize);
- //}
- case UACShieldIconSize.ExtraSmall:
- ShowUACShield(value, UACShieldIconSize.ExtraSmall);
- break;
- case UACShieldIconSize.Small:
- ShowUACShield(value, UACShieldIconSize.Small);
- break;
- case UACShieldIconSize.Medium:
- ShowUACShield(value, UACShieldIconSize.Medium);
- break;
- case UACShieldIconSize.Large:
- ShowUACShield(value, UACShieldIconSize.Large);
- break;
- case UACShieldIconSize.ExtraLarge:
- ShowUACShield(value, UACShieldIconSize.ExtraLarge);
- break;
- default:
- ShowUACShield(value, UACShieldIconSize.ExtraSmall);
- break;
- }
- }
- }
-
- /*
- [DefaultValue(false), Description(@"Use the operating system UAC shield icon image.")]
- public bool UseOSUACShieldIcon { get => _useOSUACShieldIcon; set { _useOSUACShieldIcon = value; UpdateOSUACShieldIcon(); } }
-
- [DefaultValue(null), Description(@"")]
- public Size CustomUACShieldSize { get => _customUACShieldSize; set { _customUACShieldSize = value; ShowUACShield(_useAsUACElevationButton, UACShieldIconSize.Custom, value.Width, value.Height); } }
- */
-
- [DefaultValue(UACShieldIconSize.ExtraSmall), Description(@"")]
- public UACShieldIconSize UACShieldIconSize { get => _uacShieldIconSize; set { _uacShieldIconSize = value; ShowUACShield(_useAsUACElevationButton, value); } }
///
/// Gets access to the button content.
@@ -340,7 +257,7 @@ public bool UseAsUACElevationButton
//[Category(@"Visuals"), Description(@"UAC Shield Values"), DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
//public UACShieldValues UACShieldValues { get; }
-
+
//private bool ShouldSerializeUACShieldValues() => !UACShieldValues.IsDefault;
///
@@ -543,7 +460,7 @@ public virtual void SetFixedState(PaletteState state)
set => base.ImeMode = value;
}
- /// Gets or sets a value indicating whether [show split option].
+ /*/// Gets or sets a value indicating whether [show split option].
/// true if [show split option]; otherwise, false .
[Category(@"Visuals")]
[DefaultValue(false)]
@@ -563,7 +480,7 @@ public bool ShowSplitOption
Parent?.PerformLayout();
}
}
- }
+ }*/
#endregion
@@ -598,11 +515,12 @@ public Color GetImageTransparentColor(PaletteState state) =>
#region Public Overrides
+ ///
public override Size GetPreferredSize(Size proposedSize)
{
Size preferredSize = base.GetPreferredSize(proposedSize);
- if (_showSplitOption && !string.IsNullOrWhiteSpace(Text) && TextRenderer.MeasureText(Text, Font).Width + DEFAULT_PUSH_BUTTON_WIDTH > preferredSize.Width)
+ if (Values.ShowSplitOption && !string.IsNullOrWhiteSpace(Text) && TextRenderer.MeasureText(Text, Font).Width + DEFAULT_PUSH_BUTTON_WIDTH > preferredSize.Width)
{
return preferredSize + new Size(DEFAULT_PUSH_BUTTON_WIDTH + BORDER_SIZE * 2, 0);
}
@@ -698,7 +616,10 @@ protected override void OnClick(EventArgs e)
catch (InvalidEnumArgumentException)
{
// Is it https://github.com/Krypton-Suite/Standard-Toolkit/issues/728
- if (owner is KryptonMessageBoxForm)
+ if (owner is VisualMessageBoxForm
+ or VisualMessageBoxFormDep
+ or VisualMessageBoxRtlAwareForm
+ or VisualMessageBoxRtlAwareFormDep)
{
// need to gain access to `dialogResult` and set it forcefully
FieldInfo? fi = typeof(Form).GetField("dialogResult", BindingFlags.NonPublic | BindingFlags.Instance);
@@ -720,7 +641,7 @@ protected override void OnClick(EventArgs e)
// If we have an attached command then execute it
KryptonCommand?.PerformExecute();
- if (_useAsUACElevationButton)
+ if (Values.UseAsUACElevationButton)
{
var rawUACShield = SystemIcons.Shield.ToBitmap();
@@ -766,43 +687,40 @@ protected override bool ProcessMnemonic(char charCode)
///
protected override void ContextMenuClosed() => _buttonController.RemoveFixed();
- protected override void OnPaint(PaintEventArgs e)
+ ///
+ protected override void OnPaint(PaintEventArgs? e)
{
- if (_useAsDialogButton)
+ if (Values.UseAsADialogButton)
{
- if (DialogResult == DialogResult.Abort)
+ Text = DialogResult switch
{
- Text = KryptonLanguageManager.GeneralToolkitStrings.Abort;
- }
-
- if (DialogResult == DialogResult.Cancel)
- {
- Text = KryptonLanguageManager.GeneralToolkitStrings.Cancel;
- }
-
- if (DialogResult == DialogResult.OK)
- {
- Text = KryptonLanguageManager.GeneralToolkitStrings.OK;
- }
-
- if (DialogResult == DialogResult.Yes)
- {
- Text = KryptonLanguageManager.GeneralToolkitStrings.Yes;
- }
-
- if (DialogResult == DialogResult.No)
- {
- Text = KryptonLanguageManager.GeneralToolkitStrings.No;
- }
-
- if (DialogResult == DialogResult.Retry)
- {
- Text = KryptonLanguageManager.GeneralToolkitStrings.Retry;
- }
+ DialogResult.Abort => KryptonManager.Strings.GeneralStrings.Abort,
+ DialogResult.Cancel => KryptonManager.Strings.GeneralStrings.Cancel,
+ DialogResult.OK => KryptonManager.Strings.GeneralStrings.OK,
+ DialogResult.Yes => KryptonManager.Strings.GeneralStrings.Yes,
+ DialogResult.No => KryptonManager.Strings.GeneralStrings.No,
+ DialogResult.Retry => KryptonManager.Strings.GeneralStrings.Retry,
+ DialogResult.Ignore => KryptonManager.Strings.GeneralStrings.Ignore,
+ _ => Text
+ };
+ }
- if (DialogResult == DialogResult.Ignore)
+ if (Values.UseAsUACElevationButton)
+ {
+ switch (Values.UACShieldIconSize)
{
- Text = KryptonLanguageManager.GeneralToolkitStrings.Ignore;
+ case UACShieldIconSize.ExtraSmall:
+ break;
+ case UACShieldIconSize.Small:
+ break;
+ case UACShieldIconSize.Medium:
+ break;
+ case UACShieldIconSize.Large:
+ break;
+ case UACShieldIconSize.ExtraLarge:
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
}
}
@@ -810,12 +728,12 @@ protected override void OnPaint(PaintEventArgs e)
#region Split Code
- if (!_showSplitOption)
+ if (!Values.ShowSplitOption)
{
return;
}
- Graphics g = e.Graphics;
+ Graphics g = e?.Graphics!;
Rectangle bounds = ClientRectangle;
@@ -826,16 +744,11 @@ protected override void OnPaint(PaintEventArgs e)
var focusRectangle = new Rectangle(internalBorder, internalBorder,
bounds.Width - _dropDownRectangle.Width - internalBorder, bounds.Height - (internalBorder * 2));
- PaletteBase? palette = KryptonManager.CurrentGlobalPalette;
+ PaletteBase palette = KryptonManager.CurrentGlobalPalette;
- Pen shadow = SystemPens.ButtonShadow, face = SystemPens.ButtonFace;
+ var shadow = new Pen(palette.ColorTable.GripDark);
- if (palette != null)
- {
- shadow = new Pen(palette.ColorTable.GripDark);
-
- face = new Pen(palette.ColorTable.GripLight);
- }
+ var face = new Pen(palette.ColorTable.GripLight);
if (RightToLeft == RightToLeft.Yes)
{
@@ -856,14 +769,15 @@ protected override void OnPaint(PaintEventArgs e)
}
// Draw an arrow in the correct location
- PaintArrow(g, _dropDownRectangle);
+ PaintArrow(Values.DropDownArrowColor, g, _dropDownRectangle);
#endregion
}
+ ///
protected override bool IsInputKey(Keys keyData)
{
- if (keyData.Equals(Keys.Down) && _showSplitOption)
+ if (keyData.Equals(Keys.Down) && Values.ShowSplitOption)
{
return true;
}
@@ -873,9 +787,10 @@ protected override bool IsInputKey(Keys keyData)
}
}
+ ///
protected override void OnKeyDown(KeyEventArgs e)
{
- if (_showSplitOption && e.KeyCode.Equals(Keys.Down))
+ if (Values.ShowSplitOption && e.KeyCode.Equals(Keys.Down))
{
ShowContextMenuStrip();
}
@@ -883,9 +798,10 @@ protected override void OnKeyDown(KeyEventArgs e)
base.OnKeyDown(e);
}
+ ///
protected override void OnMouseDown(MouseEventArgs e)
{
- if (!_showSplitOption)
+ if (!Values.ShowSplitOption)
{
base.OnMouseDown(e);
return;
@@ -901,16 +817,10 @@ protected override void OnMouseDown(MouseEventArgs e)
}
}
+ ///
protected override void OnMouseUp(MouseEventArgs e)
{
- if (!_showSplitOption)
- {
- base.OnMouseUp(e);
-
- return;
- }
-
- if (ContextMenuStrip == null || !ContextMenuStrip.Visible)
+ if (!Values.ShowSplitOption || ContextMenuStrip == null || !ContextMenuStrip.Visible)
{
base.OnMouseUp(e);
}
@@ -961,12 +871,12 @@ protected virtual void OnKryptonCommandChanged(EventArgs e)
///
/// Source of the event.
/// A PropertyChangedEventArgs that contains the event data.
- protected virtual void OnCommandPropertyChanged(object sender, PropertyChangedEventArgs e)
+ protected virtual void OnCommandPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
switch (e.PropertyName)
{
case nameof(Enabled):
- Enabled = KryptonCommand.Enabled;
+ Enabled = KryptonCommand!.Enabled;
break;
case nameof(Text):
case @"ExtraText":
@@ -985,9 +895,9 @@ protected virtual void OnCommandPropertyChanged(object sender, PropertyChangedEv
#endregion
#region Implementation
- private void OnButtonTextChanged(object sender, EventArgs e) => OnTextChanged(EventArgs.Empty);
+ private void OnButtonTextChanged(object? sender, EventArgs e) => OnTextChanged(EventArgs.Empty);
- private void OnButtonClick(object sender, MouseEventArgs e)
+ private void OnButtonClick(object? sender, MouseEventArgs e)
{
// Raise the standard click event
OnClick(EventArgs.Empty);
@@ -996,7 +906,7 @@ private void OnButtonClick(object sender, MouseEventArgs e)
OnMouseClick(e);
}
- private void OnButtonSelect(object sender, MouseEventArgs e)
+ private void OnButtonSelect(object? sender, MouseEventArgs e)
{
// Take the focus if allowed
if (CanFocus)
@@ -1005,126 +915,35 @@ private void OnButtonSelect(object sender, MouseEventArgs e)
}
}
- private void SetCornerRoundingRadius(float? radius)
- {
- _cornerRoundingRadius = radius ?? GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
- StateCommon.Border.Rounding = _cornerRoundingRadius;
- }
-
- #region UAC Stuff
-
- /// Shows the uac shield.
- /// if set to true [show uac shield].
- /// Size of the shield icon.
- /// The width.
- /// The height.
- private void ShowUACShield(bool showUACShield, UACShieldIconSize? shieldIconSize = null, int? width = null, int? height = null)
- {
- if (showUACShield)
- {
- int h = height ?? 16, w = width ?? 16;
-
- Image shield = SystemIcons.Shield.ToBitmap();
-
- switch (shieldIconSize)
- {
- //case UACShieldIconSize.Custom:
- // Values.Image = GraphicsExtensions.ScaleImage(shield, w, h);
- // break;
- case UACShieldIconSize.ExtraSmall:
- Values.Image = GraphicsExtensions.ScaleImage(shield, 16, 16);
- break;
- case UACShieldIconSize.Small:
- Values.Image = GraphicsExtensions.ScaleImage(shield, 32, 32);
- break;
- case UACShieldIconSize.Medium:
- Values.Image = GraphicsExtensions.ScaleImage(shield, 64, 64);
- break;
- case UACShieldIconSize.Large:
- Values.Image = GraphicsExtensions.ScaleImage(shield, 128, 128);
- break;
- case UACShieldIconSize.ExtraLarge:
- Values.Image = GraphicsExtensions.ScaleImage(shield, 256, 256);
- break;
- case null:
- Values.Image = GraphicsExtensions.ScaleImage(shield, 16, 16);
- break;
- }
-
- Invalidate();
- }
- else
- {
- Values.Image = null;
- }
- }
-
- /// Updates the UAC shield icon.
- /// Size of the icon.
- /// Size of the custom.
- private void UpdateOSUACShieldIcon(UACShieldIconSize? iconSize = null, Size? customSize = null)
- {
- //if (OSUtilities.IsWindowsEleven)
- //{
- // Image windowsElevenUacShieldImage = UACShieldIconResources.UACShieldWindows11;
-
- // if (iconSize == UACShieldIconSize.Custom)
- // {
- // UpdateShieldSize(UACShieldIconSize.Custom, customSize, windowsElevenUacShieldImage);
- // }
- // else
- // {
- // UpdateShieldSize(iconSize, null, windowsElevenUacShieldImage);
- // }
- //}
- //else if (OSUtilities.IsWindowsTen)
- //{
- // Image windowsTenUacShieldImage = UACShieldIconResources.UACShieldWindows10;
-
- // if (iconSize == UACShieldIconSize.Custom)
- // {
- // UpdateShieldSize(UACShieldIconSize.Custom, customSize, windowsTenUacShieldImage);
- // }
- // else
- // {
- // UpdateShieldSize(iconSize, null, windowsTenUacShieldImage);
- // }
- //}
- //else if (OSUtilities.IsWindowsEightPointOne || OSUtilities.IsWindowsEight || OSUtilities.IsWindowsSeven)
- //{
- // Image windowsEightUacShieldImage = UACShieldIconResources.UACShieldWindows7881;
-
- // if (iconSize == UACShieldIconSize.Custom)
- // {
- // UpdateShieldSize(UACShieldIconSize.Custom, customSize, windowsEightUacShieldImage);
- // }
- // else
- // {
- // UpdateShieldSize(iconSize, null, windowsEightUacShieldImage);
- // }
- //}
- }
-
- #endregion
-
#region Splitter Stuff
- private static void PaintArrow(Graphics graphics, Rectangle rectangle)
+ /// Paints the drop-down arrow.
+ /// The drop-down arrow graphics.
+ /// The drop-down rectangle area.
+ /// The color of the drop-down arrow.
+ private static void PaintArrow(Color? dropDownArrowColor, Graphics graphics, Rectangle rectangle)
{
var midPoint = new Point(Convert.ToInt32(rectangle.Left + rectangle.Width / 2),
Convert.ToInt32(rectangle.Top + rectangle.Height / 2));
midPoint.X += (rectangle.Width % 2);
- var arrow = new Point[]
- {
+ // Testing for null and EMPTY_COLOR, makes the arrow color react to theme changes,
+ // otherwise a custom color is in effect.
+ Color? color = dropDownArrowColor is not null && dropDownArrowColor != GlobalStaticValues.EMPTY_COLOR
+ ? dropDownArrowColor
+ : KryptonManager.CurrentGlobalPalette.GetContentShortTextColor1(PaletteContentStyle.ButtonStandalone, PaletteState.Normal);
+
+ SolidBrush dropDownBrush = new SolidBrush(color.Value);
+
+ var arrow = new Point[]
+ {
new Point(midPoint.X - 2, midPoint.Y - 1),
- new Point(midPoint.X + 3, midPoint.Y - 1),
+ new Point(midPoint.X + 3, midPoint.Y - 1),
midPoint with { Y = midPoint.Y + 2 }
};
- graphics.FillPolygon(SystemBrushes.ControlText, arrow);
+ graphics.FillPolygon(dropDownBrush, arrow);
}
private void ShowContextMenuStrip()
@@ -1158,10 +977,9 @@ private void ShowContextMenuStrip()
#region Event Handlers
- private void KryptonContextMenu_Closed(object sender, ToolStripDropDownClosedEventArgs e)
+ private void KryptonContextMenu_Closed(object? sender, ToolStripDropDownClosedEventArgs e)
{
- var kcm = sender as KryptonContextMenu;
- if (kcm != null)
+ if (sender is KryptonContextMenu kcm)
{
kcm.Closed -= KryptonContextMenu_Closed;
}
@@ -1172,10 +990,9 @@ private void KryptonContextMenu_Closed(object sender, ToolStripDropDownClosedEve
//}
}
- private void ContextMenuStrip_Closing(object sender, ToolStripDropDownClosingEventArgs e)
+ private void ContextMenuStrip_Closing(object? sender, ToolStripDropDownClosingEventArgs e)
{
- var cms = sender as ContextMenuStrip;
- if (cms != null)
+ if (sender is ContextMenuStrip cms)
{
cms.Closing -= ContextMenuStrip_Closing;
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButtonPanel.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButtonPanel.cs
index 95f32dc9d..f2ddea73f 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButtonPanel.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButtonPanel.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCheckBox.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCheckBox.cs
index c2982ec45..eeae51064 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCheckBox.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCheckBox.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -669,15 +669,15 @@ protected virtual void OnKryptonCommandChanged(EventArgs e)
///
/// Source of the event.
/// A PropertyChangedEventArgs that contains the event data.
- protected virtual void OnCommandPropertyChanged(object sender, PropertyChangedEventArgs e)
+ protected virtual void OnCommandPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
switch (e.PropertyName)
{
case nameof(Enabled):
- Enabled = KryptonCommand.Enabled;
+ Enabled = KryptonCommand!.Enabled;
break;
case nameof(CheckState):
- CheckState = KryptonCommand.CheckState;
+ CheckState = KryptonCommand!.CheckState;
break;
case nameof(Text):
case @"ExtraText":
@@ -819,9 +819,9 @@ protected override bool EvalTransparentPaint() =>
#endregion
#region Implementation
- private void OnCheckBoxTextChanged(object sender, EventArgs e) => OnTextChanged(EventArgs.Empty);
+ private void OnCheckBoxTextChanged(object? sender, EventArgs e) => OnTextChanged(EventArgs.Empty);
- private void OnControllerClick(object sender, EventArgs e) => OnClick(e);
+ private void OnControllerClick(object? sender, EventArgs e) => OnClick(e);
private void UpdateForOrientation()
{
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCheckButton.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCheckButton.cs
index aaa4c8318..3d751747e 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCheckButton.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCheckButton.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -256,11 +256,11 @@ protected override void OnKryptonCommandChanged(EventArgs e)
///
/// Source of the event.
/// A PropertyChangedEventArgs that contains the event data.
- protected override void OnCommandPropertyChanged(object sender, PropertyChangedEventArgs e)
+ protected override void OnCommandPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
Checked = e.PropertyName switch
{
- nameof(CheckState) => KryptonCommand.Checked,
+ nameof(CheckState) => KryptonCommand!.Checked,
_ => Checked
};
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCheckSet.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCheckSet.cs
index d7a418f78..062dd5d6e 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCheckSet.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCheckSet.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -43,7 +43,7 @@ public class KryptonCheckButtonCollection : CollectionBase
public KryptonCheckButtonCollection([DisallowNull] KryptonCheckSet owner)
{
Debug.Assert(owner != null);
- _owner = owner;
+ _owner = owner!;
}
#endregion
@@ -81,7 +81,7 @@ public int Add([DisallowNull] KryptonCheckButton checkButton)
///
/// The KryptonCheckButton to locate in the collection.
/// True if found in collection; otherwise false.
- public bool Contains(KryptonCheckButton checkButton) =>
+ public bool Contains(KryptonCheckButton? checkButton) =>
// ReSharper disable RedundantBaseQualifier
base.List.Contains(checkButton);
// ReSharper restore RedundantBaseQualifier
@@ -91,7 +91,7 @@ public bool Contains(KryptonCheckButton checkButton) =>
///
/// The KryptonCheckButton to locate.
/// Index of reference; otherwise -1.
- public int IndexOf(KryptonCheckButton checkButton) =>
+ public int IndexOf(KryptonCheckButton? checkButton) =>
// ReSharper disable RedundantBaseQualifier
base.List.IndexOf(checkButton);
// ReSharper restore RedundantBaseQualifier
@@ -157,7 +157,7 @@ public void Remove([DisallowNull] KryptonCheckButton checkButton)
///
/// Index of entry to return.
/// Reference of KryptonCheckButton instance.
- public KryptonCheckButton this[int index]
+ public KryptonCheckButton? this[int index]
{
get
{
@@ -167,7 +167,7 @@ public KryptonCheckButton this[int index]
}
// ReSharper disable RedundantBaseQualifier
- return (KryptonCheckButton)base.List[index];
+ return base.List[index] as KryptonCheckButton;
// ReSharper restore RedundantBaseQualifier
}
}
@@ -426,7 +426,7 @@ private void CheckButtonAdded(KryptonCheckButton? checkButton)
}
// If the incoming button is already checked
- if (checkButton.Checked)
+ if (checkButton.Checked)
{
// If we already have a button checked
if (_checkedButton != null)
@@ -469,26 +469,26 @@ private void CheckButtonRemoved(KryptonCheckButton? checkButton)
}
}
- private void OnCheckedChanging(object sender, CancelEventArgs e)
+ private void OnCheckedChanging(object? sender, CancelEventArgs e)
{
// Are we allowed to process the event?
if (!_ignoreEvents)
{
// Cast to the correct type
- var checkedButton = (KryptonCheckButton)sender;
+ var checkedButton = sender as KryptonCheckButton ?? throw new ArgumentNullException(nameof(sender));
// Prevent the checked button becoming unchecked unless AllowUncheck is defined
e.Cancel = checkedButton.Checked && !AllowUncheck;
}
}
- private void OnCheckedChanged(object sender, EventArgs e)
+ private void OnCheckedChanged(object? sender, EventArgs e)
{
// Are we allowed to process the event?
if (!_ignoreEvents)
{
// Cast to the correct type
- var checkedButton = (KryptonCheckButton)sender;
+ var checkedButton = sender as KryptonCheckButton ?? throw new ArgumentNullException(nameof(sender));
if (checkedButton.Checked)
{
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCheckedListBox.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCheckedListBox.cs
index ad7a981ad..2fe82509a 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCheckedListBox.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCheckedListBox.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -45,7 +45,7 @@ public class CheckedIndexCollection : IList
internal CheckedIndexCollection(KryptonCheckedListBox owner)
{
_owner = owner;
- _internalListBox = (InternalCheckedListBox)owner.ListBox!;
+ _internalListBox = (InternalCheckedListBox)owner.ListBox;
}
#endregion
@@ -119,7 +119,7 @@ public int IndexOf(int index)
///
/// Item index.
/// Item at specified index.
- public object this[int index]
+ public object? this[int index]
{
get
{
@@ -132,13 +132,13 @@ public object this[int index]
#endregion
#region Private
- int IList.Add(object value) => throw new NotSupportedException(@"Read Only Collection");
+ int IList.Add(object? value) => throw new NotSupportedException(@"Read Only Collection");
void IList.Clear() => throw new NotSupportedException(@"Read Only Collection");
- void IList.Insert(int index, object value) => throw new NotSupportedException(@"Read Only Collection");
+ void IList.Insert(int index, object? value) => throw new NotSupportedException(@"Read Only Collection");
- void IList.Remove(object value) => throw new NotSupportedException(@"Read Only Collection");
+ void IList.Remove(object? value) => throw new NotSupportedException(@"Read Only Collection");
void IList.RemoveAt(int index) => throw new NotSupportedException(@"Read Only Collection");
@@ -150,7 +150,15 @@ public object this[int index]
private object InnerArrayGetEntryObject(int index, int stateMask) => _internalListBox.InnerArrayGetEntryObject(index, stateMask);
- private int InnerArrayIndexOfIdentifier(object identifier, int stateMask) => _internalListBox.InnerArrayIndexOfIdentifier(identifier, stateMask);
+ private int InnerArrayIndexOfIdentifier(object? identifier, int stateMask)
+ {
+#if NET6_0_OR_GREATER
+// https://github.com/dotnet/winforms/commit/1f4a593a6de32e75ff0f5fa97d35191c1facbc93#diff-c4db2c84a2a605af84487ad4386f94c42193826e71b7cf8d297c610c034245f9
+ return _internalListBox.InnerArrayIndexOf(identifier, stateMask);
+#else
+ return _internalListBox.InnerArrayIndexOfIdentifier(identifier, stateMask);
+#endif
+ }
#endregion
}
@@ -183,7 +191,7 @@ static CheckedItemCollection()
/// Initialize a new instance of the CheckedItemCollection class.
///
/// Reference to owning control.
- internal CheckedItemCollection(KryptonCheckedListBox owner) => _internalListBox = (InternalCheckedListBox)owner.ListBox!;
+ internal CheckedItemCollection(KryptonCheckedListBox owner) => _internalListBox = (InternalCheckedListBox)owner.ListBox;
#endregion
@@ -193,7 +201,7 @@ static CheckedItemCollection()
///
/// Object reference.
/// True if button spec found; otherwise false.
- public bool Contains(object item) => IndexOf(item) != -1;
+ public bool Contains(object? item) => IndexOf(item) != -1;
///
/// Copies all the elements of the current collection to the specified Array.
@@ -220,14 +228,14 @@ public void CopyTo(Array array, int index)
///
/// Object reference.
/// -1 if not found; otherwise index position.
- public int IndexOf(object item) => InnerArrayIndexOf(item, _anyItemMask);
+ public int IndexOf(object? item) => InnerArrayIndexOf(item, _anyItemMask);
///
/// Determines the index of the specified spec in the collection.
///
/// Object reference.
/// -1 if not found; otherwise index position.
- public int IndexOfIdentifier(object item) => InnerArrayIndexOfIdentifier(item, _anyItemMask);
+ public int IndexOfIdentifier(object? item) => InnerArrayIndexOfIdentifier(item, _anyItemMask);
///
/// Gets the number of items in collection.
@@ -244,7 +252,7 @@ public void CopyTo(Array array, int index)
///
/// Item index.
/// Item at specified index.
- public object this[int index]
+ public object? this[int index]
{
get => InnerArrayGetItem(index, _anyItemMask);
set => throw new NotSupportedException(@"Read Only Collection");
@@ -291,9 +299,9 @@ internal void SetCheckedState(int index, CheckState value)
void IList.Clear() => throw new NotSupportedException(@"Read Only Collection");
- void IList.Insert(int index, object value) => throw new NotSupportedException(@"Read Only Collection");
+ void IList.Insert(int index, object? value) => throw new NotSupportedException(@"Read Only Collection");
- void IList.Remove(object value) => throw new NotSupportedException(@"Read Only Collection");
+ void IList.Remove(object? value) => throw new NotSupportedException(@"Read Only Collection");
void IList.RemoveAt(int index) => throw new NotSupportedException(@"Read Only Collection");
@@ -305,9 +313,9 @@ internal void SetCheckedState(int index, CheckState value)
private int InnerArrayGetCount(int stateMask) => _internalListBox.InnerArrayGetCount(stateMask);
- private int InnerArrayIndexOf(object item, int stateMask) => _internalListBox.InnerArrayIndexOf(item, stateMask);
+ private int InnerArrayIndexOf(object? item, int stateMask) => _internalListBox.InnerArrayIndexOf(item, stateMask);
- private int InnerArrayIndexOfIdentifier(object identifier, int stateMask) => _internalListBox.InnerArrayIndexOfIdentifier(identifier, stateMask);
+ private int InnerArrayIndexOfIdentifier(object? identifier, int stateMask) => _internalListBox.InnerArrayIndexOfIdentifier(identifier, stateMask);
private object InnerArrayGetItem(int index, int stateMask) => _internalListBox.InnerArrayGetItem(index, stateMask);
@@ -347,7 +355,7 @@ public ObjectCollection(KryptonCheckedListBox owner)
/// An object representing the item to add to the collection.
/// true to check the item; otherwise, false
/// The index of the newly added item.
- public int Add(object item, bool isChecked) => Add(item, isChecked ? CheckState.Checked : CheckState.Unchecked);
+ public int Add(object? item, bool isChecked) => Add(item, isChecked ? CheckState.Checked : CheckState.Unchecked);
///
/// Adds an item to the list of items for a CheckedListBox, specifying the object to add and the initial checked value.
@@ -355,9 +363,9 @@ public ObjectCollection(KryptonCheckedListBox owner)
/// An object representing the item to add to the collection.
/// The initial CheckState for the checked portion of the item.
/// The index of the newly added item.
- public int Add(object item, CheckState check)
+ public int Add(object? item, CheckState check)
{
- var index = base.Add(item);
+ var index = base.Add(item!);
_owner.SetItemCheckState(index, check);
return index;
}
@@ -507,7 +515,7 @@ public override DrawMode DrawMode
}
///
- /// Force the remeasure of items so they are sized correctly.
+ /// Force the remeasure of items, so they are sized correctly.
///
public void RefreshItemSizes()
{
@@ -733,40 +741,41 @@ internal int InnerArrayGetCount(int stateMask)
{
if (_miGetCount == null)
{
- _miGetCount = InnerArray?.GetType().GetMethod(@"GetCount", new[] { typeof(int) }, null);
+ _miGetCount = InnerArray?.GetType().GetMethod(@"GetCount", [typeof(int)], null);
}
- return (int)_miGetCount.Invoke(InnerArray, new object[] { stateMask });
+ return (int)_miGetCount?.Invoke(InnerArray, [stateMask])!;
}
- internal int InnerArrayIndexOf(object item, int stateMask)
+ internal int InnerArrayIndexOf(object? item, int stateMask)
{
if (_miIndexOf == null)
{
- _miIndexOf = InnerArray?.GetType().GetMethod(@"IndexOf", new[] { typeof(object), typeof(int) }, null);
+ _miIndexOf = InnerArray?.GetType().GetMethod(@"IndexOf", [typeof(object), typeof(int)], null);
}
- return (int)_miIndexOf.Invoke(InnerArray, new[] { item, stateMask });
+ return (int)_miIndexOf?.Invoke(InnerArray, [item, stateMask])!;
}
- internal int InnerArrayIndexOfIdentifier(object identifier, int stateMask)
+ internal int InnerArrayIndexOfIdentifier(object? identifier, int stateMask)
{
if (_miIndexOfIdentifier == null)
{
- _miIndexOfIdentifier = InnerArray?.GetType().GetMethod(@"IndexOfIdentifier", new[] { typeof(object), typeof(int) }, null);
+ _miIndexOfIdentifier = InnerArray?.GetType().GetMethod(@"IndexOfIdentifier", [typeof(object), typeof(int)
+ ], null);
}
- return (int)_miIndexOfIdentifier.Invoke(InnerArray, new[] { identifier, stateMask });
+ return (int)_miIndexOfIdentifier?.Invoke(InnerArray, [identifier, stateMask])!;
}
internal object InnerArrayGetItem(int index, int stateMask)
{
if (_miGetItem == null)
{
- _miGetItem = InnerArray?.GetType().GetMethod(@"GetItem", new[] { typeof(int), typeof(int) }, null);
+ _miGetItem = InnerArray?.GetType().GetMethod(@"GetItem", [typeof(int), typeof(int)], null);
}
- return _miGetItem.Invoke(InnerArray, new object[] { index, stateMask });
+ return _miGetItem?.Invoke(InnerArray, [index, stateMask])!;
}
internal object InnerArrayGetEntryObject(int index, int stateMask)
@@ -776,37 +785,37 @@ internal object InnerArrayGetEntryObject(int index, int stateMask)
_miGetEntryObject = InnerArray?.GetType().GetMethod(@"GetEntryObject", BindingFlags.NonPublic | BindingFlags.Instance);
}
- return _miGetEntryObject.Invoke(InnerArray, new object[] { index, stateMask });
+ return _miGetEntryObject?.Invoke(InnerArray, [index, stateMask])!;
}
internal bool InnerArrayGetState(int index, int stateMask)
{
if (_miGetState == null)
{
- _miGetState = InnerArray?.GetType().GetMethod(@"GetState", new[] { typeof(int), typeof(int) }, null);
+ _miGetState = InnerArray?.GetType().GetMethod(@"GetState", [typeof(int), typeof(int)], null);
}
- return (bool)_miGetState.Invoke(InnerArray, new object[] { index, stateMask });
+ return (bool)_miGetState?.Invoke(InnerArray, [index, stateMask])!;
}
internal void InnerArraySetState(int index, int stateMask, bool value)
{
if (_miSetState == null)
{
- _miSetState = InnerArray?.GetType().GetMethod(@"SetState", new[] { typeof(int), typeof(int), typeof(bool) }, null);
+ _miSetState = InnerArray?.GetType().GetMethod(@"SetState", [typeof(int), typeof(int), typeof(bool)], null);
}
- _miSetState.Invoke(InnerArray, new object[] { index, stateMask, value });
+ _miSetState?.Invoke(InnerArray, [index, stateMask, value]);
}
internal IEnumerator InnerArrayGetEnumerator(int stateMask, bool anyBit)
{
if (_miGetEnumerator == null)
{
- _miGetEnumerator = InnerArray?.GetType().GetMethod(@"GetEnumerator", new[] { typeof(int), typeof(bool) }, null);
+ _miGetEnumerator = InnerArray?.GetType().GetMethod(@"GetEnumerator", [typeof(int), typeof(bool)], null);
}
- return (IEnumerator)_miGetEnumerator.Invoke(InnerArray, new object[] { stateMask, anyBit });
+ return (IEnumerator)_miGetEnumerator?.Invoke(InnerArray, [stateMask, anyBit])!;
}
#endregion
@@ -868,7 +877,7 @@ private void WmPaint(ref Message m)
// Now blit from the bitmap from the screen to the real dc
PI.BitBlt(hdc, 0, 0, realRect.Width, realRect.Height, _screenDC, 0, 0, PI.SRCCOPY);
- // When disabled with no items the above code does not draw the background! Strange but true and
+ // When disabled with no items the above code does not draw the background! Strange but true, and
// so we need to draw the background instead directly, without using a bit blitting of bitmap
if (Items.Count == 0)
{
@@ -952,7 +961,7 @@ private void LbnSelChange()
private readonly ViewDrawCheckBox _drawCheckBox;
private readonly ViewLayoutFill _layoutFill;
private readonly ViewDrawButton _drawButton;
- private readonly InternalCheckedListBox? _listBox;
+ private readonly InternalCheckedListBox _listBox;
private readonly FixedContentValue? _contentValues;
private bool? _fixedActive;
private ButtonStyle _style;
@@ -962,9 +971,6 @@ private void LbnSelChange()
private bool _alwaysActive;
private bool _forcedLayout;
private bool _trackingMouseEnter;
- private float _cornerRoundingRadius;
- private float _itemCornerRoundingRadius;
-
#endregion
#region Events
@@ -1200,13 +1206,9 @@ public KryptonCheckedListBox()
// Add text box to the controls collection
((KryptonReadOnlyControls)Controls).AddInternal(_listBox);
-
- _cornerRoundingRadius = GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
- _itemCornerRoundingRadius = GlobalStaticValues.SECONDARY_CORNER_ROUNDING_VALUE;
}
- private void OnCheckedListClick(object sender, EventArgs e) =>
+ private void OnCheckedListClick(object? sender, EventArgs e) =>
// ReSharper disable RedundantBaseQualifier
base.OnClick(e);
// ReSharper restore RedundantBaseQualifier
@@ -1226,37 +1228,13 @@ protected override void Dispose(bool disposing)
#endregion
#region Public
- /// Gets or sets the corner rounding radius.
- /// The corner rounding radius.
- [Category(@"Visuals")]
- [Description(@"Gets or sets the corner rounding radius.")]
- [DefaultValue(GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE)]
- public float CornerRoundingRadius
- {
- get => _cornerRoundingRadius;
-
- set => SetCornerRoundingRadius(value);
- }
-
- /// Gets or sets the item corner rounding radius.
- /// The item corner rounding radius.
- [Category(@"Visuals")]
- [Description(@"Gets or sets the item corner rounding radius.")]
- [DefaultValue(GlobalStaticValues.SECONDARY_CORNER_ROUNDING_VALUE)]
- public float ItemCornerRoundingRadius
- {
- get => _itemCornerRoundingRadius;
-
- set => SetItemCornerRoundingRadius(value);
- }
-
///
/// Gets access to the contained CheckedListBox instance.
///
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[EditorBrowsable(EditorBrowsableState.Always)]
[Browsable(false)]
- public ListBox? ListBox => _listBox;
+ public ListBox ListBox => _listBox;
///
/// Gets access to the contained input control.
@@ -1264,7 +1242,7 @@ public float ItemCornerRoundingRadius
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[EditorBrowsable(EditorBrowsableState.Always)]
[Browsable(false)]
- public Control ContainedControl => ListBox!;
+ public Control ContainedControl => ListBox;
///
/// Gets or sets the text for the control.
@@ -1305,7 +1283,7 @@ public override Color BackColor
public override Font Font
{
get => base.Font;
- set => base.Font = value;
+ set => base.Font = value!;
}
///
@@ -1345,7 +1323,7 @@ public override Color ForeColor
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public int SelectedIndex
{
- get => _listBox?.SelectedIndex ?? -1;
+ get => _listBox.SelectedIndex;
set => _listBox.SelectedIndex = value;
}
@@ -1359,8 +1337,8 @@ public int SelectedIndex
[DefaultValue(null)]
public object? SelectedValue
{
- get => _listBox?.SelectedValue;
- set => _listBox.SelectedValue = value;
+ get => _listBox.SelectedValue;
+ set => _listBox.SelectedValue = value!;
}
///
@@ -1368,7 +1346,7 @@ public object? SelectedValue
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public ListBox.SelectedIndexCollection SelectedIndices => _listBox.SelectedIndices ?? new ListBox.SelectedIndexCollection(null);
+ public ListBox.SelectedIndexCollection SelectedIndices => _listBox.SelectedIndices;
///
/// Gets or sets the currently selected item in the KryptonCheckedListBox.
@@ -1378,7 +1356,7 @@ public object? SelectedValue
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public object? SelectedItem
{
- get => _listBox?.SelectedItem;
+ get => _listBox.SelectedItem;
set => _listBox.SelectedItem = value;
}
@@ -1387,7 +1365,7 @@ public object? SelectedItem
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public ListBox.SelectedObjectCollection SelectedItems => _listBox?.SelectedItems ?? new ListBox.SelectedObjectCollection(null);
+ public ListBox.SelectedObjectCollection SelectedItems => _listBox.SelectedItems;
///
/// Gets or sets the index of the first visible item in the KryptonCheckedListBox.
@@ -1396,7 +1374,7 @@ public object? SelectedItem
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public int TopIndex
{
- get => _listBox?.TopIndex ?? -1;
+ get => _listBox.TopIndex;
set => _listBox.TopIndex = value;
}
@@ -1435,7 +1413,7 @@ public ButtonStyle ItemStyle
[DefaultValue(0)]
public virtual int HorizontalExtent
{
- get => _listBox?.HorizontalExtent ?? -1;
+ get => _listBox.HorizontalExtent;
set => _listBox.HorizontalExtent = value;
}
@@ -1448,7 +1426,7 @@ public virtual int HorizontalExtent
[DefaultValue(false)]
public virtual bool HorizontalScrollbar
{
- get => _listBox?.HorizontalScrollbar ?? false;
+ get => _listBox.HorizontalScrollbar;
set => _listBox.HorizontalScrollbar = value;
}
@@ -1461,7 +1439,7 @@ public virtual bool HorizontalScrollbar
[DefaultValue(false)]
public virtual bool ScrollAlwaysVisible
{
- get => _listBox?.ScrollAlwaysVisible ?? false;
+ get => _listBox.ScrollAlwaysVisible;
set => _listBox.ScrollAlwaysVisible = value;
}
@@ -1481,7 +1459,7 @@ public virtual bool ScrollAlwaysVisible
[DefaultValue(CheckedSelectionMode.One)]
public virtual CheckedSelectionMode SelectionMode
{
- get => _listBox?.SelectionMode == System.Windows.Forms.SelectionMode.One
+ get => _listBox.SelectionMode == System.Windows.Forms.SelectionMode.One
? CheckedSelectionMode.One
: CheckedSelectionMode.None;
@@ -1498,7 +1476,7 @@ public virtual CheckedSelectionMode SelectionMode
[DefaultValue(false)]
public virtual bool Sorted
{
- get => _listBox?.Sorted ?? false;
+ get => _listBox.Sorted;
set => _listBox.Sorted = value;
}
@@ -1512,7 +1490,7 @@ public virtual bool Sorted
[MergableProperty(false)]
[Localizable(true)]
// ReSharper disable once MemberCanBeProtected.Global
- public virtual ListBox.ObjectCollection Items => _listBox?.Items ?? new ListBox.ObjectCollection(null);
+ public virtual ListBox.ObjectCollection Items => _listBox.Items;
///
/// Collection of checked items in this KryptonCheckedListBox.
@@ -1537,7 +1515,7 @@ public virtual bool Sorted
[DefaultValue(@"")]
public string FormatString
{
- get => _listBox?.FormatString ?? string.Empty;
+ get => _listBox.FormatString;
set => _listBox.FormatString = value;
}
@@ -1548,7 +1526,7 @@ public string FormatString
[DefaultValue(false)]
public bool FormattingEnabled
{
- get => _listBox?.FormattingEnabled ?? false;
+ get => _listBox.FormattingEnabled;
set => _listBox.FormattingEnabled = value;
}
@@ -1611,7 +1589,7 @@ public PaletteBorderStyle BorderStyle
private bool ShouldSerializeOverrideFocus() => !OverrideFocus.IsDefault;
///
- /// Gets access to the check box image value overrides.
+ /// Gets access to the checkbox image value overrides.
///
[Category(@"Visuals")]
[Description(@"CheckBox image value overrides.")]
@@ -1626,7 +1604,7 @@ public PaletteBorderStyle BorderStyle
[Category(@"Visuals")]
[Description(@"Overrides for defining common appearance that other states can override.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public PaletteListStateRedirect? StateCommon { get; }
+ public PaletteListStateRedirect StateCommon { get; }
private bool ShouldSerializeStateCommon() => !StateCommon.IsDefault;
@@ -1733,7 +1711,7 @@ public bool AlwaysActive
///
/// Unselects all items in the KryptonCheckedListBox.
///
- public void ClearSelected() => _listBox?.ClearSelected();
+ public void ClearSelected() => _listBox.ClearSelected();
///
/// Returns a value indicating whether the specified item is checked.
@@ -1787,7 +1765,7 @@ public void SetItemCheckState(int index, CheckState value)
if (ice.NewValue != checkedState)
{
CheckedItems.SetCheckedState(index, ice.NewValue);
- _listBox?.Invalidate();
+ _listBox.Invalidate();
}
}
}
@@ -1797,7 +1775,7 @@ public void SetItemCheckState(int index, CheckState value)
///
/// The String to search for.
/// The zero-based index of the first item found; returns -1 if no match is found.
- public int FindString(string str) => _listBox?.FindString(str) ?? -1;
+ public int FindString(string str) => _listBox.FindString(str);
///
/// Finds the first item after the given index which starts with the given string. The search is not case sensitive.
@@ -1805,14 +1783,14 @@ public void SetItemCheckState(int index, CheckState value)
/// The String to search for.
/// The zero-based index of the item before the first item to be searched. Set to -1 to search from the beginning of the control.
/// The zero-based index of the first item found; returns -1 if no match is found, or 0 if the s parameter specifies Empty.
- public int FindString(string str, int startIndex) => _listBox?.FindString(str, startIndex) ?? -1;
+ public int FindString(string str, int startIndex) => _listBox.FindString(str, startIndex);
///
/// Finds the first item in the list box that matches the specified string.
///
/// The String to search for.
/// The zero-based index of the first item found; returns -1 if no match is found.
- public int FindStringExact(string str) => _listBox?.FindStringExact(str) ?? -1;
+ public int FindStringExact(string str) => _listBox.FindStringExact(str);
///
/// Finds the first item after the specified index that matches the specified string.
@@ -1820,35 +1798,35 @@ public void SetItemCheckState(int index, CheckState value)
/// The String to search for.
/// The zero-based index of the item before the first item to be searched. Set to -1 to search from the beginning of the control.
/// The zero-based index of the first item found; returns -1 if no match is found, or 0 if the s parameter specifies Empty.
- public int FindStringExact(string str, int startIndex) => _listBox?.FindStringExact(str, startIndex) ?? -1;
+ public int FindStringExact(string str, int startIndex) => _listBox.FindStringExact(str, startIndex);
///
/// Returns the height of an item in the KryptonCheckedListBox.
///
/// The index of the item to return the height of.
/// The height, in pixels, of the item at the specified index.
- public int GetItemHeight(int index) => _listBox?.GetItemHeight(index) ?? 0;
+ public int GetItemHeight(int index) => _listBox.GetItemHeight(index);
///
/// Returns the bounding rectangle for an item in the KryptonCheckedListBox.
///
/// The zero-based index of item whose bounding rectangle you want to return.
/// A Rectangle that represents the bounding rectangle for the specified item.
- public Rectangle GetItemRectangle(int index) => _listBox?.GetItemRectangle(index) ?? Rectangle.Empty;
+ public Rectangle GetItemRectangle(int index) => _listBox.GetItemRectangle(index);
///
/// Returns a value indicating whether the specified item is selected.
///
/// The zero-based index of the item that determines whether it is selected.
/// true if the specified item is currently selected in the KryptonCheckedListBox; otherwise, false.
- public bool GetSelected(int index) => _listBox?.GetSelected(index) ?? false;
+ public bool GetSelected(int index) => _listBox.GetSelected(index);
///
/// Returns the zero-based index of the item at the specified coordinates.
///
/// A Point object containing the coordinates used to obtain the item index.
/// The zero-based index of the item found at the specified coordinates; returns ListBox.NoMatches if no match is found.
- public int IndexFromPoint(Point p) => _listBox?.IndexFromPoint(p) ?? ListBox.NoMatches;
+ public int IndexFromPoint(Point p) => _listBox.IndexFromPoint(p);
///
/// Returns the zero-based index of the item at the specified coordinates.
@@ -1856,14 +1834,14 @@ public void SetItemCheckState(int index, CheckState value)
/// The x-coordinate of the location to search.
/// The y-coordinate of the location to search.
/// The zero-based index of the item found at the specified coordinates; returns ListBox.NoMatches if no match is found.
- public int IndexFromPoint(int x, int y) => _listBox?.IndexFromPoint(x, y) ?? ListBox.NoMatches;
+ public int IndexFromPoint(int x, int y) => _listBox.IndexFromPoint(x, y);
///
/// Selects or clears the selection for the specified item in a KryptonCheckedListBox.
///
/// The zero-based index of the item in a KryptonCheckedListBox to select or clear the selection for.
/// true to select the specified item; otherwise, false.
- public void SetSelected(int index, bool value) => _listBox?.SetSelected(index, value);
+ public void SetSelected(int index, bool value) => _listBox.SetSelected(index, value);
///
/// Returns the text representation of the specified item.
@@ -1872,17 +1850,17 @@ public void SetItemCheckState(int index, CheckState value)
/// If the DisplayMember property is not specified,
/// the value returned by GetItemText is the value of the item's ToString method.
/// Otherwise, the method returns the string value of the member specified in the DisplayMember property for the object specified in the item parameter.
- public string GetItemText(object item) => _listBox?.GetItemText(item) ?? string.Empty;
+ public string? GetItemText(object? item) => _listBox.GetItemText(item);
///
/// Maintains performance while items are added to the ListBox one at a time by preventing the control from drawing until the EndUpdate method is called.
///
- public void BeginUpdate() => _listBox?.BeginUpdate();
+ public void BeginUpdate() => _listBox.BeginUpdate();
///
/// Resumes painting the ListBox control after painting is suspended by the BeginUpdate method.
///
- public void EndUpdate() => _listBox?.EndUpdate();
+ public void EndUpdate() => _listBox.EndUpdate();
///
/// Sets the fixed state of the control.
@@ -1895,18 +1873,18 @@ public void SetItemCheckState(int index, CheckState value)
///
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
- public bool IsActive => _fixedActive ?? DesignMode || AlwaysActive || ContainsFocus || _mouseOver || (_listBox?.MouseOver ?? false);
+ public bool IsActive => _fixedActive ?? DesignMode || AlwaysActive || ContainsFocus || _mouseOver || (_listBox.MouseOver);
///
/// Sets input focus to the control.
///
/// true if the input focus request was successful; otherwise, false.
- public new bool Focus() => ListBox?.Focus() == true;
+ public new bool Focus() => ListBox.Focus();
///
/// Activates the control.
///
- public new void Select() => ListBox?.Select();
+ public new void Select() => ListBox.Select();
#endregion
#region Protected
@@ -1982,12 +1960,9 @@ protected void ForceControlLayout()
/// An EventArgs that contains the event data.
protected override void OnPaletteChanged(EventArgs e)
{
- if (_listBox != null)
- {
- _listBox.Recreate();
- _listBox.RefreshItemSizes();
- _listBox.Invalidate();
- }
+ _listBox.Recreate();
+ _listBox.RefreshItemSizes();
+ _listBox.Invalidate();
base.OnPaletteChanged(e);
}
@@ -1997,9 +1972,9 @@ protected override void OnPaletteChanged(EventArgs e)
///
/// Source of notification.
/// An NeedLayoutEventArgs containing event data.
- protected override void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e)
+ protected override void OnPaletteNeedPaint(object? sender, NeedLayoutEventArgs e)
{
- _listBox?.RefreshItemSizes();
+ _listBox.RefreshItemSizes();
base.OnPaletteChanged(e);
}
@@ -2071,9 +2046,9 @@ protected override void OnCausesValidationChanged(EventArgs e)
/// Raises the Paint event.
///
/// An PaintEventArgs that contains the event data.
- protected override void OnPaint(PaintEventArgs e)
+ protected override void OnPaint(PaintEventArgs? e)
{
- Paint?.Invoke(this, e);
+ Paint?.Invoke(this, e!);
base.OnPaint(e);
}
@@ -2121,7 +2096,7 @@ protected override void OnNeedPaint(object? sender, NeedLayoutEventArgs e)
{
if (IsHandleCreated && !e.NeedLayout)
{
- _listBox?.Invalidate();
+ _listBox.Invalidate();
}
else
{
@@ -2143,10 +2118,10 @@ protected override void OnLayout(LayoutEventArgs levent)
// Only use layout logic if control is fully initialized or if being forced
// to allow a relayout or if in design mode.
- if (IsHandleCreated || _forcedLayout || (DesignMode && (_listBox != null)))
+ if (IsHandleCreated || _forcedLayout || (DesignMode))
{
Rectangle fillRect = _layoutFill.FillRect;
- _listBox?.SetBounds(fillRect.X, fillRect.Y, fillRect.Width, fillRect.Height);
+ _listBox.SetBounds(fillRect.X, fillRect.Y, fillRect.Width, fillRect.Height);
}
}
@@ -2158,7 +2133,7 @@ protected override void OnMouseEnter(EventArgs e)
{
_mouseOver = true;
PerformNeedPaint(true);
- _listBox?.Invalidate();
+ _listBox.Invalidate();
base.OnMouseEnter(e);
}
@@ -2170,7 +2145,7 @@ protected override void OnMouseLeave(EventArgs e)
{
_mouseOver = false;
PerformNeedPaint(true);
- _listBox?.Invalidate();
+ _listBox.Invalidate();
base.OnMouseLeave(e);
}
@@ -2189,28 +2164,20 @@ private void UpdateStateAndPalettes()
// Get the correct palette settings to use
IPaletteDouble doubleState = GetDoubleState();
_listBox.ViewDrawPanel.SetPalettes(doubleState.PaletteBack);
- _drawDockerOuter.SetPalettes(doubleState.PaletteBack, doubleState.PaletteBorder);
+ _drawDockerOuter.SetPalettes(doubleState.PaletteBack, doubleState.PaletteBorder!);
_drawDockerOuter.Enabled = Enabled;
// Find the new state of the main view element
- PaletteState state;
- if (IsActive)
- {
- state = PaletteState.Tracking;
- }
- else
- {
- state = Enabled ? PaletteState.Normal : PaletteState.Disabled;
- }
+ PaletteState state = Enabled ? (IsActive ? PaletteState.Tracking : PaletteState.Normal) : PaletteState.Disabled;
_listBox.ViewDrawPanel.ElementState = state;
_drawDockerOuter.ElementState = state;
}
}
- private IPaletteDouble GetDoubleState() => Enabled ? IsActive ? StateActive : StateNormal : StateDisabled;
+ private IPaletteDouble GetDoubleState() => Enabled ? (IsActive ? StateActive : StateNormal) : StateDisabled;
- private void OnListBoxDrawItem(object sender, DrawItemEventArgs e)
+ private void OnListBoxDrawItem(object? sender, DrawItemEventArgs e)
{
// We cannot do anything with an invalid index
if (e.Index < 0)
@@ -2221,7 +2188,7 @@ private void OnListBoxDrawItem(object sender, DrawItemEventArgs e)
// Update our content object with values from the list item
UpdateContentFromItemIndex(e.Index);
- // By default the button is in the normal state
+ // By default, the button is in the normal state
var buttonState = PaletteState.Normal;
// Is this item disabled
@@ -2325,7 +2292,7 @@ private void OnListBoxDrawItem(object sender, DrawItemEventArgs e)
}
}
- private void OnListBoxMeasureItem(object sender, MeasureItemEventArgs e)
+ private void OnListBoxMeasureItem(object? sender, MeasureItemEventArgs e)
{
UpdateContentFromItemIndex(e.Index);
@@ -2342,7 +2309,7 @@ private void UpdateContentFromItemIndex(int index)
// If the object exposes the rich interface then use is...
if (Items[index] is IContentValues itemValues)
{
- _contentValues.ShortText = itemValues.GetShortText();
+ _contentValues!.ShortText = itemValues.GetShortText();
_contentValues.LongText = itemValues.GetLongText();
_contentValues.Image = itemValues.GetImage(PaletteState.Normal);
_contentValues.ImageTransparentColor = itemValues.GetImageTransparentColor(PaletteState.Normal);
@@ -2350,14 +2317,14 @@ private void UpdateContentFromItemIndex(int index)
else
{
// Get the text string for the item
- _contentValues.ShortText = _listBox?.GetItemText(Items[index]);
+ _contentValues!.ShortText = _listBox.GetItemText(Items[index]);
_contentValues.LongText = null;
_contentValues.Image = null;
- _contentValues.ImageTransparentColor = Color.Empty;
+ _contentValues.ImageTransparentColor = GlobalStaticValues.EMPTY_COLOR;
}
}
- private void OnListBoxSelectedIndexChanged(object sender, EventArgs e)
+ private void OnListBoxSelectedIndexChanged(object? sender, EventArgs e)
{
// Only interested in changes of selected index
if (_lastSelectedIndex != _listBox.SelectedIndex)
@@ -2369,52 +2336,52 @@ private void OnListBoxSelectedIndexChanged(object sender, EventArgs e)
}
}
- private void OnListBoxSelectedValueChanged(object sender, EventArgs e)
+ private void OnListBoxSelectedValueChanged(object? sender, EventArgs e)
{
UpdateStateAndPalettes();
- _listBox?.Invalidate();
+ _listBox.Invalidate();
OnSelectedValueChanged(e);
}
- private void OnListBoxItemCheck(object sender, ItemCheckEventArgs e) => OnItemCheck(e);
+ private void OnListBoxItemCheck(object? sender, ItemCheckEventArgs e) => OnItemCheck(e);
- private void OnListBoxFormat(object sender, ListControlConvertEventArgs e) => OnFormat(e);
+ private void OnListBoxFormat(object? sender, ListControlConvertEventArgs e) => OnFormat(e);
- private void OnListBoxFormatInfoChanged(object sender, EventArgs e) => OnFormatInfoChanged(e);
+ private void OnListBoxFormatInfoChanged(object? sender, EventArgs e) => OnFormatInfoChanged(e);
- private void OnListBoxFormatStringChanged(object sender, EventArgs e) => OnFormatStringChanged(e);
+ private void OnListBoxFormatStringChanged(object? sender, EventArgs e) => OnFormatStringChanged(e);
- private void OnListBoxFormattingEnabledChanged(object sender, EventArgs e) => OnFormattingEnabledChanged(e);
+ private void OnListBoxFormattingEnabledChanged(object? sender, EventArgs e) => OnFormattingEnabledChanged(e);
- private void OnListBoxGotFocus(object sender, EventArgs e)
+ private void OnListBoxGotFocus(object? sender, EventArgs e)
{
UpdateStateAndPalettes();
- _listBox?.Invalidate();
+ _listBox.Invalidate();
PerformNeedPaint(true);
OnGotFocus(e);
}
- private void OnListBoxLostFocus(object sender, EventArgs e)
+ private void OnListBoxLostFocus(object? sender, EventArgs e)
{
UpdateStateAndPalettes();
- _listBox?.Invalidate();
+ _listBox.Invalidate();
PerformNeedPaint(true);
OnLostFocus(e);
}
- private void OnListBoxKeyPress(object sender, KeyPressEventArgs e) => OnKeyPress(e);
+ private void OnListBoxKeyPress(object? sender, KeyPressEventArgs e) => OnKeyPress(e);
- private void OnListBoxKeyUp(object sender, KeyEventArgs e) => OnKeyUp(e);
+ private void OnListBoxKeyUp(object? sender, KeyEventArgs e) => OnKeyUp(e);
- private void OnListBoxKeyDown(object sender, KeyEventArgs e) => OnKeyDown(e);
+ private void OnListBoxKeyDown(object? sender, KeyEventArgs e) => OnKeyDown(e);
- private void OnListBoxValidated(object sender, EventArgs e) => OnValidated(e);
+ private void OnListBoxValidated(object? sender, EventArgs e) => OnValidated(e);
- private void OnListBoxValidating(object sender, CancelEventArgs e) => OnValidating(e);
+ private void OnListBoxValidating(object? sender, CancelEventArgs e) => OnValidating(e);
- private void OnListBoxPreviewKeyDown(object sender, PreviewKeyDownEventArgs e) => OnPreviewKeyDown(e);
+ private void OnListBoxPreviewKeyDown(object? sender, PreviewKeyDownEventArgs e) => OnPreviewKeyDown(e);
- private void OnListBoxMouseChange(object sender, EventArgs e)
+ private void OnListBoxMouseChange(object? sender, EventArgs e)
{
// Change in tracking state?
if (_listBox.MouseOver != _trackingMouseEnter)
@@ -2434,21 +2401,6 @@ private void OnListBoxMouseChange(object sender, EventArgs e)
}
}
}
-
- private void SetCornerRoundingRadius(float? radius)
- {
- _cornerRoundingRadius = radius ?? GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
- StateCommon.Border.Rounding = _cornerRoundingRadius;
- }
-
- private void SetItemCornerRoundingRadius(float? radius)
- {
- _itemCornerRoundingRadius = radius ?? GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
- StateCommon.Item.Border.Rounding = _itemCornerRoundingRadius;
- }
-
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonColorButton.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonColorButton.cs
index c284324df..b57d48e00 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonColorButton.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonColorButton.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -38,7 +38,7 @@ public class KryptonColorButton : VisualSimpleBase, IButtonControl, IContentValu
private Color _selectedColor;
private Color _emptyBorderColor;
private readonly List _recentColors;
- private Image _wasImage;
+ private Image? _wasImage;
private bool _wasEnabled;
private bool _isDefault;
private bool _useMnemonic;
@@ -47,7 +47,7 @@ public class KryptonColorButton : VisualSimpleBase, IButtonControl, IContentValu
private KryptonColorButtonCustomColorPreviewShape _customColorPreviewShape;
// Context menu items
- private readonly KryptonContextMenu _kryptonContextMenu;
+ private readonly KryptonContextMenu? _kryptonContextMenu;
private readonly KryptonContextMenuSeparator _separatorTheme;
private readonly KryptonContextMenuSeparator _separatorStandard;
private readonly KryptonContextMenuSeparator _separatorRecent;
@@ -129,33 +129,35 @@ public KryptonColorButton()
DialogResult = DialogResult.None;
_useMnemonic = true;
MaxRecentColors = 10;
- _recentColors = new List();
+ _recentColors = [];
_allowFullOpen = true;
// Create the context menu items
_kryptonContextMenu = new KryptonContextMenu();
_separatorTheme = new KryptonContextMenuSeparator();
- _headingTheme = new KryptonContextMenuHeading(KryptonLanguageManager.ColorStrings.ThemeColors); //@"Theme Colors");
+ _headingTheme = new KryptonContextMenuHeading(KryptonManager.Strings.ColorStrings.ThemeColors); //@"Theme Colors");
_colorsTheme = new KryptonContextMenuColorColumns(ColorScheme.OfficeThemes);
_separatorStandard = new KryptonContextMenuSeparator();
- _headingStandard = new KryptonContextMenuHeading(KryptonLanguageManager.ColorStrings.StandardColors); //@"Standard Colors");
+ _headingStandard = new KryptonContextMenuHeading(KryptonManager.Strings.ColorStrings.StandardColors); //@"Standard Colors");
_colorsStandard = new KryptonContextMenuColorColumns(ColorScheme.OfficeStandard);
_separatorRecent = new KryptonContextMenuSeparator();
- _headingRecent = new KryptonContextMenuHeading(KryptonLanguageManager.ColorStrings.RecentColors); //@"Recent Colors");
+ _headingRecent = new KryptonContextMenuHeading(KryptonManager.Strings.ColorStrings.RecentColors); //@"Recent Colors");
_colorsRecent = new KryptonContextMenuColorColumns(ColorScheme.None);
_separatorNoColor = new KryptonContextMenuSeparator();
- _itemNoColor = new KryptonContextMenuItem(/*@"&No Color"*/ KryptonLanguageManager.ColorStrings.NoColor, GenericImageResources.ButtonNoColor, OnClickNoColor);
+ _itemNoColor = new KryptonContextMenuItem(/*@"&No Color"*/ KryptonManager.Strings.ColorStrings.NoColor, GenericImageResources.ButtonNoColor, OnClickNoColor);
_itemsNoColor = new KryptonContextMenuItems();
_itemsNoColor.Items.Add(_itemNoColor);
_separatorMoreColors = new KryptonContextMenuSeparator();
- _itemMoreColors = new KryptonContextMenuItem(/*@"&More Colors..."*/ KryptonLanguageManager.ColorStrings.MoreColors, OnClickMoreColors);
+ _itemMoreColors = new KryptonContextMenuItem(/*@"&More Colors..."*/ KryptonManager.Strings.ColorStrings.MoreColors, OnClickMoreColors);
_itemsMoreColors = new KryptonContextMenuItems();
_itemsMoreColors.Items.Add(_itemMoreColors);
- _kryptonContextMenu.Items.AddRange(new KryptonContextMenuItemBase[] { _separatorTheme, _headingTheme, _colorsTheme,
- _separatorStandard, _headingStandard, _colorsStandard,
- _separatorRecent, _headingRecent, _colorsRecent,
- _separatorNoColor, _itemsNoColor,
- _separatorMoreColors, _itemsMoreColors});
+ _kryptonContextMenu.Items.AddRange([
+ _separatorTheme, _headingTheme, _colorsTheme,
+ _separatorStandard, _headingStandard, _colorsStandard,
+ _separatorRecent, _headingRecent, _colorsRecent,
+ _separatorNoColor, _itemsNoColor,
+ _separatorMoreColors, _itemsMoreColors
+ ]);
// Create content storage
Values = CreateButtonValues(NeedPaintDelegate);
@@ -955,7 +957,7 @@ protected override void OnLostFocus(EventArgs e)
protected override void OnClick(EventArgs e)
{
// Find the form this color button is on
- Form owner = FindForm();
+ Form? owner = FindForm();
// If we find a valid owner
if (owner != null)
@@ -1094,15 +1096,15 @@ protected virtual void OnKryptonCommandChanged(EventArgs e)
///
/// Source of the event.
/// A PropertyChangedEventArgs that contains the event data.
- protected virtual void OnCommandPropertyChanged(object sender, PropertyChangedEventArgs e)
+ protected virtual void OnCommandPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
switch (e.PropertyName)
{
case nameof(Enabled):
- Enabled = KryptonCommand.Enabled;
+ Enabled = KryptonCommand!.Enabled;
break;
case @"ImageSmall":
- Values.Image = KryptonCommand.ImageSmall;
+ Values.Image = KryptonCommand!.ImageSmall;
PerformNeedPaint(true);
break;
case nameof(Text):
@@ -1139,9 +1141,9 @@ protected virtual ColorButtonValues CreateButtonValues(NeedPaintHandler needPain
#endregion
#region Implementation
- private void OnButtonTextChanged(object sender, EventArgs e) => OnTextChanged(EventArgs.Empty);
+ private void OnButtonTextChanged(object? sender, EventArgs e) => OnTextChanged(EventArgs.Empty);
- private void OnButtonClick(object sender, MouseEventArgs e)
+ private void OnButtonClick(object? sender, MouseEventArgs e)
{
var showingContextMenu = false;
@@ -1184,7 +1186,7 @@ private bool ShowDropDown()
}
else
{
- _kryptonContextMenu.Palette = Palette;
+ _kryptonContextMenu.LocalCustomPalette = LocalCustomPalette;
}
}
@@ -1233,7 +1235,7 @@ private bool ShowDropDown()
DecideOnVisible(_separatorMoreColors, _itemsMoreColors);
// Monitor relevant events inside the context menu
- HookContextMenuEvents(_kryptonContextMenu.Items, true);
+ HookContextMenuEvents(_kryptonContextMenu!.Items, true);
// Show relative to the screen rectangle
cpma.KryptonContextMenu.Closed += OnKryptonContextMenuClosed;
@@ -1264,17 +1266,17 @@ private bool ShowDropDown()
private void OnContextMenuClosed(object sender, EventArgs e) => ContextMenuClosed();
- private void OnKryptonContextMenuClosed(object sender, EventArgs e)
+ private void OnKryptonContextMenuClosed(object? sender, EventArgs e)
{
- var kcm = (KryptonContextMenu)sender;
+ var kcm = sender as KryptonContextMenu ?? throw new ArgumentNullException(nameof(sender));
kcm.Closed -= OnKryptonContextMenuClosed;
ContextMenuClosed();
// Unhook from item events
- HookContextMenuEvents(_kryptonContextMenu.Items, false);
+ HookContextMenuEvents(_kryptonContextMenu!.Items, false);
}
- private void OnButtonSelect(object sender, MouseEventArgs e)
+ private void OnButtonSelect(object? sender, MouseEventArgs e)
{
// Take the focus if allowed
if (CanFocus)
@@ -1317,7 +1319,7 @@ private void HookContextMenuEvents(KryptonContextMenuCollection collection, bool
public void AddUpdateRecentColors(IList colors)
{
foreach (Color color in colors
- .Where(static color => (color != null) && !color.Equals(Color.Empty))
+ .Where(static color => (color != null) && !color.Equals(GlobalStaticValues.EMPTY_COLOR))
.Where(color => !Enumerable.Contains(_recentColors, color)))
{
// Add to start of the list
@@ -1337,9 +1339,9 @@ private void UpdateRecentColors(Color color)
if (AutoRecentColors)
{
// We do not add to recent colors if it is inside another color columns
- foreach (KryptonContextMenuItemBase item in _kryptonContextMenu.Items)
+ foreach (KryptonContextMenuItemBase item in _kryptonContextMenu!.Items)
{
- // Only interested in the non-recent colors color columns
+ // Only interested in the non-recent colors, color columns
if ((item != _colorsRecent) && (item is KryptonContextMenuColorColumns colors))
{
// Cast to correct type
@@ -1360,7 +1362,7 @@ private void UpdateRecentColors(Color color)
}
// If this color valid and so possible to become a recent color
- if ((color != null) && !color.Equals(Color.Empty))
+ if ((color != null) && !color.Equals(GlobalStaticValues.EMPTY_COLOR))
{
var found = false;
foreach (Color recentColor in _recentColors)
@@ -1421,14 +1423,14 @@ private void UpdateContextMenu()
// Each column is just a single color
for (var i = 0; i < _recentColors.Count; i++)
{
- colors[i] = new[] { _recentColors[i] };
+ colors[i] = [_recentColors[i]];
}
_colorsRecent.SetCustomColors(colors);
}
// Should the no color entry be checked?
- _itemNoColor.Checked = _selectedColor.Equals(Color.Empty);
+ _itemNoColor.Checked = _selectedColor.Equals(GlobalStaticValues.EMPTY_COLOR);
}
private void DecideOnVisible(KryptonContextMenuItemBase visible, KryptonContextMenuItemBase target)
@@ -1439,7 +1441,7 @@ private void DecideOnVisible(KryptonContextMenuItemBase visible, KryptonContextM
if (target.Visible)
{
// Check all items before the target
- foreach (KryptonContextMenuItemBase item in _kryptonContextMenu.Items)
+ foreach (KryptonContextMenuItemBase item in _kryptonContextMenu!.Items)
{
// Finish when we reach the target
if (item == target)
@@ -1463,13 +1465,13 @@ private void DecideOnVisible(KryptonContextMenuItemBase visible, KryptonContextM
visible.Visible = previous;
}
- private void OnColumnsTrackingColor(object sender, ColorEventArgs e) => OnTrackingColor(new ColorEventArgs(e.Color));
+ private void OnColumnsTrackingColor(object? sender, ColorEventArgs e) => OnTrackingColor(new ColorEventArgs(e.Color));
- private void OnColumnsSelectedColorChanged(object sender, ColorEventArgs e) => SelectedColor = e.Color;
+ private void OnColumnsSelectedColorChanged(object? sender, ColorEventArgs e) => SelectedColor = e.Color;
- private void OnClickNoColor(object sender, EventArgs e) => SelectedColor = Color.Empty;
+ private void OnClickNoColor(object? sender, EventArgs e) => SelectedColor = GlobalStaticValues.EMPTY_COLOR;
- private void OnClickMoreColors(object sender, EventArgs e)
+ private void OnClickMoreColors(object? sender, EventArgs e)
{
// Give user a chance to cancel showing the Krypton more colors dialog
var cea = new CancelEventArgs();
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonColorDialog.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonColorDialog.cs
index 650a4424a..ed785b14f 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonColorDialog.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonColorDialog.cs
@@ -1,11 +1,14 @@
#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. 2021 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2021 - 2024. All rights reserved.
*
*/
#endregion
+// Used only for this class
+using Timer = System.Windows.Forms.Timer;
+
namespace Krypton.Toolkit
{
///
@@ -25,7 +28,7 @@ public class KryptonColorDialog : ColorDialog
private CommonDialogHandler.Attributes _redEdit;
private CommonDialogHandler.Attributes _greenEdit;
private CommonDialogHandler.Attributes _blueEdit;
- private System.Windows.Forms.Timer _alphaUpdateTimer;
+ private readonly Timer _alphaUpdateTimer;
#endregion
///
@@ -126,8 +129,8 @@ public bool ShowIcon
public bool ShowAlphaSlider
{
get => _showAlphaSlider;
- set
- {
+ set
+ {
_showAlphaSlider = value;
if (value)
{
@@ -161,10 +164,10 @@ public bool ShowAlphaSlider
}
}
- private void Timer1OnTick(object sender, EventArgs e)
+ private void Timer1OnTick(object? sender, EventArgs e)
{
var text = new StringBuilder(6);
- if ( PI.GetWindowText(_redEdit.hWnd, text, 4) <= 0)
+ if (PI.GetWindowText(_redEdit.hWnd, text, 4) <= 0)
{
// Probably Closing, or in transition
return;
@@ -179,7 +182,7 @@ private void Timer1OnTick(object sender, EventArgs e)
_alphaPanel.StateCommon.Color1 = Color.FromArgb(_alphaSlider.Value, red, green, blue);
}
- private void AlphaSlider_ValueChanged(object sender, EventArgs e)
+ private void AlphaSlider_ValueChanged(object? sender, EventArgs e)
{
_alphaSlider.ToolTipValues.Description = _alphaSlider.Value.ToString(CultureInfo.InvariantCulture);
_alphaLabel.Text = _alphaSlider.ToolTipValues.Description;
@@ -192,10 +195,10 @@ private void ClickCallback(CommonDialogHandler.Attributes originalControl)
// - Enable Add custom colour
if (originalControl.DlgCtrlId == 0x000002CF)
{
- originalControl.Button.Enabled = false;
+ originalControl.Button!.Enabled = false;
foreach (CommonDialogHandler.Attributes control in _commonDialogHandler.Controls.Where(static control => control.DlgCtrlId == 0x000002C8))
{
- control.Button.Enabled = true;
+ control.Button!.Enabled = true;
break;
}
}
@@ -210,29 +213,29 @@ private void ClickCallback(CommonDialogHandler.Attributes originalControl)
protected override IntPtr HookProc(IntPtr hWnd, int msg, IntPtr wparam, IntPtr lparam)
{
var (handled, retValue) = _commonDialogHandler.HookProc(hWnd, msg, wparam, lparam);
- if (msg == PI.WM_.INITDIALOG )
+ if (msg == PI.WM_.INITDIALOG)
{
if (!FullOpen)
{
// Find the Static colour set 000002D0
- var _clrColourBox = _commonDialogHandler.Controls.FirstOrDefault(ctl => ctl.DlgCtrlId == 0x000002D0);
- if (_clrColourBox != null)
+ var clrColourBox = _commonDialogHandler.Controls.FirstOrDefault(ctl => ctl.DlgCtrlId == 0x000002D0);
+ if (clrColourBox != null)
{
- var rcClient = _clrColourBox.WinInfo.rcClient;
+ var rcClient = clrColourBox.WinInfo.rcClient;
var lpPoint = new PI.POINT(rcClient.left, rcClient.top);
PI.ScreenToClient(hWnd, ref lpPoint);
- _clrColourBox.ClientLocation = new Point(lpPoint.X, lpPoint.Y);
- _clrColourBox.Size = new Size(rcClient.right - rcClient.left, rcClient.bottom - rcClient.top);
+ clrColourBox.ClientLocation = new Point(lpPoint.X, lpPoint.Y);
+ clrColourBox.Size = new Size(rcClient.right - rcClient.left, rcClient.bottom - rcClient.top);
}
// Find the bottom of the OK button (Might not have OK text !!) 00000001
var btnOk = _commonDialogHandler.Controls.First(static ctl => ctl.DlgCtrlId == 0x00000001);
// Now adjust the size so that it the correct display on "All" supported OS's
// https://github.com/Krypton-Suite/Standard-Toolkit/issues/415
- Size toolBoxSize = _commonDialogHandler._wrapperForm.ClientSize;
- if (_clrColourBox != null)
+ Size toolBoxSize = _commonDialogHandler._wrapperForm!.ClientSize;
+ if (clrColourBox != null)
{
- toolBoxSize.Width = _clrColourBox.Size.Width + 2 * _clrColourBox.ClientLocation.X;
+ toolBoxSize.Width = clrColourBox.Size.Width + 2 * clrColourBox.ClientLocation.X;
}
if (btnOk != null)
@@ -247,31 +250,31 @@ protected override IntPtr HookProc(IntPtr hWnd, int msg, IntPtr wparam, IntPtr l
if (_showAlphaSlider)
{
// Find the Static colour set 000002C5
- var _clrSolidColourBox = _commonDialogHandler.Controls.FirstOrDefault(ctl => ctl.DlgCtrlId == 0x000002C5);
- if (_clrSolidColourBox != null)
+ var clrSolidColourBox = _commonDialogHandler.Controls.FirstOrDefault(ctl => ctl.DlgCtrlId == 0x000002C5);
+ if (clrSolidColourBox != null)
{
- var rcClient = _clrSolidColourBox.WinInfo.rcClient;
+ var rcClient = clrSolidColourBox.WinInfo.rcClient;
var lpPoint = new PI.POINT(rcClient.left, rcClient.top);
PI.ScreenToClient(hWnd, ref lpPoint);
_alphaPanel.Location = new Point(lpPoint.X, lpPoint.Y);
- _alphaPanel.Size = new Size((rcClient.right - rcClient.left)/2, rcClient.bottom - rcClient.top);
+ _alphaPanel.Size = new Size((rcClient.right - rcClient.left) / 2, rcClient.bottom - rcClient.top);
}
- _commonDialogHandler._wrapperForm.Controls[0].Controls.Add(_alphaPanel);
+ _commonDialogHandler._wrapperForm!.Controls[0].Controls.Add(_alphaPanel);
// find the colour edit box's
_redEdit = _commonDialogHandler.Controls.First(ctl => ctl.DlgCtrlId == 0x000002C2);
_greenEdit = _commonDialogHandler.Controls.First(ctl => ctl.DlgCtrlId == 0x000002C3);
_blueEdit = _commonDialogHandler.Controls.First(ctl => ctl.DlgCtrlId == 0x000002C4);
// Add a slider
- _alphaSlider.Location = _redEdit.ClientLocation with { X = _redEdit.ClientLocation.X + _redEdit.Size.Width+4 };
+ _alphaSlider.Location = _redEdit.ClientLocation with { X = _redEdit.ClientLocation.X + _redEdit.Size.Width + 4 };
//_commonDialogHandler._wrapperForm.ClientSize
- _alphaSlider.Size = new Size(_commonDialogHandler._wrapperForm.ClientSize.Width- _alphaSlider.Location.X+4, _blueEdit.ClientLocation.Y - _redEdit.ClientLocation.Y + _blueEdit.Size.Height);
+ _alphaSlider.Size = new Size(_commonDialogHandler._wrapperForm.ClientSize.Width - _alphaSlider.Location.X + 4, _blueEdit.ClientLocation.Y - _redEdit.ClientLocation.Y + _blueEdit.Size.Height);
_commonDialogHandler._wrapperForm.Controls[0].Controls.Add(_alphaSlider);
// Find the Add button
var btnAdd = _commonDialogHandler.Controls.First(static ctl => ctl.DlgCtrlId == 0x00002C8);
- btnAdd.Button.Parent.Width -= 16;
+ btnAdd.Button!.Parent!.Width -= 16;
- _alphaLabel.Location = Point.Add(_blueEdit.ClientLocation, new Size(_blueEdit.Size.Width+2, _blueEdit.Size.Height) );
+ _alphaLabel.Location = Point.Add(_blueEdit.ClientLocation, new Size(_blueEdit.Size.Width + 2, _blueEdit.Size.Height));
_commonDialogHandler._wrapperForm.Controls[0].Controls.Add(_alphaLabel);
_alphaUpdateTimer.Enabled = true;
}
@@ -290,7 +293,7 @@ protected override IntPtr HookProc(IntPtr hWnd, int msg, IntPtr wparam, IntPtr l
{
var newSize = new Size(pos.cx, pos.cy);
if (!FullOpen
- && newSize.Width > _commonDialogHandler._wrapperForm.Size.Width
+ && newSize.Width > _commonDialogHandler._wrapperForm!.Size.Width
)
{
// Need to fiddle the width and height to workaround the Magic hidden "&d" button
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonComboBox.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonComboBox.cs
index dbcb0bf59..2a18b0090 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonComboBox.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonComboBox.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -137,7 +137,7 @@ public InternalComboBox(KryptonComboBox kryptonComboBox)
_kryptonComboBox = kryptonComboBox;
// Remove from view until size for the first time by the Krypton control
- ItemHeight = 15;
+ UpdateItemHeight(); // Ensure ItemHeight is set properly; see #1677
DropDownHeight = 200;
//DrawMode = DrawMode.OwnerDrawFixed; // #20 fix, but this causes other problems; see #578
DrawMode = DrawMode.OwnerDrawVariable;
@@ -201,7 +201,7 @@ public bool MouseOver
///
/// The state for which the image is needed.
/// Color value.
- public virtual Color GetImageTransparentColor(PaletteState state) => Color.Empty;
+ public virtual Color GetImageTransparentColor(PaletteState state) => GlobalStaticValues.EMPTY_COLOR;
///
/// Gets the content long text.
@@ -224,28 +224,7 @@ protected override void OnEnabledChanged(EventArgs e)
/// Contains the event data.
protected override void OnFontChanged(EventArgs e)
{
- // Working on Windows XP or earlier systems?
- if (_osMajorVersion < 6)
- {
- // Fudge by adding one to the font height, this gives the actual space used by the
- // combo box control to draw an individual item in the main part of the control
- ItemHeight = Font.Height + 1;
- }
- else
- {
- // Vista performs differently depending of the use of themes...
- if (IsAppThemed)
- {
- // Fudge by subtracting 1, which ensure correct sizing of combo box main area
- ItemHeight = Font.Height - 1;
- }
- else
- {
- // On under Vista without themes is the font height the actual height used
- // by the combo box for the space required for drawing the actual item
- ItemHeight = Font.Height;
- }
- }
+ UpdateItemHeight();
base.OnFontChanged(e);
}
@@ -386,7 +365,7 @@ protected override void WndProc(ref Message m)
}
// Exclude border from being drawn, we need to take off another 2 pixels from all edges
- PI.IntersectClipRect(hdc, rect.left + 2, rect.top + 2, rect.right - 2, rect.bottom - 2);
+ PI.IntersectClipRect(hdc, rect.left + 2, rect.top, rect.right - 2, rect.bottom);
var displayText = _kryptonComboBox.Text;
if (!string.IsNullOrWhiteSpace(_kryptonComboBox.CueHint.CueHintText)
&& string.IsNullOrEmpty(displayText)
@@ -435,7 +414,7 @@ protected override void WndProc(ref Message m)
rectangle = CommonHelper.ApplyPadding(VisualOrientation.Top, rectangle, states.Content.GetContentPadding(state));
// Find correct text color
Color textColor = states.Content.GetContentShortTextColor1(state);
- Font contentShortTextFont = states.Content.GetContentShortTextFont(state);
+ Font? contentShortTextFont = states.Content.GetContentShortTextFont(state);
// Find correct background color
Color backColor = states.PaletteBack.GetBackColor1(state);
@@ -568,7 +547,7 @@ private void DrawDropButton(Graphics? g, Rectangle drawRect)
// Fill background with the solid background color
using (var backBrush = new SolidBrush(BackColor))
{
- g.FillRectangle(backBrush, drawRect);
+ g?.FillRectangle(backBrush, drawRect);
}
// Ask the element to draw now
@@ -578,13 +557,49 @@ private void DrawDropButton(Graphics? g, Rectangle drawRect)
_viewButton.Render(renderContext);
// Call the renderer directly to draw the drop down glyph
- renderContext.Renderer.RenderGlyph.DrawInputControlDropDownGlyph(renderContext,
+ renderContext.Renderer!.RenderGlyph.DrawInputControlDropDownGlyph(renderContext,
_viewButton.ClientRectangle,
_palette.PaletteContent,
state);
}
}
+ private void UpdateItemHeight()
+ {
+ // Working on Windows XP or earlier systems?
+ //if (_osMajorVersion < 6)
+ //{
+ // // Fudge by adding one to the font height, this gives the actual space used by the
+ // // combo box control to draw an individual item in the main part of the control
+ // ItemHeight = Font.Height + 1;
+ //}
+ //else
+ //{
+ // // Vista performs differently depending of the use of themes...
+ // if (IsAppThemed)
+ // {
+ // // Fudge by subtracting 1, which ensure correct sizing of combo box main area
+ // //ItemHeight = Font.Height - 1;
+
+ // // #1455 - The lower part of the text can become clipped with chars like g, y, p, etc.
+ // // when subtracting one from the font height.
+ // ItemHeight = Font.Height;
+ // }
+ // else
+ // {
+ // // On under Vista without themes is the font height the actual height used
+ // // by the combo box for the space required for drawing the actual item
+ // ItemHeight = Font.Height;
+ // }
+ //}
+
+ // #1455 - The lower part of the text can become clipped with chars like g, y, p, etc.
+ // when subtracting one from the font height.
+ ItemHeight = _osMajorVersion < 6
+ ? Font.Height + 1
+ : Font.Height;
+ }
+
private bool IsAppThemed
{
get
@@ -714,9 +729,8 @@ protected override void WndProc(ref Message m)
{
var tme = new PI.TRACKMOUSEEVENTS
{
-
// This structure needs to know its own size in bytes
- cbSize = (uint)Marshal.SizeOf(typeof(PI.TRACKMOUSEEVENTS)),
+ cbSize = (uint)Marshal.SizeOf(),
dwHoverTime = 100,
// We need to know then the mouse leaves the client window area
@@ -810,7 +824,7 @@ public ComboBoxButtonSpecCollection(KryptonComboBox owner)
#region Instance Fields
private VisualPopupToolTip? _visualPopupToolTip;
- private readonly ButtonSpecManagerLayout _buttonManager;
+ private readonly ButtonSpecManagerLayout? _buttonManager;
private readonly ViewLayoutDocker _drawDockerInner;
private readonly ViewDrawDocker _drawDockerOuter;
private readonly ViewLayoutFill _layoutFill;
@@ -836,10 +850,32 @@ public ComboBoxButtonSpecCollection(KryptonComboBox owner)
private bool _alwaysActive;
private int _cachedHeight;
private int _hoverIndex;
- private float _cornerRoundingRadius;
+
+ // #1697 Work-around
+ // When changing DropDownStyle while the control is disabled the newly selected style was not applied.
+ // _deferredComboBoxStyle caches the selected change which is applied when the control is enabled again.
+ private ComboBoxStyle? _deferredComboBoxStyle;
#endregion
#region Events
+ /// This event is not relevant for this class.
+ [Browsable(false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new event EventHandler DoubleClick
+ {
+ add => base.DoubleClick += value;
+ remove => base.DoubleClick -= value;
+ }
+
+ /// This event is not relevant for this class.
+ [Browsable(false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new event MouseEventHandler MouseDoubleClick
+ {
+ add => base.MouseDoubleClick += value;
+ remove => base.MouseDoubleClick -= value;
+ }
+
///
/// Occurs when [draw item].
///
@@ -1134,10 +1170,10 @@ public KryptonComboBox()
// Create button specification collection manager
_buttonManager = new ButtonSpecManagerLayout(this, Redirector, ButtonSpecs, null,
- new[] { _drawDockerInner },
- new IPaletteMetric[] { StateCommon.ComboBox },
- new[] { PaletteMetricInt.HeaderButtonEdgeInsetInputControl },
- new[] { PaletteMetricPadding.HeaderButtonPaddingInputControl },
+ [_drawDockerInner],
+ [StateCommon.ComboBox],
+ [PaletteMetricInt.HeaderButtonEdgeInsetInputControl],
+ [PaletteMetricPadding.HeaderButtonPaddingInputControl],
CreateToolStripRenderer,
NeedPaintDelegate);
@@ -1155,15 +1191,17 @@ public KryptonComboBox()
// Must set the initial font otherwise the Form level font setting will cause the control
// to not work correctly. Happens on Vista when the Form has non-default Font setting.
- IPaletteTriple triple = StateActive.ComboBox;
+ var triple = StateActive.ComboBox;
_comboBox.BackColor = triple.PaletteBack.GetBackColor1(PaletteState.Tracking);
- _comboBox.ForeColor = triple.PaletteContent.GetContentShortTextColor1(PaletteState.Tracking);
- _comboBox.Font = triple.PaletteContent.GetContentShortTextFont(PaletteState.Tracking);
+ _comboBox.ForeColor = triple.PaletteContent!.GetContentShortTextColor1(PaletteState.Tracking);
+ _comboBox.Font = triple.PaletteContent.GetContentShortTextFont(PaletteState.Tracking)!;
AutoCompleteMode = AutoCompleteMode.None;
AutoCompleteSource = AutoCompleteSource.None;
- // Set `CornerRoundingRadius' to 'GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE' (-1)
- _cornerRoundingRadius = GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
+ // #1697 Work-around
+ // When changing DropDownStyle while the control is disabled the newly selected style was not applied.
+ // _deferredComboBoxStyle caches the selected change which is applied when the control is enabled again.
+ _deferredComboBoxStyle = null;
}
///
@@ -1181,7 +1219,7 @@ protected override void Dispose(bool disposing)
OnCancelToolTip(this, EventArgs.Empty);
// Remember to pull down the manager instance
- _buttonManager.Destruct();
+ _buttonManager?.Destruct();
}
base.Dispose(disposing);
@@ -1195,20 +1233,6 @@ protected override void Dispose(bool disposing)
#endregion
#region Public
- /// Gets or sets the corner rounding radius.
- /// The corner rounding radius.
- [Category(@"Visuals")]
- [Description(@"Gets or sets the corner rounding radius.")]
- [DefaultValue(GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE)]
- public float CornerRoundingRadius
- {
- get => _cornerRoundingRadius;
-
- set => SetCornerRoundingRadius(value);
- }
-
- private bool ShouldSerializeCornerRoundingRadius() => _cornerRoundingRadius != GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
///
/// Gets access to the common textbox appearance entries that other states can override.
///
@@ -1308,7 +1332,7 @@ public DrawMode DrawMode
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[EditorBrowsable(EditorBrowsableState.Always)]
[Browsable(false)]
- public ComboBox? ComboBox => _comboBox;
+ public ComboBox ComboBox => _comboBox;
///
/// Gets access to the contained input control.
@@ -1345,7 +1369,7 @@ public override Font Font
{
get => base.Font;
- set => base.Font = value;
+ set => base.Font = value!;
}
///
@@ -1373,7 +1397,7 @@ public override Color ForeColor
}
///
- /// Gets and sets the text associated associated with the control.
+ /// Gets and sets the text associated with the control.
///
[AllowNull]
public override string Text
@@ -1388,7 +1412,7 @@ public override string Text
[Bindable(true)]
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public object SelectedItem
+ public object? SelectedItem
{
get => _comboBox.SelectedItem;
set => _comboBox.SelectedItem = value;
@@ -1399,7 +1423,7 @@ public object SelectedItem
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public string SelectedText
+ public string? SelectedText
{
get => _comboBox.SelectedText;
set => _comboBox.SelectedText = value;
@@ -1426,7 +1450,8 @@ public int SelectedIndex
public object? SelectedValue
{
get => _comboBox.SelectedValue;
- set => _comboBox.SelectedValue = value;
+ //null forgiving operator used, to remove the warning
+ set => _comboBox.SelectedValue = value!;
}
///
@@ -1538,11 +1563,11 @@ public int SelectionStart
[DefaultValue(true)]
public bool UseMnemonic
{
- get => _buttonManager.UseMnemonic;
+ get => _buttonManager!.UseMnemonic;
set
{
- if (_buttonManager.UseMnemonic != value)
+ if (_buttonManager!.UseMnemonic != value)
{
_buttonManager.UseMnemonic = value;
PerformNeedPaint(true);
@@ -1580,19 +1605,38 @@ public bool AlwaysActive
[RefreshProperties(RefreshProperties.Repaint)]
public ComboBoxStyle DropDownStyle
{
- get => _comboBox.DropDownStyle;
+ // #1697 Work-around
+ // When _deferredComboBoxStyle has been set this value takes precedence over _comboBox.DropDownStyle
+ get => _deferredComboBoxStyle.HasValue
+ ? _deferredComboBoxStyle.Value
+ : _comboBox.DropDownStyle;
set
{
- if (_comboBox.DropDownStyle != value)
+ // #1697 Work-around
+ // If the _deferredComboBoxStyle has been set and DropDownStyle is changed again while the control is disabled this change has to be recorded.
+ if (_comboBox.DropDownStyle != value || (_deferredComboBoxStyle.HasValue && _deferredComboBoxStyle.Value != value))
{
if (value == ComboBoxStyle.Simple)
{
throw new ArgumentOutOfRangeException(nameof(_comboBox.DropDownStyle), @"KryptonComboBox does not support the DropDownStyle.Simple style.");
}
- _comboBox.DropDownStyle = value;
- UpdateEditControl();
+ // #1697 Work-around
+ // When changing DropDownStyle while the control is disabled the newly selected style was not applied.
+ // _deferredComboBoxStyle caches the selected change which is applied when the control is enabled again.
+ if (Enabled)
+ {
+ _comboBox.DropDownStyle = value;
+ UpdateEditControl();
+ }
+ else
+ {
+
+ // #1697 Work-around
+ // If the controls is disabled, record the change in DropDownStyle
+ _deferredComboBoxStyle = value;
+ }
}
}
}
@@ -1846,7 +1890,6 @@ public AutoCompleteStringCollection AutoCompleteCustomSource
public AutoCompleteMode AutoCompleteMode
{
get => _comboBox.AutoCompleteMode;
-
set => _comboBox.AutoCompleteMode = value;
}
@@ -1860,7 +1903,6 @@ public AutoCompleteMode AutoCompleteMode
public AutoCompleteSource AutoCompleteSource
{
get => _comboBox.AutoCompleteSource;
-
set => _comboBox.AutoCompleteSource = value;
}
@@ -2034,12 +2076,12 @@ public bool FormattingEnabled
/// Sets input focus to the control.
///
/// true if the input focus request was successful; otherwise, false.
- public new bool Focus() => ComboBox != null && ComboBox.Focus();
+ public new bool Focus() => ComboBox.Focus();
///
/// Activates the control.
///
- public new void Select() => ComboBox?.Select();
+ public new void Select() => ComboBox.Select();
///
/// Get the preferred size of the control based on a proposed size.
@@ -2138,9 +2180,9 @@ public bool DesignerGetHitTest(Point pt)
/// Internal designing mode method.
///
/// Mouse location.
- public Component DesignerComponentFromPoint(Point pt) =>
+ public Component? DesignerComponentFromPoint(Point pt) =>
// Ignore call as view builder is already destructed
- IsDisposed ? null : ViewManager.ComponentFromPoint(pt);
+ IsDisposed ? null : ViewManager?.ComponentFromPoint(pt);
// Ask the current view for a decision
///
@@ -2343,13 +2385,22 @@ protected override void OnEnabledChanged(EventArgs e)
_drawDockerOuter.Enabled = Enabled;
// Update state to reflect change in enabled state
- _buttonManager.RefreshButtons();
+ _buttonManager?.RefreshButtons();
// Change in enabled state requires a layout and repaint
PerformNeedPaint(true);
// Let base class fire standard event
base.OnEnabledChanged(e);
+
+ // #1697 Work-around
+ // When changing DropDownStyle while the control is disabled the newly selected style was not applied.
+ if (Enabled && _deferredComboBoxStyle.HasValue)
+ {
+ DropDownStyle = _deferredComboBoxStyle.Value;
+ _deferredComboBoxStyle = null;
+ }
+
}
///
@@ -2406,7 +2457,7 @@ protected override void OnCausesValidationChanged(EventArgs e)
/// Raises the Paint event.
///
/// An PaintEventArgs that contains the event data.
- protected override void OnPaint(PaintEventArgs e)
+ protected override void OnPaint(PaintEventArgs? e)
{
// First time we paint we perform a layout to ensure drawing works correctly
if (_firstTimePaint)
@@ -2415,8 +2466,14 @@ protected override void OnPaint(PaintEventArgs e)
ForceControlLayout();
}
+ // ToDo: Create a new API for this in a later version
+ //if (StateCommon.ComboBox.Content.SynchronizeDropDownWidth)
+ //{
+ // DropDownWidth = Size.Width;
+ //}
+
base.OnPaint(e);
- Paint?.Invoke(this, e);
+ Paint?.Invoke(this, e!);
}
///
@@ -2473,17 +2530,14 @@ protected override void OnGotFocus(EventArgs e)
/// Event details.
protected override void OnUserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
{
- if (_comboBox != null)
- {
- UpdateStateAndPalettes();
- IPaletteTriple triple = GetComboBoxTripleState();
- PaletteState state = _drawDockerOuter.State;
- _comboBox.BackColor = triple.PaletteBack.GetBackColor1(state);
- _comboBox.ForeColor = triple.PaletteContent.GetContentShortTextColor1(state);
- _comboBox.Font = triple.PaletteContent.GetContentShortTextFont(state);
- _comboBox.ClearAppThemed();
- _comboHolder.BackColor = _comboBox.BackColor;
- }
+ UpdateStateAndPalettes();
+ var triple = GetComboBoxTripleState();
+ PaletteState state = _drawDockerOuter.State;
+ _comboBox.BackColor = triple.PaletteBack.GetBackColor1(state);
+ _comboBox.ForeColor = triple.PaletteContent!.GetContentShortTextColor1(state);
+ _comboBox.Font = triple.PaletteContent.GetContentShortTextFont(state)!;
+ _comboBox.ClearAppThemed();
+ _comboHolder.BackColor = _comboBox.BackColor;
base.OnUserPreferenceChanged(sender, e);
}
@@ -2504,25 +2558,30 @@ protected override void OnLayout(LayoutEventArgs levent)
// Let base class calculate fill rectangle
base.OnLayout(levent);
- // Only use layout logic if control is fully initialized or if being forced
- // to allow a relayout or if in design mode.
- if (_forcedLayout || (DesignMode && (_comboHolder != null)))
+ try
{
- // Only need to relayout if there is something that would be visible
- if (_layoutFill.FillRect is { Height: > 0, Width: > 0 })
+ // Only use layout logic if control is fully initialized or if being forced
+ // to allow a relayout or if in design mode.
+ if (_forcedLayout || (DesignMode && (_comboHolder != null)))
{
- // Only update the bounds if they have changed
- Rectangle fillRect = _layoutFill.FillRect;
- if (fillRect != _comboHolder.Bounds)
+ // Only need to relayout if there is something that would be visible
+ if (_layoutFill.FillRect is { Height: > 0, Width: > 0 })
{
- _comboHolder.SetBounds(fillRect.X, fillRect.Y, fillRect.Width, fillRect.Height);
- _comboBox.SetBounds(-(1 + _layoutPadding.Left),
- -(1 + _layoutPadding.Top),
- fillRect.Width + 2 + _layoutPadding.Right,
- fillRect.Height + 2 + _layoutPadding.Bottom);
+ // Only update the bounds if they have changed
+ Rectangle fillRect = _layoutFill.FillRect;
+ if (fillRect != _comboHolder.Bounds)
+ {
+ _comboHolder.SetBounds(fillRect.X, fillRect.Y, fillRect.Width, fillRect.Height);
+ _comboBox.SetBounds(-(1 + _layoutPadding.Left), -(1 + _layoutPadding.Top), fillRect.Width + 2 + _layoutPadding.Right, fillRect.Height + 2 + _layoutPadding.Bottom);
+ }
}
}
}
+ catch
+ {
+ // Probably creation order in the designer is a bit wonky...
+ // Ignore for now
+ }
}
}
@@ -2584,11 +2643,11 @@ protected override void OnNeedPaint(object? sender, NeedLayoutEventArgs e)
if (!IsDisposed && !Disposing)
{
UpdateStateAndPalettes();
- IPaletteTriple triple = GetComboBoxTripleState();
+ var triple = GetComboBoxTripleState();
PaletteState state = _drawDockerOuter.State;
_comboBox.BackColor = triple.PaletteBack.GetBackColor1(state);
- _comboBox.ForeColor = triple.PaletteContent.GetContentShortTextColor1(state);
- _comboBox.Font = triple.PaletteContent.GetContentShortTextFont(state);
+ _comboBox.ForeColor = triple.PaletteContent!.GetContentShortTextColor1(state);
+ _comboBox.Font = triple.PaletteContent.GetContentShortTextFont(state)!;
_comboHolder.BackColor = _comboBox.BackColor;
}
@@ -2610,7 +2669,7 @@ protected override void OnPaletteChanged(EventArgs e)
///
/// Source of notification.
/// An NeedLayoutEventArgs containing event data.
- protected override void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e)
+ protected override void OnPaletteNeedPaint(object? sender, NeedLayoutEventArgs e)
{
base.OnPaletteChanged(e);
_comboBox.Invalidate();
@@ -2688,7 +2747,7 @@ private void AttachEditControl()
}
}
- private void UpdateEditControl()
+ internal void UpdateEditControl()
{
AttachEditControl();
@@ -2704,14 +2763,14 @@ private void UpdateEditControl()
private void UpdateStateAndPalettes()
{
// Get the correct palette settings to use
- IPaletteTriple tripleState = GetComboBoxTripleState();
- _drawDockerOuter.SetPalettes(tripleState.PaletteBack, tripleState.PaletteBorder);
+ var tripleState = GetComboBoxTripleState();
+ _drawDockerOuter.SetPalettes(tripleState.PaletteBack, tripleState.PaletteBorder!);
// Update enabled state
_drawDockerOuter.Enabled = Enabled;
// Find the new state of the main view element
- PaletteState state = IsActive ? PaletteState.Tracking : PaletteState.Normal;
+ PaletteState state = Enabled ? (IsActive ? PaletteState.Tracking : PaletteState.Normal) : PaletteState.Disabled;
_drawDockerOuter.ElementState = state;
}
@@ -2730,7 +2789,7 @@ private int PreferredHeight
}
}
- private void OnComboBoxDrawItem(object sender, DrawItemEventArgs e)
+ private void OnComboBoxDrawItem(object? sender, DrawItemEventArgs e)
{
Rectangle drawBounds = e.Bounds;
@@ -2761,7 +2820,7 @@ private void OnComboBoxDrawItem(object sender, DrawItemEventArgs e)
// Set the correct text rendering hint for the text drawing. We only draw if the edit text is enabled so we
// just always grab the normal state value. Without this line the wrong hint can occur because it inherits
// it from the device context. Resulting in blurred text.
- e.Graphics.TextRenderingHint = CommonHelper.PaletteTextHintToRenderingHint(StateNormal.Item.PaletteContent.GetContentShortTextHint(PaletteState.Normal));
+ e.Graphics.TextRenderingHint = CommonHelper.PaletteTextHintToRenderingHint(StateNormal.Item.PaletteContent!.GetContentShortTextHint(PaletteState.Normal));
TextFormatFlags flags = TextFormatFlags.TextBoxControl | TextFormatFlags.NoPadding;
@@ -2790,7 +2849,7 @@ private void OnComboBoxDrawItem(object sender, DrawItemEventArgs e)
// Update our content object with values from the list item
UpdateContentFromItemIndex(e.Index);
- // By default the button is in the normal state
+ // By default, the button is in the normal state
var buttonState = PaletteState.Normal;
// Is this item disabled
@@ -2808,7 +2867,7 @@ private void OnComboBoxDrawItem(object sender, DrawItemEventArgs e)
{
_hoverIndex = e.Index;
// Raise the Hover event
- var ev = new HoveredSelectionChangedEventArgs(e.Bounds, e.Index, Items[e.Index]);
+ var ev = new HoveredSelectionChangedEventArgs(e.Bounds, e.Index, Items[e.Index]!);
OnHoverSelectionChanged(ev);
}
}
@@ -2870,7 +2929,7 @@ private void OnComboBoxDrawItem(object sender, DrawItemEventArgs e)
}
}
- private void OnComboBoxMeasureItem(object sender, MeasureItemEventArgs e)
+ private void OnComboBoxMeasureItem(object? sender, MeasureItemEventArgs e)
{
UpdateContentFromItemIndex(e.Index);
@@ -2886,7 +2945,7 @@ private void UpdateContentFromItemIndex(int index)
// If the object exposes the rich interface then use is...
if (Items[index] is IContentValues itemValues)
{
- _contentValues.ShortText = itemValues.GetShortText();
+ _contentValues!.ShortText = itemValues.GetShortText();
_contentValues.LongText = itemValues.GetLongText();
_contentValues.Image = itemValues.GetImage(PaletteState.Normal);
_contentValues.ImageTransparentColor = itemValues.GetImageTransparentColor(PaletteState.Normal);
@@ -2894,10 +2953,10 @@ private void UpdateContentFromItemIndex(int index)
else
{
// Get the text string for the item
- _contentValues.ShortText = _comboBox.GetItemText(Items[index]);
+ _contentValues!.ShortText = _comboBox.GetItemText(Items[index]);
_contentValues.LongText = null;
_contentValues.Image = null;
- _contentValues.ImageTransparentColor = Color.Empty;
+ _contentValues.ImageTransparentColor = GlobalStaticValues.EMPTY_COLOR;
}
// Always ensure there is some text that can be measured, if only a single space. The height of
@@ -2909,7 +2968,7 @@ private void UpdateContentFromItemIndex(int index)
}
}
- private void OnComboBoxMouseChange(object sender, EventArgs e)
+ private void OnComboBoxMouseChange(object? sender, EventArgs e)
{
// Find new tracking mouse change state
var tracking = _comboBox.MouseOver || _subclassEdit is { MouseOver: true };
@@ -2936,17 +2995,17 @@ private void OnComboBoxMouseChange(object sender, EventArgs e)
_comboBox.Invalidate();
}
- private void OnComboBoxGotFocus(object sender, EventArgs e)
+ private void OnComboBoxGotFocus(object? sender, EventArgs e)
{
if (DropDownStyle == ComboBoxStyle.DropDown)
{
- _subclassEdit.Visible = true;
+ _subclassEdit!.Visible = true;
PaletteState state = Enabled
? IsActive
? PaletteState.Tracking
: PaletteState.Normal
: PaletteState.Disabled;
- _comboBox.Font = GetComboBoxTripleState().Content.GetContentShortTextFont(state);
+ _comboBox.Font = GetComboBoxTripleState().Content.GetContentShortTextFont(state)!;
}
base.OnGotFocus(e);
@@ -2954,12 +3013,12 @@ private void OnComboBoxGotFocus(object sender, EventArgs e)
_comboBox.Invalidate();
}
- private void OnComboBoxLostFocus(object sender, EventArgs e)
+ private void OnComboBoxLostFocus(object? sender, EventArgs e)
{
if (DropDownStyle == ComboBoxStyle.DropDown)
{
- _subclassEdit.Visible = false;
- _comboBox.Font = GetComboBoxTripleState().Content.GetContentShortTextFont(PaletteState.Normal);
+ _subclassEdit!.Visible = false;
+ _comboBox.Font = GetComboBoxTripleState().Content.GetContentShortTextFont(PaletteState.Normal)!;
}
// ReSharper disable RedundantBaseQualifier
@@ -2969,28 +3028,28 @@ private void OnComboBoxLostFocus(object sender, EventArgs e)
_comboBox.Invalidate();
}
- private void OnComboBoxTextChanged(object sender, EventArgs e) => OnTextChanged(e);
+ private void OnComboBoxTextChanged(object? sender, EventArgs e) => OnTextChanged(e);
- private void OnComboBoxTextUpdate(object sender, EventArgs e) => OnTextUpdate(e);
+ private void OnComboBoxTextUpdate(object? sender, EventArgs e) => OnTextUpdate(e);
- private void OnComboBoxSelectionChangeCommitted(object sender, EventArgs e) => OnSelectionChangeCommitted(e);
+ private void OnComboBoxSelectionChangeCommitted(object? sender, EventArgs e) => OnSelectionChangeCommitted(e);
- private void OnComboBoxSelectedIndexChanged(object sender, EventArgs e) => OnSelectedIndexChanged(e);
+ private void OnComboBoxSelectedIndexChanged(object? sender, EventArgs e) => OnSelectedIndexChanged(e);
- private void OnComboBoxDropDownStyleChanged(object sender, EventArgs e) => OnDropDownStyleChanged(e);
+ private void OnComboBoxDropDownStyleChanged(object? sender, EventArgs e) => OnDropDownStyleChanged(e);
- private void OnComboBoxDataSourceChanged(object sender, EventArgs e) => OnDataSourceChanged(e);
+ private void OnComboBoxDataSourceChanged(object? sender, EventArgs e) => OnDataSourceChanged(e);
- private void OnComboBoxDisplayMemberChanged(object sender, EventArgs e) => OnDisplayMemberChanged(e);
+ private void OnComboBoxDisplayMemberChanged(object? sender, EventArgs e) => OnDisplayMemberChanged(e);
- private void OnComboBoxDropDownClosed(object sender, EventArgs e)
+ private void OnComboBoxDropDownClosed(object? sender, EventArgs e)
{
_comboBox.Dropped = false;
Refresh();
OnDropDownClosed(e);
}
- private void OnComboBoxDropDown(object sender, EventArgs e)
+ private void OnComboBoxDropDown(object? sender, EventArgs e)
{
_comboBox.Dropped = true;
_hoverIndex = -1;
@@ -2998,27 +3057,27 @@ private void OnComboBoxDropDown(object sender, EventArgs e)
OnDropDown(e);
}
- private void OnComboBoxKeyPress(object sender, KeyPressEventArgs e) => OnKeyPress(e);
+ private void OnComboBoxKeyPress(object? sender, KeyPressEventArgs e) => OnKeyPress(e);
- private void OnComboBoxKeyUp(object sender, KeyEventArgs e) => OnKeyUp(e);
+ private void OnComboBoxKeyUp(object? sender, KeyEventArgs e) => OnKeyUp(e);
- private void OnComboBoxKeyDown(object sender, KeyEventArgs e) => OnKeyDown(e);
+ private void OnComboBoxKeyDown(object? sender, KeyEventArgs e) => OnKeyDown(e);
- private void OnComboBoxPreviewKeyDown(object sender, PreviewKeyDownEventArgs e) => OnPreviewKeyDown(e);
+ private void OnComboBoxPreviewKeyDown(object? sender, PreviewKeyDownEventArgs e) => OnPreviewKeyDown(e);
- private void OnComboBoxValidated(object sender, EventArgs e) => OnValidated(e);
+ private void OnComboBoxValidated(object? sender, EventArgs e) => OnValidated(e);
- private void OnComboBoxValidating(object sender, CancelEventArgs e) => OnValidating(e);
+ private void OnComboBoxValidating(object? sender, CancelEventArgs e) => OnValidating(e);
- private void OnComboBoxFormat(object sender, ListControlConvertEventArgs e) => OnFormat(e);
+ private void OnComboBoxFormat(object? sender, ListControlConvertEventArgs e) => OnFormat(e);
- private void OnComboBoxFormatInfoChanged(object sender, EventArgs e) => OnFormatInfoChanged(e);
+ private void OnComboBoxFormatInfoChanged(object? sender, EventArgs e) => OnFormatInfoChanged(e);
- private void OnComboBoxFormatStringChanged(object sender, EventArgs e) => OnFormatStringChanged(e);
+ private void OnComboBoxFormatStringChanged(object? sender, EventArgs e) => OnFormatStringChanged(e);
- private void OnComboBoxFormattingEnabledChanged(object sender, EventArgs e) => OnFormattingEnabledChanged(e);
+ private void OnComboBoxFormattingEnabledChanged(object? sender, EventArgs e) => OnFormattingEnabledChanged(e);
- private void OnComboBoxSelectedValueChanged(object sender, EventArgs e)
+ private void OnComboBoxSelectedValueChanged(object? sender, EventArgs e)
{
UpdateEditControl();
PerformNeedPaint(false);
@@ -3026,9 +3085,9 @@ private void OnComboBoxSelectedValueChanged(object sender, EventArgs e)
OnSelectedValueChanged(e);
}
- private void OnComboBoxValueMemberChanged(object sender, EventArgs e) => OnValueMemberChanged(e);
+ private void OnComboBoxValueMemberChanged(object? sender, EventArgs e) => OnValueMemberChanged(e);
- private void OnShowToolTip(object sender, ToolTipEventArgs e)
+ private void OnShowToolTip(object? sender, ToolTipEventArgs e)
{
if (!IsDisposed && !Disposing)
{
@@ -3048,7 +3107,7 @@ private void OnShowToolTip(object sender, ToolTipEventArgs e)
var shadow = true;
// Find the button spec associated with the tooltip request
- ButtonSpec? buttonSpec = _buttonManager.ButtonSpecFromView(e.Target);
+ ButtonSpec? buttonSpec = _buttonManager!.ButtonSpecFromView(e.Target);
// If the tooltip is for a button spec
if (buttonSpec != null)
@@ -3088,7 +3147,7 @@ private void OnShowToolTip(object sender, ToolTipEventArgs e)
CommonHelper.ContentStyleFromLabelStyle(toolTipStyle),
shadow);
- _visualPopupToolTip.Disposed += OnVisualPopupToolTipDisposed!;
+ _visualPopupToolTip.Disposed += OnVisualPopupToolTipDisposed;
_visualPopupToolTip.ShowRelativeTo(e.Target, e.ControlMousePosition);
}
}
@@ -3096,15 +3155,15 @@ private void OnShowToolTip(object sender, ToolTipEventArgs e)
}
// Remove any currently showing tooltip
- private void OnCancelToolTip(object sender, EventArgs e) => _visualPopupToolTip?.Dispose();
+ private void OnCancelToolTip(object? sender, EventArgs e) => _visualPopupToolTip?.Dispose();
- private void OnVisualPopupToolTipDisposed(object sender, EventArgs e)
+ private void OnVisualPopupToolTipDisposed(object? sender, EventArgs e)
{
// Unhook events from the specific instance that generated event
- var popupToolTip = (VisualPopupToolTip)sender;
- popupToolTip.Disposed -= OnVisualPopupToolTipDisposed!;
+ var popupToolTip = sender as VisualPopupToolTip ?? throw new ArgumentNullException(nameof(sender));
+ popupToolTip.Disposed -= OnVisualPopupToolTipDisposed;
- // Not showing a popup page any more
+ // Not showing a popup page anymore
_visualPopupToolTip = null;
}
@@ -3136,16 +3195,9 @@ private void ShowToolTip(ToolTipNeededEventArgs e, Point location)
tip.ShowCalculatingSize(PointToScreen(point));
}
- private void OnDoubleClick(object sender, EventArgs e) => base.OnDoubleClick(e);
-
- private void OnMouseDoubleClick(object sender, MouseEventArgs e) => base.OnMouseDoubleClick(e);
+ private void OnDoubleClick(object? sender, EventArgs e) => base.OnDoubleClick(e);
- private void SetCornerRoundingRadius(float? radius)
- {
- _cornerRoundingRadius = radius ?? GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
- StateCommon.ComboBox.Border.Rounding = _cornerRoundingRadius;
- }
+ private void OnMouseDoubleClick(object? sender, MouseEventArgs e) => base.OnMouseDoubleClick(e);
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCommand.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCommand.cs
index 940472c46..fdc7f04b8 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCommand.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCommand.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -72,7 +72,7 @@ public KryptonCommand()
_textLine2 = string.Empty;
_imageSmall = null;
_imageLarge = null;
- _imageTransparentColor = Color.Empty;
+ _imageTransparentColor = GlobalStaticValues.EMPTY_COLOR;
_commandType = KryptonCommandType.General;
_assignedButtonSpec = null;
}
@@ -335,7 +335,7 @@ public Image? ImageLarge
[Localizable(true)]
[Category(@"Appearance")]
[Description(@"Command image transparent color.")]
- [KryptonDefaultColor()]
+ [KryptonDefaultColor]
public Color ImageTransparentColor
{
get => _imageTransparentColor;
@@ -407,49 +407,49 @@ private void UpdateCommandType(KryptonCommandType commandType)
case KryptonCommandType.General:
break;
case KryptonCommandType.HelpCommand:
- SwitchToHelpCommand(KryptonManager.InternalGlobalPaletteMode);
+ SwitchToHelpCommand(KryptonManager.CurrentGlobalPaletteMode);
break;
case KryptonCommandType.IntegratedToolBarCopyCommand:
- SwitchToCopyCommand(KryptonManager.InternalGlobalPaletteMode);
+ SwitchToCopyCommand(KryptonManager.CurrentGlobalPaletteMode);
break;
case KryptonCommandType.IntegratedToolBarCutCommand:
- SwitchToCutCommand(KryptonManager.InternalGlobalPaletteMode);
+ SwitchToCutCommand(KryptonManager.CurrentGlobalPaletteMode);
break;
case KryptonCommandType.IntegratedToolBarNewCommand:
- SwitchToNewCommand(KryptonManager.InternalGlobalPaletteMode);
+ SwitchToNewCommand(KryptonManager.CurrentGlobalPaletteMode);
break;
case KryptonCommandType.IntegratedToolBarOpenCommand:
- SwitchToOpenCommand(KryptonManager.InternalGlobalPaletteMode);
+ SwitchToOpenCommand(KryptonManager.CurrentGlobalPaletteMode);
break;
case KryptonCommandType.IntegratedToolBarPageSetupCommand:
- SwitchToPageSetupCommand(KryptonManager.InternalGlobalPaletteMode);
+ SwitchToPageSetupCommand(KryptonManager.CurrentGlobalPaletteMode);
break;
case KryptonCommandType.IntegratedToolBarPasteCommand:
- SwitchToPasteCommand(KryptonManager.InternalGlobalPaletteMode);
+ SwitchToPasteCommand(KryptonManager.CurrentGlobalPaletteMode);
break;
case KryptonCommandType.IntegratedToolBarPrintCommand:
- SwitchToPrintCommand(KryptonManager.InternalGlobalPaletteMode);
+ SwitchToPrintCommand(KryptonManager.CurrentGlobalPaletteMode);
break;
case KryptonCommandType.IntegratedToolBarPrintPreviewCommand:
- SwitchToPrintPreviewCommand(KryptonManager.InternalGlobalPaletteMode);
+ SwitchToPrintPreviewCommand(KryptonManager.CurrentGlobalPaletteMode);
break;
case KryptonCommandType.IntegratedToolBarQuickPrintCommand:
- SwitchToQuickPrintCommand(KryptonManager.InternalGlobalPaletteMode);
+ SwitchToQuickPrintCommand(KryptonManager.CurrentGlobalPaletteMode);
break;
case KryptonCommandType.IntegratedToolBarRedoCommand:
- SwitchToRedoCommand(KryptonManager.InternalGlobalPaletteMode);
+ SwitchToRedoCommand(KryptonManager.CurrentGlobalPaletteMode);
break;
case KryptonCommandType.IntegratedToolBarSaveAllCommand:
- SwitchToSaveAllCommand(KryptonManager.InternalGlobalPaletteMode);
+ SwitchToSaveAllCommand(KryptonManager.CurrentGlobalPaletteMode);
break;
case KryptonCommandType.IntegratedToolBarSaveAsCommand:
- SwitchToSaveAsCommand(KryptonManager.InternalGlobalPaletteMode);
+ SwitchToSaveAsCommand(KryptonManager.CurrentGlobalPaletteMode);
break;
case KryptonCommandType.IntegratedToolBarSaveCommand:
- SwitchToSaveCommand(KryptonManager.InternalGlobalPaletteMode);
+ SwitchToSaveCommand(KryptonManager.CurrentGlobalPaletteMode);
break;
case KryptonCommandType.IntegratedToolBarUndoCommand:
- SwitchToUndoCommand(KryptonManager.InternalGlobalPaletteMode);
+ SwitchToUndoCommand(KryptonManager.CurrentGlobalPaletteMode);
break;
default:
throw new ArgumentOutOfRangeException(nameof(commandType), commandType, null);
@@ -468,7 +468,8 @@ private void SwitchToUndoCommand(PaletteMode paletteMode)
case PaletteMode.ProfessionalOffice2003:
UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarUndoNormal);
break;
- case PaletteMode.Office2007DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
case PaletteMode.Office2007BlueDarkMode:
case PaletteMode.Office2007BlueLightMode:
@@ -480,7 +481,8 @@ private void SwitchToUndoCommand(PaletteMode paletteMode)
case PaletteMode.Office2007BlackDarkMode:
UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
break;
- case PaletteMode.Office2010DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
case PaletteMode.Office2010BlueDarkMode:
case PaletteMode.Office2010BlueLightMode:
@@ -502,12 +504,14 @@ private void SwitchToUndoCommand(PaletteMode paletteMode)
case PaletteMode.Custom:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarUndoNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
case PaletteMode.Microsoft365BlackDarkMode:
case PaletteMode.Microsoft365Blue:
@@ -536,7 +540,8 @@ private void SwitchToSaveCommand(PaletteMode paletteMode)
case PaletteMode.ProfessionalOffice2003:
UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarSaveNormal);
break;
- case PaletteMode.Office2007DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
case PaletteMode.Office2007BlueDarkMode:
case PaletteMode.Office2007BlueLightMode:
@@ -548,7 +553,8 @@ private void SwitchToSaveCommand(PaletteMode paletteMode)
case PaletteMode.Office2007BlackDarkMode:
UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
break;
- case PaletteMode.Office2010DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
case PaletteMode.Office2010BlueDarkMode:
case PaletteMode.Office2010BlueLightMode:
@@ -570,12 +576,14 @@ private void SwitchToSaveCommand(PaletteMode paletteMode)
case PaletteMode.Custom:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarSaveNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
case PaletteMode.Microsoft365BlackDarkMode:
case PaletteMode.Microsoft365Blue:
@@ -604,7 +612,8 @@ private void SwitchToSaveAsCommand(PaletteMode paletteMode)
case PaletteMode.ProfessionalOffice2003:
UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
break;
- case PaletteMode.Office2007DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
case PaletteMode.Office2007BlueDarkMode:
case PaletteMode.Office2007BlueLightMode:
@@ -616,7 +625,8 @@ private void SwitchToSaveAsCommand(PaletteMode paletteMode)
case PaletteMode.Office2007BlackDarkMode:
UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
break;
- case PaletteMode.Office2010DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
case PaletteMode.Office2010BlueDarkMode:
case PaletteMode.Office2010BlueLightMode:
@@ -638,12 +648,14 @@ private void SwitchToSaveAsCommand(PaletteMode paletteMode)
case PaletteMode.Custom:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarSaveAsNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
case PaletteMode.Microsoft365BlackDarkMode:
case PaletteMode.Microsoft365Blue:
@@ -672,7 +684,8 @@ private void SwitchToSaveAllCommand(PaletteMode paletteMode)
case PaletteMode.ProfessionalOffice2003:
UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarSaveAllNormal);
break;
- case PaletteMode.Office2007DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
case PaletteMode.Office2007BlueDarkMode:
case PaletteMode.Office2007BlueLightMode:
@@ -684,7 +697,8 @@ private void SwitchToSaveAllCommand(PaletteMode paletteMode)
case PaletteMode.Office2007BlackDarkMode:
UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
break;
- case PaletteMode.Office2010DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
case PaletteMode.Office2010BlueDarkMode:
case PaletteMode.Office2010BlueLightMode:
@@ -706,12 +720,14 @@ private void SwitchToSaveAllCommand(PaletteMode paletteMode)
case PaletteMode.Custom:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarSaveAllNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
case PaletteMode.Microsoft365BlackDarkMode:
case PaletteMode.Microsoft365Blue:
@@ -740,7 +756,8 @@ private void SwitchToRedoCommand(PaletteMode paletteMode)
case PaletteMode.ProfessionalOffice2003:
UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarRedoNormal);
break;
- case PaletteMode.Office2007DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
case PaletteMode.Office2007BlueDarkMode:
case PaletteMode.Office2007BlueLightMode:
@@ -752,7 +769,8 @@ private void SwitchToRedoCommand(PaletteMode paletteMode)
case PaletteMode.Office2007BlackDarkMode:
UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
break;
- case PaletteMode.Office2010DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
case PaletteMode.Office2010BlueDarkMode:
case PaletteMode.Office2010BlueLightMode:
@@ -774,12 +792,14 @@ private void SwitchToRedoCommand(PaletteMode paletteMode)
case PaletteMode.Custom:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarRedoNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
case PaletteMode.Microsoft365BlackDarkMode:
case PaletteMode.Microsoft365Blue:
@@ -806,7 +826,8 @@ private void SwitchToQuickPrintCommand(PaletteMode paletteMode)
case PaletteMode.ProfessionalOffice2003:
UpdateImage(GenericToolbarImageResources.GenericQuickPrint);
break;
- case PaletteMode.Office2007DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
case PaletteMode.Office2007BlueDarkMode:
case PaletteMode.Office2007BlueLightMode:
@@ -818,7 +839,8 @@ private void SwitchToQuickPrintCommand(PaletteMode paletteMode)
case PaletteMode.Office2007BlackDarkMode:
UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
break;
- case PaletteMode.Office2010DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
case PaletteMode.Office2010BlueDarkMode:
case PaletteMode.Office2010BlueLightMode:
@@ -840,12 +862,14 @@ private void SwitchToQuickPrintCommand(PaletteMode paletteMode)
case PaletteMode.Custom:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarQuickPrintNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
case PaletteMode.Microsoft365BlackDarkMode:
case PaletteMode.Microsoft365Blue:
@@ -874,7 +898,8 @@ private void SwitchToPrintPreviewCommand(PaletteMode paletteMode)
case PaletteMode.ProfessionalOffice2003:
UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarPrintPreviewNormal);
break;
- case PaletteMode.Office2007DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
case PaletteMode.Office2007BlueDarkMode:
case PaletteMode.Office2007BlueLightMode:
@@ -886,7 +911,8 @@ private void SwitchToPrintPreviewCommand(PaletteMode paletteMode)
case PaletteMode.Office2007BlackDarkMode:
UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
break;
- case PaletteMode.Office2010DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
case PaletteMode.Office2010BlueDarkMode:
case PaletteMode.Office2010BlueLightMode:
@@ -908,12 +934,14 @@ private void SwitchToPrintPreviewCommand(PaletteMode paletteMode)
case PaletteMode.Custom:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarPrintPreviewNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
case PaletteMode.Microsoft365BlackDarkMode:
case PaletteMode.Microsoft365Blue:
@@ -942,7 +970,8 @@ private void SwitchToPrintCommand(PaletteMode paletteMode)
case PaletteMode.ProfessionalOffice2003:
UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarPrintNormal);
break;
- case PaletteMode.Office2007DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
case PaletteMode.Office2007BlueDarkMode:
case PaletteMode.Office2007BlueLightMode:
@@ -954,7 +983,8 @@ private void SwitchToPrintCommand(PaletteMode paletteMode)
case PaletteMode.Office2007BlackDarkMode:
UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
break;
- case PaletteMode.Office2010DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
case PaletteMode.Office2010BlueDarkMode:
case PaletteMode.Office2010BlueLightMode:
@@ -976,12 +1006,14 @@ private void SwitchToPrintCommand(PaletteMode paletteMode)
case PaletteMode.Custom:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarPrintNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
case PaletteMode.Microsoft365BlackDarkMode:
case PaletteMode.Microsoft365Blue:
@@ -1010,7 +1042,8 @@ private void SwitchToPasteCommand(PaletteMode paletteMode)
case PaletteMode.ProfessionalOffice2003:
UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarPasteNormal);
break;
- case PaletteMode.Office2007DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
case PaletteMode.Office2007BlueDarkMode:
case PaletteMode.Office2007BlueLightMode:
@@ -1022,7 +1055,8 @@ private void SwitchToPasteCommand(PaletteMode paletteMode)
case PaletteMode.Office2007BlackDarkMode:
UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
break;
- case PaletteMode.Office2010DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
case PaletteMode.Office2010BlueDarkMode:
case PaletteMode.Office2010BlueLightMode:
@@ -1044,12 +1078,14 @@ private void SwitchToPasteCommand(PaletteMode paletteMode)
case PaletteMode.Custom:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarPasteNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
case PaletteMode.Microsoft365BlackDarkMode:
case PaletteMode.Microsoft365Blue:
@@ -1078,7 +1114,8 @@ private void SwitchToPageSetupCommand(PaletteMode paletteMode)
case PaletteMode.ProfessionalOffice2003:
UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarPageSetupNormal);
break;
- case PaletteMode.Office2007DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
case PaletteMode.Office2007BlueDarkMode:
case PaletteMode.Office2007BlueLightMode:
@@ -1090,7 +1127,8 @@ private void SwitchToPageSetupCommand(PaletteMode paletteMode)
case PaletteMode.Office2007BlackDarkMode:
UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
break;
- case PaletteMode.Office2010DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
case PaletteMode.Office2010BlueDarkMode:
case PaletteMode.Office2010BlueLightMode:
@@ -1112,12 +1150,14 @@ private void SwitchToPageSetupCommand(PaletteMode paletteMode)
case PaletteMode.Custom:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarPageSetupNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
case PaletteMode.Microsoft365BlackDarkMode:
case PaletteMode.Microsoft365Blue:
@@ -1146,7 +1186,8 @@ private void SwitchToOpenCommand(PaletteMode paletteMode)
case PaletteMode.ProfessionalOffice2003:
UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarOpenNormal);
break;
- case PaletteMode.Office2007DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
case PaletteMode.Office2007BlueDarkMode:
case PaletteMode.Office2007BlueLightMode:
@@ -1158,7 +1199,8 @@ private void SwitchToOpenCommand(PaletteMode paletteMode)
case PaletteMode.Office2007BlackDarkMode:
UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
break;
- case PaletteMode.Office2010DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
case PaletteMode.Office2010BlueDarkMode:
case PaletteMode.Office2010BlueLightMode:
@@ -1180,12 +1222,14 @@ private void SwitchToOpenCommand(PaletteMode paletteMode)
case PaletteMode.Custom:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarOpenNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
case PaletteMode.Microsoft365BlackDarkMode:
case PaletteMode.Microsoft365Blue:
@@ -1214,7 +1258,8 @@ private void SwitchToNewCommand(PaletteMode paletteMode)
case PaletteMode.ProfessionalOffice2003:
UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarNewNormal);
break;
- case PaletteMode.Office2007DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
case PaletteMode.Office2007BlueDarkMode:
case PaletteMode.Office2007BlueLightMode:
@@ -1226,7 +1271,8 @@ private void SwitchToNewCommand(PaletteMode paletteMode)
case PaletteMode.Office2007BlackDarkMode:
UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
break;
- case PaletteMode.Office2010DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
case PaletteMode.Office2010BlueDarkMode:
case PaletteMode.Office2010BlueLightMode:
@@ -1248,12 +1294,14 @@ private void SwitchToNewCommand(PaletteMode paletteMode)
case PaletteMode.Custom:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarNewNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
case PaletteMode.Microsoft365BlackDarkMode:
case PaletteMode.Microsoft365Blue:
@@ -1282,7 +1330,8 @@ private void SwitchToCutCommand(PaletteMode paletteMode)
case PaletteMode.ProfessionalOffice2003:
UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarCutNormal);
break;
- case PaletteMode.Office2007DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
case PaletteMode.Office2007BlueDarkMode:
case PaletteMode.Office2007BlueLightMode:
@@ -1294,7 +1343,8 @@ private void SwitchToCutCommand(PaletteMode paletteMode)
case PaletteMode.Office2007BlackDarkMode:
UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
break;
- case PaletteMode.Office2010DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
case PaletteMode.Office2010BlueDarkMode:
case PaletteMode.Office2010BlueLightMode:
@@ -1316,12 +1366,14 @@ private void SwitchToCutCommand(PaletteMode paletteMode)
case PaletteMode.Custom:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarCutNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
case PaletteMode.Microsoft365BlackDarkMode:
case PaletteMode.Microsoft365Blue:
@@ -1350,7 +1402,8 @@ private void SwitchToCopyCommand(PaletteMode paletteMode)
case PaletteMode.ProfessionalOffice2003:
UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarCopyNormal);
break;
- case PaletteMode.Office2007DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
case PaletteMode.Office2007BlueDarkMode:
case PaletteMode.Office2007BlueLightMode:
@@ -1362,7 +1415,8 @@ private void SwitchToCopyCommand(PaletteMode paletteMode)
case PaletteMode.Office2007BlackDarkMode:
UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
break;
- case PaletteMode.Office2010DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
case PaletteMode.Office2010BlueDarkMode:
case PaletteMode.Office2010BlueLightMode:
@@ -1384,12 +1438,14 @@ private void SwitchToCopyCommand(PaletteMode paletteMode)
case PaletteMode.Custom:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarCopyNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
case PaletteMode.Microsoft365BlackDarkMode:
case PaletteMode.Microsoft365Blue:
@@ -1418,7 +1474,8 @@ private void SwitchToHelpCommand(PaletteMode paletteMode)
case PaletteMode.ProfessionalOffice2003:
UpdateImage(Office2003ControlBoxResources.Office2003HelpIconNormal);
break;
- case PaletteMode.Office2007DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
case PaletteMode.Office2007BlueDarkMode:
case PaletteMode.Office2007BlueLightMode:
@@ -1430,7 +1487,8 @@ private void SwitchToHelpCommand(PaletteMode paletteMode)
case PaletteMode.Office2007BlackDarkMode:
UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarHelpNormal);
break;
- case PaletteMode.Office2010DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
case PaletteMode.Office2010BlueDarkMode:
case PaletteMode.Office2010BlueLightMode:
@@ -1452,12 +1510,14 @@ private void SwitchToHelpCommand(PaletteMode paletteMode)
case PaletteMode.Custom:
UpdateImage(Office2010ControlBoxResources.Office2010HelpIconNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateImage(Office2013ControlBoxResources.Office2013HelpNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
case PaletteMode.Microsoft365BlackDarkMode:
case PaletteMode.Microsoft365Blue:
@@ -1476,7 +1536,7 @@ private void SwitchToHelpCommand(PaletteMode paletteMode)
/// Updates the image.
/// The help image.
- private void UpdateImage(Image helpImage) => ImageSmall = helpImage;
+ private void UpdateImage(Image? helpImage) => ImageSmall = helpImage;
/// Sets the text.
/// The value.
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCommandLinkButton.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCommandLinkButton.cs
new file mode 100644
index 000000000..24394a98b
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCommandLinkButton.cs
@@ -0,0 +1,732 @@
+#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. 2017 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+namespace Krypton.Toolkit
+{
+ /// Combines button functionality with the styling features of the Krypton Toolkit.
+ /// Main code taken from KryptonButton, then trimmed out to force the CommandLink layout.
+ [ToolboxBitmap(typeof(KryptonCommandLinkButton), @"ToolboxBitmaps.KryptonCommandLinkButton.bmp")]
+ [ToolboxItem(true)]
+ [DefaultEvent("Click")]
+ [DefaultProperty("Heading")]
+ [Designer(typeof(KryptonCommandLinkButtonDesigner))]
+ [DesignerCategory("code")]
+#if NET6_0
+#pragma warning disable CS0618
+#endif
+ [ClassInterface(ClassInterfaceType.AutoDispatch)]
+#if NET6_0
+#pragma warning restore CS0618
+#endif
+ [DisplayName("Krypton Command Link")]
+ [Description("A Krypton Command Link Button.")]
+ [ComVisible(true)]
+ public class KryptonCommandLinkButton : VisualSimpleBase, IButtonControl
+ {
+ // [ClassInterface(ClassInterfaceType.AutoDispatch)]
+ // generates warning CS0618:
+ // 'ClassInterfaceType.AutoDispatch' is obsolete: 'Support for IDispatch may be unavailable in future releases.'
+ // Krypton.Toolkit 2022 (net6.0-windows)
+ //
+ // Only for net6.0 and not for newer releases.
+ //
+ // Therefore the warning has been disabled for NET 6.0, since it has only been marked as obsolete in future releases
+ // but does seems to remain supported in contrast to the warning
+ //
+ // May it become marked obsolete in future releases new warnings will appear.
+
+ #region Static Fields
+
+ private const int BCM_SETSHIELD = 0x0000160C;
+
+ #endregion
+
+ #region Instance Fields
+
+ private bool _isDefault;
+ private bool _useMnemonic;
+ private bool _wasEnabled;
+ private ButtonStyle _buttonStyle;
+ private IKryptonCommand? _command;
+ private readonly ButtonController _buttonController;
+ private readonly PaletteTripleOverride _overrideFocus;
+ private readonly PaletteTripleOverride _overrideNormal;
+ private readonly PaletteTripleOverride _overridePressed;
+ private readonly PaletteTripleOverride _overrideTracking;
+ private readonly ViewDrawCommandLinkButton _drawCommandLinkButton;
+ private VisualOrientation _orientation;
+
+ #endregion
+
+ #region Events
+
+ ///
+ /// Occurs when the value of the KryptonCommand property changes.
+ ///
+ [Category("Property Changed")]
+ [Description("Occurs when the value of the KryptonCommand property changes.")]
+ public event EventHandler KryptonCommandChanged;
+
+ #endregion
+
+ #region Identity
+
+ /// Initializes a new instance of the class.
+ public KryptonCommandLinkButton()
+ {
+ // We generate click events manually, suppress default
+ // production of them by the base Control class
+ SetStyle(ControlStyles.StandardClick |
+ ControlStyles.StandardDoubleClick, false);
+
+ // Set default button properties
+ base.AutoSize = false;
+ DialogResult = DialogResult.None;
+ _orientation = VisualOrientation.Top;
+ _useMnemonic = true;
+
+ // Create content storage
+ CommandLinkImageValues = new CommandLinkImageValues(NeedPaintDelegate);
+ CommandLinkImageValues.Image = CommandLinkImageResources.Windows_11_CommandLink_Arrow;
+ CommandLinkTextValues = new CommandLinkTextValues(NeedPaintDelegate);
+
+ // Create the palette storage
+ StateCommon = new PaletteTripleRedirect(Redirector, PaletteBackStyle.ButtonCommand, PaletteBorderStyle.ButtonCommand, PaletteContentStyle.ButtonCommand, NeedPaintDelegate);
+ PaletteContentText contentShortText = StateCommon.Content.ShortText;
+ contentShortText.Font = KryptonManager.CurrentGlobalPalette.BaseFont; //new Font(@"Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point, 0);
+ contentShortText.TextH = PaletteRelativeAlign.Near;
+ contentShortText.TextV = PaletteRelativeAlign.Center;
+ StateCommon.Content.LongText.TextH = PaletteRelativeAlign.Near;
+ StateCommon.Content.LongText.TextV = PaletteRelativeAlign.Far;
+
+ StateDisabled = new PaletteTriple(StateCommon, NeedPaintDelegate);
+ StateNormal = new PaletteTriple(StateCommon, NeedPaintDelegate);
+ StateTracking = new PaletteTriple(StateCommon, NeedPaintDelegate);
+ StatePressed = new PaletteTriple(StateCommon, NeedPaintDelegate);
+ OverrideDefault = new PaletteTripleRedirect(Redirector, PaletteBackStyle.ButtonCommand, PaletteBorderStyle.ButtonCommand, PaletteContentStyle.ButtonCommand, NeedPaintDelegate);
+ OverrideFocus = new PaletteTripleRedirect(Redirector, PaletteBackStyle.ButtonCommand, PaletteBorderStyle.ButtonCommand, PaletteContentStyle.ButtonCommand, NeedPaintDelegate);
+ OverrideFocus.Border.Draw = InheritBool.True;
+ OverrideFocus.Border.DrawBorders = PaletteDrawBorders.All;
+ OverrideFocus.Border.GraphicsHint = PaletteGraphicsHint.AntiAlias;
+ // Force style update
+ ButtonStyle = ButtonStyle.Command;
+
+ // Create the override handling classes
+ _overrideFocus = new PaletteTripleOverride(OverrideFocus, StateNormal, PaletteState.FocusOverride);
+ _overrideNormal = new PaletteTripleOverride(OverrideDefault, _overrideFocus, PaletteState.NormalDefaultOverride);
+ _overrideTracking = new PaletteTripleOverride(OverrideFocus, StateTracking, PaletteState.FocusOverride);
+ _overridePressed = new PaletteTripleOverride(OverrideFocus, StatePressed, PaletteState.FocusOverride);
+
+ // Create the view button instance
+ _drawCommandLinkButton = new ViewDrawCommandLinkButton(StateDisabled,
+ _overrideNormal,
+ _overrideTracking,
+ _overridePressed,
+ new PaletteMetricRedirect(Redirector),
+ CommandLinkImageValues, CommandLinkTextValues,
+ Orientation,
+ UseMnemonic)
+ {
+ // Only draw a focus rectangle when focus cues are needed in the top level form
+ TestForFocusCues = true
+ };
+
+ // Create a button controller to handle button style behaviour
+ _buttonController = new ButtonController(_drawCommandLinkButton, NeedPaintDelegate);
+
+ // Assign the controller to the view element to treat as a button
+ _drawCommandLinkButton.MouseController = _buttonController;
+ _drawCommandLinkButton.KeyController = _buttonController;
+ _drawCommandLinkButton.SourceController = _buttonController;
+
+ // Need to know when user clicks the button view or mouse selects it
+ _buttonController.Click += OnButtonClick;
+ _buttonController.MouseSelect += OnButtonSelect;
+
+ // Create the view manager instance
+ ViewManager = new ViewManager(this, _drawCommandLinkButton);
+ }
+
+ #endregion
+
+ #region Public
+
+ ///
+ /// Gets and sets the automatic resize of the control to fit contents.
+ ///
+ [Browsable(false)]
+ [Localizable(false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public override bool AutoSize
+ {
+ get => base.AutoSize;
+ set
+ {
+ // Do nothing }
+ }
+ }
+
+ ///
+ /// Gets and sets the internal padding space.
+ ///
+ [Browsable(false)]
+ [Localizable(false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public new Padding Padding
+ {
+ get => base.Padding;
+ set => base.Padding = value;
+ }
+
+ ///
+ /// Gets or sets the text associated with this control.
+ ///
+ [Editor("System.ComponentModel.Design.MultilineStringEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
+ [Browsable(false)]
+ [Localizable(false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public new string Text
+ {
+ get => CommandLinkTextValues.Heading;
+ set => CommandLinkTextValues.Heading = value;
+ }
+
+ private bool ShouldSerializeText() =>
+ // Never serialize, let the button values serialize instead
+ false;
+
+ ///
+ /// Resets the Text property to its default value.
+ ///
+ public override void ResetText() => CommandLinkTextValues.ResetText();
+
+ ///
+ /// Gets and sets the visual orientation of the control.
+ ///
+ [Category("Visuals")]
+ [Description("Visual orientation of the control.")]
+ [DefaultValue(typeof(VisualOrientation), "Top")]
+ public virtual VisualOrientation Orientation
+ {
+ get => _orientation;
+
+ set
+ {
+ if (_orientation != value)
+ {
+ _orientation = value;
+
+ // Update the associated visual elements that are effected
+ _drawCommandLinkButton.Orientation = value;
+
+ PerformNeedPaint(true);
+ }
+ }
+ }
+
+ ///
+ /// Gets and sets the button style.
+ ///
+ [Category("Visuals")]
+ [Description("Button style.")]
+ public ButtonStyle ButtonStyle
+ {
+ get => _buttonStyle;
+
+ set
+ {
+ if (_buttonStyle != value)
+ {
+ _buttonStyle = value;
+ SetStyles(_buttonStyle);
+ PerformNeedPaint(true);
+ }
+ }
+ }
+
+ private bool ShouldSerializeButtonStyle() => (ButtonStyle != ButtonStyle.Command);
+
+ private void ResetButtonStyle() => ButtonStyle = ButtonStyle.Command;
+
+ ///
+ /// Gets access to the button content.
+ ///
+ [Category("CommandLink")]
+ [Description("CommandLink Button Text")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ public CommandLinkTextValues CommandLinkTextValues { get; }
+
+ ///
+ /// Gets access to the button content.
+ ///
+ [Category("CommandLink")]
+ [Description("CommandLink Button Image")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ public CommandLinkImageValues CommandLinkImageValues { get; }
+
+ private bool ShouldSerializeValues() => false;
+
+ ///
+ /// Gets access to the common button appearance that other states can override.
+ ///
+ [Category("Visuals")]
+ [Description("Overrides for defining common button appearance that other states can override.")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ public PaletteTripleRedirect StateCommon { get; }
+
+ private bool ShouldSerializeStateCommon() => !StateCommon.IsDefault;
+
+ ///
+ /// Gets access to the disabled button appearance entries.
+ ///
+ [Category("Visuals")]
+ [Description("Overrides for defining disabled button appearance.")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ public PaletteTriple StateDisabled { get; }
+
+ private bool ShouldSerializeStateDisabled() => !StateDisabled.IsDefault;
+
+ ///
+ /// Gets access to the normal button appearance entries.
+ ///
+ [Category("Visuals")]
+ [Description("Overrides for defining normal button appearance.")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ public PaletteTriple StateNormal { get; }
+
+ private bool ShouldSerializeStateNormal() => !StateNormal.IsDefault;
+
+ ///
+ /// Gets access to the hot tracking button appearance entries.
+ ///
+ [Category("Visuals")]
+ [Description("Overrides for defining hot tracking button appearance.")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ public PaletteTriple StateTracking { get; }
+
+ private bool ShouldSerializeStateTracking() => !StateTracking.IsDefault;
+
+ ///
+ /// Gets access to the pressed button appearance entries.
+ ///
+ [Category("Visuals")]
+ [Description("Overrides for defining pressed button appearance.")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ public PaletteTriple StatePressed { get; }
+
+ private bool ShouldSerializeStatePressed() => !StatePressed.IsDefault;
+
+ ///
+ /// Gets access to the normal button appearance when default.
+ ///
+ [Category("Visuals")]
+ [Description("Overrides for defining normal button appearance when default.")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ public PaletteTripleRedirect OverrideDefault { get; }
+
+ private bool ShouldSerializeOverrideDefault() => !OverrideDefault.IsDefault;
+
+ ///
+ /// Gets access to the button appearance when it has focus.
+ ///
+ [Category("Visuals")]
+ [Description("Overrides for defining button appearance when it has focus.")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ public PaletteTripleRedirect OverrideFocus { get; }
+
+ private bool ShouldSerializeOverrideFocus() => !OverrideFocus.IsDefault;
+
+ ///
+ /// Gets or sets the value returned to the parent form when the button is clicked.
+ ///
+ [Category("Behavior")]
+ [Description("The dialog-box result produced in a modal form by clicking the button.")]
+ [DefaultValue(typeof(DialogResult), "None")]
+ public DialogResult DialogResult { get; set; }
+
+ ///
+ /// Gets and sets the associated KryptonCommand.
+ ///
+ [Category("Behavior")]
+ [Description("Command associated with the button.")]
+ [DefaultValue(null)]
+ public virtual IKryptonCommand? KryptonCommand
+ {
+ get => _command;
+
+ set
+ {
+ if (_command == value)
+ {
+ return;
+ }
+
+ if (_command != null)
+ {
+ _command.PropertyChanged -= OnCommandPropertyChanged;
+ }
+ else
+ {
+ _wasEnabled = Enabled;
+ }
+
+ _command = value;
+ OnKryptonCommandChanged(EventArgs.Empty);
+
+ if (_command != null)
+ {
+ _command.PropertyChanged += OnCommandPropertyChanged;
+ }
+ else
+ {
+ Enabled = _wasEnabled;
+ }
+ }
+ }
+
+ ///
+ /// Notifies a control that it is the default button so that its appearance and behavior is adjusted accordingly.
+ ///
+ /// true if the control should behave as a default button; otherwise false.
+ public void NotifyDefault(bool value)
+ {
+ if (!ViewDrawButton.IsFixed && (_isDefault != value))
+ {
+ // Remember new default status
+ _isDefault = value;
+
+ // Decide if the default overrides should be applied
+ _overrideNormal.Apply = value;
+
+ // Change in default state requires a layout and repaint
+ PerformNeedPaint(true);
+ }
+ }
+
+ ///
+ /// Generates a Click event for the control.
+ ///
+ public void PerformClick()
+ {
+ if (CanSelect)
+ {
+ OnClick(EventArgs.Empty);
+ }
+ }
+
+ ///
+ /// Gets or sets a value indicating whether an ampersand is included in the text of the control.
+ ///
+ [Category("Appearance")]
+ [Description("When true the first character after an ampersand will be used as a mnemonic.")]
+ [DefaultValue(true)]
+ public bool UseMnemonic
+ {
+ get => _useMnemonic;
+
+ set
+ {
+ if (_useMnemonic != value)
+ {
+ _useMnemonic = value;
+ _drawCommandLinkButton.UseMnemonic = value;
+ PerformNeedPaint(true);
+ }
+ }
+ }
+
+ ///
+ /// Fix the control to a particular palette state.
+ ///
+ /// Palette state to fix.
+ public virtual void SetFixedState(PaletteState state)
+ {
+ if (state == PaletteState.NormalDefaultOverride)
+ {
+ // Set up the overrides correctly to match state
+ _overrideFocus.Apply = true;
+ _overrideNormal.Apply = true;
+
+ // Must pass a proper drawing state to the view
+ state = PaletteState.Normal;
+ }
+
+ // Request fixed state from the view
+ _drawCommandLinkButton.FixedState = state;
+ }
+
+ ///
+ /// Determines the IME status of the object when selected.
+ ///
+ [Browsable(false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new ImeMode ImeMode
+ {
+ get => base.ImeMode;
+ set => base.ImeMode = value;
+ }
+
+ #endregion
+
+ #region Protected Overrides
+
+ ///
+ /// Gets the default size of the control.
+ ///
+ protected override Size DefaultSize => new Size(319, 61);
+
+ ///
+ /// Gets the default Input Method Editor (IME) mode supported by this control.
+ ///
+ protected override ImeMode DefaultImeMode => ImeMode.Disable;
+
+ ///
+ /// Raises the EnabledChanged event.
+ ///
+ /// An EventArgs that contains the event data.
+ protected override void OnEnabledChanged(EventArgs e)
+ {
+ // Change in enabled state requires a layout and repaint
+ PerformNeedPaint(true);
+
+ // Let base class fire standard event
+ base.OnEnabledChanged(e);
+ }
+
+ ///
+ /// Raises the GotFocus event.
+ ///
+ /// An EventArgs that contains the event data.
+ protected override void OnGotFocus(EventArgs e)
+ {
+ if (!ViewDrawButton.IsFixed)
+ {
+ // Apply the focus overrides
+ _overrideFocus.Apply = true;
+ _overrideTracking.Apply = true;
+ _overridePressed.Apply = true;
+
+ // Change in focus requires a repaint
+ PerformNeedPaint(false);
+ }
+
+ // Let base class fire standard event
+ base.OnGotFocus(e);
+ }
+
+ ///
+ /// Raises the LostFocus event.
+ ///
+ /// An EventArgs that contains the event data.
+ protected override void OnLostFocus(EventArgs e)
+ {
+ if (!ViewDrawButton.IsFixed)
+ {
+ // Apply the focus overrides
+ _overrideFocus.Apply = false;
+ _overrideTracking.Apply = false;
+ _overridePressed.Apply = false;
+
+ // Change in focus requires a repaint
+ PerformNeedPaint(false);
+ }
+
+ // Let base class fire standard event
+ base.OnLostFocus(e);
+ }
+
+ ///
+ /// Raises the Click event.
+ ///
+ /// An EventArgs that contains the event data.
+ protected override void OnClick(EventArgs e)
+ {
+ // Find the form this button is on
+ Form? owner = FindForm();
+
+ // If we find a valid owner
+ if (owner != null)
+ {
+ // Update owner with our dialog result setting
+ owner.DialogResult = DialogResult;
+ }
+
+ // Let base class fire standard event
+ base.OnClick(e);
+
+ // If we have an attached command then execute it
+ KryptonCommand?.PerformExecute();
+ }
+
+ ///
+ /// Processes a mnemonic character.
+ ///
+ /// The mnemonic character entered.
+ /// true if the mnemonic was processed; otherwise, false.
+ protected override bool ProcessMnemonic(char charCode)
+ {
+ // Are we allowed to process mnemonics?
+ if (UseMnemonic && CanProcessMnemonic())
+ {
+ // Does the button primary text contain the mnemonic?
+ if (IsMnemonic(charCode, CommandLinkTextValues.Heading))
+ {
+ // Perform default action for a button, click it!
+ PerformClick();
+ return true;
+ }
+ }
+
+ // No match found, let base class do standard processing
+ return base.ProcessMnemonic(charCode);
+ }
+
+ ///
+ /// Called when a context menu has just been closed.
+ ///
+ protected override void ContextMenuClosed()
+ {
+ _buttonController.RemoveFixed();
+ }
+
+ ///
+ protected override void OnPaint(PaintEventArgs? e)
+ {
+ StateCommon.Content.LongText.Font = CommandLinkTextValues.DescriptionFont != null
+ ? CommandLinkTextValues.DescriptionFont
+ : null;
+
+ StateCommon.Content.ShortText.Font =
+ CommandLinkTextValues.HeadingFont != null
+ ? CommandLinkTextValues.HeadingFont
+ : null;
+
+ StateCommon.Content.LongText.TextH = CommandLinkTextValues.DescriptionTextHAlignment != null
+ ? CommandLinkTextValues.DescriptionTextHAlignment ?? PaletteRelativeAlign.Near
+ : PaletteRelativeAlign.Near;
+
+ StateCommon.Content.LongText.TextV = CommandLinkTextValues.DescriptionTextVAlignment != null
+ ? CommandLinkTextValues.DescriptionTextVAlignment ?? PaletteRelativeAlign.Far
+ : PaletteRelativeAlign.Far;
+
+ StateCommon.Content.ShortText.TextH = CommandLinkTextValues.HeadingTextHAlignment != null
+ ? CommandLinkTextValues.HeadingTextHAlignment ?? PaletteRelativeAlign.Near
+ : PaletteRelativeAlign.Near;
+
+ StateCommon.Content.ShortText.TextV = CommandLinkTextValues.HeadingTextVAlignment != null
+ ? CommandLinkTextValues.HeadingTextVAlignment ?? PaletteRelativeAlign.Center
+ : PaletteRelativeAlign.Center;
+
+ base.OnPaint(e);
+ }
+
+ #endregion
+
+ #region WIN32 Calls
+
+
+ [DllImport(Libraries.User32, CharSet = CharSet.Unicode)]
+ static extern int SendMessage(HandleRef hWnd, uint msg, IntPtr wParam, bool lParam);
+
+ #endregion
+
+ #region Protected Virtual
+
+ ///
+ /// Update the state objects to reflect the new button style.
+ ///
+ /// New button style.
+ protected virtual void SetStyles(ButtonStyle buttonStyle)
+ {
+ StateCommon.SetStyles(buttonStyle);
+ OverrideDefault.SetStyles(buttonStyle);
+ OverrideFocus.SetStyles(buttonStyle);
+ }
+
+ ///
+ /// Creates a values storage object appropriate for control.
+ ///
+ /// Set of button values.
+ /// Delegate for notifying paint requests.
+ protected virtual ButtonValues CreateButtonValues(NeedPaintHandler needPaint) => new ButtonValues(needPaint);
+
+ ///
+ /// Raises the KryptonCommandChanged event.
+ ///
+ /// An EventArgs containing the event data.
+ protected virtual void OnKryptonCommandChanged(EventArgs e)
+ {
+ KryptonCommandChanged.Invoke(this, e);
+
+ // Use the values from the new command
+ if (KryptonCommand != null)
+ {
+ Enabled = KryptonCommand.Enabled;
+ }
+
+ // Redraw to update the text/extratext/image properties
+ PerformNeedPaint(true);
+ }
+
+ ///
+ /// Handles a change in the property of an attached command.
+ ///
+ /// Source of the event.
+ /// A PropertyChangedEventArgs that contains the event data.
+ protected virtual void OnCommandPropertyChanged(object? sender, PropertyChangedEventArgs e)
+ {
+ switch (e.PropertyName)
+ {
+ case "Enabled":
+ Enabled = KryptonCommand!.Enabled;
+ break;
+ case "Text":
+ case "ExtraText":
+ case "ImageSmall":
+ case "ImageTransparentColor":
+ PerformNeedPaint(true);
+ break;
+ }
+ }
+
+ ///
+ /// Gets access to the view element for the color button.
+ ///
+ protected virtual ViewDrawCommandLinkButton ViewDrawButton => _drawCommandLinkButton;
+
+ #endregion
+
+ #region Implementation
+
+ private void OnButtonTextChanged(object sender, EventArgs e) => OnTextChanged(EventArgs.Empty);
+
+ private void OnButtonClick(object? sender, MouseEventArgs e)
+ {
+ // Raise the standard click event
+ OnClick(EventArgs.Empty);
+
+ // Raise event to indicate it was a mouse activated click
+ OnMouseClick(e);
+ }
+
+ private void OnButtonSelect(object? sender, MouseEventArgs e)
+ {
+ // Take the focus if allowed
+ if (CanFocus)
+ {
+ Focus();
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonContextMenu.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonContextMenu.cs
index 2ff667cbe..978b4d5d5 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonContextMenu.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonContextMenu.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -71,7 +71,7 @@ public KryptonContextMenu()
NeedPaintHandler needPaintDelegate = OnNeedPaint;
// Set default settings
- Palette = null;
+ LocalCustomPalette = null;
PaletteMode = PaletteMode.Global;
Images = new ContextMenuImages(needPaintDelegate);
_redirector = new PaletteRedirect(null);
@@ -86,7 +86,7 @@ public KryptonContextMenu()
StateChecked = new PaletteContextMenuItemStateChecked(StateCommon);
// Create the top level collection for menu items
- Items = new KryptonContextMenuCollection();
+ Items = [];
}
///
@@ -205,17 +205,11 @@ protected override void Dispose(bool disposing)
[Description(@"Palette applied to drawing.")]
public PaletteMode PaletteMode
{
- [DebuggerStepThrough]
- get;
+ [DebuggerStepThrough] get;
set;
}
-
private bool ShouldSerializePaletteMode() => PaletteMode != PaletteMode.Global;
-
- ///
- /// Resets the PaletteMode property to its default value.
- ///
- public void ResetPaletteMode() => PaletteMode = PaletteMode.Global;
+ private void ResetPaletteMode() => PaletteMode = PaletteMode.Global;
///
/// Gets and sets the custom palette implementation.
@@ -223,17 +217,16 @@ public PaletteMode PaletteMode
[Category(@"Visuals")]
[Description(@"Custom palette applied to drawing.")]
[DefaultValue(null)]
- public PaletteBase? Palette
+ public KryptonCustomPaletteBase? LocalCustomPalette
{
[DebuggerStepThrough]
get;
set;
}
-
///
/// Resets the Palette property to its default value.
///
- public void ResetPalette() => PaletteMode = PaletteMode.Global;
+ private void ResetLocalCustomPalette() => PaletteMode = PaletteMode.Global;
///
/// Gets a reference to the caller that caused the context menu to be shown.
@@ -354,7 +347,7 @@ public bool Show(object caller,
CloseReason = ToolStripDropDownCloseReason.AppFocusChange;
// Create the actual control used to show the context menu
- VisualContextMenu = CreateContextMenu(this, Palette, PaletteMode,
+ VisualContextMenu = CreateContextMenu(this, LocalCustomPalette, PaletteMode,
_redirector, _redirectorImages,
Items, Enabled, keyboardActivated);
@@ -424,7 +417,7 @@ public void Close(ToolStripDropDownCloseReason reason)
protected virtual VisualContextMenu CreateContextMenu(KryptonContextMenu kcm,
PaletteBase? palette,
PaletteMode paletteMode,
- PaletteRedirect? redirector,
+ PaletteRedirect redirector,
PaletteRedirectContextMenu redirectorImages,
KryptonContextMenuCollection items,
bool enabled,
@@ -482,7 +475,7 @@ private void OnNeedPaint(object? sender, [DisallowNull] NeedLayoutEventArgs e)
VisualContextMenu?.PerformNeedPaint(e.NeedLayout);
}
- private void OnContextMenuDisposed(object sender, EventArgs e)
+ private void OnContextMenuDisposed(object? sender, EventArgs e)
{
// Should still be caching a reference to actual display control
if (VisualContextMenu != null)
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCustomPaletteBase.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCustomPaletteBase.cs
index 3b1165113..7b8bc8de0 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCustomPaletteBase.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCustomPaletteBase.cs
@@ -5,16 +5,14 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
// These are "Only" used here, So will not put into global usings
-using System.Xml.Xsl;
-
-using Krypton.Toolkit.Properties;
+using XmlTransformer = System.Xml.Xsl.XslCompiledTransform;
namespace Krypton.Toolkit
{
@@ -24,21 +22,15 @@ namespace Krypton.Toolkit
[ToolboxItem(true)]
[ToolboxBitmap(typeof(KryptonCustomPaletteBase), "ToolboxBitmaps.KryptonPalette.bmp")]
[DefaultEvent(nameof(PalettePaint))]
- [DefaultProperty(nameof(BasePaletteMode))]
+ //[DefaultProperty(nameof(BasePaletteMode))]
[DesignerCategory(@"code")]
- [Designer(typeof(KryptonPaletteDesigner))]
+ [Designer(typeof(KryptonCustomPaletteBaseDesigner))]
[Description(@"A customisable palette component.")]
public class KryptonCustomPaletteBase : PaletteBase
{
#region Type Definitions
- private class ImageDictionary : Dictionary { }
- private class ImageReverseDictionary : Dictionary { }
- #endregion
-
- #region Constants
-
- private const int CURRENT_PALETTE_VERSION = 19;
-
+ private class ImageDictionary : Dictionary;
+ private class ImageReverseDictionary : Dictionary;
#endregion
#region Instance Fields
@@ -47,11 +39,9 @@ private class ImageReverseDictionary : Dictionary { }
private IRenderer? _baseRenderer;
private RendererMode _baseRenderMode;
private PaletteBase? _basePalette;
- private PaletteMode _basePaletteMode;
- private InheritBool _allowFormChrome;
+ //private PaletteMode _basePaletteMode;
private readonly PaletteRedirect _redirector;
private readonly NeedPaintHandler _needPaintDelegate;
- private string _themeName;
#endregion
@@ -66,7 +56,6 @@ public KryptonCustomPaletteBase()
// Set the default palette/palette mode
_basePalette = KryptonManager.GetPaletteForMode(PaletteMode.Microsoft365Blue);
- _basePaletteMode = PaletteMode.Microsoft365Blue;
// Set the default renderer
_baseRenderer = null;
@@ -75,9 +64,6 @@ public KryptonCustomPaletteBase()
// Create the redirector for passing requests onto the inherited palette
_redirector = new PaletteRedirect(_basePalette);
- // Set default value of properties
- _allowFormChrome = InheritBool.Inherit;
-
// Create the storage for the common states
Common = new KryptonPaletteCommon(_redirector, _needPaintDelegate);
@@ -112,16 +98,11 @@ public KryptonCustomPaletteBase()
ButtonSpecs.ButtonSpecChanged += OnButtonSpecChanged;
// Hook to palette events
- if (_basePalette != null)
- {
- ToolMenuStatus = new KryptonPaletteTMS(this, _basePalette.ColorTable, OnMenuToolStatusPaint);
- _basePalette.PalettePaint += OnPalettePaint;
- _basePalette.ButtonSpecChanged += OnButtonSpecChanged;
- _basePalette.BasePaletteChanged += OnBasePaletteChanged;
- _basePalette.BaseRendererChanged += OnBaseRendererChanged;
- }
-
- _themeName = string.Empty;
+ ToolMenuStatus = new KryptonPaletteTMS(this, _basePalette.ColorTable, OnMenuToolStatusPaint);
+ _basePalette.PalettePaint += OnPalettePaint;
+ _basePalette.ButtonSpecChanged += OnButtonSpecChanged;
+ _basePalette.BasePaletteChanged += OnBasePaletteChanged;
+ _basePalette.BaseRendererChanged += OnBaseRendererChanged;
}
///
@@ -151,7 +132,7 @@ protected override void Dispose(bool disposing)
if (disposing)
{
// Must unhook from the palette paint event
- if (_basePalette != null)
+ if (_basePalette is not null)
{
_basePalette.PalettePaint -= OnPalettePaint;
_basePalette.ButtonSpecChanged -= OnButtonSpecChanged;
@@ -164,30 +145,20 @@ protected override void Dispose(bool disposing)
}
#endregion
- #region AllowFormChrome
+ #region UseThemeFormChromeBorderWidth
///
- /// Gets or sets a value indicating if KryptonForm instances should show custom chrome.
+ /// Gets or sets a value indicating if KryptonForm instances should UseThemeFormChromeBorderWidth.
///
[KryptonPersist(false)]
[Category(@"Visuals")]
- [Description(@"Should KryptonForm instances show custom chrome.")]
+ [Description(@"Should KryptonForm instances UseThemeFormChromeBorderWidth.")]
[DefaultValue(InheritBool.Inherit)]
- public InheritBool AllowFormChrome
+ public new InheritBool UseThemeFormChromeBorderWidth
{
- get => _allowFormChrome;
+ get => _basePalette!.UseThemeFormChromeBorderWidth;
- set
- {
- if (_allowFormChrome != value)
- {
- _allowFormChrome = value;
- OnAllowFormChromeChanged(this, EventArgs.Empty);
- }
- }
+ set => _basePalette!.UseThemeFormChromeBorderWidth = value;
}
-
- private bool ShouldSerializeAllowFormChrome() => AllowFormChrome != InheritBool.Inherit;
-
#endregion
#region ButtonSpecs
@@ -544,20 +515,12 @@ public KryptonPaletteCheckButtons ButtonStyles
public override IRenderer GetRenderer()
=> _baseRenderMode switch
{
- RendererMode.Inherit => _basePalette.GetRenderer(),
- RendererMode.Custom => _baseRenderer,
+ RendererMode.Inherit => _basePalette!.GetRenderer(),
+ RendererMode.Custom => _baseRenderer!,
_ => KryptonManager.GetRendererForMode(_baseRenderMode)
};
#endregion
- #region IPalette
- ///
- /// Gets a value indicating if KryptonForm instances should show custom chrome.
- ///
- /// InheritBool value.
- public override InheritBool GetAllowFormChrome() => AllowFormChrome == InheritBool.Inherit ? _basePalette.GetAllowFormChrome() : AllowFormChrome;
- #endregion
-
#region PaletteBase Back
///
/// Gets a value indicating if background should be drawn.
@@ -587,7 +550,7 @@ public override PaletteGraphicsHint GetBackGraphicsHint(PaletteBackStyle style,
/// Color value.
public override Color GetBackColor1(PaletteBackStyle style, PaletteState state) =>
// Find the correct destination in the palette and pass on request
- GetPaletteBack(style, state)?.GetBackColor1(state) ?? Color.Empty;
+ GetPaletteBack(style, state)?.GetBackColor1(state) ?? GlobalStaticValues.EMPTY_COLOR;
///
/// Gets the second back color.
@@ -597,7 +560,7 @@ public override Color GetBackColor1(PaletteBackStyle style, PaletteState state)
/// Color value.
public override Color GetBackColor2(PaletteBackStyle style, PaletteState state) =>
// Find the correct destination in the palette and pass on request
- GetPaletteBack(style, state)?.GetBackColor2(state) ?? Color.Empty;
+ GetPaletteBack(style, state)?.GetBackColor2(state) ?? GlobalStaticValues.EMPTY_COLOR;
///
/// Gets the color background drawing style.
@@ -635,7 +598,7 @@ public override float GetBackColorAngle(PaletteBackStyle style, PaletteState sta
/// Palette value should be applicable to this state.
/// Image instance.
public override Image? GetBackImage(PaletteBackStyle style, PaletteState state)
- => GetPaletteBack(style, state).GetBackImage(state);
+ => GetPaletteBack(style, state)?.GetBackImage(state);
///
/// Gets the background image style.
@@ -839,6 +802,7 @@ public override Color GetContentImageColorMap(PaletteContentStyle style, Palette
public override Color GetContentImageColorTo(PaletteContentStyle style, PaletteState state)
=> GetPaletteContent(style, state).GetContentImageColorTo(state);
+ ///
public override Color GetContentImageColorTransparent(PaletteContentStyle style, PaletteState state) => throw new NotImplementedException();
///
@@ -847,7 +811,7 @@ public override Color GetContentImageColorTo(PaletteContentStyle style, PaletteS
/// Content style.
/// Palette value should be applicable to this state.
/// Font value.
- public override Font GetContentShortTextFont(PaletteContentStyle style, PaletteState state)
+ public override Font? GetContentShortTextFont(PaletteContentStyle style, PaletteState state)
=> GetPaletteContent(style, state).GetContentShortTextFont(state);
///
@@ -856,7 +820,7 @@ public override Font GetContentShortTextFont(PaletteContentStyle style, PaletteS
/// Content style.
/// Palette value should be applicable to this state.
/// Font value.
- public override Font GetContentShortTextNewFont(PaletteContentStyle style, PaletteState state)
+ public override Font? GetContentShortTextNewFont(PaletteContentStyle style, PaletteState state)
=> GetPaletteContent(style, state).GetContentShortTextFont(state);
///
@@ -1000,7 +964,7 @@ public override PaletteRectangleAlign GetContentShortTextImageAlign(PaletteConte
/// Content style.
/// Palette value should be applicable to this state.
/// Font value.
- public override Font GetContentLongTextFont(PaletteContentStyle style, PaletteState state)
+ public override Font? GetContentLongTextFont(PaletteContentStyle style, PaletteState state)
=> GetPaletteContent(style, state).GetContentLongTextFont(state);
///
@@ -1009,7 +973,7 @@ public override Font GetContentLongTextFont(PaletteContentStyle style, PaletteSt
/// Content style.
/// Palette value should be applicable to this state.
/// Font value.
- public override Font GetContentLongTextNewFont(PaletteContentStyle style, PaletteState state)
+ public override Font? GetContentLongTextNewFont(PaletteContentStyle style, PaletteState state)
=> GetPaletteContent(style, state).GetContentLongTextFont(state);
///
@@ -1467,13 +1431,13 @@ public override Padding GetMetricPadding(PaletteState state, PaletteMetricPaddin
}
///
- /// Gets a drop down button image appropriate for the provided state.
+ /// Gets a drop-down button image appropriate for the provided state.
///
/// PaletteState for which image is required.
public override Image? GetDropDownButtonImage(PaletteState state)
{
// Grab state specific image
- Image? retImage = state switch
+ var retImage = state switch
{
PaletteState.Disabled => Images.DropDownButton.Disabled,
PaletteState.Normal => Images.DropDownButton.Normal,
@@ -1495,7 +1459,7 @@ public override Padding GetMetricPadding(PaletteState state, PaletteMetricPaddin
/// Appropriate image for drawing; otherwise null.
public override Image? GetContextMenuCheckedImage()
{
- Image? retImage = Images.ContextMenu.Checked;
+ var retImage = Images.ContextMenu.Checked;
// If nothing found then use the base palette
return retImage ?? _redirector.GetContextMenuCheckedImage();
@@ -1507,7 +1471,7 @@ public override Padding GetMetricPadding(PaletteState state, PaletteMetricPaddin
/// Appropriate image for drawing; otherwise null.
public override Image? GetContextMenuIndeterminateImage()
{
- Image? retImage = Images.ContextMenu.Indeterminate;
+ var retImage = Images.ContextMenu.Indeterminate;
// If nothing found then use the base palette
return retImage ?? _redirector.GetContextMenuIndeterminateImage();
@@ -1519,7 +1483,7 @@ public override Padding GetMetricPadding(PaletteState state, PaletteMetricPaddin
/// Appropriate image for drawing; otherwise null.
public override Image? GetContextMenuSubMenuImage()
{
- Image? retImage = Images.ContextMenu.SubMenu;
+ var retImage = Images.ContextMenu.SubMenu;
// If nothing found then use the base palette
return retImage ?? _redirector.GetContextMenuSubMenuImage();
@@ -1534,7 +1498,7 @@ public override Padding GetMetricPadding(PaletteState state, PaletteMetricPaddin
public override Image? GetGalleryButtonImage(PaletteRibbonGalleryButton button, PaletteState state)
{
Image? retImage = null;
- KryptonPaletteImagesGalleryButton images = button switch
+ var images = button switch
{
PaletteRibbonGalleryButton.Up => Images.GalleryButtons.Up,
PaletteRibbonGalleryButton.Down => Images.GalleryButtons.Down,
@@ -1555,7 +1519,7 @@ public override Padding GetMetricPadding(PaletteState state, PaletteMetricPaddin
retImage ??= images.Common;
// If nothing found then use the base palette
- return retImage ?? _redirector?.GetGalleryButtonImage(button, state);
+ return retImage ?? _redirector.GetGalleryButtonImage(button, state);
}
#endregion
@@ -1590,7 +1554,7 @@ public override Color GetButtonSpecImageTransparentColor(PaletteButtonSpecStyle
///
/// Style of button spec.
/// String value.
- public override string? GetButtonSpecShortText(PaletteButtonSpecStyle style)
+ public override string GetButtonSpecShortText(PaletteButtonSpecStyle style)
=> GetPaletteButtonSpec(style).GetButtonSpecShortText(style);
///
@@ -1598,7 +1562,7 @@ public override Color GetButtonSpecImageTransparentColor(PaletteButtonSpecStyle
///
/// Style of button spec.
/// String value.
- public override string? GetButtonSpecLongText(PaletteButtonSpecStyle style)
+ public override string GetButtonSpecLongText(PaletteButtonSpecStyle style)
=> GetPaletteButtonSpec(style).GetButtonSpecLongText(style);
///
@@ -1606,7 +1570,7 @@ public override Color GetButtonSpecImageTransparentColor(PaletteButtonSpecStyle
///
/// Style of button spec.
/// String value.
- public override string? GetButtonSpecToolTipTitle(PaletteButtonSpecStyle style)
+ public override string GetButtonSpecToolTipTitle(PaletteButtonSpecStyle style)
=> GetPaletteButtonSpec(style).GetButtonSpecToolTipTitle(style);
///
@@ -1617,6 +1581,7 @@ public override Color GetButtonSpecImageTransparentColor(PaletteButtonSpecStyle
public override Color GetButtonSpecColorMap(PaletteButtonSpecStyle style)
=> GetPaletteButtonSpec(style).GetButtonSpecColorMap(style);
+ ///
public override Color GetButtonSpecColorTransparent(PaletteButtonSpecStyle style) => throw new NotImplementedException();
///
@@ -1763,6 +1728,43 @@ public override Color GetRibbonMinimizeBarDark(PaletteState state)
public override Color GetRibbonMinimizeBarLight(PaletteState state)
=> GetPaletteRibbonGeneral(state).GetRibbonMinimizeBarLight(state);
+ ///
+ /// Gets the dark rafting color for the tab background.
+ ///
+ /// Palette value should be applicable to this state.
+ /// Color value.
+ public override Color GetRibbonTabRowBackgroundGradientRaftingDark(PaletteState state) => GetPaletteRibbonGeneral(state).GetRibbonTabRowBackgroundGradientRaftingDark(state);
+
+ ///
+ /// Gets the light rafting color for the tab background.
+ ///
+ /// Palette value should be applicable to this state.
+ /// Color value.
+ public override Color GetRibbonTabRowBackgroundGradientRaftingLight(PaletteState state) => GetPaletteRibbonGeneral(state).GetRibbonTabRowBackgroundGradientRaftingLight(state);
+
+ ///
+ /// Gets the solid color for the tab background.
+ ///
+ /// Palette value should be applicable to this state.
+ /// Color value.
+ public override Color GetRibbonTabRowBackgroundSolidColor(PaletteState state) => GetPaletteRibbonGeneral(state).GetRibbonTabRowBackgroundSolidColor(state);
+
+ ///
+ public override Color GetRibbonTabRowGradientColor1(PaletteState state) =>
+ GetPaletteRibbonGeneral(state).GetRibbonTabRowGradientColor1(state);
+
+ ///
+ public override Color GetRibbonFileAppTabBottomColor(PaletteState state) =>
+ GetPaletteRibbonFileAppTab(state).GetRibbonFileAppTabBottomColor(state);
+
+ ///
+ public override Color GetRibbonFileAppTabTopColor(PaletteState state) =>
+ GetPaletteRibbonFileAppTab(state).GetRibbonFileAppTabTopColor(state);
+
+ ///
+ public override Color GetRibbonFileAppTabTextColor(PaletteState state) =>
+ GetPaletteRibbonFileAppTab(state).GetRibbonFileAppTabTextColor(state);
+
///
/// Gets the font for the ribbon text.
///
@@ -1771,6 +1773,10 @@ public override Color GetRibbonMinimizeBarLight(PaletteState state)
public override Font GetRibbonTextFont(PaletteState state)
=> GetPaletteRibbonGeneral(state).GetRibbonTextFont(state);
+ ///
+ public override float GetRibbonTabRowGradientRaftingAngle(PaletteState state) =>
+ GetPaletteRibbonGeneral(state).GetRibbonTabRowGradientRaftingAngle(state);
+
///
/// Gets the rendering hint for the ribbon font.
///
@@ -1982,7 +1988,7 @@ public void ResetToDefaults(bool silent)
else
{
// Perform the reset operation on a separate worker thread
- CommonHelper.PerformOperation(ResetOperation, null);
+ CommonHelper.PerformOperation(ResetOperation!, null);
KryptonMessageBox.Show("Reset of palette is completed.",
"Palette Reset",
@@ -2024,7 +2030,7 @@ public void PopulateFromBase(bool silent)
else
{
// Perform the reset operation on a separate worker thread
- CommonHelper.PerformOperation(PopulateFromBaseOperation, null);
+ CommonHelper.PerformOperation(PopulateFromBaseOperation!, null);
KryptonMessageBox.Show("Relevant values have been populated.",
"Populate Values",
@@ -2051,20 +2057,18 @@ public void PopulateFromBase(bool silent)
///
/// Import palette settings from an xml file.
///
- /// Fullpath of imported filename; otherwise empty string.
+ /// Full path of imported filename; otherwise empty string.
public string Import(bool silent = false)
{
- string paletteFileName = string.Empty;
- if (UseKryptonFileDialogs)
+ var paletteFileName = string.Empty;
+ if (KryptonManager._globalUseKryptonFileDialogs)
{
- using var kofd = new KryptonOpenFileDialog
- {
- CheckFileExists = true,
- CheckPathExists = true,
- DefaultExt = @"xml",
- Filter = @"Palette files (*.xml)|*.xml|All files (*.*)|(*.*)",
- Title = @"Load Custom Palette"
- };
+ using var kofd = new KryptonOpenFileDialog();
+ kofd.CheckFileExists = true;
+ kofd.CheckPathExists = true;
+ kofd.DefaultExt = @"xml";
+ kofd.Filter = @"Palette files (*.xml)|*.xml|All files (*.*)|(*.*)";
+ kofd.Title = @"Load Custom Palette";
if (kofd.ShowDialog() == DialogResult.OK)
{
@@ -2076,15 +2080,13 @@ public string Import(bool silent = false)
}
else
{
- using var dialog = new OpenFileDialog
- {
- // Palette files are just XML documents
- CheckFileExists = true,
- CheckPathExists = true,
- DefaultExt = @"xml",
- Filter = @"Palette files (*.xml)|*.xml|All files (*.*)|(*.*)",
- Title = @"Load Palette"
- };
+ using var dialog = new OpenFileDialog();
+ // Palette files are just XML documents
+ dialog.CheckFileExists = true;
+ dialog.CheckPathExists = true;
+ dialog.DefaultExt = @"xml";
+ dialog.Filter = @"Palette files (*.xml)|*.xml|All files (*.*)|(*.*)";
+ dialog.Title = @"Load Palette";
// Get the actual file selected by the user
if (dialog.ShowDialog() == DialogResult.OK)
@@ -2103,11 +2105,43 @@ public string Import(bool silent = false)
return paletteFileName;
}
+ /// Import palette settings from a xml file. For use with action list.
+ /// Full path of imported filename; otherwise empty string.
+ internal string ActionListImport(bool silent = false)
+ {
+ var paletteFileName = string.Empty;
+
+ using var dialog = new OpenFileDialog();
+ // Palette files are just XML documents
+ dialog.CheckFileExists = true;
+ dialog.CheckPathExists = true;
+ dialog.DefaultExt = @"xml";
+ dialog.Filter = @"Palette files (*.xml)|*.xml|All files (*.*)|(*.*)";
+ dialog.Title = @"Load Palette";
+
+ // Get the actual file selected by the user
+ if (dialog.ShowDialog() == DialogResult.OK)
+ {
+ paletteFileName = dialog.FileName;
+
+ // Set the theme name to the file name
+ PaletteName = paletteFileName;
+ }
+
+ if (!string.IsNullOrWhiteSpace(paletteFileName))
+ {
+ // Use the existing import overload that takes the target name
+ paletteFileName = Import(paletteFileName, silent);
+ }
+
+ return paletteFileName;
+ }
+
///
/// Silent Import of palette settings from the specified xml file.
///
/// Filename to load.
- /// Fullpath of imported filename; otherwise empty string.
+ /// Full path of imported filename; otherwise empty string.
public string Import(string filename) => Import(filename, true);
///
@@ -2115,7 +2149,7 @@ public string Import(bool silent = false)
///
/// Filename to load.
/// Silent mode provides no user interface feedback.
- /// Fullpath of imported filename; otherwise empty string.
+ /// Full path of imported filename; otherwise empty string.
/// Thrown if failure to import
public string Import(string filename, bool silent)
{
@@ -2133,7 +2167,7 @@ public string Import(string filename, bool silent)
else
{
// Perform the import operation on a separate worker thread
- ret = CommonHelper.PerformOperation(ImportFromFile, filename) as string;
+ ret = CommonHelper.PerformOperation(ImportFromFile!, filename) as string;
KryptonMessageBox.Show($"Import from file '{filename}' completed.",
@"Palette Import",
@@ -2166,6 +2200,7 @@ public string Import(string filename, bool silent)
// Set the palette name
// TODO: Get paletteName from the paletteBase
+
SetPaletteName(Path.GetFileName(ret));
return ret;
@@ -2176,7 +2211,7 @@ public string Import(string filename, bool silent)
///
/// Stream that contains an XmlDocument.
public void Import(Stream stream) =>
- // By default the import is silent
+ // By default, the import is silent
Import(stream, true);
///
@@ -2213,35 +2248,71 @@ public void ImportWithUpgrade(Stream stream)
}
}
- private void PerformUpgrade(Stream stream)
+ /// Upgrades the specified palette and upgrades it if needed.
+ /// The theme file path.
+ public void ImportWithUpgrade(string themeFilePath)
{
- using var reader = new StreamReader(stream);
- string end = reader.ReadToEnd();
- reader.Close();
+ FileStream? stream = null;
+
+ try
+ {
+ stream = new FileStream(path: themeFilePath, mode: FileMode.Open);
+
+ ImportWithUpgrade(stream);
+ }
+ catch (Exception e)
+ {
+ ExceptionHandler.CaptureException(e);
+ }
+ finally
+ {
+
+ stream?.Close();
+
+ stream?.Dispose();
+ }
+ }
- using (var streamReader = new StringReader(Resources.v6to19))
+ private void PerformUpgrade(Stream stream)
+ {
+ try
{
- using (var xmlTextReader = XmlReader.Create(streamReader))
+ using var reader = new StreamReader(stream);
+
+ var end = reader.ReadToEnd();
+ reader.Close();
+
+ using (var currentSupportedPaletteSchemaReader =
+ new StreamReader(PaletteSchemaResources.CurrentSupportedPaletteSchema))
{
- var xslCompiledTransform1 = new XslCompiledTransform();
- xslCompiledTransform1.Load(xmlTextReader);
- end = TransformXml(xslCompiledTransform1, end);
+ using (var xslTextReader = XmlReader.Create(currentSupportedPaletteSchemaReader))
+ {
+ var xslToXmlTransformer = new XmlTransformer();
+
+ xslToXmlTransformer.Load(xslTextReader);
+
+ end = TransformXml(xslToXmlTransformer, end);
+ }
}
- }
- using var ms = new MemoryStream();
- using (var writer = new StreamWriter(ms,
- /*StreamWriter.UTF8NoBOM*/ new UTF8Encoding(false, true),
- 1024, true))
+ using var ms = new MemoryStream();
+ using (var writer = new StreamWriter(ms,
+ /*StreamWriter.UTF8NoBOM*/ new UTF8Encoding(false, true),
+ 1024, true))
+ {
+ writer.WriteLine("");
+ writer.Write(end);
+ writer.Flush();
+ writer.Close();
+ }
+ ms.Position = 0;
+ // If this goes boom, then something more needs to be done !
+ ImportFromStream(ms);
+ }
+ catch (Exception e)
{
- writer.WriteLine("");
- writer.Write(end);
- writer.Flush();
- writer.Close();
+ ExceptionHandler.CaptureException(e, showStackTrace: GlobalStaticValues.DEFAULT_USE_STACK_TRACE);
}
- ms.Position = 0;
- // If this goes boom, then something more needs to be done !
- ImportFromStream(ms);
}
///
@@ -2250,16 +2321,14 @@ private void PerformUpgrade(Stream stream)
/// The transform.
/// The XML.
///
- private string TransformXml(XslCompiledTransform transform, string xml)
+ private string TransformXml(XmlTransformer transform, string xml)
{
using var reader = new StringReader(xml);
using var writer = new StringWriter();
using var xmlTextReader = new XmlTextReader(reader);
- using var xmlTextWriter = new XmlTextWriter(writer)
- {
- Formatting = Formatting.Indented,
- Indentation = 4
- };
+ using var xmlTextWriter = new XmlTextWriter(writer);
+ xmlTextWriter.Formatting = Formatting.Indented;
+ xmlTextWriter.Indentation = 4;
transform.Transform(xmlTextReader, xmlTextWriter);
@@ -2285,7 +2354,7 @@ public void Import(Stream stream, bool silent)
else
{
// Perform the import operation on a separate worker thread
- CommonHelper.PerformOperation(ImportFromStream, stream);
+ CommonHelper.PerformOperation(ImportFromStream!, stream);
KryptonMessageBox.Show(@"Import completed with success.",
@"Palette Import",
@@ -2317,7 +2386,7 @@ public void Import(Stream stream, bool silent)
///
/// ByteArray that was returning from exporting palette.
public void Import(byte[] byteArray) =>
- // By default the import is silent
+ // By default, the import is silent
Import(byteArray, true);
///
@@ -2339,7 +2408,7 @@ public void Import(byte[] byteArray, bool silent)
else
{
// Perform the import operation on a separate worker thread
- CommonHelper.PerformOperation(ImportFromByteArray, byteArray);
+ CommonHelper.PerformOperation(ImportFromByteArray!, byteArray);
KryptonMessageBox.Show(@"Import completed with success.",
@"Palette Import",
@@ -2369,18 +2438,16 @@ public void Import(byte[] byteArray, bool silent)
///
/// Export palette settings to a user specified xml file.
///
- /// Fullpath of exported filename; otherwise empty string.
+ /// Full path of exported filename; otherwise empty string.
public string? Export()
{
- if (UseKryptonFileDialogs)
+ if (KryptonManager._globalUseKryptonFileDialogs)
{
- using var ksfd = new KryptonSaveFileDialog
- {
- OverwritePrompt = true,
- DefaultExt = @"xml",
- Filter = @"Palette files (*.xml)|*.xml|All files (*.*)|(*.*)",
- Title = @"Save Palette As"
- };
+ using var ksfd = new KryptonSaveFileDialog();
+ ksfd.OverwritePrompt = true;
+ ksfd.DefaultExt = @"xml";
+ ksfd.Filter = @"Palette files (*.xml)|*.xml|All files (*.*)|(*.*)";
+ ksfd.Title = @"Save Palette As";
if (ksfd.ShowDialog() == DialogResult.OK)
{
@@ -2394,14 +2461,12 @@ public void Import(byte[] byteArray, bool silent)
}
else
{
- using var dialog = new SaveFileDialog
- {
- // Palette files are just xml documents
- OverwritePrompt = true,
- DefaultExt = @"xml",
- Filter = @"Palette files (*.xml)|*.xml|All files (*.*)|(*.*)",
- Title = @"Save Palette As"
- };
+ using var dialog = new SaveFileDialog();
+ // Palette files are just xml documents
+ dialog.OverwritePrompt = true;
+ dialog.DefaultExt = @"xml";
+ dialog.Filter = @"Palette files (*.xml)|*.xml|All files (*.*)|(*.*)";
+ dialog.Title = @"Save Palette As";
// Get the actual file selected by the user
if (dialog.ShowDialog() == DialogResult.OK)
@@ -2419,12 +2484,38 @@ public void Import(byte[] byteArray, bool silent)
return string.Empty;
}
+ /// Export palette settings to a user specified xml file. For use with action list.
+ /// Full path of exported filename; otherwise empty string.
+ internal string? ActionListExport()
+ {
+ using var dialog = new SaveFileDialog();
+ // Palette files are just xml documents
+ dialog.OverwritePrompt = true;
+ dialog.DefaultExt = @"xml";
+ dialog.Filter = @"Palette files (*.xml)|*.xml|All files (*.*)|(*.*)";
+ dialog.Title = @"Save Palette As";
+
+ // Get the actual file selected by the user
+ if (dialog.ShowDialog() == DialogResult.OK)
+ {
+ SetCustomisedKryptonPaletteFilePath(Path.GetFullPath(dialog.FileName));
+
+ // Set the theme name to the file name
+ PaletteName = dialog.FileName;
+
+ // Use the existing export overload that takes the target name
+ return Export(dialog.FileName, true, false);
+ }
+
+ return string.Empty;
+ }
+
///
/// Export palette settings to the specified xml file.
///
/// Filename to create or overwrite.
/// Should default values be exported.
- /// Fullpath of exported filename; otherwise empty string.
+ /// Full path of exported filename; otherwise empty string.
public string? Export(string filename, bool ignoreDefaults)
=> Export(filename, ignoreDefaults, true);
@@ -2434,7 +2525,7 @@ public void Import(byte[] byteArray, bool silent)
/// Filename to create or overwrite.
/// Should default values be exported.
/// Silent mode provides no user interface feedback.
- /// Fullpath of exported filename; otherwise empty string.
+ /// Full path of exported filename; otherwise empty string.
public string? Export(string filename, bool ignoreDefaults, bool silent)
{
string? ret;
@@ -2451,7 +2542,7 @@ public void Import(byte[] byteArray, bool silent)
else
{
// Perform the import operation on a separate worker thread
- ret = CommonHelper.PerformOperation(ExportToFile,
+ ret = CommonHelper.PerformOperation(ExportToFile!,
new object[] { filename, ignoreDefaults }) as string;
KryptonMessageBox.Show($"Export to file '{filename}' completed.",
@@ -2487,7 +2578,7 @@ public void Import(byte[] byteArray, bool silent)
/// Destination stream for exporting.
/// Should default values be exported.
public void Export(Stream stream, bool ignoreDefaults) =>
- // By default the export is silent
+ // By default, the export is silent
Export(stream, ignoreDefaults, true);
///
@@ -2510,7 +2601,7 @@ public void Export(Stream stream, bool ignoreDefaults, bool silent)
else
{
// Perform the import operation on a separate worker thread
- CommonHelper.PerformOperation(ExportToStream,
+ CommonHelper.PerformOperation(ExportToStream!,
new object[] { stream, ignoreDefaults });
KryptonMessageBox.Show(@"Export completed with success.",
@@ -2566,7 +2657,7 @@ public void Export(Stream stream, bool ignoreDefaults, bool silent)
else
{
// Perform the import operation on a separate worker thread
- ret = CommonHelper.PerformOperation(ExportToByteArray,
+ ret = CommonHelper.PerformOperation(ExportToByteArray!,
new object[] { ignoreDefaults }) as byte[];
KryptonMessageBox.Show(@"Export completed with success.",
@@ -2606,7 +2697,7 @@ public void Export(Stream stream, bool ignoreDefaults, bool silent)
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsDefault => !(ShouldSerializeCustomisedKryptonPaletteFilePath()
|| ShouldSerializePaletteName()
- || ShouldSerializeBasePaletteMode()
+ //|| ShouldSerializeBasePaletteMode()
|| ShouldSerializeBasePalette()
|| ShouldSerializeBaseRendererMode()
|| ShouldSerializeBaseRenderer()
@@ -2619,7 +2710,7 @@ public void Reset()
{
ResetCustomisedKryptonPaletteFilePath();
ResetPaletteName();
- ResetBasePaletteMode();
+ //ResetBasePaletteMode();
ResetBasePalette();
ResetBaseRendererMode();
ResetBaseRenderer();
@@ -2647,71 +2738,69 @@ public void Reset()
private bool ShouldSerializePaletteName() => !string.IsNullOrWhiteSpace(PaletteName);
private void ResetPaletteName() => PaletteName = string.Empty;
- ///
- /// Gets or sets the base palette used to inherit from.
- ///
- [KryptonPersist(false, false)]
- [Category(@"Visuals")]
- [Description(@"Base palette used to inherit from.")]
- [DefaultValue(PaletteMode.Microsoft365Blue)]
- public PaletteMode BasePaletteMode
- {
- get => _basePaletteMode;
-
- set
- {
- if (_basePaletteMode != value)
- {
- // Action depends on new value
- switch (value)
- {
- case PaletteMode.Custom:
- // Do nothing, you must assign a palette to the
- // 'BasePalette' property in order to get the custom mode
- break;
- default:
- // Cache the original values
- PaletteMode tempMode = _basePaletteMode;
- PaletteBase? tempPalette = _basePalette;
-
- // Use the new value
- _basePaletteMode = value;
- _basePalette = KryptonManager.GetPaletteForMode(_basePaletteMode);
-
- // If the new value creates a circular reference
- if (HasCircularReference())
- {
- // Restore the original values
- _basePaletteMode = tempMode;
- _basePalette = tempPalette;
-
- throw new ArgumentOutOfRangeException(nameof(value), @"Cannot use palette that would create a circular reference");
- }
- else
- {
- // Restore the original base palette as 'SetPalette' will not
- // work correctly unless it still has the old value in place
- _basePalette = tempPalette;
- }
-
- // Get a reference to the standard palette from its name
- SetPalette(KryptonManager.GetPaletteForMode(_basePaletteMode));
-
- // Fire events to indicate a change in palette values
- OnBasePaletteChanged(this, EventArgs.Empty);
- OnBaseRendererChanged(this, EventArgs.Empty);
- OnAllowFormChromeChanged(this, EventArgs.Empty);
- OnButtonSpecChanged(this, EventArgs.Empty);
- OnPalettePaint(this, new PaletteLayoutEventArgs(true, true));
- break;
- }
- }
- }
- }
-
- private bool ShouldSerializeBasePaletteMode() => BasePaletteMode != PaletteMode.Microsoft365Blue;
-
- private void ResetBasePaletteMode() => BasePaletteMode = PaletteMode.Microsoft365Blue;
+ /////
+ ///// Gets or sets the base palette used to inherit from.
+ /////
+ //[KryptonPersist(false, false)]
+ //[Category(@"Visuals")]
+ //[Description(@"Base palette used to inherit from.")]
+ //[DefaultValue(PaletteMode.Microsoft365Blue)]
+ //public PaletteMode BasePaletteMode
+ //{
+ // get => _basePaletteMode;
+
+ // set
+ // {
+ // if (_basePaletteMode != value)
+ // {
+ // // Action depends on new value
+ // switch (value)
+ // {
+ // case PaletteMode.Custom:
+ // // Do nothing, you must assign a palette to the
+ // // 'BasePalette' property in order to get the custom mode
+ // break;
+ // default:
+ // // Cache the original values
+ // PaletteMode tempMode = _basePaletteMode;
+ // PaletteBase? tempPalette = _basePalette;
+
+ // // Use the new value
+ // _basePaletteMode = value;
+ // _basePalette = KryptonManager.GetPaletteForMode(_basePaletteMode);
+
+ // // If the new value creates a circular reference
+ // if (HasCircularReference())
+ // {
+ // // Restore the original values
+ // _basePaletteMode = tempMode;
+ // _basePalette = tempPalette;
+
+ // throw new ArgumentOutOfRangeException(nameof(value), @"Cannot use palette that would create a circular reference");
+ // }
+ // else
+ // {
+ // // Restore the original base palette as 'SetPalette' will not
+ // // work correctly unless it still has the old value in place
+ // _basePalette = tempPalette;
+ // }
+
+ // // Get a reference to the standard palette from its name
+ // SetPalette(KryptonManager.GetPaletteForMode(_basePaletteMode));
+
+ // // Fire events to indicate a change in palette values
+ // OnBasePaletteChanged(this, EventArgs.Empty);
+ // OnBaseRendererChanged(this, EventArgs.Empty);
+ // OnUseThemeFormChromeBorderWidthChanged(this, EventArgs.Empty);
+ // OnButtonSpecChanged(this, EventArgs.Empty);
+ // OnPalettePaint(this, new PaletteLayoutEventArgs(true, true));
+ // break;
+ // }
+ // }
+ // }
+ //}
+ //private bool ShouldSerializeBasePaletteMode() => BasePaletteMode != PaletteMode.Microsoft365Blue;
+ //private void ResetBasePaletteMode() => BasePaletteMode = PaletteMode.Microsoft365Blue;
///
/// Gets and sets the KryptonPalette used to inherit from.
@@ -2729,43 +2818,45 @@ public PaletteBase? BasePalette
if (_basePalette != value)
{
// Store the original values
- PaletteMode tempMode = _basePaletteMode;
- PaletteBase? tempPalette = _basePalette;
+ //PaletteMode tempMode = _basePaletteMode;
+ var tempPalette = _basePalette;
// Find the new palette mode based on the incoming value
- _basePaletteMode = value == null ? PaletteMode.Microsoft365Blue : PaletteMode.Custom;
+ //_basePaletteMode = value == null ? PaletteMode.Microsoft365Blue : PaletteMode.Custom;
_basePalette = value;
// If the new value creates a circular reference
- if (HasCircularReference())
- {
- // Put back the original palette details
- _basePaletteMode = tempMode;
- _basePalette = tempPalette;
-
- throw new ArgumentOutOfRangeException(nameof(value), @"Cannot use palette that would create a circular reference");
- }
- else
+ //if (HasCircularReference())
+ //{
+ // // Put back the original palette details
+ // //_basePaletteMode = tempMode;
+ // _basePalette = tempPalette;
+
+ // throw new ArgumentOutOfRangeException(nameof(value), @"Cannot use palette that would create a circular reference");
+ //}
+ //else
{
// Restore the original base palette as 'SetPalette' will not
// work correctly unless it still has the old value in place
_basePalette = tempPalette;
}
- // Use the provided palette value
- SetPalette(value);
-
// If no custom palette is required
if (value == null)
{
// Get the appropriate palette for the global mode
- SetPalette(KryptonManager.GetPaletteForMode(_basePaletteMode));
+ SetPalette(KryptonManager.GetPaletteForMode(PaletteMode.Microsoft365Blue/*_basePaletteMode*/));
+ }
+ else
+ {
+ // Use the provided palette value
+ SetPalette(value);
}
// Indicate the palette values have changed
OnBasePaletteChanged(this, EventArgs.Empty);
OnBaseRendererChanged(this, EventArgs.Empty);
- OnAllowFormChromeChanged(this, EventArgs.Empty);
+ OnUseThemeFormChromeBorderWidthChanged(this, EventArgs.Empty);
OnButtonSpecChanged(this, EventArgs.Empty);
OnPalettePaint(this, new PaletteLayoutEventArgs(true, true));
}
@@ -2802,14 +2893,9 @@ public RendererMode BaseRenderMode
_baseRenderMode = value;
// If inheriting then we do not need a base renderer
- if (value == RendererMode.Inherit)
- {
- _baseRenderer = null;
- }
- else
- {
- _baseRenderer = KryptonManager.GetRendererForMode(_baseRenderMode);
- }
+ _baseRenderer = value == RendererMode.Inherit
+ ? null
+ : KryptonManager.GetRendererForMode(_baseRenderMode);
// Fire events to indicate a change in palette values
// (because renderer has changed the palette need redrawing)
@@ -2852,42 +2938,44 @@ public IRenderer? BaseRenderer
}
}
}
-
private bool ShouldSerializeBaseRenderer() => BaseRenderer != null;
private void ResetBaseRenderer() => BaseRenderer = null;
- //protected override void DefineFonts()
- //{
- // // This class has no font fields
- //}
-
///
/// Gets access to the color table instance.
///
[Browsable(false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public override KryptonColorTable ColorTable => ToolMenuStatus.InternalKCT;
- [Browsable(false)]
- public new bool UseKryptonFileDialogs
- { get => _basePalette!.UseKryptonFileDialogs; set => _basePalette!.UseKryptonFileDialogs = value; }
-
- [Browsable(false)]
- public new float BaseFontSize
- { get => _basePalette!.BaseFontSize; set => _basePalette!.BaseFontSize = value; }
-
+ ///
[Browsable(false)]
[DisallowNull]
public new Font BaseFont
- { get => _basePalette!.BaseFont; set => _basePalette!.BaseFont = value; }
+ {
+ get => _basePalette!.BaseFont;
+ set => _basePalette!.BaseFont = value;
+ }
+
+ private new void ResetBaseFont() => _basePalette!.ResetBaseFont();
+ private new bool ShouldSerializeBaseFont() => _basePalette!.ShouldSerializeBaseFont();
+ ///
[Browsable(false)]
[DisallowNull]
public new string ThemeName
- { get => _basePalette!.ThemeName; set => _basePalette!.ThemeName = value; }
+ {
+ get => _basePalette!.ThemeName;
+ set => _basePalette!.ThemeName = value;
+ }
+ ///
[Browsable(false)]
public new BasePaletteType BasePaletteType
- { get => _basePalette!.BasePaletteType; set => _basePalette!.BasePaletteType = value; }
+ {
+ get => _basePalette!.BasePaletteType;
+ set => _basePalette!.BasePaletteType = value;
+ }
#endregion
#region Protected
@@ -2901,7 +2989,7 @@ public IRenderer? BaseRenderer
///
/// Source of the event.
/// An PaintLayoutEventArgs containing event data.
- protected override 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)
@@ -2911,16 +2999,16 @@ protected override void OnPalettePaint(object sender, PaletteLayoutEventArgs e)
}
///
- /// Raises the AllowFormChromeChanged event.
+ /// Raises the UseThemeFormChromeBorderWidthChanged event.
///
/// Source of the event.
/// An EventArgs containing event data.
- protected override void OnAllowFormChromeChanged(object sender, EventArgs e)
+ protected override void OnUseThemeFormChromeBorderWidthChanged(object sender, EventArgs e)
{
// Can only generate change events if not suspended
if (_suspendCount == 0)
{
- base.OnAllowFormChromeChanged(this, e);
+ base.OnUseThemeFormChromeBorderWidthChanged(this, e);
}
}
@@ -2929,7 +3017,7 @@ protected override void OnAllowFormChromeChanged(object sender, EventArgs e)
///
/// Source of the event.
/// An EventArgs containing event data.
- protected override 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)
@@ -2943,7 +3031,7 @@ protected override void OnBasePaletteChanged(object sender, EventArgs e)
///
/// Source of the event.
/// An EventArgs containing event data.
- protected override 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)
@@ -2957,7 +3045,7 @@ protected override void OnBaseRendererChanged(object sender, EventArgs e)
///
/// Source of the event.
/// An EventArgs containing event data.
- protected override 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)
@@ -2968,49 +3056,49 @@ protected override void OnButtonSpecChanged(object sender, EventArgs e)
#endregion
#region Internal
- internal bool HasCircularReference()
- {
- // Use a dictionary as a set to check for existence
- var paletteSet = new Dictionary();
-
- // Start processing from ourself upwards
- PaletteBase? palette = this;
-
- // Keep searching until no more palettes found
- while (palette != null)
- {
- // If the palette has already been encountered then it is a circular reference
- if (paletteSet.ContainsKey(palette))
- {
- return true;
- }
- else
- {
- // Otherwise, add to the set
- paletteSet.Add(palette, true);
- // Cast to correct type
-
- // If this is a KryptonPalette instance
- if (palette is KryptonCustomPaletteBase owner)
- {
- // Get the next palette up in hierarchy
- palette = owner.BasePaletteMode switch
- {
- PaletteMode.Custom => owner.BasePalette,
- PaletteMode.Global => KryptonManager.InternalGlobalPalette,
- _ => null
- };
- }
- else
- {
- palette = null;
- }
- }
- }
-
- // No circular reference encountered
- return false;
- }
+ //internal bool HasCircularReference()
+ //{
+ // // Use a dictionary as a set to check for existence
+ // var paletteSet = new Dictionary();
+
+ // // Start processing from ourself upwards
+ // PaletteBase? palette = this;
+
+ // // Keep searching until no more palettes found
+ // while (palette != null)
+ // {
+ // // If the palette has already been encountered then it is a circular reference
+ // if (paletteSet.ContainsKey(palette))
+ // {
+ // return true;
+ // }
+ // else
+ // {
+ // // Otherwise, add to the set
+ // paletteSet.Add(palette, true);
+ // // Cast to correct type
+
+ // // If this is a KryptonPalette instance
+ // if (palette is KryptonCustomPaletteBase owner)
+ // {
+ // // Get the next palette up in hierarchy
+ // palette = owner.BasePaletteMode switch
+ // {
+ // PaletteMode.Custom => owner.BasePalette,
+ // PaletteMode.Global => KryptonManager.InternalGlobalPalette,
+ // _ => null
+ // };
+ // }
+ // else
+ // {
+ // palette = null;
+ // }
+ // }
+ // }
+
+ // // No circular reference encountered
+ // return false;
+ //}
#endregion
#region Implementation Persistence, Used by threading
@@ -3027,10 +3115,6 @@ internal bool HasCircularReference()
ResetObjectToDefault(this, true);
// Ask each part of the palette to populate itself
- if (_basePalette != null)
- {
- _allowFormChrome = _basePalette.GetAllowFormChrome();
- }
ButtonStyles.PopulateFromBase(Common);
CalendarDay.PopulateFromBase();
ButtonSpecs.PopulateFromBase();
@@ -3125,7 +3209,7 @@ internal bool HasCircularReference()
private void ImportFromXmlDocument([DisallowNull] XmlDocument doc)
{
// Remember the current culture setting
- CultureInfo culture = Thread.CurrentThread.CurrentCulture;
+ var culture = Thread.CurrentThread.CurrentCulture;
try
{
@@ -3156,9 +3240,10 @@ private void ImportFromXmlDocument([DisallowNull] XmlDocument doc)
// Grab the version number of the format being loaded
var version = int.Parse(root.GetAttribute(nameof(Version)));
- if (version < CURRENT_PALETTE_VERSION)
+ if (version < GlobalStaticValues.CURRENT_SUPPORTED_PALETTE_VERSION)
{
- throw new ArgumentException($"Version '{version}' number is incompatible, only version {CURRENT_PALETTE_VERSION} or above can be imported.\nUse the PaletteUpgradeTool from the Application tab of the KryptonExplorer to upgrade.");
+ throw new ArgumentException(
+ $"Version '{version}' number is incompatible, only version {GlobalStaticValues.CURRENT_SUPPORTED_PALETTE_VERSION} or above can be imported.\nUse the PaletteUpgradeTool from the Application tab of the KryptonExplorer to upgrade.");
}
// Grab the properties and images elements
@@ -3187,6 +3272,10 @@ private void ImportFromXmlDocument([DisallowNull] XmlDocument doc)
// TODO: Get paletteName from the paletteBase
//SetPaletteName(root.SelectSingleNode(Name));
}
+ catch (Exception e)
+ {
+ ExceptionHandler.CaptureException(e, showStackTrace: GlobalStaticValues.DEFAULT_USE_STACK_TRACE);
+ }
finally
{
// Put back the old culture before existing routine
@@ -3215,7 +3304,7 @@ private void ImportFromXmlDocument([DisallowNull] XmlDocument doc)
}
// Create an XmlDocument containing the saved palette details
- XmlDocument doc = ExportToXmlDocument(ignoreDefaults);
+ var doc = ExportToXmlDocument(ignoreDefaults);
// Save to the provided filename
doc.Save(filename);
@@ -3240,7 +3329,7 @@ private void ImportFromXmlDocument([DisallowNull] XmlDocument doc)
var ignoreDefaults = (bool)parameters[1];
// Create an XmlDocument containing palette settings
- XmlDocument doc = ExportToXmlDocument(ignoreDefaults);
+ var doc = ExportToXmlDocument(ignoreDefaults);
// Save to the parameter provided stream object
doc.Save(stream);
@@ -3275,7 +3364,7 @@ private void ImportFromXmlDocument([DisallowNull] XmlDocument doc)
private XmlDocument ExportToXmlDocument(bool ignoreDefaults)
{
// Remember the current culture setting
- CultureInfo culture = Thread.CurrentThread.CurrentCulture;
+ var culture = Thread.CurrentThread.CurrentCulture;
try
{
@@ -3289,21 +3378,28 @@ private XmlDocument ExportToXmlDocument(bool ignoreDefaults)
doc.AppendChild(doc.CreateProcessingInstruction("xml", @"version=""1.0"""));
// Add a comment about the source of the document
- doc.AppendChild(doc.CreateComment("Created by exporting the settings of a KryptonPalette instance."));
- doc.AppendChild(doc.CreateComment("For more information about Krypton visit https://github.com/Krypton-Suite/Standard-Toolkit"));
+ doc.AppendChild(
+ doc.CreateComment("Created by exporting the settings of a KryptonCustomPaletteBase instance."));
+ doc.AppendChild(doc.CreateComment(
+ "For more information about Krypton visit https://github.com/Krypton-Suite/Standard-Toolkit"));
+ doc.AppendChild(doc.CreateComment(
+ "New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)"));
+ doc.AppendChild(doc.CreateComment(
+ $"Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - {DateTime.Now.Year}. All rights reserved."));
doc.AppendChild(doc.CreateComment("WARNING: Modifying this file may render it invalid for importing."));
+ doc.AppendChild(doc.CreateComment($@"Date created: {DateTime.Now.ToLongDateString()}"));
// Create a root node with version and the date information, by
// having a version number the loading of older version is easier
- XmlElement root = doc.CreateElement("KryptonPalette");
- root.SetAttribute(nameof(Version), CURRENT_PALETTE_VERSION.ToString());
+ var root = doc.CreateElement("KryptonPalette");
+ root.SetAttribute(nameof(Version), GlobalStaticValues.CURRENT_SUPPORTED_PALETTE_VERSION.ToString());
root.SetAttribute("Generated",
$"{DateTime.Now.ToLongDateString()}, @{DateTime.Now.ToShortTimeString()}");
doc.AppendChild(root);
// Add two children, one for storing actual palette values the other for cached images
- XmlElement props = doc.CreateElement(nameof(Properties));
- XmlElement images = doc.CreateElement(nameof(Images));
+ var props = doc.CreateElement(nameof(Properties));
+ var images = doc.CreateElement(nameof(Images));
root.AppendChild(props);
root.AppendChild(images);
@@ -3316,6 +3412,12 @@ private XmlDocument ExportToXmlDocument(bool ignoreDefaults)
return doc;
}
+ catch (Exception e)
+ {
+ ExceptionHandler.CaptureException(e, showStackTrace: GlobalStaticValues.DEFAULT_USE_STACK_TRACE);
+
+ return new XmlDocument();
+ }
finally
{
// Put back the old culture before existing routine
@@ -3331,10 +3433,10 @@ private void ImportObjectFromElement(XmlElement? element,
if (obj != null)
{
// Grab the type information for the object instance
- Type t = obj.GetType();
+ var t = obj.GetType();
// We are only interested in looking at the properties
- foreach (PropertyInfo prop in t.GetProperties())
+ foreach (var prop in t.GetProperties())
{
// Search each of the attributes applied to the property
foreach (var attrib in prop.GetCustomAttributes(false))
@@ -3345,10 +3447,9 @@ private void ImportObjectFromElement(XmlElement? element,
// Cast attribute to the correct type
// Check if there is an element matching the property
- var childElement = element?.SelectSingleNode(prop.Name) as XmlElement;
// Can only import if a matching XML element is found
- if (childElement != null)
+ if (element?.SelectSingleNode(prop.Name) is XmlElement childElement)
{
// Should we navigate down inside the property?
if (persistAttribute.Navigate)
@@ -3372,7 +3473,7 @@ private void ImportObjectFromElement(XmlElement? element,
var valueValue = childElement.GetAttribute(@"Value");
// We special case the loading of images
- if (prop.PropertyType.Equals(typeof(Image)))
+ if (prop.PropertyType == typeof(Image))
{
if (valueValue.Length == 0)
{
@@ -3381,17 +3482,20 @@ private void ImportObjectFromElement(XmlElement? element,
}
else
{
- // Have we already encountered the image?
- if (imageCache.ContainsKey(valueValue))
- {
- // Push the image from the cache into the property
- prop.SetValue(obj, valueValue, null);
- }
- else
- {
- // Cannot find image to set to empty
- prop.SetValue(obj, null, null);
- }
+ /*// Have we already encountered the image?
+ if (imageCache.ContainsKey(valueValue))
+ {
+ // Push the image from the cache into the property
+ prop.SetValue(obj, valueValue, null);
+ }
+ else
+ {
+ // Cannot find image to set to empty
+ prop.SetValue(obj, null, null);
+ }*/
+
+ // If image exists in dictionary, push the image from the cache into the property, else null.
+ prop.SetValue(obj, imageCache.TryGetValue(valueValue, out var imageValue) ? imageValue : null, null);
}
}
else
@@ -3403,7 +3507,7 @@ private void ImportObjectFromElement(XmlElement? element,
if (valueType != nameof(Font) || valueValue != @"(none)")
{
// We need the type converter to create a string representation
- TypeConverter converter = TypeDescriptor.GetConverter(StringToType(valueType));
+ var converter = TypeDescriptor.GetConverter(StringToType(valueType));
// Recreate the value using the converter
setValue = converter.ConvertFromInvariantString(valueValue);
@@ -3424,7 +3528,7 @@ private void ImportObjectFromElement(XmlElement? element,
private void ImportImagesFromElement(XmlElement element, ImageReverseDictionary imageCache)
{
// Get all nodes storing images
- XmlNodeList? images = element.SelectNodes(nameof(Image));
+ var images = element.SelectNodes(nameof(Image));
// Load each image node entry in turn
if (images != null)
@@ -3435,21 +3539,21 @@ private void ImportImagesFromElement(XmlElement element, ImageReverseDictionary
var imageElement = (XmlElement)image;
// Check the element is the expected type and has the required data
- if (imageElement != null &&
+ if (imageElement is not null &&
imageElement.HasAttribute(@"Name") &&
imageElement.ChildNodes.Count == 1 &&
- imageElement.ChildNodes[0].NodeType == XmlNodeType.CDATA)
+ imageElement.ChildNodes[0]!.NodeType == XmlNodeType.CDATA)
{
try
{
// Extract the image name
- var name = imageElement.GetAttribute(@"Name");
+ string name = imageElement.GetAttribute(@"Name");
// Grab the CDATA section that contains the base64 value
- var cdata = imageElement.ChildNodes[0] as XmlCDataSection;
+ XmlCDataSection cdata = (imageElement.ChildNodes[0] as XmlCDataSection)!;
// Convert to back from a string to bytes
- var bytes = Convert.FromBase64String(cdata.Value);
+ byte[] bytes = Convert.FromBase64String(cdata.Value!);
// Convert the bytes back into an Image
using var memory = new MemoryStream(bytes);
@@ -3460,13 +3564,14 @@ private void ImportImagesFromElement(XmlElement element, ImageReverseDictionary
}
catch
{
+ // ToDo: Remove BinaryFormatter, as it's now considered obsolete and a security risk in >= .NET 9
// Do the old way
// SYSLIB0011: BinaryFormatter serialization is obsolete
#pragma warning disable SYSLIB0011
var formatter = new BinaryFormatter();
- var old = (Image)formatter.Deserialize(memory);
+ var old = formatter.Deserialize(memory) as Image;
#pragma warning restore SYSLIB0011
- resurrect = old is Bitmap bitmap ? bitmap : new Bitmap(old);
+ resurrect = old as Bitmap ?? new Bitmap(old!);
}
// Add into the lookup dictionary
@@ -3494,10 +3599,10 @@ private void ExportObjectToElement(XmlDocument doc,
}
// Grab the type information for the object instance
- Type t = obj.GetType();
+ var t = obj.GetType();
// We are only interested in looking at the properties
- foreach (PropertyInfo prop in t.GetProperties())
+ foreach (var prop in t.GetProperties())
{
// Search each of the attributes applied to the property
foreach (var attrib in prop.GetCustomAttributes(false))
@@ -3514,16 +3619,16 @@ private void ExportObjectToElement(XmlDocument doc,
// Grab the property object
var childObj = prop.GetValue(obj, null);
- // Should be test if the object contains only default values?
+ // Test if the object contains only default values?
if (ignoreDefaults)
{
- PropertyDescriptor propertyIsDefault = TypeDescriptor.GetProperties(childObj)[nameof(IsDefault)];
+ PropertyDescriptor propertyIsDefault = TypeDescriptor.GetProperties(childObj!)[nameof(IsDefault)]!;
// All compound objects are expected to have an 'IsDefault' returning a boolean
if (propertyIsDefault != null && propertyIsDefault.PropertyType == typeof(bool))
{
// If the object 'IsDefault' then no need to persist it
- if ((bool)propertyIsDefault.GetValue(childObj))
+ if ((bool)propertyIsDefault.GetValue(childObj)!)
{
childObj = null;
}
@@ -3534,7 +3639,7 @@ private void ExportObjectToElement(XmlDocument doc,
if (childObj != null)
{
// Create and add a new xml element
- XmlElement childElement = doc.CreateElement(prop.Name);
+ var childElement = doc.CreateElement(prop.Name);
element.AppendChild(childElement);
// Recurse into the object instance
@@ -3558,10 +3663,10 @@ private void ExportObjectToElement(XmlDocument doc,
if (defaultAttribs.Length == 1)
{
// Cast to correct type
- var defaultAttrib = (DefaultValueAttribute)defaultAttribs[0];
+ var defaultAttrib = defaultAttribs[0] as DefaultValueAttribute;
// Decide if the property value matches the default described by the attribute
- if (defaultAttrib.Value == null)
+ if (defaultAttrib!.Value == null)
{
ignore = childObj == null;
}
@@ -3576,14 +3681,14 @@ private void ExportObjectToElement(XmlDocument doc,
if (!ignore)
{
// Create and add a new xml element
- XmlElement childElement = doc.CreateElement(prop.Name);
+ var childElement = doc.CreateElement(prop.Name);
element.AppendChild(childElement);
// Save the type of the property
childElement.SetAttribute(nameof(Type), TypeToString(prop.PropertyType));
// We special case the saving of images
- if (prop.PropertyType.Equals(typeof(Image)))
+ if (prop.PropertyType == typeof(Image))
{
if (childObj == null)
{
@@ -3599,31 +3704,34 @@ private void ExportObjectToElement(XmlDocument doc,
}
// Have we already encountered the image?
- if (imageCache != null && imageCache.ContainsKey(image))
+ if (imageCache != null)
{
- // Save reference to the existing cached image
- childElement.SetAttribute(@"Value", imageCache[image]);
- }
- else
- {
- // Generate a placeholder string
- var imageName = $@"ImageCache{(imageCache.Count + 1)}";
+ if (imageCache.TryGetValue(image, out var value))
+ {
+ // Save reference to the existing cached image
+ childElement.SetAttribute(@"Value", value);
+ }
+ else
+ {
+ // Generate a placeholder string
+ var imageName = $@"ImageCache{(imageCache.Count + 1)}";
- // Add the actual image instance into the cache
- imageCache.Add(image, imageName);
+ // Add the actual image instance into the cache
+ imageCache.Add(image, imageName);
- // Save the placeholder name instead of the actual image
- childElement.SetAttribute(@"Value", imageName);
+ // Save the placeholder name instead of the actual image
+ childElement.SetAttribute(@"Value", imageName);
+ }
}
}
}
else
{
// We need the type converter to create a string representation
- TypeConverter converter = TypeDescriptor.GetConverter(prop.PropertyType);
+ var converter = TypeDescriptor.GetConverter(prop.PropertyType);
// Save to an invariant string so that load is not affected by culture
- childElement.SetAttribute(@"Value", converter.ConvertToInvariantString(childObj));
+ childElement.SetAttribute(@"Value", converter.ConvertToInvariantString(childObj!));
}
}
}
@@ -3639,7 +3747,7 @@ private void ExportImagesToElement(XmlDocument doc, XmlElement element, ImageDic
{
try
{
- // Convert the Image into base64 so it can be used in xml
+ // Convert the Image into base64, so it can be used in xml
using var memory = new MemoryStream();
var imageFormat = entry.Key.RawFormat;
@@ -3654,12 +3762,12 @@ private void ExportImagesToElement(XmlDocument doc, XmlElement element, ImageDic
var base64 = Convert.ToBase64String(memory.ToArray());
// Create and add a new xml element
- XmlElement imageElement = doc.CreateElement(nameof(Image));
+ var imageElement = doc.CreateElement(nameof(Image));
imageElement.SetAttribute(@"Name", entry.Value);
element.AppendChild(imageElement);
// Set the image data into a CDATA section
- XmlCDataSection cdata = doc.CreateCDataSection(base64);
+ var cdata = doc.CreateCDataSection(base64);
imageElement.AppendChild(cdata);
}
catch (SerializationException)
@@ -3675,10 +3783,10 @@ private void ResetObjectToDefault(object? obj, bool populate)
if (obj != null)
{
// Grab the type information for the object instance
- Type t = obj.GetType();
+ var t = obj.GetType();
// We are only interested in looking at the properties
- foreach (PropertyInfo prop in t.GetProperties())
+ foreach (var prop in t.GetProperties())
{
// Search each of the attributes applied to the property
foreach (var attrib in prop.GetCustomAttributes(false))
@@ -3693,9 +3801,9 @@ private void ResetObjectToDefault(object? obj, bool populate)
if (prop.CanRead)
{
// Grab the property object
- var childObj = prop.GetValue(obj, null);
+ object? childObj = prop.GetValue(obj, null);
- PropertyDescriptor propertyIsDefault = TypeDescriptor.GetProperties(childObj)[nameof(IsDefault)];
+ var propertyIsDefault = TypeDescriptor.GetProperties(childObj!)[nameof(IsDefault)];
// All compound objects are expected to have an 'IsDefault' returning a boolean
if (propertyIsDefault != null && propertyIsDefault.PropertyType == typeof(bool))
@@ -3717,7 +3825,7 @@ private void ResetObjectToDefault(object? obj, bool populate)
}
else
{
- // Only default value if not part of a populate operation or we are part of a populate
+ // Only default value if not part of a populate operation, or we are part of a populate
// operation and the persist property indicates it can be reset in a populate scenario
if (!populate || persist.Populate)
{
@@ -3814,7 +3922,7 @@ private static Type StringToType(string s)
#endregion
#region Implementation GetPalette
- private PaletteElementColor? GetTrackBar(PaletteElement element, PaletteState state)
+ private PaletteElementColor GetTrackBar(PaletteElement element, PaletteState state)
{
switch (element)
{
@@ -3830,9 +3938,9 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- DebugTools.NotImplemented("GetTrackBar(PaletteElement element, PaletteState state)", "KryptonPalette.cs");
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
+
case PaletteElement.TrackBarTrack:
switch (state)
{
@@ -3845,9 +3953,9 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- DebugTools.NotImplemented("GetTrackBar(PaletteElement element, PaletteState state)", "KryptonPalette.cs");
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
+
case PaletteElement.TrackBarPosition:
switch (state)
{
@@ -3864,22 +3972,23 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- DebugTools.NotImplemented("GetTrackBar(PaletteElement element, PaletteState state)", "KryptonPalette.cs");
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
+
default:
// Should never happen!
Debug.Assert(false);
- DebugTools.NotImplemented("GetTrackBar(PaletteElement element, PaletteState state)", "KryptonPalette.cs");
- return null;
+ throw DebugTools.NotImplemented(element.ToString());
}
}
private IPaletteRibbonGeneral GetPaletteRibbonGeneral() => Ribbon.RibbonGeneral;
- private IPaletteRibbonGeneral GetPaletteRibbonGeneral(PaletteState state) => Ribbon.RibbonGeneral;
+ private IPaletteRibbonGeneral GetPaletteRibbonGeneral(PaletteState _ /*state*/) => Ribbon.RibbonGeneral;
- private IPaletteRibbonBack? GetPaletteRibbonBack(PaletteRibbonBackStyle style, PaletteState state)
+ private IPaletteRibbonFileAppTab GetPaletteRibbonFileAppTab(PaletteState _ /*state*/) => Ribbon.RibbonFileAppTab;
+
+ private IPaletteRibbonBack GetPaletteRibbonBack(PaletteRibbonBackStyle style, PaletteState state)
{
switch (style)
{
@@ -3920,11 +4029,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(style.ToString());
}
}
- private IPaletteRibbonBack? GetPaletteRibbonBack(KryptonPaletteRibbonTab ribbonTab,
+ private IPaletteRibbonBack GetPaletteRibbonBack(KryptonPaletteRibbonTab ribbonTab,
PaletteState state)
{
switch (state)
@@ -3951,11 +4060,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private IPaletteRibbonBack? GetPaletteRibbonBack(KryptonPaletteRibbonAppButton ribbonAppButton,
+ private IPaletteRibbonBack GetPaletteRibbonBack(KryptonPaletteRibbonAppButton ribbonAppButton,
PaletteState state)
{
switch (state)
@@ -3969,11 +4078,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private IPaletteRibbonBack? GetPaletteRibbonBack(KryptonPaletteRibbonGroupArea ribbonGroupArea,
+ private IPaletteRibbonBack GetPaletteRibbonBack(KryptonPaletteRibbonGroupArea ribbonGroupArea,
PaletteState state)
{
switch (state)
@@ -3994,11 +4103,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private IPaletteRibbonBack? GetPaletteRibbonBack(KryptonPaletteRibbonGroupNormalBorder ribbonGroupNormalBorder,
+ private IPaletteRibbonBack GetPaletteRibbonBack(KryptonPaletteRibbonGroupNormalBorder ribbonGroupNormalBorder,
PaletteState state)
{
switch (state)
@@ -4014,11 +4123,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private IPaletteRibbonBack? GetPaletteRibbonBack(KryptonPaletteRibbonGroupNormalTitle ribbonGroupNormalTitle,
+ private IPaletteRibbonBack GetPaletteRibbonBack(KryptonPaletteRibbonGroupNormalTitle ribbonGroupNormalTitle,
PaletteState state)
{
switch (state)
@@ -4034,11 +4143,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private IPaletteRibbonBack? GetPaletteRibbonBack(KryptonPaletteRibbonGroupCollapsedBorder ribbonGroupCollapsedBorder,
+ private IPaletteRibbonBack GetPaletteRibbonBack(KryptonPaletteRibbonGroupCollapsedBorder ribbonGroupCollapsedBorder,
PaletteState state)
{
switch (state)
@@ -4056,11 +4165,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private IPaletteRibbonBack? GetPaletteRibbonBack(KryptonPaletteRibbonGroupCollapsedBack ribbonGroupCollapsedBack,
+ private IPaletteRibbonBack GetPaletteRibbonBack(KryptonPaletteRibbonGroupCollapsedBack ribbonGroupCollapsedBack,
PaletteState state)
{
switch (state)
@@ -4078,11 +4187,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private IPaletteRibbonBack? GetPaletteRibbonBack(KryptonPaletteRibbonGroupCollapsedFrameBorder ribbonGroupCollapsedFrameBorder,
+ private IPaletteRibbonBack GetPaletteRibbonBack(KryptonPaletteRibbonGroupCollapsedFrameBorder ribbonGroupCollapsedFrameBorder,
PaletteState state)
{
switch (state)
@@ -4100,11 +4209,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private IPaletteRibbonBack? GetPaletteRibbonBack(KryptonPaletteRibbonGroupCollapsedFrameBack ribbonGroupCollapsedFrameBack,
+ private IPaletteRibbonBack GetPaletteRibbonBack(KryptonPaletteRibbonGroupCollapsedFrameBack ribbonGroupCollapsedFrameBack,
PaletteState state)
{
switch (state)
@@ -4122,11 +4231,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private IPaletteRibbonBack? GetPaletteRibbonBack(KryptonPaletteRibbonQATMinibar ribbonQATMinibar,
+ private IPaletteRibbonBack GetPaletteRibbonBack(KryptonPaletteRibbonQATMinibar ribbonQATMinibar,
PaletteState state)
{
switch (state)
@@ -4139,11 +4248,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private IPaletteRibbonText? GetPaletteRibbonText(PaletteRibbonTextStyle style,
+ private IPaletteRibbonText GetPaletteRibbonText(PaletteRibbonTextStyle style,
PaletteState state)
{
switch (style)
@@ -4169,11 +4278,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private IPaletteRibbonText? GetPaletteRibbonText(KryptonPaletteRibbonTab ribbonTab,
+ private IPaletteRibbonText GetPaletteRibbonText(KryptonPaletteRibbonTab ribbonTab,
PaletteState state)
{
switch (state)
@@ -4197,11 +4306,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private IPaletteRibbonText? GetPaletteRibbonText(KryptonPaletteRibbonGroupNormalTitle ribbonGroupNormalTitle,
+ private IPaletteRibbonText GetPaletteRibbonText(KryptonPaletteRibbonGroupNormalTitle ribbonGroupNormalTitle,
PaletteState state)
{
switch (state)
@@ -4213,11 +4322,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private IPaletteRibbonText? GetPaletteRibbonText(KryptonPaletteRibbonGroupCollapsedText ribbonGroupCollapsedText,
+ private IPaletteRibbonText GetPaletteRibbonText(KryptonPaletteRibbonGroupCollapsedText ribbonGroupCollapsedText,
PaletteState state)
{
switch (state)
@@ -4229,11 +4338,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private IPaletteRibbonText? GetPaletteRibbonText(KryptonPaletteRibbonGroupBaseText ribbonGroupButtonText,
+ private IPaletteRibbonText GetPaletteRibbonText(KryptonPaletteRibbonGroupBaseText ribbonGroupButtonText,
PaletteState state)
{
switch (state)
@@ -4245,11 +4354,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private IPaletteButtonSpec? GetPaletteButtonSpec(PaletteButtonSpecStyle style)
+ private IPaletteButtonSpec GetPaletteButtonSpec(PaletteButtonSpecStyle style)
{
switch (style)
{
@@ -4304,11 +4413,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(style.ToString());
}
}
- private IPaletteBack? GetPaletteBack(PaletteBackStyle style, PaletteState state)
+ private IPaletteBack GetPaletteBack(PaletteBackStyle style, PaletteState state)
{
// Update the redirectors
Common.StateCommon.BackStyle = style;
@@ -4508,11 +4617,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(style.ToString());
}
}
- private PaletteBorder? GetPaletteBorder(PaletteBorderStyle style, PaletteState state)
+ private PaletteBorder GetPaletteBorder(PaletteBorderStyle style, PaletteState state)
{
// Must update the redirector values used if the palette source is used
Common.StateCommon.BorderStyle = style;
@@ -4689,12 +4798,11 @@ private static Type StringToType(string s)
return ContextMenu.StateCommon.Separator.Border;
default:
// Should never happen!
- Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(style.ToString());
}
}
- private IPaletteContent? GetPaletteContent(PaletteContentStyle style, PaletteState state)
+ private IPaletteContent GetPaletteContent(PaletteContentStyle style, PaletteState state)
{
// Must update the redirector values used if the palette source is used
Common.StateCommon.ContentStyle = style;
@@ -4858,11 +4966,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(style.ToString());
}
}
- private IPaletteBack? GetPaletteBackButton(KryptonPaletteCheckButton button, PaletteState state)
+ private IPaletteBack GetPaletteBackButton(KryptonPaletteCheckButton button, PaletteState state)
{
// Have to special case states that do not derive from PaletteTriple
switch (state)
@@ -4877,7 +4985,7 @@ private static Type StringToType(string s)
return CalendarDay.OverrideToday.Back;
default:
{
- PaletteTriple? buttonState = GetPaletteButton(button, state);
+ var buttonState = GetPaletteButton(button, state);
if (buttonState != null)
{
return buttonState.Back;
@@ -4886,13 +4994,13 @@ private static Type StringToType(string s)
{
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
}
}
- private PaletteBorder? GetPaletteBorderButton(KryptonPaletteCheckButton button, PaletteState state)
+ private PaletteBorder GetPaletteBorderButton(KryptonPaletteCheckButton button, PaletteState state)
{
// Have to special case states that do not derive from PaletteTriple
switch (state)
@@ -4907,7 +5015,7 @@ private static Type StringToType(string s)
return CalendarDay.OverrideToday.Border;
default:
{
- PaletteTriple? buttonState = GetPaletteButton(button, state);
+ var buttonState = GetPaletteButton(button, state);
if (buttonState != null)
{
return buttonState.Border;
@@ -4916,13 +5024,13 @@ private static Type StringToType(string s)
{
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
}
}
- private PaletteContent? GetPaletteContentButton(KryptonPaletteCheckButton button, PaletteState state)
+ private PaletteContent GetPaletteContentButton(KryptonPaletteCheckButton button, PaletteState state)
{
// Have to special case states that do not derive from PaletteTriple
switch (state)
@@ -4937,7 +5045,7 @@ private static Type StringToType(string s)
return CalendarDay.OverrideToday.Content;
default:
{
- PaletteTriple? buttonState = GetPaletteButton(button, state);
+ var buttonState = GetPaletteButton(button, state);
if (buttonState != null)
{
return buttonState.Content;
@@ -4946,13 +5054,13 @@ private static Type StringToType(string s)
{
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
}
}
- private PaletteTriple? GetPaletteButton(KryptonPaletteCheckButton button, PaletteState state)
+ private PaletteTriple GetPaletteButton(KryptonPaletteCheckButton button, PaletteState state)
{
switch (state)
{
@@ -4973,11 +5081,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private IPaletteBack? GetPaletteBackCalendarDay(KryptonPaletteCalendarDay button, PaletteState state)
+ private IPaletteBack GetPaletteBackCalendarDay(KryptonPaletteCalendarDay button, PaletteState state)
{
// Have to special case states that do not derive from PaletteTriple
switch (state)
@@ -4990,7 +5098,7 @@ private static Type StringToType(string s)
return button.OverrideToday.Back;
default:
{
- PaletteTriple? buttonState = GetPaletteCalendarDay(button, state);
+ var buttonState = GetPaletteCalendarDay(button, state);
if (buttonState != null)
{
return buttonState.Back;
@@ -4999,13 +5107,13 @@ private static Type StringToType(string s)
{
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
}
}
- private PaletteBorder? GetPaletteBorderCalendarDay(KryptonPaletteCalendarDay button, PaletteState state)
+ private PaletteBorder GetPaletteBorderCalendarDay(KryptonPaletteCalendarDay button, PaletteState state)
{
// Have to special case states that do not derive from PaletteTriple
switch (state)
@@ -5018,7 +5126,7 @@ private static Type StringToType(string s)
return button.OverrideToday.Border;
default:
{
- PaletteTriple? buttonState = GetPaletteCalendarDay(button, state);
+ var buttonState = GetPaletteCalendarDay(button, state);
if (buttonState != null)
{
return buttonState.Border;
@@ -5027,13 +5135,13 @@ private static Type StringToType(string s)
{
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
}
}
- private PaletteContent? GetPaletteContentCalendarDay(KryptonPaletteCalendarDay button, PaletteState state)
+ private PaletteContent GetPaletteContentCalendarDay(KryptonPaletteCalendarDay button, PaletteState state)
{
// Have to special case states that do not derive from PaletteTriple
switch (state)
@@ -5046,7 +5154,7 @@ private static Type StringToType(string s)
return button.OverrideToday.Content;
default:
{
- PaletteTriple? buttonState = GetPaletteCalendarDay(button, state);
+ var buttonState = GetPaletteCalendarDay(button, state);
if (buttonState != null)
{
return buttonState.Content;
@@ -5055,13 +5163,13 @@ private static Type StringToType(string s)
{
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
}
}
- private PaletteTriple? GetPaletteCalendarDay(KryptonPaletteCalendarDay button, PaletteState state)
+ private PaletteTriple GetPaletteCalendarDay(KryptonPaletteCalendarDay button, PaletteState state)
{
switch (state)
{
@@ -5083,11 +5191,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private PaletteTriple? GetPaletteInputControl(KryptonPaletteInputControl inputControl, PaletteState state)
+ private PaletteTriple GetPaletteInputControl(KryptonPaletteInputControl inputControl, PaletteState state)
{
switch (state)
{
@@ -5106,11 +5214,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private IPaletteBack? GetPaletteBackTab(KryptonPaletteTabButton button, PaletteState state)
+ private IPaletteBack GetPaletteBackTab(KryptonPaletteTabButton button, PaletteState state)
{
// Have to special case states that do not derive from PaletteTriple
switch (state)
@@ -5119,7 +5227,7 @@ private static Type StringToType(string s)
return button.OverrideFocus.Back;
default:
{
- PaletteTabTriple? buttonState = GetPaletteTab(button, state);
+ var buttonState = GetPaletteTab(button, state);
if (buttonState != null)
{
return buttonState.Back;
@@ -5128,13 +5236,13 @@ private static Type StringToType(string s)
{
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
}
}
- private PaletteBorder? GetPaletteBorderTab(KryptonPaletteTabButton button, PaletteState state)
+ private PaletteBorder GetPaletteBorderTab(KryptonPaletteTabButton button, PaletteState state)
{
// Have to special case states that do not derive from PaletteTriple
switch (state)
@@ -5143,7 +5251,7 @@ private static Type StringToType(string s)
return button.OverrideFocus.Border;
default:
{
- PaletteTabTriple? buttonState = GetPaletteTab(button, state);
+ var buttonState = GetPaletteTab(button, state);
if (buttonState != null)
{
return buttonState.Border;
@@ -5152,13 +5260,13 @@ private static Type StringToType(string s)
{
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
}
}
- private PaletteContent? GetPaletteContentTab(KryptonPaletteTabButton button, PaletteState state)
+ private PaletteContent GetPaletteContentTab(KryptonPaletteTabButton button, PaletteState state)
{
// Have to special case states that do not derive from PaletteTriple
switch (state)
@@ -5167,7 +5275,7 @@ private static Type StringToType(string s)
return button.OverrideFocus.Content;
default:
{
- PaletteTabTriple? buttonState = GetPaletteTab(button, state);
+ var buttonState = GetPaletteTab(button, state);
if (buttonState != null)
{
return buttonState.Content;
@@ -5176,13 +5284,13 @@ private static Type StringToType(string s)
{
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
}
}
- private PaletteTabTriple? GetPaletteTab(KryptonPaletteTabButton button, PaletteState state)
+ private PaletteTabTriple GetPaletteTab(KryptonPaletteTabButton button, PaletteState state)
{
switch (state)
{
@@ -5201,13 +5309,13 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private PaletteBack? GetPaletteBackSeparator(KryptonPaletteSeparator separator, PaletteState state)
+ private PaletteBack GetPaletteBackSeparator(KryptonPaletteSeparator separator, PaletteState state)
{
- PaletteSeparatorPadding? separatorState = GetPaletteSeparator(separator, state);
+ var separatorState = GetPaletteSeparator(separator, state);
if (separatorState != null)
{
@@ -5217,13 +5325,13 @@ private static Type StringToType(string s)
{
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented("separatorState == null");
}
}
- private PaletteBorder? GetPaletteBorderSeparator(KryptonPaletteSeparator separator, PaletteState state)
+ private PaletteBorder GetPaletteBorderSeparator(KryptonPaletteSeparator separator, PaletteState state)
{
- PaletteSeparatorPadding? separatorState = GetPaletteSeparator(separator, state);
+ var separatorState = GetPaletteSeparator(separator, state);
if (separatorState != null)
{
@@ -5233,11 +5341,11 @@ private static Type StringToType(string s)
{
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented("separatorState == null");
}
}
- private PaletteSeparatorPadding? GetPaletteSeparator(KryptonPaletteSeparator separator, PaletteState state)
+ private PaletteSeparatorPadding GetPaletteSeparator(KryptonPaletteSeparator separator, PaletteState state)
{
switch (state)
{
@@ -5252,43 +5360,25 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private PaletteBack? GetPaletteBackControl(KryptonPaletteControl control, PaletteState state)
+ private PaletteBack GetPaletteBackControl(KryptonPaletteControl control, PaletteState state)
{
- PaletteDouble? controlState = GetPaletteControl(control, state);
+ var controlState = GetPaletteControl(control, state);
- if (controlState != null)
- {
- return controlState.Back;
- }
- else
- {
- // Should never happen!
- Debug.Assert(false);
- return null;
- }
+ return controlState.Back;
}
- private PaletteBorder? GetPaletteBorderControl(KryptonPaletteControl control, PaletteState state)
+ private PaletteBorder GetPaletteBorderControl(KryptonPaletteControl control, PaletteState state)
{
- PaletteDouble? controlState = GetPaletteControl(control, state);
+ var controlState = GetPaletteControl(control, state);
- if (controlState != null)
- {
- return controlState.Border;
- }
- else
- {
- // Should never happen!
- Debug.Assert(false);
- return null;
- }
+ return controlState.Border;
}
- private PaletteDouble? GetPaletteControl(KryptonPaletteControl control, PaletteState state)
+ private PaletteDouble GetPaletteControl(KryptonPaletteControl control, PaletteState state)
{
switch (state)
{
@@ -5299,27 +5389,18 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private PaletteBack? GetPaletteBackForm(KryptonPaletteForm form, PaletteState state)
+ private PaletteBack GetPaletteBackForm(KryptonPaletteForm form, PaletteState state)
{
- PaletteDouble? controlState = GetPaletteForm(form, state);
+ var controlState = GetPaletteForm(form, state);
- if (controlState != null)
- {
- return controlState.Back;
- }
- else
- {
- // Should never happen!
- Debug.Assert(false);
- return null;
- }
+ return controlState.Back;
}
- private PaletteBack? GetPaletteBackGridBackground(KryptonPaletteGrid grid, PaletteState state)
+ private PaletteBack GetPaletteBackGridBackground(KryptonPaletteGrid grid, PaletteState state)
{
switch (state)
{
@@ -5330,11 +5411,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private PaletteBack? GetPaletteBackGridHeaderColumn(KryptonPaletteGrid grid, PaletteState state)
+ private PaletteBack GetPaletteBackGridHeaderColumn(KryptonPaletteGrid grid, PaletteState state)
{
switch (state)
{
@@ -5351,11 +5432,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private PaletteBack? GetPaletteBackGridHeaderRow(KryptonPaletteGrid grid, PaletteState state)
+ private PaletteBack GetPaletteBackGridHeaderRow(KryptonPaletteGrid grid, PaletteState state)
{
switch (state)
{
@@ -5372,11 +5453,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private PaletteBack? GetPaletteBackGridDataCell(KryptonPaletteGrid grid, PaletteState state)
+ private PaletteBack GetPaletteBackGridDataCell(KryptonPaletteGrid grid, PaletteState state)
{
switch (state)
{
@@ -5389,11 +5470,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private PaletteBorder? GetPaletteBorderGridHeaderColumn(KryptonPaletteGrid grid, PaletteState state)
+ private PaletteBorder GetPaletteBorderGridHeaderColumn(KryptonPaletteGrid grid, PaletteState state)
{
switch (state)
{
@@ -5410,11 +5491,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private PaletteBorder? GetPaletteBorderGridHeaderRow(KryptonPaletteGrid grid, PaletteState state)
+ private PaletteBorder GetPaletteBorderGridHeaderRow(KryptonPaletteGrid grid, PaletteState state)
{
switch (state)
{
@@ -5431,11 +5512,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private PaletteBorder? GetPaletteBorderGridDataCell(KryptonPaletteGrid grid, PaletteState state)
+ private PaletteBorder GetPaletteBorderGridDataCell(KryptonPaletteGrid grid, PaletteState state)
{
switch (state)
{
@@ -5448,12 +5529,12 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private IPaletteContent? GetPaletteContentGridHeaderColumn(KryptonPaletteGrid grid, PaletteState state)
+ private IPaletteContent GetPaletteContentGridHeaderColumn(KryptonPaletteGrid grid, PaletteState state)
{
switch (state)
{
@@ -5470,11 +5551,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private IPaletteContent? GetPaletteContentGridHeaderRow(KryptonPaletteGrid grid, PaletteState state)
+ private IPaletteContent GetPaletteContentGridHeaderRow(KryptonPaletteGrid grid, PaletteState state)
{
switch (state)
{
@@ -5491,11 +5572,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private IPaletteContent? GetPaletteContentGridDataCell(KryptonPaletteGrid grid, PaletteState state)
+ private IPaletteContent GetPaletteContentGridDataCell(KryptonPaletteGrid grid, PaletteState state)
{
switch (state)
{
@@ -5508,27 +5589,18 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private PaletteBorder? GetPaletteBorderForm(KryptonPaletteForm form, PaletteState state)
+ private PaletteBorder GetPaletteBorderForm(KryptonPaletteForm form, PaletteState state)
{
- PaletteDouble? controlState = GetPaletteForm(form, state);
+ var controlState = GetPaletteForm(form, state);
- if (controlState != null)
- {
- return controlState.Border;
- }
- else
- {
- // Should never happen!
- Debug.Assert(false);
- return null;
- }
+ return controlState.Border;
}
- private PaletteDouble? GetPaletteForm(KryptonPaletteForm form, PaletteState state)
+ private PaletteDouble GetPaletteForm(KryptonPaletteForm form, PaletteState state)
{
switch (state)
{
@@ -5539,95 +5611,73 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private PaletteBack? GetPaletteBackHeader(KryptonPaletteHeader header, PaletteState state)
+ private PaletteBack GetPaletteBackHeader(KryptonPaletteHeader header, PaletteState state)
{
- PaletteTriple? headerState = GetPaletteHeader(header, state);
+ var headerState = GetPaletteHeader(header, state);
- if (headerState != null)
- {
- return headerState.Back;
- }
- else
- {
- // Should never happen!
- Debug.Assert(false);
- return null;
- }
+ return headerState.Back;
}
- private PaletteBorder? GetPaletteBorderHeader(KryptonPaletteHeader header, PaletteState state)
+ private PaletteBorder GetPaletteBorderHeader(KryptonPaletteHeader header, PaletteState state)
{
- PaletteTriple? headerState = GetPaletteHeader(header, state);
+ var headerState = GetPaletteHeader(header, state);
- if (headerState != null)
- {
- return headerState.Border;
- }
- else
- {
- // Should never happen!
- Debug.Assert(false);
- return null;
- }
+ return headerState.Border;
}
- private PaletteContent? GetPaletteContentHeader(KryptonPaletteHeader header, PaletteState state)
+ private PaletteContent GetPaletteContentHeader(KryptonPaletteHeader header, PaletteState state)
{
- PaletteTriple? headerState = GetPaletteHeader(header, state);
+ var headerState = GetPaletteHeader(header, state);
- if (headerState != null)
- {
- return headerState.Content;
- }
- else
- {
- // Should never happen!
- Debug.Assert(false);
- return null;
- }
+ return headerState.Content;
}
- private PaletteTriple? GetPaletteHeader(KryptonPaletteHeader header, PaletteState state)
+ private PaletteTriple GetPaletteHeader(KryptonPaletteHeader header, PaletteState state)
{
switch (state)
{
case PaletteState.Disabled:
return header.StateDisabled;
+ case PaletteState.Tracking: // #1729 KHeader does not implement the tracking state, default to normal
case PaletteState.Normal:
return header.StateNormal;
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private PaletteBack? GetPalettePanel(KryptonPalettePanel panel, PaletteState state)
+ private PaletteBack GetPalettePanel(KryptonPalettePanel panel, PaletteState state)
{
switch (state)
{
case PaletteState.Disabled:
return panel.StateDisabled;
+
+ case PaletteState.Tracking: // #1552 KPanel does not implement the tracking state, default to normal
case PaletteState.Normal:
return panel.StateNormal;
+
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private PaletteContent? GetPaletteLabel(KryptonPaletteLabel label, PaletteState state)
+ private PaletteContent GetPaletteLabel(KryptonPaletteLabel label, PaletteState state)
{
switch (state)
{
case PaletteState.Disabled:
return label.StateDisabled;
case PaletteState.Normal:
+ case PaletteState.ContextNormal: // Occurs from the TreeGrid
case PaletteState.Tracking:
case PaletteState.Pressed:
return label.StateNormal;
@@ -5642,11 +5692,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private PaletteBack? GetPaletteBackContextMenuItemSplit(PaletteState state)
+ private PaletteBack GetPaletteBackContextMenuItemSplit(PaletteState state)
{
switch (state)
{
@@ -5659,11 +5709,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private PaletteBack? GetPaletteBackContextMenuItemHighlight(PaletteState state)
+ private PaletteBack GetPaletteBackContextMenuItemHighlight(PaletteState state)
{
switch (state)
{
@@ -5676,11 +5726,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private PaletteBack? GetPaletteBackContextMenuItemImage(PaletteState state)
+ private PaletteBack GetPaletteBackContextMenuItemImage(PaletteState state)
{
switch (state)
{
@@ -5690,14 +5740,16 @@ private static Type StringToType(string s)
return ContextMenu.StateNormal.ItemImage.Back;
case PaletteState.CheckedNormal:
return ContextMenu.StateChecked.ItemImage.Back;
+ case PaletteState.CheckedTracking:
+ return ContextMenu.StateHighlight.ItemHighlight.Back;
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private PaletteBorder? GetPaletteBorderContextMenuItemHighlight(PaletteState state)
+ private PaletteBorder GetPaletteBorderContextMenuItemHighlight(PaletteState state)
{
switch (state)
{
@@ -5710,11 +5762,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private PaletteBorder? GetPaletteBorderContextMenuItemSplit(PaletteState state)
+ private PaletteBorder GetPaletteBorderContextMenuItemSplit(PaletteState state)
{
switch (state)
{
@@ -5727,11 +5779,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private PaletteBorder? GetPaletteBorderContextMenuItemImage(PaletteState state)
+ private PaletteBorder GetPaletteBorderContextMenuItemImage(PaletteState state)
{
switch (state)
{
@@ -5741,14 +5793,16 @@ private static Type StringToType(string s)
return ContextMenu.StateNormal.ItemImage.Border;
case PaletteState.CheckedNormal:
return ContextMenu.StateChecked.ItemImage.Border;
+ case PaletteState.CheckedTracking:
+ return ContextMenu.StateHighlight.ItemHighlight.Border;
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private PaletteContent? GetPaletteContentContextMenuItemImage(PaletteState state)
+ private PaletteContent GetPaletteContentContextMenuItemImage(PaletteState state)
{
switch (state)
{
@@ -5761,11 +5815,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private PaletteContent? GetPaletteContentContextMenuItemShortcutText(PaletteState state)
+ private PaletteContent GetPaletteContentContextMenuItemShortcutText(PaletteState state)
{
switch (state)
{
@@ -5776,11 +5830,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private IPaletteContent? GetPaletteContentContextMenuTextAlternate(PaletteState state)
+ private IPaletteContent GetPaletteContentContextMenuTextAlternate(PaletteState state)
{
switch (state)
{
@@ -5791,11 +5845,11 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
- private IPaletteContent? GetPaletteContentContextMenuItemTextStandard(PaletteState state)
+ private IPaletteContent GetPaletteContentContextMenuItemTextStandard(PaletteState state)
{
switch (state)
{
@@ -5806,13 +5860,13 @@ private static Type StringToType(string s)
default:
// Should never happen!
Debug.Assert(false);
- return null;
+ throw DebugTools.NotImplemented(state.ToString());
}
}
#endregion
#region Implementation
- private void OnMenuToolStatusPaint(object sender, NeedLayoutEventArgs e)
+ private void OnMenuToolStatusPaint(object? sender, NeedLayoutEventArgs e)
{
// Only raise the need to paint if painting has not been suspended
if (_suspendCount == 0)
@@ -5828,19 +5882,19 @@ private void OnNeedPaint(object? sender, NeedLayoutEventArgs e)
// Only raise the need to paint if updates have not been suspended
if (_suspendCount == 0)
{
- // Changing the krypton control colors does not effect the menu/tool/status areas
+ // Changing the krypton control colors does not affect the menu/tool/status areas
OnPalettePaint(this, new PaletteLayoutEventArgs(e.NeedLayout, false));
}
}
- private void SetPalette(PaletteBase? basePalette)
+ private void SetPalette(PaletteBase basePalette)
{
if (basePalette != _basePalette)
{
- Debug.Assert(_basePalette != null);
+ Debug.Assert(_basePalette is not null);
// Unhook from current palette events
- if (_basePalette != null)
+ if (_basePalette is not null)
{
_basePalette.PalettePaint -= OnPalettePaint;
_basePalette.ButtonSpecChanged -= OnButtonSpecChanged;
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCustomPaletteManager.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCustomPaletteManager.cs
deleted file mode 100644
index 30a479a59..000000000
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCustomPaletteManager.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-#region BSD License
-/*
- *
- * Original BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE)
- * © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
- *
- * New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
- *
- */
-#endregion
-
-namespace Krypton.Toolkit
-{
- [ToolboxItem(false)] //, System.ComponentModel.DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public partial class KryptonCustomPaletteManager : Component
- {
- #region Instance Fields
-
- private BasePaletteType _paletteType;
-
- private string _themeName;
-
- private PaletteBase _basePalette;
-
- #endregion
-
- #region Public
-
- public BasePaletteType PaletteType { get => _paletteType; set => _paletteType = value; }
-
- public string ThemeName { get => _themeName; private set => _themeName = value; }
-
- public PaletteBase BasePalette { get => _basePalette; set => _basePalette = value; }
-
- #endregion
-
- #region Identity
-
- /// Initializes a new instance of the class.
- public KryptonCustomPaletteManager()
- {
- _paletteType = BasePaletteType.Office2007;
-
- _themeName = null;
-
- _basePalette = null;
- }
-
- #endregion
-
- #region Implementation
-
- public static void LoadExternalPalette(PaletteBase palette)
- {
- var pm = new KryptonCustomPaletteManager();
-
- try
- {
- pm.BasePalette = palette;
- }
- catch (Exception e)
- {
- ExceptionHandler.CaptureException(e);
- }
- }
-
- #endregion
- }
-}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridView.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridView.cs
index bd654248a..d94765489 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridView.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridView.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -23,8 +23,8 @@ namespace Krypton.Toolkit
public class KryptonDataGridView : DataGridView
{
#region Type Declaractions
- private class ColumnHeaderCache : Dictionary { }
- private class RowHeaderCache : Dictionary { }
+ private class ColumnHeaderCache : Dictionary;
+ private class RowHeaderCache : Dictionary;
#endregion
#region Classes
@@ -56,7 +56,7 @@ private class ToolTipContent : IContentValues
///
/// The state for which the image is needed.
/// Color value.
- public Color GetImageTransparentColor(PaletteState state) => Color.Empty;
+ public Color GetImageTransparentColor(PaletteState state) => GlobalStaticValues.EMPTY_COLOR;
///
/// Gets the content short text.
@@ -106,9 +106,9 @@ private class ToolTipContent : IContentValues
// States and redirector
// Cached values for determining cell style overrides
- private Font _columnFont;
- private Font _rowFont;
- private Font _dataCellFont;
+ private Font? _columnFont;
+ private Font? _rowFont;
+ private Font? _dataCellFont;
private Padding _columnPadding;
private Padding _rowPadding;
private Padding _dataCellPadding;
@@ -134,7 +134,7 @@ private class ToolTipContent : IContentValues
private bool _hideOuterBorders;
private string _toolTipText;
private byte _oldLocation;
- private DataGridViewCell _oldCell;
+ private DataGridViewCell? _oldCell;
private KryptonContextMenu? _kryptonContextMenu;
//Seb
@@ -213,7 +213,7 @@ protected override void Dispose(bool disposing)
SystemEvents.UserPreferenceChanged -= OnUserPreferenceChanged;
// Dispose of view manager related resources
- ViewManager.Dispose();
+ ViewManager?.Dispose();
}
base.Dispose(disposing);
@@ -227,8 +227,7 @@ protected override void Dispose(bool disposing)
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new Color BackgroundColor
- {
+ public new Color BackgroundColor {
get => base.BackgroundColor;
set => base.BackgroundColor = value;
}
@@ -252,7 +251,7 @@ protected override void Dispose(bool disposing)
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new DataGridViewCellBorderStyle CellBorderStyle
+ public new DataGridViewCellBorderStyle CellBorderStyle
{
get => base.CellBorderStyle;
set => base.CellBorderStyle = value;
@@ -264,7 +263,7 @@ protected override void Dispose(bool disposing)
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new DataGridViewHeaderBorderStyle ColumnHeadersBorderStyle
+ public new DataGridViewHeaderBorderStyle ColumnHeadersBorderStyle
{
get => base.ColumnHeadersBorderStyle;
set => base.ColumnHeadersBorderStyle = value;
@@ -276,7 +275,7 @@ protected override void Dispose(bool disposing)
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new DataGridViewCellStyle ColumnHeadersDefaultCellStyle
+ public new DataGridViewCellStyle ColumnHeadersDefaultCellStyle
{
get => base.ColumnHeadersDefaultCellStyle;
set => base.ColumnHeadersDefaultCellStyle = value;
@@ -288,7 +287,7 @@ protected override void Dispose(bool disposing)
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new DataGridViewCellStyle DefaultCellStyle
+ public new DataGridViewCellStyle DefaultCellStyle
{
get => base.DefaultCellStyle;
set => base.DefaultCellStyle = value;
@@ -300,7 +299,7 @@ protected override void Dispose(bool disposing)
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new bool EnableHeadersVisualStyles
+ public new bool EnableHeadersVisualStyles
{
get => base.EnableHeadersVisualStyles;
set => base.EnableHeadersVisualStyles = value;
@@ -312,7 +311,7 @@ protected override void Dispose(bool disposing)
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new Color GridColor
+ public new Color GridColor
{
get => base.GridColor;
set => base.GridColor = value;
@@ -324,7 +323,7 @@ protected override void Dispose(bool disposing)
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new DataGridViewHeaderBorderStyle RowHeadersBorderStyle
+ public new DataGridViewHeaderBorderStyle RowHeadersBorderStyle
{
get => base.RowHeadersBorderStyle;
set => base.RowHeadersBorderStyle = value;
@@ -336,7 +335,7 @@ protected override void Dispose(bool disposing)
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new DataGridViewCellStyle RowHeadersDefaultCellStyle
+ public new DataGridViewCellStyle RowHeadersDefaultCellStyle
{
get => base.RowHeadersDefaultCellStyle;
set => base.RowHeadersDefaultCellStyle = value;
@@ -350,12 +349,21 @@ protected override void Dispose(bool disposing)
#endregion
#region Public
+ [Browsable(false)]
+ [Description(@"When true and AutoGenerateColumns is true the KryptonDataGridView will use Krypton column types, when false the standard WinForms column types.")]
+ [DefaultValue(true)]
+ public bool AutoGenerateKryptonColumns
+ {
+ get;
+ set;
+ } = true;
+
/// Gets or sets the associated with this control.
/// The for this control, or if there is no . The default is .
[Category(@"Behavior")]
[Description(@"Consider using KryptonContextMenu within the behaviors section.\nThe Winforms shortcut menu to show when the user right-clicks the page.\nNote: The ContextMenu will be rendered.")]
[DefaultValue(null)]
- public override ContextMenuStrip? ContextMenuStrip
+ public override ContextMenuStrip? ContextMenuStrip
{
[DebuggerStepThrough]
get => base.ContextMenuStrip;
@@ -388,7 +396,7 @@ public override ContextMenuStrip? ContextMenuStrip
[Category(@"Behavior")]
[Description(@"The KryptonContextMenu to show when the user right-clicks the Control.")]
[DefaultValue(null)]
- public virtual KryptonContextMenu? KryptonContextMenu
+ public virtual KryptonContextMenu? KryptonContextMenu
{
get => _kryptonContextMenu;
@@ -419,7 +427,7 @@ public virtual KryptonContextMenu? KryptonContextMenu
[Category(@"Visuals")]
[Description(@"Determine if the outer borders of the grid cells are drawn.")]
[DefaultValue(false)]
- public bool HideOuterBorders
+ public bool HideOuterBorders
{
get => _hideOuterBorders;
@@ -438,7 +446,7 @@ public bool HideOuterBorders
///
[Category(@"Visuals")]
[Description(@"Palette applied to drawing.")]
- public PaletteMode PaletteMode
+ public PaletteMode PaletteMode
{
[DebuggerStepThrough]
get => _paletteMode;
@@ -486,7 +494,7 @@ public PaletteMode PaletteMode
[Category(@"Visuals")]
[Description(@"Custom palette applied to drawing.")]
[DefaultValue(null)]
- public PaletteBase? Palette
+ public PaletteBase? Palette
{
[DebuggerStepThrough]
get => _localPalette;
@@ -543,7 +551,7 @@ public PaletteBase? Palette
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Advanced)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public IRenderer? Renderer
+ public IRenderer? Renderer
{
[DebuggerStepThrough]
get;
@@ -639,7 +647,7 @@ public virtual PaletteState GetCellTriple(DataGridViewElementStates state,
int columnIndex,
out IPaletteBack paletteBack,
out IPaletteBorder paletteBorder,
- out IPaletteContent? paletteContent)
+ out IPaletteContent paletteContent)
{
PaletteState retState;
@@ -801,7 +809,7 @@ public virtual PaletteState GetCellTriple(DataGridViewElementStates state,
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public Point CellOver
+ public Point CellOver
{
get => _cellOver;
set => _cellOver = value;
@@ -812,7 +820,7 @@ public Point CellOver
/// Highlight search strings in the DataGridView
///
/// The string to search.
- public void HighlightSearch(string s) => HighlightSearch(s, new List());
+ public void HighlightSearch(string s) => HighlightSearch(s, []);
///
/// Highlight search strings in the DataGridView
@@ -847,8 +855,7 @@ public void HighlightSearch(string s, List columnsIndex)
///
/// Gets and sets the ViewManager instance.
///
- protected ViewManager ViewManager
- {
+ protected ViewManager? ViewManager {
[DebuggerStepThrough]
get;
set;
@@ -857,8 +864,7 @@ protected ViewManager ViewManager
///
/// Gets access to the need paint delegate.
///
- protected NeedPaintHandler NeedPaintDelegate
- {
+ protected NeedPaintHandler NeedPaintDelegate {
[DebuggerStepThrough]
get;
private set;
@@ -869,7 +875,7 @@ protected NeedPaintHandler NeedPaintDelegate
///
/// Source of notification.
/// An NeedLayoutEventArgs containing event data.
- protected void OnNeedResyncPaint(object sender, NeedLayoutEventArgs e)
+ protected void OnNeedResyncPaint(object? sender, NeedLayoutEventArgs e)
{
// Ensure the current cell style values are in sync with the new
// palette setting and any state overrides that are defined
@@ -931,8 +937,7 @@ protected void OnNeedPaint(object? sender, [DisallowNull] NeedLayoutEventArgs e)
///
/// Gets a value indicating if transparent paint is needed
///
- protected bool NeedTransparentPaint
- {
+ protected bool NeedTransparentPaint {
get
{
// Do we need to evaluate the need for a tranparent paint
@@ -960,7 +965,7 @@ protected virtual void OnPaletteChanged(EventArgs e)
Redirector.Target = _palette;
// A new palette source means we need to layout and redraw
- OnNeedPaint(Palette, new NeedLayoutEventArgs(true));
+ OnNeedPaint(Palette!, new NeedLayoutEventArgs(true));
PaletteChanged?.Invoke(this, e);
}
@@ -971,7 +976,7 @@ protected virtual void OnPaletteChanged(EventArgs e)
/// True if paint required; otherwise false.
protected virtual bool EvalTransparentPaint() =>
// Do we have a manager to use for asking about painting?
- ViewManager != null && ViewManager.EvalTransparentPaint(Renderer);
+ ViewManager != null && ViewManager.EvalTransparentPaint(Renderer!);
///
/// Work out if this control needs to use Invoke to force a repaint.
@@ -989,7 +994,7 @@ protected virtual bool EvalTransparentPaint() =>
/// Source of notification.
/// An EventArgs containing event data.
///
- protected virtual void OnButtonSpecChanged(object sender, [DisallowNull] EventArgs e)
+ protected virtual void OnButtonSpecChanged(object? sender, [DisallowNull] EventArgs e)
{
Debug.Assert(e != null);
@@ -1001,7 +1006,62 @@ protected virtual void OnButtonSpecChanged(object sender, [DisallowNull] EventAr
}
#endregion
+
#region Protected Override
+ ///
+ protected override void OnDataMemberChanged(EventArgs e)
+ {
+ base.OnDataMemberChanged(e);
+
+ if (AutoGenerateColumns
+ && AutoGenerateKryptonColumns
+ && DataSource is not null)
+ {
+ ReplaceDefaultColumsWithKryptonColumns();
+ }
+ }
+
+ ///
+ protected override void OnDataSourceChanged(EventArgs e)
+ {
+ base.OnDataSourceChanged(e);
+
+ if (AutoGenerateColumns
+ && AutoGenerateKryptonColumns
+ && DataSource is not null)
+ {
+ ReplaceDefaultColumsWithKryptonColumns();
+ }
+ }
+
+ ///
+ protected override void OnAutoGenerateColumnsChanged(EventArgs e)
+ {
+ // First handle the base the event
+ base.OnAutoGenerateColumnsChanged(e);
+
+ // If needed convert the winforms columns to Krypton columns
+ if (AutoGenerateColumns
+ && AutoGenerateKryptonColumns
+ && DataSource is not null)
+ {
+ ReplaceDefaultColumsWithKryptonColumns();
+ }
+ }
+
+ ///
+ protected override void OnDataBindingComplete(DataGridViewBindingCompleteEventArgs e)
+ {
+ base.OnDataBindingComplete(e);
+
+ if (AutoGenerateColumns
+ && AutoGenerateKryptonColumns
+ && DataSource is not null)
+ {
+ ReplaceDefaultColumsWithKryptonColumns();
+ }
+ }
+
///
/// Raises the PaintBackground event.
///
@@ -1028,7 +1088,7 @@ protected override void OnCellMouseEnter(DataGridViewCellEventArgs e)
protected override void OnCellMouseMove(DataGridViewCellMouseEventArgs e)
{
// Cache mouse location before calling base class
- DataGridViewCell cell = GetCellInternal(e.ColumnIndex, e.RowIndex);
+ DataGridViewCell? cell = GetCellInternal(e.ColumnIndex, e.RowIndex);
var oldLocation = CurrentMouseLocation(cell);
if ((cell is DataGridViewRowHeaderCell) && (_oldCell == cell))
@@ -1149,6 +1209,10 @@ protected override void OnEditingControlShowing(DataGridViewEditingControlShowin
/// A DataGridViewCellPaintingEventArgs that contains the event data.
protected override void OnCellPainting(DataGridViewCellPaintingEventArgs e)
{
+ if (e is null)
+ {
+ throw new ArgumentNullException(nameof(e));
+ }
// Get the palette and state values for this cell
PaletteState state = GetCellTriple(e.State,
@@ -1156,12 +1220,12 @@ protected override void OnCellPainting(DataGridViewCellPaintingEventArgs e)
e.ColumnIndex,
out IPaletteBack paletteBack,
out IPaletteBorder paletteBorder,
- out IPaletteContent? paletteContent);
+ out IPaletteContent paletteContent);
try
{
// If the font we get from the base palette is a system font that is invalid this will throw exception
- var hContent = _contentInherit.GetContentShortTextFont(state).Height;
+ var hContent = _contentInherit.GetContentShortTextFont(state)!.Height;
}
catch
{
@@ -1173,18 +1237,18 @@ protected override void OnCellPainting(DataGridViewCellPaintingEventArgs e)
// Use an offscreen bitmap to draw onto before blitting it to the screen
var tempCellBounds = e.CellBounds with { X = 0, Y = 0 };
- using (var tempBitmap = new Bitmap(e.CellBounds.Width, e.CellBounds.Height, e.Graphics))
+ using (var tempBitmap = new Bitmap(e.CellBounds.Width, e.CellBounds.Height, e.Graphics!))
{
using (Graphics tempG = Graphics.FromImage(tempBitmap))
{
- using (var renderContext = new RenderContext(this, tempG, tempCellBounds, Renderer))
+ using (var renderContext = new RenderContext(this, tempG, tempCellBounds, Renderer!))
{
// Force the border to have a specified maximum border edge
_borderForced.SetInherit(paletteBorder);
_borderForced.MaxBorderEdges = GetCellMaxBorderEdges(e.CellBounds, e.ColumnIndex, e.RowIndex);
// Get the padding used to decide how to draw the background
- Padding borderPadding = Renderer.RenderStandardBorder.GetBorderRawPadding(_borderForced, state, VisualOrientation.Top);
+ Padding borderPadding = Renderer!.RenderStandardBorder.GetBorderRawPadding(_borderForced, state, VisualOrientation.Top);
// Get the border path used to limit drawing of the background
GraphicsPath borderPath = Renderer.RenderStandardBorder.GetBackPath(renderContext, tempCellBounds, _borderForced, VisualOrientation.Top, state);
@@ -1193,8 +1257,8 @@ protected override void OnCellPainting(DataGridViewCellPaintingEventArgs e)
Rectangle tempCellBackBounds = CommonHelper.ApplyPadding(VisualOrientation.Top, tempCellBounds, borderPadding);
// Update the back interceptor class
- _backInherit.SetInherit(paletteBack, e.CellStyle);
-
+ _backInherit.SetInherit(paletteBack, e.CellStyle!);
+ using var gh = new GraphicsHint(renderContext.Graphics, _borderForced.GetBorderGraphicsHint(PaletteState.Normal));
IDisposable? unused = Renderer.RenderStandardBack.DrawBack(renderContext, tempCellBackBounds, borderPath, _backInherit, VisualOrientation.Top, state, null);
// We never save the memento for reuse later
@@ -1203,6 +1267,7 @@ protected override void OnCellPainting(DataGridViewCellPaintingEventArgs e)
Renderer.RenderStandardBorder.DrawBorder(renderContext, tempCellBounds, _borderForced, VisualOrientation.Top, state);
// Must remember to release resources!
+ gh.Dispose();
borderPath.Dispose();
switch (e)
@@ -1234,8 +1299,12 @@ protected override void OnCellPainting(DataGridViewCellPaintingEventArgs e)
? 5
: width), tempCellBounds.Y + 3, spec.Icon.Width, spec.Icon.Height);
renderContext.Graphics.DrawImage(spec.Icon, iconBounds);
- tempCellBounds = tempCellBounds with { X = tempCellBounds.X +
- (spec.Alignment == IconSpec.IconAlignment.Left ? iconWidth : 0), Width = width };
+ tempCellBounds = tempCellBounds with
+ {
+ X = tempCellBounds.X +
+ (spec.Alignment == IconSpec.IconAlignment.Left ? iconWidth : 0),
+ Width = width
+ };
}
}
@@ -1244,7 +1313,7 @@ protected override void OnCellPainting(DataGridViewCellPaintingEventArgs e)
// If this is a row header cell
case { RowIndex: >= 0, ColumnIndex: -1 }:
{
- // By default there is no glyph needed for the row
+ // By default, there is no glyph needed for the row
var glyph = GridRowGlyph.None;
// Find the correct glyph that should be drawn
@@ -1297,9 +1366,9 @@ protected override void OnCellPainting(DataGridViewCellPaintingEventArgs e)
Rectangle beforeCellBounds = tempCellBounds;
tempCellBounds = Renderer.RenderGlyph.DrawGridErrorGlyph(renderContext, tempCellBounds, state, rtl);
- // Calculate the icon rectangle
- var iconBounds = new Rectangle(tempCellBounds.Right + 1, tempCellBounds.Top,
- beforeCellBounds.Width - tempCellBounds.Width, tempCellBounds.Height);
+ // Calculate the icon rectangle
+ var iconBounds = new Rectangle(tempCellBounds.Right + 1, tempCellBounds.Top,
+ beforeCellBounds.Width - tempCellBounds.Width, tempCellBounds.Height);
// Cache the icon area
if (_rowCache.ContainsKey(e.RowIndex))
@@ -1343,8 +1412,12 @@ protected override void OnCellPainting(DataGridViewCellPaintingEventArgs e)
? 5
: width), tempCellBounds.Y + 3, spec.Icon.Width, spec.Icon.Height);
renderContext.Graphics.DrawImage(spec.Icon, iconBounds);
- tempCellBounds = tempCellBounds with { X = tempCellBounds.X +
- (spec.Alignment == IconSpec.IconAlignment.Left ? iconWidth : 0), Width = width };
+ tempCellBounds = tempCellBounds with
+ {
+ X = tempCellBounds.X +
+ (spec.Alignment == IconSpec.IconAlignment.Left ? iconWidth : 0),
+ Width = width
+ };
}
}
@@ -1366,11 +1439,14 @@ protected override void OnCellPainting(DataGridViewCellPaintingEventArgs e)
if (e is { ColumnIndex: >= 0, RowIndex: >= 0 })
{
// Blit the image onto the screen
- e.Graphics.DrawImage(tempBitmap, e.CellBounds.Location);
+ e.Graphics?.DrawImage(tempBitmap, e.CellBounds.Location);
//Seb Search highlight
//Empty _restrictColumnsSearch means highlight everywhere
- if (!string.IsNullOrEmpty(_searchString) && (_restrictColumnsSearch.Count == 0 || (_restrictColumnsSearch.Count != 0 && _restrictColumnsSearch.Contains(e.ColumnIndex))) && e.FormattedValue.GetType().Name != nameof(Bitmap))
+ if (!string.IsNullOrEmpty(_searchString)
+ && (_restrictColumnsSearch.Count == 0 || (_restrictColumnsSearch.Count != 0
+ && _restrictColumnsSearch.Contains(e.ColumnIndex)))
+ && e.FormattedValue!.GetType().Name != nameof(Bitmap))
{
var val = (string)e.FormattedValue;
var sindx = val.ToLower().IndexOf(_searchString.ToLower());
@@ -1385,8 +1461,8 @@ protected override void OnCellPainting(DataGridViewCellPaintingEventArgs e)
var sBefore = val.Substring(0, sindx);
var sWord = val.Substring(sindx, _searchString.Length);
- Size s1 = TextRenderer.MeasureText(e.Graphics, sBefore, e.CellStyle.Font, e.CellBounds.Size);
- Size s2 = TextRenderer.MeasureText(e.Graphics, sWord, e.CellStyle.Font, e.CellBounds.Size);
+ Size s1 = TextRenderer.MeasureText(e.Graphics!, sBefore, e.CellStyle!.Font, e.CellBounds.Size);
+ Size s2 = TextRenderer.MeasureText(e.Graphics!, sWord, e.CellStyle.Font, e.CellBounds.Size);
if (s1.Width > 5)
{
@@ -1417,7 +1493,7 @@ protected override void OnCellPainting(DataGridViewCellPaintingEventArgs e)
? new SolidBrush(Color.DarkGoldenrod)
: new SolidBrush(Color.Yellow);
- e.Graphics.FillRectangle(hl_brush, hl_rect);
+ e.Graphics!.FillRectangle(hl_brush, hl_rect);
hl_brush.Dispose();
sindx = val.ToLower().IndexOf(_searchString.ToLower(), sCount++);
@@ -1429,7 +1505,7 @@ protected override void OnCellPainting(DataGridViewCellPaintingEventArgs e)
else
{
// Update the content interceptor class
- _contentInherit.SetInherit(paletteContent, e.CellStyle);
+ _contentInherit.SetInherit(paletteContent!, e.CellStyle!);
// Is there any text to be Displayed?
if (e.FormattedValue != null)
@@ -1442,8 +1518,9 @@ protected override void OnCellPainting(DataGridViewCellPaintingEventArgs e)
if ((e.RowIndex == -1) && (e.ColumnIndex != -1))
{
// Find size needed to show header text fully
- Size prefSize = Renderer.RenderStandardContent.GetContentPreferredSize(layoutContext, _contentInherit, _shortTextValue,
- VisualOrientation.Top, state, false, false);
+ Size prefSize = Renderer.RenderStandardContent.GetContentPreferredSize(
+ layoutContext, _contentInherit, _shortTextValue,
+ VisualOrientation.Top, state);
var contentsFit = (prefSize.Width <= tempCellBounds.Width) &&
(prefSize.Height <= tempCellBounds.Height);
@@ -1460,30 +1537,31 @@ protected override void OnCellPainting(DataGridViewCellPaintingEventArgs e)
}
// Find the correct layout for the header content
- using IDisposable memento = Renderer.RenderStandardContent.LayoutContent(layoutContext, tempCellBounds,
+ using IDisposable memento = Renderer.RenderStandardContent.LayoutContent(
+ layoutContext, tempCellBounds,
_contentInherit, _shortTextValue,
- VisualOrientation.Top, state, false, false);
+ VisualOrientation.Top, state);
// Perform actual drawing of the content
Renderer.RenderStandardContent.DrawContent(renderContext, tempCellBounds,
_contentInherit, memento,
VisualOrientation.Top,
- state, false, false, true);
+ state, true);
}
// Blit the image onto the screen
- e.Graphics.DrawImage(tempBitmap, e.CellBounds.Location);
+ e.Graphics?.DrawImage(tempBitmap, e.CellBounds.Location);
}
}
else
{
// Blit the image onto the screen
- e.Graphics.DrawImage(tempBitmap, e.CellBounds.Location);
+ e.Graphics?.DrawImage(tempBitmap, e.CellBounds.Location);
}
}
}
}
- if ((e.PaintParts & DataGridViewPaintParts.Focus) == DataGridViewPaintParts.Focus)
+ if (e != null && (e.PaintParts & DataGridViewPaintParts.Focus) == DataGridViewPaintParts.Focus)
{
// Only consider drawing the focus rectangle if the control has focus wants to show the cues
if (ShowFocusCues && Focused)
@@ -1505,14 +1583,14 @@ protected override void OnCellPainting(DataGridViewCellPaintingEventArgs e)
focusCellBounds.X++;
}
- ControlPaint.DrawFocusRectangle(e.Graphics, focusCellBounds, Color.Empty, paletteContent.GetContentShortTextColor1(state));
+ ControlPaint.DrawFocusRectangle(e.Graphics!, focusCellBounds, GlobalStaticValues.EMPTY_COLOR, paletteContent!.GetContentShortTextColor1(state));
}
}
}
}
// Prevent base class from doing the standard drawing
- e.Handled = true;
+ e!.Handled = true;
base.OnCellPainting(e);
}
@@ -1547,7 +1625,7 @@ protected override void PaintBackground(Graphics graphics,
PaintTransparentBackground(graphics, clipBounds);
// Use the view manager to paint the view panel that fills the entire areas as the background
- using var context = new RenderContext(this, graphics, clipBounds, Renderer);
+ using var context = new RenderContext(this, graphics, clipBounds, Renderer!);
ViewManager.Paint(context);
}
@@ -1592,8 +1670,7 @@ protected override void OnLayout(LayoutEventArgs levent)
#endregion
#region Internal
- internal PaletteRedirect Redirector
- {
+ internal PaletteRedirect Redirector {
[DebuggerStepThrough]
get;
private set;
@@ -1612,7 +1689,7 @@ internal void SyncStyles()
SyncCellStylesWithPalette();
}
- internal bool RightToLeftInternal
+ internal bool RightToLeftInternal
{
get
{
@@ -1621,18 +1698,65 @@ internal bool RightToLeftInternal
{
// Cache access to the internal get property 'RightToLeftInternal'
_piRTL = typeof(DataGridView).GetProperty(nameof(RightToLeftInternal), BindingFlags.Instance |
- BindingFlags.NonPublic |
- BindingFlags.GetField);
+ BindingFlags.NonPublic |
+ BindingFlags.GetField)!;
}
// Grab the internal calculated value of the right to left setting
- return (bool)_piRTL.GetValue(this, null);
+ return (bool)_piRTL.GetValue(this, null)!;
}
}
#endregion
#region Implementation
+
+ ///
+ /// Handles the auto generation of Krypton columns
+ ///
+ private void ReplaceDefaultColumsWithKryptonColumns()
+ {
+ DataGridViewColumn currentColumn;
+ KryptonDataGridViewTextBoxColumn newColumn;
+ List columnsProcessed = [];
+ int index;
+
+ for (int i = 0 ; i < ColumnCount ; i++)
+ {
+ currentColumn = Columns[i];
+
+ /*
+ * Auto generated columns are always of type System.Windows.Forms.DataGridViewTextBoxColumn.
+ * Only columns that are of type DataGridViewTextBoxColumn and have the DataPropertyName set will be converted to krypton Columns.
+ */
+ if (currentColumn is DataGridViewTextBoxColumn && currentColumn.DataPropertyName.Length > 0)
+ {
+ index = currentColumn.Index;
+ columnsProcessed.Add(index);
+
+ newColumn = new KryptonDataGridViewTextBoxColumn
+ {
+ Name = currentColumn.Name,
+ DataPropertyName = currentColumn.DataPropertyName,
+ HeaderText = currentColumn.HeaderText,
+ Width = currentColumn.Width
+ };
+
+ Columns.RemoveAt(index);
+ Columns.Insert(index, newColumn);
+ }
+ }
+
+ /*
+ * After the columns have been replaced they need a little help so they have the same width as when only Winforms columns would've been auto added.
+ * Setting this value in the above for loop does not work.
+ */
+ for (int i = 0 ; i < columnsProcessed.Count ; i++)
+ {
+ Columns[columnsProcessed[i]].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
+ }
+ }
+
private void SetupVisuals()
{
// Setup the invoke used to refresh display
@@ -1914,12 +2038,12 @@ private void SyncBackColorCellStylesWithPalette()
{
PaletteState state = Enabled ? PaletteState.Normal : PaletteState.Disabled;
- if ((ColumnHeadersDefaultCellStyle.BackColor == Color.Empty) ||
+ if ((ColumnHeadersDefaultCellStyle.BackColor == GlobalStaticValues.EMPTY_COLOR) ||
(ColumnHeadersDefaultCellStyle.BackColor == _columnBackColor))
{
_columnBackColor = StateNormal.HeaderColumn.Back.Color1;
- if (_columnBackColor == Color.Empty)
+ if (_columnBackColor == GlobalStaticValues.EMPTY_COLOR)
{
_columnBackColor = StateNormal.HeaderColumn.Back.GetBackColor1(state);
}
@@ -1927,12 +2051,12 @@ private void SyncBackColorCellStylesWithPalette()
ColumnHeadersDefaultCellStyle.BackColor = _columnBackColor;
}
- if ((RowHeadersDefaultCellStyle.BackColor == Color.Empty) ||
+ if ((RowHeadersDefaultCellStyle.BackColor == GlobalStaticValues.EMPTY_COLOR) ||
(RowHeadersDefaultCellStyle.BackColor == _rowBackColor))
{
_rowBackColor = StateNormal.HeaderRow.Back.Color1;
- if (_rowBackColor == Color.Empty)
+ if (_rowBackColor == GlobalStaticValues.EMPTY_COLOR)
{
_rowBackColor = StateNormal.HeaderRow.Back.GetBackColor1(state);
}
@@ -1940,12 +2064,12 @@ private void SyncBackColorCellStylesWithPalette()
RowHeadersDefaultCellStyle.BackColor = _rowBackColor;
}
- if ((DefaultCellStyle.BackColor == Color.Empty) ||
+ if ((DefaultCellStyle.BackColor == GlobalStaticValues.EMPTY_COLOR) ||
(DefaultCellStyle.BackColor == _dataCellBackColor))
{
_dataCellBackColor = StateNormal.DataCell.Back.Color1;
- if (_dataCellBackColor == Color.Empty)
+ if (_dataCellBackColor == GlobalStaticValues.EMPTY_COLOR)
{
_dataCellBackColor = StateNormal.DataCell.Back.GetBackColor1(state);
}
@@ -1958,12 +2082,12 @@ private void SyncSelBackColorCellStylesWithPalette()
{
PaletteState state = Enabled ? PaletteState.CheckedNormal : PaletteState.Disabled;
- if ((ColumnHeadersDefaultCellStyle.SelectionBackColor == Color.Empty) ||
+ if ((ColumnHeadersDefaultCellStyle.SelectionBackColor == GlobalStaticValues.EMPTY_COLOR) ||
(ColumnHeadersDefaultCellStyle.SelectionBackColor == _columnSelBackColor))
{
_columnSelBackColor = StateSelected.HeaderColumn.Back.Color1;
- if (_columnSelBackColor == Color.Empty)
+ if (_columnSelBackColor == GlobalStaticValues.EMPTY_COLOR)
{
_columnSelBackColor = StateSelected.HeaderColumn.Back.GetBackColor1(state);
}
@@ -1971,12 +2095,12 @@ private void SyncSelBackColorCellStylesWithPalette()
ColumnHeadersDefaultCellStyle.SelectionBackColor = _columnSelBackColor;
}
- if ((RowHeadersDefaultCellStyle.SelectionBackColor == Color.Empty) ||
+ if ((RowHeadersDefaultCellStyle.SelectionBackColor == GlobalStaticValues.EMPTY_COLOR) ||
(RowHeadersDefaultCellStyle.SelectionBackColor == _rowSelBackColor))
{
_rowSelBackColor = StateSelected.HeaderRow.Back.Color1;
- if (_rowSelBackColor == Color.Empty)
+ if (_rowSelBackColor == GlobalStaticValues.EMPTY_COLOR)
{
_rowSelBackColor = StateSelected.HeaderRow.Back.GetBackColor1(state);
}
@@ -1984,12 +2108,12 @@ private void SyncSelBackColorCellStylesWithPalette()
RowHeadersDefaultCellStyle.SelectionBackColor = _rowSelBackColor;
}
- if ((DefaultCellStyle.SelectionBackColor == Color.Empty) ||
+ if ((DefaultCellStyle.SelectionBackColor == GlobalStaticValues.EMPTY_COLOR) ||
(DefaultCellStyle.SelectionBackColor == _dataCellSelBackColor))
{
_dataCellSelBackColor = StateSelected.DataCell.Back.Color1;
- if (_dataCellSelBackColor == Color.Empty)
+ if (_dataCellSelBackColor == GlobalStaticValues.EMPTY_COLOR)
{
_dataCellSelBackColor = StateSelected.DataCell.Back.GetBackColor1(state);
}
@@ -2002,12 +2126,12 @@ private void SyncForeColorCellStylesWithPalette()
{
PaletteState state = Enabled ? PaletteState.Normal : PaletteState.Disabled;
- if ((ColumnHeadersDefaultCellStyle.ForeColor == Color.Empty) ||
+ if ((ColumnHeadersDefaultCellStyle.ForeColor == GlobalStaticValues.EMPTY_COLOR) ||
(ColumnHeadersDefaultCellStyle.ForeColor == _columnForeColor))
{
_columnForeColor = StateNormal.HeaderColumn.Content.Color1;
- if (_columnForeColor == Color.Empty)
+ if (_columnForeColor == GlobalStaticValues.EMPTY_COLOR)
{
_columnForeColor = StateNormal.HeaderColumn.Content.GetContentShortTextColor1(state);
}
@@ -2015,12 +2139,12 @@ private void SyncForeColorCellStylesWithPalette()
ColumnHeadersDefaultCellStyle.ForeColor = _columnForeColor;
}
- if ((RowHeadersDefaultCellStyle.ForeColor == Color.Empty) ||
+ if ((RowHeadersDefaultCellStyle.ForeColor == GlobalStaticValues.EMPTY_COLOR) ||
(RowHeadersDefaultCellStyle.ForeColor == _rowForeColor))
{
_rowForeColor = StateNormal.HeaderRow.Content.Color1;
- if (_rowForeColor == Color.Empty)
+ if (_rowForeColor == GlobalStaticValues.EMPTY_COLOR)
{
_rowForeColor = StateNormal.HeaderRow.Content.GetContentShortTextColor1(state);
}
@@ -2028,12 +2152,12 @@ private void SyncForeColorCellStylesWithPalette()
RowHeadersDefaultCellStyle.ForeColor = _rowForeColor;
}
- if ((DefaultCellStyle.ForeColor == Color.Empty) ||
+ if ((DefaultCellStyle.ForeColor == GlobalStaticValues.EMPTY_COLOR) ||
(DefaultCellStyle.ForeColor == _dataCellForeColor))
{
_dataCellForeColor = StateNormal.DataCell.Content.Color1;
- if (_dataCellForeColor == Color.Empty)
+ if (_dataCellForeColor == GlobalStaticValues.EMPTY_COLOR)
{
_dataCellForeColor = StateNormal.DataCell.Content.GetContentShortTextColor1(state);
}
@@ -2046,12 +2170,12 @@ private void SyncSelForeColorCellStylesWithPalette()
{
PaletteState state = Enabled ? PaletteState.CheckedNormal : PaletteState.Disabled;
- if ((ColumnHeadersDefaultCellStyle.SelectionForeColor == Color.Empty) ||
+ if ((ColumnHeadersDefaultCellStyle.SelectionForeColor == GlobalStaticValues.EMPTY_COLOR) ||
(ColumnHeadersDefaultCellStyle.SelectionForeColor == _columnSelForeColor))
{
_columnSelForeColor = StateSelected.HeaderColumn.Content.Color1;
- if (_columnSelForeColor == Color.Empty)
+ if (_columnSelForeColor == GlobalStaticValues.EMPTY_COLOR)
{
_columnSelForeColor = StateSelected.HeaderColumn.Content.GetContentShortTextColor1(state);
}
@@ -2059,12 +2183,12 @@ private void SyncSelForeColorCellStylesWithPalette()
ColumnHeadersDefaultCellStyle.SelectionForeColor = _columnSelForeColor;
}
- if ((RowHeadersDefaultCellStyle.SelectionForeColor == Color.Empty) ||
+ if ((RowHeadersDefaultCellStyle.SelectionForeColor == GlobalStaticValues.EMPTY_COLOR) ||
(RowHeadersDefaultCellStyle.SelectionForeColor == _rowSelForeColor))
{
_rowSelForeColor = StateSelected.HeaderRow.Content.Color1;
- if (_rowSelForeColor == Color.Empty)
+ if (_rowSelForeColor == GlobalStaticValues.EMPTY_COLOR)
{
_rowSelForeColor = StateSelected.HeaderRow.Content.GetContentShortTextColor1(state);
}
@@ -2072,12 +2196,12 @@ private void SyncSelForeColorCellStylesWithPalette()
RowHeadersDefaultCellStyle.SelectionForeColor = _rowSelForeColor;
}
- if ((DefaultCellStyle.SelectionForeColor == Color.Empty) ||
+ if ((DefaultCellStyle.SelectionForeColor == GlobalStaticValues.EMPTY_COLOR) ||
(DefaultCellStyle.SelectionForeColor == _dataCellSelForeColor))
{
_dataCellSelForeColor = StateSelected.DataCell.Content.Color1;
- if (_dataCellSelForeColor == Color.Empty)
+ if (_dataCellSelForeColor == GlobalStaticValues.EMPTY_COLOR)
{
_dataCellSelForeColor = StateSelected.DataCell.Content.GetContentShortTextColor1(state);
}
@@ -2087,7 +2211,7 @@ private void SyncSelForeColorCellStylesWithPalette()
}
private byte UpdateLocationForRowErrors(DataGridViewCellMouseEventArgs e,
- DataGridViewCell cell,
+ DataGridViewCell? cell,
byte location)
{
// If over the main area of a row header cell...
@@ -2149,6 +2273,7 @@ private DataGridViewContentAlignment RelativeToAlign(PaletteRelativeAlign textH,
// Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(textH.ToString());
return DataGridViewContentAlignment.MiddleLeft;
}
@@ -2222,7 +2347,7 @@ private void ViewManagerLayout()
_layoutDirty = false;
// Ask the view to perform a layout
- ViewManager.Layout(Renderer);
+ ViewManager.Layout(Renderer!);
} while (_layoutDirty && (max-- > 0));
@@ -2232,7 +2357,7 @@ private void ViewManagerLayout()
}
}
- private void CellDataAreaMouseEnterInternal(DataGridViewCell cell)
+ private void CellDataAreaMouseEnterInternal(DataGridViewCell? cell)
{
Point currentCellAddress = CurrentCellAddress;
@@ -2240,11 +2365,11 @@ private void CellDataAreaMouseEnterInternal(DataGridViewCell cell)
{
// Are we allowed to show a tooltip?
if (ShowCellToolTips &&
- ((currentCellAddress.X == -1) || (currentCellAddress.X != cell.ColumnIndex) ||
+ ((currentCellAddress.X == -1) || (currentCellAddress.X != cell!.ColumnIndex) ||
(currentCellAddress.Y != cell.RowIndex) || (EditingControl == null)))
{
// Grab the correct tooltip text for the cell
- _toolTipText = GetToolTipText(cell, cell.RowIndex);
+ _toolTipText = GetToolTipText(cell, cell!.RowIndex);
// No explicit text provided?
if (string.IsNullOrEmpty(_toolTipText))
@@ -2256,12 +2381,12 @@ private void CellDataAreaMouseEnterInternal(DataGridViewCell cell)
if ((cell.RowIndex != -1) && (cell.OwningColumn != null))
{
if ((cell.OwningColumn.Width < GetCellPreferredWidth(cell)) ||
- (cell.OwningRow.Height < GetCellPreferredHeight(cell)))
+ (cell.OwningRow!.Height < GetCellPreferredHeight(cell)))
{
var editedValue = cell.GetEditedFormattedValue(cell.RowIndex, DataGridViewDataErrorContexts.Display) as string;
if (!string.IsNullOrEmpty(editedValue))
{
- _toolTipText = TruncateToolTipText(editedValue);
+ _toolTipText = TruncateToolTipText(editedValue ?? string.Empty);
}
}
}
@@ -2275,7 +2400,7 @@ private void CellDataAreaMouseEnterInternal(DataGridViewCell cell)
var editedValue = cell.GetEditedFormattedValue(cell.RowIndex, DataGridViewDataErrorContexts.Display) as string;
if (!string.IsNullOrEmpty(editedValue))
{
- _toolTipText = TruncateToolTipText(editedValue);
+ _toolTipText = TruncateToolTipText(editedValue ?? string.Empty);
}
}
catch
@@ -2301,10 +2426,10 @@ private void CellDataAreaMouseEnterInternal(DataGridViewCell cell)
}
}
- private void CellErrorAreaMouseEnterInternal(DataGridViewCell cell)
+ private void CellErrorAreaMouseEnterInternal(DataGridViewCell? cell)
{
// Grab the correct error text for the cell
- _toolTipText = GetErrorText(cell, cell.RowIndex);
+ _toolTipText = GetErrorText(cell, cell!.RowIndex);
// Restart the timer for showing the error tooltip
if (_showTimer != null)
@@ -2326,17 +2451,17 @@ private void CellAreaMouseLeaveInternal()
}
}
- private void OnVisualPopupToolTipDisposed(object sender, EventArgs e)
+ private void OnVisualPopupToolTipDisposed(object? sender, EventArgs e)
{
// Unhook events from the specific instance that generated event
- var popupToolTip = (VisualPopupToolTip)sender;
+ var popupToolTip = sender as VisualPopupToolTip ?? throw new ArgumentNullException(nameof(sender));
popupToolTip.Disposed -= OnVisualPopupToolTipDisposed;
// Not showing a popup page any more
_visualPopupToolTip = null;
}
- private void OnTimerTick(object sender, EventArgs e)
+ private void OnTimerTick(object? sender, EventArgs e)
{
// Only need a one tick timer
if (_showTimer != null)
@@ -2354,7 +2479,7 @@ private void OnTimerTick(object sender, EventArgs e)
// Create the actual tooltip popup object
_visualPopupToolTip = new VisualPopupToolTip(Redirector,
new ToolTipContent(_toolTipText),
- Renderer,
+ Renderer!,
PaletteBackStyle.ControlToolTip,
PaletteBorderStyle.ControlToolTip,
PaletteContentStyle.LabelToolTip,
@@ -2368,7 +2493,7 @@ private void OnTimerTick(object sender, EventArgs e)
}
}
- private DataGridViewCell GetCellInternal(int column, int row)
+ private DataGridViewCell? GetCellInternal(int column, int row)
{
// Only need to cache reflection info the first time around
if (_miGCI == null)
@@ -2376,13 +2501,13 @@ private DataGridViewCell GetCellInternal(int column, int row)
// Cache access to the internal method 'GetCellInternal'
_miGCI = typeof(DataGridView).GetMethod(nameof(GetCellInternal), BindingFlags.Instance |
BindingFlags.NonPublic |
- BindingFlags.GetField);
+ BindingFlags.GetField)!;
}
- return (DataGridViewCell)_miGCI.Invoke(this, new object[] { column, row });
+ return _miGCI.Invoke(this, [column, row]) as DataGridViewCell;
}
- private string GetToolTipText(DataGridViewCell cell, int row)
+ private string GetToolTipText(DataGridViewCell? cell, int row)
{
// Only need to cache reflection info the first time around
if (_miGTTT == null)
@@ -2390,12 +2515,12 @@ private string GetToolTipText(DataGridViewCell cell, int row)
// Cache access to the internal get property 'GetToolTipText'
_miGTTT = typeof(DataGridViewCell).GetMethod(nameof(GetToolTipText), BindingFlags.Instance |
BindingFlags.NonPublic |
- BindingFlags.GetField);
+ BindingFlags.GetField)!;
}
try
{
- return (string)_miGTTT.Invoke(cell, new object[] { row });
+ return _miGTTT.Invoke(cell, [row]) as string ?? string.Empty;
}
catch
{
@@ -2403,7 +2528,7 @@ private string GetToolTipText(DataGridViewCell cell, int row)
}
}
- private string GetErrorText(DataGridViewCell cell, int row)
+ private string GetErrorText(DataGridViewCell? cell, int row)
{
// Only need to cache reflection info the first time around
if (_miGET == null)
@@ -2411,12 +2536,12 @@ private string GetErrorText(DataGridViewCell cell, int row)
// Cache access to the internal get property 'GetErrorText'
_miGET = typeof(DataGridViewCell).GetMethod(nameof(GetErrorText), BindingFlags.Instance |
BindingFlags.NonPublic |
- BindingFlags.GetField);
+ BindingFlags.GetField)!;
}
try
{
- return (string)_miGET.Invoke(cell, new object[] { row });
+ return _miGET.Invoke(cell, [row]) as string ?? string.Empty;
}
catch
{
@@ -2424,7 +2549,7 @@ private string GetErrorText(DataGridViewCell cell, int row)
}
}
- private byte CurrentMouseLocation(DataGridViewCell cell)
+ private byte CurrentMouseLocation(DataGridViewCell? cell)
{
// Only need to cache reflection info the first time around
if (_piCML == null)
@@ -2432,39 +2557,49 @@ private byte CurrentMouseLocation(DataGridViewCell cell)
// Cache access to the internal get property 'CurrentMouseLocation'
_piCML = typeof(DataGridViewCell).GetProperty(nameof(CurrentMouseLocation), BindingFlags.Instance |
BindingFlags.NonPublic |
- BindingFlags.GetField);
+ BindingFlags.GetField)!;
}
// Grab the internal calculated value of the right to left setting
- return (byte)_piCML.GetValue(cell, null);
+ return (byte)_piCML.GetValue(cell, null)!;
}
- private int GetCellPreferredWidth(DataGridViewCell cell)
+ private int GetCellPreferredWidth([DisallowNull] DataGridViewCell? cell)
{
+ if (cell is null)
+ {
+ throw new ArgumentNullException(nameof(cell));
+ }
+
// Only need to cache reflection info the first time around
if (_miGPW == null)
{
// Cache access to the internal method 'GetPreferredWidth' of cells
_miGPW = typeof(DataGridViewCell).GetMethod(@"GetPreferredWidth", BindingFlags.Instance |
BindingFlags.NonPublic |
- BindingFlags.GetField);
+ BindingFlags.GetField)!;
}
- return (int)_miGPW.Invoke(cell, new object[] { cell.RowIndex, cell.OwningRow.Height });
+ return (int)_miGPW.Invoke(cell, [cell.RowIndex!, cell.OwningRow!.Height!])!;
}
- private int GetCellPreferredHeight(DataGridViewCell cell)
+ private int GetCellPreferredHeight(DataGridViewCell? cell)
{
+ if (cell is null)
+ {
+ throw new ArgumentNullException(nameof(cell));
+ }
+
// Only need to cache reflection info the first time around
if (_miGPH == null)
{
// Cache access to the internal method 'GetPreferredHeight' of cells
_miGPH = typeof(DataGridViewCell).GetMethod(@"GetPreferredHeight", BindingFlags.Instance |
BindingFlags.NonPublic |
- BindingFlags.GetField);
+ BindingFlags.GetField)!;
}
- return (int)_miGPH.Invoke(cell, new object[] { cell.RowIndex, cell.OwningColumn.Width });
+ return (int)_miGPH.Invoke(cell, [cell.RowIndex, cell.OwningColumn!.Width])!;
}
private string DismissBaseToolTips()
@@ -2475,10 +2610,10 @@ private string DismissBaseToolTips()
// Cache access to the internal get property 'ActivateToolTip'
_miATT = typeof(DataGridView).GetMethod(@"ActivateToolTip", BindingFlags.Instance |
BindingFlags.NonPublic |
- BindingFlags.GetField);
+ BindingFlags.GetField)!;
}
- return (string)_miATT.Invoke(this, new object[] { false, string.Empty, -1, -1 });
+ return _miATT.Invoke(this, [false, string.Empty, -1, -1]) as string ?? string.Empty;
}
private string TruncateToolTipText(string toolTipText)
@@ -2507,7 +2642,7 @@ private void SetPalette(PaletteBase? palette)
_palette = palette;
// Get the renderer associated with the palette
- Renderer = _palette.GetRenderer();
+ Renderer = _palette?.GetRenderer();
// Hook to new palette events
if (_palette != null)
@@ -2537,11 +2672,11 @@ private void PaintTransparentBackground(Graphics g, Rectangle clipRect)
_miPTB = typeof(Control).GetMethod(nameof(PaintTransparentBackground),
BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.InvokeMethod,
null, CallingConventions.HasThis,
- new[] { typeof(PaintEventArgs), typeof(Rectangle), typeof(Region) },
- null);
+ [typeof(PaintEventArgs), typeof(Rectangle), typeof(Region)],
+ null)!;
}
- _miPTB.Invoke(this, new object[] { new PaintEventArgs(g, clipRect), ClientRectangle, null });
+ _miPTB.Invoke(this, [new PaintEventArgs(g, clipRect), ClientRectangle, null!]);
}
}
@@ -2570,7 +2705,7 @@ private void OnPerformRefresh()
}
}
- private void OnGlobalPaletteChanged(object sender, EventArgs e)
+ private void OnGlobalPaletteChanged(object? sender, EventArgs e)
{
// We only care if we are using the global palette
if (PaletteMode == PaletteMode.Global)
@@ -2582,18 +2717,18 @@ private void OnGlobalPaletteChanged(object sender, EventArgs e)
SyncCellStylesWithPalette();
// A new palette source means we need to layout and redraw
- OnNeedPaint(Palette, new NeedLayoutEventArgs(true));
+ OnNeedPaint(Palette!, new NeedLayoutEventArgs(true));
}
}
- private void OnUserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e) => OnNeedResyncPaint(Palette, new NeedLayoutEventArgs(true));
+ private void OnUserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e) => OnNeedResyncPaint(Palette!, new NeedLayoutEventArgs(true));
- private void OnSyncPropertyChanged(object sender, EventArgs e) =>
+ private void OnSyncPropertyChanged(object? sender, EventArgs e) =>
// Ensure the current cell style values are in sync with the new palette
// setting and any state overrides that are defined.
SyncCellStylesWithPalette();
- private void OnSyncBackPropertyChanged(object sender, PropertyChangedEventArgs e)
+ private void OnSyncBackPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
// Only interested in the first color from the background palettes
if (e.PropertyName == "Color1")
@@ -2605,14 +2740,17 @@ private void OnSyncBackPropertyChanged(object sender, PropertyChangedEventArgs e
}
#endregion
- #region menus
- private void OnContextMenuStripOpening(object sender, CancelEventArgs e)
+ #region Menus
+ private void OnContextMenuStripOpening(object? sender, CancelEventArgs e)
{
// Get the actual strip instance
- ContextMenuStrip cms = base.ContextMenuStrip;
+ ContextMenuStrip? cms = base.ContextMenuStrip;
// Make sure it has the correct renderer
- cms.Renderer = CreateToolStripRenderer();
+ if (cms != null)
+ {
+ cms.Renderer = CreateToolStripRenderer();
+ }
}
///
@@ -2620,15 +2758,15 @@ private void OnContextMenuStripOpening(object sender, CancelEventArgs e)
///
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Advanced)]
- public ToolStripRenderer CreateToolStripRenderer() => Renderer.RenderToolStrip(GetResolvedPalette());
+ public ToolStripRenderer CreateToolStripRenderer() => Renderer?.RenderToolStrip(GetResolvedPalette()!)!;
- private void OnKryptonContextMenuDisposed(object sender, EventArgs e) =>
+ private void OnKryptonContextMenuDisposed(object? sender, EventArgs e) =>
// When the current krypton context menu is disposed, we should remove
// it to prevent it being used again, as that would just throw an exception
// because it has been disposed.
KryptonContextMenu = null;
- private void OnContextMenuClosed(object sender, ToolStripDropDownClosedEventArgs e) => ContextMenuClosed();
+ private void OnContextMenuClosed(object? sender, ToolStripDropDownClosedEventArgs e) => ContextMenuClosed();
///
/// Called when a context menu has just been closed.
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewButtonCell.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewButtonCell.cs
index 4919ae444..4e65c2850 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewButtonCell.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewButtonCell.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -18,9 +18,9 @@ namespace Krypton.Toolkit
public class KryptonDataGridViewButtonCell : DataGridViewButtonCell
{
#region Static Fields
- private static PropertyInfo _piButtonState;
- private static PropertyInfo _piMouseEnteredCellAddress;
- private static FieldInfo _fiMouseInContentBounds;
+ private static PropertyInfo? _piButtonState;
+ private static PropertyInfo? _piMouseEnteredCellAddress;
+ private static FieldInfo? _fiMouseInContentBounds;
#endregion
#region Instance Fields
@@ -47,13 +47,12 @@ public class KryptonDataGridViewButtonCell : DataGridViewButtonCell
/// New object instance.
public override object Clone()
{
- var dataGridViewCell = base.Clone() as KryptonDataGridViewButtonCell;
- if (dataGridViewCell != null)
- {
- dataGridViewCell._styleSet = _styleSet;
- dataGridViewCell._shortTextValue = _shortTextValue;
- dataGridViewCell._buttonStyle = _buttonStyle;
- }
+ var dataGridViewCell = base.Clone() as KryptonDataGridViewButtonCell ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("dataGridViewCell"));
+
+ dataGridViewCell._styleSet = _styleSet;
+ dataGridViewCell._shortTextValue = _shortTextValue;
+ dataGridViewCell._buttonStyle = _buttonStyle;
+
return dataGridViewCell;
}
@@ -70,7 +69,7 @@ public ButtonStyle ButtonStyle
{
_buttonStyle = value;
_styleSet = true;
- DataGridView.InvalidateCell(this);
+ DataGridView?.InvalidateCell(this);
}
}
#endregion
@@ -104,13 +103,13 @@ protected override Size GetPreferredSize(Graphics graphics,
{
try
{
- var kDGV = (KryptonDataGridView)DataGridView;
+ var kDGV = DataGridView as KryptonDataGridView;
// Create the view elements and palette structure
- CreateViewAndPalettes(kDGV);
+ CreateViewAndPalettes(kDGV!);
// Is this cell the currently active cell
- var currentCell = (rowIndex == DataGridView.CurrentCellAddress.Y) &&
+ var currentCell = (rowIndex == DataGridView!.CurrentCellAddress.Y) &&
(ColumnIndex == DataGridView.CurrentCellAddress.X);
// Is this cell the same as the one with the mouse inside it
@@ -141,21 +140,21 @@ protected override Size GetPreferredSize(Graphics graphics,
}
// Update the display text
- if ((kDGV.Columns[ColumnIndex] is KryptonDataGridViewButtonColumn { UseColumnTextForButtonValue: true } col) && !kDGV.Rows[rowIndex].IsNewRow)
+ if ((kDGV!.Columns[ColumnIndex] is KryptonDataGridViewButtonColumn { UseColumnTextForButtonValue: true } col) && !kDGV.Rows[rowIndex].IsNewRow)
{
- _shortTextValue.ShortText = col.Text;
+ _shortTextValue!.ShortText = col.Text;
}
else if (!string.IsNullOrEmpty(FormattedValue?.ToString()))
{
- _shortTextValue.ShortText = FormattedValue.ToString();
+ _shortTextValue!.ShortText = FormattedValue!.ToString();
}
else
{
- _shortTextValue.ShortText = string.Empty;
+ _shortTextValue!.ShortText = string.Empty;
}
// Position the button element inside the available cell area
- using var layoutContext = new ViewLayoutContext(kDGV, kDGV.Renderer);
+ using var layoutContext = new ViewLayoutContext(kDGV, kDGV.Renderer!);
// Define the available area for layout
layoutContext.DisplayRectangle = new Rectangle(0, 0, int.MaxValue, int.MaxValue);
@@ -190,23 +189,23 @@ protected override Size GetPreferredSize(Graphics graphics,
/// A DataGridViewAdvancedBorderStyle that contains border styles for the cell that is being painted.
/// A bitwise combination of the DataGridViewPaintParts values that specifies which parts of the cell need to be painted.
protected override void Paint(Graphics graphics,
- Rectangle clipBounds,
- Rectangle cellBounds,
- int rowIndex,
- DataGridViewElementStates cellState,
- object value,
- object formattedValue,
- string errorText,
- DataGridViewCellStyle cellStyle,
- DataGridViewAdvancedBorderStyle advancedBorderStyle,
- DataGridViewPaintParts paintParts)
+ Rectangle clipBounds,
+ Rectangle cellBounds,
+ int rowIndex,
+ DataGridViewElementStates cellState,
+ object? value,
+ object? formattedValue,
+ string? errorText,
+ DataGridViewCellStyle cellStyle,
+ DataGridViewAdvancedBorderStyle advancedBorderStyle,
+ DataGridViewPaintParts paintParts)
{
if (DataGridView is KryptonDataGridView kDgv)
{
// Should we draw the content foreground?
if ((paintParts & DataGridViewPaintParts.ContentForeground) == DataGridViewPaintParts.ContentForeground)
{
- using var renderContext = new RenderContext(kDgv, graphics, cellBounds, kDgv.Renderer);
+ using var renderContext = new RenderContext(kDgv, graphics, cellBounds, kDgv.Renderer!);
// Create the view elements and palette structure
CreateViewAndPalettes(kDgv);
@@ -250,15 +249,15 @@ protected override void Paint(Graphics graphics,
UseColumnTextForButtonValue: true
} col) && !kDgv.Rows[rowIndex].IsNewRow)
{
- _shortTextValue.ShortText = col.Text;
+ _shortTextValue!.ShortText = col.Text;
}
else if (!string.IsNullOrEmpty(FormattedValue?.ToString()))
{
- _shortTextValue.ShortText = FormattedValue.ToString();
+ _shortTextValue!.ShortText = FormattedValue!.ToString();
}
else
{
- _shortTextValue.ShortText = string.Empty;
+ _shortTextValue!.ShortText = string.Empty;
}
// Prevent button overlapping the bottom/right border
@@ -279,7 +278,7 @@ protected override void Paint(Graphics graphics,
cellBounds.Height -= cellStyle.Padding.Vertical;
// Position the button element inside the available cell area
- using (var layoutContext = new ViewLayoutContext(kDgv, kDgv.Renderer))
+ using (var layoutContext = new ViewLayoutContext(kDgv, kDgv.Renderer!))
{
// Define the available area for layout
layoutContext.DisplayRectangle = cellBounds;
@@ -352,11 +351,10 @@ private ButtonState ButtonStateInternal
_piButtonState = typeof(DataGridViewButtonCell).GetProperty(nameof(ButtonState), BindingFlags.Instance |
BindingFlags.NonPublic |
BindingFlags.GetField);
-
}
// Grab the internal property implemented by base class
- return (ButtonState)_piButtonState.GetValue(this, null);
+ return _piButtonState != null ? (ButtonState)(_piButtonState.GetValue(this, null) ?? ButtonState.Normal) : ButtonState.Normal;
}
}
@@ -371,10 +369,18 @@ private bool MouseInContentBoundsInternal
_fiMouseInContentBounds = typeof(DataGridViewButtonCell).GetField(@"mouseInContentBounds", BindingFlags.Static |
BindingFlags.NonPublic |
BindingFlags.GetField);
+ if (_fiMouseInContentBounds == null)
+ {
+ // https://github.com/dotnet/winforms/commit/27e010d21c78457113f5be67eeea842499ab5f74#diff-bb5ad249080118c559367691ad27b9a93f8d5324b814f65113ff2e4bd15c9b39
+ // This was changed in netCore8 P1 but when running netcore7 it still wants this new name ??
+ _fiMouseInContentBounds = typeof(DataGridViewButtonCell).GetField(@"s_mouseInContentBounds", BindingFlags.Static |
+ BindingFlags.NonPublic |
+ BindingFlags.GetField);
+ }
}
// Grab the internal property implemented by base class
- return (bool)_fiMouseInContentBounds.GetValue(this);
+ return _fiMouseInContentBounds != null && (bool)(_fiMouseInContentBounds.GetValue(this) ?? false);
}
}
@@ -389,12 +395,11 @@ private Point MouseEnteredCellAddressInternal
_piMouseEnteredCellAddress = typeof(DataGridView).GetProperty(@"MouseEnteredCellAddress", BindingFlags.Instance |
BindingFlags.NonPublic |
BindingFlags.GetField);
-
}
// Grab the internal property implemented by base class
// ReSharper disable RedundantBaseQualifier
- return (Point)_piMouseEnteredCellAddress.GetValue(base.DataGridView, null);
+ return _piMouseEnteredCellAddress != null ? (Point)(_piMouseEnteredCellAddress.GetValue(base.DataGridView, null) ?? Point.Empty) : Point.Empty;
// ReSharper restore RedundantBaseQualifier
}
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewButtonColumn.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewButtonColumn.cs
index 2ca0262a1..5a959502d 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewButtonColumn.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewButtonColumn.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -19,7 +19,7 @@ namespace Krypton.Toolkit
public class KryptonDataGridViewButtonColumn : KryptonDataGridViewIconColumn
{
#region Static Fields
- private MethodInfo _miColumnCommonChange;
+ private MethodInfo? _miColumnCommonChange;
private PropertyInfo _piUseColumnTextForButtonValueInternal;
#endregion
@@ -65,8 +65,9 @@ public override string ToString()
public override object Clone()
{
// Create a new instance
- var clone = base.Clone() as KryptonDataGridViewButtonColumn;
+ var clone = base.Clone() as KryptonDataGridViewButtonColumn ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("clone"));
clone.Text = Text;
+
return clone;
}
#endregion
@@ -77,9 +78,19 @@ public override object Clone()
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- [DisallowNull]
- public override DataGridViewCell CellTemplate
+ public override DataGridViewCell? CellTemplate
{
+ /*
+ Text from the base property, shows that it can be null
+ //
+ // Summary:
+ // Gets or sets the template used to create new cells.
+ //
+ // Returns:
+ // A System.Windows.Forms.DataGridViewCell that all other cells in the column are
+ // modeled after. The default is null.
+ */
+
get => base.CellTemplate;
set
@@ -98,12 +109,16 @@ public override DataGridViewCell CellTemplate
///
[Browsable(true)]
[Category(@"Appearance")]
+ [AllowNull]
public override DataGridViewCellStyle DefaultCellStyle
{
+ // Data type made non-nullable again to keep it inline with the underlying virtual base method
+ // Added [AllowNull] attribute since the base can take null as a value
+
get => base.DefaultCellStyle;
set => base.DefaultCellStyle = value;
}
-
+
///
/// Gets or sets the default text Displayed on the button cell.
///
@@ -153,13 +168,13 @@ public string? Text
public bool UseColumnTextForButtonValue
{
get =>
- ((KryptonDataGridViewButtonCell)CellTemplate)?.UseColumnTextForButtonValue ?? throw new InvalidOperationException(@"KryptonDataGridViewButtonColumn cell template required");
+ (CellTemplate as KryptonDataGridViewButtonCell)?.UseColumnTextForButtonValue ?? throw new InvalidOperationException(@"KryptonDataGridViewButtonColumn cell template required");
set
{
if (UseColumnTextForButtonValue != value)
{
- SetUseColumnTextForButtonValueInternal(CellTemplate, value);
+ SetUseColumnTextForButtonValueInternal(CellTemplate!, value);
if (DataGridView != null)
{
DataGridViewRowCollection rows = DataGridView.Rows;
@@ -186,13 +201,14 @@ public bool UseColumnTextForButtonValue
public ButtonStyle ButtonStyle
{
get =>
- ((KryptonDataGridViewButtonCell)CellTemplate)?.ButtonStyle ?? throw new InvalidOperationException(@"KryptonDataGridViewButtonColumn cell template required");
+ (CellTemplate as KryptonDataGridViewButtonCell)?.ButtonStyle ?? throw new InvalidOperationException(@"KryptonDataGridViewButtonColumn cell template required");
set
{
if (ButtonStyle != value)
{
- ((KryptonDataGridViewButtonCell)CellTemplate).ButtonStyleInternal = value;
+ (CellTemplate as KryptonDataGridViewButtonCell)!.ButtonStyleInternal = value;
+
if (DataGridView != null)
{
DataGridViewRowCollection rows = DataGridView.Rows;
@@ -219,14 +235,21 @@ private bool ShouldSerializeDefaultCellStyle()
return false;
}
- DataGridViewCellStyle defaultCellStyle = DefaultCellStyle;
- return !defaultCellStyle.BackColor.IsEmpty || !defaultCellStyle.ForeColor.IsEmpty ||
-!defaultCellStyle.SelectionBackColor.IsEmpty || !defaultCellStyle.SelectionForeColor.IsEmpty ||
- defaultCellStyle.Font != null || !defaultCellStyle.IsNullValueDefault ||
-!defaultCellStyle.IsDataSourceNullValueDefault || !string.IsNullOrEmpty(defaultCellStyle.Format) ||
-!defaultCellStyle.FormatProvider.Equals(CultureInfo.CurrentCulture) || defaultCellStyle.Alignment != DataGridViewContentAlignment.MiddleCenter ||
- defaultCellStyle.WrapMode != DataGridViewTriState.NotSet || defaultCellStyle.Tag != null
-|| !defaultCellStyle.Padding.Equals(Padding.Empty);
+ DataGridViewCellStyle defaultCellStyle = DefaultCellStyle!;
+
+ return !defaultCellStyle.BackColor.IsEmpty
+ || !defaultCellStyle.ForeColor.IsEmpty
+ || !defaultCellStyle.SelectionBackColor.IsEmpty
+ || !defaultCellStyle.SelectionForeColor.IsEmpty
+ || defaultCellStyle.Font != null
+ || !defaultCellStyle.IsNullValueDefault
+ || !defaultCellStyle.IsDataSourceNullValueDefault
+ || !string.IsNullOrEmpty(defaultCellStyle.Format)
+ || !defaultCellStyle.FormatProvider.Equals(CultureInfo.CurrentCulture)
+ || defaultCellStyle.Alignment != DataGridViewContentAlignment.MiddleCenter
+ || defaultCellStyle.WrapMode != DataGridViewTriState.NotSet
+ || defaultCellStyle.Tag != null
+ || !defaultCellStyle.Padding.Equals(Padding.Empty);
}
private void ColumnCommonChange(int columnIndex)
@@ -241,7 +264,7 @@ private void ColumnCommonChange(int columnIndex)
}
- _miColumnCommonChange.Invoke(DataGridView, new object[] { columnIndex });
+ _miColumnCommonChange?.Invoke(DataGridView, [columnIndex]);
}
private void SetUseColumnTextForButtonValueInternal(object instance, bool value)
@@ -252,11 +275,11 @@ private void SetUseColumnTextForButtonValueInternal(object instance, bool value)
// Cache access to the internal property sette 'UseColumnTextForButtonValueInternal'
_piUseColumnTextForButtonValueInternal = typeof(DataGridViewButtonCell).GetProperty(@"UseColumnTextForButtonValueInternal", BindingFlags.Instance |
BindingFlags.NonPublic |
- BindingFlags.SetProperty);
+ BindingFlags.SetProperty)!;
}
- _piUseColumnTextForButtonValueInternal.SetValue(instance, value, null);
+ _piUseColumnTextForButtonValueInternal?.SetValue(instance, value, null);
}
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewCheckBoxCell.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewCheckBoxCell.cs
index ce83c2a40..1a0aecc7a 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewCheckBoxCell.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewCheckBoxCell.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -18,9 +18,9 @@ namespace Krypton.Toolkit
public class KryptonDataGridViewCheckBoxCell : DataGridViewCheckBoxCell
{
#region Static Fields
- private static PropertyInfo _piButtonState;
- private static PropertyInfo _piMouseEnteredCellAddress;
- private static FieldInfo _fiMouseInContentBounds;
+ private static PropertyInfo? _piButtonState;
+ private static PropertyInfo? _piMouseEnteredCellAddress;
+ private static FieldInfo? _fiMouseInContentBounds;
#endregion
#region Instance Fields
@@ -75,10 +75,10 @@ protected override Size GetPreferredSize(Graphics graphics,
{
try
{
- var kDGV = (KryptonDataGridView)DataGridView;
+ var kDGV = DataGridView as KryptonDataGridView;
// Is this cell the currently active cell
- var currentCell = (rowIndex == DataGridView.CurrentCellAddress.Y) &&
+ var currentCell = (rowIndex == DataGridView!.CurrentCellAddress.Y) &&
(ColumnIndex == DataGridView.CurrentCellAddress.X);
// Is this cell the same as the one with the mouse inside it
@@ -91,8 +91,8 @@ protected override Size GetPreferredSize(Graphics graphics,
var pressed = currentCell && ((ButtonStateInternal & ButtonState.Pushed) == ButtonState.Pushed);
// Find out the requested size of the check box drawing
- using var viewContent = new ViewLayoutContext(kDGV, kDGV.Renderer);
- Size checkBoxSize = kDGV.Renderer.RenderGlyph.GetCheckBoxPreferredSize(viewContent,
+ using var viewContent = new ViewLayoutContext(kDGV!, kDGV!.Renderer!);
+ Size checkBoxSize = kDGV.Renderer!.RenderGlyph.GetCheckBoxPreferredSize(viewContent,
kDGV.Redirector,
kDGV.Enabled,
CheckState.Unchecked,
@@ -131,9 +131,9 @@ protected override void Paint(Graphics graphics,
Rectangle cellBounds,
int rowIndex,
DataGridViewElementStates cellState,
- object value,
- object formattedValue,
- string errorText,
+ object? value,
+ object? formattedValue,
+ string? errorText,
DataGridViewCellStyle cellStyle,
DataGridViewAdvancedBorderStyle advancedBorderStyle,
DataGridViewPaintParts paintParts)
@@ -171,13 +171,13 @@ protected override void Paint(Graphics graphics,
var tracking = mouseCell && MouseInContentBoundsInternal;
var pressed = currentCell && ((ButtonStateInternal & ButtonState.Pushed) == ButtonState.Pushed);
- using var renderContext = new RenderContext(kDgv, graphics, cellBounds, kDgv.Renderer);
+ using var renderContext = new RenderContext(kDgv, graphics, cellBounds, kDgv.Renderer!);
Size checkBoxSize;
// Find out the requested size of the check box drawing
- using (var viewContent = new ViewLayoutContext(kDgv, kDgv.Renderer))
+ using (var viewContent = new ViewLayoutContext(kDgv, kDgv.Renderer!))
{
- checkBoxSize = renderContext.Renderer.RenderGlyph.GetCheckBoxPreferredSize(viewContent,
+ checkBoxSize = renderContext.Renderer!.RenderGlyph.GetCheckBoxPreferredSize(viewContent,
kDgv.Redirector,
kDgv.Enabled && !base.ReadOnly,
checkState,
@@ -265,7 +265,7 @@ private ButtonState ButtonStateInternal
}
// Grab the internal property implemented by base class
- return (ButtonState)_piButtonState.GetValue(this, null);
+ return _piButtonState != null ? (ButtonState)_piButtonState!.GetValue(this, null)! : ButtonState.Normal;
}
}
@@ -280,10 +280,18 @@ private bool MouseInContentBoundsInternal
_fiMouseInContentBounds = typeof(DataGridViewCheckBoxCell).GetField(@"mouseInContentBounds", BindingFlags.Static |
BindingFlags.NonPublic |
BindingFlags.GetField);
+ if (_fiMouseInContentBounds == null)
+ {
+ // https://github.com/dotnet/winforms/commit/7ab46c6e6ae1c39143a7638d694fb6e130ab4edc#diff-2684515ec95bea4ec16a0bf7c9e6ff09dc33d31aafabd2c35f016994c800fc84
+ // This was changed in netCore8 P1 but when running netcore7 it still wants this new name ??
+ _fiMouseInContentBounds = typeof(DataGridViewCheckBoxCell).GetField(@"s_mouseInContentBounds", BindingFlags.Static |
+ BindingFlags.NonPublic |
+ BindingFlags.GetField);
+ }
}
// Grab the internal property implemented by base class
- return (bool)_fiMouseInContentBounds.GetValue(this);
+ return (bool)_fiMouseInContentBounds!.GetValue(this)!;
}
}
@@ -303,7 +311,7 @@ private Point MouseEnteredCellAddressInternal
// Grab the internal property implemented by base class
// ReSharper disable RedundantBaseQualifier
- return (Point)_piMouseEnteredCellAddress.GetValue(base.DataGridView, null);
+ return (Point)_piMouseEnteredCellAddress!.GetValue(base.DataGridView, null)!;
// ReSharper restore RedundantBaseQualifier
}
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewCheckBoxColumn.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewCheckBoxColumn.cs
index bc769631e..d3f3fe6e1 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewCheckBoxColumn.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewCheckBoxColumn.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -77,7 +77,7 @@ public override string ToString()
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public override DataGridViewCell CellTemplate
+ public override DataGridViewCell? CellTemplate
{
get => base.CellTemplate;
@@ -98,7 +98,7 @@ public override DataGridViewCell CellTemplate
[Category(@"Data")]
[DefaultValue(@"")]
[TypeConverter(typeof(StringConverter))]
- public object FalseValue
+ public object? FalseValue
{
get =>
CheckBoxCellTemplate == null
@@ -108,7 +108,8 @@ public object FalseValue
{
if (FalseValue != value)
{
- CheckBoxCellTemplate.FalseValue = value;
+ CheckBoxCellTemplate!.FalseValue = value;
+
if (DataGridView != null)
{
DataGridViewRowCollection rows = DataGridView.Rows;
@@ -133,7 +134,7 @@ public object FalseValue
[Category(@"Data")]
[DefaultValue(@"")]
[TypeConverter(typeof(StringConverter))]
- public object IndeterminateValue
+ public object? IndeterminateValue
{
get =>
CheckBoxCellTemplate == null
@@ -143,7 +144,7 @@ public object IndeterminateValue
{
if (IndeterminateValue != value)
{
- CheckBoxCellTemplate.IndeterminateValue = value;
+ CheckBoxCellTemplate!.IndeterminateValue = value;
if (DataGridView != null)
{
DataGridViewRowCollection rows = DataGridView.Rows;
@@ -168,7 +169,7 @@ public object IndeterminateValue
[Category(@"Data")]
[DefaultValue(@"")]
[TypeConverter(typeof(StringConverter))]
- public object TrueValue
+ public object? TrueValue
{
get =>
CheckBoxCellTemplate == null
@@ -178,7 +179,7 @@ public object TrueValue
{
if (TrueValue != value)
{
- CheckBoxCellTemplate.TrueValue = value;
+ CheckBoxCellTemplate!.TrueValue = value;
if (DataGridView != null)
{
DataGridViewRowCollection rows = DataGridView.Rows;
@@ -210,7 +211,7 @@ public bool ThreeState
{
if (ThreeState != value)
{
- CheckBoxCellTemplate.ThreeState = value;
+ CheckBoxCellTemplate!.ThreeState = value;
if (DataGridView != null)
{
DataGridViewRowCollection rows = DataGridView.Rows;
@@ -243,7 +244,7 @@ public bool ThreeState
#endregion
#region Private
- private KryptonDataGridViewCheckBoxCell? CheckBoxCellTemplate => (KryptonDataGridViewCheckBoxCell)CellTemplate;
+ private KryptonDataGridViewCheckBoxCell? CheckBoxCellTemplate => CellTemplate as KryptonDataGridViewCheckBoxCell;
private bool ShouldSerializeCellTemplate()
{
@@ -268,7 +269,17 @@ private bool ShouldSerializeCellTemplate()
// ReSharper restore RedundantBaseQualifier
DataGridViewCellStyle defaultCellStyle = DefaultCellStyle;
- if (defaultCellStyle.BackColor.IsEmpty && defaultCellStyle.ForeColor.IsEmpty && defaultCellStyle.SelectionBackColor.IsEmpty && defaultCellStyle.SelectionForeColor.IsEmpty && (defaultCellStyle.Font == null) && defaultCellStyle.NullValue.Equals(indeterminate) && defaultCellStyle.IsDataSourceNullValueDefault && string.IsNullOrEmpty(defaultCellStyle.Format) && defaultCellStyle.FormatProvider.Equals(CultureInfo.CurrentCulture) && (defaultCellStyle.Alignment == DataGridViewContentAlignment.MiddleCenter) && defaultCellStyle is { WrapMode: DataGridViewTriState.NotSet, Tag: null })
+ if (defaultCellStyle.BackColor.IsEmpty
+ && defaultCellStyle.ForeColor.IsEmpty
+ && defaultCellStyle.SelectionBackColor.IsEmpty
+ && defaultCellStyle.SelectionForeColor.IsEmpty
+ && (defaultCellStyle.Font is null)
+ && defaultCellStyle.NullValue!.Equals(indeterminate)
+ && defaultCellStyle.IsDataSourceNullValueDefault
+ && string.IsNullOrEmpty(defaultCellStyle.Format)
+ && defaultCellStyle.FormatProvider.Equals(CultureInfo.CurrentCulture)
+ && (defaultCellStyle.Alignment == DataGridViewContentAlignment.MiddleCenter)
+ && defaultCellStyle is { WrapMode: DataGridViewTriState.NotSet, Tag: null })
{
return !defaultCellStyle.Padding.Equals(Padding.Empty);
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewComboBoxCell.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewComboBoxCell.cs
index 1b6d2dec8..7c7c336f3 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewComboBoxCell.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewComboBoxCell.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -21,7 +21,7 @@ public class KryptonDataGridViewComboBoxCell : DataGridViewTextBoxCell
{
#region Static Fields
[ThreadStatic]
- private static KryptonComboBox _paintingComboBox;
+ private static KryptonComboBox? _paintingComboBox;
private static readonly Type _defaultEditType = typeof(KryptonDataGridViewComboBoxEditingControl);
private static readonly Type _defaultValueType = typeof(string);
private static readonly Size _sizeLarge = new Size(10000, 10000);
@@ -86,27 +86,26 @@ public override string ToString() =>
/// Gets the items in the combobox.
/// The items.
- public ComboBox.ObjectCollection Items => _paintingComboBox.ComboBox.Items;
+ public ComboBox.ObjectCollection Items => _paintingComboBox!.ComboBox.Items;
///
/// Clones a DataGridViewComboBoxCell cell, copies all the custom properties.
///
public override object Clone()
{
- var dataGridViewCell = base.Clone() as KryptonDataGridViewComboBoxCell;
- if (dataGridViewCell != null)
- {
- dataGridViewCell.DropDownStyle = DropDownStyle;
- dataGridViewCell.DropDownHeight = DropDownHeight;
- dataGridViewCell.DropDownWidth = DropDownWidth;
- dataGridViewCell.MaxDropDownItems = MaxDropDownItems;
- dataGridViewCell.AutoCompleteMode = AutoCompleteMode;
- dataGridViewCell.AutoCompleteSource = AutoCompleteSource;
- dataGridViewCell.DisplayMember = DisplayMember;
- dataGridViewCell.ValueMember = ValueMember;
- dataGridViewCell.DataSource = DataSource;
- }
- return dataGridViewCell;
+ var dataGridViewCell = base.Clone() as KryptonDataGridViewComboBoxCell ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("dataGridViewCell"));
+
+ dataGridViewCell.DropDownStyle = DropDownStyle;
+ dataGridViewCell.DropDownHeight = DropDownHeight;
+ dataGridViewCell.DropDownWidth = DropDownWidth;
+ dataGridViewCell.MaxDropDownItems = MaxDropDownItems;
+ dataGridViewCell.AutoCompleteMode = AutoCompleteMode;
+ dataGridViewCell.AutoCompleteSource = AutoCompleteSource;
+ dataGridViewCell.DisplayMember = DisplayMember;
+ dataGridViewCell.ValueMember = ValueMember;
+ dataGridViewCell.DataSource = DataSource;
+
+ return dataGridViewCell!;
}
///
/// The DropDownStyle property replicates the one from the KryptonComboBox control
@@ -188,7 +187,7 @@ public int DropDownWidth
///
/// The AutoCompleteMode property replicates the one from the KryptonComboBox control
///
- [DefaultValue(121)]
+ [DefaultValue(AutoCompleteMode.None)]
public AutoCompleteMode AutoCompleteMode
{
get => _autoCompleteMode;
@@ -206,7 +205,7 @@ public AutoCompleteMode AutoCompleteMode
///
/// The AutoCompleteSource property replicates the one from the KryptonComboBox control
///
- [DefaultValue(121)]
+ [DefaultValue(AutoCompleteSource.None)]
public AutoCompleteSource AutoCompleteSource
{
get => _autoCompleteSource;
@@ -284,10 +283,11 @@ public object? DataSource
[EditorBrowsable(EditorBrowsableState.Advanced)]
public override void DetachEditingControl()
{
- DataGridView dataGridView = DataGridView;
- if (dataGridView?.EditingControl == null)
+ DataGridView? dataGridView = DataGridView;
+ switch (dataGridView?.EditingControl)
{
- throw new InvalidOperationException(@"Cell is detached or its grid has no editing control.");
+ case null:
+ throw new InvalidOperationException(@"Cell is detached or its grid has no editing control.");
}
if (dataGridView.EditingControl is KryptonComboBox comboBox)
@@ -304,12 +304,12 @@ public override void DetachEditingControl()
/// set according to the cell properties.
///
public override void InitializeEditingControl(int rowIndex,
- object initialFormattedValue,
- DataGridViewCellStyle dataGridViewCellStyle)
+ object? initialFormattedValue,
+ DataGridViewCellStyle dataGridViewCellStyle)
{
base.InitializeEditingControl(rowIndex, initialFormattedValue, dataGridViewCellStyle);
- if (DataGridView.EditingControl is KryptonComboBox comboBox)
+ if (DataGridView!.EditingControl is KryptonComboBox comboBox)
{
if (OwningColumn is KryptonDataGridViewComboBoxColumn { DataSource: null } comboColumn)
{
@@ -319,7 +319,7 @@ public override void InitializeEditingControl(int rowIndex,
{
strings[i] = comboColumn.Items[i];
}
-
+ comboBox.Items.Clear();
comboBox.Items.AddRange(strings);
var autoAppend = new string[comboColumn.AutoCompleteCustomSource.Count];
@@ -342,14 +342,7 @@ public override void InitializeEditingControl(int rowIndex,
comboBox.ValueMember = ValueMember;
comboBox.DataSource = DataSource;
- if (initialFormattedValue is not string initialFormattedValueStr)
- {
- comboBox.Text = string.Empty;
- }
- else
- {
- comboBox.Text = initialFormattedValueStr;
- }
+ comboBox.Text = initialFormattedValue as string ?? string.Empty;
}
}
@@ -372,7 +365,7 @@ public override void PositionEditingControl(bool setLocation,
isFirstDisplayedColumn, isFirstDisplayedRow);
editingControlBounds = GetAdjustedEditingControlBounds(editingControlBounds, cellStyle);
- DataGridView.EditingControl.Location = new Point(editingControlBounds.X, editingControlBounds.Y);
+ DataGridView!.EditingControl!.Location = new Point(editingControlBounds.X, editingControlBounds.Y);
DataGridView.EditingControl.Size = new Size(editingControlBounds.Width, editingControlBounds.Height);
}
@@ -385,17 +378,8 @@ public override void PositionEditingControl(bool setLocation,
///
protected override Rectangle GetErrorIconBounds(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex)
{
- const int BUTTONS_WIDTH = 16;
-
Rectangle errorIconBounds = base.GetErrorIconBounds(graphics, cellStyle, rowIndex);
- if (DataGridView.RightToLeft == RightToLeft.Yes)
- {
- errorIconBounds.X = errorIconBounds.Left + BUTTONS_WIDTH;
- }
- else
- {
- errorIconBounds.X = errorIconBounds.Left - BUTTONS_WIDTH;
- }
+ errorIconBounds.X = errorIconBounds.Left;
return errorIconBounds;
}
@@ -405,32 +389,21 @@ protected override Rectangle GetErrorIconBounds(Graphics graphics, DataGridViewC
///
protected override Size GetPreferredSize(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex, Size constraintSize)
{
- if (DataGridView == null)
- {
- return new Size(-1, -1);
- }
-
- Size preferredSize = base.GetPreferredSize(graphics, cellStyle, rowIndex, constraintSize);
- if (constraintSize.Width == 0)
- {
- const int BUTTONS_WIDTH = 16; // Account for the width of the up/down buttons.
- const int BUTTON_MARGIN = 8; // Account for some blank pixels between the text and buttons.
- preferredSize.Width += BUTTONS_WIDTH + BUTTON_MARGIN;
- }
-
- return preferredSize;
+ return DataGridView == null
+ ? new Size(-1, -1)
+ : base.GetPreferredSize(graphics, cellStyle, rowIndex, constraintSize);
}
#endregion
#region Private
- private KryptonDataGridViewComboBoxEditingControl EditingComboBox => DataGridView.EditingControl as KryptonDataGridViewComboBoxEditingControl;
+ private KryptonDataGridViewComboBoxEditingControl? EditingComboBox => DataGridView!.EditingControl as KryptonDataGridViewComboBoxEditingControl;
private static Rectangle GetAdjustedEditingControlBounds(Rectangle editingControlBounds,
DataGridViewCellStyle cellStyle)
{
// Adjust the vertical location of the editing control:
- var preferredHeight = _paintingComboBox.GetPreferredSize(_sizeLarge).Height + 2;
+ var preferredHeight = _paintingComboBox!.GetPreferredSize(_sizeLarge).Height + 2;
if (preferredHeight < editingControlBounds.Height)
{
switch (cellStyle.Alignment)
@@ -467,8 +440,8 @@ private void OnCommonChange()
}
private bool OwnsEditingComboBox(int rowIndex) =>
- rowIndex != -1
- && DataGridView is { EditingControl: KryptonDataGridViewComboBoxEditingControl control }
+ rowIndex != -1
+ && DataGridView is { EditingControl: KryptonDataGridViewComboBoxEditingControl control }
&& (rowIndex == ((IDataGridViewEditingControl)control).EditingControlRowIndex);
private static bool PartPainted(DataGridViewPaintParts paintParts, DataGridViewPaintParts paintPart) => (paintParts & paintPart) != 0;
@@ -481,7 +454,7 @@ internal void SetDropDownStyle(int rowIndex, ComboBoxStyle value)
_dropDownStyle = value;
if (OwnsEditingComboBox(rowIndex))
{
- EditingComboBox.DropDownStyle = value;
+ EditingComboBox!.DropDownStyle = value;
}
}
@@ -490,7 +463,7 @@ internal void SetMaxDropDownItems(int rowIndex, int value)
_maxDropDownItems = value;
if (OwnsEditingComboBox(rowIndex))
{
- EditingComboBox.MaxDropDownItems = value;
+ EditingComboBox!.MaxDropDownItems = value;
}
}
@@ -499,7 +472,7 @@ internal void SetDropDownHeight(int rowIndex, int value)
_dropDownHeight = value;
if (OwnsEditingComboBox(rowIndex))
{
- EditingComboBox.DropDownHeight = value;
+ EditingComboBox!.DropDownHeight = value;
}
}
@@ -508,7 +481,7 @@ internal void SetDropDownWidth(int rowIndex, int value)
_dropDownWidth = value;
if (OwnsEditingComboBox(rowIndex))
{
- EditingComboBox.DropDownWidth = value;
+ EditingComboBox!.DropDownWidth = value;
}
}
@@ -517,7 +490,7 @@ internal void SetAutoCompleteMode(int rowIndex, AutoCompleteMode value)
_autoCompleteMode = value;
if (OwnsEditingComboBox(rowIndex))
{
- EditingComboBox.AutoCompleteMode = value;
+ EditingComboBox!.AutoCompleteMode = value;
}
}
@@ -526,7 +499,7 @@ internal void SetAutoCompleteSource(int rowIndex, AutoCompleteSource value)
_autoCompleteSource = value;
if (OwnsEditingComboBox(rowIndex))
{
- EditingComboBox.AutoCompleteSource = value;
+ EditingComboBox!.AutoCompleteSource = value;
}
}
@@ -535,7 +508,7 @@ internal void SetDisplayMember(int rowIndex, string value)
_displayMember = value;
if (OwnsEditingComboBox(rowIndex))
{
- EditingComboBox.DisplayMember = value;
+ EditingComboBox!.DisplayMember = value;
}
}
@@ -544,16 +517,16 @@ internal void SetValueMember(int rowIndex, string value)
_valueMember = value;
if (OwnsEditingComboBox(rowIndex))
{
- EditingComboBox.ValueMember = value;
+ EditingComboBox!.ValueMember = value;
}
}
- internal void SetDataSource(int rowIndex, object value)
+ internal void SetDataSource(int rowIndex, object? value)
{
_dataSource = value;
if (OwnsEditingComboBox(rowIndex))
{
- EditingComboBox.DataSource = value;
+ EditingComboBox!.DataSource = value;
}
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewComboBoxColumn.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewComboBoxColumn.cs
index 69e8d4cc3..df7ae92a0 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewComboBoxColumn.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewComboBoxColumn.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -28,8 +28,8 @@ public class KryptonDataGridViewComboBoxColumn : KryptonDataGridViewIconColumn
public KryptonDataGridViewComboBoxColumn()
: base(new KryptonDataGridViewComboBoxCell())
{
- Items = new List();
- AutoCompleteCustomSource = new AutoCompleteStringCollection();
+ Items = [];
+ AutoCompleteCustomSource = [];
}
///
@@ -54,7 +54,7 @@ public override string ToString()
///
public override object Clone()
{
- var cloned = base.Clone() as KryptonDataGridViewComboBoxColumn;
+ var cloned = base.Clone() as KryptonDataGridViewComboBoxColumn ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("clone"));
cloned.Items.AddRange(Items);
@@ -77,7 +77,7 @@ public override object Clone()
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public override DataGridViewCell CellTemplate
+ public override DataGridViewCell? CellTemplate
{
get => base.CellTemplate;
@@ -468,7 +468,7 @@ public string ValueMember
[Description(@"Indicates the Datasource for the items in this control.")]
[TypeConverter(@"System.Windows.Forms.Design.DataSourceConverter")]
[Editor(@"System.Windows.Forms.Design.DataSourceListEditor", typeof(UITypeEditor))]
- public object DataSource
+ public object? DataSource
{
get =>
@@ -493,7 +493,7 @@ public object DataSource
///
/// Small utility function that returns the template cell as a KryptonDataGridViewComboBoxCell
///
- private KryptonDataGridViewComboBoxCell? ComboBoxCellTemplate => (KryptonDataGridViewComboBoxCell)CellTemplate;
+ private KryptonDataGridViewComboBoxCell? ComboBoxCellTemplate => CellTemplate as KryptonDataGridViewComboBoxCell;
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewComboBoxEditingControl.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewComboBoxEditingControl.cs
index 33a9c6d09..562b2c6c8 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewComboBoxEditingControl.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewComboBoxEditingControl.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,14 +20,14 @@ public class KryptonDataGridViewComboBoxEditingControl : KryptonComboBox,
IDataGridViewEditingControl
{
#region Instance Fields
- private DataGridView _dataGridView;
+ private DataGridView? _dataGridView;
private bool _valueChanged;
#endregion
#region Identity
///
- /// Initalize a new instance of the KryptonDataGridViewComboBoxEditingControl class.
+ /// Initialize a new instance of the KryptonDataGridViewComboBoxEditingControl class.
///
public KryptonDataGridViewComboBoxEditingControl()
{
@@ -42,7 +42,7 @@ public KryptonDataGridViewComboBoxEditingControl()
///
/// Property which caches the grid that uses this editing control
///
- public virtual DataGridView EditingControlDataGridView
+ public virtual DataGridView? EditingControlDataGridView
{
get => _dataGridView;
set => _dataGridView = value;
@@ -50,11 +50,26 @@ public virtual DataGridView EditingControlDataGridView
///
/// Property which represents the current formatted value of the editing control
+ /// Allows null as input, but null will saved as an empty string.
///
- public virtual object? EditingControlFormattedValue
+ [AllowNull]
+ public virtual object EditingControlFormattedValue
{
+ // [AllowNull] removes warning CS8767, but allows for null input, which is undesired.
+ // The Text property is a non-nullable string and therefore null input
+ // will be converted to String.Empty.
+
get => GetEditingControlFormattedValue(DataGridViewDataErrorContexts.Formatting);
- set => Text = (string)value;
+
+ set
+ {
+ // #1800 correct to the standard of the Winforms counterpart
+ // Text is only set if the cast is correct. null value will also be rejected.
+ if (value is string str)
+ {
+ Text = str;
+ }
+ }
}
///
@@ -82,7 +97,7 @@ public virtual bool EditingControlValueChanged
public virtual bool RepositionEditingControlOnValueChange => false;
///
- /// Method called by the grid before the editing control is shown so it can adapt to the provided cell style.
+ /// Method called by the grid before the editing control is shown, so it can adapt to the provided cell style.
///
public virtual void ApplyCellStyleToEditingControl(DataGridViewCellStyle dataGridViewCellStyle)
{
@@ -103,7 +118,7 @@ public virtual void ApplyCellStyleToEditingControl(DataGridViewCellStyle dataGri
///
/// Returns the current value of the editing control.
///
- public virtual object? GetEditingControlFormattedValue(DataGridViewDataErrorContexts context) => Text;
+ public virtual object GetEditingControlFormattedValue(DataGridViewDataErrorContexts context) => Text!;
///
/// Called by the grid to give the editing control a chance to prepare itself for the editing session.
@@ -153,7 +168,7 @@ private void NotifyDataGridViewOfValueChange()
if (!_valueChanged)
{
_valueChanged = true;
- _dataGridView.NotifyCurrentCellDirty(true);
+ _dataGridView?.NotifyCurrentCellDirty(true);
}
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewCustomEditingControl.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewCustomEditingControl.cs
index bcc37f69f..85b3a49aa 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewCustomEditingControl.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewCustomEditingControl.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,7 +20,7 @@ public class KryptonDataGridViewCustomEditingControl : KryptonTextBox,
IDataGridViewEditingControl
{
#region Instance Fields
- private DataGridView _dataGridView;
+ private DataGridView? _dataGridView;
private bool _valueChanged;
private int _rowIndex;
#endregion
@@ -42,7 +42,7 @@ public KryptonDataGridViewCustomEditingControl()
///
/// Property which caches the grid that uses this editing control
///
- public virtual DataGridView EditingControlDataGridView
+ public virtual DataGridView? EditingControlDataGridView
{
get => _dataGridView;
set => _dataGridView = value;
@@ -50,11 +50,19 @@ public virtual DataGridView EditingControlDataGridView
///
/// Property which represents the current formatted value of the editing control
+ /// Allows null as input, but null will saved as an empty string.
///
- public virtual object EditingControlFormattedValue
+ [AllowNull]
+ public virtual object EditingControlFormattedValue
{
+ // [AllowNull] removes warning CS8767, but allows for null input, which is undesired.
+ // The Text property is a non-nullable string and therefore null input
+ // will be converted to String.Empty.
+
get => GetEditingControlFormattedValue(DataGridViewDataErrorContexts.Formatting);
- set => Text = (string)value;
+ set => Text = value is string str && str is not null
+ ? str
+ : string.Empty;
}
///
@@ -222,7 +230,7 @@ private void NotifyDataGridViewOfValueChange()
if (!_valueChanged)
{
_valueChanged = true;
- _dataGridView.NotifyCurrentCellDirty(true);
+ _dataGridView?.NotifyCurrentCellDirty(true);
}
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewDateTimePickerCell.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewDateTimePickerCell.cs
index 39e1a0d24..7c76e08ad 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewDateTimePickerCell.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewDateTimePickerCell.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -73,7 +73,7 @@ public KryptonDataGridViewDateTimePickerCell()
_maxDate = DateTime.MaxValue;
_minDate = DateTime.MinValue;
_format = DateTimePickerFormat.Long;
- _calendarDimensions = new Size(1,1);
+ _calendarDimensions = new Size(1, 1);
_calendarTodayText = "Today:";
_calendarFirstDayOfWeek = Day.Default;
_calendarShowToday = true;
@@ -106,27 +106,26 @@ public KryptonDataGridViewDateTimePickerCell()
///
public override object Clone()
{
- var dateTimeCell = base.Clone() as KryptonDataGridViewDateTimePickerCell;
- if (dateTimeCell != null)
- {
- dateTimeCell.AutoShift = AutoShift;
- dateTimeCell.Checked = Checked;
- dateTimeCell.ShowCheckBox = ShowCheckBox;
- dateTimeCell.ShowUpDown = ShowUpDown;
- dateTimeCell.CustomFormat = CustomFormat;
- dateTimeCell.CustomNullText = CustomNullText;
- dateTimeCell.MaxDate = MaxDate;
- dateTimeCell.MinDate = MinDate;
- dateTimeCell.Format = Format;
- dateTimeCell.CalendarDimensions = CalendarDimensions;
- dateTimeCell.CalendarTodayText = CalendarTodayText;
- dateTimeCell.CalendarFirstDayOfWeek = CalendarFirstDayOfWeek;
- dateTimeCell.CalendarShowToday = CalendarShowToday;
- dateTimeCell.CalendarCloseOnTodayClick = CalendarCloseOnTodayClick;
- dateTimeCell.CalendarShowTodayCircle = CalendarShowTodayCircle;
- dateTimeCell.CalendarShowWeekNumbers = CalendarShowWeekNumbers;
- dateTimeCell.CalendarTodayDate = CalendarTodayDate;
- }
+ var dateTimeCell = base.Clone() as KryptonDataGridViewDateTimePickerCell ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("dateTimeCell"));
+
+ dateTimeCell.AutoShift = AutoShift;
+ dateTimeCell.Checked = Checked;
+ dateTimeCell.ShowCheckBox = ShowCheckBox;
+ dateTimeCell.ShowUpDown = ShowUpDown;
+ dateTimeCell.CustomFormat = CustomFormat;
+ dateTimeCell.CustomNullText = CustomNullText;
+ dateTimeCell.MaxDate = MaxDate;
+ dateTimeCell.MinDate = MinDate;
+ dateTimeCell.Format = Format;
+ dateTimeCell.CalendarDimensions = CalendarDimensions;
+ dateTimeCell.CalendarTodayText = CalendarTodayText;
+ dateTimeCell.CalendarFirstDayOfWeek = CalendarFirstDayOfWeek;
+ dateTimeCell.CalendarShowToday = CalendarShowToday;
+ dateTimeCell.CalendarCloseOnTodayClick = CalendarCloseOnTodayClick;
+ dateTimeCell.CalendarShowTodayCircle = CalendarShowTodayCircle;
+ dateTimeCell.CalendarShowWeekNumbers = CalendarShowWeekNumbers;
+ dateTimeCell.CalendarTodayDate = CalendarTodayDate;
+
return dateTimeCell;
}
@@ -396,7 +395,7 @@ public bool CalendarCloseOnTodayClick
}
}
-
+
///
/// The CalendarShowTodayCircle property replicates the one from the KryptonDateTimePicker control
///
@@ -462,7 +461,7 @@ public DateTime CalendarTodayDate
[EditorBrowsable(EditorBrowsableState.Advanced)]
public override void DetachEditingControl()
{
- DataGridView dataGridView = DataGridView;
+ DataGridView? dataGridView = DataGridView;
if (dataGridView?.EditingControl == null)
{
throw new InvalidOperationException("Cell is detached or its grid has no editing control.");
@@ -477,12 +476,12 @@ public override void DetachEditingControl()
/// set according to the cell properties.
///
public override void InitializeEditingControl(int rowIndex,
- object initialFormattedValue,
- DataGridViewCellStyle dataGridViewCellStyle)
+ object? initialFormattedValue,
+ DataGridViewCellStyle dataGridViewCellStyle)
{
base.InitializeEditingControl(rowIndex, initialFormattedValue, dataGridViewCellStyle);
- if (DataGridView.EditingControl is KryptonDateTimePicker dateTime)
+ if (DataGridView!.EditingControl is KryptonDateTimePicker dateTime)
{
if (OwningColumn is KryptonDataGridViewDateTimePickerColumn dateTimeColumn)
{
@@ -514,7 +513,8 @@ public override void InitializeEditingControl(int rowIndex,
}
else
{
- var dt = (DateTime)_dtc.ConvertFromInvariantString(initialFormattedValueStr);
+ var dt = (DateTime)_dtc.ConvertFromInvariantString(initialFormattedValueStr)!;
+
if (dt != null)
{
dateTime.Value = dt;
@@ -537,11 +537,12 @@ public override void InitializeEditingControl(int rowIndex,
/// A TypeConverter associated with the formatted value type that provides custom conversion from the value type, or null if no such custom conversion is needed.
/// A bitwise combination of DataGridViewDataErrorContexts values describing the context in which the formatted value is needed.
///
- protected override object GetFormattedValue(object value, int rowIndex,
- ref DataGridViewCellStyle cellStyle,
- TypeConverter valueTypeConverter,
- TypeConverter formattedValueTypeConverter,
- DataGridViewDataErrorContexts context)
+ protected override object? GetFormattedValue(object? value,
+ int rowIndex,
+ ref DataGridViewCellStyle cellStyle,
+ TypeConverter? valueTypeConverter,
+ TypeConverter? formattedValueTypeConverter,
+ DataGridViewDataErrorContexts context)
{
if ((value == null) || (value == DBNull.Value))
{
@@ -567,10 +568,10 @@ protected override object GetFormattedValue(object value, int rowIndex,
/// A TypeConverter for the display value type, or null to use the default converter.
/// A TypeConverter for the cell value type, or null to use the default converter.
///
- public override object ParseFormattedValue(object formattedValue,
- DataGridViewCellStyle cellStyle,
- TypeConverter formattedValueTypeConverter,
- TypeConverter valueTypeConverter)
+ public override object ParseFormattedValue(object? formattedValue,
+ DataGridViewCellStyle cellStyle,
+ TypeConverter? formattedValueTypeConverter,
+ TypeConverter? valueTypeConverter)
{
if (formattedValue == null)
{
@@ -578,8 +579,8 @@ public override object ParseFormattedValue(object formattedValue,
}
else
{
- var stringValue = (string)formattedValue;
- return string.IsNullOrEmpty(stringValue) ? DBNull.Value : _dtc.ConvertFromInvariantString(stringValue);
+ string stringValue = (string)formattedValue;
+ return string.IsNullOrEmpty(stringValue) ? DBNull.Value : _dtc.ConvertFromInvariantString(stringValue)!;
}
}
@@ -602,7 +603,7 @@ public override void PositionEditingControl(bool setLocation,
isFirstDisplayedColumn, isFirstDisplayedRow);
editingControlBounds = GetAdjustedEditingControlBounds(editingControlBounds, cellStyle);
- DataGridView.EditingControl.Location = new Point(editingControlBounds.X, editingControlBounds.Y);
+ DataGridView!.EditingControl!.Location = new Point(editingControlBounds.X, editingControlBounds.Y);
DataGridView.EditingControl.Size = new Size(editingControlBounds.Width, editingControlBounds.Height);
}
#endregion
@@ -617,7 +618,7 @@ protected override Rectangle GetErrorIconBounds(Graphics graphics, DataGridViewC
const int ButtonsWidth = 16;
Rectangle errorIconBounds = base.GetErrorIconBounds(graphics, cellStyle, rowIndex);
- if (DataGridView.RightToLeft == RightToLeft.Yes)
+ if (DataGridView!.RightToLeft == RightToLeft.Yes)
{
errorIconBounds.X = errorIconBounds.Left + ButtonsWidth;
}
@@ -658,17 +659,17 @@ protected override Size GetPreferredSize(Graphics graphics, DataGridViewCellStyl
/// the KryptonDateTimePicker control piece by piece (text and up/down buttons).
///
protected override void Paint(Graphics graphics,
- Rectangle clipBounds,
- Rectangle cellBounds,
- int rowIndex,
- DataGridViewElementStates cellState,
- object value,
- object formattedValue,
- string errorText,
- DataGridViewCellStyle cellStyle,
- DataGridViewAdvancedBorderStyle advancedBorderStyle,
- DataGridViewPaintParts paintParts)
- {
+ Rectangle clipBounds,
+ Rectangle cellBounds,
+ int rowIndex,
+ DataGridViewElementStates cellState,
+ object? value,
+ object? formattedValue,
+ string? errorText,
+ DataGridViewCellStyle cellStyle,
+ DataGridViewAdvancedBorderStyle advancedBorderStyle,
+ DataGridViewPaintParts paintParts)
+ {
if (DataGridView == null)
{
return;
@@ -702,8 +703,8 @@ protected override void Paint(Graphics graphics,
#region Private
- private KryptonDataGridViewDateTimePickerEditingControl EditingDateTimePicker =>
- DataGridView.EditingControl as KryptonDataGridViewDateTimePickerEditingControl;
+ private KryptonDataGridViewDateTimePickerEditingControl EditingDateTimePicker =>
+ DataGridView!.EditingControl as KryptonDataGridViewDateTimePickerEditingControl ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(DataGridView.EditingControl)));
private Rectangle GetAdjustedEditingControlBounds(Rectangle editingControlBounds,
DataGridViewCellStyle cellStyle)
@@ -746,7 +747,7 @@ private void OnCommonChange()
}
private bool OwnsEditingDateTimePicker(int rowIndex) =>
- rowIndex != -1 && DataGridView is { EditingControl: KryptonDataGridViewDateTimePickerEditingControl control }
+ rowIndex != -1 && DataGridView is { EditingControl: KryptonDataGridViewDateTimePickerEditingControl control }
&& (rowIndex == ((IDataGridViewEditingControl)control).EditingControlRowIndex);
private static bool PartPainted(DataGridViewPaintParts paintParts, DataGridViewPaintParts paintPart) => (paintParts & paintPart) != 0;
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewDateTimePickerColumn.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewDateTimePickerColumn.cs
index 20036323d..6c9d8f76d 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewDateTimePickerColumn.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewDateTimePickerColumn.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -33,9 +33,9 @@ public class KryptonDataGridViewDateTimePickerColumn : KryptonDataGridViewIconCo
public KryptonDataGridViewDateTimePickerColumn()
: base(new KryptonDataGridViewDateTimePickerCell())
{
- _annualDates = new DateTimeList();
- _monthlyDates = new DateTimeList();
- _dates = new DateTimeList();
+ _annualDates = [];
+ _monthlyDates = [];
+ _dates = [];
}
///
@@ -60,7 +60,8 @@ public override string ToString()
///
public override object Clone()
{
- var cloned = base.Clone() as KryptonDataGridViewDateTimePickerColumn;
+ var cloned = base.Clone() as KryptonDataGridViewDateTimePickerColumn ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("cloned"));
+
cloned.CalendarAnnuallyBoldedDates = CalendarAnnuallyBoldedDates;
cloned.CalendarMonthlyBoldedDates = CalendarMonthlyBoldedDates;
@@ -76,7 +77,7 @@ public override object Clone()
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public override DataGridViewCell CellTemplate
+ public override DataGridViewCell? CellTemplate
{
get => base.CellTemplate;
@@ -808,7 +809,8 @@ public DateTime CalendarTodayDate
[Category(@"MonthCalendar")]
[Description(@"Indicates which annual dates should be boldface.")]
[Localizable(true)]
- public DateTime[] CalendarAnnuallyBoldedDates
+ [AllowNull]
+ public DateTime[]? CalendarAnnuallyBoldedDates
{
get => _annualDates.ToArray();
@@ -835,7 +837,8 @@ public DateTime[] CalendarAnnuallyBoldedDates
[Category(@"MonthCalendar")]
[Description(@"Indicates which monthly dates should be boldface.")]
[Localizable(true)]
- public DateTime[] CalendarMonthlyBoldedDates
+ [AllowNull]
+ public DateTime[]? CalendarMonthlyBoldedDates
{
get => _monthlyDates.ToArray();
@@ -862,7 +865,8 @@ public DateTime[] CalendarMonthlyBoldedDates
[Category(@"MonthCalendar")]
[Description(@"Indicates which dates should be boldface.")]
[Localizable(true)]
- public DateTime[] CalendarBoldedDates
+ [AllowNull]
+ public DateTime[]? CalendarBoldedDates
{
get => _dates.ToArray();
@@ -889,7 +893,7 @@ public DateTime[] CalendarBoldedDates
///
/// Small utility function that returns the template cell as a KryptonDataGridViewDateTimePickerCell
///
- private KryptonDataGridViewDateTimePickerCell? DateTimePickerCellTemplate => (KryptonDataGridViewDateTimePickerCell)CellTemplate;
+ private KryptonDataGridViewDateTimePickerCell? DateTimePickerCellTemplate => CellTemplate as KryptonDataGridViewDateTimePickerCell;
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewDateTimePickerEditingControl.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewDateTimePickerEditingControl.cs
index 633e1f5e0..5500d42a3 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewDateTimePickerEditingControl.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewDateTimePickerEditingControl.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -46,20 +46,24 @@ public KryptonDataGridViewDateTimePickerEditingControl()
///
/// Property which caches the grid that uses this editing control
///
- public virtual DataGridView EditingControlDataGridView
+ public virtual DataGridView? EditingControlDataGridView
{
get => _dataGridView;
- set => _dataGridView = value;
+ set => _dataGridView = value!;
}
///
/// Property which represents the current formatted value of the editing control
///
+ [AllowNull]
public virtual object EditingControlFormattedValue
{
+ // [AllowNull] removes warning CS8767 and allows to write null
+ // although the interface defines the property as non-nullable
+
get => GetEditingControlFormattedValue(DataGridViewDataErrorContexts.Formatting);
- set
+ set
{
if ((value == null) || (value == DBNull.Value))
{
@@ -68,13 +72,14 @@ public virtual object EditingControlFormattedValue
else
{
var formattedValue = value as string;
+
if (string.IsNullOrEmpty(formattedValue))
{
ValueNullable = (formattedValue == string.Empty) ? null : value;
}
else
{
- Value = (DateTime)_dtc.ConvertFromInvariantString(formattedValue);
+ Value = (DateTime)_dtc.ConvertFromInvariantString(formattedValue!)!;
}
}
}
@@ -133,7 +138,8 @@ public virtual void ApplyCellStyleToEditingControl(DataGridViewCellStyle dataGri
///
/// Returns the current value of the editing control.
///
- public virtual object GetEditingControlFormattedValue(DataGridViewDataErrorContexts context) => (ValueNullable == null) || (ValueNullable == DBNull.Value) ? string.Empty : _dtc.ConvertToInvariantString(Value);
+ public virtual object GetEditingControlFormattedValue(DataGridViewDataErrorContexts context) =>
+ (ValueNullable is null) || (ValueNullable == DBNull.Value) ? string.Empty : _dtc.ConvertToInvariantString(Value)!;
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewDomainUpDownCell.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewDomainUpDownCell.cs
index b4258a9bb..27ae18002 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewDomainUpDownCell.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewDomainUpDownCell.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -70,7 +70,7 @@ public override string ToString() =>
[EditorBrowsable(EditorBrowsableState.Advanced)]
public override void DetachEditingControl()
{
- DataGridView dataGridView = DataGridView;
+ DataGridView? dataGridView = DataGridView;
if (dataGridView?.EditingControl == null)
{
throw new InvalidOperationException(@"Cell is detached or its grid has no editing control.");
@@ -98,12 +98,12 @@ public override void DetachEditingControl()
/// set according to the cell properties.
///
public override void InitializeEditingControl(int rowIndex,
- object initialFormattedValue,
- DataGridViewCellStyle dataGridViewCellStyle)
+ object? initialFormattedValue,
+ DataGridViewCellStyle dataGridViewCellStyle)
{
base.InitializeEditingControl(rowIndex, initialFormattedValue, dataGridViewCellStyle);
- if (DataGridView.EditingControl is KryptonDomainUpDown domainUpDown)
+ if (DataGridView!.EditingControl is KryptonDomainUpDown domainUpDown)
{
domainUpDown.Items.Clear();
domainUpDown.ButtonSpecs.Clear();
@@ -113,7 +113,7 @@ public override void InitializeEditingControl(int rowIndex,
domainUpDown.Items.InsertRange(0, domainColumn.Items);
}
- domainUpDown.Text = initialFormattedValue is string initialFormattedValueStr ? initialFormattedValueStr : string.Empty;
+ domainUpDown.Text = initialFormattedValue as string ?? string.Empty;
}
}
@@ -136,7 +136,7 @@ public override void PositionEditingControl(bool setLocation,
isFirstDisplayedColumn, isFirstDisplayedRow);
editingControlBounds = GetAdjustedEditingControlBounds(editingControlBounds, cellStyle);
- DataGridView.EditingControl.Location = new Point(editingControlBounds.X, editingControlBounds.Y);
+ DataGridView!.EditingControl!.Location = new Point(editingControlBounds.X, editingControlBounds.Y);
DataGridView.EditingControl.Size = new Size(editingControlBounds.Width, editingControlBounds.Height);
}
#endregion
@@ -148,17 +148,8 @@ public override void PositionEditingControl(bool setLocation,
///
protected override Rectangle GetErrorIconBounds(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex)
{
- const int BUTTONS_WIDTH = 16;
-
Rectangle errorIconBounds = base.GetErrorIconBounds(graphics, cellStyle, rowIndex);
- if (DataGridView.RightToLeft == RightToLeft.Yes)
- {
- errorIconBounds.X = errorIconBounds.Left + BUTTONS_WIDTH;
- }
- else
- {
- errorIconBounds.X = errorIconBounds.Left - BUTTONS_WIDTH;
- }
+ errorIconBounds.X = errorIconBounds.Left;
return errorIconBounds;
}
@@ -168,26 +159,16 @@ protected override Rectangle GetErrorIconBounds(Graphics graphics, DataGridViewC
///
protected override Size GetPreferredSize(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex, Size constraintSize)
{
- if (DataGridView == null)
- {
- return new Size(-1, -1);
- }
-
- Size preferredSize = base.GetPreferredSize(graphics, cellStyle, rowIndex, constraintSize);
- if (constraintSize.Width == 0)
- {
- const int BUTTONS_WIDTH = 16; // Account for the width of the up/down buttons.
- const int BUTTON_MARGIN = 8; // Account for some blank pixels between the text and buttons.
- preferredSize.Width += BUTTONS_WIDTH + BUTTON_MARGIN;
- }
-
- return preferredSize;
+ return DataGridView == null
+ ? new Size(-1, -1)
+ : base.GetPreferredSize(graphics, cellStyle, rowIndex, constraintSize);
}
#endregion
#region Private
- private KryptonDataGridViewDomainUpDownEditingControl EditingDomainUpDown => DataGridView.EditingControl as KryptonDataGridViewDomainUpDownEditingControl;
+ private KryptonDataGridViewDomainUpDownEditingControl EditingDomainUpDown => DataGridView!.EditingControl as KryptonDataGridViewDomainUpDownEditingControl
+ ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(DataGridView.EditingControl)));
private Rectangle GetAdjustedEditingControlBounds(Rectangle editingControlBounds,
DataGridViewCellStyle cellStyle)
@@ -230,7 +211,7 @@ private void OnCommonChange()
}
private bool OwnsEditingDomainUpDown(int rowIndex) =>
- rowIndex != -1 && DataGridView is { EditingControl: KryptonDataGridViewDomainUpDownEditingControl control }
+ rowIndex != -1 && DataGridView is { EditingControl: KryptonDataGridViewDomainUpDownEditingControl control }
&& (rowIndex == ((IDataGridViewEditingControl)control).EditingControlRowIndex);
private static bool PartPainted(DataGridViewPaintParts paintParts, DataGridViewPaintParts paintPart) => (paintParts & paintPart) != 0;
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewDomainUpDownColumn.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewDomainUpDownColumn.cs
index bcadf70d5..f5b74b1ee 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewDomainUpDownColumn.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewDomainUpDownColumn.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -25,7 +25,7 @@ public class KryptonDataGridViewDomainUpDownColumn : KryptonDataGridViewIconColu
///
public KryptonDataGridViewDomainUpDownColumn()
: base(new KryptonDataGridViewDomainUpDownCell()) =>
- Items = new StringCollection();
+ Items = [];
///
/// Returns a standard compact string representation of the column.
@@ -49,13 +49,13 @@ public override string ToString()
///
public override object Clone()
{
- var cloned = base.Clone() as KryptonDataGridViewDomainUpDownColumn;
+ var cloned = base.Clone() as KryptonDataGridViewDomainUpDownColumn ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("cloned"));
// Convert collection of strings to an array
var strings = new string[Items.Count];
for (var i = 0; i < strings.Length; i++)
{
- strings[i] = Items[i];
+ strings[i] = Items[i]!;
}
cloned.Items.AddRange(strings);
@@ -70,7 +70,7 @@ public override object Clone()
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public override DataGridViewCell CellTemplate
+ public override DataGridViewCell? CellTemplate
{
get => base.CellTemplate;
set
@@ -99,7 +99,7 @@ public override DataGridViewCell CellTemplate
///
/// Small utility function that returns the template cell as a KryptonDataGridViewDomainUpDownCell
///
- private KryptonDataGridViewDomainUpDownCell DomainUpDownCellTemplate => (KryptonDataGridViewDomainUpDownCell)CellTemplate;
+ private KryptonDataGridViewDomainUpDownCell DomainUpDownCellTemplate => CellTemplate as KryptonDataGridViewDomainUpDownCell ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(CellTemplate)));
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewDomainUpDownEditingControl.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewDomainUpDownEditingControl.cs
index 67e77f9dc..ec210d543 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewDomainUpDownEditingControl.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewDomainUpDownEditingControl.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -42,19 +42,27 @@ public KryptonDataGridViewDomainUpDownEditingControl()
///
/// Property which caches the grid that uses this editing control
///
- public virtual DataGridView EditingControlDataGridView
+ public virtual DataGridView? EditingControlDataGridView
{
get => _dataGridView;
- set => _dataGridView = value;
+ set => _dataGridView = value!;
}
///
/// Property which represents the current formatted value of the editing control
+ /// Allows null as input, but null will saved as an empty string.
///
- public virtual object EditingControlFormattedValue
+ [AllowNull]
+ public virtual object EditingControlFormattedValue
{
+ // [AllowNull] removes warning CS8767, but allows for null input, which is undesired.
+ // The Text property is a non-nullable string and therefore null input
+ // will be converted to String.Empty.
+
get => GetEditingControlFormattedValue(DataGridViewDataErrorContexts.Formatting);
- set => Text = (string)value;
+ set => Text = value is string str && str is not null
+ ? str
+ : string.Empty;
}
///
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewIconColumn.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewIconColumn.cs
index 7879e5cc8..893eac938 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewIconColumn.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewIconColumn.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -96,7 +96,7 @@ public abstract class KryptonDataGridViewIconColumn : DataGridViewColumn, IIconC
///
protected KryptonDataGridViewIconColumn(DataGridViewCell cellTemplate)
: base(cellTemplate) =>
- IconSpecs = new List();
+ IconSpecs = [];
#endregion
@@ -106,11 +106,11 @@ protected KryptonDataGridViewIconColumn(DataGridViewCell cellTemplate)
///
public override object Clone()
{
- var cloned = base.Clone() as KryptonDataGridViewIconColumn;
+ var cloned = base.Clone() as KryptonDataGridViewIconColumn ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("cloned"));
foreach (IconSpec sp in IconSpecs)
{
- cloned.IconSpecs.Add(sp.Clone() as IconSpec);
+ cloned.IconSpecs.Add((sp.Clone() as IconSpec)!);
}
return cloned;
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewLinkCell.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewLinkCell.cs
index 8542ae912..185eb45a1 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewLinkCell.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewLinkCell.cs
@@ -5,11 +5,12 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
+// ReSharper disable InconsistentNaming
namespace Krypton.Toolkit
{
///
@@ -80,7 +81,7 @@ public LabelStyle LabelStyle
{
_labelStyle = value;
_labelStyleDefined = true;
- DataGridView.InvalidateCell(this);
+ DataGridView!.InvalidateCell(this);
}
}
}
@@ -115,7 +116,7 @@ protected override Size GetPreferredSize(Graphics graphics,
{
try
{
- var kDGV = (KryptonDataGridView)DataGridView;
+ var kDGV = DataGridView as KryptonDataGridView;
// Ensure the view classes are created and hooked up
CreateViewAndPalettes(kDGV);
@@ -126,16 +127,16 @@ protected override Size GetPreferredSize(Graphics graphics,
// Update the display text
if ((rowIndex >= 0) && !string.IsNullOrEmpty(FormattedValue?.ToString()))
{
- _shortTextValue.ShortText = FormattedValue.ToString();
+ _shortTextValue.ShortText = FormattedValue!.ToString();
}
else
{
- if ((kDGV.Columns[ColumnIndex] is KryptonDataGridViewButtonColumn
+ if ((kDGV?.Columns[ColumnIndex] is KryptonDataGridViewButtonColumn
{
UseColumnTextForButtonValue: true
} col) && !kDGV.Rows[rowIndex].IsNewRow)
{
- _shortTextValue.ShortText = col.Text;
+ _shortTextValue.ShortText = col.Text!;
}
else
{
@@ -144,7 +145,7 @@ protected override Size GetPreferredSize(Graphics graphics,
}
// Position the button element inside the available cell area
- using var layoutContext = new ViewLayoutContext(kDGV, kDGV.Renderer);
+ using var layoutContext = new ViewLayoutContext(kDGV!, kDGV?.Renderer!);
// Define the available area for layout
layoutContext.DisplayRectangle = new Rectangle(0, 0, int.MaxValue, int.MaxValue);
@@ -179,23 +180,23 @@ protected override Size GetPreferredSize(Graphics graphics,
/// A DataGridViewAdvancedBorderStyle that contains border styles for the cell that is being painted.
/// A bitwise combination of the DataGridViewPaintParts values that specifies which parts of the cell need to be painted.
protected override void Paint(Graphics graphics,
- Rectangle clipBounds,
- Rectangle cellBounds,
- int rowIndex,
- DataGridViewElementStates cellState,
- object value,
- object? formattedValue,
- string errorText,
- DataGridViewCellStyle cellStyle,
- DataGridViewAdvancedBorderStyle advancedBorderStyle,
- DataGridViewPaintParts paintParts)
+ Rectangle clipBounds,
+ Rectangle cellBounds,
+ int rowIndex,
+ DataGridViewElementStates cellState,
+ object? value,
+ object? formattedValue,
+ string? errorText,
+ DataGridViewCellStyle cellStyle,
+ DataGridViewAdvancedBorderStyle advancedBorderStyle,
+ DataGridViewPaintParts paintParts)
{
if (DataGridView is KryptonDataGridView kDgv)
{
// Should we draw the content foreground?
if ((paintParts & DataGridViewPaintParts.ContentForeground) == DataGridViewPaintParts.ContentForeground)
{
- using var renderContext = new RenderContext(kDgv, graphics, cellBounds, kDgv.Renderer);
+ using var renderContext = new RenderContext(kDgv, graphics, cellBounds, kDgv.Renderer!);
// Cache the starting cell bounds
Rectangle startBounds = cellBounds;
@@ -206,9 +207,9 @@ protected override void Paint(Graphics graphics,
SetElementStateAndPalette();
// Update the display text
- if (!string.IsNullOrEmpty(formattedValue?.ToString()))
+ if (!string.IsNullOrEmpty(formattedValue?.ToString())!)
{
- _shortTextValue.ShortText = formattedValue.ToString();
+ _shortTextValue.ShortText = formattedValue!.ToString();
}
else
{
@@ -217,7 +218,7 @@ protected override void Paint(Graphics graphics,
UseColumnTextForButtonValue: true
} col) && !kDgv.Rows[rowIndex].IsNewRow)
{
- _shortTextValue.ShortText = col.Text;
+ _shortTextValue.ShortText = col.Text!;
}
else
{
@@ -243,7 +244,7 @@ protected override void Paint(Graphics graphics,
cellBounds.Height -= cellStyle.Padding.Vertical;
// Position the button element inside the available cell area
- using (var layoutContext = new ViewLayoutContext(kDgv, kDgv.Renderer))
+ using (var layoutContext = new ViewLayoutContext(kDgv, kDgv.Renderer!))
{
// Define the available area for calculating layout
layoutContext.DisplayRectangle = cellBounds;
@@ -333,13 +334,13 @@ internal LabelStyle LabelStyleInternal
#endregion
#region Private
- private void CreateViewAndPalettes(KryptonDataGridView kDGV)
+ private void CreateViewAndPalettes(KryptonDataGridView? kDGV)
{
// Create the view element when first needed
- if (_viewLabel == null)
+ if (_viewLabel is null)
{
// Create helper object to get all values from the DGV redirector
- _palette = new PaletteContentToPalette(kDGV.Redirector, PaletteContentStyle.LabelNormalPanel);
+ _palette = new PaletteContentToPalette(kDGV!.Redirector, PaletteContentStyle.LabelNormalPanel);
_inheritBehavior = new LinkLabelBehaviorInherit(_palette, KryptonLinkBehavior.AlwaysUnderline);
_overrideVisited = new PaletteContentInheritOverride(_palette, _inheritBehavior, PaletteState.LinkNotVisitedOverride, true);
_overridePressed = new PaletteContentInheritOverride(_palette, _overrideVisited, PaletteState.LinkPressedOverride, false);
@@ -354,7 +355,7 @@ private void CreateViewAndPalettes(KryptonDataGridView kDGV)
private void SetElementStateAndPalette()
{
- LinkState linkState = LinkStateInternal;
+ LinkState? linkState = LinkStateInternal;
// Has the item been visited
_overrideVisited.OverrideState = LinkVisited ? PaletteState.LinkVisitedOverride : PaletteState.LinkNotVisitedOverride;
@@ -378,22 +379,21 @@ private void SetElementStateAndPalette()
_palette.ContentStyle = CommonHelper.ContentStyleFromLabelStyle(_labelStyle);
}
- private LinkState LinkStateInternal
+ private LinkState? LinkStateInternal
{
get
{
// Only need to cache reflection info the first time around
- if (_piLinkState == null)
+ if (_piLinkState is null)
{
// Cache access to the internal get property 'LinkState'
_piLinkState = typeof(DataGridViewLinkCell).GetProperty(nameof(LinkState), BindingFlags.Instance |
- BindingFlags.NonPublic |
- BindingFlags.GetField);
-
+ BindingFlags.NonPublic |
+ BindingFlags.GetField)!;
}
// Grab the internal property implemented by base class
- return (LinkState)_piLinkState.GetValue(this, null);
+ return (LinkState?)_piLinkState!.GetValue(this, null);
}
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewLinkColumn.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewLinkColumn.cs
index a7192fa21..d7ab9e107 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewLinkColumn.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewLinkColumn.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -62,9 +62,10 @@ public override string ToString()
public override object Clone()
{
// Create a new instance
- var clone = base.Clone() as KryptonDataGridViewLinkColumn;
+ var clone = base.Clone() as KryptonDataGridViewLinkColumn ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("clone"));
clone.Text = Text;
clone.LabelStyle = LabelStyle;
+
return clone;
}
#endregion
@@ -75,18 +76,18 @@ public override object Clone()
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public override DataGridViewCell CellTemplate
+ public override DataGridViewCell? CellTemplate
{
get => base.CellTemplate;
set
{
- if ((value != null) && value is not KryptonDataGridViewLinkCell)
+ if ((value is not null) && value is not KryptonDataGridViewLinkCell)
{
throw new InvalidCastException("Can only assign a object of type KryptonDataGridViewLinkCell");
}
- base.CellTemplate = value;
+ base.CellTemplate = value as KryptonDataGridViewLinkCell;
}
}
@@ -144,7 +145,7 @@ public LabelStyle LabelStyle
if (_labelStyle != value)
{
_labelStyle = value;
- ((KryptonDataGridViewLinkCell)CellTemplate).LabelStyleInternal = value;
+ ((KryptonDataGridViewLinkCell)CellTemplate!).LabelStyleInternal = value;
// ReSharper disable RedundantBaseQualifier
if (base.DataGridView != null)
// ReSharper restore RedundantBaseQualifier
@@ -172,12 +173,12 @@ public LabelStyle LabelStyle
public LinkBehavior LinkBehavior
{
get =>
- ((KryptonDataGridViewLinkCell)CellTemplate)?.LinkBehavior ?? throw new InvalidOperationException("KryptonDataGridViewLinkCell cell template required");
+ ((KryptonDataGridViewLinkCell)CellTemplate!)?.LinkBehavior ?? throw new InvalidOperationException("KryptonDataGridViewLinkCell cell template required");
set
{
if (!LinkBehavior.Equals(value))
{
- ((KryptonDataGridViewLinkCell)CellTemplate).LinkBehaviorInternal = value;
+ ((KryptonDataGridViewLinkCell)CellTemplate!).LinkBehaviorInternal = value;
// ReSharper disable RedundantBaseQualifier
if (base.DataGridView != null)
// ReSharper restore RedundantBaseQualifier
@@ -205,12 +206,12 @@ public LinkBehavior LinkBehavior
public bool TrackVisitedState
{
get =>
- ((KryptonDataGridViewLinkCell)CellTemplate)?.TrackVisitedState ?? throw new InvalidOperationException("KryptonDataGridViewLinkCell cell template required");
+ ((KryptonDataGridViewLinkCell)CellTemplate!)?.TrackVisitedState ?? throw new InvalidOperationException("KryptonDataGridViewLinkCell cell template required");
set
{
if (TrackVisitedState != value)
{
- TrackVisitedStateInternal(CellTemplate, value);
+ TrackVisitedStateInternal(CellTemplate!, value);
if (DataGridView != null)
{
DataGridViewRowCollection rows = DataGridView.Rows;
@@ -236,13 +237,13 @@ public bool TrackVisitedState
public bool UseColumnTextForLinkValue
{
get =>
- ((KryptonDataGridViewLinkCell)CellTemplate)?.UseColumnTextForLinkValue ?? throw new InvalidOperationException("KryptonDataGridViewLinkCell cell template required");
+ ((KryptonDataGridViewLinkCell)CellTemplate!)?.UseColumnTextForLinkValue ?? throw new InvalidOperationException("KryptonDataGridViewLinkCell cell template required");
set
{
if (UseColumnTextForLinkValue != value)
{
- SetUseColumnTextForLinkValueInternal(CellTemplate, value);
+ SetUseColumnTextForLinkValueInternal(CellTemplate!, value);
if (DataGridView != null)
{
DataGridViewRowCollection rows = DataGridView.Rows;
@@ -265,27 +266,27 @@ public bool UseColumnTextForLinkValue
private void ColumnCommonChange(int columnIndex)
{
// Only need to cache reflection info the first time around
- if (_miColumnCommonChange == null)
+ if (_miColumnCommonChange is null)
{
// Cache access to the internal method 'OnColumnCommonChange'
_miColumnCommonChange = typeof(DataGridView).GetMethod("OnColumnCommonChange", BindingFlags.Instance |
BindingFlags.NonPublic |
- BindingFlags.GetField);
+ BindingFlags.GetField)!;
}
- _miColumnCommonChange.Invoke(DataGridView, new object[] { columnIndex });
+ _miColumnCommonChange.Invoke(DataGridView, [columnIndex]);
}
private void SetUseColumnTextForLinkValueInternal(object instance, bool value)
{
// Only need to cache reflection info the first time around
- if (_piUseColumnTextForLinkValueInternal == null)
+ if (_piUseColumnTextForLinkValueInternal is null)
{
// Cache access to the internal property sette 'UseColumnTextForLinkValueInternal'
_piUseColumnTextForLinkValueInternal = typeof(DataGridViewLinkCell).GetProperty(@"UseColumnTextForLinkValueInternal", BindingFlags.Instance |
- BindingFlags.NonPublic |
- BindingFlags.SetProperty);
+ BindingFlags.NonPublic |
+ BindingFlags.SetProperty)!;
}
@@ -295,12 +296,12 @@ private void SetUseColumnTextForLinkValueInternal(object instance, bool value)
private void TrackVisitedStateInternal(object instance, bool value)
{
// Only need to cache reflection info the first time around
- if (_piTrackVisitedStateInternal == null)
+ if (_piTrackVisitedStateInternal is null)
{
// Cache access to the internal property sette 'TrackVisitedStateInternal'
_piTrackVisitedStateInternal = typeof(DataGridViewLinkCell).GetProperty(nameof(TrackVisitedStateInternal), BindingFlags.Instance |
- BindingFlags.NonPublic |
- BindingFlags.SetProperty);
+ BindingFlags.NonPublic |
+ BindingFlags.SetProperty)!;
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewMaskedTextBoxCell.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewMaskedTextBoxCell.cs
index 9902556e2..9f270990f 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewMaskedTextBoxCell.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewMaskedTextBoxCell.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -60,7 +60,7 @@ public KryptonDataGridViewMaskedTextBoxCell()
_paintingMaskedTextBox.SetLayoutDisplayPadding(new Padding(0, 0, 1, -1));
_paintingMaskedTextBox.StateCommon.Border.Width = 0;
_paintingMaskedTextBox.StateCommon.Border.Draw = InheritBool.False;
- _paintingMaskedTextBox.StateCommon.Back.Color1 = Color.Empty;
+ _paintingMaskedTextBox.StateCommon.Back.Color1 = GlobalStaticValues.EMPTY_COLOR;
}
// Set the default values of the properties:
@@ -414,7 +414,7 @@ public override object Clone()
dataGridViewCell.TextMaskFormat = TextMaskFormat;
dataGridViewCell.UseSystemPasswordChar = UseSystemPasswordChar;
}
- return dataGridViewCell;
+ return dataGridViewCell!;
}
///
@@ -424,7 +424,7 @@ public override object Clone()
[EditorBrowsable(EditorBrowsableState.Advanced)]
public override void DetachEditingControl()
{
- DataGridView dataGridView = DataGridView;
+ DataGridView? dataGridView = DataGridView;
if (dataGridView?.EditingControl == null)
{
throw new InvalidOperationException("Cell is detached or its grid has no editing control.");
@@ -450,12 +450,12 @@ public override void DetachEditingControl()
/// set according to the cell properties.
///
public override void InitializeEditingControl(int rowIndex,
- object initialFormattedValue,
+ object? initialFormattedValue,
DataGridViewCellStyle dataGridViewCellStyle)
{
base.InitializeEditingControl(rowIndex, initialFormattedValue, dataGridViewCellStyle);
- if (DataGridView.EditingControl is KryptonMaskedTextBox maskedTextBox)
+ if (DataGridView!.EditingControl is KryptonMaskedTextBox maskedTextBox)
{
maskedTextBox.PromptChar = PromptChar;
maskedTextBox.AllowPromptAsInput = AllowPromptAsInput;
@@ -473,7 +473,7 @@ public override void InitializeEditingControl(int rowIndex,
maskedTextBox.SkipLiterals = SkipLiterals;
maskedTextBox.TextMaskFormat = TextMaskFormat;
maskedTextBox.UseSystemPasswordChar = UseSystemPasswordChar;
- maskedTextBox.Text = initialFormattedValue is string initialFormattedValueStr ? initialFormattedValueStr : string.Empty;
+ maskedTextBox.Text = initialFormattedValue as string ?? string.Empty;
}
}
@@ -496,7 +496,7 @@ public override void PositionEditingControl(bool setLocation,
isFirstDisplayedColumn, isFirstDisplayedRow);
editingControlBounds = GetAdjustedEditingControlBounds(editingControlBounds, cellStyle);
- DataGridView.EditingControl.Location = new Point(editingControlBounds.X, editingControlBounds.Y);
+ DataGridView!.EditingControl!.Location = new Point(editingControlBounds.X, editingControlBounds.Y);
DataGridView.EditingControl.Size = new Size(editingControlBounds.Width, editingControlBounds.Height);
}
#endregion
@@ -508,17 +508,8 @@ public override void PositionEditingControl(bool setLocation,
///
protected override Rectangle GetErrorIconBounds(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex)
{
- const int BUTTONS_WIDTH = 16;
-
Rectangle errorIconBounds = base.GetErrorIconBounds(graphics, cellStyle, rowIndex);
- if (DataGridView.RightToLeft == RightToLeft.Yes)
- {
- errorIconBounds.X = errorIconBounds.Left + BUTTONS_WIDTH;
- }
- else
- {
- errorIconBounds.X = errorIconBounds.Left - BUTTONS_WIDTH;
- }
+ errorIconBounds.X = errorIconBounds.Left;
return errorIconBounds;
}
@@ -528,27 +519,16 @@ protected override Rectangle GetErrorIconBounds(Graphics graphics, DataGridViewC
///
protected override Size GetPreferredSize(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex, Size constraintSize)
{
- if (DataGridView == null)
- {
- return new Size(-1, -1);
- }
-
- Size preferredSize = base.GetPreferredSize(graphics, cellStyle, rowIndex, constraintSize);
- if (constraintSize.Width == 0)
- {
- const int BUTTONS_WIDTH = 16; // Account for the width of the up/down buttons.
- const int BUTTON_MARGIN = 8; // Account for some blank pixels between the text and buttons.
- preferredSize.Width += BUTTONS_WIDTH + BUTTON_MARGIN;
- }
-
- return preferredSize;
+ return DataGridView == null
+ ? new Size(-1, -1)
+ : base.GetPreferredSize(graphics, cellStyle, rowIndex, constraintSize);
}
#endregion
#region Private
- private KryptonDataGridViewMaskedTextBoxEditingControl EditingMaskedTextBox => DataGridView.EditingControl as KryptonDataGridViewMaskedTextBoxEditingControl;
+ private KryptonDataGridViewMaskedTextBoxEditingControl? EditingMaskedTextBox => DataGridView!.EditingControl as KryptonDataGridViewMaskedTextBoxEditingControl;
private Rectangle GetAdjustedEditingControlBounds(Rectangle editingControlBounds,
DataGridViewCellStyle cellStyle)
@@ -591,8 +571,8 @@ private void OnCommonChange()
}
private bool OwnsEditingMaskedTextBox(int rowIndex) =>
- rowIndex != -1
- && DataGridView is { EditingControl: KryptonDataGridViewMaskedTextBoxEditingControl control }
+ rowIndex != -1
+ && DataGridView is { EditingControl: KryptonDataGridViewMaskedTextBoxEditingControl control }
&& (rowIndex == ((IDataGridViewEditingControl)control).EditingControlRowIndex);
private static bool PartPainted(DataGridViewPaintParts paintParts, DataGridViewPaintParts paintPart) => (paintParts & paintPart) != 0;
@@ -605,7 +585,7 @@ internal void SetPromptChar(int rowIndex, char value)
_promptChar = value;
if (OwnsEditingMaskedTextBox(rowIndex))
{
- EditingMaskedTextBox.PromptChar = value;
+ EditingMaskedTextBox!.PromptChar = value;
}
}
@@ -614,7 +594,7 @@ internal void SetAllowPromptAsInput(int rowIndex, bool value)
_allowPromptAsInput = value;
if (OwnsEditingMaskedTextBox(rowIndex))
{
- EditingMaskedTextBox.AllowPromptAsInput = value;
+ EditingMaskedTextBox!.AllowPromptAsInput = value;
}
}
@@ -623,7 +603,7 @@ internal void SetAsciiOnly(int rowIndex, bool value)
_asciiOnly = value;
if (OwnsEditingMaskedTextBox(rowIndex))
{
- EditingMaskedTextBox.AsciiOnly = value;
+ EditingMaskedTextBox!.AsciiOnly = value;
}
}
@@ -632,7 +612,7 @@ internal void SetBeepOnError(int rowIndex, bool value)
_beepOnError = value;
if (OwnsEditingMaskedTextBox(rowIndex))
{
- EditingMaskedTextBox.BeepOnError = value;
+ EditingMaskedTextBox!.BeepOnError = value;
}
}
@@ -641,7 +621,7 @@ internal void SetCutCopyMaskFormat(int rowIndex, MaskFormat value)
_cutCopyMaskFormat = value;
if (OwnsEditingMaskedTextBox(rowIndex))
{
- EditingMaskedTextBox.CutCopyMaskFormat = value;
+ EditingMaskedTextBox!.CutCopyMaskFormat = value;
}
}
@@ -650,7 +630,7 @@ internal void SetHidePromptOnLeave(int rowIndex, bool value)
_hidePromptOnLeave = value;
if (OwnsEditingMaskedTextBox(rowIndex))
{
- EditingMaskedTextBox.HidePromptOnLeave = value;
+ EditingMaskedTextBox!.HidePromptOnLeave = value;
}
}
@@ -659,7 +639,7 @@ internal void SetHideSelection(int rowIndex, bool value)
_hideSelection = value;
if (OwnsEditingMaskedTextBox(rowIndex))
{
- EditingMaskedTextBox.HideSelection = value;
+ EditingMaskedTextBox!.HideSelection = value;
}
}
@@ -668,7 +648,7 @@ internal void SetInsertKeyMode(int rowIndex, InsertKeyMode value)
_insertKeyMode = value;
if (OwnsEditingMaskedTextBox(rowIndex))
{
- EditingMaskedTextBox.InsertKeyMode = value;
+ EditingMaskedTextBox!.InsertKeyMode = value;
}
}
@@ -677,7 +657,7 @@ internal void SetMask(int rowIndex, string value)
_mask = value;
if (OwnsEditingMaskedTextBox(rowIndex))
{
- EditingMaskedTextBox.Mask = value;
+ EditingMaskedTextBox!.Mask = value;
}
}
@@ -686,7 +666,7 @@ internal void SetPasswordChar(int rowIndex, char value)
_passwordChar = value;
if (OwnsEditingMaskedTextBox(rowIndex))
{
- EditingMaskedTextBox.PasswordChar = value;
+ EditingMaskedTextBox!.PasswordChar = value;
}
}
@@ -695,7 +675,7 @@ internal void SetRejectInputOnFirstFailure(int rowIndex, bool value)
_rejectInputOnFirstFailure = value;
if (OwnsEditingMaskedTextBox(rowIndex))
{
- EditingMaskedTextBox.RejectInputOnFirstFailure = value;
+ EditingMaskedTextBox!.RejectInputOnFirstFailure = value;
}
}
@@ -704,7 +684,7 @@ internal void SetResetOnPrompt(int rowIndex, bool value)
_resetOnPrompt = value;
if (OwnsEditingMaskedTextBox(rowIndex))
{
- EditingMaskedTextBox.ResetOnPrompt = value;
+ EditingMaskedTextBox!.ResetOnPrompt = value;
}
}
@@ -713,7 +693,7 @@ internal void SetResetOnSpace(int rowIndex, bool value)
_resetOnSpace = value;
if (OwnsEditingMaskedTextBox(rowIndex))
{
- EditingMaskedTextBox.ResetOnSpace = value;
+ EditingMaskedTextBox!.ResetOnSpace = value;
}
}
@@ -722,7 +702,7 @@ internal void SetSkipLiterals(int rowIndex, bool value)
_skipLiterals = value;
if (OwnsEditingMaskedTextBox(rowIndex))
{
- EditingMaskedTextBox.SkipLiterals = value;
+ EditingMaskedTextBox!.SkipLiterals = value;
}
}
@@ -731,7 +711,7 @@ internal void SetTextMaskFormat(int rowIndex, MaskFormat value)
_textMaskFormat = value;
if (OwnsEditingMaskedTextBox(rowIndex))
{
- EditingMaskedTextBox.TextMaskFormat = value;
+ EditingMaskedTextBox!.TextMaskFormat = value;
}
}
@@ -740,7 +720,7 @@ internal void SetUseSystemPasswordChar(int rowIndex, bool value)
_useSystemPasswordChar = value;
if (OwnsEditingMaskedTextBox(rowIndex))
{
- EditingMaskedTextBox.UseSystemPasswordChar = value;
+ EditingMaskedTextBox!.UseSystemPasswordChar = value;
}
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewMaskedTextBoxColumn.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewMaskedTextBoxColumn.cs
index e83e8f331..c9b8bac72 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewMaskedTextBoxColumn.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewMaskedTextBoxColumn.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -51,7 +51,7 @@ public override string ToString()
///
public override object Clone()
{
- var cloned = base.Clone() as KryptonDataGridViewMaskedTextBoxColumn;
+ var cloned = base.Clone() as KryptonDataGridViewMaskedTextBoxColumn ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("cloned"));
return cloned;
}
@@ -63,7 +63,7 @@ public override object Clone()
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public override DataGridViewCell CellTemplate
+ public override DataGridViewCell? CellTemplate
{
get => base.CellTemplate;
set
@@ -724,7 +724,7 @@ public bool UseSystemPasswordChar
///
/// Small utility function that returns the template cell as a KryptonDataGridViewMaskedTextBoxCell
///
- private KryptonDataGridViewMaskedTextBoxCell? MaskedTextBoxCellTemplate => (KryptonDataGridViewMaskedTextBoxCell)CellTemplate;
+ private KryptonDataGridViewMaskedTextBoxCell? MaskedTextBoxCellTemplate => CellTemplate as KryptonDataGridViewMaskedTextBoxCell;
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewMaskedTextBoxEditingControl.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewMaskedTextBoxEditingControl.cs
index 49f28a55a..98d0679e1 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewMaskedTextBoxEditingControl.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewMaskedTextBoxEditingControl.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,7 +20,7 @@ public class KryptonDataGridViewMaskedTextBoxEditingControl : KryptonMaskedTextB
IDataGridViewEditingControl
{
#region Instance Fields
- private DataGridView _dataGridView;
+ private DataGridView? _dataGridView;
private bool _valueChanged;
#endregion
@@ -42,7 +42,7 @@ public KryptonDataGridViewMaskedTextBoxEditingControl()
///
/// Property which caches the grid that uses this editing control
///
- public virtual DataGridView EditingControlDataGridView
+ public virtual DataGridView? EditingControlDataGridView
{
get => _dataGridView;
set => _dataGridView = value;
@@ -50,11 +50,19 @@ public virtual DataGridView EditingControlDataGridView
///
/// Property which represents the current formatted value of the editing control
+ /// Allows null as input, but null will saved as an empty string.
///
- public virtual object EditingControlFormattedValue
+ [AllowNull]
+ public virtual object EditingControlFormattedValue
{
+ // [AllowNull] removes warning CS8767, but allows for null input, which is undesired.
+ // The Text property is a non-nullable string and therefore null input
+ // will be converted to String.Empty.
+
get => GetEditingControlFormattedValue(DataGridViewDataErrorContexts.Formatting);
- set => Text = (string)value;
+ set => Text = value is string str && str is not null
+ ? str
+ : string.Empty;
}
///
@@ -220,7 +228,7 @@ private void NotifyDataGridViewOfValueChange()
if (!_valueChanged)
{
_valueChanged = true;
- _dataGridView.NotifyCurrentCellDirty(true);
+ _dataGridView?.NotifyCurrentCellDirty(true);
}
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewNumericUpDownCell.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewNumericUpDownCell.cs
index 0aa4e8870..34739a669 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewNumericUpDownCell.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewNumericUpDownCell.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -249,7 +249,7 @@ public override object Clone()
dataGridViewCell.AllowDecimals = AllowDecimals;
dataGridViewCell.TrailingZeroes = TrailingZeroes;
}
- return dataGridViewCell;
+ return dataGridViewCell!;
}
///
@@ -259,8 +259,9 @@ public override object Clone()
[EditorBrowsable(EditorBrowsableState.Advanced)]
public override void DetachEditingControl()
{
- DataGridView dataGridView = DataGridView;
- if (dataGridView?.EditingControl == null)
+ DataGridView dataGridView = DataGridView!;
+
+ if (dataGridView?.EditingControl is null)
{
throw new InvalidOperationException("Cell is detached or its grid has no editing control.");
}
@@ -285,12 +286,12 @@ public override void DetachEditingControl()
/// set according to the cell properties.
///
public override void InitializeEditingControl(int rowIndex,
- object initialFormattedValue,
+ object? initialFormattedValue,
DataGridViewCellStyle dataGridViewCellStyle)
{
base.InitializeEditingControl(rowIndex, initialFormattedValue, dataGridViewCellStyle);
- if (DataGridView.EditingControl is KryptonNumericUpDown numericUpDown)
+ if (DataGridView!.EditingControl is KryptonNumericUpDown numericUpDown)
{
numericUpDown.DecimalPlaces = DecimalPlaces;
numericUpDown.Increment = Increment;
@@ -298,7 +299,7 @@ public override void InitializeEditingControl(int rowIndex,
numericUpDown.Minimum = Minimum;
numericUpDown.ThousandsSeparator = ThousandsSeparator;
numericUpDown.Hexadecimal = Hexadecimal;
- numericUpDown.Text = initialFormattedValue is string initialFormattedValueStr ? initialFormattedValueStr : string.Empty;
+ numericUpDown.Text = initialFormattedValue as string ?? string.Empty;
}
}
@@ -343,7 +344,7 @@ public override void PositionEditingControl(bool setLocation,
isFirstDisplayedColumn, isFirstDisplayedRow);
editingControlBounds = GetAdjustedEditingControlBounds(editingControlBounds, cellStyle);
- DataGridView.EditingControl.Location = new Point(editingControlBounds.X, editingControlBounds.Y);
+ DataGridView!.EditingControl!.Location = new Point(editingControlBounds.X, editingControlBounds.Y);
DataGridView.EditingControl.Size = new Size(editingControlBounds.Width, editingControlBounds.Height);
}
#endregion
@@ -355,12 +356,8 @@ public override void PositionEditingControl(bool setLocation,
///
protected override Rectangle GetErrorIconBounds(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex)
{
- const int BUTTONS_WIDTH = 16;
-
Rectangle errorIconBounds = base.GetErrorIconBounds(graphics, cellStyle, rowIndex);
- errorIconBounds.X = DataGridView.RightToLeft == RightToLeft.Yes
- ? errorIconBounds.Left + BUTTONS_WIDTH
- : errorIconBounds.Left - BUTTONS_WIDTH;
+ errorIconBounds.X = errorIconBounds.Left;
return errorIconBounds;
}
@@ -369,11 +366,11 @@ protected override Rectangle GetErrorIconBounds(Graphics graphics, DataGridViewC
/// Customized implementation of the GetFormattedValue function in order to include the decimal and thousand separator
/// characters in the formatted representation of the cell value.
///
- protected override object GetFormattedValue(object value,
+ protected override object GetFormattedValue(object? value,
int rowIndex,
ref DataGridViewCellStyle cellStyle,
- TypeConverter valueTypeConverter,
- TypeConverter formattedValueTypeConverter,
+ TypeConverter? valueTypeConverter,
+ TypeConverter? formattedValueTypeConverter,
DataGridViewDataErrorContexts context)
{
// By default, the base implementation converts the Decimal 1234.5 into the string "1234.5"
@@ -398,7 +395,7 @@ protected override object GetFormattedValue(object value,
return formattedDecimal.ToString((ThousandsSeparator ? "N" : "F") + DecimalPlaces.ToString());
}
}
- return formattedValue;
+ return formattedValue!;
}
///
@@ -406,25 +403,14 @@ protected override object GetFormattedValue(object value,
///
protected override Size GetPreferredSize(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex, Size constraintSize)
{
- if (DataGridView == null)
- {
- return new Size(-1, -1);
- }
-
- Size preferredSize = base.GetPreferredSize(graphics, cellStyle, rowIndex, constraintSize);
- if (constraintSize.Width == 0)
- {
- const int BUTTONS_WIDTH = 16; // Account for the width of the up/down buttons.
- const int BUTTON_MARGIN = 8; // Account for some blank pixels between the text and buttons.
- preferredSize.Width += BUTTONS_WIDTH + BUTTON_MARGIN;
- }
-
- return preferredSize;
+ return DataGridView == null
+ ? new Size(-1, -1)
+ : base.GetPreferredSize(graphics, cellStyle, rowIndex, constraintSize);
}
#endregion
#region Private
- private KryptonDataGridViewNumericUpDownEditingControl EditingNumericUpDown => DataGridView.EditingControl as KryptonDataGridViewNumericUpDownEditingControl;
+ private KryptonDataGridViewNumericUpDownEditingControl? EditingNumericUpDown => DataGridView!.EditingControl as KryptonDataGridViewNumericUpDownEditingControl;
private decimal Constrain(decimal value)
{
@@ -482,7 +468,7 @@ private void OnCommonChange()
}
private bool OwnsEditingNumericUpDown(int rowIndex) =>
- rowIndex != -1 && DataGridView is { EditingControl: KryptonDataGridViewNumericUpDownEditingControl control }
+ rowIndex != -1 && DataGridView is { EditingControl: KryptonDataGridViewNumericUpDownEditingControl control }
&& (rowIndex == ((IDataGridViewEditingControl)control).EditingControlRowIndex);
private static bool PartPainted(DataGridViewPaintParts paintParts, DataGridViewPaintParts paintPart) => (paintParts & paintPart) != 0;
@@ -495,7 +481,7 @@ internal void SetAllowDecimals(int rowIndex, bool value)
_allowDecimals = value;
if (OwnsEditingNumericUpDown(rowIndex))
{
- EditingNumericUpDown.AllowDecimals = value;
+ EditingNumericUpDown!.AllowDecimals = value;
}
}
@@ -504,7 +490,7 @@ internal void SetTrailingZeroes(int rowIndex, bool value)
_trailingZeroes = value;
if (OwnsEditingNumericUpDown(rowIndex))
{
- EditingNumericUpDown.TrailingZeroes = value;
+ EditingNumericUpDown!.TrailingZeroes = value;
}
}
@@ -513,7 +499,7 @@ internal void SetDecimalPlaces(int rowIndex, int value)
_decimalPlaces = value;
if (OwnsEditingNumericUpDown(rowIndex))
{
- EditingNumericUpDown.DecimalPlaces = value;
+ EditingNumericUpDown!.DecimalPlaces = value;
}
}
@@ -522,7 +508,7 @@ internal void SetHexadecimal(int rowIndex, bool value)
_hexadecimal = value;
if (OwnsEditingNumericUpDown(rowIndex))
{
- EditingNumericUpDown.Hexadecimal = value;
+ EditingNumericUpDown!.Hexadecimal = value;
}
}
@@ -531,7 +517,7 @@ internal void SetIncrement(int rowIndex, decimal value)
_increment = value;
if (OwnsEditingNumericUpDown(rowIndex))
{
- EditingNumericUpDown.Increment = value;
+ EditingNumericUpDown!.Increment = value;
}
}
@@ -556,7 +542,7 @@ internal void SetMaximum(int rowIndex, decimal value)
if (OwnsEditingNumericUpDown(rowIndex))
{
- EditingNumericUpDown.Maximum = value;
+ EditingNumericUpDown!.Maximum = value;
}
}
@@ -581,7 +567,7 @@ internal void SetMinimum(int rowIndex, decimal value)
if (OwnsEditingNumericUpDown(rowIndex))
{
- EditingNumericUpDown.Minimum = value;
+ EditingNumericUpDown!.Minimum = value;
}
}
@@ -590,7 +576,7 @@ internal void SetThousandsSeparator(int rowIndex, bool value)
_thousandsSeparator = value;
if (OwnsEditingNumericUpDown(rowIndex))
{
- EditingNumericUpDown.ThousandsSeparator = value;
+ EditingNumericUpDown!.ThousandsSeparator = value;
}
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewNumericUpDownColumn.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewNumericUpDownColumn.cs
index b63e6262c..cb5db311e 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewNumericUpDownColumn.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewNumericUpDownColumn.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -51,7 +51,7 @@ public override string ToString()
///
public override object Clone()
{
- var cloned = base.Clone() as KryptonDataGridViewNumericUpDownColumn;
+ var cloned = base.Clone() as KryptonDataGridViewNumericUpDownColumn ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("cloned"));
return cloned;
}
@@ -63,7 +63,7 @@ public override object Clone()
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public override DataGridViewCell CellTemplate
+ public override DataGridViewCell? CellTemplate
{
get => base.CellTemplate;
set
@@ -393,7 +393,7 @@ public bool ThousandsSeparator
///
/// Small utility function that returns the template cell as a KryptonDataGridViewNumericUpDownCell
///
- private KryptonDataGridViewNumericUpDownCell? NumericUpDownCellTemplate => (KryptonDataGridViewNumericUpDownCell)CellTemplate;
+ private KryptonDataGridViewNumericUpDownCell? NumericUpDownCellTemplate => CellTemplate as KryptonDataGridViewNumericUpDownCell;
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewNumericUpDownEditingControl.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewNumericUpDownEditingControl.cs
index f6f20a870..793a5b5dd 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewNumericUpDownEditingControl.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewNumericUpDownEditingControl.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,7 +20,7 @@ public class KryptonDataGridViewNumericUpDownEditingControl : KryptonNumericUpDo
IDataGridViewEditingControl
{
#region Instance Fields
- private DataGridView _dataGridView;
+ private DataGridView? _dataGridView;
private bool _valueChanged;
#endregion
@@ -42,19 +42,27 @@ public KryptonDataGridViewNumericUpDownEditingControl()
///
/// Property which caches the grid that uses this editing control
///
- public virtual DataGridView EditingControlDataGridView
+ public virtual DataGridView? EditingControlDataGridView
{
get => _dataGridView;
- set => _dataGridView = value;
+ set => _dataGridView = value!;
}
///
/// Property which represents the current formatted value of the editing control
+ /// Allows null as input, but null will saved as an empty string.
///
- public virtual object EditingControlFormattedValue
+ [AllowNull]
+ public virtual object EditingControlFormattedValue
{
+ // [AllowNull] removes warning CS8767, but allows for null input, which is undesired.
+ // The Text property is a non-nullable string and therefore null input
+ // will be converted to String.Empty.
+
get => GetEditingControlFormattedValue(DataGridViewDataErrorContexts.Formatting);
- set => Text = (string)value;
+ set => Text = value is string str && str is not null
+ ? str
+ : string.Empty;
}
///
@@ -285,7 +293,7 @@ private void NotifyDataGridViewOfValueChange()
if (!_valueChanged)
{
_valueChanged = true;
- _dataGridView.NotifyCurrentCellDirty(true);
+ _dataGridView?.NotifyCurrentCellDirty(true);
}
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewTextBoxCell.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewTextBoxCell.cs
index 5c8d6ec8f..965ccc0d9 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewTextBoxCell.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewTextBoxCell.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -76,10 +76,10 @@ public override string ToString() =>
///
public override object Clone()
{
- var cloned = base.Clone() as KryptonDataGridViewTextBoxCell;
+ var cloned = (KryptonDataGridViewTextBoxCell)base.Clone();
foreach (IconSpec sp in IconSpecs)
{
- cloned.IconSpecs.Add(sp.Clone() as IconSpec);
+ cloned.IconSpecs.Add((IconSpec)sp.Clone());
}
cloned.Multiline = Multiline;
@@ -119,7 +119,7 @@ protected override void Dispose(bool disposing)
[EditorBrowsable(EditorBrowsableState.Advanced)]
public override void DetachEditingControl()
{
- DataGridView dataGridView = DataGridView;
+ DataGridView? dataGridView = DataGridView;
if (dataGridView?.EditingControl == null)
{
throw new InvalidOperationException("Cell is detached or its grid has no editing control.");
@@ -145,19 +145,19 @@ public override void DetachEditingControl()
/// set according to the cell properties.
///
public override void InitializeEditingControl(int rowIndex,
- object initialFormattedValue,
+ object? initialFormattedValue,
DataGridViewCellStyle dataGridViewCellStyle)
{
base.InitializeEditingControl(rowIndex, initialFormattedValue, dataGridViewCellStyle);
- if (DataGridView.EditingControl is KryptonTextBox textBox)
+ if (DataGridView!.EditingControl is KryptonTextBox textBox)
{
- textBox.Text = initialFormattedValue is not string initialFormattedValueStr ? string.Empty : initialFormattedValueStr;
+ textBox.Text = initialFormattedValue as string ?? string.Empty;
DataGridViewTriState wrapMode = Style.WrapMode;
if (wrapMode == DataGridViewTriState.NotSet)
{
- wrapMode = OwningColumn.DefaultCellStyle.WrapMode;
+ wrapMode = OwningColumn!.DefaultCellStyle.WrapMode;
}
textBox.WordWrap = textBox.Multiline = wrapMode == DataGridViewTriState.True;
@@ -198,7 +198,7 @@ public override void PositionEditingControl(bool setLocation,
isFirstDisplayedColumn, isFirstDisplayedRow);
editingControlBounds = GetAdjustedEditingControlBounds(editingControlBounds, cellStyle);
- DataGridView.EditingControl.Location = new Point(editingControlBounds.X, editingControlBounds.Y);
+ DataGridView!.EditingControl!.Location = new Point(editingControlBounds.X, editingControlBounds.Y);
DataGridView.EditingControl.Size = new Size(editingControlBounds.Width, editingControlBounds.Height);
}
#endregion
@@ -211,17 +211,8 @@ public override void PositionEditingControl(bool setLocation,
///
protected override Rectangle GetErrorIconBounds(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex)
{
- const int BUTTONS_WIDTH = 16;
-
Rectangle errorIconBounds = base.GetErrorIconBounds(graphics, cellStyle, rowIndex);
- if (DataGridView.RightToLeft == RightToLeft.Yes)
- {
- errorIconBounds.X = errorIconBounds.Left + BUTTONS_WIDTH;
- }
- else
- {
- errorIconBounds.X = errorIconBounds.Left - BUTTONS_WIDTH;
- }
+ errorIconBounds.X = errorIconBounds.Left;
return errorIconBounds;
}
@@ -231,33 +222,22 @@ protected override Rectangle GetErrorIconBounds(Graphics graphics, DataGridViewC
///
protected override Size GetPreferredSize(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex, Size constraintSize)
{
- if (DataGridView == null)
- {
- return new Size(-1, -1);
- }
-
- Size preferredSize = base.GetPreferredSize(graphics, cellStyle, rowIndex, constraintSize);
-
- if (constraintSize.Width == 0)
- {
- const int BUTTONS_WIDTH = 16; // Account for the width of the up/down buttons.
- const int BUTTON_MARGIN = 8; // Account for some blank pixels between the text and buttons.
- preferredSize.Width += BUTTONS_WIDTH + BUTTON_MARGIN;
- }
- return preferredSize;
+ return DataGridView == null
+ ? new Size(-1, -1)
+ : base.GetPreferredSize(graphics, cellStyle, rowIndex, constraintSize);
}
#endregion
#region Private
- private KryptonDataGridViewTextBoxEditingControl EditingTextBox => DataGridView.EditingControl as KryptonDataGridViewTextBoxEditingControl;
+ private KryptonDataGridViewTextBoxEditingControl? EditingTextBox => DataGridView!.EditingControl as KryptonDataGridViewTextBoxEditingControl;
private Rectangle GetAdjustedEditingControlBounds(Rectangle editingControlBounds,
DataGridViewCellStyle cellStyle)
{
// Adjust the vertical location of the editing control:
- var preferredHeight = DataGridView.EditingControl.GetPreferredSize(new Size(editingControlBounds.Width, 10000)).Height;
+ var preferredHeight = DataGridView!.EditingControl!.GetPreferredSize(new Size(editingControlBounds.Width, 10000)).Height;
if (preferredHeight < editingControlBounds.Height)
{
switch (cellStyle.Alignment)
@@ -308,7 +288,7 @@ internal void SetMultiline(int rowIndex, bool value)
_multiline = value;
if (OwnsEditingTextBox(rowIndex))
{
- EditingTextBox.Multiline = value;
+ EditingTextBox!.Multiline = value;
}
}
@@ -317,7 +297,7 @@ internal void SetMultilineStringEditor(int rowIndex, bool value)
_multilineStringEditor = value;
if (OwnsEditingTextBox(rowIndex))
{
- EditingTextBox.MultilineStringEditor = value;
+ EditingTextBox!.MultilineStringEditor = value;
}
}
#endregion
@@ -328,6 +308,6 @@ internal void SetMultilineStringEditor(int rowIndex, bool value)
[Category(@"Data")]
[Description(@"Set of extra icons to appear with control.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public List IconSpecs { get; } = new List();
+ public List IconSpecs { get; } = [];
}
}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewTextBoxColumn.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewTextBoxColumn.cs
index b989bae4d..0baa7add2 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewTextBoxColumn.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewTextBoxColumn.cs
@@ -1,11 +1,11 @@
-#region BSD License
+ #region BSD License
/*
*
* Original BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE)
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -53,10 +53,11 @@ public override string ToString()
///
public override object Clone()
{
- var cloned = base.Clone() as KryptonDataGridViewTextBoxColumn;
+ var cloned = base.Clone() as KryptonDataGridViewTextBoxColumn ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("coned"));
cloned.Multiline = Multiline;
cloned.MultilineStringEditor = MultilineStringEditor;
+
return cloned;
}
@@ -90,8 +91,9 @@ public int MaxInputLength
{
if (MaxInputLength != value)
{
- TextBoxCellTemplate.MaxInputLength = value;
- if (DataGridView != null)
+ TextBoxCellTemplate!.MaxInputLength = value;
+
+ if (DataGridView is not null)
{
DataGridViewRowCollection rows = DataGridView.Rows;
var count = rows.Count;
@@ -122,18 +124,21 @@ public int MaxInputLength
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ [AllowNull, MaybeNull]
public override DataGridViewCell CellTemplate
{
+ // base.CellTemplate can be null for getter and setter
+
get => base.CellTemplate;
set
{
- if ((value != null) && value is not KryptonDataGridViewTextBoxCell)
+ if ((value is not null) && value is not KryptonDataGridViewTextBoxCell)
{
throw new InvalidCastException("Can only assign a object of type KryptonDataGridViewTextBoxCell");
}
- base.CellTemplate = value;
+ base.CellTemplate = (KryptonDataGridViewTextBoxCell)value!;
}
}
@@ -143,18 +148,25 @@ public override DataGridViewCell CellTemplate
[Browsable(true)]
[Category(@"Appearance")]
[Description(@"DataGridView Column DefaultCell Style\r\nIf you set wrap mode, then this will ensure the DataRows are set to display the wrapped text!")]
+ [AllowNull]
public override DataGridViewCellStyle DefaultCellStyle
{
+ // base.DefaultCellStyle will take a null value and handle it.
+ // [NotNull] if the base getter encounters a null value it will always return a DefaultCellStyle
+
get => base.DefaultCellStyle;
set
{
base.DefaultCellStyle = value;
- if ((value.WrapMode != DataGridViewTriState.True)
+
+ if (value is null
+ || value.WrapMode != DataGridViewTriState.True
|| DataGridView == null)
{
return;
}
+
// https://stackoverflow.com/questions/16514352/multiple-lines-in-a-datagridview-cell/16514393
switch (DataGridView.AutoSizeRowsMode)
{
@@ -252,7 +264,7 @@ public bool MultilineStringEditor
#endregion
#region Private
- private KryptonDataGridViewTextBoxCell? TextBoxCellTemplate => (KryptonDataGridViewTextBoxCell)CellTemplate;
+ private KryptonDataGridViewTextBoxCell? TextBoxCellTemplate => CellTemplate as KryptonDataGridViewTextBoxCell;
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewTextBoxEditingControl.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewTextBoxEditingControl.cs
index 4bf74044f..559c44b5b 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewTextBoxEditingControl.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDataGridViewTextBoxEditingControl.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -50,11 +50,19 @@ public virtual DataGridView? EditingControlDataGridView
///
/// Property which represents the current formatted value of the editing control
+ /// Allows null as input, but null will saved as an empty string.
///
- public virtual object EditingControlFormattedValue
+ [AllowNull]
+ public virtual object EditingControlFormattedValue
{
+ // [AllowNull] removes warning CS8767, but allows for null input, which is undesired.
+ // The Text property is a non-nullable string and therefore null input
+ // will be converted to String.Empty.
+
get => GetEditingControlFormattedValue(DataGridViewDataErrorContexts.Formatting);
- set => Text = (string)value;
+ set => Text = value is string str && str is not null
+ ? str
+ : string.Empty;
}
///
@@ -193,7 +201,7 @@ protected override void OnTextChanged(EventArgs e)
base.OnTextChanged(e);
//if (Focused)
- NotifyDataGridViewOfValueChange();
+ NotifyDataGridViewOfValueChange();
}
///
@@ -218,7 +226,7 @@ private void NotifyDataGridViewOfValueChange()
if (!_valueChanged)
{
_valueChanged = true;
- _dataGridView.NotifyCurrentCellDirty(true);
+ _dataGridView?.NotifyCurrentCellDirty(true);
}
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDateTimePicker.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDateTimePicker.cs
index 0ec63d6b2..7e830754e 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDateTimePicker.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDateTimePicker.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -63,7 +63,7 @@ public DateTimePickerButtonSpecCollection(KryptonDateTimePicker owner)
private readonly ViewDrawDateTimeButton _buttonDown;
private readonly ViewDrawDateTimeText _drawText;
private readonly ViewLayoutCenter _layoutCheckBox;
- private readonly ButtonSpecManagerDraw _buttonManager;
+ private readonly ButtonSpecManagerDraw? _buttonManager;
private VisualPopupToolTip? _visualPopupToolTip;
private KryptonContextMenuMonthCalendar? _kmc;
private InputControlStyle _inputControlStyle;
@@ -88,7 +88,6 @@ public DateTimePickerButtonSpecCollection(KryptonDateTimePicker owner)
private bool _alwaysActive;
private bool _userSetDateTime;
private bool _dropDownMonthChanged;
- private float _cornerRoundingRadius;
private object? _rawDateTime;
private int _cachedHeight;
#endregion
@@ -208,9 +207,9 @@ public KryptonDateTimePicker()
CalendarDimensions = new Size(1, 1);
_today = DEFAULT_TODAY;
CalendarFirstDayOfWeek = Day.Default;
- _annualDates = new DateTimeList();
- _monthlyDates = new DateTimeList();
- _dates = new DateTimeList();
+ _annualDates = [];
+ _monthlyDates = [];
+ _dates = [];
// Create storage objects
ButtonSpecs = new DateTimePickerButtonSpecCollection(this);
@@ -291,10 +290,10 @@ public KryptonDateTimePicker()
// Create button specification collection manager
_buttonManager = new ButtonSpecManagerDraw(this, Redirector, ButtonSpecs, null,
- new[] { _drawDockerOuter },
- new IPaletteMetric[] { StateCommon },
- new[] { PaletteMetricInt.HeaderButtonEdgeInsetPrimary },
- new[] { PaletteMetricPadding.HeaderButtonPaddingPrimary },
+ [_drawDockerOuter],
+ [StateCommon],
+ [PaletteMetricInt.HeaderButtonEdgeInsetPrimary],
+ [PaletteMetricPadding.HeaderButtonPaddingPrimary],
CreateToolStripRenderer,
NeedPaintDelegate);
@@ -306,9 +305,6 @@ public KryptonDateTimePicker()
// Update alignment to match current RightToLeft settings
UpdateForRightToLeft();
-
- // Set `CornerRoundingRadius' to 'GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE' (-1)
- _cornerRoundingRadius = GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
}
///
@@ -323,7 +319,7 @@ protected override void Dispose(bool disposing)
OnCancelToolTip(this, EventArgs.Empty);
// Remember to pull down the manager instance
- _buttonManager.Destruct();
+ _buttonManager?.Destruct();
}
base.Dispose(disposing);
@@ -331,18 +327,6 @@ protected override void Dispose(bool disposing)
#endregion
#region Public
- /// Gets or sets the corner rounding radius.
- /// The corner rounding radius.
- [Category(@"Visuals")]
- [Description(@"Gets or sets the corner rounding radius.")]
- [DefaultValue(GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE)]
- public float CornerRoundingRadius
- {
- get => _cornerRoundingRadius;
-
- set => SetCornerRoundingRadius(value);
- }
-
///
/// Gets or sets the background color for the control.
///
@@ -364,7 +348,7 @@ public override Color BackColor
public override Font Font
{
get => base.Font;
- set => base.Font = value;
+ set => base.Font = value!;
}
///
@@ -423,6 +407,7 @@ public override string Text
[Description(@"Text used as label for todays date.")]
[DefaultValue("Today:")]
[Localizable(true)]
+ [AllowNull]
public string CalendarTodayText
{
get => _today;
@@ -486,19 +471,12 @@ public string CalendarTodayText
///
[Category(@"MonthCalendar")]
[Description(@"Today's date.")]
+ [AllowNull]
public DateTime CalendarTodayDate
{
get => _todayDate;
- set
- {
- if (value == null)
- {
- value = DateTime.Now.Date;
- }
-
- _todayDate = value;
- }
+ set => _todayDate = value == null ? DateTime.Now.Date : value;
}
private void ResetCalendarTodayDate() => CalendarTodayDate = DateTime.Now.Date;
@@ -511,7 +489,8 @@ public DateTime CalendarTodayDate
[Category(@"MonthCalendar")]
[Description(@"Indicates which annual dates should be boldface.")]
[Localizable(true)]
- public DateTime[] CalendarAnnuallyBoldedDates
+ [AllowNull]
+ public DateTime[]? CalendarAnnuallyBoldedDates
{
get => _annualDates.ToArray();
@@ -538,7 +517,8 @@ public DateTime[] CalendarAnnuallyBoldedDates
[Category(@"MonthCalendar")]
[Description(@"Indicates which monthly dates should be boldface.")]
[Localizable(true)]
- public DateTime[] CalendarMonthlyBoldedDates
+ [AllowNull]
+ public DateTime[]? CalendarMonthlyBoldedDates
{
get => _monthlyDates.ToArray();
@@ -565,7 +545,8 @@ public DateTime[] CalendarMonthlyBoldedDates
[Category(@"MonthCalendar")]
[Description(@"Indicates which dates should be boldface.")]
[Localizable(true)]
- public DateTime[] CalendarBoldedDates
+ [AllowNull]
+ public DateTime[]? CalendarBoldedDates
{
get => _dates.ToArray();
@@ -673,7 +654,12 @@ public void ResetValueNullable()
}
///
- /// Gets or sets the date/time value assigned to the control..
+ /// Sets date as the current selected date.
+ ///
+ public void SetDate(DateTime date) => Value = date;
+
+ ///
+ /// Gets or sets the date/time value assigned to the control.
///
[Category(@"Appearance")]
[Description(@"Property for the date/time.")]
@@ -704,17 +690,8 @@ public DateTime Value
}
}
}
-
- ///
- /// Should the Value property be serialized.
- ///
- /// True if property needs to be serialized.
- public bool ShouldSerializeValue() => false;
-
- ///
- /// Reset value of the Value property.
- ///
- public void ResetValue()
+ internal bool ShouldSerializeValue() => false;
+ internal void ResetValue()
{
// Setting an explicit value means the check box should be set
InternalViewDrawCheckBox.CheckState = CheckState.Checked;
@@ -834,11 +811,11 @@ public bool ShowCheckBox
[DefaultValue(true)]
public bool UseMnemonic
{
- get => _buttonManager.UseMnemonic;
+ get => _buttonManager!.UseMnemonic;
set
{
- if (_buttonManager.UseMnemonic != value)
+ if (_buttonManager!.UseMnemonic != value)
{
_buttonManager.UseMnemonic = value;
PerformNeedPaint(true);
@@ -989,7 +966,7 @@ public bool Checked
[DefaultValue("")]
[RefreshProperties(RefreshProperties.Repaint)]
[Localizable(true)]
- public string CustomFormat
+ public string? CustomFormat
{
get => _customFormat;
@@ -1086,10 +1063,10 @@ public string CustomNullText
[Category(@"Visuals - DateTimePicker")]
[Description(@"Custom palette applied to drawing.")]
[DefaultValue(null)]
- public new PaletteBase? Palette
+ public new KryptonCustomPaletteBase? LocalCustomPalette
{
- get => base.Palette;
- set => base.Palette = value;
+ get => base.LocalCustomPalette;
+ set => base.LocalCustomPalette = value;
}
///
@@ -1367,7 +1344,7 @@ public void SelectLastFragment()
///
/// Tab state.
/// Transparent Color.
- public Color GetImageTransparentColor(PaletteState state) => Color.Empty;
+ public Color GetImageTransparentColor(PaletteState state) => GlobalStaticValues.EMPTY_COLOR;
///
/// Gets the short text used as the main ribbon title.
@@ -1489,9 +1466,9 @@ public bool DesignerGetHitTest(Point pt)
/// Mouse location.
[EditorBrowsable(EditorBrowsableState.Never)]
[Browsable(false)]
- public Component DesignerComponentFromPoint(Point pt) =>
+ public Component? DesignerComponentFromPoint(Point pt) =>
// Ignore call as view builder is already destructed
- IsDisposed ? null : ViewManager.ComponentFromPoint(pt);
+ IsDisposed ? null : ViewManager?.ComponentFromPoint(pt);
// Ask the current view for a decision
///
@@ -1621,7 +1598,7 @@ protected override bool ProcessMnemonic(char charCode)
if (UseMnemonic && CanProcessMnemonic())
{
// Pass request onto the button spec manager
- if (_buttonManager.ProcessMnemonic(charCode))
+ if (_buttonManager!.ProcessMnemonic(charCode))
{
return true;
}
@@ -1718,7 +1695,7 @@ protected override void OnEnabledChanged(EventArgs e)
_drawDockerOuter.Enabled = Enabled;
// Update state to reflect change in enabled state
- _buttonManager.RefreshButtons();
+ _buttonManager?.RefreshButtons();
// Change in enabled state requires a layout and repaint
PerformNeedPaint(true);
@@ -1929,22 +1906,14 @@ protected override void OnRightToLeftChanged(EventArgs e)
///
/// Source of notification.
/// An EventArgs containing event data.
- protected override void OnButtonSpecChanged(object sender, EventArgs e)
+ protected override void OnButtonSpecChanged(object? sender, EventArgs e)
{
// Recreate all the button specs with new values
- _buttonManager.RecreateButtons();
+ _buttonManager?.RecreateButtons();
// Let base class perform standard processing
base.OnButtonSpecChanged(sender, e);
}
-
- ///
- /// Raises the Paint event.
- ///
- /// A PaintEventArgs that contains the event data.
- ///
- protected override void OnPaint(PaintEventArgs e) => base.OnPaint(e);
-
#endregion
#region Internal
@@ -1986,13 +1955,13 @@ private void UpdateStateAndPalettes()
{
// Get the correct palette settings to use
IPaletteTriple tripleState = GetTripleState();
- _drawDockerOuter.SetPalettes(tripleState.PaletteBack, tripleState.PaletteBorder);
+ _drawDockerOuter.SetPalettes(tripleState.PaletteBack, tripleState.PaletteBorder!);
// Update enabled state
_drawDockerOuter.Enabled = Enabled;
// Find the new state of the main view element
- PaletteState state = IsActive ? PaletteState.Tracking : PaletteState.Normal;
+ PaletteState state = Enabled ? (IsActive ? PaletteState.Tracking : PaletteState.Normal) : PaletteState.Disabled;
_drawDockerOuter.ElementState = state;
}
@@ -2024,7 +1993,7 @@ private void UpdateForRightToLeft()
}
}
- private void OnShowToolTip(object sender, ToolTipEventArgs e)
+ private void OnShowToolTip(object? sender, ToolTipEventArgs e)
{
if (!IsDisposed)
{
@@ -2044,7 +2013,7 @@ private void OnShowToolTip(object sender, ToolTipEventArgs e)
var shadow = true;
// Find the button spec associated with the tooltip request
- ButtonSpec? buttonSpec = _buttonManager.ButtonSpecFromView(e.Target);
+ ButtonSpec? buttonSpec = _buttonManager?.ButtonSpecFromView(e.Target);
// If the tooltip is for a button spec
if (buttonSpec != null)
@@ -2091,11 +2060,11 @@ private void OnShowToolTip(object sender, ToolTipEventArgs e)
}
}
- private void OnCheckBoxClick(object sender, EventArgs e) =>
+ private void OnCheckBoxClick(object? sender, EventArgs e) =>
// Invert the current checked state
Checked = !Checked;
- private void OnDropDownClick(object sender, EventArgs e)
+ private void OnDropDownClick(object? sender, EventArgs e)
{
// Never shown the calendar at design time
if (!InRibbonDesignMode)
@@ -2103,7 +2072,7 @@ private void OnDropDownClick(object sender, EventArgs e)
// Just in case the user is inputting characters, end it
_drawText.EndInputDigits();
- // Reset the cacheed value indicating if a date is selected in the month calendar
+ // Reset the cached value indicating if a date is selected in the month calendar
_dropDownMonthChanged = false;
// Create a new krypton context menu each time we drop the menu
@@ -2142,7 +2111,7 @@ private void OnDropDownClick(object sender, EventArgs e)
}
else
{
- kcm.Palette = Palette;
+ kcm.LocalCustomPalette = LocalCustomPalette;
}
// Give user a change to modify the context menu or even cancel the menu entirely
@@ -2199,7 +2168,7 @@ private void OnDropDownClick(object sender, EventArgs e)
_buttonDropDown.RemoveFixed();
}
- private void OnMonthCalendarDateChanged(object sender, DateRangeEventArgs e)
+ private void OnMonthCalendarDateChanged(object? sender, DateRangeEventArgs e)
{
// Use the newly selected date but the existing time
var newDt = new DateTime(e.Start.Year, e.Start.Month, e.Start.Day, _dateTime.Hour, _dateTime.Minute,
@@ -2223,10 +2192,10 @@ private void OnMonthCalendarDateChanged(object sender, DateRangeEventArgs e)
_dropDownMonthChanged = true;
}
- private void OnKryptonContextMenuClosed(object sender, EventArgs e)
+ private void OnKryptonContextMenuClosed(object? sender, EventArgs e)
{
// Must unhook from menu so it can be garbage collected
- var kcm = (KryptonContextMenu)sender;
+ var kcm = sender as KryptonContextMenu ?? throw new ArgumentNullException(nameof(sender));
kcm.Closed -= OnKryptonContextMenuClosed;
// Unhook from month calendar events
@@ -2251,7 +2220,7 @@ private void OnKryptonContextMenuClosed(object sender, EventArgs e)
kcm.Dispose();
}
- private void OnUpClick(object sender, EventArgs e)
+ private void OnUpClick(object? sender, EventArgs e)
{
// Never operate the control at design time
if (!InRibbonDesignMode)
@@ -2263,7 +2232,7 @@ private void OnUpClick(object sender, EventArgs e)
_buttonUp.RemoveFixed();
}
- private void OnDownClick(object sender, EventArgs e)
+ private void OnDownClick(object? sender, EventArgs e)
{
// Never operate the control at design time
if (!InRibbonDesignMode)
@@ -2275,27 +2244,19 @@ private void OnDownClick(object sender, EventArgs e)
_buttonDown.RemoveFixed();
}
- private void OnCancelToolTip(object sender, EventArgs e) =>
+ private void OnCancelToolTip(object? sender, EventArgs e) =>
// Remove any currently showing tooltip
_visualPopupToolTip?.Dispose();
- private void OnVisualPopupToolTipDisposed(object sender, EventArgs e)
+ private void OnVisualPopupToolTipDisposed(object? sender, EventArgs e)
{
// Unhook events from the specific instance that generated event
- var popupToolTip = (VisualPopupToolTip)sender;
- popupToolTip.Disposed -= OnVisualPopupToolTipDisposed!;
+ var popupToolTip = sender as VisualPopupToolTip ?? throw new ArgumentNullException(nameof(sender));
+ popupToolTip.Disposed -= OnVisualPopupToolTipDisposed;
// Not showing a popup page any more
_visualPopupToolTip = null;
}
-
- private void SetCornerRoundingRadius(float? radius)
- {
- _cornerRoundingRadius = radius ?? GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
- StateCommon.Border.Rounding = _cornerRoundingRadius;
- }
-
#endregion
}
@@ -2335,7 +2296,7 @@ public class DTPContextMenu : KryptonContextMenu
protected override VisualContextMenu CreateContextMenu(KryptonContextMenu kcm,
PaletteBase? palette,
PaletteMode paletteMode,
- PaletteRedirect? redirector,
+ PaletteRedirect redirector,
PaletteRedirectContextMenu redirectorImages,
KryptonContextMenuCollection items,
bool enabled,
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDomainUpDown.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDomainUpDown.cs
index 82452ef54..20ecaef01 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDomainUpDown.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDomainUpDown.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -497,7 +497,7 @@ public void Dispose()
///
/// The state for which the image is needed.
/// Color value.
- public virtual Color GetImageTransparentColor(PaletteState state) => Color.Empty;
+ public virtual Color GetImageTransparentColor(PaletteState state) => GlobalStaticValues.EMPTY_COLOR;
///
/// Gets the content long text.
@@ -632,7 +632,7 @@ private void DrawUpDownButtons(Graphics g, Rectangle clientRect)
_viewButton.ElementState = ButtonElementState(upRect);
_viewButton.Layout(layoutContext);
_viewButton.Render(renderContext);
- renderContext.Renderer.RenderGlyph.DrawInputControlNumericUpGlyph(renderContext, _viewButton.ClientRectangle, _palette.PaletteContent, _viewButton.ElementState);
+ renderContext.Renderer!.RenderGlyph.DrawInputControlNumericUpGlyph(renderContext, _viewButton.ClientRectangle, _palette.PaletteContent, _viewButton.ElementState);
// Down button
layoutContext.DisplayRectangle = downRect;
@@ -707,7 +707,6 @@ public DomainUpDownButtonSpecCollection(KryptonDomainUpDown owner)
private bool _mouseOver;
private bool _alwaysActive;
private bool _trackingMouseEnter;
- private float _cornerRoundingRadius;
private int _cachedHeight;
#endregion
@@ -849,10 +848,10 @@ public KryptonDomainUpDown()
// Create button specification collection manager
_buttonManager = new ButtonSpecManagerLayout(this, Redirector, ButtonSpecs, null,
- new[] { _drawDockerInner },
- new IPaletteMetric[] { StateCommon },
- new[] { PaletteMetricInt.HeaderButtonEdgeInsetInputControl },
- new[] { PaletteMetricPadding.HeaderButtonPaddingInputControl },
+ [_drawDockerInner],
+ [StateCommon],
+ [PaletteMetricInt.HeaderButtonEdgeInsetInputControl],
+ [PaletteMetricPadding.HeaderButtonPaddingInputControl],
CreateToolStripRenderer,
NeedPaintDelegate);
@@ -864,9 +863,6 @@ public KryptonDomainUpDown()
// Add text box to the controls collection
((KryptonReadOnlyControls)Controls).AddInternal(_domainUpDown);
-
- // Set `CornerRoundingRadius' to 'GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE' (-1)
- _cornerRoundingRadius = GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
}
///
@@ -892,18 +888,6 @@ protected override void Dispose(bool disposing)
#endregion
#region Public
- /// Gets or sets the corner rounding radius.
- /// The corner rounding radius.
- [Category(@"Visuals")]
- [Description(@"Gets or sets the corner rounding radius.")]
- [DefaultValue(GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE)]
- public float CornerRoundingRadius
- {
- get => _cornerRoundingRadius;
-
- set => SetCornerRoundingRadius(value);
- }
-
///
/// Gets and sets if the control is in the tab chain.
///
@@ -1557,7 +1541,7 @@ protected override void OnPaletteChanged(EventArgs e)
///
/// Source of notification.
/// An NeedLayoutEventArgs containing event data.
- protected override void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e)
+ protected override void OnPaletteNeedPaint(object? sender, NeedLayoutEventArgs e)
{
InvalidateChildren();
base.OnPaletteChanged(e);
@@ -1724,10 +1708,10 @@ protected override void OnNeedPaint(object? sender, NeedLayoutEventArgs e)
IPaletteTriple triple = GetTripleState();
PaletteState state = _drawDockerOuter.State;
_domainUpDown.BackColor = triple.PaletteBack.GetBackColor1(state);
- _domainUpDown.ForeColor = triple.PaletteContent.GetContentShortTextColor1(state);
+ _domainUpDown.ForeColor = triple.PaletteContent!.GetContentShortTextColor1(state);
// Only set the font if the domain up down has been created
- Font font = triple.PaletteContent.GetContentShortTextFont(state);
+ Font? font = triple.PaletteContent.GetContentShortTextFont(state);
if ((_domainUpDown.Handle != IntPtr.Zero) && !_domainUpDown.Font.Equals(font))
{
_domainUpDown.Font = font;
@@ -1865,13 +1849,13 @@ private void UpdateStateAndPalettes()
{
// Get the correct palette settings to use
IPaletteTriple tripleState = GetTripleState();
- _drawDockerOuter.SetPalettes(tripleState.PaletteBack, tripleState.PaletteBorder);
+ _drawDockerOuter.SetPalettes(tripleState.PaletteBack, tripleState.PaletteBorder!);
// Update enabled state
_drawDockerOuter.Enabled = Enabled;
// Find the new state of the main view element
- PaletteState state = IsActive ? PaletteState.Tracking : PaletteState.Normal;
+ PaletteState state = Enabled ? (IsActive ? PaletteState.Tracking : PaletteState.Normal) : PaletteState.Disabled;
_drawDockerOuter.ElementState = state;
}
@@ -1890,13 +1874,13 @@ private int PreferredHeight
}
}
- private void OnDomainUpDownTextChanged(object sender, EventArgs e) => OnTextChanged(e);
+ private void OnDomainUpDownTextChanged(object? sender, EventArgs e) => OnTextChanged(e);
- private void OnDomainUpDownScroll(object sender, ScrollEventArgs e) => OnScroll(e);
+ private void OnDomainUpDownScroll(object? sender, ScrollEventArgs e) => OnScroll(e);
- private void OnDomainUpDownSelectedItemChanged(object sender, EventArgs e) => OnSelectedItemChanged(e);
+ private void OnDomainUpDownSelectedItemChanged(object? sender, EventArgs e) => OnSelectedItemChanged(e);
- private void OnDomainUpDownGotFocus(object sender, EventArgs e)
+ private void OnDomainUpDownGotFocus(object? sender, EventArgs e)
{
UpdateStateAndPalettes();
PerformNeedPaint(true);
@@ -1904,7 +1888,7 @@ private void OnDomainUpDownGotFocus(object sender, EventArgs e)
base.OnGotFocus(e);
}
- private void OnDomainUpDownLostFocus(object sender, EventArgs e)
+ private void OnDomainUpDownLostFocus(object? sender, EventArgs e)
{
UpdateStateAndPalettes();
PerformNeedPaint(true);
@@ -1914,19 +1898,19 @@ private void OnDomainUpDownLostFocus(object sender, EventArgs e)
// ReSharper restore RedundantBaseQualifier
}
- private void OnDomainUpDownKeyPress(object sender, KeyPressEventArgs e) => OnKeyPress(e);
+ private void OnDomainUpDownKeyPress(object? sender, KeyPressEventArgs e) => OnKeyPress(e);
- private void OnDomainUpDownKeyUp(object sender, KeyEventArgs e) => OnKeyUp(e);
+ private void OnDomainUpDownKeyUp(object? sender, KeyEventArgs e) => OnKeyUp(e);
- private void OnDomainUpDownKeyDown(object sender, KeyEventArgs e) => OnKeyDown(e);
+ private void OnDomainUpDownKeyDown(object? sender, KeyEventArgs e) => OnKeyDown(e);
- private void OnDomainUpDownPreviewKeyDown(object sender, PreviewKeyDownEventArgs e) => OnPreviewKeyDown(e);
+ private void OnDomainUpDownPreviewKeyDown(object? sender, PreviewKeyDownEventArgs e) => OnPreviewKeyDown(e);
- private void OnDomainUpDownValidated(object sender, EventArgs e) => OnValidated(e);
+ private void OnDomainUpDownValidated(object? sender, EventArgs e) => OnValidated(e);
- private void OnDomainUpDownValidating(object sender, CancelEventArgs e) => OnValidating(e);
+ private void OnDomainUpDownValidating(object? sender, CancelEventArgs e) => OnValidating(e);
- private void OnShowToolTip(object sender, ToolTipEventArgs e)
+ private void OnShowToolTip(object? sender, ToolTipEventArgs e)
{
if (!IsDisposed && !Disposing)
{
@@ -1993,21 +1977,21 @@ private void OnShowToolTip(object sender, ToolTipEventArgs e)
}
}
- private void OnCancelToolTip(object sender, EventArgs e) =>
+ private void OnCancelToolTip(object? sender, EventArgs e) =>
// Remove any currently showing tooltip
_visualPopupToolTip?.Dispose();
- private void OnVisualPopupToolTipDisposed(object sender, EventArgs e)
+ private void OnVisualPopupToolTipDisposed(object? sender, EventArgs e)
{
// Unhook events from the specific instance that generated event
- var popupToolTip = (VisualPopupToolTip)sender;
+ var popupToolTip = sender as VisualPopupToolTip ?? throw new ArgumentNullException(nameof(sender));
popupToolTip.Disposed -= OnVisualPopupToolTipDisposed;
// Not showing a popup page any more
_visualPopupToolTip = null;
}
- private void OnDomainUpDownMouseChange(object sender, EventArgs e)
+ private void OnDomainUpDownMouseChange(object? sender, EventArgs e)
{
// Find new tracking mouse change state
var tracking = _domainUpDown.MouseOver ||
@@ -2033,14 +2017,6 @@ private void OnDomainUpDownMouseChange(object sender, EventArgs e)
}
}
}
-
- private void SetCornerRoundingRadius(float? radius)
- {
- _cornerRoundingRadius = radius ?? GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
- StateCommon.Border.Rounding = _cornerRoundingRadius;
- }
-
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDropButton.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDropButton.cs
index d865b3106..efdf5091e 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDropButton.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDropButton.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -637,10 +637,10 @@ protected override void OnLostFocus(EventArgs e)
protected override void OnClick(EventArgs e)
{
// Find the form this button is on
- Form owner = FindForm();
+ Form? owner = FindForm();
// If we find a valid owner
- if (owner != null)
+ if (owner is not null)
{
// Update owner with our dialog result setting
owner.DialogResult = DialogResult;
@@ -732,12 +732,12 @@ protected virtual void OnKryptonCommandChanged(EventArgs e)
///
/// Source of the event.
/// A PropertyChangedEventArgs that contains the event data.
- protected virtual void OnCommandPropertyChanged(object sender, PropertyChangedEventArgs e)
+ protected virtual void OnCommandPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
switch (e.PropertyName)
{
case nameof(Enabled):
- Enabled = KryptonCommand.Enabled;
+ Enabled = KryptonCommand!.Enabled;
break;
case nameof(Text):
case @"ExtraText":
@@ -773,9 +773,9 @@ protected virtual void SetStyles(ButtonStyle buttonStyle)
#endregion
#region Implementation
- private void OnButtonTextChanged(object sender, EventArgs e) => OnTextChanged(EventArgs.Empty);
+ private void OnButtonTextChanged(object? sender, EventArgs e) => OnTextChanged(EventArgs.Empty);
- private void OnButtonClick(object sender, MouseEventArgs e)
+ private void OnButtonClick(object? sender, MouseEventArgs e)
{
var showingContextMenu = false;
@@ -813,7 +813,7 @@ private bool ShowDropDown()
}
else
{
- KryptonContextMenu.Palette = Palette;
+ KryptonContextMenu.LocalCustomPalette = LocalCustomPalette;
}
}
@@ -895,16 +895,16 @@ private bool ShowDropDown()
_ => KryptonContextMenuPositionV.Below
};
- private void OnContextMenuClosed(object sender, EventArgs e) => ContextMenuClosed();
+ private void OnContextMenuClosed(object? sender, EventArgs e) => ContextMenuClosed();
- private void OnKryptonContextMenuClosed(object sender, EventArgs e)
+ private void OnKryptonContextMenuClosed(object? sender, EventArgs e)
{
- var kcm = (KryptonContextMenu)sender;
+ var kcm = sender as KryptonContextMenu ?? throw new ArgumentNullException(nameof(sender));
kcm.Closed -= OnKryptonContextMenuClosed;
ContextMenuClosed();
}
- private void OnButtonSelect(object sender, MouseEventArgs e)
+ private void OnButtonSelect(object? sender, MouseEventArgs e)
{
// Take the focus if allowed
if (CanFocus)
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonFolderBrowserDialog.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonFolderBrowserDialog.cs
index af09db820..27485fd9c 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonFolderBrowserDialog.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonFolderBrowserDialog.cs
@@ -2,7 +2,7 @@
/*
*
* 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. 2023 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,7 +20,7 @@ namespace Krypton.Toolkit
[ToolboxItem(true)]
public class KryptonFolderBrowserDialog : ShellDialogWrapper, IDisposable
{
-#if NET60_OR_GREATER
+#if NET6_0_OR_GREATER
private readonly FolderBrowserDialog _internalOpenFileDialog = new();// { AutoUpgradeEnabled = true };
#else
private readonly ShellBrowserDialogTFM _internalOpenFileDialog = new ShellBrowserDialogTFM();
@@ -45,7 +45,7 @@ public class KryptonFolderBrowserDialog : ShellDialogWrapper, IDisposable
// return true;
//}
-#if NET60_OR_GREATER
+#if NET6_0_OR_GREATER
///
public override Guid? ClientGuid
{
@@ -67,22 +67,22 @@ public override Guid? ClientGuid
public string SelectedPath
{
get => _internalOpenFileDialog.SelectedPath;
- set => _internalOpenFileDialog.SelectedPath = value;
+ set => _internalOpenFileDialog.SelectedPath = value!;
}
-#if NET60_OR_GREATER
+#if NET6_0_OR_GREATER
///
/// Gets or sets the initial directory displayed by the folder browser dialog.
///
[Category(@"FolderBrowsing")]
[DefaultValue("")]
- [Editor(typeof(InitialDirectoryEditor), typeof(UITypeEditor))]
+ [Editor(typeof(KryptonInitialDirectoryEditor), typeof(UITypeEditor))]
[Description(@"Gets or sets the initial directory displayed by the folder browser dialog")]
[AllowNull]
public string InitialDirectory
{
get => _internalOpenFileDialog.InitialDirectory;
- set => _internalOpenFileDialog.InitialDirectory = value;
+ set => _internalOpenFileDialog.InitialDirectory = value!;
}
#endif
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonFontDialog.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonFontDialog.cs
index 370173c73..f36eea546 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonFontDialog.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonFontDialog.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -87,13 +87,13 @@ public bool DisplayIsPrinterFontDescription
{
// internal bool GetOption(int option) => (uint) (this.options & option) > 0U;
var funcSetOption = typeof(FontDialog).GetMethod(@"GetOption", BindingFlags.NonPublic | BindingFlags.Instance);
- return (bool)funcSetOption!.Invoke(this, new object[] { 0x02 });
+ return (bool)funcSetOption!.Invoke(this, [0x02])!;
}
set
{
//internal void SetOption(int option, bool value)
var funcSetOption = typeof(FontDialog).GetMethod(@"SetOption", BindingFlags.NonPublic | BindingFlags.Instance);
- funcSetOption!.Invoke(this, new object[] { 0x02, value });
+ funcSetOption!.Invoke(this, [0x02, value]);
}
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonForm.cs
index bcca89211..e716ec76b 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonForm.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonForm.cs
@@ -5,12 +5,14 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
// ReSharper disable InconsistentNaming
+
+// ReSharper disable UnusedMember.Global
namespace Krypton.Toolkit
{
///
@@ -70,7 +72,6 @@ public FormFixedButtonSpecCollection(KryptonForm owner)
#region Instance Fields
- private readonly FormFixedButtonSpecCollection? _buttonSpecsFixed;
private readonly ButtonSpecManagerDraw _buttonManager;
private VisualPopupToolTip? _visualPopupToolTip;
private readonly ViewDrawForm _drawDocker;
@@ -95,12 +96,8 @@ public FormFixedButtonSpecCollection(KryptonForm owner)
private StatusStrip? _statusStrip;
private Bitmap? _cacheBitmap;
private Icon? _cacheIcon;
- private float _cornerRoundingRadius;
private Control? _activeControl;
private KryptonFormTitleStyle _titleStyle;
- //private IntegratedToolBarValues _integratedToolBarValues;
- //private IntegratedToolbarManager _integratedToolbarManager;
-
#endregion
#region Identity
@@ -121,16 +118,18 @@ public KryptonForm()
_recreateButtons = true;
_firstCheckView = true;
_lastNotNormal = false;
+ // Yes, we want to be drawn double buffered by default
+ base.DoubleBuffered = true;
// Create storage objects
ButtonSpecs = new FormButtonSpecCollection(this);
- _buttonSpecsFixed = new FormFixedButtonSpecCollection(this);
+ var buttonSpecsFixed = new FormFixedButtonSpecCollection(this);
// Add the fixed set of window form buttons
ButtonSpecMin = new ButtonSpecFormWindowMin(this);
ButtonSpecMax = new ButtonSpecFormWindowMax(this);
ButtonSpecClose = new ButtonSpecFormWindowClose(this);
- _buttonSpecsFixed.AddRange(new ButtonSpecFormFixed[] { ButtonSpecMin, ButtonSpecMax, ButtonSpecClose });
+ buttonSpecsFixed.AddRange([ButtonSpecMin, ButtonSpecMax, ButtonSpecClose]);
// Create the palette storage
StateCommon = new PaletteFormRedirect(Redirector, NeedPaintDelegate);
@@ -145,7 +144,6 @@ public KryptonForm()
PaletteMetricPadding.None,
VisualOrientation.Top)
{
-
// We need the border drawn before content to allow any injected elements
// such as the application button for the ribbon to draw over borders.
ForceBorderFirst = true
@@ -160,6 +158,13 @@ public KryptonForm()
// Create a null element that takes up all remaining space
_layoutNull = new ViewLayoutNull();
+ //// Create the internal panel used for containing content
+ //Panel = new KryptonPanel(this, StateCommon, StateDisabled, StateNormal, OnPanelPaint!)
+ //{
+ // // Make sure the panel back style always mimics our back style
+ // PanelBackStyle = PaletteBackStyle.ControlClient
+ //};
+ //_layoutFill = new ViewLayoutFill(Panel); // TODO For the Panel in a form
// Create the root element that contains the title bar and null filler
_drawDocker = new ViewDrawForm(StateActive.Back, StateActive.Border)
@@ -169,11 +174,11 @@ public KryptonForm()
};
// Create button specification collection manager
- _buttonManager = new ButtonSpecManagerDraw(this, Redirector, ButtonSpecs, _buttonSpecsFixed,
- new[] { _drawHeading },
- new IPaletteMetric[] { StateCommon.Header },
- new[] { PaletteMetricInt.HeaderButtonEdgeInsetForm },
- new[] { PaletteMetricPadding.HeaderButtonPaddingForm },
+ _buttonManager = new ButtonSpecManagerDraw(this, Redirector, ButtonSpecs, buttonSpecsFixed,
+ [_drawHeading],
+ [StateCommon.Header],
+ [PaletteMetricInt.HeaderButtonEdgeInsetForm],
+ [PaletteMetricPadding.HeaderButtonPaddingForm],
CreateToolStripRenderer,
OnButtonManagerNeedPaint!);
@@ -184,21 +189,19 @@ public KryptonForm()
_buttonManager.ToolTipManager = ToolTipManager;
// Hook into global static events
- KryptonManager.GlobalAllowFormChromeChanged += OnGlobalAllowFormChromeChanged;
+ KryptonManager.GlobalUseThemeFormChromeBorderWidthChanged += OnGlobalUseThemeFormChromeBorderWidthChanged;
KryptonManager.GlobalPaletteChanged += OnGlobalPaletteChanged;
// Create the view manager instance
ViewManager = new ViewManager(this, _drawDocker);
- // Set the CornerRoundingRadius to 'GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE', default value
- _cornerRoundingRadius = GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
_titleStyle = KryptonFormTitleStyle.Inherit;
// Disable 'UseDropShadow' on creation
#pragma warning disable CS0618
_useDropShadow = false;
#pragma warning restore CS0618
+ TransparencyKey = Color.Magenta; // Bug #1749
}
///
@@ -217,7 +220,7 @@ protected override void Dispose(bool disposing)
// Unhook from the global static events
KryptonManager.GlobalPaletteChanged -= OnGlobalPaletteChanged;
- KryptonManager.GlobalAllowFormChromeChanged -= OnGlobalAllowFormChromeChanged;
+ KryptonManager.GlobalUseThemeFormChromeBorderWidthChanged -= OnGlobalUseThemeFormChromeBorderWidthChanged;
// Clear down the cached bitmap
if (_cacheBitmap != null)
@@ -268,7 +271,7 @@ public string? TextExtra
[Category(@"Visuals")]
[Description(@"Should custom chrome be allowed for this KryptonForm instance.")]
[DefaultValue(true)]
- public bool AllowFormChrome
+ public new bool UseThemeFormChromeBorderWidth
{
get => _allowFormChrome;
set
@@ -276,9 +279,14 @@ public bool AllowFormChrome
if (_allowFormChrome != value)
{
_allowFormChrome = value;
+ if (StateCommon!.Border is PaletteFormBorder formBorder)
+ {
+ formBorder.UseThemeFormChromeBorderWidth = value;
+ }
// Do we want to switch on/off the custom chrome?
- UpdateCustomChromeDecision();
+ UpdateUseThemeFormChromeBorderWidthDecision();
+ RecalcNonClient();
}
}
}
@@ -345,9 +353,7 @@ public PaletteRelativeAlign FormTitleAlign
}
}
}
-
private bool ShouldSerializeFormTitleAlign() => _formTitleAlign != PaletteRelativeAlign.Near;
-
private void ResetFormTitleAlign() => _formTitleAlign = PaletteRelativeAlign.Near;
///
@@ -524,7 +530,7 @@ public void InjectViewElement([DisallowNull] ViewBase element, ViewDockStyle sty
else
{
// Just add to the docking edge requested
- _drawHeading.Add(element, style);
+ _drawHeading.Add(element!, style);
}
}
}
@@ -605,16 +611,6 @@ public FormWindowState GetWindowState()
}
}
- /// Gets or sets the corner rounding radius.
- /// The corner rounding radius.
- [DefaultValue(GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE),
- Description(@"Defines the corner roundness on the current window (-1 is the default look).")]
- public float CornerRoundingRadius
- {
- get => _cornerRoundingRadius;
- set => SetCornerRoundingRadius(value);
- }
-
/// Gets or sets the active control on the container control.
[DefaultValue(null),
Description(@"Defines an active control for this window.")]
@@ -639,79 +635,9 @@ public float CornerRoundingRadius
Description(@"Arranges the current window title alignment.")]
public KryptonFormTitleStyle TitleStyle { get => _titleStyle; set { _titleStyle = value; UpdateTitleStyle(value); } }
- /*/// Gets or sets the integrated tool bar values.
- /// The integrated tool bar values.
- [Category(@"Visuals")]
- [Description(@"Handles the integrated toolbar.")]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public IntegratedToolBarValues IntegratedToolBarValues
- {
- [DebuggerStepThrough]
- get => _integratedToolBarValues;
-
- set
- {
- _integratedToolBarValues = value;
-
- _integratedToolbarManager = new IntegratedToolbarManager(this, _integratedToolBarValues);
- }
- }
-
- private bool ShouldSerializeIntegratedToolBarValues() => !_integratedToolBarValues.IsDefault;
-
- /// Resets the integrated tool bar values.
- public void ResetIntegratedToolBarValues() => _integratedToolBarValues.Reset();*/
-
#endregion
#region Public Chrome
- ///
- /// Perform layout on behalf of the composition element using our root element.
- ///
- /// Layout context.
- /// Rectangle for composition element.
- public override void WindowChromeCompositionLayout(ViewLayoutContext context,
- Rectangle compRect)
- {
- // Update buttons so the min/max/close and custom button
- // specs have visible states set to the correct values. For
- // the form level buttons this means they are hidden.
- _buttonManager.RefreshButtons(true);
-
- // Tell the content to draw itself on a composition surface
- _drawContent.DrawContentOnComposition = true;
- _drawContent.Glowing = true;
-
- // Update the fixed header area to that provided
- _headingFixedSize.FixedSize = new Size(compRect.Height, compRect.Height);
-
- // Perform actual layout of the element tree
- ViewManager?.Layout(context);
- }
-
- ///
- /// Perform painting on behalf of the composition element using our root element.
- ///
- /// Rendering context.
- public override void WindowChromeCompositionPaint(RenderContext context)
- {
- // We do not draw background of form or header
- _drawDocker.DrawCanvas = false;
- _drawHeading.DrawCanvas = false;
-
- ViewManager?.Paint(context);
- }
-
- ///
- /// Raises the event.
- ///
- /// A that contains the event data.
- protected override void OnPaint(PaintEventArgs e)
- {
- StateCommon.Border.Rounding = CornerRoundingRadius;
-
- base.OnPaint(e);
- }
///
/// Gets a value indicating if the provided point is inside the minimize button.
@@ -820,7 +746,7 @@ protected override void OnPaint(PaintEventArgs e)
/// Transparent Color.
public Color GetImageTransparentColor(PaletteState state) =>
// We never mark any color as transparent
- Color.Empty;
+ GlobalStaticValues.EMPTY_COLOR;
///
/// Gets the short text used as the main caption title.
@@ -849,7 +775,7 @@ internal class FormPaletteRedirect : PaletteRedirect
{
private readonly KryptonForm _kryptonForm;
- public FormPaletteRedirect(PaletteBase? palette, KryptonForm kryptonForm)
+ public FormPaletteRedirect(PaletteBase palette, KryptonForm kryptonForm)
: base(palette) =>
_kryptonForm = kryptonForm;
@@ -898,7 +824,7 @@ protected override void OnControlRemoved(ControlEventArgs e)
if (_statusStrip == e.Control)
{
// Unhook from status strip events
- UnmonitorStatusStrip();
+ UnMonitorStatusStrip();
// Recalc to test if status strip should be unintegrated
RecalcNonClient();
@@ -916,7 +842,7 @@ protected override void OnLoad(EventArgs e)
base.OnLoad(e);
// We only apply custom chrome when control is already created and positioned
- UpdateCustomChromeDecision();
+ UpdateUseThemeFormChromeBorderWidthDecision();
}
///
@@ -935,7 +861,7 @@ protected override void OnTextChanged(EventArgs e)
/// Source of notification.
/// An EventArgs containing event data.
///
- protected override void OnButtonSpecChanged(object sender, [DisallowNull] EventArgs e)
+ protected override void OnButtonSpecChanged(object? sender, [DisallowNull] EventArgs e)
{
Debug.Assert(e != null);
@@ -972,11 +898,7 @@ protected override void OnWindowActiveChanged()
_drawHeading.Enabled = WindowActive;
_drawContent.Enabled = WindowActive;
- // Only need to redraw if showing custom chrome
- if (ApplyCustomChrome)
- {
- PerformNeedPaint(false);
- }
+ PerformNeedPaint(false);
base.OnWindowActiveChanged();
}
@@ -991,17 +913,17 @@ protected override void OnPaletteChanged(EventArgs e)
base.OnPaletteChanged(e);
// Test if we need to change the custom chrome usage
- UpdateCustomChromeDecision();
+ UpdateUseThemeFormChromeBorderWidthDecision();
}
///
- /// Occurs when the AllowFormChromeChanged event is fired for the current palette.
+ /// Occurs when the UseThemeFormChromeBorderWidthChanged event is fired for the current palette.
///
/// Source of the event.
/// An EventArgs containing the event data.
- protected override void OnAllowFormChromeChanged(object sender, EventArgs e) =>
+ protected override void OnUseThemeFormChromeBorderWidthChanged(object? sender, EventArgs e) =>
// Test if we need to change the custom chrome usage
- UpdateCustomChromeDecision();
+ UpdateUseThemeFormChromeBorderWidthDecision();
#endregion
@@ -1039,9 +961,8 @@ protected override void WindowChromeEnd()
/// Perform hit testing.
///
/// Point in window coordinates.
- /// Are we performing composition.
///
- protected override IntPtr WindowChromeHitTest(Point pt, bool composition)
+ protected override IntPtr WindowChromeHitTest(Point pt)
{
Point originalPt = pt;
if (CustomCaptionArea.Contains(pt))
@@ -1049,22 +970,19 @@ protected override IntPtr WindowChromeHitTest(Point pt, bool composition)
return new IntPtr(PI.HT.CAPTION);
}
- if (!composition)
+ // Is the mouse over any of the min/max/close buttons?
+ if (_buttonManager.GetButtonRectangle(ButtonSpecMin).Contains(pt)
+ || _buttonManager.GetButtonRectangle(ButtonSpecMax).Contains(pt)
+ || _buttonManager.GetButtonRectangle(ButtonSpecClose).Contains(pt))
{
- // Is the mouse over any of the min/max/close buttons?
- if (_buttonManager.GetButtonRectangle(ButtonSpecMin).Contains(pt)
- || _buttonManager.GetButtonRectangle(ButtonSpecMax).Contains(pt)
- || _buttonManager.GetButtonRectangle(ButtonSpecClose).Contains(pt))
- {
- // Get the mouse controller for this button
- ViewBase? viewBase = ViewManager?.Root?.ViewFromPoint(pt);
- IMouseController? controller = viewBase?.FindMouseController();
+ // Get the mouse controller for this button
+ ViewBase? viewBase = ViewManager?.Root.ViewFromPoint(pt);
+ IMouseController? controller = viewBase?.FindMouseController();
- // Ensure the button shows as 'normal' state when mouse not over and pressed
- if (controller is ButtonController buttonController)
- {
- buttonController.NonClientAsNormal = true;
- }
+ // Ensure the button shows as 'normal' state when mouse not over and pressed
+ if (controller is ButtonController buttonController)
+ {
+ buttonController.NonClientAsNormal = true;
}
}
@@ -1087,19 +1005,7 @@ protected override IntPtr WindowChromeHitTest(Point pt, bool composition)
}
}
- var borders = FormBorderStyle switch
- {
- FormBorderStyle.None
- or FormBorderStyle.Fixed3D
- or FormBorderStyle.FixedDialog
- or FormBorderStyle.FixedSingle
- or FormBorderStyle.FixedToolWindow => Padding.Empty,
-
- _ => WindowState == FormWindowState.Maximized
- ? Padding.Empty
- : RealWindowBorders // When maximized we do not have any borders around the client
- };
-
+ Padding borders = RealWindowBorders;
// Restrict the top border to the same size as the left as we are using
// the values for the size of the border hit testing for resizing the window
// and not the size of the border for drawing purposes.
@@ -1109,7 +1015,7 @@ or FormBorderStyle.FixedSingle
}
// Get the elements that contains the mouse point
- ViewBase? mouseView = ViewManager?.Root?.ViewFromPoint(pt);
+ ViewBase? mouseView = ViewManager?.Root.ViewFromPoint(pt);
// Scan up the view hierarchy until a recognized element is found
while (mouseView != null)
@@ -1179,7 +1085,7 @@ or FormBorderStyle.FixedSingle
mouseView = mouseView.Parent;
}
- return base.WindowChromeHitTest(originalPt, composition);
+ return base.WindowChromeHitTest(originalPt);
}
///
@@ -1210,12 +1116,6 @@ protected override bool OnWM_NCLBUTTONDOWN(ref Message m)
// Convert to window coordinates
Point windowPoint = ScreenToWindow(screenPoint);
- // In composition we need to adjust for the left window border
- if (ApplyComposition)
- {
- windowPoint.X -= RealWindowBorders.Left;
- }
-
// Is the mouse over the Application icon image area
if (_drawContent.ImageRectangle(context).Contains(windowPoint))
{
@@ -1304,34 +1204,41 @@ private void SetHeaderStyle(ViewDrawDocker drawDocker,
PaletteMetricInt.HeaderButtonEdgeInsetDockInactive,
PaletteMetricPadding.HeaderButtonPaddingDockInactive);
break;
+
case HeaderStyle.Form:
_buttonManager.SetDockerMetrics(drawDocker, palette,
PaletteMetricInt.HeaderButtonEdgeInsetForm,
PaletteMetricPadding.HeaderButtonPaddingForm);
break;
+
case HeaderStyle.Calendar:
_buttonManager.SetDockerMetrics(drawDocker, palette,
PaletteMetricInt.HeaderButtonEdgeInsetCalendar,
PaletteMetricPadding.HeaderButtonPaddingCalendar);
break;
+
case HeaderStyle.Custom1:
_buttonManager.SetDockerMetrics(drawDocker, palette,
PaletteMetricInt.HeaderButtonEdgeInsetCustom1,
PaletteMetricPadding.HeaderButtonPaddingCustom1);
break;
+
case HeaderStyle.Custom2:
_buttonManager.SetDockerMetrics(drawDocker, palette,
PaletteMetricInt.HeaderButtonEdgeInsetCustom2,
PaletteMetricPadding.HeaderButtonPaddingCustom2);
break;
+
case HeaderStyle.Custom3:
_buttonManager.SetDockerMetrics(drawDocker, palette,
PaletteMetricInt.HeaderButtonEdgeInsetCustom3,
PaletteMetricPadding.HeaderButtonPaddingCustom3);
break;
+
default:
// Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(style.ToString());
break;
}
}
@@ -1370,7 +1277,7 @@ private bool CheckViewLayout()
if (_headerStyle != _headerStylePrev)
{
// Ensure the header style matches the form border style
- SetHeaderStyle(_drawHeading, StateCommon.Header, _headerStyle);
+ SetHeaderStyle(_drawHeading, StateCommon!.Header, _headerStyle);
// Remember last header style set
_headerStylePrev = _headerStyle;
@@ -1380,10 +1287,6 @@ private bool CheckViewLayout()
Padding windowBorders = RealWindowBorders;
_headingFixedSize.FixedSize = new Size(windowBorders.Top, windowBorders.Top);
- // The content is definitely not being drawn on a composition
- _drawContent.DrawContentOnComposition = false;
- _drawContent.Glowing = false;
-
// A change in window state since last time requires a layout
if (_lastWindowState != GetWindowState())
{
@@ -1445,7 +1348,7 @@ private bool CheckViewLayout()
// Track the window state at the time the region is created
_regionWindowState = WindowState;
- // Get the path for the border so we can shape the form using it
+ // Get the path for the border, so we can shape the form using it
using var context = new RenderContext(this, null, Bounds, Renderer);
using GraphicsPath? path = _drawDocker.GetOuterBorderPath(context);
if (!_firstCheckView)
@@ -1478,10 +1381,16 @@ private void PerformViewPaint(Graphics g, Rectangle rect)
{
// If we notice we have become maximized but the layout has not updated for
// the maximized state then we need to update the region ourself right now
- if ((GetWindowState() == FormWindowState.Maximized) &&
- (_regionWindowState != FormWindowState.Maximized))
+ if (GetWindowState() == FormWindowState.Maximized)
+ {
+ if (_regionWindowState != FormWindowState.Maximized)
+ {
+ UpdateRegionForMaximized();
+ }
+ }
+ else
{
- UpdateRegionForMaximized();
+ g.FillRectangle(Brushes.Magenta, rect); // Bug #1749
}
// We draw the main form and header background
@@ -1536,22 +1445,26 @@ private void UpdateBorderRegion(Region? newRegion)
oldRegion?.Dispose();
}
- private void UpdateCustomChromeDecision()
+ private bool _hasUseThemeFormChromeBorderWidthFirstRun;
+ private void UpdateUseThemeFormChromeBorderWidthDecision()
{
if (IsHandleCreated)
{
// Decide if we should have custom chrome applied
- var needChrome = AllowFormChrome &&
- KryptonManager.AllowFormChrome &&
- (GetResolvedPalette().GetAllowFormChrome() == InheritBool.True);
+ var needChrome = UseThemeFormChromeBorderWidth &&
+ KryptonManager.UseThemeFormChromeBorderWidth &&
+ (GetResolvedPalette().UseThemeFormChromeBorderWidth == InheritBool.True);
// Is there a change in custom chrome requirement?
- if (ApplyCustomChrome != needChrome)
+ if (UseThemeFormChromeBorderWidth != needChrome
+ || !_hasUseThemeFormChromeBorderWidthFirstRun)
{
+ _hasUseThemeFormChromeBorderWidthFirstRun = true;
_recreateButtons = true;
_firstCheckView = true;
- ApplyCustomChrome = needChrome;
- PerformNeedPaint(needChrome);
+ UseThemeFormChromeBorderWidth = needChrome;
+ base.UseThemeFormChromeBorderWidth = true; // make sure "Form" buttons are drawn correctly
+ PerformNeedPaint(true); // Force Layout size change
}
}
}
@@ -1567,7 +1480,7 @@ private void MonitorStatusStrip(StatusStrip statusStrip)
{
if (_statusStrip != null)
{
- UnmonitorStatusStrip();
+ UnMonitorStatusStrip();
}
// Hook into event handlers
@@ -1576,7 +1489,7 @@ private void MonitorStatusStrip(StatusStrip statusStrip)
_statusStrip.DockChanged += OnStatusDockChanged;
}
- private void UnmonitorStatusStrip()
+ private void UnMonitorStatusStrip()
{
if (_statusStrip != null)
{
@@ -1587,7 +1500,7 @@ private void UnmonitorStatusStrip()
}
}
- private void OnShowToolTip(object sender, ToolTipEventArgs e)
+ private void OnShowToolTip(object? sender, ToolTipEventArgs e)
{
if (!IsDisposed)
{
@@ -1615,7 +1528,7 @@ private void OnShowToolTip(object sender, ToolTipEventArgs e)
if (AllowButtonSpecToolTips)
{
// Create a helper object to provide tooltip values
- var buttonSpecMapping = new ButtonSpecToContent(Redirector!, buttonSpec);
+ var buttonSpecMapping = new ButtonSpecToContent(Redirector, buttonSpec);
// Is there actually anything to show for the tooltip
if (buttonSpecMapping.HasContent)
@@ -1650,17 +1563,17 @@ private void OnShowToolTip(object sender, ToolTipEventArgs e)
}
}
- private void OnCancelToolTip(object sender, EventArgs e) =>
+ private void OnCancelToolTip(object? sender, EventArgs e) =>
// Remove any currently showing tooltip
_visualPopupToolTip?.Dispose();
- private void OnVisualPopupToolTipDisposed(object sender, EventArgs e)
+ private void OnVisualPopupToolTipDisposed(object? sender, EventArgs e)
{
// Unhook events from the specific instance that generated event
- var popupToolTip = (VisualPopupToolTip)sender;
+ var popupToolTip = sender as VisualPopupToolTip ?? throw new ArgumentNullException(nameof(sender));
popupToolTip.Disposed -= OnVisualPopupToolTipDisposed;
- // Not showing a popup page any more
+ // Not showing a popup page anymore
_visualPopupToolTip = null;
}
@@ -1692,7 +1605,7 @@ private void OnButtonManagerNeedPaint(object sender, NeedLayoutEventArgs e)
OnNeedPaint(sender, e);
}
- private void OnStatusDockChanged(object sender, EventArgs e)
+ private void OnStatusDockChanged(object? sender, EventArgs e)
{
if (StatusStripMerging)
{
@@ -1700,7 +1613,7 @@ private void OnStatusDockChanged(object sender, EventArgs e)
}
}
- private void OnStatusVisibleChanged(object sender, EventArgs e)
+ private void OnStatusVisibleChanged(object? sender, EventArgs e)
{
if (StatusStripMerging)
{
@@ -1708,14 +1621,14 @@ private void OnStatusVisibleChanged(object sender, EventArgs e)
}
}
- private void OnGlobalAllowFormChromeChanged(object sender, EventArgs e) => UpdateCustomChromeDecision();
+ private void OnGlobalUseThemeFormChromeBorderWidthChanged(object? sender, EventArgs e) => UpdateUseThemeFormChromeBorderWidthDecision();
- private void OnGlobalPaletteChanged(object sender, EventArgs e)
+ private void OnGlobalPaletteChanged(object? sender, EventArgs e)
{
// We only care if we are using the global palette
if (PaletteMode == PaletteMode.Global)
{
- UpdateCustomChromeDecision();
+ UpdateUseThemeFormChromeBorderWidthDecision();
}
}
@@ -1736,21 +1649,13 @@ private void UpdateTitleStyle(KryptonFormTitleStyle titleStyle)
break;
}
}
-
- private void SetCornerRoundingRadius(float? radius)
- {
- _cornerRoundingRadius = radius ?? GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
- StateCommon.Border.Rounding = _cornerRoundingRadius;
- }
-
#endregion
#region Drop Shadow Methods
///
/// Calls the method that draws the drop shadow around the form.
///
- /// Use dropshadow user input value.
+ /// Use drop shadow user input value.
public void UpdateDropShadowDraw(bool useDropShadow)
{
if (useDropShadow)
@@ -1849,8 +1754,8 @@ public static bool GetHasCurrentInstanceGotAdministrativeRights()
/// if set to true [value].
public static void SetIsInAdministratorMode(bool value)
{
- // TODO: @wagnerp: what is this supposed to be doing ?
- var form = new KryptonForm();
+ //// TODO: @wagnerp: what is this supposed to be doing ?
+ //var form = new KryptonForm();
//form.IsInAdministratorMode = value;
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonGroup.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonGroup.cs
index 38d5da514..f695f554a 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonGroup.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonGroup.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -31,7 +31,6 @@ public class KryptonGroup : VisualControlContainment
private readonly ViewLayoutFill _layoutFill;
private bool _forcedLayout;
private bool _layingOut;
- private float _cornerRoundingRadius;
#endregion
@@ -73,25 +72,10 @@ public KryptonGroup()
// Add panel to the controls collection
((KryptonReadOnlyControls)Controls).AddInternal(Panel);
-
- _cornerRoundingRadius = GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
}
#endregion
#region Public
-
- /// Gets or sets the corner rounding radius.
- /// The corner rounding radius.
- [Category(@"Visuals")]
- [Description(@"Gets or sets the corner rounding radius.")]
- [DefaultValue(GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE)]
- public float CornerRoundingRadius
- {
- get => _cornerRoundingRadius;
-
- set => SetCornerRoundingRadius(value);
- }
-
///
/// Gets and sets the name of the control.
///
@@ -226,7 +210,7 @@ public PaletteBackStyle GroupBackStyle
[Category(@"Visuals")]
[Description(@"Overrides for defining common group appearance that other states can override.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public PaletteDoubleRedirect? StateCommon { get; }
+ public PaletteDoubleRedirect StateCommon { get; }
private bool ShouldSerializeStateCommon() => !StateCommon.IsDefault;
@@ -238,7 +222,7 @@ public PaletteBackStyle GroupBackStyle
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public PaletteDouble? StateDisabled { get; }
- private bool ShouldSerializeStateDisabled() => !StateDisabled.IsDefault;
+ private bool ShouldSerializeStateDisabled() => !StateDisabled!.IsDefault;
///
/// Gets access to the normal group appearance entries.
@@ -248,7 +232,7 @@ public PaletteBackStyle GroupBackStyle
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public PaletteDouble? StateNormal { get; }
- private bool ShouldSerializeStateNormal() => !StateNormal.IsDefault;
+ private bool ShouldSerializeStateNormal() => !StateNormal!.IsDefault;
///
/// Get the preferred size of the control based on a proposed size.
@@ -317,7 +301,7 @@ public virtual void SetFixedState(PaletteState state)
{
// Request fixed state from the view
_drawDocker.FixedState = state;
- Panel.SetFixedState(state);
+ Panel?.SetFixedState(state);
}
#endregion
@@ -384,11 +368,11 @@ protected override void OnEnabledChanged(EventArgs e)
// Push correct palettes into the view
if (Enabled)
{
- _drawDocker.SetPalettes(StateNormal.Back, StateNormal.Border);
+ _drawDocker.SetPalettes(StateNormal!.Back, StateNormal.Border);
}
else
{
- _drawDocker.SetPalettes(StateDisabled.Back, StateDisabled.Border);
+ _drawDocker.SetPalettes(StateDisabled!.Back, StateDisabled.Border);
}
_drawDocker.Enabled = Enabled;
@@ -430,7 +414,7 @@ protected override void OnLayout(LayoutEventArgs levent)
if (IsInitialized || _forcedLayout || (DesignMode && (Panel != null)))
{
Rectangle fillRect = _layoutFill.FillRect;
- Panel.SetBounds(fillRect.X, fillRect.Y, fillRect.Width, fillRect.Height);
+ Panel?.SetBounds(fillRect.X, fillRect.Y, fillRect.Width, fillRect.Height);
}
_layingOut = false;
@@ -447,7 +431,7 @@ protected override void OnNeedPaint(object? sender, NeedLayoutEventArgs e)
{
// As the contained group panel is using our palette storage
// we also need to pass on any paint request to it as well
- Panel.PerformNeedPaint(e.NeedLayout);
+ Panel?.PerformNeedPaint(e.NeedLayout);
}
else
{
@@ -459,7 +443,7 @@ protected override void OnNeedPaint(object? sender, NeedLayoutEventArgs e)
#endregion
#region Implementation
- private void OnGroupPanelPaint(object sender, NeedLayoutEventArgs e)
+ private void OnGroupPanelPaint(object? sender, NeedLayoutEventArgs e)
{
// If the child panel is layout out but not because we are, then it must be
// laying out because a child has changed visibility/size/etc. If we are an
@@ -469,14 +453,6 @@ private void OnGroupPanelPaint(object sender, NeedLayoutEventArgs e)
PerformNeedPaint(true);
}
}
-
- private void SetCornerRoundingRadius(float? radius)
- {
- _cornerRoundingRadius = radius ?? GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
- StateCommon.Border.Rounding = _cornerRoundingRadius;
- }
-
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonGroupBox.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonGroupBox.cs
index 7878c5c2d..590a60fe4 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonGroupBox.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonGroupBox.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -32,13 +32,12 @@ public class KryptonGroupBox : VisualControlContainment
private readonly ViewDrawGroupBoxDocker _drawDocker;
private readonly ViewDrawContent _drawContent;
private readonly ViewLayoutFill _layoutFill;
- private ScreenObscurer _obscurer;
+ private ScreenObscurer? _obscurer;
private readonly EventHandler? _removeObscurer;
private bool _forcedLayout;
private bool _captionVisible;
private readonly bool _ignoreLayout;
private bool _layingOut;
- private float _cornerRoundingRadius;
#endregion
#region Identity
@@ -67,7 +66,6 @@ public KryptonGroupBox()
// Create the internal panel used for containing content
Panel = new KryptonGroupBoxPanel(this, StateCommon, StateDisabled, StateNormal, OnGroupPanelPaint!)
{
-
// Make sure the panel back style always mimics our back style
PanelBackStyle = PaletteBackStyle.ControlGroupBox
};
@@ -104,8 +102,6 @@ public KryptonGroupBox()
((KryptonReadOnlyControls)Controls).AddInternal(Panel);
_ignoreLayout = false;
-
- _cornerRoundingRadius = GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
}
///
@@ -125,7 +121,10 @@ protected override void Dispose(bool disposing)
_obscurer.Dispose();
_obscurer = null!;
}
- catch { }
+ catch
+ {
+ // Ignored
+ }
}
}
@@ -134,19 +133,6 @@ protected override void Dispose(bool disposing)
#endregion
#region Public
-
- /// Gets or sets the corner rounding radius.
- /// The corner rounding radius.
- [Category(@"Visuals")]
- [Description(@"Gets or sets the corner rounding radius.")]
- [DefaultValue(GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE)]
- public float CornerRoundingRadius
- {
- get => _cornerRoundingRadius;
-
- set => SetCornerRoundingRadius(value);
- }
-
///
/// Gets and sets the name of the control.
///
@@ -247,7 +233,7 @@ public override string Text
[Category(@"Appearance")]
[Description(@"The internal panel that contains group content.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public KryptonGroupBoxPanel? Panel { get; }
+ public KryptonGroupBoxPanel Panel { get; }
///
/// Gets and the sets the percentage of overlap for the caption and group area.
@@ -262,9 +248,8 @@ public double CaptionOverlap
set
{
- if (_drawDocker.CaptionOverlap != value)
+ if ( _drawDocker.CaptionOverlap != value)
{
-
// Enforce limits on the value between 0 and 1 (0% and 100%)
value = Math.Max(Math.Min(value, 1.0), 0.0);
_drawDocker.CaptionOverlap = value;
@@ -481,7 +466,7 @@ public bool CaptionVisible
[Category(@"Visuals")]
[Description(@"Overrides for defining common header group appearance that other states can override.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public PaletteGroupBoxRedirect? StateCommon { get; }
+ public PaletteGroupBoxRedirect StateCommon { get; }
private bool ShouldSerializeStateCommon() => !StateCommon.IsDefault;
@@ -493,7 +478,7 @@ public bool CaptionVisible
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public PaletteGroupBox? StateDisabled { get; }
- private bool ShouldSerializeStateDisabled() => !StateDisabled.IsDefault;
+ private bool ShouldSerializeStateDisabled() => !StateDisabled!.IsDefault;
///
/// Gets access to the normal header group appearance entries.
@@ -503,7 +488,7 @@ public bool CaptionVisible
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public PaletteGroupBox? StateNormal { get; }
- private bool ShouldSerializeStateNormal() => !StateNormal.IsDefault;
+ private bool ShouldSerializeStateNormal() => !StateNormal!.IsDefault;
///
/// Gets access to the caption content.
@@ -686,13 +671,13 @@ protected override void OnEnabledChanged(EventArgs e)
// Push correct palettes into the view
if (Enabled)
{
- _drawContent.SetPalette(StateNormal.Content);
+ _drawContent.SetPalette(StateNormal!.Content);
_drawDocker.SetPalettes(StateNormal.Back, StateNormal.Border);
}
else
{
- _drawContent.SetPalette(StateDisabled.Content);
- _drawDocker.SetPalettes(StateDisabled.Back, StateNormal.Border);
+ _drawContent.SetPalette(StateDisabled!.Content);
+ _drawDocker.SetPalettes(StateDisabled.Back, StateNormal!.Border);
}
_drawContent.Enabled = Enabled;
@@ -769,7 +754,7 @@ protected override void WndProc(ref Message m)
}
case PI.WM_.WINDOWPOSCHANGED:
// Uncover from the covered area
- _obscurer.Uncover();
+ _obscurer?.Uncover();
break;
}
@@ -790,9 +775,9 @@ protected override void WndProc(ref Message m)
#endregion
#region Implementation
- private void OnRemoveObscurer(object sender, EventArgs e) => _obscurer.Uncover();
+ private void OnRemoveObscurer(object? sender, EventArgs e) => _obscurer?.Uncover();
- private void OnValuesTextChanged(object sender, EventArgs e) => OnTextChanged(EventArgs.Empty);
+ private void OnValuesTextChanged(object? sender, EventArgs e) => OnTextChanged(EventArgs.Empty);
private void OnGroupPanelPaint(object sender, NeedLayoutEventArgs e)
{
@@ -806,14 +791,6 @@ private void OnGroupPanelPaint(object sender, NeedLayoutEventArgs e)
}
private void ReapplyVisible() => _drawContent.Visible = _captionVisible;
-
- private void SetCornerRoundingRadius(float? radius)
- {
- _cornerRoundingRadius = radius ?? GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
- StateCommon.Border.Rounding = _cornerRoundingRadius;
- }
-
#endregion
#region Implementation Static
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonGroupBoxPanel.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonGroupBoxPanel.cs
index c4fcd950a..b2030f208 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonGroupBoxPanel.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonGroupBoxPanel.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonGroupPanel.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonGroupPanel.cs
index 439723ad6..9b654b32c 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonGroupPanel.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonGroupPanel.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -110,7 +110,7 @@ public KryptonGroupPanel(Control alignControl,
ViewDrawPanel.SetPalettes(Enabled ? _forcedNormal : _forcedDisabled);
// Make sure the alignment of the group panel is as that of the parent
- ViewManager.AlignControl = alignControl;
+ ViewManager!.AlignControl = alignControl;
}
#endregion
@@ -315,7 +315,7 @@ public override DockStyle Dock
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new PaletteBase Palette
+ public new PaletteBase? Palette
{
get => base.Palette;
set => base.Palette = value;
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonHeader.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonHeader.cs
index fb0b983ba..abffc144e 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonHeader.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonHeader.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -49,8 +49,7 @@ public HeaderButtonSpecCollection(KryptonHeader owner)
private VisualOrientation _orientation;
private readonly ViewDrawDocker _drawDocker;
private readonly ViewDrawContent _drawContent;
- private readonly ButtonSpecManagerDraw _buttonManager;
- private float _cornerRoundingRadius;
+ private readonly ButtonSpecManagerDraw? _buttonManager;
private VisualPopupToolTip? _visualPopupToolTip;
#endregion
@@ -90,10 +89,10 @@ public KryptonHeader()
// Create button specification collection manager
_buttonManager = new ButtonSpecManagerDraw(this, Redirector, ButtonSpecs, null,
- new[] { _drawDocker },
- new IPaletteMetric[] { StateCommon },
- new[] { PaletteMetricInt.HeaderButtonEdgeInsetPrimary },
- new[] { PaletteMetricPadding.HeaderButtonPaddingPrimary },
+ [_drawDocker],
+ [StateCommon],
+ [PaletteMetricInt.HeaderButtonEdgeInsetPrimary],
+ [PaletteMetricPadding.HeaderButtonPaddingPrimary],
CreateToolStripRenderer,
NeedPaintDelegate);
@@ -106,8 +105,6 @@ public KryptonHeader()
// We want to be auto sized by default, but not the property default!
AutoSize = true;
AutoSizeMode = AutoSizeMode.GrowAndShrink;
-
- _cornerRoundingRadius = GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
}
///
@@ -122,7 +119,7 @@ protected override void Dispose(bool disposing)
OnCancelToolTip(this, EventArgs.Empty);
// Remember to pull down the manager instance
- _buttonManager.Destruct();
+ _buttonManager?.Destruct();
}
base.Dispose(disposing);
@@ -130,19 +127,6 @@ protected override void Dispose(bool disposing)
#endregion
#region Public
-
- /// Gets or sets the corner rounding radius.
- /// The corner rounding radius.
- [Category(@"Visuals")]
- [Description(@"Gets or sets the corner rounding radius.")]
- [DefaultValue(GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE)]
- public float CornerRoundingRadius
- {
- get => _cornerRoundingRadius;
-
- set => SetCornerRoundingRadius(value);
- }
-
///
/// Gets and sets the automatic resize of the control to fit contents.
///
@@ -223,7 +207,7 @@ public virtual VisualOrientation Orientation
// Update the associated visual elements that are effected
_drawDocker.Orientation = value;
_drawContent.Orientation = value;
- _buttonManager.RecreateButtons();
+ _buttonManager?.RecreateButtons();
PerformNeedPaint(true);
}
@@ -238,11 +222,11 @@ public virtual VisualOrientation Orientation
[DefaultValue(true)]
public bool UseMnemonic
{
- get => _buttonManager.UseMnemonic;
+ get => _buttonManager!.UseMnemonic;
set
{
- if (_buttonManager.UseMnemonic != value)
+ if (_buttonManager!.UseMnemonic != value)
{
_buttonManager.UseMnemonic = value;
PerformNeedPaint(true);
@@ -295,53 +279,38 @@ public HeaderStyle HeaderStyle
switch (_style)
{
case HeaderStyle.Primary:
- _buttonManager.SetDockerMetrics(_drawDocker, StateCommon,
+ _buttonManager?.SetDockerMetrics(_drawDocker, StateCommon,
PaletteMetricInt.HeaderButtonEdgeInsetPrimary,
PaletteMetricPadding.HeaderButtonPaddingPrimary);
break;
case HeaderStyle.Secondary:
- _buttonManager.SetDockerMetrics(_drawDocker, StateCommon,
- PaletteMetricInt.HeaderButtonEdgeInsetSecondary,
- PaletteMetricPadding.HeaderButtonPaddingSecondary);
+ _buttonManager?.SetDockerMetrics(_drawDocker, StateCommon, PaletteMetricInt.HeaderButtonEdgeInsetSecondary, PaletteMetricPadding.HeaderButtonPaddingSecondary);
break;
case HeaderStyle.DockActive:
- _buttonManager.SetDockerMetrics(_drawDocker, StateCommon,
- PaletteMetricInt.HeaderButtonEdgeInsetDockActive,
- PaletteMetricPadding.HeaderButtonPaddingDockActive);
+ _buttonManager?.SetDockerMetrics(_drawDocker, StateCommon, PaletteMetricInt.HeaderButtonEdgeInsetDockActive, PaletteMetricPadding.HeaderButtonPaddingDockActive);
break;
case HeaderStyle.DockInactive:
- _buttonManager.SetDockerMetrics(_drawDocker, StateCommon,
- PaletteMetricInt.HeaderButtonEdgeInsetDockInactive,
- PaletteMetricPadding.HeaderButtonPaddingDockInactive);
+ _buttonManager?.SetDockerMetrics(_drawDocker, StateCommon, PaletteMetricInt.HeaderButtonEdgeInsetDockInactive, PaletteMetricPadding.HeaderButtonPaddingDockInactive);
break;
case HeaderStyle.Form:
- _buttonManager.SetDockerMetrics(_drawDocker, StateCommon,
- PaletteMetricInt.HeaderButtonEdgeInsetForm,
- PaletteMetricPadding.HeaderButtonPaddingForm);
+ _buttonManager?.SetDockerMetrics(_drawDocker, StateCommon, PaletteMetricInt.HeaderButtonEdgeInsetForm, PaletteMetricPadding.HeaderButtonPaddingForm);
break;
case HeaderStyle.Calendar:
- _buttonManager.SetDockerMetrics(_drawDocker, StateCommon,
- PaletteMetricInt.HeaderButtonEdgeInsetCalendar,
- PaletteMetricPadding.HeaderButtonPaddingCalendar);
+ _buttonManager?.SetDockerMetrics(_drawDocker, StateCommon, PaletteMetricInt.HeaderButtonEdgeInsetCalendar, PaletteMetricPadding.HeaderButtonPaddingCalendar);
break;
case HeaderStyle.Custom1:
- _buttonManager.SetDockerMetrics(_drawDocker, StateCommon,
- PaletteMetricInt.HeaderButtonEdgeInsetCustom1,
- PaletteMetricPadding.HeaderButtonPaddingCustom1);
+ _buttonManager?.SetDockerMetrics(_drawDocker, StateCommon, PaletteMetricInt.HeaderButtonEdgeInsetCustom1, PaletteMetricPadding.HeaderButtonPaddingCustom1);
break;
case HeaderStyle.Custom2:
- _buttonManager.SetDockerMetrics(_drawDocker, StateCommon,
- PaletteMetricInt.HeaderButtonEdgeInsetCustom2,
- PaletteMetricPadding.HeaderButtonPaddingCustom2);
+ _buttonManager?.SetDockerMetrics(_drawDocker, StateCommon, PaletteMetricInt.HeaderButtonEdgeInsetCustom2, PaletteMetricPadding.HeaderButtonPaddingCustom2);
break;
case HeaderStyle.Custom3:
- _buttonManager.SetDockerMetrics(_drawDocker, StateCommon,
- PaletteMetricInt.HeaderButtonEdgeInsetCustom3,
- PaletteMetricPadding.HeaderButtonPaddingCustom3);
+ _buttonManager?.SetDockerMetrics(_drawDocker, StateCommon, PaletteMetricInt.HeaderButtonEdgeInsetCustom3, PaletteMetricPadding.HeaderButtonPaddingCustom3);
break;
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(_style.ToString());
break;
}
@@ -433,9 +402,9 @@ public bool DesignerGetHitTest(Point pt)
/// Mouse location.
[EditorBrowsable(EditorBrowsableState.Never)]
[Browsable(false)]
- public Component DesignerComponentFromPoint(Point pt) =>
+ public Component? DesignerComponentFromPoint(Point pt) =>
// Ignore call as view builder is already destructed
- IsDisposed ? null : ViewManager.ComponentFromPoint(pt);
+ IsDisposed ? null : ViewManager?.ComponentFromPoint(pt);
// Ask the current view for a decision
///
@@ -463,7 +432,7 @@ protected override bool ProcessMnemonic(char charCode)
if (UseMnemonic && CanProcessMnemonic())
{
// Pass request onto the button spec manager
- if (_buttonManager.ProcessMnemonic(charCode))
+ if (_buttonManager!.ProcessMnemonic(charCode))
{
return true;
}
@@ -483,19 +452,19 @@ protected override void OnEnabledChanged(EventArgs e)
if (Enabled)
{
_drawDocker.SetPalettes(StateNormal.Back, StateNormal.Border);
- _drawContent.SetPalette(StateNormal.Content);
+ _drawContent?.SetPalette(StateNormal.Content);
}
else
{
_drawDocker.SetPalettes(StateDisabled.Back, StateDisabled.Border);
- _drawContent.SetPalette(StateDisabled.Content);
+ _drawContent?.SetPalette(StateDisabled.Content);
}
_drawDocker.Enabled = Enabled;
- _drawContent.Enabled = Enabled;
+ _drawContent!.Enabled = Enabled;
// Update state to reflect change in enabled state
- _buttonManager.RefreshButtons();
+ _buttonManager?.RefreshButtons();
// Change in enabled state requires a layout and repaint
PerformNeedPaint(true);
@@ -514,10 +483,10 @@ protected override void OnEnabledChanged(EventArgs e)
///
/// Source of notification.
/// An EventArgs containing event data.
- protected override void OnButtonSpecChanged(object sender, EventArgs e)
+ protected override void OnButtonSpecChanged(object? sender, EventArgs e)
{
// Recreate all the button specs with new values
- _buttonManager.RecreateButtons();
+ _buttonManager?.RecreateButtons();
// Let base class perform standard processing
base.OnButtonSpecChanged(sender, e);
@@ -525,14 +494,14 @@ protected override void OnButtonSpecChanged(object sender, EventArgs e)
#endregion
#region Implementation
- private void OnHeaderTextChanged(object sender, EventArgs e) => OnTextChanged(EventArgs.Empty);
+ private void OnHeaderTextChanged(object? sender, EventArgs e) => OnTextChanged(EventArgs.Empty);
- private void OnShowToolTip(object sender, ToolTipEventArgs e)
+ private void OnShowToolTip(object? sender, ToolTipEventArgs e)
{
if (!IsDisposed)
{
// Do not show tooltips when the form we are in does not have focus
- Form topForm = FindForm();
+ Form? topForm = FindForm();
if (topForm is { ContainsFocus: false })
{
return;
@@ -547,7 +516,7 @@ private void OnShowToolTip(object sender, ToolTipEventArgs e)
var shadow = true;
// Find the button spec associated with the tooltip request
- ButtonSpec buttonSpec = _buttonManager.ButtonSpecFromView(e.Target);
+ ButtonSpec? buttonSpec = _buttonManager?.ButtonSpecFromView(e.Target);
// If the tooltip is for a button spec
if (buttonSpec != null)
@@ -587,34 +556,26 @@ private void OnShowToolTip(object sender, ToolTipEventArgs e)
CommonHelper.ContentStyleFromLabelStyle(toolTipStyle),
shadow);
- _visualPopupToolTip.Disposed += OnVisualPopupToolTipDisposed!;
- _visualPopupToolTip.ShowRelativeTo(e.Target, e.ControlMousePosition);
+ _visualPopupToolTip.Disposed += OnVisualPopupToolTipDisposed;
+ _visualPopupToolTip?.ShowRelativeTo(e.Target, e.ControlMousePosition);
}
}
}
}
- private void OnCancelToolTip(object sender, EventArgs e) =>
+ private void OnCancelToolTip(object? sender, EventArgs e) =>
// Remove any currently showing tooltip
_visualPopupToolTip?.Dispose();
- private void OnVisualPopupToolTipDisposed(object sender, EventArgs e)
+ private void OnVisualPopupToolTipDisposed(object? sender, EventArgs e)
{
// Unhook events from the specific instance that generated event
- var popupToolTip = (VisualPopupToolTip)sender;
- popupToolTip.Disposed -= OnVisualPopupToolTipDisposed!;
+ var popupToolTip = sender as VisualPopupToolTip ?? throw new ArgumentNullException(nameof(sender));
+ popupToolTip.Disposed -= OnVisualPopupToolTipDisposed;
// Not showing a popup page any more
_visualPopupToolTip = null;
}
-
- private void SetCornerRoundingRadius(float? radius)
- {
- _cornerRoundingRadius = radius ?? GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
- StateCommon.Border.Rounding = _cornerRoundingRadius;
- }
-
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonHeaderGroup.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonHeaderGroup.cs
index 660fe465c..d9d670957 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonHeaderGroup.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonHeaderGroup.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -67,10 +67,6 @@ public HeaderGroupButtonSpecCollection(KryptonHeaderGroup owner)
private bool _collapsed;
private readonly bool _ignoreLayout;
private bool _layingOut;
- private float _cornerRoundingRadius;
- private float _headerPrimaryCornerRoundingRadius;
- private float _headerSecondaryCornerRoundingRadius;
-
#endregion
#region Events
@@ -119,7 +115,6 @@ public KryptonHeaderGroup()
// Create the internal panel used for containing content
Panel = new KryptonGroupPanel(this, StateCommon, StateDisabled, StateNormal, OnGroupPanelPaint!)
{
-
// Make sure the panel back style always mimics our back style
PanelBackStyle = PaletteBackStyle.ControlClient
};
@@ -150,7 +145,6 @@ public KryptonHeaderGroup()
_drawDocker = new ViewDrawDocker(StateNormal.Back, StateNormal.Border, StateNormal,
PaletteMetricBool.HeaderGroupOverlay)
{
-
// Layout child view on top of the border space
IgnoreBorderSpace = true,
@@ -171,10 +165,10 @@ public KryptonHeaderGroup()
// Create button specification collection manager
_buttonManager = new ButtonSpecManagerDraw(this, Redirector, ButtonSpecs, null,
- new[] { _drawHeading1, _drawHeading2 },
- new IPaletteMetric[] { StateCommon.HeaderPrimary, StateCommon.HeaderSecondary },
- new[] { PaletteMetricInt.HeaderButtonEdgeInsetPrimary, PaletteMetricInt.HeaderButtonEdgeInsetSecondary },
- new[] { PaletteMetricPadding.HeaderButtonPaddingPrimary, PaletteMetricPadding.HeaderButtonPaddingSecondary },
+ [_drawHeading1, _drawHeading2],
+ [StateCommon.HeaderPrimary, StateCommon.HeaderSecondary],
+ [PaletteMetricInt.HeaderButtonEdgeInsetPrimary, PaletteMetricInt.HeaderButtonEdgeInsetSecondary],
+ [PaletteMetricPadding.HeaderButtonPaddingPrimary, PaletteMetricPadding.HeaderButtonPaddingSecondary],
CreateToolStripRenderer,
NeedPaintDelegate);
@@ -201,12 +195,6 @@ public KryptonHeaderGroup()
((KryptonReadOnlyControls)Controls).AddInternal(Panel);
_ignoreLayout = false;
-
- _cornerRoundingRadius = GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
- _headerPrimaryCornerRoundingRadius = GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
- _headerSecondaryCornerRoundingRadius = GlobalStaticValues.SECONDARY_CORNER_ROUNDING_VALUE;
}
///
@@ -244,43 +232,6 @@ protected override void Dispose(bool disposing)
#endregion
#region Public
-
- /// Gets or sets the corner rounding radius.
- /// The corner rounding radius.
- [Category(@"Visuals")]
- [Description(@"Gets or sets the corner rounding radius.")]
- [DefaultValue(GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE)]
- public float CornerRoundingRadius
- {
- get => _cornerRoundingRadius;
-
- set => SetCornerRoundingRadius(value);
- }
-
- /// Gets or sets the header primary corner rounding radius.
- /// The header primary corner rounding radius.
- [Category(@"Visuals")]
- [Description(@"Gets or sets the header primary corner rounding radius.")]
- [DefaultValue(GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE)]
- public float HeaderPrimaryCornerRoundingRadius
- {
- get => _headerPrimaryCornerRoundingRadius;
-
- set => SetHeaderPrimaryCornerRoundingRadius(value);
- }
-
- /// Gets or sets the header secondary corner rounding radius.
- /// The header secondary corner rounding radius.
- [Category(@"Visuals")]
- [Description(@"Gets or sets the corner rounding radius.")]
- [DefaultValue(GlobalStaticValues.SECONDARY_CORNER_ROUNDING_VALUE)]
- public float HeaderSecondaryCornerRoundingRadius
- {
- get => _headerSecondaryCornerRoundingRadius;
-
- set => SetHeaderSecondaryCornerRoundingRadius(value);
- }
-
///
/// Gets and sets the name of the control.
///
@@ -401,7 +352,7 @@ public bool UseMnemonic
[Category(@"Appearance")]
[Description(@"The internal panel that contains group content.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public KryptonGroupPanel? Panel { get; }
+ public KryptonGroupPanel Panel { get; }
///
/// Gets or sets a value indicating if collapsed mode is auto toggled by arrow button specs.
@@ -849,7 +800,7 @@ public void DesignerMouseLeave() =>
///
protected void ForceControlLayout()
{
- // Usually the layout will not occur if currently initializing but
+ // Usually the layout will not occur if currently initializing, but
// we need to force the layout processing because otherwise the size
// of the panel controls will not have been calculated when controls
// are added to the panels. That would then cause problems with
@@ -925,17 +876,14 @@ protected override void OnLayout(LayoutEventArgs levent)
// Only use layout logic if control is fully initialized or if being forced
// to allow a relayout or if in design mode.
- if (Panel != null)
+ if (IsInitialized || _forcedLayout || DesignMode )
{
- if (IsInitialized || _forcedLayout || DesignMode )
- {
- Rectangle fillRect = _layoutFill.FillRect;
+ Rectangle fillRect = _layoutFill.FillRect;
- Panel.SetBounds(fillRect.X,
- fillRect.Y,
- fillRect.Width,
- fillRect.Height);
- }
+ Panel.SetBounds(fillRect.X,
+ fillRect.Y,
+ fillRect.Width,
+ fillRect.Height);
}
}
@@ -1079,7 +1027,7 @@ protected override void WndProc(ref Message m)
// Just in case the WM_WINDOWPOSCHANGED does not occur we can
// ensure the obscurer is removed using this async delegate call
- BeginInvoke(_removeObscurer);
+ BeginInvoke(_removeObscurer!);
break;
}
case PI.WM_.WINDOWPOSCHANGED:
@@ -1096,7 +1044,7 @@ protected override void WndProc(ref Message m)
///
/// Source of notification.
/// An EventArgs containing event data.
- protected override void OnButtonSpecChanged(object sender, EventArgs e)
+ protected override void OnButtonSpecChanged(object? sender, EventArgs e)
{
// Recreate all the button specs with new values
_buttonManager.RecreateButtons();
@@ -1107,11 +1055,11 @@ protected override void OnButtonSpecChanged(object sender, EventArgs e)
#endregion
#region Implementation
- private void OnRemoveObscurer(object sender, EventArgs e) => _obscurer?.Uncover();
+ private void OnRemoveObscurer(object? sender, EventArgs e) => _obscurer?.Uncover();
- private void OnHeaderGroupTextChanged(object sender, EventArgs e) => OnTextChanged(EventArgs.Empty);
+ private void OnHeaderGroupTextChanged(object? sender, EventArgs e) => OnTextChanged(EventArgs.Empty);
- private void OnShowToolTip(object sender, ToolTipEventArgs e)
+ private void OnShowToolTip(object? sender, ToolTipEventArgs e)
{
if (!IsDisposed)
{
@@ -1179,32 +1127,29 @@ private void OnShowToolTip(object sender, ToolTipEventArgs e)
}
// Remove any currently showing tooltip
- private void OnCancelToolTip(object sender, EventArgs e) => _visualPopupToolTip?.Dispose();
+ private void OnCancelToolTip(object? sender, EventArgs e) => _visualPopupToolTip?.Dispose();
- private void OnVisualPopupToolTipDisposed(object sender, EventArgs e)
+ private void OnVisualPopupToolTipDisposed(object? sender, EventArgs e)
{
// Unhook events from the specific instance that generated event
- var popupToolTip = (VisualPopupToolTip)sender;
+ var popupToolTip = sender as VisualPopupToolTip ?? throw new ArgumentNullException(nameof(sender));
popupToolTip.Disposed -= OnVisualPopupToolTipDisposed;
- // Not showing a popup page any more
+ // Not showing a popup page anymore
_visualPopupToolTip = null;
}
// Monitor the button spec being clicked
- private void OnButtonSpecInserted(object sender, ButtonSpecEventArgs e) => e.ButtonSpec.Click += OnButtonSpecClicked;
+ private void OnButtonSpecInserted(object? sender, ButtonSpecEventArgs e) => e.ButtonSpec.Click += OnButtonSpecClicked;
// Unhook from monitoring the button spec
- private void OnButtonSpecRemoved(object sender, ButtonSpecEventArgs e) => e.ButtonSpec.Click -= OnButtonSpecClicked;
+ private void OnButtonSpecRemoved(object? sender, ButtonSpecEventArgs e) => e.ButtonSpec.Click -= OnButtonSpecClicked;
- private void OnButtonSpecClicked(object sender, EventArgs e)
+ private void OnButtonSpecClicked(object? sender, EventArgs e)
{
// Do we need to automatically switch collapsed modes?
- if (AutoCollapseArrow)
+ if (AutoCollapseArrow && sender is ButtonSpecHeaderGroup buttonSpec)
{
- // Cast to correct type
- var buttonSpec = (ButtonSpecHeaderGroup)sender;
-
// Action depends on the arrow
switch (buttonSpec.Type)
{
@@ -1322,8 +1267,9 @@ private void SetHeaderStyle(ViewDrawDocker drawDocker,
PaletteMetricPadding.HeaderButtonPaddingCustom3);
break;
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(style.ToString());
break;
}
}
@@ -1353,8 +1299,9 @@ private void ReapplyVisible()
secondaryVisible = true;
break;
default:
- // Should never happen!
+ // Should never happen!
Debug.Assert(false);
+ DebugTools.NotImplemented(CollapseTarget.ToString());
break;
}
}
@@ -1362,28 +1309,6 @@ private void ReapplyVisible()
_drawHeading1.Visible = primaryVisible;
_drawHeading2.Visible = secondaryVisible;
}
-
- private void SetCornerRoundingRadius(float? radius)
- {
- _cornerRoundingRadius = radius ?? GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
- StateCommon.Border.Rounding = _cornerRoundingRadius;
- }
-
- private void SetHeaderPrimaryCornerRoundingRadius(float? radius)
- {
- _headerPrimaryCornerRoundingRadius = radius ?? GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
- StateCommon.Border.Rounding = _headerPrimaryCornerRoundingRadius;
- }
-
- private void SetHeaderSecondaryCornerRoundingRadius(float? radius)
- {
- _headerSecondaryCornerRoundingRadius = radius ?? GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
- StateCommon.Border.Rounding = _headerSecondaryCornerRoundingRadius;
- }
-
#endregion
#region Implementation Static
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonHelpCommand.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonHelpCommand.cs
index 5dc2e54e4..bc6530c75 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonHelpCommand.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonHelpCommand.cs
@@ -2,7 +2,7 @@
/*
*
* 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.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -40,7 +40,7 @@ public class KryptonHelpCommand : KryptonCommand
public ButtonSpecAny? HelpButton
{
get => _helpButtonSpec ?? new ButtonSpecAny();
- set { _helpButtonSpec = value; UpdateImage(KryptonManager.InternalGlobalPaletteMode); }
+ set { _helpButtonSpec = value; UpdateImage(KryptonManager.CurrentGlobalPaletteMode); }
}
/* ///
@@ -66,7 +66,7 @@ public KryptonHelpCommand()
{
_imageStates = new ButtonImageStates();
- Text = KryptonLanguageManager.ButtonSpecStyles.FormHelp;
+ Text = KryptonManager.Strings.ButtonSpecStyleStrings.FormHelp;
}
#endregion
@@ -75,24 +75,24 @@ public KryptonHelpCommand()
/// Updates the image.
/// The help image.
- private void UpdateImage(Image helpImage) => ImageSmall = helpImage;
+ private void UpdateImage(Image? helpImage) => ImageSmall = helpImage;
/// Adds the image states.
/// The active image.
/// The disabled image.
/// The normal image.
/// The pressed image.
- private void AddImageStates(Image? activeImage, Image disabledImage, Image normalImage, Image? pressedImage)
+ private void AddImageStates(Image? activeImage, Image? disabledImage, Image? normalImage, Image? pressedImage)
{
if (_helpButtonSpec != null)
{
_helpButtonSpec.ImageStates.ImageDisabled = disabledImage;
- _helpButtonSpec.ImageStates.ImageTracking = activeImage ?? null;
+ _helpButtonSpec.ImageStates.ImageTracking = activeImage;
_helpButtonSpec.ImageStates.ImageNormal = normalImage;
- _helpButtonSpec.ImageStates.ImagePressed = pressedImage ?? null;
+ _helpButtonSpec.ImageStates.ImagePressed = pressedImage;
}
}
@@ -110,7 +110,7 @@ private void UpdateActiveImage(Image activeImage)
/// Updates the disabled image.
/// The disabled image.
- private void UpdateDisabledImage(Image disabledImage)
+ private void UpdateDisabledImage(Image? disabledImage)
{
_disabledImage = disabledImage;
@@ -122,7 +122,7 @@ private void UpdateDisabledImage(Image disabledImage)
/// Updates the normal image.
/// The normal image.
- private void UpdateNormalImage(Image normalImage)
+ private void UpdateNormalImage(Image? normalImage)
{
_normalImage = normalImage;
@@ -134,7 +134,7 @@ private void UpdateNormalImage(Image normalImage)
/// Updates the pressed image.
/// The pressed image.
- private void UpdatePressedImage(Image pressedImage)
+ private void UpdatePressedImage(Image? pressedImage)
{
_pressedImage = pressedImage;
@@ -160,128 +160,60 @@ private void UpdateImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateImage(Office2003ControlBoxResources.Office2003HelpIconNormal);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateImage(Office2007ControlBoxResources.Office2007HelpIconNormal);
- break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateImage(Office2007ControlBoxResources.Office2007HelpIconNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateImage(Office2007ControlBoxResources.Office2007HelpIconNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateImage(Office2007ControlBoxResources.Office2007HelpIconNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateImage(Office2007ControlBoxResources.Office2007HelpIconNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateImage(Office2007ControlBoxResources.Office2007HelpIconNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateImage(Office2007ControlBoxResources.Office2007HelpIconNormal);
- break;
case PaletteMode.Office2007White:
- UpdateImage(Office2007ControlBoxResources.Office2007HelpIconNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateImage(Office2007ControlBoxResources.Office2007HelpIconNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateImage(Office2007ControlBoxResources.Office2007HelpIconNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateImage(Office2010ControlBoxResources.Office2010HelpIconNormal);
- break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateImage(Office2010ControlBoxResources.Office2010HelpIconNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateImage(Office2010ControlBoxResources.Office2010HelpIconNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateImage(Office2010ControlBoxResources.Office2010HelpIconNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateImage(Office2010ControlBoxResources.Office2010HelpIconNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateImage(Office2010ControlBoxResources.Office2010HelpIconNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateImage(Office2010ControlBoxResources.Office2010HelpIconNormal);
- break;
case PaletteMode.Office2010White:
- UpdateImage(Office2010ControlBoxResources.Office2010HelpIconNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateImage(Office2010ControlBoxResources.Office2010HelpIconNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateImage(Office2010ControlBoxResources.Office2010HelpIconNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateImage(Office2013ControlBoxResources.Office2013HelpNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateImage(Microsoft365ControlBoxResources.Microsoft365HelpIconNormal);
- break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateImage(Microsoft365ControlBoxResources.Microsoft365HelpIconNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateImage(Microsoft365ControlBoxResources.Microsoft365HelpIconNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateImage(Microsoft365ControlBoxResources.Microsoft365HelpIconNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateImage(Microsoft365ControlBoxResources.Microsoft365HelpIconNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateImage(Microsoft365ControlBoxResources.Microsoft365HelpIconNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateImage(Microsoft365ControlBoxResources.Microsoft365HelpIconNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateImage(Microsoft365ControlBoxResources.Microsoft365HelpIconNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateImage(Microsoft365ControlBoxResources.Microsoft365HelpIconNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateImage(Microsoft365ControlBoxResources.Microsoft365HelpIconNormal);
break;
case PaletteMode.SparkleBlue:
- UpdateImage(Office2010ControlBoxResources.Office2010HelpIconNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateImage(Office2010ControlBoxResources.Office2010HelpIconNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateImage(Office2010ControlBoxResources.Office2010HelpIconNormal);
- break;
case PaletteMode.SparkleOrange:
- UpdateImage(Office2010ControlBoxResources.Office2010HelpIconNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateImage(Office2010ControlBoxResources.Office2010HelpIconNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateImage(Office2010ControlBoxResources.Office2010HelpIconNormal);
- break;
case PaletteMode.SparklePurple:
- UpdateImage(Office2010ControlBoxResources.Office2010HelpIconNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateImage(Office2010ControlBoxResources.Office2010HelpIconNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
- UpdateImage(Office2010ControlBoxResources.Office2010HelpIconNormal);
- break;
case PaletteMode.Custom:
UpdateImage(Office2010ControlBoxResources.Office2010HelpIconNormal);
break;
@@ -313,125 +245,59 @@ private void UpdateActiveImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateActiveImage(ProfessionalControlBoxResources.ProfessionalHelpIconNormal);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ControlBoxResources.Office2007HelpIconHover);
- break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ControlBoxResources.Office2007HelpIconHover);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ControlBoxResources.Office2007HelpIconHover);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ControlBoxResources.Office2007HelpIconHover);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ControlBoxResources.Office2007HelpIconHover);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ControlBoxResources.Office2007HelpIconHover);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ControlBoxResources.Office2007HelpIconHover);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ControlBoxResources.Office2007HelpIconHover);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ControlBoxResources.Office2007HelpIconHover);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateActiveImage(Office2007ControlBoxResources.Office2007HelpIconHover);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ControlBoxResources.Office2010HelpIconHover);
- break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ControlBoxResources.Office2010HelpIconHover);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ControlBoxResources.Office2010HelpIconHover);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ControlBoxResources.Office2010HelpIconHover);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ControlBoxResources.Office2010HelpIconHover);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ControlBoxResources.Office2010HelpIconHover);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ControlBoxResources.Office2010HelpIconHover);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ControlBoxResources.Office2010HelpIconHover);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ControlBoxResources.Office2010HelpIconHover);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateActiveImage(Office2010ControlBoxResources.Office2010HelpIconHover);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateActiveImage(Office2013ControlBoxResources.Office2013HelpActive);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Microsoft365ControlBoxResources.Microsoft365HelpIconHover);
- break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Microsoft365ControlBoxResources.Microsoft365HelpIconHover);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Microsoft365ControlBoxResources.Microsoft365HelpIconHover);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Microsoft365ControlBoxResources.Microsoft365HelpIconHover);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Microsoft365ControlBoxResources.Microsoft365HelpIconHover);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Microsoft365ControlBoxResources.Microsoft365HelpIconHover);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Microsoft365ControlBoxResources.Microsoft365HelpIconHover);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Microsoft365ControlBoxResources.Microsoft365HelpIconHover);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Microsoft365ControlBoxResources.Microsoft365HelpIconHover);
- break;
case PaletteMode.Microsoft365White:
UpdateActiveImage(Microsoft365ControlBoxResources.Microsoft365HelpIconHover);
break;
case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ControlBoxResources.Office2010HelpIconHover);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ControlBoxResources.Office2010HelpIconHover);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ControlBoxResources.Office2010HelpIconHover);
- break;
case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ControlBoxResources.Office2010HelpIconHover);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ControlBoxResources.Office2010HelpIconHover);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ControlBoxResources.Office2010HelpIconHover);
- break;
case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ControlBoxResources.Office2010HelpIconHover);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ControlBoxResources.Office2010HelpIconHover);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateActiveImage(Office2010ControlBoxResources.Office2010HelpIconHover);
break;
@@ -455,8 +321,9 @@ private void UpdateDisabledImage(PaletteMode mode)
break;
case PaletteMode.ProfessionalOffice2003:
break;
- case PaletteMode.Office2007DarkGray:
- break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
+ // break;
case PaletteMode.Office2007Blue:
break;
case PaletteMode.Office2007BlueDarkMode:
@@ -475,8 +342,9 @@ private void UpdateDisabledImage(PaletteMode mode)
break;
case PaletteMode.Office2007BlackDarkMode:
break;
- case PaletteMode.Office2010DarkGray:
- break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
+ // break;
case PaletteMode.Office2010Blue:
break;
case PaletteMode.Office2010BlueDarkMode:
@@ -495,12 +363,14 @@ private void UpdateDisabledImage(PaletteMode mode)
break;
case PaletteMode.Office2010BlackDarkMode:
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
break;
- case PaletteMode.Microsoft365DarkGray:
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
+ // break;
case PaletteMode.Microsoft365Black:
break;
case PaletteMode.Microsoft365BlackDarkMode:
@@ -557,8 +427,9 @@ private void UpdateNormalImage(PaletteMode mode)
break;
case PaletteMode.ProfessionalOffice2003:
break;
- case PaletteMode.Office2007DarkGray:
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
+ // break;
case PaletteMode.Office2007Blue:
break;
case PaletteMode.Office2007BlueDarkMode:
@@ -577,8 +448,9 @@ private void UpdateNormalImage(PaletteMode mode)
break;
case PaletteMode.Office2007BlackDarkMode:
break;
- case PaletteMode.Office2010DarkGray:
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
+ // break;
case PaletteMode.Office2010Blue:
break;
case PaletteMode.Office2010BlueDarkMode:
@@ -597,12 +469,14 @@ private void UpdateNormalImage(PaletteMode mode)
break;
case PaletteMode.Office2010BlackDarkMode:
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
break;
- case PaletteMode.Microsoft365DarkGray:
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
+ // break;
case PaletteMode.Microsoft365Black:
break;
case PaletteMode.Microsoft365BlackDarkMode:
@@ -659,8 +533,9 @@ private void UpdatePressedImage(PaletteMode mode)
break;
case PaletteMode.ProfessionalOffice2003:
break;
- case PaletteMode.Office2007DarkGray:
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
+ // break;
case PaletteMode.Office2007Blue:
break;
case PaletteMode.Office2007BlueDarkMode:
@@ -679,8 +554,9 @@ private void UpdatePressedImage(PaletteMode mode)
break;
case PaletteMode.Office2007BlackDarkMode:
break;
- case PaletteMode.Office2010DarkGray:
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
+ // break;
case PaletteMode.Office2010Blue:
break;
case PaletteMode.Office2010BlueDarkMode:
@@ -699,12 +575,14 @@ private void UpdatePressedImage(PaletteMode mode)
break;
case PaletteMode.Office2010BlackDarkMode:
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
break;
- case PaletteMode.Microsoft365DarkGray:
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
+ // break;
case PaletteMode.Microsoft365Black:
break;
case PaletteMode.Microsoft365BlackDarkMode:
@@ -753,7 +631,7 @@ private void UpdatePressedImage(PaletteMode mode)
/// mode - null
private void UpdateImageStates(PaletteMode mode)
{
- if (_helpButtonSpec != null)
+ if (_helpButtonSpec is not null)
{
switch (mode)
{
@@ -765,125 +643,59 @@ private void UpdateImageStates(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
AddImageStates(null, ProfessionalControlBoxResources.ProfessionalHelpIconDisabled, ProfessionalControlBoxResources.ProfessionalHelpIconNormal, null);
break;
- case PaletteMode.Office2007DarkGray:
- AddImageStates(Office2007ControlBoxResources.Office2007HelpIconHover, Office2007ControlBoxResources.Office2007HelpIconDisabled, Office2007ControlBoxResources.Office2007HelpIconNormal, Office2007ControlBoxResources.Office2007HelpIconPressed);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- AddImageStates(Office2007ControlBoxResources.Office2007HelpIconHover, Office2007ControlBoxResources.Office2007HelpIconDisabled, Office2007ControlBoxResources.Office2007HelpIconNormal, Office2007ControlBoxResources.Office2007HelpIconPressed);
- break;
case PaletteMode.Office2007BlueDarkMode:
- AddImageStates(Office2007ControlBoxResources.Office2007HelpIconHover, Office2007ControlBoxResources.Office2007HelpIconDisabled, Office2007ControlBoxResources.Office2007HelpIconNormal, Office2007ControlBoxResources.Office2007HelpIconPressed);
- break;
case PaletteMode.Office2007BlueLightMode:
- AddImageStates(Office2007ControlBoxResources.Office2007HelpIconHover, Office2007ControlBoxResources.Office2007HelpIconDisabled, Office2007ControlBoxResources.Office2007HelpIconNormal, Office2007ControlBoxResources.Office2007HelpIconPressed);
- break;
case PaletteMode.Office2007Silver:
- AddImageStates(Office2007ControlBoxResources.Office2007HelpIconHover, Office2007ControlBoxResources.Office2007HelpIconDisabled, Office2007ControlBoxResources.Office2007HelpIconNormal, Office2007ControlBoxResources.Office2007HelpIconPressed);
- break;
case PaletteMode.Office2007SilverDarkMode:
- AddImageStates(Office2007ControlBoxResources.Office2007HelpIconHover, Office2007ControlBoxResources.Office2007HelpIconDisabled, Office2007ControlBoxResources.Office2007HelpIconNormal, Office2007ControlBoxResources.Office2007HelpIconPressed);
- break;
case PaletteMode.Office2007SilverLightMode:
- AddImageStates(Office2007ControlBoxResources.Office2007HelpIconHover, Office2007ControlBoxResources.Office2007HelpIconDisabled, Office2007ControlBoxResources.Office2007HelpIconNormal, Office2007ControlBoxResources.Office2007HelpIconPressed);
- break;
case PaletteMode.Office2007White:
- AddImageStates(Office2007ControlBoxResources.Office2007HelpIconHover, Office2007ControlBoxResources.Office2007HelpIconDisabled, Office2007ControlBoxResources.Office2007HelpIconNormal, Office2007ControlBoxResources.Office2007HelpIconPressed);
- break;
case PaletteMode.Office2007Black:
- AddImageStates(Office2007ControlBoxResources.Office2007HelpIconHover, Office2007ControlBoxResources.Office2007HelpIconDisabled, Office2007ControlBoxResources.Office2007HelpIconNormal, Office2007ControlBoxResources.Office2007HelpIconPressed);
- break;
case PaletteMode.Office2007BlackDarkMode:
AddImageStates(Office2007ControlBoxResources.Office2007HelpIconHover, Office2007ControlBoxResources.Office2007HelpIconDisabled, Office2007ControlBoxResources.Office2007HelpIconNormal, Office2007ControlBoxResources.Office2007HelpIconPressed);
break;
- case PaletteMode.Office2010DarkGray:
- AddImageStates(Office2010ControlBoxResources.Office2010HelpIconHover, Office2010ControlBoxResources.Office2010HelpIconDisabled, Office2010ControlBoxResources.Office2010HelpIconNormal, Office2010ControlBoxResources.Office2010HelpIconPressed);
- break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- AddImageStates(Office2010ControlBoxResources.Office2010HelpIconHover, Office2010ControlBoxResources.Office2010HelpIconDisabled, Office2010ControlBoxResources.Office2010HelpIconNormal, Office2010ControlBoxResources.Office2010HelpIconPressed);
- break;
case PaletteMode.Office2010BlueDarkMode:
- AddImageStates(Office2010ControlBoxResources.Office2010HelpIconHover, Office2010ControlBoxResources.Office2010HelpIconDisabled, Office2010ControlBoxResources.Office2010HelpIconNormal, Office2010ControlBoxResources.Office2010HelpIconPressed);
- break;
case PaletteMode.Office2010BlueLightMode:
- AddImageStates(Office2010ControlBoxResources.Office2010HelpIconHover, Office2010ControlBoxResources.Office2010HelpIconDisabled, Office2010ControlBoxResources.Office2010HelpIconNormal, Office2010ControlBoxResources.Office2010HelpIconPressed);
- break;
case PaletteMode.Office2010Silver:
- AddImageStates(Office2010ControlBoxResources.Office2010HelpIconHover, Office2010ControlBoxResources.Office2010HelpIconDisabled, Office2010ControlBoxResources.Office2010HelpIconNormal, Office2010ControlBoxResources.Office2010HelpIconPressed);
- break;
case PaletteMode.Office2010SilverDarkMode:
- AddImageStates(Office2010ControlBoxResources.Office2010HelpIconHover, Office2010ControlBoxResources.Office2010HelpIconDisabled, Office2010ControlBoxResources.Office2010HelpIconNormal, Office2010ControlBoxResources.Office2010HelpIconPressed);
- break;
case PaletteMode.Office2010SilverLightMode:
- AddImageStates(Office2010ControlBoxResources.Office2010HelpIconHover, Office2010ControlBoxResources.Office2010HelpIconDisabled, Office2010ControlBoxResources.Office2010HelpIconNormal, Office2010ControlBoxResources.Office2010HelpIconPressed);
- break;
case PaletteMode.Office2010White:
- AddImageStates(Office2010ControlBoxResources.Office2010HelpIconHover, Office2010ControlBoxResources.Office2010HelpIconDisabled, Office2010ControlBoxResources.Office2010HelpIconNormal, Office2010ControlBoxResources.Office2010HelpIconPressed);
- break;
case PaletteMode.Office2010Black:
- AddImageStates(Office2010ControlBoxResources.Office2010HelpIconHover, Office2010ControlBoxResources.Office2010HelpIconDisabled, Office2010ControlBoxResources.Office2010HelpIconNormal, Office2010ControlBoxResources.Office2010HelpIconPressed);
- break;
case PaletteMode.Office2010BlackDarkMode:
AddImageStates(Office2010ControlBoxResources.Office2010HelpIconHover, Office2010ControlBoxResources.Office2010HelpIconDisabled, Office2010ControlBoxResources.Office2010HelpIconNormal, Office2010ControlBoxResources.Office2010HelpIconPressed);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
AddImageStates(Microsoft365ControlBoxResources.Microsoft365HelpIconHover, Microsoft365ControlBoxResources.Microsoft365HelpIconDisabled, Microsoft365ControlBoxResources.Microsoft365HelpIconNormal, Microsoft365ControlBoxResources.Microsoft365HelpIconPressed);
break;
- case PaletteMode.Microsoft365DarkGray:
- AddImageStates(Microsoft365ControlBoxResources.Microsoft365HelpIconHover, Microsoft365ControlBoxResources.Microsoft365HelpIconDisabled, Microsoft365ControlBoxResources.Microsoft365HelpIconNormal, Microsoft365ControlBoxResources.Microsoft365HelpIconPressed);
- break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- AddImageStates(Microsoft365ControlBoxResources.Microsoft365HelpIconHover, Microsoft365ControlBoxResources.Microsoft365HelpIconDisabled, Microsoft365ControlBoxResources.Microsoft365HelpIconNormal, Microsoft365ControlBoxResources.Microsoft365HelpIconPressed);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- AddImageStates(Microsoft365ControlBoxResources.Microsoft365HelpIconHover, Microsoft365ControlBoxResources.Microsoft365HelpIconDisabled, Microsoft365ControlBoxResources.Microsoft365HelpIconNormal, Microsoft365ControlBoxResources.Microsoft365HelpIconPressed);
- break;
case PaletteMode.Microsoft365Blue:
- AddImageStates(Microsoft365ControlBoxResources.Microsoft365HelpIconHover, Microsoft365ControlBoxResources.Microsoft365HelpIconDisabled, Microsoft365ControlBoxResources.Microsoft365HelpIconNormal, Microsoft365ControlBoxResources.Microsoft365HelpIconPressed);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- AddImageStates(Microsoft365ControlBoxResources.Microsoft365HelpIconHover, Microsoft365ControlBoxResources.Microsoft365HelpIconDisabled, Microsoft365ControlBoxResources.Microsoft365HelpIconNormal, Microsoft365ControlBoxResources.Microsoft365HelpIconPressed);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- AddImageStates(Microsoft365ControlBoxResources.Microsoft365HelpIconHover, Microsoft365ControlBoxResources.Microsoft365HelpIconDisabled, Microsoft365ControlBoxResources.Microsoft365HelpIconNormal, Microsoft365ControlBoxResources.Microsoft365HelpIconPressed);
- break;
case PaletteMode.Microsoft365Silver:
- AddImageStates(Microsoft365ControlBoxResources.Microsoft365HelpIconHover, Microsoft365ControlBoxResources.Microsoft365HelpIconDisabled, Microsoft365ControlBoxResources.Microsoft365HelpIconNormal, Microsoft365ControlBoxResources.Microsoft365HelpIconPressed);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- AddImageStates(Microsoft365ControlBoxResources.Microsoft365HelpIconHover, Microsoft365ControlBoxResources.Microsoft365HelpIconDisabled, Microsoft365ControlBoxResources.Microsoft365HelpIconNormal, Microsoft365ControlBoxResources.Microsoft365HelpIconPressed);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- AddImageStates(Microsoft365ControlBoxResources.Microsoft365HelpIconHover, Microsoft365ControlBoxResources.Microsoft365HelpIconDisabled, Microsoft365ControlBoxResources.Microsoft365HelpIconNormal, Microsoft365ControlBoxResources.Microsoft365HelpIconPressed);
- break;
case PaletteMode.Microsoft365White:
AddImageStates(Microsoft365ControlBoxResources.Microsoft365HelpIconHover, Microsoft365ControlBoxResources.Microsoft365HelpIconDisabled, Microsoft365ControlBoxResources.Microsoft365HelpIconNormal, Microsoft365ControlBoxResources.Microsoft365HelpIconPressed);
break;
case PaletteMode.SparkleBlue:
- AddImageStates(Office2010ControlBoxResources.Office2010HelpIconHover, Office2010ControlBoxResources.Office2010HelpIconDisabled, Office2010ControlBoxResources.Office2010HelpIconNormal, Office2010ControlBoxResources.Office2010HelpIconPressed);
- break;
case PaletteMode.SparkleBlueDarkMode:
- AddImageStates(Office2010ControlBoxResources.Office2010HelpIconHover, Office2010ControlBoxResources.Office2010HelpIconDisabled, Office2010ControlBoxResources.Office2010HelpIconNormal, Office2010ControlBoxResources.Office2010HelpIconPressed);
- break;
case PaletteMode.SparkleBlueLightMode:
- AddImageStates(Office2010ControlBoxResources.Office2010HelpIconHover, Office2010ControlBoxResources.Office2010HelpIconDisabled, Office2010ControlBoxResources.Office2010HelpIconNormal, Office2010ControlBoxResources.Office2010HelpIconPressed);
- break;
case PaletteMode.SparkleOrange:
- AddImageStates(Office2010ControlBoxResources.Office2010HelpIconHover, Office2010ControlBoxResources.Office2010HelpIconDisabled, Office2010ControlBoxResources.Office2010HelpIconNormal, Office2010ControlBoxResources.Office2010HelpIconPressed);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- AddImageStates(Office2010ControlBoxResources.Office2010HelpIconHover, Office2010ControlBoxResources.Office2010HelpIconDisabled, Office2010ControlBoxResources.Office2010HelpIconNormal, Office2010ControlBoxResources.Office2010HelpIconPressed);
- break;
case PaletteMode.SparkleOrangeLightMode:
- AddImageStates(Office2010ControlBoxResources.Office2010HelpIconHover, Office2010ControlBoxResources.Office2010HelpIconDisabled, Office2010ControlBoxResources.Office2010HelpIconNormal, Office2010ControlBoxResources.Office2010HelpIconPressed);
- break;
case PaletteMode.SparklePurple:
- AddImageStates(Office2010ControlBoxResources.Office2010HelpIconHover, Office2010ControlBoxResources.Office2010HelpIconDisabled, Office2010ControlBoxResources.Office2010HelpIconNormal, Office2010ControlBoxResources.Office2010HelpIconPressed);
- break;
case PaletteMode.SparklePurpleDarkMode:
- AddImageStates(Office2010ControlBoxResources.Office2010HelpIconHover, Office2010ControlBoxResources.Office2010HelpIconDisabled, Office2010ControlBoxResources.Office2010HelpIconNormal, Office2010ControlBoxResources.Office2010HelpIconPressed);
- break;
case PaletteMode.SparklePurpleLightMode:
AddImageStates(Office2010ControlBoxResources.Office2010HelpIconHover, Office2010ControlBoxResources.Office2010HelpIconDisabled, Office2010ControlBoxResources.Office2010HelpIconNormal, Office2010ControlBoxResources.Office2010HelpIconPressed);
break;
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonInformationBox.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonInformationBox.cs
new file mode 100644
index 000000000..b9e029509
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonInformationBox.cs
@@ -0,0 +1,20 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+namespace Krypton.Toolkit
+{
+ /// Provides a public facing API to the .
+ public class KryptonInformationBox
+ {
+ public KryptonInformationBox()
+ {
+ DebugTools.NotImplemented(GlobalStaticValues.DEFAULT_NOT_IMPLEMENTED_YET_MESSAGE);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonInputBox.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonInputBox.cs
index 86091cbe6..ee940870a 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonInputBox.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonInputBox.cs
@@ -1,4 +1,13 @@
-namespace Krypton.Toolkit
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+namespace Krypton.Toolkit
{
///
///
@@ -12,58 +21,16 @@ public static class KryptonInputBox
///
/// Displays an input box with provided prompt and caption and defaulted response string.
///
- /// The text to display as an input prompt.
- /// The text to display in the title bar of the input box.
- /// Default response text..
- /// The cue text.
- /// The colour of the cue.
- /// The cue font.
- /// Enables the password option.
- /// Input string.
- public static string Show(string prompt,
- string caption = @"",
- string defaultResponse = @"",
- string cueText = @"",
- Color cueColour = new Color(), // Color.Empty
- Font? cueTypeface = null,
- bool usePasswordOption = false)
- => InternalShow(null, prompt, caption, defaultResponse, cueText, cueColour, cueTypeface, usePasswordOption);
-
- ///
- /// DDisplays an input box in front of the specified object and with the provided prompt and caption and defaulted response string.
- ///
- /// Owner of the modal dialog box.
- /// The text to display as an input prompt.
- /// The text to display in the title bar of the input box.
- /// Default response text..
- /// The cue text.
- /// The colour of the cue.
- /// The cue font.
- /// Enables the password option.
+ /// The data to feed through to .
/// Input string.
- public static string Show(IWin32Window owner, string prompt,
- string caption = @"",
- string defaultResponse = @"",
- string cueText = @"",
- Color cueColour = new Color(), // Color.Empty
- Font? cueTypeface = null,
- bool usePasswordOption = false)
- => InternalShow(owner, prompt, caption, defaultResponse, cueText, cueColour, cueTypeface, usePasswordOption);
+ public static string Show(KryptonInputBoxData inputBoxData)
+ => InternalShow(inputBoxData);
#endregion
#region Implementation
- private static string InternalShow(IWin32Window? owner,
- string prompt,
- string caption,
- string defaultResponse,
- string cueText,
- Color cueColour,
- Font? cueTypeface,
- bool usePasswordOption) =>
- KryptonInputBoxForm.InternalShow(owner, prompt, caption, defaultResponse, cueText, cueColour,
- cueTypeface, usePasswordOption);
+ internal static string InternalShow(KryptonInputBoxData inputBoxData) => inputBoxData.UseRTLLayout == KryptonUseRTLLayout.Yes ? VisualInputBoxRtlAwareForm.InternalShow(inputBoxData) : VisualInputBoxForm.InternalShow(inputBoxData);
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonInputBoxManager.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonInputBoxManager.cs
index aaa2547fc..c421b631d 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonInputBoxManager.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonInputBoxManager.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -17,97 +17,39 @@ namespace Krypton.Toolkit
public class KryptonInputBoxManager : Component
{
#region Variables
- private bool _usePasswordOption;
- private Color _cueColour;
+ private KryptonInputBoxData _inputBoxData;
- private Font _cueTypeface;
-
- private string _caption, _cueText, _defaultResponse, _prompt;
-
- private IWin32Window? _owner;
#endregion
#region Properties
- /// Gets or sets a value indicating whether [use password option].
- /// true if [use password option]; otherwise, false .
- [DefaultValue(false), Description(@"Triggers the password feature of the response textbox.")]
- public bool UsePasswordOption { get => _usePasswordOption; set => _usePasswordOption = value; }
-
- /// Gets or sets the cue colour.
- /// The cue colour.
- [DefaultValue(typeof(Color), "Color.Gray"), Description(@"Modifies the cue text colour.")]
- public Color CueColour { get => _cueColour; set => _cueColour = value; }
-
- /// Gets or sets the cue typeface.
- /// The cue typeface.
- [DefaultValue(typeof(Font), "Segoe UI, 9pt"), Description(@"The cue text typeface.")]
- public Font CueTypeface { get => _cueTypeface; set => _cueTypeface = value; }
- /// Gets or sets the caption.
- /// The caption.
- [DefaultValue(""), Description(@"The krypton input box caption.")]
- public string Caption { get => _caption; set => _caption = value; }
+ public KryptonInputBoxData InputBoxData { get => _inputBoxData; set => _inputBoxData = value; }
- /// Gets or sets the cue text.
- /// The cue text.
- [DefaultValue(""), Description(@"The krypton input box cue text.")]
- public string CueText { get => _cueText; set => _cueText = value; }
-
- /// Gets or sets the default response.
- /// The default response.
- [DefaultValue(""), Description(@"The krypton input box default response.")]
- public string DefaultResponse { get => _defaultResponse; set => _defaultResponse = value; }
-
- /// Gets or sets the prompt.
- /// The prompt.
- [DefaultValue(""), Description(@"The krypton input box prompt text.")]
- public string Prompt { get => _prompt; set => _prompt = value; }
#endregion
#region Constructor
/// Initializes a new instance of the class.
public KryptonInputBoxManager()
{
- _usePasswordOption = false;
-
- _cueColour = Color.Gray;
-
- _cueTypeface = new Font("Segoe UI", 9f);
-
- _caption = string.Empty;
-
- _cueText = string.Empty;
-
- _defaultResponse = string.Empty;
-
- _prompt = string.Empty;
+ _inputBoxData = new KryptonInputBoxData();
}
#endregion
#region Setters and Getters
/// Sets the Owner to the value of value.
/// The desired value of Owner.
- public void SetOwner(IWin32Window value) => _owner = value;
+ public void SetOwner(IWin32Window value) => _inputBoxData.Owner = value;
/// Returns the value of the Owner.
/// The value of the Owner.
- public IWin32Window? GetOwner() => _owner;
+ public IWin32Window? GetOwner() => _inputBoxData.Owner;
#endregion
#region Methods
/// Displays the krypton input box.
- public void DisplayKryptonInputBox()
- {
- if (GetOwner() != null)
- {
- KryptonInputBox.Show(_owner!, _prompt, _caption, _defaultResponse, _cueText, _cueColour, _cueTypeface, _usePasswordOption);
- }
- else
- {
- KryptonInputBox.Show(_prompt, _caption, _defaultResponse, _cueText, _cueColour, _cueTypeface, _usePasswordOption);
- }
- }
+ public void DisplayKryptonInputBox() => KryptonInputBox.Show(_inputBoxData);
+
#endregion
}
}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolBarManager.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolBarManager.cs
index 4ad907cfd..5d29802c7 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolBarManager.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolBarManager.cs
@@ -2,7 +2,7 @@
/*
*
* 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. 2023 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2024. All rights reserved.
*
*/
#endregion
@@ -40,8 +40,6 @@ public class KryptonIntegratedToolBarManager : Component
private bool _flipButtonArray;
- private bool _allowFormIntegration;
-
private ButtonSpecAny[] _integratedToolBarButtons;
private PaletteButtonOrientation _integratedToolBarButtonOrientation;
@@ -90,36 +88,6 @@ public class KryptonIntegratedToolBarManager : Component
#region Public
- /// Gets or sets a value indicating whether [allow form integration].
- /// true if [allow form integration]; otherwise, false .
- /// @"The 'ParentForm' property cannot be null.
- [Category(@"Visuals"), DefaultValue(false), Description(@"Add/remove the integrated tool bar buttons to the parent form. (Note: Existing buttonspecs will not be affected.)")]
- public bool AllowFormIntegration
- {
- get => _allowFormIntegration;
-
- set
- {
- _allowFormIntegration = value;
-
- if (_parentForm != null)
- {
- if (value)
- {
- AttachIntegratedToolBarToParent(_parentForm);
- }
- else
- {
- DetachIntegratedToolBarFromParent(_parentForm);
- }
- }
- else
- {
- throw new ArgumentNullException($@"The 'ParentForm' property cannot be null.");
- }
- }
- }
-
/// Gets the integrated tool bar buttons.
/// The integrated tool bar buttons.
[Category(@"Visuals"), DefaultValue(null), Description(@"Contains all the integrated tool bar buttons.")]
@@ -266,8 +234,6 @@ public void Reset()
{
_flipButtonArray = false;
- _allowFormIntegration = false;
-
SetupToolBar();
_integratedToolBarButtonOrientation = PaletteButtonOrientation.FixedTop;
@@ -412,7 +378,7 @@ public void ShowIntegrateToolBar(bool showIntegratedToolBar, KryptonForm parentF
}
catch (Exception e)
{
- ExceptionHandler.CaptureException(e, className: @"KryptonIntegratedToolBarManager.cs", methodSignature: @"IntegrateToolBarIntoParentForm(bool showIntegratedToolBar, KryptonForm parentForm)");
+ ExceptionHandler.CaptureException(e, showStackTrace: GlobalStaticValues.DEFAULT_USE_STACK_TRACE);
}
}
@@ -438,7 +404,7 @@ public void AttachIntegratedToolBarToParent(KryptonForm? parentForm)
}
catch (Exception e)
{
- ExceptionHandler.CaptureException(e, className: @"KryptonIntegratedToolBarManager.cs", methodSignature: @"AttachIntegratedToolBarToParent(KryptonForm parentForm)");
+ ExceptionHandler.CaptureException(e, showStackTrace: GlobalStaticValues.DEFAULT_USE_STACK_TRACE);
}
}
@@ -465,7 +431,7 @@ public void DetachIntegratedToolBarFromParent(KryptonForm? parentForm)
}
catch (Exception e)
{
- ExceptionHandler.CaptureException(e, className: @"KryptonIntegratedToolBarManager.cs", methodSignature: @"AttachIntegratedToolBarToParent(KryptonForm parentForm)");
+ ExceptionHandler.CaptureException(e, showStackTrace: GlobalStaticValues.DEFAULT_USE_STACK_TRACE);
}
}
@@ -523,7 +489,7 @@ public void UpdateButtonOrientation(PaletteButtonOrientation buttonOrientation)
}
catch (Exception e)
{
- ExceptionHandler.CaptureException(e);
+ ExceptionHandler.CaptureException(e, showStackTrace: GlobalStaticValues.DEFAULT_USE_STACK_TRACE);
}
}
@@ -563,7 +529,7 @@ public void UpdateButtonAlignment(PaletteRelativeEdgeAlign buttonAlignment)
}
catch (Exception e)
{
- ExceptionHandler.CaptureException(e);
+ ExceptionHandler.CaptureException(e, showStackTrace: GlobalStaticValues.DEFAULT_USE_STACK_TRACE);
}
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarCopyCommand.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarCopyCommand.cs
index b520cdb58..9904e65a0 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarCopyCommand.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarCopyCommand.cs
@@ -2,1030 +2,635 @@
/*
*
* Copy 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. 2023 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2024. All rights reserved.
*
*/
#endregion
namespace Krypton.Toolkit
{
- /// A created specifically for the button spec.
- [Category(@"code")]
- [ToolboxItem(false)]
- //[ToolboxBitmap(typeof(KryptonHelpCommand), @"ToolboxBitmaps.KryptonHelp.bmp")]
- [Description(@"For use with the 'Copy' ButtonSpec style.")]
- [DesignerCategory(@"code")]
- public class KryptonIntegratedToolbarCopyCommand : KryptonCommand
- {
- #region Instance Fields
+ /// A created specifically for the button spec.
+ [Category(@"code")]
+ [ToolboxItem(false)]
+ //[ToolboxBitmap(typeof(KryptonHelpCommand), @"ToolboxBitmaps.KryptonHelp.bmp")]
+ [Description(@"For use with the 'Copy' ButtonSpec style.")]
+ [DesignerCategory(@"code")]
+ public class KryptonIntegratedToolbarCopyCommand : KryptonCommand
+ {
+ #region Instance Fields
- private ButtonSpecAny? _copyButtonSpec;
+ private ButtonSpecAny? _copyButtonSpec;
- private ButtonImageStates? _imageStates;
+ private ButtonImageStates? _imageStates;
- private Image? _activeImage;
+ private Image? _activeImage;
- private Image? _disabledImage;
+ private Image? _disabledImage;
- private Image? _normalImage;
+ private Image? _normalImage;
- private Image? _pressedImage;
+ private Image? _pressedImage;
- #endregion
- #region Public
+ #endregion
- /// Gets or sets the copy button.
- /// The copy button.
- [DefaultValue(null), Description(@"Access to the copy button spec.")]
- [AllowNull]
- public ButtonSpecAny? ToolBarCopyButton
- {
- get => _copyButtonSpec ?? new ButtonSpecAny();
- set { _copyButtonSpec = value; UpdateImage(KryptonManager.InternalGlobalPaletteMode); }
- }
+ #region Public
- /// Gets the active image.
- /// The active image.
- public Image? ActiveImage { get => _activeImage; private set => _activeImage = value; }
-
- /// Gets the disabled image.
- /// The disabled image.
- public Image? DisabledImage { get => _disabledImage; private set => _disabledImage = value; }
-
- /// Gets the normal image.
- /// The normal image.
- public Image? NormalImage { get => _normalImage; private set => _normalImage = value; }
-
- /// Gets the pressed image.
- /// The pressed image.
- public Image? PressedImage { get => _pressedImage; private set => _pressedImage = value; }
-
- #endregion
-
- #region Identity
-
- /// Initializes a new instance of the class.
- public KryptonIntegratedToolbarCopyCommand()
- {
- _imageStates = new ButtonImageStates();
-
- Text = KryptonLanguageManager.ToolBarStrings.Copy;
- }
-
- #endregion
-
- #region Implementation
-
- /// Updates the image.
- /// The help image.
- private void UpdateImage(Image helpImage) => ImageSmall = helpImage;
-
- /// Adds the image states.
- /// The active image.
- /// The disabled image.
- /// The normal image.
- /// The pressed image.
- private void AddImageStates(Image? activeImage, Image disabledImage, Image normalImage, Image? pressedImage)
- {
- if (_copyButtonSpec != null)
- {
- _copyButtonSpec.ImageStates.ImageDisabled = disabledImage;
-
- _copyButtonSpec.ImageStates.ImageTracking = activeImage ?? null;
-
- _copyButtonSpec.ImageStates.ImageNormal = normalImage;
-
- _copyButtonSpec.ImageStates.ImagePressed = pressedImage ?? null;
- }
- }
-
- /// Updates the active image.
- /// The active image.
- private void UpdateActiveImage(Image activeImage)
- {
- _activeImage = activeImage;
-
- if (_copyButtonSpec != null)
- {
- _copyButtonSpec.ImageStates.ImageTracking = _activeImage;
- }
- }
-
- /// Updates the disabled image.
- /// The disabled image.
- private void UpdateDisabledImage(Image disabledImage)
- {
- _disabledImage = disabledImage;
-
- if (_copyButtonSpec != null)
- {
- _copyButtonSpec.ImageStates.ImageDisabled = disabledImage;
- }
- }
-
- /// Updates the normal image.
- /// The normal image.
- private void UpdateNormalImage(Image normalImage)
- {
- _normalImage = normalImage;
-
- if (_copyButtonSpec != null)
- {
- _copyButtonSpec.ImageStates.ImageNormal = normalImage;
- }
- }
-
- /// Updates the pressed image.
- /// The pressed image.
- private void UpdatePressedImage(Image pressedImage)
- {
- _pressedImage = pressedImage;
-
- if (_copyButtonSpec != null)
- {
- _copyButtonSpec.ImageStates.ImagePressed = pressedImage;
- }
- }
-
- /// Updates the image.
- /// The mode.
- /// mode - null
- private void UpdateImage(PaletteMode mode)
- {
-
- switch (mode)
- {
- case PaletteMode.Global:
- break;
- case PaletteMode.ProfessionalSystem:
- UpdateImage(SystemToolbarImageResources.SystemToolbarCopyNormal);
- break;
- case PaletteMode.ProfessionalOffice2003:
- UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007DarkGray:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007Blue:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007BlueDarkMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007BlueLightMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007Silver:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007SilverDarkMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007SilverLightMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007White:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007Black:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007BlackDarkMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010DarkGray:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010Blue:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010BlueDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010BlueLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010Silver:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010SilverDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010SilverLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010White:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010Black:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010BlackDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
- case PaletteMode.Office2013White:
- UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365Black:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365BlackDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365Blue:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365BlueDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365BlueLightMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365Silver:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365SilverDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365SilverLightMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365White:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.SparkleBlue:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparkleOrange:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparklePurple:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Custom:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- default:
- throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
- }
-
- UpdateActiveImage(mode);
-
- UpdateDisabledImage(mode);
-
- UpdateNormalImage(mode);
-
- UpdatePressedImage(mode);
- }
-
- /// Updates the active image.
- /// The mode.
- /// mode - null
- private void UpdateActiveImage(PaletteMode mode)
- {
- switch (mode)
- {
- case PaletteMode.Global:
- break;
- case PaletteMode.ProfessionalSystem:
- UpdateActiveImage(SystemToolbarImageResources.SystemToolbarCopyNormal);
- break;
- case PaletteMode.ProfessionalOffice2003:
- UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007BlackDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010BlackDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
- case PaletteMode.Office2013White:
- UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365White:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Custom:
- break;
- default:
- throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
- }
- }
-
- /// Updates the disabled image.
- /// The mode.
- /// mode - null
- private void UpdateDisabledImage(PaletteMode mode)
- {
- switch (mode)
- {
- case PaletteMode.Global:
- break;
- case PaletteMode.ProfessionalSystem:
- UpdateActiveImage(SystemToolbarImageResources.SystemToolbarCopyDisabled);
- break;
- case PaletteMode.ProfessionalOffice2003:
- UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarCopyDisabled);
- break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyDisabled);
- break;
- case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyDisabled);
- break;
- case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyDisabled);
- break;
- case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyDisabled);
- break;
- case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyDisabled);
- break;
- case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyDisabled);
- break;
- case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyDisabled);
- break;
- case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyDisabled);
- break;
- case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyDisabled);
- break;
- case PaletteMode.Office2007BlackDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyDisabled);
- break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled);
- break;
- case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled);
- break;
- case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled);
- break;
- case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled);
- break;
- case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled);
- break;
- case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled);
- break;
- case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled);
- break;
- case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled);
- break;
- case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled);
- break;
- case PaletteMode.Office2010BlackDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled);
- break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
- case PaletteMode.Office2013White:
- UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarCopyDisabled);
- break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyDisabled);
- break;
- case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyDisabled);
- break;
- case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyDisabled);
- break;
- case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyDisabled);
- break;
- case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyDisabled);
- break;
- case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyDisabled);
- break;
- case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyDisabled);
- break;
- case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyDisabled);
- break;
- case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyDisabled);
- break;
- case PaletteMode.Microsoft365White:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyDisabled);
- break;
- case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled);
- break;
- case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled);
- break;
- case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled);
- break;
- case PaletteMode.Custom:
- break;
- default:
- throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
- }
- }
-
- /// Updates the normal image.
- /// The mode.
- /// mode - null
- private void UpdateNormalImage(PaletteMode mode)
- {
- switch (mode)
- {
- case PaletteMode.Global:
- break;
- case PaletteMode.ProfessionalSystem:
- UpdateActiveImage(SystemToolbarImageResources.SystemToolbarCopyNormal);
- break;
- case PaletteMode.ProfessionalOffice2003:
- UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007BlackDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010BlackDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
- case PaletteMode.Office2013White:
- UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365White:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Custom:
- break;
- default:
- throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
- }
- }
-
- /// Updates the pressed image.
- /// The mode.
- /// mode - null
- private void UpdatePressedImage(PaletteMode mode)
- {
- switch (mode)
- {
- case PaletteMode.Global:
- break;
- case PaletteMode.ProfessionalSystem:
- UpdateActiveImage(SystemToolbarImageResources.SystemToolbarCopyNormal);
- break;
- case PaletteMode.ProfessionalOffice2003:
- UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007BlackDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010BlackDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
- case PaletteMode.Office2013White:
- UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365White:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Custom:
- break;
- default:
- throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
- }
- }
-
- /// Updates the image states.
- /// The mode.
- /// mode - null
- private void UpdateImageStates(PaletteMode mode)
- {
- if (_copyButtonSpec != null)
- {
- switch (mode)
- {
- case PaletteMode.Global:
- break;
- case PaletteMode.ProfessionalSystem:
- AddImageStates(null, SystemToolbarImageResources.SystemToolbarCopyDisabled, SystemToolbarImageResources.SystemToolbarCopyNormal, null);
- break;
- case PaletteMode.ProfessionalOffice2003:
- AddImageStates(null, Office2003ToolbarImageResources.Office2003ToolbarCopyDisabled, Office2003ToolbarImageResources.Office2003ToolbarCopyNormal, null);
- break;
- case PaletteMode.Office2007DarkGray:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal, Office2007ToolbarImageResources.Office2007ToolbarCopyDisabled, Office2007ToolbarImageResources.Office2007ToolbarCopyNormal, Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007Blue:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal, Office2007ToolbarImageResources.Office2007ToolbarCopyDisabled, Office2007ToolbarImageResources.Office2007ToolbarCopyNormal, Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007BlueDarkMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal, Office2007ToolbarImageResources.Office2007ToolbarCopyDisabled, Office2007ToolbarImageResources.Office2007ToolbarCopyNormal, Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007BlueLightMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal, Office2007ToolbarImageResources.Office2007ToolbarCopyDisabled, Office2007ToolbarImageResources.Office2007ToolbarCopyNormal, Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007Silver:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal, Office2007ToolbarImageResources.Office2007ToolbarCopyDisabled, Office2007ToolbarImageResources.Office2007ToolbarCopyNormal, Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007SilverDarkMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal, Office2007ToolbarImageResources.Office2007ToolbarCopyDisabled, Office2007ToolbarImageResources.Office2007ToolbarCopyNormal, Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007SilverLightMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal, Office2007ToolbarImageResources.Office2007ToolbarCopyDisabled, Office2007ToolbarImageResources.Office2007ToolbarCopyNormal, Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007White:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal, Office2007ToolbarImageResources.Office2007ToolbarCopyDisabled, Office2007ToolbarImageResources.Office2007ToolbarCopyNormal, Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007Black:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal, Office2007ToolbarImageResources.Office2007ToolbarCopyDisabled, Office2007ToolbarImageResources.Office2007ToolbarCopyNormal, Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2007BlackDarkMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal, Office2007ToolbarImageResources.Office2007ToolbarCopyDisabled, Office2007ToolbarImageResources.Office2007ToolbarCopyNormal, Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010DarkGray:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010Blue:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010BlueDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010BlueLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010Silver:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010SilverDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010SilverLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010White:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010Black:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2010BlackDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
- case PaletteMode.Office2013White:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal, Office2019ToolbarImageResources.Office2019ToolbarCopyDisabled, Office2019ToolbarImageResources.Office2019ToolbarCopyNormal, Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365DarkGray:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal, Office2019ToolbarImageResources.Office2019ToolbarCopyDisabled, Office2019ToolbarImageResources.Office2019ToolbarCopyNormal, Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365Black:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal, Office2019ToolbarImageResources.Office2019ToolbarCopyDisabled, Office2019ToolbarImageResources.Office2019ToolbarCopyNormal, Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365BlackDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal, Office2019ToolbarImageResources.Office2019ToolbarCopyDisabled, Office2019ToolbarImageResources.Office2019ToolbarCopyNormal, Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365Blue:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal, Office2019ToolbarImageResources.Office2019ToolbarCopyDisabled, Office2019ToolbarImageResources.Office2019ToolbarCopyNormal, Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365BlueDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal, Office2019ToolbarImageResources.Office2019ToolbarCopyDisabled, Office2019ToolbarImageResources.Office2019ToolbarCopyNormal, Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365BlueLightMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal, Office2019ToolbarImageResources.Office2019ToolbarCopyDisabled, Office2019ToolbarImageResources.Office2019ToolbarCopyNormal, Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365Silver:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal, Office2019ToolbarImageResources.Office2019ToolbarCopyDisabled, Office2019ToolbarImageResources.Office2019ToolbarCopyNormal, Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365SilverDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal, Office2019ToolbarImageResources.Office2019ToolbarCopyDisabled, Office2019ToolbarImageResources.Office2019ToolbarCopyNormal, Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365SilverLightMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal, Office2019ToolbarImageResources.Office2019ToolbarCopyDisabled, Office2019ToolbarImageResources.Office2019ToolbarCopyNormal, Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.Microsoft365White:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal, Office2019ToolbarImageResources.Office2019ToolbarCopyDisabled, Office2019ToolbarImageResources.Office2019ToolbarCopyNormal, Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- case PaletteMode.SparkleBlue:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparkleBlueLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparkleOrange:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparklePurple:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.SparklePurpleLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
- break;
- case PaletteMode.Custom:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal, Office2019ToolbarImageResources.Office2019ToolbarCopyDisabled, Office2019ToolbarImageResources.Office2019ToolbarCopyNormal, Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
- break;
- default:
- throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
- }
- }
- }
-
- #endregion
- }
+ /// Gets or sets the copy button.
+ /// The copy button.
+ [DefaultValue(null), Description(@"Access to the copy button spec.")]
+ [AllowNull]
+ public ButtonSpecAny? ToolBarCopyButton
+ {
+ get => _copyButtonSpec ?? new ButtonSpecAny();
+ set { _copyButtonSpec = value; UpdateImage(KryptonManager.CurrentGlobalPaletteMode); }
+ }
+
+ /// Gets the active image.
+ /// The active image.
+ public Image? ActiveImage { get => _activeImage; private set => _activeImage = value; }
+
+ /// Gets the disabled image.
+ /// The disabled image.
+ public Image? DisabledImage { get => _disabledImage; private set => _disabledImage = value; }
+
+ /// Gets the normal image.
+ /// The normal image.
+ public Image? NormalImage { get => _normalImage; private set => _normalImage = value; }
+
+ /// Gets the pressed image.
+ /// The pressed image.
+ public Image? PressedImage { get => _pressedImage; private set => _pressedImage = value; }
+
+ #endregion
+
+ #region Identity
+
+ /// Initializes a new instance of the class.
+ public KryptonIntegratedToolbarCopyCommand()
+ {
+ _imageStates = new ButtonImageStates();
+
+ Text = KryptonManager.Strings.ToolBarStrings.Copy;
+ }
+
+ #endregion
+
+ #region Implementation
+
+ /// Updates the image.
+ /// The help image.
+ private void UpdateImage(Image? helpImage) => ImageSmall = helpImage;
+
+ /// Adds the image states.
+ /// The active image.
+ /// The disabled image.
+ /// The normal image.
+ /// The pressed image.
+ private void AddImageStates(Image? activeImage, Image? disabledImage, Image? normalImage, Image? pressedImage)
+ {
+ if (_copyButtonSpec != null)
+ {
+ _copyButtonSpec.ImageStates.ImageDisabled = disabledImage;
+
+ _copyButtonSpec.ImageStates.ImageTracking = activeImage ?? null;
+
+ _copyButtonSpec.ImageStates.ImageNormal = normalImage;
+
+ _copyButtonSpec.ImageStates.ImagePressed = pressedImage ?? null;
+ }
+ }
+
+ /// Updates the active image.
+ /// The active image.
+ private void UpdateActiveImage(Image activeImage)
+ {
+ _activeImage = activeImage;
+
+ if (_copyButtonSpec != null)
+ {
+ _copyButtonSpec.ImageStates.ImageTracking = _activeImage;
+ }
+ }
+
+ /// Updates the disabled image.
+ /// The disabled image.
+ private void UpdateDisabledImage(Image? disabledImage)
+ {
+ _disabledImage = disabledImage;
+
+ if (_copyButtonSpec != null)
+ {
+ _copyButtonSpec.ImageStates.ImageDisabled = disabledImage;
+ }
+ }
+
+ /// Updates the normal image.
+ /// The normal image.
+ private void UpdateNormalImage(Image? normalImage)
+ {
+ _normalImage = normalImage;
+
+ if (_copyButtonSpec != null)
+ {
+ _copyButtonSpec.ImageStates.ImageNormal = normalImage;
+ }
+ }
+
+ /// Updates the pressed image.
+ /// The pressed image.
+ private void UpdatePressedImage(Image? pressedImage)
+ {
+ _pressedImage = pressedImage;
+
+ if (_copyButtonSpec != null)
+ {
+ _copyButtonSpec.ImageStates.ImagePressed = pressedImage;
+ }
+ }
+
+ /// Updates the image.
+ /// The mode.
+ /// mode - null
+ private void UpdateImage(PaletteMode mode)
+ {
+
+ switch (mode)
+ {
+ case PaletteMode.Global:
+ break;
+ case PaletteMode.ProfessionalSystem:
+ UpdateImage(SystemToolbarImageResources.SystemToolbarCopyNormal);
+ break;
+ case PaletteMode.ProfessionalOffice2003:
+ UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarCopyNormal);
+ break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
+ case PaletteMode.Office2007Blue:
+ case PaletteMode.Office2007BlueDarkMode:
+ case PaletteMode.Office2007BlueLightMode:
+ case PaletteMode.Office2007Silver:
+ case PaletteMode.Office2007SilverDarkMode:
+ case PaletteMode.Office2007SilverLightMode:
+ case PaletteMode.Office2007White:
+ case PaletteMode.Office2007Black:
+ case PaletteMode.Office2007BlackDarkMode:
+ UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
+ break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
+ case PaletteMode.Office2010Blue:
+ case PaletteMode.Office2010BlueDarkMode:
+ case PaletteMode.Office2010BlueLightMode:
+ case PaletteMode.Office2010Silver:
+ case PaletteMode.Office2010SilverDarkMode:
+ case PaletteMode.Office2010SilverLightMode:
+ case PaletteMode.Office2010White:
+ case PaletteMode.Office2010Black:
+ case PaletteMode.Office2010BlackDarkMode:
+ UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
+ break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
+ case PaletteMode.Office2013White:
+ UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarCopyNormal);
+ break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
+ case PaletteMode.Microsoft365Black:
+ case PaletteMode.Microsoft365BlackDarkMode:
+ case PaletteMode.Microsoft365Blue:
+ case PaletteMode.Microsoft365BlueDarkMode:
+ case PaletteMode.Microsoft365BlueLightMode:
+ case PaletteMode.Microsoft365Silver:
+ case PaletteMode.Microsoft365SilverDarkMode:
+ case PaletteMode.Microsoft365SilverLightMode:
+ case PaletteMode.Microsoft365White:
+ UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
+ break;
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
+ break;
+ case PaletteMode.Custom:
+ UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
+ }
+
+ UpdateActiveImage(mode);
+
+ UpdateDisabledImage(mode);
+
+ UpdateNormalImage(mode);
+
+ UpdatePressedImage(mode);
+ }
+
+ /// Updates the active image.
+ /// The mode.
+ /// mode - null
+ private void UpdateActiveImage(PaletteMode mode)
+ {
+ switch (mode)
+ {
+ case PaletteMode.Global:
+ break;
+ case PaletteMode.ProfessionalSystem:
+ UpdateActiveImage(SystemToolbarImageResources.SystemToolbarCopyNormal);
+ break;
+ case PaletteMode.ProfessionalOffice2003:
+ UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarCopyNormal);
+ break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
+ case PaletteMode.Office2007Blue:
+ case PaletteMode.Office2007BlueDarkMode:
+ case PaletteMode.Office2007BlueLightMode:
+ case PaletteMode.Office2007Silver:
+ case PaletteMode.Office2007SilverDarkMode:
+ case PaletteMode.Office2007SilverLightMode:
+ case PaletteMode.Office2007White:
+ case PaletteMode.Office2007Black:
+ case PaletteMode.Office2007BlackDarkMode:
+ UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
+ break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
+ case PaletteMode.Office2010Blue:
+ case PaletteMode.Office2010BlueDarkMode:
+ case PaletteMode.Office2010BlueLightMode:
+ case PaletteMode.Office2010Silver:
+ case PaletteMode.Office2010SilverDarkMode:
+ case PaletteMode.Office2010SilverLightMode:
+ case PaletteMode.Office2010White:
+ case PaletteMode.Office2010Black:
+ case PaletteMode.Office2010BlackDarkMode:
+ UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
+ break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
+ case PaletteMode.Office2013White:
+ UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarCopyNormal);
+ break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
+ case PaletteMode.Microsoft365Black:
+ case PaletteMode.Microsoft365BlackDarkMode:
+ case PaletteMode.Microsoft365Blue:
+ case PaletteMode.Microsoft365BlueDarkMode:
+ case PaletteMode.Microsoft365BlueLightMode:
+ case PaletteMode.Microsoft365Silver:
+ case PaletteMode.Microsoft365SilverDarkMode:
+ case PaletteMode.Microsoft365SilverLightMode:
+ case PaletteMode.Microsoft365White:
+ UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
+ break;
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
+ break;
+ case PaletteMode.Custom:
+ break;
+ default:
+ throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
+ }
+ }
+
+ /// Updates the disabled image.
+ /// The mode.
+ /// mode - null
+ private void UpdateDisabledImage(PaletteMode mode)
+ {
+ switch (mode)
+ {
+ case PaletteMode.Global:
+ break;
+ case PaletteMode.ProfessionalSystem:
+ UpdateActiveImage(SystemToolbarImageResources.SystemToolbarCopyDisabled);
+ break;
+ case PaletteMode.ProfessionalOffice2003:
+ UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarCopyDisabled);
+ break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
+ case PaletteMode.Office2007Blue:
+ case PaletteMode.Office2007BlueDarkMode:
+ case PaletteMode.Office2007BlueLightMode:
+ case PaletteMode.Office2007Silver:
+ case PaletteMode.Office2007SilverDarkMode:
+ case PaletteMode.Office2007SilverLightMode:
+ case PaletteMode.Office2007White:
+ case PaletteMode.Office2007Black:
+ case PaletteMode.Office2007BlackDarkMode:
+ UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyDisabled);
+ break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
+ case PaletteMode.Office2010Blue:
+ case PaletteMode.Office2010BlueDarkMode:
+ case PaletteMode.Office2010BlueLightMode:
+ case PaletteMode.Office2010Silver:
+ case PaletteMode.Office2010SilverDarkMode:
+ case PaletteMode.Office2010SilverLightMode:
+ case PaletteMode.Office2010White:
+ case PaletteMode.Office2010Black:
+ case PaletteMode.Office2010BlackDarkMode:
+ UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled);
+ break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
+ case PaletteMode.Office2013White:
+ UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarCopyDisabled);
+ break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
+ case PaletteMode.Microsoft365Black:
+ case PaletteMode.Microsoft365BlackDarkMode:
+ case PaletteMode.Microsoft365Blue:
+ case PaletteMode.Microsoft365BlueDarkMode:
+ case PaletteMode.Microsoft365BlueLightMode:
+ case PaletteMode.Microsoft365Silver:
+ case PaletteMode.Microsoft365SilverDarkMode:
+ case PaletteMode.Microsoft365SilverLightMode:
+ case PaletteMode.Microsoft365White:
+ UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyDisabled);
+ break;
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled);
+ break;
+ case PaletteMode.Custom:
+ break;
+ default:
+ throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
+ }
+ }
+
+ /// Updates the normal image.
+ /// The mode.
+ /// mode - null
+ private void UpdateNormalImage(PaletteMode mode)
+ {
+ switch (mode)
+ {
+ case PaletteMode.Global:
+ break;
+ case PaletteMode.ProfessionalSystem:
+ UpdateActiveImage(SystemToolbarImageResources.SystemToolbarCopyNormal);
+ break;
+ case PaletteMode.ProfessionalOffice2003:
+ UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarCopyNormal);
+ break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
+ case PaletteMode.Office2007Blue:
+ case PaletteMode.Office2007BlueDarkMode:
+ case PaletteMode.Office2007BlueLightMode:
+ case PaletteMode.Office2007Silver:
+ case PaletteMode.Office2007SilverDarkMode:
+ case PaletteMode.Office2007SilverLightMode:
+ case PaletteMode.Office2007White:
+ case PaletteMode.Office2007Black:
+ case PaletteMode.Office2007BlackDarkMode:
+ UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
+ break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
+ case PaletteMode.Office2010Blue:
+ case PaletteMode.Office2010BlueDarkMode:
+ case PaletteMode.Office2010BlueLightMode:
+ case PaletteMode.Office2010Silver:
+ case PaletteMode.Office2010SilverDarkMode:
+ case PaletteMode.Office2010SilverLightMode:
+ case PaletteMode.Office2010White:
+ case PaletteMode.Office2010Black:
+ case PaletteMode.Office2010BlackDarkMode:
+ UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
+ break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
+ case PaletteMode.Office2013White:
+ UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarCopyNormal);
+ break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
+ case PaletteMode.Microsoft365Black:
+ case PaletteMode.Microsoft365BlackDarkMode:
+ case PaletteMode.Microsoft365Blue:
+ case PaletteMode.Microsoft365BlueDarkMode:
+ case PaletteMode.Microsoft365BlueLightMode:
+ case PaletteMode.Microsoft365Silver:
+ case PaletteMode.Microsoft365SilverDarkMode:
+ case PaletteMode.Microsoft365SilverLightMode:
+ case PaletteMode.Microsoft365White:
+ UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
+ break;
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
+ break;
+ case PaletteMode.Custom:
+ break;
+ default:
+ throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
+ }
+ }
+
+ /// Updates the pressed image.
+ /// The mode.
+ /// mode - null
+ private void UpdatePressedImage(PaletteMode mode)
+ {
+ switch (mode)
+ {
+ case PaletteMode.Global:
+ break;
+ case PaletteMode.ProfessionalSystem:
+ UpdateActiveImage(SystemToolbarImageResources.SystemToolbarCopyNormal);
+ break;
+ case PaletteMode.ProfessionalOffice2003:
+ UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarCopyNormal);
+ break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
+ case PaletteMode.Office2007Blue:
+ case PaletteMode.Office2007BlueDarkMode:
+ case PaletteMode.Office2007BlueLightMode:
+ case PaletteMode.Office2007Silver:
+ case PaletteMode.Office2007SilverDarkMode:
+ case PaletteMode.Office2007SilverLightMode:
+ case PaletteMode.Office2007White:
+ case PaletteMode.Office2007Black:
+ case PaletteMode.Office2007BlackDarkMode:
+ UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
+ break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
+ case PaletteMode.Office2010Blue:
+ case PaletteMode.Office2010BlueDarkMode:
+ case PaletteMode.Office2010BlueLightMode:
+ case PaletteMode.Office2010Silver:
+ case PaletteMode.Office2010SilverDarkMode:
+ case PaletteMode.Office2010SilverLightMode:
+ case PaletteMode.Office2010White:
+ case PaletteMode.Office2010Black:
+ case PaletteMode.Office2010BlackDarkMode:
+ UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
+ break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
+ case PaletteMode.Office2013White:
+ UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarCopyNormal);
+ break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
+ case PaletteMode.Microsoft365Black:
+ case PaletteMode.Microsoft365BlackDarkMode:
+ case PaletteMode.Microsoft365Blue:
+ case PaletteMode.Microsoft365BlueDarkMode:
+ case PaletteMode.Microsoft365BlueLightMode:
+ case PaletteMode.Microsoft365Silver:
+ case PaletteMode.Microsoft365SilverDarkMode:
+ case PaletteMode.Microsoft365SilverLightMode:
+ case PaletteMode.Microsoft365White:
+ UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
+ break;
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
+ break;
+ case PaletteMode.Custom:
+ break;
+ default:
+ throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
+ }
+ }
+
+ /// Updates the image states.
+ /// The mode.
+ /// mode - null
+ private void UpdateImageStates(PaletteMode mode)
+ {
+ if (_copyButtonSpec != null)
+ {
+ switch (mode)
+ {
+ case PaletteMode.Global:
+ break;
+ case PaletteMode.ProfessionalSystem:
+ AddImageStates(null, SystemToolbarImageResources.SystemToolbarCopyDisabled, SystemToolbarImageResources.SystemToolbarCopyNormal, null);
+ break;
+ case PaletteMode.ProfessionalOffice2003:
+ AddImageStates(null, Office2003ToolbarImageResources.Office2003ToolbarCopyDisabled, Office2003ToolbarImageResources.Office2003ToolbarCopyNormal, null);
+ break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
+ case PaletteMode.Office2007Blue:
+ case PaletteMode.Office2007BlueDarkMode:
+ case PaletteMode.Office2007BlueLightMode:
+ case PaletteMode.Office2007Silver:
+ case PaletteMode.Office2007SilverDarkMode:
+ case PaletteMode.Office2007SilverLightMode:
+ case PaletteMode.Office2007White:
+ case PaletteMode.Office2007Black:
+ case PaletteMode.Office2007BlackDarkMode:
+ AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarCopyNormal, Office2007ToolbarImageResources.Office2007ToolbarCopyDisabled, Office2007ToolbarImageResources.Office2007ToolbarCopyNormal, Office2007ToolbarImageResources.Office2007ToolbarCopyNormal);
+ break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
+ case PaletteMode.Office2010Blue:
+ case PaletteMode.Office2010BlueDarkMode:
+ case PaletteMode.Office2010BlueLightMode:
+ case PaletteMode.Office2010Silver:
+ case PaletteMode.Office2010SilverDarkMode:
+ case PaletteMode.Office2010SilverLightMode:
+ case PaletteMode.Office2010White:
+ case PaletteMode.Office2010Black:
+ case PaletteMode.Office2010BlackDarkMode:
+ AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
+ break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
+ case PaletteMode.Office2013White:
+ AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal, Office2019ToolbarImageResources.Office2019ToolbarCopyDisabled, Office2019ToolbarImageResources.Office2019ToolbarCopyNormal, Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
+ break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
+ case PaletteMode.Microsoft365Black:
+ case PaletteMode.Microsoft365BlackDarkMode:
+ case PaletteMode.Microsoft365Blue:
+ case PaletteMode.Microsoft365BlueDarkMode:
+ case PaletteMode.Microsoft365BlueLightMode:
+ case PaletteMode.Microsoft365Silver:
+ case PaletteMode.Microsoft365SilverDarkMode:
+ case PaletteMode.Microsoft365SilverLightMode:
+ case PaletteMode.Microsoft365White:
+ AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal, Office2019ToolbarImageResources.Office2019ToolbarCopyDisabled, Office2019ToolbarImageResources.Office2019ToolbarCopyNormal, Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
+ break;
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyDisabled, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal, Office2010ToolbarImageResources.Office2010ToolbarCopyNormal);
+ break;
+ case PaletteMode.Custom:
+ AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarCopyNormal, Office2019ToolbarImageResources.Office2019ToolbarCopyDisabled, Office2019ToolbarImageResources.Office2019ToolbarCopyNormal, Office2019ToolbarImageResources.Office2019ToolbarCopyNormal);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
+ }
+ }
+ }
+
+ #endregion
+ }
}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarCutCommand.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarCutCommand.cs
index af086a555..4aed89238 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarCutCommand.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarCutCommand.cs
@@ -2,7 +2,7 @@
/*
*
* Cut 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. 2023 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2024. All rights reserved.
*
*/
#endregion
@@ -42,7 +42,7 @@ public class KryptonIntegratedToolbarCutCommand : KryptonCommand
public ButtonSpecAny? ToolBarCutButton
{
get => _cutButtonSpec ?? new ButtonSpecAny();
- set { _cutButtonSpec = value; UpdateImage(KryptonManager.InternalGlobalPaletteMode); }
+ set { _cutButtonSpec = value; UpdateImage(KryptonManager.CurrentGlobalPaletteMode); }
}
/// Gets the active image.
@@ -70,7 +70,7 @@ public KryptonIntegratedToolbarCutCommand()
{
_imageStates = new ButtonImageStates();
- Text = KryptonLanguageManager.ToolBarStrings.Cut;
+ Text = KryptonManager.Strings.ToolBarStrings.Cut;
}
#endregion
@@ -79,24 +79,24 @@ public KryptonIntegratedToolbarCutCommand()
/// Updates the image.
/// The help image.
- private void UpdateImage(Image helpImage) => ImageSmall = helpImage;
+ private void UpdateImage(Image? helpImage) => ImageSmall = helpImage;
/// Adds the image states.
/// The active image.
/// The disabled image.
/// The normal image.
/// The pressed image.
- private void AddImageStates(Image? activeImage, Image disabledImage, Image normalImage, Image? pressedImage)
+ private void AddImageStates(Image? activeImage, Image? disabledImage, Image? normalImage, Image? pressedImage)
{
if (_cutButtonSpec != null)
{
_cutButtonSpec.ImageStates.ImageDisabled = disabledImage;
- _cutButtonSpec.ImageStates.ImageTracking = activeImage ?? null;
+ _cutButtonSpec.ImageStates.ImageTracking = activeImage;
_cutButtonSpec.ImageStates.ImageNormal = normalImage;
- _cutButtonSpec.ImageStates.ImagePressed = pressedImage ?? null;
+ _cutButtonSpec.ImageStates.ImagePressed = pressedImage;
}
}
@@ -114,7 +114,7 @@ private void UpdateActiveImage(Image activeImage)
/// Updates the disabled image.
/// The disabled image.
- private void UpdateDisabledImage(Image disabledImage)
+ private void UpdateDisabledImage(Image? disabledImage)
{
_disabledImage = disabledImage;
@@ -126,7 +126,7 @@ private void UpdateDisabledImage(Image disabledImage)
/// Updates the normal image.
/// The normal image.
- private void UpdateNormalImage(Image normalImage)
+ private void UpdateNormalImage(Image? normalImage)
{
_normalImage = normalImage;
@@ -138,7 +138,7 @@ private void UpdateNormalImage(Image normalImage)
/// Updates the pressed image.
/// The pressed image.
- private void UpdatePressedImage(Image pressedImage)
+ private void UpdatePressedImage(Image? pressedImage)
{
_pressedImage = pressedImage;
@@ -164,125 +164,59 @@ private void UpdateImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarCutNormal);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007White:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010White:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarCutNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
break;
case PaletteMode.SparkleBlue:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparkleOrange:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparklePurple:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
break;
@@ -317,125 +251,59 @@ private void UpdateActiveImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarCutNormal);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarCutNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
break;
case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
break;
@@ -461,125 +329,59 @@ private void UpdateDisabledImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarCutDisabled);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutDisabled);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutDisabled);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutDisabled);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutDisabled);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutDisabled);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutDisabled);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutDisabled);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutDisabled);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutDisabled);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutDisabled);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutDisabled);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutDisabled);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutDisabled);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutDisabled);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutDisabled);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutDisabled);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutDisabled);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutDisabled);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutDisabled);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutDisabled);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarCutDisabled);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutDisabled);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutDisabled);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutDisabled);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutDisabled);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutDisabled);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutDisabled);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutDisabled);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutDisabled);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutDisabled);
- break;
case PaletteMode.Microsoft365White:
UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutDisabled);
break;
case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutDisabled);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutDisabled);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutDisabled);
- break;
case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutDisabled);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutDisabled);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutDisabled);
- break;
case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutDisabled);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutDisabled);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutDisabled);
break;
@@ -605,125 +407,59 @@ private void UpdateNormalImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarCutNormal);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarCutNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
break;
case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
break;
@@ -749,125 +485,59 @@ private void UpdatePressedImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarCutNormal);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarCutNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
break;
case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
break;
@@ -895,125 +565,59 @@ private void UpdateImageStates(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
AddImageStates(null, Office2003ToolbarImageResources.Office2003ToolbarCutDisabled, Office2003ToolbarImageResources.Office2003ToolbarCutNormal, null);
break;
- case PaletteMode.Office2007DarkGray:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarCutNormal, Office2007ToolbarImageResources.Office2007ToolbarCutDisabled, Office2007ToolbarImageResources.Office2007ToolbarCutNormal, Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarCutNormal, Office2007ToolbarImageResources.Office2007ToolbarCutDisabled, Office2007ToolbarImageResources.Office2007ToolbarCutNormal, Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarCutNormal, Office2007ToolbarImageResources.Office2007ToolbarCutDisabled, Office2007ToolbarImageResources.Office2007ToolbarCutNormal, Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarCutNormal, Office2007ToolbarImageResources.Office2007ToolbarCutDisabled, Office2007ToolbarImageResources.Office2007ToolbarCutNormal, Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007Silver:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarCutNormal, Office2007ToolbarImageResources.Office2007ToolbarCutDisabled, Office2007ToolbarImageResources.Office2007ToolbarCutNormal, Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarCutNormal, Office2007ToolbarImageResources.Office2007ToolbarCutDisabled, Office2007ToolbarImageResources.Office2007ToolbarCutNormal, Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarCutNormal, Office2007ToolbarImageResources.Office2007ToolbarCutDisabled, Office2007ToolbarImageResources.Office2007ToolbarCutNormal, Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007White:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarCutNormal, Office2007ToolbarImageResources.Office2007ToolbarCutDisabled, Office2007ToolbarImageResources.Office2007ToolbarCutNormal, Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007Black:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarCutNormal, Office2007ToolbarImageResources.Office2007ToolbarCutDisabled, Office2007ToolbarImageResources.Office2007ToolbarCutNormal, Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarCutNormal, Office2007ToolbarImageResources.Office2007ToolbarCutDisabled, Office2007ToolbarImageResources.Office2007ToolbarCutNormal, Office2007ToolbarImageResources.Office2007ToolbarCutNormal);
break;
- case PaletteMode.Office2010DarkGray:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutDisabled, Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutDisabled, Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutDisabled, Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutDisabled, Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010Silver:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutDisabled, Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutDisabled, Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutDisabled, Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010White:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutDisabled, Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010Black:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutDisabled, Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutDisabled, Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarCutNormal, Office2019ToolbarImageResources.Office2019ToolbarCutDisabled, Office2019ToolbarImageResources.Office2019ToolbarCutNormal, Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarCutNormal, Office2019ToolbarImageResources.Office2019ToolbarCutDisabled, Office2019ToolbarImageResources.Office2019ToolbarCutNormal, Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarCutNormal, Office2019ToolbarImageResources.Office2019ToolbarCutDisabled, Office2019ToolbarImageResources.Office2019ToolbarCutNormal, Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarCutNormal, Office2019ToolbarImageResources.Office2019ToolbarCutDisabled, Office2019ToolbarImageResources.Office2019ToolbarCutNormal, Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365Blue:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarCutNormal, Office2019ToolbarImageResources.Office2019ToolbarCutDisabled, Office2019ToolbarImageResources.Office2019ToolbarCutNormal, Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarCutNormal, Office2019ToolbarImageResources.Office2019ToolbarCutDisabled, Office2019ToolbarImageResources.Office2019ToolbarCutNormal, Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarCutNormal, Office2019ToolbarImageResources.Office2019ToolbarCutDisabled, Office2019ToolbarImageResources.Office2019ToolbarCutNormal, Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365Silver:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarCutNormal, Office2019ToolbarImageResources.Office2019ToolbarCutDisabled, Office2019ToolbarImageResources.Office2019ToolbarCutNormal, Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarCutNormal, Office2019ToolbarImageResources.Office2019ToolbarCutDisabled, Office2019ToolbarImageResources.Office2019ToolbarCutNormal, Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarCutNormal, Office2019ToolbarImageResources.Office2019ToolbarCutDisabled, Office2019ToolbarImageResources.Office2019ToolbarCutNormal, Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
- break;
case PaletteMode.Microsoft365White:
AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarCutNormal, Office2019ToolbarImageResources.Office2019ToolbarCutDisabled, Office2019ToolbarImageResources.Office2019ToolbarCutNormal, Office2019ToolbarImageResources.Office2019ToolbarCutNormal);
break;
case PaletteMode.SparkleBlue:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutDisabled, Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutDisabled, Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutDisabled, Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparkleOrange:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutDisabled, Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutDisabled, Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutDisabled, Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparklePurple:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutDisabled, Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutDisabled, Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutDisabled, Office2010ToolbarImageResources.Office2010ToolbarCutNormal, Office2010ToolbarImageResources.Office2010ToolbarCutNormal);
break;
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarNewCommand.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarNewCommand.cs
index 9c565ab63..5784b0305 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarNewCommand.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarNewCommand.cs
@@ -2,7 +2,7 @@
/*
*
* 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. 2023 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2024. All rights reserved.
*
*/
#endregion
@@ -42,7 +42,7 @@ public class KryptonIntegratedToolbarNewCommand : KryptonCommand
public ButtonSpecAny? ToolBarNewButton
{
get => _newButtonSpec ?? new ButtonSpecAny();
- set { _newButtonSpec = value; UpdateImage(KryptonManager.InternalGlobalPaletteMode); }
+ set { _newButtonSpec = value; UpdateImage(KryptonManager.CurrentGlobalPaletteMode); }
}
/// Gets the active image.
@@ -70,7 +70,7 @@ public KryptonIntegratedToolbarNewCommand()
{
_imageStates = new ButtonImageStates();
- Text = KryptonLanguageManager.ToolBarStrings.New;
+ Text = KryptonManager.Strings.ToolBarStrings.New;
}
#endregion
@@ -79,24 +79,24 @@ public KryptonIntegratedToolbarNewCommand()
/// Updates the image.
/// The help image.
- private void UpdateImage(Image helpImage) => ImageSmall = helpImage;
+ private void UpdateImage(Image? helpImage) => ImageSmall = helpImage;
/// Adds the image states.
/// The active image.
/// The disabled image.
/// The normal image.
/// The pressed image.
- private void AddImageStates(Image? activeImage, Image disabledImage, Image normalImage, Image? pressedImage)
+ private void AddImageStates(Image? activeImage, Image? disabledImage, Image? normalImage, Image? pressedImage)
{
if (_newButtonSpec != null)
{
_newButtonSpec.ImageStates.ImageDisabled = disabledImage;
- _newButtonSpec.ImageStates.ImageTracking = activeImage ?? null;
+ _newButtonSpec.ImageStates.ImageTracking = activeImage;
_newButtonSpec.ImageStates.ImageNormal = normalImage;
- _newButtonSpec.ImageStates.ImagePressed = pressedImage ?? null;
+ _newButtonSpec.ImageStates.ImagePressed = pressedImage;
}
}
@@ -114,7 +114,7 @@ private void UpdateActiveImage(Image activeImage)
/// Updates the disabled image.
/// The disabled image.
- private void UpdateDisabledImage(Image disabledImage)
+ private void UpdateDisabledImage(Image? disabledImage)
{
_disabledImage = disabledImage;
@@ -126,7 +126,7 @@ private void UpdateDisabledImage(Image disabledImage)
/// Updates the normal image.
/// The normal image.
- private void UpdateNormalImage(Image normalImage)
+ private void UpdateNormalImage(Image? normalImage)
{
_normalImage = normalImage;
@@ -138,7 +138,7 @@ private void UpdateNormalImage(Image normalImage)
/// Updates the pressed image.
/// The pressed image.
- private void UpdatePressedImage(Image pressedImage)
+ private void UpdatePressedImage(Image? pressedImage)
{
_pressedImage = pressedImage;
@@ -164,125 +164,59 @@ private void UpdateImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarNewNormal);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007White:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010White:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarNewNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
break;
case PaletteMode.SparkleBlue:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparkleOrange:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparklePurple:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
break;
@@ -317,125 +251,59 @@ private void UpdateActiveImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarNewNormal);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarNewNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
break;
case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
break;
@@ -461,125 +329,59 @@ private void UpdateDisabledImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarNewDisabled);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewDisabled);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewDisabled);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewDisabled);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewDisabled);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewDisabled);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewDisabled);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewDisabled);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewDisabled);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewDisabled);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewDisabled);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewDisabled);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewDisabled);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewDisabled);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewDisabled);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewDisabled);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewDisabled);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewDisabled);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewDisabled);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewDisabled);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewDisabled);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarNewDisabled);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewDisabled);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewDisabled);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewDisabled);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewDisabled);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewDisabled);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewDisabled);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewDisabled);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewDisabled);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewDisabled);
- break;
case PaletteMode.Microsoft365White:
UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewDisabled);
break;
case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewDisabled);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewDisabled);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewDisabled);
- break;
case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewDisabled);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewDisabled);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewDisabled);
- break;
case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewDisabled);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewDisabled);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewDisabled);
break;
@@ -605,125 +407,59 @@ private void UpdateNormalImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarNewNormal);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarNewNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
break;
case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
break;
@@ -749,125 +485,59 @@ private void UpdatePressedImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarNewNormal);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarNewNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
break;
case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
break;
@@ -895,125 +565,59 @@ private void UpdateImageStates(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
AddImageStates(null, Office2003ToolbarImageResources.Office2003ToolbarNewDisabled, Office2003ToolbarImageResources.Office2003ToolbarNewNormal, null);
break;
- case PaletteMode.Office2007DarkGray:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarNewNormal, Office2007ToolbarImageResources.Office2007ToolbarNewDisabled, Office2007ToolbarImageResources.Office2007ToolbarNewNormal, Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarNewNormal, Office2007ToolbarImageResources.Office2007ToolbarNewDisabled, Office2007ToolbarImageResources.Office2007ToolbarNewNormal, Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarNewNormal, Office2007ToolbarImageResources.Office2007ToolbarNewDisabled, Office2007ToolbarImageResources.Office2007ToolbarNewNormal, Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarNewNormal, Office2007ToolbarImageResources.Office2007ToolbarNewDisabled, Office2007ToolbarImageResources.Office2007ToolbarNewNormal, Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007Silver:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarNewNormal, Office2007ToolbarImageResources.Office2007ToolbarNewDisabled, Office2007ToolbarImageResources.Office2007ToolbarNewNormal, Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarNewNormal, Office2007ToolbarImageResources.Office2007ToolbarNewDisabled, Office2007ToolbarImageResources.Office2007ToolbarNewNormal, Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarNewNormal, Office2007ToolbarImageResources.Office2007ToolbarNewDisabled, Office2007ToolbarImageResources.Office2007ToolbarNewNormal, Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007White:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarNewNormal, Office2007ToolbarImageResources.Office2007ToolbarNewDisabled, Office2007ToolbarImageResources.Office2007ToolbarNewNormal, Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007Black:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarNewNormal, Office2007ToolbarImageResources.Office2007ToolbarNewDisabled, Office2007ToolbarImageResources.Office2007ToolbarNewNormal, Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarNewNormal, Office2007ToolbarImageResources.Office2007ToolbarNewDisabled, Office2007ToolbarImageResources.Office2007ToolbarNewNormal, Office2007ToolbarImageResources.Office2007ToolbarNewNormal);
break;
- case PaletteMode.Office2010DarkGray:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewDisabled, Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewDisabled, Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewDisabled, Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewDisabled, Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010Silver:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewDisabled, Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewDisabled, Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewDisabled, Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010White:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewDisabled, Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010Black:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewDisabled, Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewDisabled, Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarNewNormal, Office2019ToolbarImageResources.Office2019ToolbarNewDisabled, Office2019ToolbarImageResources.Office2019ToolbarNewNormal, Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarNewNormal, Office2019ToolbarImageResources.Office2019ToolbarNewDisabled, Office2019ToolbarImageResources.Office2019ToolbarNewNormal, Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarNewNormal, Office2019ToolbarImageResources.Office2019ToolbarNewDisabled, Office2019ToolbarImageResources.Office2019ToolbarNewNormal, Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarNewNormal, Office2019ToolbarImageResources.Office2019ToolbarNewDisabled, Office2019ToolbarImageResources.Office2019ToolbarNewNormal, Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365Blue:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarNewNormal, Office2019ToolbarImageResources.Office2019ToolbarNewDisabled, Office2019ToolbarImageResources.Office2019ToolbarNewNormal, Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarNewNormal, Office2019ToolbarImageResources.Office2019ToolbarNewDisabled, Office2019ToolbarImageResources.Office2019ToolbarNewNormal, Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarNewNormal, Office2019ToolbarImageResources.Office2019ToolbarNewDisabled, Office2019ToolbarImageResources.Office2019ToolbarNewNormal, Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365Silver:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarNewNormal, Office2019ToolbarImageResources.Office2019ToolbarNewDisabled, Office2019ToolbarImageResources.Office2019ToolbarNewNormal, Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarNewNormal, Office2019ToolbarImageResources.Office2019ToolbarNewDisabled, Office2019ToolbarImageResources.Office2019ToolbarNewNormal, Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarNewNormal, Office2019ToolbarImageResources.Office2019ToolbarNewDisabled, Office2019ToolbarImageResources.Office2019ToolbarNewNormal, Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
- break;
case PaletteMode.Microsoft365White:
AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarNewNormal, Office2019ToolbarImageResources.Office2019ToolbarNewDisabled, Office2019ToolbarImageResources.Office2019ToolbarNewNormal, Office2019ToolbarImageResources.Office2019ToolbarNewNormal);
break;
case PaletteMode.SparkleBlue:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewDisabled, Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewDisabled, Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewDisabled, Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparkleOrange:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewDisabled, Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewDisabled, Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewDisabled, Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparklePurple:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewDisabled, Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewDisabled, Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewDisabled, Office2010ToolbarImageResources.Office2010ToolbarNewNormal, Office2010ToolbarImageResources.Office2010ToolbarNewNormal);
break;
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarOpenCommand.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarOpenCommand.cs
index 23d5add71..61a93650f 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarOpenCommand.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarOpenCommand.cs
@@ -2,7 +2,7 @@
/*
*
* Open 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. 2023 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2024. All rights reserved.
*
*/
#endregion
@@ -42,7 +42,7 @@ public class KryptonIntegratedToolbarOpenCommand : KryptonCommand
public ButtonSpecAny? ToolBarOpenButton
{
get => _openButtonSpec ?? new ButtonSpecAny();
- set { _openButtonSpec = value; UpdateImage(KryptonManager.InternalGlobalPaletteMode); }
+ set { _openButtonSpec = value; UpdateImage(KryptonManager.CurrentGlobalPaletteMode); }
}
/// Gets the active image.
@@ -70,7 +70,7 @@ public KryptonIntegratedToolbarOpenCommand()
{
_imageStates = new ButtonImageStates();
- Text = KryptonLanguageManager.ToolBarStrings.Open;
+ Text = KryptonManager.Strings.ToolBarStrings.Open;
}
#endregion
@@ -79,24 +79,24 @@ public KryptonIntegratedToolbarOpenCommand()
/// Updates the image.
/// The help image.
- private void UpdateImage(Image helpImage) => ImageSmall = helpImage;
+ private void UpdateImage(Image? helpImage) => ImageSmall = helpImage;
/// Adds the image states.
/// The active image.
/// The disabled image.
/// The normal image.
/// The pressed image.
- private void AddImageStates(Image? activeImage, Image disabledImage, Image normalImage, Image? pressedImage)
+ private void AddImageStates(Image? activeImage, Image? disabledImage, Image? normalImage, Image? pressedImage)
{
if (_openButtonSpec != null)
{
_openButtonSpec.ImageStates.ImageDisabled = disabledImage;
- _openButtonSpec.ImageStates.ImageTracking = activeImage ?? null;
+ _openButtonSpec.ImageStates.ImageTracking = activeImage;
_openButtonSpec.ImageStates.ImageNormal = normalImage;
- _openButtonSpec.ImageStates.ImagePressed = pressedImage ?? null;
+ _openButtonSpec.ImageStates.ImagePressed = pressedImage;
}
}
@@ -114,7 +114,7 @@ private void UpdateActiveImage(Image activeImage)
/// Updates the disabled image.
/// The disabled image.
- private void UpdateDisabledImage(Image disabledImage)
+ private void UpdateDisabledImage(Image? disabledImage)
{
_disabledImage = disabledImage;
@@ -126,7 +126,7 @@ private void UpdateDisabledImage(Image disabledImage)
/// Updates the normal image.
/// The normal image.
- private void UpdateNormalImage(Image normalImage)
+ private void UpdateNormalImage(Image? normalImage)
{
_normalImage = normalImage;
@@ -138,7 +138,7 @@ private void UpdateNormalImage(Image normalImage)
/// Updates the pressed image.
/// The pressed image.
- private void UpdatePressedImage(Image pressedImage)
+ private void UpdatePressedImage(Image? pressedImage)
{
_pressedImage = pressedImage;
@@ -164,125 +164,59 @@ private void UpdateImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarOpenNormal);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007White:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010White:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarOpenNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
break;
case PaletteMode.SparkleBlue:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparkleOrange:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparklePurple:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
break;
@@ -317,125 +251,59 @@ private void UpdateActiveImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarOpenNormal);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarOpenNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
break;
case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
break;
@@ -461,125 +329,59 @@ private void UpdateDisabledImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarOpenDisabled);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenDisabled);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenDisabled);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenDisabled);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenDisabled);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenDisabled);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenDisabled);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenDisabled);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenDisabled);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenDisabled);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenDisabled);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarOpenDisabled);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenDisabled);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenDisabled);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenDisabled);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenDisabled);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenDisabled);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenDisabled);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenDisabled);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenDisabled);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenDisabled);
- break;
case PaletteMode.Microsoft365White:
UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenDisabled);
break;
case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled);
- break;
case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled);
- break;
case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled);
break;
@@ -605,125 +407,59 @@ private void UpdateNormalImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarOpenNormal);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarOpenNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
break;
case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
break;
@@ -749,125 +485,59 @@ private void UpdatePressedImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarOpenNormal);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarOpenNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
break;
case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
break;
@@ -895,125 +565,59 @@ private void UpdateImageStates(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
AddImageStates(null, Office2003ToolbarImageResources.Office2003ToolbarOpenDisabled, Office2003ToolbarImageResources.Office2003ToolbarOpenNormal, null);
break;
- case PaletteMode.Office2007DarkGray:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal, Office2007ToolbarImageResources.Office2007ToolbarOpenDisabled, Office2007ToolbarImageResources.Office2007ToolbarOpenNormal, Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal, Office2007ToolbarImageResources.Office2007ToolbarOpenDisabled, Office2007ToolbarImageResources.Office2007ToolbarOpenNormal, Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal, Office2007ToolbarImageResources.Office2007ToolbarOpenDisabled, Office2007ToolbarImageResources.Office2007ToolbarOpenNormal, Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal, Office2007ToolbarImageResources.Office2007ToolbarOpenDisabled, Office2007ToolbarImageResources.Office2007ToolbarOpenNormal, Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007Silver:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal, Office2007ToolbarImageResources.Office2007ToolbarOpenDisabled, Office2007ToolbarImageResources.Office2007ToolbarOpenNormal, Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal, Office2007ToolbarImageResources.Office2007ToolbarOpenDisabled, Office2007ToolbarImageResources.Office2007ToolbarOpenNormal, Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal, Office2007ToolbarImageResources.Office2007ToolbarOpenDisabled, Office2007ToolbarImageResources.Office2007ToolbarOpenNormal, Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007White:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal, Office2007ToolbarImageResources.Office2007ToolbarOpenDisabled, Office2007ToolbarImageResources.Office2007ToolbarOpenNormal, Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007Black:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal, Office2007ToolbarImageResources.Office2007ToolbarOpenDisabled, Office2007ToolbarImageResources.Office2007ToolbarOpenNormal, Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarOpenNormal, Office2007ToolbarImageResources.Office2007ToolbarOpenDisabled, Office2007ToolbarImageResources.Office2007ToolbarOpenNormal, Office2007ToolbarImageResources.Office2007ToolbarOpenNormal);
break;
- case PaletteMode.Office2010DarkGray:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010Silver:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010White:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010Black:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal, Office2019ToolbarImageResources.Office2019ToolbarOpenDisabled, Office2019ToolbarImageResources.Office2019ToolbarOpenNormal, Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal, Office2019ToolbarImageResources.Office2019ToolbarOpenDisabled, Office2019ToolbarImageResources.Office2019ToolbarOpenNormal, Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal, Office2019ToolbarImageResources.Office2019ToolbarOpenDisabled, Office2019ToolbarImageResources.Office2019ToolbarOpenNormal, Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal, Office2019ToolbarImageResources.Office2019ToolbarOpenDisabled, Office2019ToolbarImageResources.Office2019ToolbarOpenNormal, Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365Blue:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal, Office2019ToolbarImageResources.Office2019ToolbarOpenDisabled, Office2019ToolbarImageResources.Office2019ToolbarOpenNormal, Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal, Office2019ToolbarImageResources.Office2019ToolbarOpenDisabled, Office2019ToolbarImageResources.Office2019ToolbarOpenNormal, Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal, Office2019ToolbarImageResources.Office2019ToolbarOpenDisabled, Office2019ToolbarImageResources.Office2019ToolbarOpenNormal, Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365Silver:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal, Office2019ToolbarImageResources.Office2019ToolbarOpenDisabled, Office2019ToolbarImageResources.Office2019ToolbarOpenNormal, Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal, Office2019ToolbarImageResources.Office2019ToolbarOpenDisabled, Office2019ToolbarImageResources.Office2019ToolbarOpenNormal, Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal, Office2019ToolbarImageResources.Office2019ToolbarOpenDisabled, Office2019ToolbarImageResources.Office2019ToolbarOpenNormal, Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
- break;
case PaletteMode.Microsoft365White:
AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarOpenNormal, Office2019ToolbarImageResources.Office2019ToolbarOpenDisabled, Office2019ToolbarImageResources.Office2019ToolbarOpenNormal, Office2019ToolbarImageResources.Office2019ToolbarOpenNormal);
break;
case PaletteMode.SparkleBlue:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparkleOrange:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparklePurple:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenDisabled, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal, Office2010ToolbarImageResources.Office2010ToolbarOpenNormal);
break;
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarPageSetupCommand.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarPageSetupCommand.cs
index ba75034a8..d4cc7c467 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarPageSetupCommand.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarPageSetupCommand.cs
@@ -2,7 +2,7 @@
/*
*
* PageSetup 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. 2023 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2024. All rights reserved.
*
*/
#endregion
@@ -42,7 +42,7 @@ public class KryptonIntegratedToolbarPageSetupCommand : KryptonCommand
public ButtonSpecAny? ToolBarPageSetupButton
{
get => _pageSetupButtonSpec ?? new ButtonSpecAny();
- set { _pageSetupButtonSpec = value; UpdateImage(KryptonManager.InternalGlobalPaletteMode); }
+ set { _pageSetupButtonSpec = value; UpdateImage(KryptonManager.CurrentGlobalPaletteMode); }
}
/// Gets the active image.
@@ -70,7 +70,7 @@ public KryptonIntegratedToolbarPageSetupCommand()
{
_imageStates = new ButtonImageStates();
- Text = KryptonLanguageManager.ToolBarStrings.PageSetup;
+ Text = KryptonManager.Strings.ToolBarStrings.PageSetup;
}
#endregion
@@ -79,24 +79,24 @@ public KryptonIntegratedToolbarPageSetupCommand()
/// Updates the image.
/// The help image.
- private void UpdateImage(Image helpImage) => ImageSmall = helpImage;
+ private void UpdateImage(Image? helpImage) => ImageSmall = helpImage;
/// Adds the image states.
/// The active image.
/// The disabled image.
/// The normal image.
/// The pressed image.
- private void AddImageStates(Image? activeImage, Image disabledImage, Image normalImage, Image? pressedImage)
+ private void AddImageStates(Image? activeImage, Image? disabledImage, Image? normalImage, Image? pressedImage)
{
if (_pageSetupButtonSpec != null)
{
_pageSetupButtonSpec.ImageStates.ImageDisabled = disabledImage;
- _pageSetupButtonSpec.ImageStates.ImageTracking = activeImage ?? null;
+ _pageSetupButtonSpec.ImageStates.ImageTracking = activeImage;
_pageSetupButtonSpec.ImageStates.ImageNormal = normalImage;
- _pageSetupButtonSpec.ImageStates.ImagePressed = pressedImage ?? null;
+ _pageSetupButtonSpec.ImageStates.ImagePressed = pressedImage;
}
}
@@ -114,7 +114,7 @@ private void UpdateActiveImage(Image activeImage)
/// Updates the disabled image.
/// The disabled image.
- private void UpdateDisabledImage(Image disabledImage)
+ private void UpdateDisabledImage(Image? disabledImage)
{
_disabledImage = disabledImage;
@@ -126,7 +126,7 @@ private void UpdateDisabledImage(Image disabledImage)
/// Updates the normal image.
/// The normal image.
- private void UpdateNormalImage(Image normalImage)
+ private void UpdateNormalImage(Image? normalImage)
{
_normalImage = normalImage;
@@ -138,7 +138,7 @@ private void UpdateNormalImage(Image normalImage)
/// Updates the pressed image.
/// The pressed image.
- private void UpdatePressedImage(Image pressedImage)
+ private void UpdatePressedImage(Image? pressedImage)
{
_pressedImage = pressedImage;
@@ -164,125 +164,59 @@ private void UpdateImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarPageSetupNormal);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007White:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010White:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarPageSetupNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
break;
case PaletteMode.SparkleBlue:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparkleOrange:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparklePurple:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
break;
@@ -317,125 +251,59 @@ private void UpdateActiveImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarPageSetupNormal);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarPageSetupNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
break;
case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
break;
@@ -461,125 +329,59 @@ private void UpdateDisabledImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarPageSetupDisabled);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupDisabled);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupDisabled);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupDisabled);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupDisabled);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupDisabled);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupDisabled);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupDisabled);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupDisabled);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupDisabled);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupDisabled);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarPageSetupDisabled);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupDisabled);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupDisabled);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupDisabled);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupDisabled);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupDisabled);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupDisabled);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupDisabled);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupDisabled);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupDisabled);
- break;
case PaletteMode.Microsoft365White:
UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupDisabled);
break;
case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled);
- break;
case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled);
- break;
case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled);
break;
@@ -605,125 +407,59 @@ private void UpdateNormalImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarPageSetupNormal);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarPageSetupNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
break;
case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
break;
@@ -749,125 +485,59 @@ private void UpdatePressedImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarPageSetupNormal);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarPageSetupNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
break;
case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
break;
@@ -895,125 +565,59 @@ private void UpdateImageStates(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
AddImageStates(null, Office2003ToolbarImageResources.Office2003ToolbarPageSetupDisabled, Office2003ToolbarImageResources.Office2003ToolbarPageSetupNormal, null);
break;
- case PaletteMode.Office2007DarkGray:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal, Office2007ToolbarImageResources.Office2007ToolbarPageSetupDisabled, Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal, Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal, Office2007ToolbarImageResources.Office2007ToolbarPageSetupDisabled, Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal, Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal, Office2007ToolbarImageResources.Office2007ToolbarPageSetupDisabled, Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal, Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal, Office2007ToolbarImageResources.Office2007ToolbarPageSetupDisabled, Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal, Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007Silver:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal, Office2007ToolbarImageResources.Office2007ToolbarPageSetupDisabled, Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal, Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal, Office2007ToolbarImageResources.Office2007ToolbarPageSetupDisabled, Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal, Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal, Office2007ToolbarImageResources.Office2007ToolbarPageSetupDisabled, Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal, Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007White:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal, Office2007ToolbarImageResources.Office2007ToolbarPageSetupDisabled, Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal, Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007Black:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal, Office2007ToolbarImageResources.Office2007ToolbarPageSetupDisabled, Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal, Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal, Office2007ToolbarImageResources.Office2007ToolbarPageSetupDisabled, Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal, Office2007ToolbarImageResources.Office2007ToolbarPageSetupNormal);
break;
- case PaletteMode.Office2010DarkGray:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010Silver:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010White:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010Black:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal, Office2019ToolbarImageResources.Office2019ToolbarPageSetupDisabled, Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal, Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal, Office2019ToolbarImageResources.Office2019ToolbarPageSetupDisabled, Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal, Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal, Office2019ToolbarImageResources.Office2019ToolbarPageSetupDisabled, Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal, Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal, Office2019ToolbarImageResources.Office2019ToolbarPageSetupDisabled, Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal, Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365Blue:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal, Office2019ToolbarImageResources.Office2019ToolbarPageSetupDisabled, Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal, Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal, Office2019ToolbarImageResources.Office2019ToolbarPageSetupDisabled, Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal, Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal, Office2019ToolbarImageResources.Office2019ToolbarPageSetupDisabled, Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal, Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365Silver:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal, Office2019ToolbarImageResources.Office2019ToolbarPageSetupDisabled, Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal, Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal, Office2019ToolbarImageResources.Office2019ToolbarPageSetupDisabled, Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal, Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal, Office2019ToolbarImageResources.Office2019ToolbarPageSetupDisabled, Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal, Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
- break;
case PaletteMode.Microsoft365White:
AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal, Office2019ToolbarImageResources.Office2019ToolbarPageSetupDisabled, Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal, Office2019ToolbarImageResources.Office2019ToolbarPageSetupNormal);
break;
case PaletteMode.SparkleBlue:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparkleOrange:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparklePurple:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupDisabled, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal, Office2010ToolbarImageResources.Office2010ToolbarPageSetupNormal);
break;
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarPasteCommand.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarPasteCommand.cs
index 2c2357558..2ddb019ce 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarPasteCommand.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarPasteCommand.cs
@@ -2,7 +2,7 @@
/*
*
* Paste 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. 2023 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2024. All rights reserved.
*
*/
#endregion
@@ -42,7 +42,7 @@ public class KryptonIntegratedToolbarPasteCommand : KryptonCommand
public ButtonSpecAny? ToolBarPasteButton
{
get => _pasteButtonSpec ?? new ButtonSpecAny();
- set { _pasteButtonSpec = value; UpdateImage(KryptonManager.InternalGlobalPaletteMode); }
+ set { _pasteButtonSpec = value; UpdateImage(KryptonManager.CurrentGlobalPaletteMode); }
}
/// Gets the active image.
@@ -70,7 +70,7 @@ public KryptonIntegratedToolbarPasteCommand()
{
_imageStates = new ButtonImageStates();
- Text = KryptonLanguageManager.ToolBarStrings.Paste;
+ Text = KryptonManager.Strings.ToolBarStrings.Paste;
}
#endregion
@@ -79,24 +79,24 @@ public KryptonIntegratedToolbarPasteCommand()
/// Updates the image.
/// The help image.
- private void UpdateImage(Image helpImage) => ImageSmall = helpImage;
+ private void UpdateImage(Image? helpImage) => ImageSmall = helpImage;
/// Adds the image states.
/// The active image.
/// The disabled image.
/// The normal image.
/// The pressed image.
- private void AddImageStates(Image? activeImage, Image disabledImage, Image normalImage, Image? pressedImage)
+ private void AddImageStates(Image? activeImage, Image? disabledImage, Image? normalImage, Image? pressedImage)
{
if (_pasteButtonSpec != null)
{
_pasteButtonSpec.ImageStates.ImageDisabled = disabledImage;
- _pasteButtonSpec.ImageStates.ImageTracking = activeImage ?? null;
+ _pasteButtonSpec.ImageStates.ImageTracking = activeImage;
_pasteButtonSpec.ImageStates.ImageNormal = normalImage;
- _pasteButtonSpec.ImageStates.ImagePressed = pressedImage ?? null;
+ _pasteButtonSpec.ImageStates.ImagePressed = pressedImage;
}
}
@@ -114,7 +114,7 @@ private void UpdateActiveImage(Image activeImage)
/// Updates the disabled image.
/// The disabled image.
- private void UpdateDisabledImage(Image disabledImage)
+ private void UpdateDisabledImage(Image? disabledImage)
{
_disabledImage = disabledImage;
@@ -126,7 +126,7 @@ private void UpdateDisabledImage(Image disabledImage)
/// Updates the normal image.
/// The normal image.
- private void UpdateNormalImage(Image normalImage)
+ private void UpdateNormalImage(Image? normalImage)
{
_normalImage = normalImage;
@@ -138,7 +138,7 @@ private void UpdateNormalImage(Image normalImage)
/// Updates the pressed image.
/// The pressed image.
- private void UpdatePressedImage(Image pressedImage)
+ private void UpdatePressedImage(Image? pressedImage)
{
_pressedImage = pressedImage;
@@ -164,131 +164,61 @@ private void UpdateImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarPasteNormal);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007White:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010White:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ case PaletteMode.Custom:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarPasteNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
break;
- case PaletteMode.SparkleBlue:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.SparkleOrange:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.SparklePurple:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.Custom:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
default:
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
}
@@ -312,134 +242,65 @@ private void UpdateActiveImage(PaletteMode mode)
case PaletteMode.Global:
break;
case PaletteMode.ProfessionalSystem:
- UpdateActiveImage(SystemToolbarImageResources.SystemToolbarPasteNormal);
+ UpdateImage(SystemToolbarImageResources.SystemToolbarPasteNormal);
break;
case PaletteMode.ProfessionalOffice2003:
- UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarPasteNormal);
- break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
+ UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarPasteNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
+ UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ case PaletteMode.Custom:
+ UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
- UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarPasteNormal);
- break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
+ UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarPasteNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365White:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
- case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.Custom:
+ UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
break;
default:
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
@@ -456,134 +317,65 @@ private void UpdateDisabledImage(PaletteMode mode)
case PaletteMode.Global:
break;
case PaletteMode.ProfessionalSystem:
- UpdateActiveImage(SystemToolbarImageResources.SystemToolbarPasteDisabled);
+ UpdateImage(SystemToolbarImageResources.SystemToolbarPasteDisabled);
break;
case PaletteMode.ProfessionalOffice2003:
- UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarPasteDisabled);
- break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteDisabled);
+ UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarPasteDisabled);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteDisabled);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteDisabled);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteDisabled);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteDisabled);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteDisabled);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteDisabled);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteDisabled);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteDisabled);
- break;
case PaletteMode.Office2007BlackDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteDisabled);
- break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled);
+ UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPasteDisabled);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled);
- break;
case PaletteMode.Office2010BlackDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled);
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ case PaletteMode.Custom:
+ UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
- UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarPasteDisabled);
- break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteDisabled);
+ UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarPasteDisabled);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteDisabled);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteDisabled);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteDisabled);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteDisabled);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteDisabled);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteDisabled);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteDisabled);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteDisabled);
- break;
case PaletteMode.Microsoft365White:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteDisabled);
- break;
- case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled);
- break;
- case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled);
- break;
- case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled);
- break;
- case PaletteMode.Custom:
+ UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPasteDisabled);
break;
default:
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
@@ -600,134 +392,65 @@ private void UpdateNormalImage(PaletteMode mode)
case PaletteMode.Global:
break;
case PaletteMode.ProfessionalSystem:
- UpdateActiveImage(SystemToolbarImageResources.SystemToolbarPasteNormal);
+ UpdateImage(SystemToolbarImageResources.SystemToolbarPasteNormal);
break;
case PaletteMode.ProfessionalOffice2003:
- UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarPasteNormal);
- break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
+ UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarPasteNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
+ UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ case PaletteMode.Custom:
+ UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
- UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarPasteNormal);
- break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
+ UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarPasteNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365White:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
- case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.Custom:
+ UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
break;
default:
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
@@ -744,134 +467,65 @@ private void UpdatePressedImage(PaletteMode mode)
case PaletteMode.Global:
break;
case PaletteMode.ProfessionalSystem:
- UpdateActiveImage(SystemToolbarImageResources.SystemToolbarPasteNormal);
+ UpdateImage(SystemToolbarImageResources.SystemToolbarPasteNormal);
break;
case PaletteMode.ProfessionalOffice2003:
- UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarPasteNormal);
- break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
+ UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarPasteNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
+ UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ case PaletteMode.Custom:
+ UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
- UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarPasteNormal);
- break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
+ UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarPasteNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365White:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
- case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
- case PaletteMode.Custom:
+ UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
break;
default:
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
@@ -895,125 +549,59 @@ private void UpdateImageStates(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
AddImageStates(null, Office2003ToolbarImageResources.Office2003ToolbarPasteDisabled, Office2003ToolbarImageResources.Office2003ToolbarPasteNormal, null);
break;
- case PaletteMode.Office2007DarkGray:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal, Office2007ToolbarImageResources.Office2007ToolbarPasteDisabled, Office2007ToolbarImageResources.Office2007ToolbarPasteNormal, Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal, Office2007ToolbarImageResources.Office2007ToolbarPasteDisabled, Office2007ToolbarImageResources.Office2007ToolbarPasteNormal, Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal, Office2007ToolbarImageResources.Office2007ToolbarPasteDisabled, Office2007ToolbarImageResources.Office2007ToolbarPasteNormal, Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal, Office2007ToolbarImageResources.Office2007ToolbarPasteDisabled, Office2007ToolbarImageResources.Office2007ToolbarPasteNormal, Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007Silver:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal, Office2007ToolbarImageResources.Office2007ToolbarPasteDisabled, Office2007ToolbarImageResources.Office2007ToolbarPasteNormal, Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal, Office2007ToolbarImageResources.Office2007ToolbarPasteDisabled, Office2007ToolbarImageResources.Office2007ToolbarPasteNormal, Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal, Office2007ToolbarImageResources.Office2007ToolbarPasteDisabled, Office2007ToolbarImageResources.Office2007ToolbarPasteNormal, Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007White:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal, Office2007ToolbarImageResources.Office2007ToolbarPasteDisabled, Office2007ToolbarImageResources.Office2007ToolbarPasteNormal, Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007Black:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal, Office2007ToolbarImageResources.Office2007ToolbarPasteDisabled, Office2007ToolbarImageResources.Office2007ToolbarPasteNormal, Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPasteNormal, Office2007ToolbarImageResources.Office2007ToolbarPasteDisabled, Office2007ToolbarImageResources.Office2007ToolbarPasteNormal, Office2007ToolbarImageResources.Office2007ToolbarPasteNormal);
break;
- case PaletteMode.Office2010DarkGray:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010Silver:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010White:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010Black:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal, Office2019ToolbarImageResources.Office2019ToolbarPasteDisabled, Office2019ToolbarImageResources.Office2019ToolbarPasteNormal, Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal, Office2019ToolbarImageResources.Office2019ToolbarPasteDisabled, Office2019ToolbarImageResources.Office2019ToolbarPasteNormal, Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal, Office2019ToolbarImageResources.Office2019ToolbarPasteDisabled, Office2019ToolbarImageResources.Office2019ToolbarPasteNormal, Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal, Office2019ToolbarImageResources.Office2019ToolbarPasteDisabled, Office2019ToolbarImageResources.Office2019ToolbarPasteNormal, Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365Blue:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal, Office2019ToolbarImageResources.Office2019ToolbarPasteDisabled, Office2019ToolbarImageResources.Office2019ToolbarPasteNormal, Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal, Office2019ToolbarImageResources.Office2019ToolbarPasteDisabled, Office2019ToolbarImageResources.Office2019ToolbarPasteNormal, Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal, Office2019ToolbarImageResources.Office2019ToolbarPasteDisabled, Office2019ToolbarImageResources.Office2019ToolbarPasteNormal, Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365Silver:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal, Office2019ToolbarImageResources.Office2019ToolbarPasteDisabled, Office2019ToolbarImageResources.Office2019ToolbarPasteNormal, Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal, Office2019ToolbarImageResources.Office2019ToolbarPasteDisabled, Office2019ToolbarImageResources.Office2019ToolbarPasteNormal, Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal, Office2019ToolbarImageResources.Office2019ToolbarPasteDisabled, Office2019ToolbarImageResources.Office2019ToolbarPasteNormal, Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
- break;
case PaletteMode.Microsoft365White:
AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPasteNormal, Office2019ToolbarImageResources.Office2019ToolbarPasteDisabled, Office2019ToolbarImageResources.Office2019ToolbarPasteNormal, Office2019ToolbarImageResources.Office2019ToolbarPasteNormal);
break;
case PaletteMode.SparkleBlue:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.SparkleOrange:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.SparklePurple:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteDisabled, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal, Office2010ToolbarImageResources.Office2010ToolbarPasteNormal);
break;
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarPrintCommand.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarPrintCommand.cs
index 02e86cab6..dab01b083 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarPrintCommand.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarPrintCommand.cs
@@ -2,7 +2,7 @@
/*
*
* Print 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. 2023 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2024. All rights reserved.
*
*/
#endregion
@@ -48,7 +48,7 @@ public class KryptonIntegratedToolbarPrintCommand : KryptonCommand
public ButtonSpecAny? ToolBarPrintButton
{
get => _printButtonSpec ?? new ButtonSpecAny();
- set { _printButtonSpec = value; UpdateImage(KryptonManager.InternalGlobalPaletteMode); UpdateButtonSpec(); }
+ set { _printButtonSpec = value; UpdateImage(KryptonManager.CurrentGlobalPaletteMode); UpdateButtonSpec(); }
}
/// Gets the active image.
@@ -80,7 +80,7 @@ public KryptonIntegratedToolbarPrintCommand()
_printButtonSpec = null;
- Text = KryptonLanguageManager.ToolBarStrings.Print;
+ Text = KryptonManager.Strings.ToolBarStrings.Print;
}
#endregion
@@ -89,24 +89,24 @@ public KryptonIntegratedToolbarPrintCommand()
/// Updates the image.
/// The help image.
- private void UpdateImage(Image helpImage) => ImageSmall = helpImage;
+ private void UpdateImage(Image? helpImage) => ImageSmall = helpImage;
/// Adds the image states.
/// The active image.
/// The disabled image.
/// The normal image.
/// The pressed image.
- private void AddImageStates(Image? activeImage, Image disabledImage, Image normalImage, Image? pressedImage)
+ private void AddImageStates(Image? activeImage, Image? disabledImage, Image? normalImage, Image? pressedImage)
{
if (_printButtonSpec != null)
{
_printButtonSpec.ImageStates.ImageDisabled = disabledImage;
- _printButtonSpec.ImageStates.ImageTracking = activeImage ?? null;
+ _printButtonSpec.ImageStates.ImageTracking = activeImage;
_printButtonSpec.ImageStates.ImageNormal = normalImage;
- _printButtonSpec.ImageStates.ImagePressed = pressedImage ?? null;
+ _printButtonSpec.ImageStates.ImagePressed = pressedImage;
}
}
@@ -124,7 +124,7 @@ private void UpdateActiveImage(Image activeImage)
/// Updates the disabled image.
/// The disabled image.
- private void UpdateDisabledImage(Image disabledImage)
+ private void UpdateDisabledImage(Image? disabledImage)
{
_disabledImage = disabledImage;
@@ -136,7 +136,7 @@ private void UpdateDisabledImage(Image disabledImage)
/// Updates the normal image.
/// The normal image.
- private void UpdateNormalImage(Image normalImage)
+ private void UpdateNormalImage(Image? normalImage)
{
_normalImage = normalImage;
@@ -148,7 +148,7 @@ private void UpdateNormalImage(Image normalImage)
/// Updates the pressed image.
/// The pressed image.
- private void UpdatePressedImage(Image pressedImage)
+ private void UpdatePressedImage(Image? pressedImage)
{
_pressedImage = pressedImage;
@@ -174,125 +174,59 @@ private void UpdateImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarPrintNormal);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007White:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010White:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarPrintNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
break;
case PaletteMode.SparkleBlue:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparkleOrange:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparklePurple:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
break;
@@ -327,125 +261,59 @@ private void UpdateActiveImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarPrintNormal);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarPrintNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
break;
case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
break;
@@ -471,125 +339,59 @@ private void UpdateDisabledImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarPrintDisabled);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintDisabled);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintDisabled);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintDisabled);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintDisabled);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintDisabled);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintDisabled);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintDisabled);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintDisabled);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintDisabled);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintDisabled);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarPrintDisabled);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintDisabled);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintDisabled);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintDisabled);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintDisabled);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintDisabled);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintDisabled);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintDisabled);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintDisabled);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintDisabled);
- break;
case PaletteMode.Microsoft365White:
UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintDisabled);
break;
case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled);
- break;
case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled);
- break;
case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled);
break;
@@ -615,125 +417,59 @@ private void UpdateNormalImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarPrintNormal);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarPrintNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
break;
case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
break;
@@ -759,125 +495,59 @@ private void UpdatePressedImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarPrintNormal);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarPrintNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
break;
case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
break;
@@ -905,125 +575,59 @@ private void UpdateImageStates(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
AddImageStates(null, Office2003ToolbarImageResources.Office2003ToolbarPrintDisabled, Office2003ToolbarImageResources.Office2003ToolbarPrintNormal, null);
break;
- case PaletteMode.Office2007DarkGray:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintDisabled, Office2007ToolbarImageResources.Office2007ToolbarPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintDisabled, Office2007ToolbarImageResources.Office2007ToolbarPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintDisabled, Office2007ToolbarImageResources.Office2007ToolbarPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintDisabled, Office2007ToolbarImageResources.Office2007ToolbarPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007Silver:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintDisabled, Office2007ToolbarImageResources.Office2007ToolbarPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintDisabled, Office2007ToolbarImageResources.Office2007ToolbarPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintDisabled, Office2007ToolbarImageResources.Office2007ToolbarPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007White:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintDisabled, Office2007ToolbarImageResources.Office2007ToolbarPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007Black:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintDisabled, Office2007ToolbarImageResources.Office2007ToolbarPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintDisabled, Office2007ToolbarImageResources.Office2007ToolbarPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintNormal);
break;
- case PaletteMode.Office2010DarkGray:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010Silver:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010White:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010Black:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintDisabled, Office2019ToolbarImageResources.Office2019ToolbarPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintDisabled, Office2019ToolbarImageResources.Office2019ToolbarPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintDisabled, Office2019ToolbarImageResources.Office2019ToolbarPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintDisabled, Office2019ToolbarImageResources.Office2019ToolbarPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365Blue:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintDisabled, Office2019ToolbarImageResources.Office2019ToolbarPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintDisabled, Office2019ToolbarImageResources.Office2019ToolbarPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintDisabled, Office2019ToolbarImageResources.Office2019ToolbarPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365Silver:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintDisabled, Office2019ToolbarImageResources.Office2019ToolbarPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintDisabled, Office2019ToolbarImageResources.Office2019ToolbarPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintDisabled, Office2019ToolbarImageResources.Office2019ToolbarPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
- break;
case PaletteMode.Microsoft365White:
AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintDisabled, Office2019ToolbarImageResources.Office2019ToolbarPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintNormal);
break;
case PaletteMode.SparkleBlue:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparkleOrange:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparklePurple:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintNormal);
break;
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarPrintPreviewCommand.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarPrintPreviewCommand.cs
index 2c8fe98cf..0f1f690e5 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarPrintPreviewCommand.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarPrintPreviewCommand.cs
@@ -2,7 +2,7 @@
/*
*
* PrintPreview 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. 2023 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2024. All rights reserved.
*
*/
#endregion
@@ -42,7 +42,7 @@ public class KryptonIntegratedToolbarPrintPreviewCommand : KryptonCommand
public ButtonSpecAny? ToolBarPrintPreviewButton
{
get => _printPreviewButtonSpec ?? new ButtonSpecAny();
- set { _printPreviewButtonSpec = value; UpdateImage(KryptonManager.InternalGlobalPaletteMode); }
+ set { _printPreviewButtonSpec = value; UpdateImage(KryptonManager.CurrentGlobalPaletteMode); }
}
/// Gets the active image.
@@ -70,7 +70,7 @@ public KryptonIntegratedToolbarPrintPreviewCommand()
{
_imageStates = new ButtonImageStates();
- Text = KryptonLanguageManager.ToolBarStrings.PrintPreview;
+ Text = KryptonManager.Strings.ToolBarStrings.PrintPreview;
}
#endregion
@@ -79,24 +79,24 @@ public KryptonIntegratedToolbarPrintPreviewCommand()
/// Updates the image.
/// The help image.
- private void UpdateImage(Image helpImage) => ImageSmall = helpImage;
+ private void UpdateImage(Image? helpImage) => ImageSmall = helpImage;
/// Adds the image states.
/// The active image.
/// The disabled image.
/// The normal image.
/// The pressed image.
- private void AddImageStates(Image? activeImage, Image disabledImage, Image normalImage, Image? pressedImage)
+ private void AddImageStates(Image? activeImage, Image? disabledImage, Image? normalImage, Image? pressedImage)
{
if (_printPreviewButtonSpec != null)
{
_printPreviewButtonSpec.ImageStates.ImageDisabled = disabledImage;
- _printPreviewButtonSpec.ImageStates.ImageTracking = activeImage ?? null;
+ _printPreviewButtonSpec.ImageStates.ImageTracking = activeImage;
_printPreviewButtonSpec.ImageStates.ImageNormal = normalImage;
- _printPreviewButtonSpec.ImageStates.ImagePressed = pressedImage ?? null;
+ _printPreviewButtonSpec.ImageStates.ImagePressed = pressedImage;
}
}
@@ -114,7 +114,7 @@ private void UpdateActiveImage(Image activeImage)
/// Updates the disabled image.
/// The disabled image.
- private void UpdateDisabledImage(Image disabledImage)
+ private void UpdateDisabledImage(Image? disabledImage)
{
_disabledImage = disabledImage;
@@ -126,7 +126,7 @@ private void UpdateDisabledImage(Image disabledImage)
/// Updates the normal image.
/// The normal image.
- private void UpdateNormalImage(Image normalImage)
+ private void UpdateNormalImage(Image? normalImage)
{
_normalImage = normalImage;
@@ -138,7 +138,7 @@ private void UpdateNormalImage(Image normalImage)
/// Updates the pressed image.
/// The pressed image.
- private void UpdatePressedImage(Image pressedImage)
+ private void UpdatePressedImage(Image? pressedImage)
{
_pressedImage = pressedImage;
@@ -164,125 +164,59 @@ private void UpdateImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarPrintPreviewNormal);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007White:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010White:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarPrintPreviewNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
break;
case PaletteMode.SparkleBlue:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparkleOrange:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparklePurple:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
break;
@@ -317,125 +251,59 @@ private void UpdateActiveImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarPrintPreviewNormal);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarPrintPreviewNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
break;
case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
break;
@@ -461,125 +329,59 @@ private void UpdateDisabledImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarPrintPreviewDisabled);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewDisabled);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewDisabled);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewDisabled);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewDisabled);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewDisabled);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewDisabled);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewDisabled);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewDisabled);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewDisabled);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewDisabled);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarPrintPreviewDisabled);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewDisabled);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewDisabled);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewDisabled);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewDisabled);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewDisabled);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewDisabled);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewDisabled);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewDisabled);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewDisabled);
- break;
case PaletteMode.Microsoft365White:
UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewDisabled);
break;
case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled);
- break;
case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled);
- break;
case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled);
break;
@@ -605,125 +407,59 @@ private void UpdateNormalImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarPrintPreviewNormal);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarPrintPreviewNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
break;
case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
break;
@@ -749,125 +485,59 @@ private void UpdatePressedImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarPrintPreviewNormal);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarPrintPreviewNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
break;
case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
break;
@@ -895,125 +565,59 @@ private void UpdateImageStates(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
AddImageStates(null, Office2003ToolbarImageResources.Office2003ToolbarPrintPreviewDisabled, Office2003ToolbarImageResources.Office2003ToolbarPrintPreviewNormal, null);
break;
- case PaletteMode.Office2007DarkGray:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewDisabled, Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewDisabled, Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewDisabled, Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewDisabled, Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007Silver:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewDisabled, Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewDisabled, Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewDisabled, Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007White:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewDisabled, Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007Black:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewDisabled, Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewDisabled, Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal, Office2007ToolbarImageResources.Office2007ToolbarPrintPreviewNormal);
break;
- case PaletteMode.Office2010DarkGray:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010Silver:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010White:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010Black:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewDisabled, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewDisabled, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewDisabled, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewDisabled, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365Blue:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewDisabled, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewDisabled, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewDisabled, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365Silver:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewDisabled, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewDisabled, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewDisabled, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
- break;
case PaletteMode.Microsoft365White:
AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewDisabled, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal, Office2019ToolbarImageResources.Office2019ToolbarPrintPreviewNormal);
break;
case PaletteMode.SparkleBlue:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparkleOrange:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparklePurple:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewDisabled, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal, Office2010ToolbarImageResources.Office2010ToolbarPrintPreviewNormal);
break;
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarQuickPrintCommand.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarQuickPrintCommand.cs
index 835ac1211..7420122c9 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarQuickPrintCommand.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarQuickPrintCommand.cs
@@ -2,7 +2,7 @@
/*
*
* QuickPrint 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. 2023 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2024. All rights reserved.
*
*/
#endregion
@@ -42,7 +42,7 @@ public class KryptonIntegratedToolbarQuickPrintCommand : KryptonCommand
public ButtonSpecAny? ToolBarQuickPrintButton
{
get => _quickPrintButtonSpec ?? new ButtonSpecAny();
- set { _quickPrintButtonSpec = value; UpdateImage(KryptonManager.InternalGlobalPaletteMode); }
+ set { _quickPrintButtonSpec = value; UpdateImage(KryptonManager.CurrentGlobalPaletteMode); }
}
/// Gets the active image.
@@ -70,7 +70,7 @@ public KryptonIntegratedToolbarQuickPrintCommand()
{
_imageStates = new ButtonImageStates();
- Text = KryptonLanguageManager.ToolBarStrings.QuickPrint;
+ Text = KryptonManager.Strings.ToolBarStrings.QuickPrint;
}
#endregion
@@ -79,24 +79,24 @@ public KryptonIntegratedToolbarQuickPrintCommand()
/// Updates the image.
/// The help image.
- private void UpdateImage(Image helpImage) => ImageSmall = helpImage;
+ private void UpdateImage(Image? helpImage) => ImageSmall = helpImage;
/// Adds the image states.
/// The active image.
/// The disabled image.
/// The normal image.
/// The pressed image.
- private void AddImageStates(Image? activeImage, Image disabledImage, Image normalImage, Image? pressedImage)
+ private void AddImageStates(Image? activeImage, Image? disabledImage, Image? normalImage, Image? pressedImage)
{
if (_quickPrintButtonSpec != null)
{
_quickPrintButtonSpec.ImageStates.ImageDisabled = disabledImage;
- _quickPrintButtonSpec.ImageStates.ImageTracking = activeImage ?? null;
+ _quickPrintButtonSpec.ImageStates.ImageTracking = activeImage;
_quickPrintButtonSpec.ImageStates.ImageNormal = normalImage;
- _quickPrintButtonSpec.ImageStates.ImagePressed = pressedImage ?? null;
+ _quickPrintButtonSpec.ImageStates.ImagePressed = pressedImage;
}
}
@@ -114,7 +114,7 @@ private void UpdateActiveImage(Image activeImage)
/// Updates the disabled image.
/// The disabled image.
- private void UpdateDisabledImage(Image disabledImage)
+ private void UpdateDisabledImage(Image? disabledImage)
{
_disabledImage = disabledImage;
@@ -126,7 +126,7 @@ private void UpdateDisabledImage(Image disabledImage)
/// Updates the normal image.
/// The normal image.
- private void UpdateNormalImage(Image normalImage)
+ private void UpdateNormalImage(Image? normalImage)
{
_normalImage = normalImage;
@@ -138,7 +138,7 @@ private void UpdateNormalImage(Image normalImage)
/// Updates the pressed image.
/// The pressed image.
- private void UpdatePressedImage(Image pressedImage)
+ private void UpdatePressedImage(Image? pressedImage)
{
_pressedImage = pressedImage;
@@ -164,125 +164,59 @@ private void UpdateImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateImage(GenericToolbarImageResources.GenericQuickPrint);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007White:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010White:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarQuickPrintNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
break;
case PaletteMode.SparkleBlue:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparkleOrange:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparklePurple:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
break;
@@ -317,125 +251,59 @@ private void UpdateActiveImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateActiveImage(GenericToolbarImageResources.GenericQuickPrint);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarQuickPrintNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
break;
case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
break;
@@ -461,125 +329,59 @@ private void UpdateDisabledImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateActiveImage(GenericToolbarImageResources.GenericQuickPrint);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintDisabled);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintDisabled);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintDisabled);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintDisabled);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintDisabled);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintDisabled);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintDisabled);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintDisabled);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintDisabled);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintDisabled);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarQuickPrintDisabled);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintDisabled);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintDisabled);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintDisabled);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintDisabled);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintDisabled);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintDisabled);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintDisabled);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintDisabled);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintDisabled);
- break;
case PaletteMode.Microsoft365White:
UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintDisabled);
break;
case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled);
- break;
case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled);
- break;
case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled);
break;
@@ -605,125 +407,59 @@ private void UpdateNormalImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateActiveImage(GenericToolbarImageResources.GenericQuickPrint);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarQuickPrintNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
break;
case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
break;
@@ -749,125 +485,59 @@ private void UpdatePressedImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateActiveImage(GenericToolbarImageResources.GenericQuickPrint);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarQuickPrintNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365White:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
- case PaletteMode.SparkleBlue:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
break;
+ case PaletteMode.SparkleBlue:
case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
break;
@@ -895,125 +565,59 @@ private void UpdateImageStates(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
AddImageStates(null, GenericToolbarImageResources.GenericQuickPrint, GenericToolbarImageResources.GenericQuickPrint, null);
break;
- case PaletteMode.Office2007DarkGray:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarQuickPrintDisabled, Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarQuickPrintDisabled, Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarQuickPrintDisabled, Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarQuickPrintDisabled, Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007Silver:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarQuickPrintDisabled, Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarQuickPrintDisabled, Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarQuickPrintDisabled, Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007White:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarQuickPrintDisabled, Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007Black:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarQuickPrintDisabled, Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarQuickPrintDisabled, Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal, Office2007ToolbarImageResources.Office2007ToolbarQuickPrintNormal);
break;
- case PaletteMode.Office2010DarkGray:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010Silver:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010White:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010Black:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintDisabled, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintDisabled, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintDisabled, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintDisabled, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365Blue:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintDisabled, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintDisabled, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintDisabled, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365Silver:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintDisabled, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintDisabled, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintDisabled, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
- break;
case PaletteMode.Microsoft365White:
AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintDisabled, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal, Office2019ToolbarImageResources.Office2019ToolbarQuickPrintNormal);
break;
case PaletteMode.SparkleBlue:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparkleOrange:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparklePurple:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintDisabled, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal, Office2010ToolbarImageResources.Office2010ToolbarQuickPrintNormal);
break;
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarRedoCommand.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarRedoCommand.cs
index 955d64785..e180b50ee 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarRedoCommand.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarRedoCommand.cs
@@ -2,7 +2,7 @@
/*
*
* Redo 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. 2023 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2024. All rights reserved.
*
*/
#endregion
@@ -42,7 +42,7 @@ public class KryptonIntegratedToolbarRedoCommand : KryptonCommand
public ButtonSpecAny? ToolBarRedoButton
{
get => _redoButtonSpec ?? new ButtonSpecAny();
- set { _redoButtonSpec = value; UpdateImage(KryptonManager.InternalGlobalPaletteMode); }
+ set { _redoButtonSpec = value; UpdateImage(KryptonManager.CurrentGlobalPaletteMode); }
}
/// Gets the active image.
@@ -70,7 +70,7 @@ public KryptonIntegratedToolbarRedoCommand()
{
_imageStates = new ButtonImageStates();
- Text = KryptonLanguageManager.ToolBarStrings.Redo;
+ Text = KryptonManager.Strings.ToolBarStrings.Redo;
}
#endregion
@@ -79,24 +79,24 @@ public KryptonIntegratedToolbarRedoCommand()
/// Updates the image.
/// The help image.
- private void UpdateImage(Image helpImage) => ImageSmall = helpImage;
+ private void UpdateImage(Image? helpImage) => ImageSmall = helpImage;
/// Adds the image states.
/// The active image.
/// The disabled image.
/// The normal image.
/// The pressed image.
- private void AddImageStates(Image? activeImage, Image disabledImage, Image normalImage, Image? pressedImage)
+ private void AddImageStates(Image? activeImage, Image? disabledImage, Image? normalImage, Image? pressedImage)
{
if (_redoButtonSpec != null)
{
_redoButtonSpec.ImageStates.ImageDisabled = disabledImage;
- _redoButtonSpec.ImageStates.ImageTracking = activeImage ?? null;
+ _redoButtonSpec.ImageStates.ImageTracking = activeImage;
_redoButtonSpec.ImageStates.ImageNormal = normalImage;
- _redoButtonSpec.ImageStates.ImagePressed = pressedImage ?? null;
+ _redoButtonSpec.ImageStates.ImagePressed = pressedImage;
}
}
@@ -114,7 +114,7 @@ private void UpdateActiveImage(Image activeImage)
/// Updates the disabled image.
/// The disabled image.
- private void UpdateDisabledImage(Image disabledImage)
+ private void UpdateDisabledImage(Image? disabledImage)
{
_disabledImage = disabledImage;
@@ -126,7 +126,7 @@ private void UpdateDisabledImage(Image disabledImage)
/// Updates the normal image.
/// The normal image.
- private void UpdateNormalImage(Image normalImage)
+ private void UpdateNormalImage(Image? normalImage)
{
_normalImage = normalImage;
@@ -138,7 +138,7 @@ private void UpdateNormalImage(Image normalImage)
/// Updates the pressed image.
/// The pressed image.
- private void UpdatePressedImage(Image pressedImage)
+ private void UpdatePressedImage(Image? pressedImage)
{
_pressedImage = pressedImage;
@@ -164,131 +164,61 @@ private void UpdateImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarRedoNormal);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007White:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010White:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ case PaletteMode.Custom:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarRedoNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
break;
- case PaletteMode.SparkleBlue:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.SparkleOrange:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.SparklePurple:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.Custom:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
default:
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
}
@@ -312,134 +242,65 @@ private void UpdateActiveImage(PaletteMode mode)
case PaletteMode.Global:
break;
case PaletteMode.ProfessionalSystem:
- UpdateActiveImage(SystemToolbarImageResources.SystemToolbarRedoNormal);
+ UpdateImage(SystemToolbarImageResources.SystemToolbarRedoNormal);
break;
case PaletteMode.ProfessionalOffice2003:
- UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarRedoNormal);
- break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
+ UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarRedoNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
+ UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ case PaletteMode.Custom:
+ UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
- UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarRedoNormal);
- break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
+ UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarRedoNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365White:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
- case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.Custom:
+ UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
break;
default:
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
@@ -456,134 +317,65 @@ private void UpdateDisabledImage(PaletteMode mode)
case PaletteMode.Global:
break;
case PaletteMode.ProfessionalSystem:
- UpdateActiveImage(SystemToolbarImageResources.SystemToolbarRedoDisabled);
+ UpdateImage(SystemToolbarImageResources.SystemToolbarRedoDisabled);
break;
case PaletteMode.ProfessionalOffice2003:
- UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarRedoDisabled);
- break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoDisabled);
+ UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarRedoDisabled);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoDisabled);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoDisabled);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoDisabled);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoDisabled);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoDisabled);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoDisabled);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoDisabled);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoDisabled);
- break;
case PaletteMode.Office2007BlackDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoDisabled);
- break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled);
+ UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarRedoDisabled);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled);
- break;
case PaletteMode.Office2010BlackDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled);
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ case PaletteMode.Custom:
+ UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
- UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarRedoDisabled);
- break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoDisabled);
+ UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarRedoDisabled);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoDisabled);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoDisabled);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoDisabled);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoDisabled);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoDisabled);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoDisabled);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoDisabled);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoDisabled);
- break;
case PaletteMode.Microsoft365White:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoDisabled);
- break;
- case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled);
- break;
- case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled);
- break;
- case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled);
- break;
- case PaletteMode.Custom:
+ UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarRedoDisabled);
break;
default:
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
@@ -600,134 +392,65 @@ private void UpdateNormalImage(PaletteMode mode)
case PaletteMode.Global:
break;
case PaletteMode.ProfessionalSystem:
- UpdateActiveImage(SystemToolbarImageResources.SystemToolbarRedoNormal);
+ UpdateImage(SystemToolbarImageResources.SystemToolbarRedoNormal);
break;
case PaletteMode.ProfessionalOffice2003:
- UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarRedoNormal);
- break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
+ UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarRedoNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
+ UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ case PaletteMode.Custom:
+ UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
- UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarRedoNormal);
- break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
+ UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarRedoNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365White:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
- case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.Custom:
+ UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
break;
default:
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
@@ -744,134 +467,65 @@ private void UpdatePressedImage(PaletteMode mode)
case PaletteMode.Global:
break;
case PaletteMode.ProfessionalSystem:
- UpdateActiveImage(SystemToolbarImageResources.SystemToolbarRedoNormal);
+ UpdateImage(SystemToolbarImageResources.SystemToolbarRedoNormal);
break;
case PaletteMode.ProfessionalOffice2003:
- UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarRedoNormal);
- break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
+ UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarRedoNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
+ UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ case PaletteMode.Custom:
+ UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
- UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarRedoNormal);
- break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
+ UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarRedoNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365White:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
- case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
- case PaletteMode.Custom:
+ UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
break;
default:
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
@@ -895,127 +549,61 @@ private void UpdateImageStates(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
AddImageStates(null, Office2003ToolbarImageResources.Office2003ToolbarRedoDisabled, Office2003ToolbarImageResources.Office2003ToolbarRedoNormal, null);
break;
- case PaletteMode.Office2007DarkGray:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal, Office2007ToolbarImageResources.Office2007ToolbarRedoDisabled, Office2007ToolbarImageResources.Office2007ToolbarRedoNormal, Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal, Office2007ToolbarImageResources.Office2007ToolbarRedoDisabled, Office2007ToolbarImageResources.Office2007ToolbarRedoNormal, Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal, Office2007ToolbarImageResources.Office2007ToolbarRedoDisabled, Office2007ToolbarImageResources.Office2007ToolbarRedoNormal, Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal, Office2007ToolbarImageResources.Office2007ToolbarRedoDisabled, Office2007ToolbarImageResources.Office2007ToolbarRedoNormal, Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007Silver:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal, Office2007ToolbarImageResources.Office2007ToolbarRedoDisabled, Office2007ToolbarImageResources.Office2007ToolbarRedoNormal, Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal, Office2007ToolbarImageResources.Office2007ToolbarRedoDisabled, Office2007ToolbarImageResources.Office2007ToolbarRedoNormal, Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal, Office2007ToolbarImageResources.Office2007ToolbarRedoDisabled, Office2007ToolbarImageResources.Office2007ToolbarRedoNormal, Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007White:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal, Office2007ToolbarImageResources.Office2007ToolbarRedoDisabled, Office2007ToolbarImageResources.Office2007ToolbarRedoNormal, Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007Black:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal, Office2007ToolbarImageResources.Office2007ToolbarRedoDisabled, Office2007ToolbarImageResources.Office2007ToolbarRedoNormal, Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarRedoNormal, Office2007ToolbarImageResources.Office2007ToolbarRedoDisabled, Office2007ToolbarImageResources.Office2007ToolbarRedoNormal, Office2007ToolbarImageResources.Office2007ToolbarRedoNormal);
break;
- case PaletteMode.Office2010DarkGray:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010Silver:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010White:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010Black:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal, Office2019ToolbarImageResources.Office2019ToolbarRedoDisabled, Office2019ToolbarImageResources.Office2019ToolbarRedoNormal, Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal, Office2019ToolbarImageResources.Office2019ToolbarRedoDisabled, Office2019ToolbarImageResources.Office2019ToolbarRedoNormal, Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal, Office2019ToolbarImageResources.Office2019ToolbarRedoDisabled, Office2019ToolbarImageResources.Office2019ToolbarRedoNormal, Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal, Office2019ToolbarImageResources.Office2019ToolbarRedoDisabled, Office2019ToolbarImageResources.Office2019ToolbarRedoNormal, Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365Blue:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal, Office2019ToolbarImageResources.Office2019ToolbarRedoDisabled, Office2019ToolbarImageResources.Office2019ToolbarRedoNormal, Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal, Office2019ToolbarImageResources.Office2019ToolbarRedoDisabled, Office2019ToolbarImageResources.Office2019ToolbarRedoNormal, Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal, Office2019ToolbarImageResources.Office2019ToolbarRedoDisabled, Office2019ToolbarImageResources.Office2019ToolbarRedoNormal, Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365Silver:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal, Office2019ToolbarImageResources.Office2019ToolbarRedoDisabled, Office2019ToolbarImageResources.Office2019ToolbarRedoNormal, Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal, Office2019ToolbarImageResources.Office2019ToolbarRedoDisabled, Office2019ToolbarImageResources.Office2019ToolbarRedoNormal, Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal, Office2019ToolbarImageResources.Office2019ToolbarRedoDisabled, Office2019ToolbarImageResources.Office2019ToolbarRedoNormal, Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
- break;
case PaletteMode.Microsoft365White:
AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal, Office2019ToolbarImageResources.Office2019ToolbarRedoDisabled, Office2019ToolbarImageResources.Office2019ToolbarRedoNormal, Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
break;
case PaletteMode.SparkleBlue:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.SparkleOrange:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.SparklePurple:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
+ AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoDisabled, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal, Office2010ToolbarImageResources.Office2010ToolbarRedoNormal);
break;
case PaletteMode.Custom:
AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarRedoNormal, Office2019ToolbarImageResources.Office2019ToolbarRedoDisabled, Office2019ToolbarImageResources.Office2019ToolbarRedoNormal, Office2019ToolbarImageResources.Office2019ToolbarRedoNormal);
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarSaveAllCommand.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarSaveAllCommand.cs
index 794b84ea7..a34dbc786 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarSaveAllCommand.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarSaveAllCommand.cs
@@ -2,7 +2,7 @@
/*
*
* SaveAll 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. 2023 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2024. All rights reserved.
*
*/
#endregion
@@ -48,7 +48,7 @@ public class KryptonIntegratedToolbarSaveAllCommand : KryptonCommand
public ButtonSpecAny? ToolBarSaveAllButton
{
get => _saveAllButtonSpec ?? new ButtonSpecAny();
- set { _saveAllButtonSpec = value; UpdateImage(KryptonManager.InternalGlobalPaletteMode); }
+ set { _saveAllButtonSpec = value; UpdateImage(KryptonManager.CurrentGlobalPaletteMode); }
}
/// Gets the active image.
@@ -78,7 +78,7 @@ public KryptonIntegratedToolbarSaveAllCommand()
_style = PaletteButtonSpecStyle.SaveAll;
- Text = KryptonLanguageManager.ToolBarStrings.SaveAll;
+ Text = KryptonManager.Strings.ToolBarStrings.SaveAll;
UpdateButtonSpec();
}
@@ -89,24 +89,24 @@ public KryptonIntegratedToolbarSaveAllCommand()
/// Updates the image.
/// The help image.
- private void UpdateImage(Image helpImage) => ImageSmall = helpImage;
+ private void UpdateImage(Image? helpImage) => ImageSmall = helpImage;
/// Adds the image states.
/// The active image.
/// The disabled image.
/// The normal image.
/// The pressed image.
- private void AddImageStates(Image? activeImage, Image disabledImage, Image normalImage, Image? pressedImage)
+ private void AddImageStates(Image? activeImage, Image? disabledImage, Image? normalImage, Image? pressedImage)
{
if (_saveAllButtonSpec != null)
{
_saveAllButtonSpec.ImageStates.ImageDisabled = disabledImage;
- _saveAllButtonSpec.ImageStates.ImageTracking = activeImage ?? null;
+ _saveAllButtonSpec.ImageStates.ImageTracking = activeImage;
_saveAllButtonSpec.ImageStates.ImageNormal = normalImage;
- _saveAllButtonSpec.ImageStates.ImagePressed = pressedImage ?? null;
+ _saveAllButtonSpec.ImageStates.ImagePressed = pressedImage;
}
}
@@ -124,7 +124,7 @@ private void UpdateActiveImage(Image activeImage)
/// Updates the disabled image.
/// The disabled image.
- private void UpdateDisabledImage(Image disabledImage)
+ private void UpdateDisabledImage(Image? disabledImage)
{
_disabledImage = disabledImage;
@@ -136,7 +136,7 @@ private void UpdateDisabledImage(Image disabledImage)
/// Updates the normal image.
/// The normal image.
- private void UpdateNormalImage(Image normalImage)
+ private void UpdateNormalImage(Image? normalImage)
{
_normalImage = normalImage;
@@ -148,7 +148,7 @@ private void UpdateNormalImage(Image normalImage)
/// Updates the pressed image.
/// The pressed image.
- private void UpdatePressedImage(Image pressedImage)
+ private void UpdatePressedImage(Image? pressedImage)
{
_pressedImage = pressedImage;
@@ -174,131 +174,61 @@ private void UpdateImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarSaveAllNormal);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007White:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010White:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ case PaletteMode.Custom:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarSaveAllNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
break;
- case PaletteMode.SparkleBlue:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparkleOrange:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparklePurple:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.Custom:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
default:
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
}
@@ -322,134 +252,65 @@ private void UpdateActiveImage(PaletteMode mode)
case PaletteMode.Global:
break;
case PaletteMode.ProfessionalSystem:
- UpdateActiveImage(SystemToolbarImageResources.SystemToolbarSaveAllNormal);
+ UpdateImage(SystemToolbarImageResources.SystemToolbarSaveAllNormal);
break;
case PaletteMode.ProfessionalOffice2003:
- UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarSaveAllNormal);
- break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
+ UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarSaveAllNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
+ UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ case PaletteMode.Custom:
+ UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
- UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarSaveAllNormal);
- break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
+ UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarSaveAllNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365White:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.Custom:
+ UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
break;
default:
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
@@ -466,134 +327,65 @@ private void UpdateDisabledImage(PaletteMode mode)
case PaletteMode.Global:
break;
case PaletteMode.ProfessionalSystem:
- UpdateActiveImage(SystemToolbarImageResources.SystemToolbarSaveAllDisabled);
+ UpdateImage(SystemToolbarImageResources.SystemToolbarSaveAllDisabled);
break;
case PaletteMode.ProfessionalOffice2003:
- UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarSaveAllDisabled);
- break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllDisabled);
+ UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarSaveAllDisabled);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllDisabled);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllDisabled);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllDisabled);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllDisabled);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllDisabled);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllDisabled);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllDisabled);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllDisabled);
- break;
case PaletteMode.Office2007BlackDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllDisabled);
- break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled);
+ UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllDisabled);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled);
- break;
case PaletteMode.Office2010BlackDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled);
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ case PaletteMode.Custom:
+ UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
- UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarSaveAllDisabled);
- break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllDisabled);
+ UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarSaveAllDisabled);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllDisabled);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllDisabled);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllDisabled);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllDisabled);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllDisabled);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllDisabled);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllDisabled);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllDisabled);
- break;
case PaletteMode.Microsoft365White:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllDisabled);
- break;
- case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled);
- break;
- case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled);
- break;
- case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled);
- break;
- case PaletteMode.Custom:
+ UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllDisabled);
break;
default:
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
@@ -610,134 +402,65 @@ private void UpdateNormalImage(PaletteMode mode)
case PaletteMode.Global:
break;
case PaletteMode.ProfessionalSystem:
- UpdateActiveImage(SystemToolbarImageResources.SystemToolbarSaveAllNormal);
+ UpdateImage(SystemToolbarImageResources.SystemToolbarSaveAllNormal);
break;
case PaletteMode.ProfessionalOffice2003:
- UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarSaveAllNormal);
- break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
+ UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarSaveAllNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
+ UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ case PaletteMode.Custom:
+ UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
- UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarSaveAllNormal);
- break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
+ UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarSaveAllNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365White:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.Custom:
+ UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
break;
default:
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
@@ -754,134 +477,65 @@ private void UpdatePressedImage(PaletteMode mode)
case PaletteMode.Global:
break;
case PaletteMode.ProfessionalSystem:
- UpdateActiveImage(SystemToolbarImageResources.SystemToolbarSaveAllNormal);
+ UpdateImage(SystemToolbarImageResources.SystemToolbarSaveAllNormal);
break;
case PaletteMode.ProfessionalOffice2003:
- UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarSaveAllNormal);
- break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
+ UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarSaveAllNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
+ UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ case PaletteMode.Custom:
+ UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
- UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarSaveAllNormal);
- break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
+ UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarSaveAllNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365White:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
- case PaletteMode.Custom:
+ UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
break;
default:
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
@@ -905,125 +559,59 @@ private void UpdateImageStates(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
AddImageStates(null, Office2003ToolbarImageResources.Office2003ToolbarSaveAllDisabled, Office2003ToolbarImageResources.Office2003ToolbarSaveAllNormal, null);
break;
- case PaletteMode.Office2007DarkGray:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAllDisabled, Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAllDisabled, Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAllDisabled, Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAllDisabled, Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007Silver:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAllDisabled, Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAllDisabled, Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAllDisabled, Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007White:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAllDisabled, Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007Black:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAllDisabled, Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAllDisabled, Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAllNormal);
break;
- case PaletteMode.Office2010DarkGray:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010Silver:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010White:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010Black:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAllDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAllDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAllDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAllDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365Blue:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAllDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAllDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAllDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365Silver:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAllDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAllDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAllDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
- break;
case PaletteMode.Microsoft365White:
AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAllDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAllNormal);
break;
case PaletteMode.SparkleBlue:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.SparkleOrange:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.SparklePurple:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAllNormal);
break;
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarSaveAsCommand.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarSaveAsCommand.cs
index db553cc64..e62f126e1 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarSaveAsCommand.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarSaveAsCommand.cs
@@ -2,7 +2,7 @@
/*
*
* SaveAs 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. 2023 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2024. All rights reserved.
*
*/
#endregion
@@ -42,7 +42,7 @@ public class KryptonIntegratedToolbarSaveAsCommand : KryptonCommand
public ButtonSpecAny? ToolBarSaveAsButton
{
get => _saveAsButtonSpec ?? new ButtonSpecAny();
- set { _saveAsButtonSpec = value; UpdateImage(KryptonManager.InternalGlobalPaletteMode); }
+ set { _saveAsButtonSpec = value; UpdateImage(KryptonManager.CurrentGlobalPaletteMode); }
}
/// Gets the active image.
@@ -70,7 +70,7 @@ public KryptonIntegratedToolbarSaveAsCommand()
{
_imageStates = new ButtonImageStates();
- Text = KryptonLanguageManager.ToolBarStrings.SaveAs;
+ Text = KryptonManager.Strings.ToolBarStrings.SaveAs;
}
#endregion
@@ -79,24 +79,24 @@ public KryptonIntegratedToolbarSaveAsCommand()
/// Updates the image.
/// The help image.
- private void UpdateImage(Image helpImage) => ImageSmall = helpImage;
+ private void UpdateImage(Image? helpImage) => ImageSmall = helpImage;
/// Adds the image states.
/// The active image.
/// The disabled image.
/// The normal image.
/// The pressed image.
- private void AddImageStates(Image? activeImage, Image disabledImage, Image normalImage, Image? pressedImage)
+ private void AddImageStates(Image? activeImage, Image? disabledImage, Image? normalImage, Image? pressedImage)
{
if (_saveAsButtonSpec != null)
{
_saveAsButtonSpec.ImageStates.ImageDisabled = disabledImage;
- _saveAsButtonSpec.ImageStates.ImageTracking = activeImage ?? null;
+ _saveAsButtonSpec.ImageStates.ImageTracking = activeImage;
_saveAsButtonSpec.ImageStates.ImageNormal = normalImage;
- _saveAsButtonSpec.ImageStates.ImagePressed = pressedImage ?? null;
+ _saveAsButtonSpec.ImageStates.ImagePressed = pressedImage;
}
}
@@ -114,7 +114,7 @@ private void UpdateActiveImage(Image activeImage)
/// Updates the disabled image.
/// The disabled image.
- private void UpdateDisabledImage(Image disabledImage)
+ private void UpdateDisabledImage(Image? disabledImage)
{
_disabledImage = disabledImage;
@@ -126,7 +126,7 @@ private void UpdateDisabledImage(Image disabledImage)
/// Updates the normal image.
/// The normal image.
- private void UpdateNormalImage(Image normalImage)
+ private void UpdateNormalImage(Image? normalImage)
{
_normalImage = normalImage;
@@ -138,7 +138,7 @@ private void UpdateNormalImage(Image normalImage)
/// Updates the pressed image.
/// The pressed image.
- private void UpdatePressedImage(Image pressedImage)
+ private void UpdatePressedImage(Image? pressedImage)
{
_pressedImage = pressedImage;
@@ -162,133 +162,63 @@ private void UpdateImage(PaletteMode mode)
UpdateImage(SystemToolbarImageResources.SystemToolbarSaveNormal);
break;
case PaletteMode.ProfessionalOffice2003:
- UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarSaveNormal);
- break;
- case PaletteMode.Office2007DarkGray:
UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007White:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010White:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ case PaletteMode.Custom:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarSaveAsNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
break;
- case PaletteMode.SparkleBlue:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparkleOrange:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparklePurple:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.Custom:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
default:
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
}
@@ -312,134 +242,65 @@ private void UpdateActiveImage(PaletteMode mode)
case PaletteMode.Global:
break;
case PaletteMode.ProfessionalSystem:
- UpdateActiveImage(GenericToolbarImageResources.GenericSaveAs);
+ UpdateImage(SystemToolbarImageResources.SystemToolbarSaveNormal);
break;
case PaletteMode.ProfessionalOffice2003:
- UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarSaveNormal);
- break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
+ UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
+ UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ case PaletteMode.Custom:
+ UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
- UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarSaveAsNormal);
- break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
+ UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarSaveAsNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365White:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.Custom:
+ UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
break;
default:
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
@@ -456,134 +317,65 @@ private void UpdateDisabledImage(PaletteMode mode)
case PaletteMode.Global:
break;
case PaletteMode.ProfessionalSystem:
- UpdateActiveImage(GenericToolbarImageResources.GenericSaveAs);
+ UpdateImage(SystemToolbarImageResources.SystemToolbarSaveDisabled);
break;
case PaletteMode.ProfessionalOffice2003:
- UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarSaveDisabled);
- break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsDisabled);
+ UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsDisabled);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsDisabled);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsDisabled);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsDisabled);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsDisabled);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsDisabled);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsDisabled);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsDisabled);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsDisabled);
- break;
case PaletteMode.Office2007BlackDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsDisabled);
- break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled);
+ UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsDisabled);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled);
- break;
case PaletteMode.Office2010BlackDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled);
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ case PaletteMode.Custom:
+ UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
- UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarSaveAsDisabled);
- break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsDisabled);
+ UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarSaveAsDisabled);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsDisabled);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsDisabled);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsDisabled);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsDisabled);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsDisabled);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsDisabled);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsDisabled);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsDisabled);
- break;
case PaletteMode.Microsoft365White:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsDisabled);
- break;
- case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled);
- break;
- case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled);
- break;
- case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled);
- break;
- case PaletteMode.Custom:
+ UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsDisabled);
break;
default:
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
@@ -600,134 +392,65 @@ private void UpdateNormalImage(PaletteMode mode)
case PaletteMode.Global:
break;
case PaletteMode.ProfessionalSystem:
- UpdateActiveImage(GenericToolbarImageResources.GenericSaveAs);
+ UpdateImage(SystemToolbarImageResources.SystemToolbarSaveNormal);
break;
case PaletteMode.ProfessionalOffice2003:
- UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarSaveNormal);
- break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
+ UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
+ UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ case PaletteMode.Custom:
+ UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
- UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarSaveAsNormal);
- break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
+ UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarSaveAsNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365White:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.Custom:
+ UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
break;
default:
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
@@ -744,134 +467,65 @@ private void UpdatePressedImage(PaletteMode mode)
case PaletteMode.Global:
break;
case PaletteMode.ProfessionalSystem:
- UpdateActiveImage(GenericToolbarImageResources.GenericSaveAs);
+ UpdateImage(SystemToolbarImageResources.SystemToolbarSaveNormal);
break;
case PaletteMode.ProfessionalOffice2003:
- UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarSaveNormal);
- break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
+ UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
+ UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ case PaletteMode.Custom:
+ UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
- UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarSaveAsNormal);
- break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
+ UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarSaveAsNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365White:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
- case PaletteMode.Custom:
+ UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
break;
default:
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
@@ -895,125 +549,59 @@ private void UpdateImageStates(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
AddImageStates(null, Office2003ToolbarImageResources.Office2003ToolbarSaveDisabled, Office2003ToolbarImageResources.Office2003ToolbarSaveNormal, null);
break;
- case PaletteMode.Office2007DarkGray:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAsDisabled, Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAsDisabled, Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAsDisabled, Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAsDisabled, Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007Silver:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAsDisabled, Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAsDisabled, Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAsDisabled, Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007White:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAsDisabled, Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007Black:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAsDisabled, Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAsDisabled, Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveAsNormal);
break;
- case PaletteMode.Office2010DarkGray:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010Silver:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010White:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010Black:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAsDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAsDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAsDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAsDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365Blue:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAsDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAsDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAsDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365Silver:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAsDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAsDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAsDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
- break;
case PaletteMode.Microsoft365White:
AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAsDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveAsNormal);
break;
case PaletteMode.SparkleBlue:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.SparkleOrange:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.SparklePurple:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveAsNormal);
break;
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarSaveCommand.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarSaveCommand.cs
index ba59a3287..d0a7cb6bd 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarSaveCommand.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarSaveCommand.cs
@@ -2,7 +2,7 @@
/*
*
* Save 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. 2023 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2024. All rights reserved.
*
*/
#endregion
@@ -42,7 +42,7 @@ public class KryptonIntegratedToolbarSaveCommand : KryptonCommand
public ButtonSpecAny? ToolBarSaveButton
{
get => _saveButtonSpec ?? new ButtonSpecAny();
- set { _saveButtonSpec = value; UpdateImage(KryptonManager.InternalGlobalPaletteMode); }
+ set { _saveButtonSpec = value; UpdateImage(KryptonManager.CurrentGlobalPaletteMode); }
}
/// Gets the active image.
@@ -70,7 +70,7 @@ public KryptonIntegratedToolbarSaveCommand()
{
_imageStates = new ButtonImageStates();
- Text = KryptonLanguageManager.ToolBarStrings.Save;
+ Text = KryptonManager.Strings.ToolBarStrings.Save;
}
#endregion
@@ -79,24 +79,24 @@ public KryptonIntegratedToolbarSaveCommand()
/// Updates the image.
/// The help image.
- private void UpdateImage(Image helpImage) => ImageSmall = helpImage;
+ private void UpdateImage(Image? helpImage) => ImageSmall = helpImage;
/// Adds the image states.
/// The active image.
/// The disabled image.
/// The normal image.
/// The pressed image.
- private void AddImageStates(Image? activeImage, Image disabledImage, Image normalImage, Image? pressedImage)
+ private void AddImageStates(Image? activeImage, Image? disabledImage, Image? normalImage, Image? pressedImage)
{
if (_saveButtonSpec != null)
{
_saveButtonSpec.ImageStates.ImageDisabled = disabledImage;
- _saveButtonSpec.ImageStates.ImageTracking = activeImage ?? null;
+ _saveButtonSpec.ImageStates.ImageTracking = activeImage;
_saveButtonSpec.ImageStates.ImageNormal = normalImage;
- _saveButtonSpec.ImageStates.ImagePressed = pressedImage ?? null;
+ _saveButtonSpec.ImageStates.ImagePressed = pressedImage;
}
}
@@ -114,7 +114,7 @@ private void UpdateActiveImage(Image activeImage)
/// Updates the disabled image.
/// The disabled image.
- private void UpdateDisabledImage(Image disabledImage)
+ private void UpdateDisabledImage(Image? disabledImage)
{
_disabledImage = disabledImage;
@@ -126,7 +126,7 @@ private void UpdateDisabledImage(Image disabledImage)
/// Updates the normal image.
/// The normal image.
- private void UpdateNormalImage(Image normalImage)
+ private void UpdateNormalImage(Image? normalImage)
{
_normalImage = normalImage;
@@ -138,7 +138,7 @@ private void UpdateNormalImage(Image normalImage)
/// Updates the pressed image.
/// The pressed image.
- private void UpdatePressedImage(Image pressedImage)
+ private void UpdatePressedImage(Image? pressedImage)
{
_pressedImage = pressedImage;
@@ -164,131 +164,61 @@ private void UpdateImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarSaveNormal);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007White:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010White:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ case PaletteMode.Custom:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarSaveNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
break;
- case PaletteMode.SparkleBlue:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.SparkleOrange:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.SparklePurple:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.Custom:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
default:
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
}
@@ -312,134 +242,65 @@ private void UpdateActiveImage(PaletteMode mode)
case PaletteMode.Global:
break;
case PaletteMode.ProfessionalSystem:
- UpdateActiveImage(GenericToolbarImageResources.GenericSave);
+ UpdateImage(SystemToolbarImageResources.SystemToolbarSaveNormal);
break;
case PaletteMode.ProfessionalOffice2003:
- UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarSaveNormal);
- break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
+ UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarSaveNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
+ UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ case PaletteMode.Custom:
+ UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
- UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarSaveNormal);
- break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
+ UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarSaveNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365White:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
- case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.Custom:
+ UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
break;
default:
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
@@ -456,134 +317,65 @@ private void UpdateDisabledImage(PaletteMode mode)
case PaletteMode.Global:
break;
case PaletteMode.ProfessionalSystem:
- UpdateActiveImage(GenericToolbarImageResources.GenericSave);
+ UpdateImage(SystemToolbarImageResources.SystemToolbarSaveDisabled);
break;
case PaletteMode.ProfessionalOffice2003:
- UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarSaveDisabled);
- break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveDisabled);
+ UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarSaveDisabled);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveDisabled);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveDisabled);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveDisabled);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveDisabled);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveDisabled);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveDisabled);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveDisabled);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveDisabled);
- break;
case PaletteMode.Office2007BlackDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveDisabled);
- break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled);
+ UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveDisabled);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled);
- break;
case PaletteMode.Office2010BlackDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled);
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ case PaletteMode.Custom:
+ UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
- UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarSaveDisabled);
- break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveDisabled);
+ UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarSaveDisabled);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveDisabled);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveDisabled);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveDisabled);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveDisabled);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveDisabled);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveDisabled);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveDisabled);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveDisabled);
- break;
case PaletteMode.Microsoft365White:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveDisabled);
- break;
- case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled);
- break;
- case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled);
- break;
- case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled);
- break;
- case PaletteMode.Custom:
+ UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveDisabled);
break;
default:
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
@@ -600,134 +392,65 @@ private void UpdateNormalImage(PaletteMode mode)
case PaletteMode.Global:
break;
case PaletteMode.ProfessionalSystem:
- UpdateActiveImage(GenericToolbarImageResources.GenericSave);
+ UpdateImage(SystemToolbarImageResources.SystemToolbarSaveNormal);
break;
case PaletteMode.ProfessionalOffice2003:
- UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarSaveNormal);
- break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
+ UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarSaveNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
+ UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ case PaletteMode.Custom:
+ UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
- UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarSaveNormal);
- break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
+ UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarSaveNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365White:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
- case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.Custom:
+ UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
break;
default:
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
@@ -744,134 +467,65 @@ private void UpdatePressedImage(PaletteMode mode)
case PaletteMode.Global:
break;
case PaletteMode.ProfessionalSystem:
- UpdateActiveImage(GenericToolbarImageResources.GenericSave);
+ UpdateImage(SystemToolbarImageResources.SystemToolbarSaveNormal);
break;
case PaletteMode.ProfessionalOffice2003:
- UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarSaveNormal);
- break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
+ UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarSaveNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
+ UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ case PaletteMode.Custom:
+ UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
- UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarSaveNormal);
- break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
+ UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarSaveNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365White:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
- case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
- case PaletteMode.Custom:
+ UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
break;
default:
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
@@ -895,125 +549,59 @@ private void UpdateImageStates(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
AddImageStates(null, Office2003ToolbarImageResources.Office2003ToolbarSaveDisabled, Office2003ToolbarImageResources.Office2003ToolbarSaveNormal, null);
break;
- case PaletteMode.Office2007DarkGray:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveDisabled, Office2007ToolbarImageResources.Office2007ToolbarSaveNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveDisabled, Office2007ToolbarImageResources.Office2007ToolbarSaveNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveDisabled, Office2007ToolbarImageResources.Office2007ToolbarSaveNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveDisabled, Office2007ToolbarImageResources.Office2007ToolbarSaveNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007Silver:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveDisabled, Office2007ToolbarImageResources.Office2007ToolbarSaveNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveDisabled, Office2007ToolbarImageResources.Office2007ToolbarSaveNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveDisabled, Office2007ToolbarImageResources.Office2007ToolbarSaveNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007White:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveDisabled, Office2007ToolbarImageResources.Office2007ToolbarSaveNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007Black:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveDisabled, Office2007ToolbarImageResources.Office2007ToolbarSaveNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarSaveNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveDisabled, Office2007ToolbarImageResources.Office2007ToolbarSaveNormal, Office2007ToolbarImageResources.Office2007ToolbarSaveNormal);
break;
- case PaletteMode.Office2010DarkGray:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010Silver:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010White:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010Black:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365Blue:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365Silver:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
- break;
case PaletteMode.Microsoft365White:
AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarSaveNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveDisabled, Office2019ToolbarImageResources.Office2019ToolbarSaveNormal, Office2019ToolbarImageResources.Office2019ToolbarSaveNormal);
break;
case PaletteMode.SparkleBlue:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.SparkleOrange:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.SparklePurple:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveDisabled, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal, Office2010ToolbarImageResources.Office2010ToolbarSaveNormal);
break;
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarUndoCommand.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarUndoCommand.cs
index cfa4d0e5b..966f3991c 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarUndoCommand.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonIntegratedToolbarUndoCommand.cs
@@ -2,7 +2,7 @@
/*
*
* Undo 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. 2023 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2024. All rights reserved.
*
*/
#endregion
@@ -42,7 +42,7 @@ public class KryptonIntegratedToolbarUndoCommand : KryptonCommand
public ButtonSpecAny? ToolBarUndoButton
{
get => _undoButtonSpec ?? new ButtonSpecAny();
- set { _undoButtonSpec = value; UpdateImage(KryptonManager.InternalGlobalPaletteMode); }
+ set { _undoButtonSpec = value; UpdateImage(KryptonManager.CurrentGlobalPaletteMode); }
}
/// Gets the active image.
@@ -70,7 +70,7 @@ public KryptonIntegratedToolbarUndoCommand()
{
_imageStates = new ButtonImageStates();
- Text = KryptonLanguageManager.ToolBarStrings.Undo;
+ Text = KryptonManager.Strings.ToolBarStrings.Undo;
}
#endregion
@@ -79,24 +79,24 @@ public KryptonIntegratedToolbarUndoCommand()
/// Updates the image.
/// The help image.
- private void UpdateImage(Image helpImage) => ImageSmall = helpImage;
+ private void UpdateImage(Image? helpImage) => ImageSmall = helpImage;
/// Adds the image states.
/// The active image.
/// The disabled image.
/// The normal image.
/// The pressed image.
- private void AddImageStates(Image? activeImage, Image disabledImage, Image normalImage, Image? pressedImage)
+ private void AddImageStates(Image? activeImage, Image? disabledImage, Image? normalImage, Image? pressedImage)
{
if (_undoButtonSpec != null)
{
_undoButtonSpec.ImageStates.ImageDisabled = disabledImage;
- _undoButtonSpec.ImageStates.ImageTracking = activeImage ?? null;
+ _undoButtonSpec.ImageStates.ImageTracking = activeImage;
_undoButtonSpec.ImageStates.ImageNormal = normalImage;
- _undoButtonSpec.ImageStates.ImagePressed = pressedImage ?? null;
+ _undoButtonSpec.ImageStates.ImagePressed = pressedImage;
}
}
@@ -114,7 +114,7 @@ private void UpdateActiveImage(Image activeImage)
/// Updates the disabled image.
/// The disabled image.
- private void UpdateDisabledImage(Image disabledImage)
+ private void UpdateDisabledImage(Image? disabledImage)
{
_disabledImage = disabledImage;
@@ -126,7 +126,7 @@ private void UpdateDisabledImage(Image disabledImage)
/// Updates the normal image.
/// The normal image.
- private void UpdateNormalImage(Image normalImage)
+ private void UpdateNormalImage(Image? normalImage)
{
_normalImage = normalImage;
@@ -138,7 +138,7 @@ private void UpdateNormalImage(Image normalImage)
/// Updates the pressed image.
/// The pressed image.
- private void UpdatePressedImage(Image pressedImage)
+ private void UpdatePressedImage(Image? pressedImage)
{
_pressedImage = pressedImage;
@@ -164,131 +164,61 @@ private void UpdateImage(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarUndoNormal);
break;
- case PaletteMode.Office2007DarkGray:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007White:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
break;
- case PaletteMode.Office2010DarkGray:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010White:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ case PaletteMode.Custom:
UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarUndoNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365White:
UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
break;
- case PaletteMode.SparkleBlue:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.SparkleOrange:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.SparklePurple:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.Custom:
- UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
default:
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
}
@@ -312,134 +242,65 @@ private void UpdateActiveImage(PaletteMode mode)
case PaletteMode.Global:
break;
case PaletteMode.ProfessionalSystem:
- UpdateActiveImage(SystemToolbarImageResources.SystemToolbarUndoNormal);
+ UpdateImage(SystemToolbarImageResources.SystemToolbarUndoNormal);
break;
case PaletteMode.ProfessionalOffice2003:
- UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarUndoNormal);
- break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
+ UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarUndoNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
+ UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ case PaletteMode.Custom:
+ UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
- UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarUndoNormal);
- break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
+ UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarUndoNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365White:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
- case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.Custom:
+ UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
break;
default:
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
@@ -456,134 +317,65 @@ private void UpdateDisabledImage(PaletteMode mode)
case PaletteMode.Global:
break;
case PaletteMode.ProfessionalSystem:
- UpdateActiveImage(SystemToolbarImageResources.SystemToolbarUndoDisabled);
+ UpdateImage(SystemToolbarImageResources.SystemToolbarUndoDisabled);
break;
case PaletteMode.ProfessionalOffice2003:
- UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarUndoDisabled);
- break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoDisabled);
+ UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarUndoDisabled);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoDisabled);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoDisabled);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoDisabled);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoDisabled);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoDisabled);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoDisabled);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoDisabled);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoDisabled);
- break;
case PaletteMode.Office2007BlackDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoDisabled);
- break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled);
+ UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarUndoDisabled);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled);
- break;
case PaletteMode.Office2010BlackDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled);
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ case PaletteMode.Custom:
+ UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
- UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarUndoDisabled);
- break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoDisabled);
+ UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarUndoDisabled);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoDisabled);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoDisabled);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoDisabled);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoDisabled);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoDisabled);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoDisabled);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoDisabled);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoDisabled);
- break;
case PaletteMode.Microsoft365White:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoDisabled);
- break;
- case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled);
- break;
- case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled);
- break;
- case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled);
- break;
- case PaletteMode.Custom:
+ UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarUndoDisabled);
break;
default:
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
@@ -600,134 +392,65 @@ private void UpdateNormalImage(PaletteMode mode)
case PaletteMode.Global:
break;
case PaletteMode.ProfessionalSystem:
- UpdateActiveImage(SystemToolbarImageResources.SystemToolbarUndoNormal);
+ UpdateImage(SystemToolbarImageResources.SystemToolbarUndoNormal);
break;
case PaletteMode.ProfessionalOffice2003:
- UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarUndoNormal);
- break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
+ UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarUndoNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
+ UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ case PaletteMode.Custom:
+ UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
- UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarUndoNormal);
- break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
+ UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarUndoNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365White:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
- case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.Custom:
+ UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
break;
default:
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
@@ -744,134 +467,65 @@ private void UpdatePressedImage(PaletteMode mode)
case PaletteMode.Global:
break;
case PaletteMode.ProfessionalSystem:
- UpdateActiveImage(SystemToolbarImageResources.SystemToolbarUndoNormal);
+ UpdateImage(SystemToolbarImageResources.SystemToolbarUndoNormal);
break;
case PaletteMode.ProfessionalOffice2003:
- UpdateActiveImage(Office2003ToolbarImageResources.Office2003ToolbarUndoNormal);
- break;
- case PaletteMode.Office2007DarkGray:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
+ UpdateImage(Office2003ToolbarImageResources.Office2003ToolbarUndoNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007Silver:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007White:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007Black:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
- UpdateActiveImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
- case PaletteMode.Office2010DarkGray:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
+ UpdateImage(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010Silver:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010White:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010Black:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ case PaletteMode.Custom:
+ UpdateImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
- UpdateActiveImage(Office2013ToolbarImageResources.Office2013ToolbarUndoNormal);
- break;
- case PaletteMode.Microsoft365DarkGray:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
+ UpdateImage(Office2013ToolbarImageResources.Office2013ToolbarUndoNormal);
break;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365Blue:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365Silver:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365White:
- UpdateActiveImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
- case PaletteMode.SparkleBlue:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.SparkleBlueDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.SparkleBlueLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.SparkleOrange:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.SparkleOrangeDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.SparkleOrangeLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.SparklePurple:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.SparklePurpleDarkMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.SparklePurpleLightMode:
- UpdateActiveImage(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
- case PaletteMode.Custom:
+ UpdateImage(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
break;
default:
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
@@ -895,125 +549,59 @@ private void UpdateImageStates(PaletteMode mode)
case PaletteMode.ProfessionalOffice2003:
AddImageStates(null, Office2003ToolbarImageResources.Office2003ToolbarUndoDisabled, Office2003ToolbarImageResources.Office2003ToolbarUndoNormal, null);
break;
- case PaletteMode.Office2007DarkGray:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal, Office2007ToolbarImageResources.Office2007ToolbarUndoDisabled, Office2007ToolbarImageResources.Office2007ToolbarUndoNormal, Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2007DarkGray:
case PaletteMode.Office2007Blue:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal, Office2007ToolbarImageResources.Office2007ToolbarUndoDisabled, Office2007ToolbarImageResources.Office2007ToolbarUndoNormal, Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007BlueDarkMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal, Office2007ToolbarImageResources.Office2007ToolbarUndoDisabled, Office2007ToolbarImageResources.Office2007ToolbarUndoNormal, Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007BlueLightMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal, Office2007ToolbarImageResources.Office2007ToolbarUndoDisabled, Office2007ToolbarImageResources.Office2007ToolbarUndoNormal, Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007Silver:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal, Office2007ToolbarImageResources.Office2007ToolbarUndoDisabled, Office2007ToolbarImageResources.Office2007ToolbarUndoNormal, Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007SilverDarkMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal, Office2007ToolbarImageResources.Office2007ToolbarUndoDisabled, Office2007ToolbarImageResources.Office2007ToolbarUndoNormal, Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007SilverLightMode:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal, Office2007ToolbarImageResources.Office2007ToolbarUndoDisabled, Office2007ToolbarImageResources.Office2007ToolbarUndoNormal, Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007White:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal, Office2007ToolbarImageResources.Office2007ToolbarUndoDisabled, Office2007ToolbarImageResources.Office2007ToolbarUndoNormal, Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007Black:
- AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal, Office2007ToolbarImageResources.Office2007ToolbarUndoDisabled, Office2007ToolbarImageResources.Office2007ToolbarUndoNormal, Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
- break;
case PaletteMode.Office2007BlackDarkMode:
AddImageStates(Office2007ToolbarImageResources.Office2007ToolbarUndoNormal, Office2007ToolbarImageResources.Office2007ToolbarUndoDisabled, Office2007ToolbarImageResources.Office2007ToolbarUndoNormal, Office2007ToolbarImageResources.Office2007ToolbarUndoNormal);
break;
- case PaletteMode.Office2010DarkGray:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2010DarkGray:
case PaletteMode.Office2010Blue:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010BlueDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010BlueLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010Silver:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010SilverDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010SilverLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010White:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010Black:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.Office2010BlackDarkMode:
AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
break;
- case PaletteMode.Office2013DarkGray:
- case PaletteMode.Office2013LightGray:
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Office2013DarkGray:
+ //case PaletteMode.Office2013LightGray:
case PaletteMode.Office2013White:
AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal, Office2019ToolbarImageResources.Office2019ToolbarUndoDisabled, Office2019ToolbarImageResources.Office2019ToolbarUndoNormal, Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
break;
- case PaletteMode.Microsoft365DarkGray:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal, Office2019ToolbarImageResources.Office2019ToolbarUndoDisabled, Office2019ToolbarImageResources.Office2019ToolbarUndoNormal, Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
+ // TODO: Re-enable this once completed
+ //case PaletteMode.Microsoft365DarkGray:
case PaletteMode.Microsoft365Black:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal, Office2019ToolbarImageResources.Office2019ToolbarUndoDisabled, Office2019ToolbarImageResources.Office2019ToolbarUndoNormal, Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365BlackDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal, Office2019ToolbarImageResources.Office2019ToolbarUndoDisabled, Office2019ToolbarImageResources.Office2019ToolbarUndoNormal, Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365Blue:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal, Office2019ToolbarImageResources.Office2019ToolbarUndoDisabled, Office2019ToolbarImageResources.Office2019ToolbarUndoNormal, Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365BlueDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal, Office2019ToolbarImageResources.Office2019ToolbarUndoDisabled, Office2019ToolbarImageResources.Office2019ToolbarUndoNormal, Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365BlueLightMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal, Office2019ToolbarImageResources.Office2019ToolbarUndoDisabled, Office2019ToolbarImageResources.Office2019ToolbarUndoNormal, Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365Silver:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal, Office2019ToolbarImageResources.Office2019ToolbarUndoDisabled, Office2019ToolbarImageResources.Office2019ToolbarUndoNormal, Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365SilverDarkMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal, Office2019ToolbarImageResources.Office2019ToolbarUndoDisabled, Office2019ToolbarImageResources.Office2019ToolbarUndoNormal, Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365SilverLightMode:
- AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal, Office2019ToolbarImageResources.Office2019ToolbarUndoDisabled, Office2019ToolbarImageResources.Office2019ToolbarUndoNormal, Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
- break;
case PaletteMode.Microsoft365White:
AddImageStates(Office2019ToolbarImageResources.Office2019ToolbarUndoNormal, Office2019ToolbarImageResources.Office2019ToolbarUndoDisabled, Office2019ToolbarImageResources.Office2019ToolbarUndoNormal, Office2019ToolbarImageResources.Office2019ToolbarUndoNormal);
break;
case PaletteMode.SparkleBlue:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.SparkleBlueDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.SparkleBlueLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.SparkleOrange:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.SparkleOrangeDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.SparkleOrangeLightMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.SparklePurple:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.SparklePurpleDarkMode:
- AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
- break;
case PaletteMode.SparklePurpleLightMode:
AddImageStates(Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoDisabled, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal, Office2010ToolbarImageResources.Office2010ToolbarUndoNormal);
break;
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonLabel.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonLabel.cs
index a327b4dee..eb30cc432 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonLabel.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonLabel.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -446,7 +446,7 @@ protected virtual void OnKryptonCommandChanged(EventArgs e)
///
/// Source of the event.
/// A PropertyChangedEventArgs that contains the event data.
- protected virtual void OnCommandPropertyChanged(object sender, PropertyChangedEventArgs e)
+ protected virtual void OnCommandPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
switch (e.PropertyName)
{
@@ -496,7 +496,7 @@ protected override bool EvalTransparentPaint() =>
#endregion
#region Implementation
- private void OnLabelTextChanged(object sender, EventArgs e) => OnTextChanged(EventArgs.Empty);
+ private void OnLabelTextChanged(object? sender, EventArgs e) => OnTextChanged(EventArgs.Empty);
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonLinkLabel.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonLinkLabel.cs
index a3c4910dc..5abf3e812 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonLinkLabel.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonLinkLabel.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -287,7 +287,7 @@ protected override void SetLabelStyle(LabelStyle style)
#endregion
#region Implementation
- private void OnControllerClick(object sender, MouseEventArgs e) => OnLinkClicked(new LinkClickedEventArgs(Text));
+ private void OnControllerClick(object? sender, MouseEventArgs e) => OnLinkClicked(new LinkClickedEventArgs(Text));
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonLinkWrapLabel.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonLinkWrapLabel.cs
index fc6781710..0216cf558 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonLinkWrapLabel.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonLinkWrapLabel.cs
@@ -2,7 +2,7 @@
/*
*
* 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.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -168,7 +168,7 @@ public override Color BackColor
public override Font Font
{
get => base.Font;
- set => base.Font = value;
+ set => base.Font = value!;
}
///
@@ -406,7 +406,7 @@ public KryptonContextMenu? KryptonContextMenu
///
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
- public PaletteBase? GetResolvedPalette() => _palette;
+ public PaletteBase GetResolvedPalette() => _palette!;
///
/// Gets access to the current renderer.
@@ -459,10 +459,10 @@ public void UpdateFont()
font ??= StateCommon.Font ?? _redirector.GetContentShortTextFont(_labelContentStyle, ps);
// Recover text color from state common or as last resort the inherited palette
- if (textColor == Color.Empty)
+ if (textColor == GlobalStaticValues.EMPTY_COLOR)
{
textColor = StateCommon.TextColor;
- if (textColor == Color.Empty)
+ if (textColor == GlobalStaticValues.EMPTY_COLOR)
{
textColor = _redirector.GetContentShortTextColor1(_labelContentStyle, ps);
}
@@ -560,10 +560,10 @@ protected override void OnPaint(PaintEventArgs e)
font ??= StateCommon.Font ?? _redirector.GetContentShortTextFont(_labelContentStyle, ps);
// Recover text color from state common or as last resort the inherited palette
- if (textColor == Color.Empty)
+ if (textColor == GlobalStaticValues.EMPTY_COLOR)
{
textColor = StateCommon.TextColor;
- if (textColor == Color.Empty)
+ if (textColor == GlobalStaticValues.EMPTY_COLOR)
{
textColor = _redirector.GetContentShortTextColor1(_labelContentStyle, ps);
}
@@ -607,13 +607,13 @@ protected override void OnPaintBackground(PaintEventArgs? pEvent)
_miPtb = typeof(Control).GetMethod("PaintTransparentBackground",
BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.InvokeMethod,
null, CallingConventions.HasThis,
- new[] { typeof(PaintEventArgs), typeof(Rectangle), typeof(Region) },
+ [typeof(PaintEventArgs), typeof(Rectangle), typeof(Region)],
null);
}
if (pEvent != null)
{
- _miPtb?.Invoke(this, new object[] { pEvent, ClientRectangle, null });
+ _miPtb?.Invoke(this, [pEvent, ClientRectangle, null!]);
}
}
else
@@ -810,15 +810,15 @@ private void SetPalette(PaletteBase? palette)
}
}
- private void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e) => NeedPaint(e);
+ private void OnPaletteNeedPaint(object? sender, NeedLayoutEventArgs e) => NeedPaint(e);
// Change in base renderer or base palette require we fetch the latest renderer
- private void OnBaseChanged(object sender, EventArgs e) => Renderer = _palette?.GetRenderer();
+ private void OnBaseChanged(object? sender, EventArgs e) => Renderer = _palette?.GetRenderer();
/// Called when [global palette changed].
/// The sender.
/// The instance containing the event data.
- private void OnGlobalPaletteChanged(object sender, EventArgs e)
+ private void OnGlobalPaletteChanged(object? sender, EventArgs e)
{
// We only care if we are using the global palette
if (PaletteMode == PaletteMode.Global)
@@ -852,13 +852,13 @@ private void OnContextMenuStripOpening(object sender, CancelEventArgs e)
}
}
- private void OnKryptonContextMenuDisposed(object sender, EventArgs e) =>
+ private void OnKryptonContextMenuDisposed(object? sender, EventArgs e) =>
// When the current krypton context menu is disposed, we should remove
// it to prevent it being used again, as that would just throw an exception
// because it has been disposed.
KryptonContextMenu = null;
- private void OnContextMenuClosed(object sender, ToolStripDropDownClosedEventArgs e) => ContextMenuClosed();
+ private void OnContextMenuClosed(object? sender, ToolStripDropDownClosedEventArgs e) => ContextMenuClosed();
private void NeedPaint(bool layout) => NeedPaint(new NeedLayoutEventArgs(layout));
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonListBox.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonListBox.cs
index b5f74dced..944f62434 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonListBox.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonListBox.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -147,7 +147,7 @@ public override DrawMode DrawMode
}
///
- /// Force the remeasure of items so they are sized correctly.
+ /// Force the remeasure of items, so they are sized correctly.
///
public void RefreshItemSizes()
{
@@ -360,9 +360,6 @@ private void WmPaint(ref Message m)
private bool _alwaysActive;
private bool _forcedLayout;
private bool _trackingMouseEnter;
- private float _cornerRoundingRadius;
- private float _itemCornerRoundingRadius;
-
#endregion
#region Events
@@ -602,13 +599,9 @@ public KryptonListBox()
// Add list box to the controls collection
((KryptonReadOnlyControls)Controls).AddInternal(_listBox);
-
- _cornerRoundingRadius = GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
- _itemCornerRoundingRadius = GlobalStaticValues.SECONDARY_CORNER_ROUNDING_VALUE;
}
- private void OnListBoxClick(object sender, EventArgs e) =>
+ private void OnListBoxClick(object? sender, EventArgs e) =>
// ReSharper disable RedundantBaseQualifier
base.OnClick(e);
// ReSharper restore RedundantBaseQualifier
@@ -628,31 +621,6 @@ protected override void Dispose(bool disposing)
#endregion
#region Public
-
- /// Gets or sets the corner rounding radius.
- /// The corner rounding radius.
- [Category(@"Visuals")]
- [Description(@"Gets or sets the corner rounding radius.")]
- [DefaultValue(GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE)]
- public float CornerRoundingRadius
- {
- get => _cornerRoundingRadius;
-
- set => SetCornerRoundingRadius(value);
- }
-
- /// Gets or sets the item corner rounding radius.
- /// The item corner rounding radius.
- [Category(@"Visuals")]
- [Description(@"Gets or sets the item corner rounding radius.")]
- [DefaultValue(GlobalStaticValues.SECONDARY_CORNER_ROUNDING_VALUE)]
- public float ItemCornerRoundingRadius
- {
- get => _itemCornerRoundingRadius;
-
- set => SetItemCornerRoundingRadius(value);
- }
-
///
/// Gets access to the contained ListBox instance.
///
@@ -676,9 +644,10 @@ public float ItemCornerRoundingRadius
[Bindable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- [DisallowNull]
+ [AllowNull]
public override string Text
{
+ // Control.Text can take null but will always return an empty string when the input was null
get => base.Text;
set => base.Text = value;
}
@@ -703,9 +672,12 @@ public override Color BackColor
[Bindable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- [DisallowNull]
+ [AllowNull]
public override Font Font
{
+ // base.Font will always return a Font
+ // base can take null as a value
+
get => base.Font;
set => base.Font = value;
}
@@ -762,7 +734,7 @@ public int SelectedIndex
public object? SelectedValue
{
get => _listBox.SelectedValue;
- set => _listBox.SelectedValue = value;
+ set => _listBox.SelectedValue = value!;
}
///
@@ -1031,7 +1003,7 @@ public PaletteBorderStyle BorderStyle
[Category(@"Visuals")]
[Description(@"Overrides for defining common appearance that other states can override.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public PaletteListStateRedirect? StateCommon { get; }
+ public PaletteListStateRedirect StateCommon { get; }
private bool ShouldSerializeStateCommon() => !StateCommon.IsDefault;
@@ -1247,12 +1219,12 @@ public bool AlwaysActive
/// Sets input focus to the control.
///
/// true if the input focus request was successful; otherwise, false.
- public new bool Focus() => ListBox != null && ListBox.Focus();
+ public new bool Focus() => ListBox.Focus();
///
/// Activates the control.
///
- public new void Select() => ListBox?.Select();
+ public new void Select() => ListBox.Select();
#endregion
#region Protected
@@ -1351,7 +1323,7 @@ protected override void OnPaletteChanged(EventArgs e)
///
/// Source of notification.
/// An NeedLayoutEventArgs containing event data.
- protected override void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e)
+ protected override void OnPaletteNeedPaint(object? sender, NeedLayoutEventArgs e)
{
_listBox.RefreshItemSizes();
base.OnPaletteChanged(e);
@@ -1425,9 +1397,9 @@ protected override void OnCausesValidationChanged(EventArgs e)
/// Raises the Paint event.
///
/// An PaintEventArgs that contains the event data.
- protected override void OnPaint(PaintEventArgs e)
+ protected override void OnPaint(PaintEventArgs? e)
{
- Paint?.Invoke(this, e);
+ Paint?.Invoke(this, e!);
base.OnPaint(e);
}
@@ -1497,7 +1469,7 @@ protected override void OnLayout(LayoutEventArgs levent)
// Only use layout logic if control is fully initialized or if being forced
// to allow a relayout or if in design mode.
- if (IsHandleCreated || _forcedLayout || (DesignMode && (_listBox != null)))
+ if (IsHandleCreated || _forcedLayout || (DesignMode))
{
Rectangle fillRect = _layoutFill.FillRect;
_listBox.SetBounds(fillRect.X, fillRect.Y, fillRect.Width, fillRect.Height);
@@ -1543,19 +1515,11 @@ private void UpdateStateAndPalettes()
// Get the correct palette settings to use
IPaletteDouble doubleState = GetDoubleState();
_listBox.ViewDrawPanel.SetPalettes(doubleState.PaletteBack);
- _drawDockerOuter.SetPalettes(doubleState.PaletteBack, doubleState.PaletteBorder);
+ _drawDockerOuter.SetPalettes(doubleState.PaletteBack, doubleState.PaletteBorder!);
_drawDockerOuter.Enabled = Enabled;
// Find the new state of the main view element
- PaletteState state;
- if (IsActive)
- {
- state = PaletteState.Tracking;
- }
- else
- {
- state = Enabled ? PaletteState.Normal : PaletteState.Disabled;
- }
+ PaletteState state = Enabled ? (IsActive ? PaletteState.Tracking : PaletteState.Normal) : PaletteState.Disabled;
_listBox.ViewDrawPanel.ElementState = state;
_drawDockerOuter.ElementState = state;
@@ -1564,7 +1528,7 @@ private void UpdateStateAndPalettes()
private IPaletteDouble GetDoubleState() => Enabled ? (IsActive ? StateActive : StateNormal) : StateDisabled;
- private void OnListBoxDrawItem(object sender, DrawItemEventArgs e)
+ private void OnListBoxDrawItem(object? sender, DrawItemEventArgs e)
{
// We cannot do anything with an invalid index
if (e.Index < 0)
@@ -1575,7 +1539,7 @@ private void OnListBoxDrawItem(object sender, DrawItemEventArgs e)
// Update our content object with values from the list item
UpdateContentFromItemIndex(e.Index);
- // By default the button is in the normal state
+ // By default, the button is in the normal state
var buttonState = PaletteState.Normal;
// Is this item disabled
@@ -1670,7 +1634,7 @@ private void OnListBoxDrawItem(object sender, DrawItemEventArgs e)
}
}
- private void OnListBoxMeasureItem(object sender, MeasureItemEventArgs e)
+ private void OnListBoxMeasureItem(object? sender, MeasureItemEventArgs e)
{
UpdateContentFromItemIndex(e.Index);
@@ -1687,7 +1651,7 @@ private void UpdateContentFromItemIndex(int index)
// If the object exposes the rich interface then use is...
if (Items[index] is IContentValues itemValues)
{
- _contentValues.ShortText = itemValues.GetShortText();
+ _contentValues!.ShortText = itemValues.GetShortText();
_contentValues.LongText = itemValues.GetLongText();
_contentValues.Image = itemValues.GetImage(PaletteState.Normal);
_contentValues.ImageTransparentColor = itemValues.GetImageTransparentColor(PaletteState.Normal);
@@ -1695,20 +1659,20 @@ private void UpdateContentFromItemIndex(int index)
else
{
// Get the text string for the item
- _contentValues.ShortText = _listBox.GetItemText(Items[index]);
+ _contentValues!.ShortText = _listBox.GetItemText(Items[index]);
_contentValues.LongText = null;
_contentValues.Image = null;
- _contentValues.ImageTransparentColor = Color.Empty;
+ _contentValues.ImageTransparentColor = GlobalStaticValues.EMPTY_COLOR;
}
}
- private void OnListBoxDataSourceChanged(object sender, EventArgs e) => OnDataSourceChanged(e);
+ private void OnListBoxDataSourceChanged(object? sender, EventArgs e) => OnDataSourceChanged(e);
- private void OnListBoxDisplayMemberChanged(object sender, EventArgs e) => OnDisplayMemberChanged(e);
+ private void OnListBoxDisplayMemberChanged(object? sender, EventArgs e) => OnDisplayMemberChanged(e);
- private void OnListBoxValueMemberChanged(object sender, EventArgs e) => OnValueMemberChanged(e);
+ private void OnListBoxValueMemberChanged(object? sender, EventArgs e) => OnValueMemberChanged(e);
- private void OnListBoxSelectedIndexChanged(object sender, EventArgs e)
+ private void OnListBoxSelectedIndexChanged(object? sender, EventArgs e)
{
switch (_listBox.SelectionMode)
{
@@ -1737,8 +1701,8 @@ private void OnListBoxSelectedIndexChanged(object sender, EventArgs e)
}
}
- private bool SelectedIndicesChanged(int[] left,
- ListBox.SelectedIndexCollection right)
+ private bool SelectedIndicesChanged(int[]? left,
+ ListBox.SelectedIndexCollection? right)
{
// First time around the left can be null
if ((left == null) && (right != null))
@@ -1747,7 +1711,7 @@ private bool SelectedIndicesChanged(int[] left,
}
// Quickest check is to see if they have different number of entries
- if (left.Length != right.Count)
+ if (left!.Length != right!.Count)
{
return true;
}
@@ -1756,22 +1720,22 @@ private bool SelectedIndicesChanged(int[] left,
return left.Where((t, i) => t != right[i]).Any();
}
- private void OnListBoxSelectedValueChanged(object sender, EventArgs e)
+ private void OnListBoxSelectedValueChanged(object? sender, EventArgs e)
{
UpdateStateAndPalettes();
_listBox.Invalidate();
OnSelectedValueChanged(e);
}
- private void OnListBoxFormat(object sender, ListControlConvertEventArgs e) => OnFormat(e);
+ private void OnListBoxFormat(object? sender, ListControlConvertEventArgs e) => OnFormat(e);
- private void OnListBoxFormatInfoChanged(object sender, EventArgs e) => OnFormatInfoChanged(e);
+ private void OnListBoxFormatInfoChanged(object? sender, EventArgs e) => OnFormatInfoChanged(e);
- private void OnListBoxFormatStringChanged(object sender, EventArgs e) => OnFormatStringChanged(e);
+ private void OnListBoxFormatStringChanged(object? sender, EventArgs e) => OnFormatStringChanged(e);
- private void OnListBoxFormattingEnabledChanged(object sender, EventArgs e) => OnFormattingEnabledChanged(e);
+ private void OnListBoxFormattingEnabledChanged(object? sender, EventArgs e) => OnFormattingEnabledChanged(e);
- private void OnListBoxGotFocus(object sender, EventArgs e)
+ private void OnListBoxGotFocus(object? sender, EventArgs e)
{
UpdateStateAndPalettes();
_listBox.Invalidate();
@@ -1779,7 +1743,7 @@ private void OnListBoxGotFocus(object sender, EventArgs e)
OnGotFocus(e);
}
- private void OnListBoxLostFocus(object sender, EventArgs e)
+ private void OnListBoxLostFocus(object? sender, EventArgs e)
{
UpdateStateAndPalettes();
_listBox.Invalidate();
@@ -1787,19 +1751,19 @@ private void OnListBoxLostFocus(object sender, EventArgs e)
OnLostFocus(e);
}
- private void OnListBoxKeyPress(object sender, KeyPressEventArgs e) => OnKeyPress(e);
+ private void OnListBoxKeyPress(object? sender, KeyPressEventArgs e) => OnKeyPress(e);
- private void OnListBoxKeyUp(object sender, KeyEventArgs e) => OnKeyUp(e);
+ private void OnListBoxKeyUp(object? sender, KeyEventArgs e) => OnKeyUp(e);
- private void OnListBoxKeyDown(object sender, KeyEventArgs e) => OnKeyDown(e);
+ private void OnListBoxKeyDown(object? sender, KeyEventArgs e) => OnKeyDown(e);
- private void OnListBoxPreviewKeyDown(object sender, PreviewKeyDownEventArgs e) => OnPreviewKeyDown(e);
+ private void OnListBoxPreviewKeyDown(object? sender, PreviewKeyDownEventArgs e) => OnPreviewKeyDown(e);
- private void OnListBoxValidated(object sender, EventArgs e) => OnValidated(e);
+ private void OnListBoxValidated(object? sender, EventArgs e) => OnValidated(e);
- private void OnListBoxValidating(object sender, CancelEventArgs e) => OnValidating(e);
+ private void OnListBoxValidating(object? sender, CancelEventArgs e) => OnValidating(e);
- private void OnListBoxMouseChange(object sender, EventArgs e)
+ private void OnListBoxMouseChange(object? sender, EventArgs e)
{
// Change in tracking state?
if (_listBox.MouseOver != _trackingMouseEnter)
@@ -1820,23 +1784,9 @@ private void OnListBoxMouseChange(object sender, EventArgs e)
}
}
- private void OnDoubleClick(object sender, EventArgs e) => base.OnDoubleClick(e);
-
- private void OnMouseDoubleClick(object sender, MouseEventArgs e) => base.OnMouseDoubleClick(e);
-
- private void SetCornerRoundingRadius(float? radius)
- {
- _cornerRoundingRadius = radius ?? GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
- StateCommon.Border.Rounding = _cornerRoundingRadius;
- }
-
- private void SetItemCornerRoundingRadius(float? radius)
- {
- _itemCornerRoundingRadius = radius ?? GlobalStaticValues.SECONDARY_CORNER_ROUNDING_VALUE;
+ private void OnDoubleClick(object? sender, EventArgs e) => base.OnDoubleClick(e);
- StateCommon.Item.Border.Rounding = _itemCornerRoundingRadius;
- }
+ private void OnMouseDoubleClick(object? sender, MouseEventArgs e) => base.OnMouseDoubleClick(e);
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonListItem.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonListItem.cs
index cea9dba93..51c7bb9b7 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonListItem.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonListItem.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -22,8 +22,8 @@ public class KryptonListItem : Component,
{
#region Instance Fields
private string _shortText;
- private string _longText;
- private Image _image;
+ private string? _longText;
+ private Image? _image;
private Color _imageTransparentColor;
#endregion
@@ -42,7 +42,7 @@ public class KryptonListItem : Component,
/// Initialize a new instance of the KryptonListItem class.
///
public KryptonListItem()
- : this("ListItem", null, null, Color.Empty)
+ : this("ListItem", null, null, GlobalStaticValues.EMPTY_COLOR)
{
}
@@ -51,7 +51,7 @@ public KryptonListItem()
///
/// Initial short text value.
public KryptonListItem(string shortText)
- : this(shortText, null, null, Color.Empty)
+ : this(shortText, null, null, GlobalStaticValues.EMPTY_COLOR)
{
}
@@ -61,7 +61,7 @@ public KryptonListItem(string shortText)
/// Initial short text value.
/// Initial long text value.
public KryptonListItem(string shortText, string longText)
- : this(shortText, longText, null, Color.Empty)
+ : this(shortText, longText, null, GlobalStaticValues.EMPTY_COLOR)
{
}
@@ -73,8 +73,8 @@ public KryptonListItem(string shortText, string longText)
/// Initial image value.
public KryptonListItem(string shortText,
string longText,
- Image image)
- : this(shortText, longText, image, Color.Empty)
+ Image? image)
+ : this(shortText, longText, image, GlobalStaticValues.EMPTY_COLOR)
{
}
@@ -86,8 +86,8 @@ public KryptonListItem(string shortText,
/// Initial image value.
/// Initial transparent image color.
public KryptonListItem(string shortText,
- string longText,
- Image image,
+ string? longText,
+ Image? image,
Color imageTransparentColor)
{
_shortText = shortText;
@@ -138,7 +138,7 @@ public string ShortText
[Localizable(true)]
public string LongText
{
- get => _longText;
+ get => _longText!;
set
{
@@ -200,7 +200,7 @@ public Color ImageTransparentColor
}
}
- private bool ShouldSerializeImageTransparentColor() => _imageTransparentColor != Color.Empty;
+ private bool ShouldSerializeImageTransparentColor() => _imageTransparentColor != GlobalStaticValues.EMPTY_COLOR;
#endregion
@@ -241,7 +241,7 @@ public Color ImageTransparentColor
/// Gets the content long text.
///
/// String value.
- public string GetLongText() => _longText;
+ public string GetLongText() => _longText!;
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonListView.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonListView.cs
index 9dab7e8b5..2174adad4 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonListView.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonListView.cs
@@ -1,16 +1,13 @@
#region BSD License
/*
- *
- * Original BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE)
- * © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
- *
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
- *
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2021 - 2024. All rights reserved.
*/
#endregion
-// ReSharper disable MemberCanBeProtected.Global
+using ListView = System.Windows.Forms.ListView;
+// ReSharper disable UnusedMember.Global
+
namespace Krypton.Toolkit
{
///
@@ -19,178 +16,365 @@ namespace Krypton.Toolkit
///
[ToolboxItem(true)]
[ToolboxBitmap(typeof(ListView))]
- [DefaultEvent("AfterSelect")]
- [DefaultProperty("Nodes")]
- [Designer(typeof(KryptonTreeViewDesigner))]
+ [Designer(typeof(KryptonListViewDesigner))]
[DesignerCategory(@"code")]
- [Description(@"A Kryptonised listview. Does not support the `List or Details View` types")]
- public class KryptonListView : ListView
+ [Description(@"A Kryptonised listview.")]
+ public class KryptonListView : VisualControlBase,
+ IContainedInputControl
{
- #region Variables
- private PaletteBase? _localPalette;
- private PaletteBase? _palette;
- private PaletteMode _paletteMode;
- private bool _layoutDirty;
- private bool _refreshAll;
- private float _cornerRoundingRadius;
- private float _itemCornerRoundingRadius;
- private readonly IntPtr _screenDC;
+ #region Classes
+ private class InternalListView : ListView
+ {
+ #region Instance Fields
+
+ private readonly ViewManager? _viewManager;
+ private readonly KryptonListView _kryptonListView;
+ private readonly IntPtr _screenDC;
+ private bool _mouseOver;
+
+ #endregion
+
+ #region Events
+
+ ///
+ /// Occurs when the mouse enters the InternalListView.
+ ///
+ public event EventHandler? TrackMouseEnter;
+
+ ///
+ /// Occurs when the mouse leaves the InternalListView.
+ ///
+ public event EventHandler? TrackMouseLeave;
+
+ #endregion
+
+ #region Identity
+
+ ///
+ /// Initialize a new instance of the InternalListView class.
+ ///
+ /// Reference to owning control.
+ public InternalListView(KryptonListView kryptonListView)
+ {
+ SetStyle(ControlStyles.ResizeRedraw
+ | ControlStyles.AllPaintingInWmPaint
+ | ControlStyles.OptimizedDoubleBuffer, true);
+
+ _kryptonListView = kryptonListView;
+
+ // Create manager and view for drawing the background
+ ViewDrawPanel = new ViewDrawPanel();
+ _viewManager = new ViewManager(this, ViewDrawPanel);
+
+ // ReSharper disable RedundantBaseQualifier
+ // Set required properties to act as an owner draw list box
+ base.Size = Size.Empty;
+ base.BorderStyle = BorderStyle.None;
+ // ReSharper restore RedundantBaseQualifier
+
+ // We need to create and cache a device context compatible with the display
+ _screenDC = PI.CreateCompatibleDC(IntPtr.Zero);
+ }
+
+ ///
+ /// Releases all resources used by the Control.
+ ///
+ /// true to release both managed and unmanaged resources; false to release only unmanaged resources.
+ protected override void Dispose(bool disposing)
+ {
+ base.Dispose(disposing);
+ if (_screenDC != IntPtr.Zero)
+ {
+ PI.DeleteDC(_screenDC);
+ }
+ }
+
+ #endregion
+
+ #region Public
+
+ ///
+ /// Recreate the window handle.
+ ///
+ public void Recreate() => RecreateHandle();
+
+ ///
+ /// Gets access to the contained view draw panel instance.
+ ///
+ public ViewDrawPanel ViewDrawPanel { get; }
+
+ ///
+ /// Gets and sets if the mouse is currently over the combo box.
+ ///
+ public bool MouseOver
+ {
+ get => _mouseOver;
+ set
+ {
+ // Only interested in changes
+ if (_mouseOver != value)
+ {
+ _mouseOver = value;
+
+ // Generate appropriate change event
+ if (_mouseOver)
+ {
+ OnTrackMouseEnter(EventArgs.Empty);
+ }
+ else
+ {
+ OnTrackMouseLeave(EventArgs.Empty);
+ }
+ }
+ }
+ }
+
+ #endregion
+
+ #region Protected
+
+ /// Raises the event.
+ /// An that contains the event data.
+ protected override void OnSystemColorsChanged(EventArgs e)
+ {
+ // DO nothing, It's Krypton Colours that are in use !
+ }
+
+ ///
+ /// Raises the Layout event.
+ ///
+ /// A LayoutEventArgs containing the event data.
+ protected override void OnLayout(LayoutEventArgs levent)
+ {
+ base.OnLayout(levent);
+
+ // Ask the panel to layout given our available size
+ using var context =
+ new ViewLayoutContext(_viewManager, this, _kryptonListView, _kryptonListView.Renderer);
+ ViewDrawPanel.Layout(context);
+ }
+
+ ///
+ /// Process Windows-based messages.
+ ///
+ /// A Windows-based message.
+ protected override void WndProc(ref Message m)
+ {
+ switch (m.Msg)
+ {
+ case PI.WM_.ERASEBKGND:
+ // Do not draw the background here, always do it in the paint
+ // instead to prevent flicker because of a two stage drawing process
+ break;
+ case PI.WM_.PRINTCLIENT:
+ case PI.WM_.PAINT:
+ WmPaint(ref m);
+ break;
+ case PI.WM_.VSCROLL:
+ case PI.WM_.HSCROLL:
+ case PI.WM_.MOUSEWHEEL:
+ Invalidate();
+ base.WndProc(ref m);
+ break;
+ case PI.WM_.MOUSELEAVE:
+ if (MouseOver)
+ {
+ MouseOver = false;
+ _kryptonListView.PerformNeedPaint(true);
+ Invalidate();
+ }
+
+ base.WndProc(ref m);
+ break;
+ case PI.WM_.MOUSEMOVE:
+ if (!MouseOver)
+ {
+ MouseOver = true;
+ _kryptonListView.PerformNeedPaint(true);
+ Invalidate();
+ }
+
+ base.WndProc(ref m);
+ break;
+ default:
+ base.WndProc(ref m);
+ break;
+ }
+ }
+
+ #endregion
+
+ #region Private
+
+ ///
+ /// Raises the TrackMouseEnter event.
+ ///
+ /// An EventArgs containing the event data.
+ private void OnTrackMouseEnter(EventArgs e) => TrackMouseEnter?.Invoke(this, e);
+
+ ///
+ /// Raises the TrackMouseLeave event.
+ ///
+ /// An EventArgs containing the event data.
+ private void OnTrackMouseLeave(EventArgs e) => TrackMouseLeave?.Invoke(this, e);
+
+ private void WmPaint(ref Message m)
+ {
+ var ps = new PI.PAINTSTRUCT();
+
+ // Do we need to BeginPaint or just take the given HDC?
+ IntPtr hdc = m.WParam == IntPtr.Zero ? PI.BeginPaint(Handle, ref ps) : m.WParam;
+
+ // Create bitmap that all drawing occurs onto, then we can blit it later to remove flicker
+ Rectangle realRect = CommonHelper.RealClientRectangle(Handle);
+
+ // No point drawing when one of the dimensions is zero
+ if (realRect is { Width: > 0, Height: > 0 })
+ {
+ IntPtr hBitmap = PI.CreateCompatibleBitmap(hdc, realRect.Width, realRect.Height);
+
+ // If we managed to get a compatible bitmap
+ if (hBitmap != IntPtr.Zero)
+ {
+ try
+ {
+ // Must use the screen device context for the bitmap when drawing into the
+ // bitmap otherwise the Opacity and RightToLeftLayout will not work correctly.
+ PI.SelectObject(_screenDC, hBitmap);
+
+ // Easier to draw using a graphics instance than a DC!
+ using (Graphics g = Graphics.FromHdc(_screenDC))
+ {
+ // Ask the view element to layout in given space, needs this before a render call
+ using (var context = new ViewLayoutContext(this, _kryptonListView.Renderer))
+ {
+ context.DisplayRectangle = realRect;
+ ViewDrawPanel.Layout(context);
+ }
+
+ using (var context = new RenderContext(this, _kryptonListView, g, realRect,
+ _kryptonListView.Renderer))
+ {
+ ViewDrawPanel.Render(context);
+ }
+
+ // We can only control the background color by using the built in property and not
+ // by overriding the drawing directly, therefore we can only provide a single color.
+ Color color1 = ViewDrawPanel.GetPalette().GetBackColor1(ViewDrawPanel.State);
+ if (color1 != BackColor)
+ {
+ BackColor = color1;
+ }
+
+ // Replace given DC with the screen DC for base window proc drawing
+ IntPtr beforeDC = m.WParam;
+ m.WParam = _screenDC;
+ DefWndProc(ref m);
+ m.WParam = beforeDC;
+ }
+
+ // Now blit from the bitmap from the screen to the real dc
+ PI.BitBlt(hdc, 0, 0, realRect.Width, realRect.Height, _screenDC, 0, 0, PI.SRCCOPY);
+ }
+ finally
+ {
+ // Delete the temporary bitmap
+ PI.DeleteObject(hBitmap);
+ }
+ }
+ }
+
+ // Do we need to match the original BeginPaint?
+ if (m.WParam == IntPtr.Zero)
+ {
+ PI.EndPaint(Handle, ref ps);
+ }
+ }
+
+ #endregion
+ }
+
+ #endregion
+
+ #region Instance Fields
private readonly PaletteTripleOverride _overrideNormal;
+ private readonly PaletteTripleOverride _overrideDisabled;
private readonly PaletteTripleOverride _overrideTracking;
- private readonly PaletteTripleOverride _overridePressed;
private readonly PaletteTripleOverride _overrideCheckedNormal;
private readonly PaletteTripleOverride _overrideCheckedTracking;
- private readonly PaletteTripleOverride _overrideCheckedPressed;
- private readonly PaletteRedirectCheckBox? _paletteCheckBoxImages;
- private readonly ViewLayoutDocker _drawDockerInner;
private readonly ViewDrawDocker _drawDockerOuter;
- private readonly ViewLayoutCenter _layoutCheckBox;
- private readonly ViewLayoutSeparator _layoutCheckBoxAfter;
- private readonly ViewLayoutStack _layoutCheckBoxStack;
- private readonly ViewLayoutDocker _layoutDockerTile;
- private readonly ViewLayoutDocker _layoutDockerSmall;
- private readonly ViewLayoutDocker _layoutDockerCheckLarge;
- private readonly ViewLayoutStack _layoutImageStack;
- private readonly ViewLayoutCenter _layoutImageCenter;
- private readonly ViewLayoutCenter _layoutImageCenterState;
- private readonly ViewLayoutSeparator _layoutImage;
- private readonly ViewLayoutSeparator _layoutImageState;
- private readonly ViewLayoutSeparator _layoutImageAfter;
- private readonly ViewDrawCheckBox _drawCheckBox;
private readonly ViewLayoutFill _layoutFill;
- private readonly ViewDrawButton _drawButton;
- private readonly ShortTextValue? _contentValues;
+ private readonly InternalListView _listView;
+ private bool? _fixedActive;
+ private readonly IntPtr _screenDC;
private bool _mouseOver;
private bool _alwaysActive;
- private ButtonStyle _style;
- private bool? _fixedActive;
- private KryptonContextMenu? _kryptonContextMenu;
+ private bool _forcedLayout;
+ #endregion
+
+ #region Events
+
+ // TODO:
#endregion
- #region Identity
public KryptonListView()
{
- SetStyle(ControlStyles.AllPaintingInWmPaint
- | ControlStyles.OptimizedDoubleBuffer
- | ControlStyles.SupportsTransparentBackColor // Cannot get thi sto work (Code removed)!!
- | ControlStyles.EnableNotifyMessage
- , true);
-
- base.OwnerDraw = true;
- // We need to repaint entire control whenever resized
- SetStyle(ControlStyles.ResizeRedraw, true);
- // Yes, we want to be drawn double buffered by default
- DoubleBuffered = true;
+ // Contains another control and needs marking as such for validation to work
+ SetStyle(ControlStyles.ContainerControl, true);
+ // Cannot select this control, only the child tree view and does not generate a
+ SetStyle(ControlStyles.Selectable | ControlStyles.StandardClick, false);
// Default fields
- _alwaysActive = true;
- _style = ButtonStyle.ListItem;
- Padding = new Padding(1);
- base.BorderStyle = System.Windows.Forms.BorderStyle.None;
-
- // We need to create and cache a device context compatible with the display
- _screenDC = PI.CreateCompatibleDC(IntPtr.Zero);
-
- // Set the palette and renderer to the defaults as specified by the manager
- Redirector = new PaletteRedirect(null);
- CacheNewPalette(KryptonManager.CurrentGlobalPalette);
-
- KryptonManager.GlobalPaletteChanged += OnGlobalPaletteChanged;
-
- NeedPaintDelegate = OnNeedPaint;
+ base.Padding = new Padding(1);
// Create the palette storage
- Images = new CheckBoxImages(NeedPaintDelegate);
- _paletteCheckBoxImages = new PaletteRedirectCheckBox(Redirector, Images);
- StateCommon = new PaletteListStateRedirect(Redirector, PaletteBackStyle.InputControlStandalone, PaletteBorderStyle.InputControlStandalone, NeedPaintDelegate);
- OverrideFocus = new PaletteListItemTripleRedirect(Redirector, PaletteBackStyle.ButtonListItem, PaletteBorderStyle.ButtonListItem, PaletteContentStyle.ButtonListItem, NeedPaintDelegate);
- StateDisabled = new PaletteListState(StateCommon, NeedPaintDelegate);
- StateActive = new PaletteDouble(StateCommon, NeedPaintDelegate);
- StateNormal = new PaletteListState(StateCommon, NeedPaintDelegate);
- StateTracking = new PaletteListItemTriple(StateCommon.Item, NeedPaintDelegate);
- StatePressed = new PaletteListItemTriple(StateCommon.Item, NeedPaintDelegate);
- StateCheckedNormal = new PaletteListItemTriple(StateCommon.Item, NeedPaintDelegate);
- StateCheckedTracking = new PaletteListItemTriple(StateCommon.Item, NeedPaintDelegate);
- StateCheckedPressed = new PaletteListItemTriple(StateCommon.Item, NeedPaintDelegate);
- // Create manager and view for drawing the background
- ViewDrawPanel = new ViewDrawPanel(StateNormal.Back);
+ var backInherit = new PaletteBackInheritRedirect(Redirector, PaletteBackStyle.InputControlStandalone);
+ var borderInherit = new PaletteBorderInheritRedirect(Redirector, PaletteBorderStyle.InputControlStandalone);
+ var commonBack = new PaletteBackColor1(backInherit, NeedPaintDelegate);
+ var commonBorder = new PaletteBorder(borderInherit, NeedPaintDelegate);
+ StateCommon = new PaletteTreeStateRedirect(Redirector, commonBack, backInherit, commonBorder, borderInherit,
+ NeedPaintDelegate);
+ StateCommon.Node.BackStyle = PaletteBackStyle.InputControlStandalone;
+ var disabledBack = new PaletteBackColor1(StateCommon.PaletteBack, NeedPaintDelegate);
+ var disabledBorder = new PaletteBorder(StateCommon.PaletteBorder!, NeedPaintDelegate);
+ StateDisabled = new PaletteTreeState(StateCommon, disabledBack, disabledBorder, NeedPaintDelegate);
+
+ var normalBack = new PaletteBackColor1(StateCommon.PaletteBack, NeedPaintDelegate);
+ var normalBorder = new PaletteBorder(StateCommon.PaletteBorder!, NeedPaintDelegate);
+ StateNormal = new PaletteTreeState(StateCommon, normalBack, normalBorder, NeedPaintDelegate);
+
+ var activeBack = new PaletteBackColor1(StateCommon.PaletteBack, NeedPaintDelegate);
+ var activeBorder = new PaletteBorder(StateCommon.PaletteBorder!, NeedPaintDelegate);
+ StateActive = new PaletteDouble(StateCommon, activeBack, activeBorder, NeedPaintDelegate);
+
+ StateTracking = new PaletteTreeNodeTriple(StateCommon.Node, NeedPaintDelegate);
+ StateCheckedNormal = new PaletteTreeNodeTriple(StateCommon.Node, NeedPaintDelegate);
+ StateCheckedTracking = new PaletteTreeNodeTriple(StateCommon.Node, NeedPaintDelegate);
// Create the override handling classes
- _overrideNormal = new PaletteTripleOverride(OverrideFocus.Item, StateNormal.Item, PaletteState.FocusOverride);
- _overrideTracking = new PaletteTripleOverride(OverrideFocus.Item, StateTracking.Item, PaletteState.FocusOverride);
- _overridePressed = new PaletteTripleOverride(OverrideFocus.Item, StatePressed.Item, PaletteState.FocusOverride);
- _overrideCheckedNormal = new PaletteTripleOverride(OverrideFocus.Item, StateCheckedNormal.Item, PaletteState.FocusOverride);
- _overrideCheckedTracking = new PaletteTripleOverride(OverrideFocus.Item, StateCheckedTracking.Item, PaletteState.FocusOverride);
- _overrideCheckedPressed = new PaletteTripleOverride(OverrideFocus.Item, StateCheckedPressed.Item, PaletteState.FocusOverride);
-
- // Create the check box image drawer and place inside element so it is always centered
- _drawCheckBox = new ViewDrawCheckBox(_paletteCheckBoxImages);
- _layoutCheckBox = new ViewLayoutCenter
- {
- _drawCheckBox
- };
- _layoutCheckBoxAfter = new ViewLayoutSeparator(3, 0);
- _layoutCheckBoxStack = new ViewLayoutStack(true)
- {
- _layoutCheckBox,
- _layoutCheckBoxAfter
- };
- // Stack used to layout the location of the node image
- _layoutImage = new ViewLayoutSeparator(0, 0);
- _layoutImageAfter = new ViewLayoutSeparator(3, 0);
- _layoutImageCenter = new ViewLayoutCenter(_layoutImage);
- _layoutImageStack = new ViewLayoutStack(true)
- {
- _layoutImageCenter,
- _layoutImageAfter
- };
- _layoutImageState = new ViewLayoutSeparator(16, 16);
- _layoutImageCenterState = new ViewLayoutCenter(_layoutImageState);
- // Create the draw element for owner drawing individual items
- _contentValues = new ShortTextValue();
- _drawButton = new ViewDrawButton(StateDisabled.Item, _overrideNormal,
- _overrideTracking, _overridePressed,
- _overrideCheckedNormal, _overrideCheckedTracking,
- _overrideCheckedPressed,
- new PaletteMetricRedirect(Redirector),
- _contentValues, VisualOrientation.Top, false);
-
- // Place check box on the left and the label in the remainder
- _layoutDockerTile = new ViewLayoutDocker
- {
- { _layoutImageStack, ViewDockStyle.Left },
- { _layoutImageCenterState, ViewDockStyle.Left },
- { _layoutCheckBoxStack, ViewDockStyle.Left },
- { _drawButton, ViewDockStyle.Fill }
- };
-
- _layoutDockerSmall = new ViewLayoutDocker
- {
- { _drawButton, ViewDockStyle.Left },
- { _layoutImageStack, ViewDockStyle.Left },
- { _layoutImageCenterState, ViewDockStyle.Left },
- { _layoutCheckBoxStack, ViewDockStyle.Left }
- };
-
- // Place check box on the left and the text to match the width
- _layoutDockerCheckLarge = new ViewLayoutDocker
- {
- { _layoutImageStack, ViewDockStyle.Left },
- { _layoutImageCenterState, ViewDockStyle.Left },
- { _layoutCheckBoxStack, ViewDockStyle.Left },
- { _drawButton, ViewDockStyle.Bottom }
- };
-
- // Create the element that fills the remainder space and remembers fill rectangle
- _layoutFill = new ViewLayoutFill(this)
+ OverrideFocus = new PaletteTreeNodeTripleRedirect(Redirector, PaletteBackStyle.ButtonListItem,
+ PaletteBorderStyle.ButtonListItem, PaletteContentStyle.ButtonListItem, NeedPaintDelegate);
+ _overrideNormal = new PaletteTripleOverride(OverrideFocus.Node, StateNormal.Node, PaletteState.FocusOverride);
+ _overrideDisabled = new PaletteTripleOverride(StateNormal.Node, StateDisabled.Node, PaletteState.Disabled);
+ _overrideTracking = new PaletteTripleOverride(OverrideFocus.Node, StateTracking.Node, PaletteState.FocusOverride);
+ _overrideCheckedNormal = new PaletteTripleOverride(OverrideFocus.Node, StateCheckedNormal.Node, PaletteState.FocusOverride);
+ _overrideCheckedTracking = new PaletteTripleOverride(OverrideFocus.Node, StateCheckedTracking.Node, PaletteState.FocusOverride);
+
+ // Create the internal list box used for containing content
+ _listView = new InternalListView(this);
+ _listView.Click += OnListBoxClick; // SKC: make sure that the default click is also routed.
+ _listView.GotFocus += OnListViewGotFocus;
+ _listView.LostFocus += OnListViewLostFocus;
+
+ _layoutFill = new ViewLayoutFill(_listView)
{
DisplayPadding = new Padding(1)
};
// Create inner view for placing inside the drawing docker
- _drawDockerInner = new ViewLayoutDocker
+ var drawDockerInner = new ViewLayoutDocker
{
{ _layoutFill, ViewDockStyle.Fill }
};
@@ -198,479 +382,900 @@ public KryptonListView()
// Create view for the control border and background
_drawDockerOuter = new ViewDrawDocker(StateNormal.Back, StateNormal.Border)
{
- { _drawDockerInner, ViewDockStyle.Fill }
+ { drawDockerInner, ViewDockStyle.Fill }
};
-
+
// Create the view manager instance
ViewManager = new ViewManager(this, _drawDockerOuter);
+
// We need to create and cache a device context compatible with the display
_screenDC = PI.CreateCompatibleDC(IntPtr.Zero);
- StateCommon.Item.Content.ShortText.MultiLine = InheritBool.True;
- StateCommon.Item.Content.ShortText.MultiLineH = PaletteRelativeAlign.Center;
- StateCommon.Item.Content.ShortText.TextH = PaletteRelativeAlign.Center;
- _cornerRoundingRadius = GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
- _itemCornerRoundingRadius = GlobalStaticValues.SECONDARY_CORNER_ROUNDING_VALUE;
+ // Add tree view to the controls collection
+ ((KryptonReadOnlyControls)Controls).AddInternal(_listView);
}
- ///
- /// Gets access to the contained view draw panel instance.
- ///
- public ViewDrawPanel ViewDrawPanel { get; }
+ private void OnListBoxClick(object? sender, EventArgs e) => OnClick(e);
///
- /// Gets access to the palette redirector.
+ /// Clean up any resources being used.
///
- protected PaletteRedirect? Redirector
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
{
- [DebuggerStepThrough]
- get;
+ base.Dispose(disposing);
+ if (_screenDC != IntPtr.Zero)
+ {
+ PI.DeleteDC(_screenDC);
+ }
}
+
+ #region Public
+
///
- /// Gets and sets the ViewManager instance.
+ /// Gets access to the contained TreeView instance.
///
- public ViewManager ViewManager
- {
- [DebuggerStepThrough]
- get;
- }
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ [EditorBrowsable(EditorBrowsableState.Always)]
+ [Browsable(false)]
+ public ListView ListView => _listView;
+
///
- /// Gets access to the current renderer.
+ /// Gets access to the contained input control.
///
- [Browsable(false)]
- [EditorBrowsable(EditorBrowsableState.Advanced)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public IRenderer? Renderer
+ [EditorBrowsable(EditorBrowsableState.Always)]
+ [Browsable(false)]
+ public Control ContainedControl => _listView;
+
+ /// Gets or sets the type of action the user must take to activate an item.
+ /// One of the values. The default is .
+ /// The value specified is not one of the members.
+ [Category("Behavior")]
+ [DefaultValue(ItemActivation.Standard)]
+ [Description("ListViewActivationDescr")]
+ public ItemActivation Activation
{
- [DebuggerStepThrough]
- get;
- private set;
+ get => _listView.Activation;
+ set => _listView.Activation = value;
}
- #endregion
-
- #region Public
-
- /// Gets or sets the corner rounding radius.
- /// The corner rounding radius.
- [Category(@"Visuals")]
- [Description(@"Gets or sets the corner rounding radius.")]
- [DefaultValue(GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE)]
- public float CornerRoundingRadius
+ /// Gets or sets the alignment of items in the control.
+ /// One of the values. The default is .
+ /// The value specified is not one of the values.
+ [Category("Behavior")]
+ [DefaultValue(ListViewAlignment.Top)]
+ [Localizable(true)]
+ [Description("ListViewAlignmentDescr")]
+ public ListViewAlignment Alignment
{
- get => _cornerRoundingRadius;
-
- set => SetCornerRoundingRadius(value);
+ get => _listView.Alignment;
+ set => _listView.Alignment = value;
}
- /// Gets or sets the item corner rounding radius.
- /// The item corner rounding radius.
- [Category(@"Visuals")]
- [Description(@"Gets or sets the item corner rounding radius.")]
- [DefaultValue(GlobalStaticValues.SECONDARY_CORNER_ROUNDING_VALUE)]
- public float ItemCornerRoundingRadius
+ /// Gets or sets a value indicating whether the user can drag column headers to reorder columns in the control.
+ ///
+ /// if drag-and-drop column reordering is allowed; otherwise, . The default is .
+ [Category("Behavior")]
+ [DefaultValue(false)]
+ [Description("ListViewAllowColumnReorderDescr")]
+ public bool AllowColumnReorder
{
- get => _itemCornerRoundingRadius;
+ get => _listView.AllowColumnReorder;
+ set => _listView.AllowColumnReorder = value;
+ }
- set => SetItemCornerRoundingRadius(value);
+ /// Gets or sets whether icons are automatically kept arranged.
+ ///
+ /// if icons are automatically kept arranged and snapped to the grid; otherwise, . The default is .
+ [Category("Behavior")]
+ [DefaultValue(true)]
+ [Description("ListViewAutoArrangeDescr")]
+ public bool AutoArrange
+ {
+ get => _listView.AutoArrange;
+ set => _listView.AutoArrange = value;
}
- /// Gets and sets the custom palette implementation.
- [Category(@"Visuals")]
- [Description(@"Custom palette applied to drawing.")]
- [DefaultValue(null)]
- public PaletteBase? Palette
+ /// Gets or sets a value indicating whether the background image of the should be tiled.
+ ///
+ /// if the background image of the should be tiled; otherwise, . The default is .
+ [Category("Appearance")]
+ [DefaultValue(false)]
+ [Description("ListViewBackgroundImageTiledDescr")]
+ public bool BackgroundImageTiled
{
- [DebuggerStepThrough]
- get => _localPalette;
- set
- {
- if (_localPalette == value)
- {
- return;
- }
+ get => _listView.BackgroundImageTiled;
+ set => _listView.BackgroundImageTiled = value;
+ }
- CacheNewPalette(value);
- if (value == null)
- {
- _paletteMode = PaletteMode.Global;
- _localPalette = null;
- CacheNewPalette(KryptonManager.GetPaletteForMode(_paletteMode));
- }
- else
- {
- _localPalette = value;
- _paletteMode = PaletteMode.Custom;
- }
- PerformLayout();
- }
+
+ /// Gets or sets a value indicating whether a check box appears next to each item in the control.
+ ///
+ /// if a check box appears next to each item in the control; otherwise, . The default is .
+ [Category("Appearance")]
+ [DefaultValue(false)]
+ [Description("ListViewCheckBoxesDescr")]
+ public bool CheckBoxes
+ {
+ get => _listView.CheckBoxes;
+ set => _listView.CheckBoxes = value;
}
- /// Resets the Palette property to its default value.
- public void ResetPalette() => PaletteMode = PaletteMode.Global;
///
- /// Gets and sets Determines if the control is always active or only when the mouse is over the control or has focus.
+ /// Gets or sets the text for the control.
///
- [Category(@"Visuals")]
- [Description(@"Determines if the control is always active or only when the mouse is over the control or has focus.")]
- [DefaultValue(true)]
- public bool AlwaysActive
+ [Browsable(false)]
+ [Bindable(false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ [AllowNull]
+ public override string Text
{
- get => _alwaysActive;
-
- set
- {
- if (_alwaysActive != value)
- {
- _alwaysActive = value;
- Invalidate();
- }
- }
+ get => base.Text;
+ set => base.Text = value;
}
///
- /// Sets the fixed state of the control.
+ /// Gets or sets the background color for the control.
///
- /// Should the control be fixed as active.
- public void SetFixedState(bool active) => _fixedActive = active;
+ [Browsable(false)]
+ [Bindable(false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public override Color BackColor
+ {
+ get => base.BackColor;
+ set => base.BackColor = value;
+ }
///
- /// Gets a value indicating if the input control is active.
+ /// Gets or sets the font of the text Displayed by the control.
///
[Browsable(false)]
+ [Bindable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
- public bool IsActive => _fixedActive ?? DesignMode || AlwaysActive || ContainsFocus || _mouseOver;
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ [AmbientValue(null)]
+ [AllowNull]
+ public override Font Font
+ {
+ get => base.Font;
+ set => base.Font = value!;
+ }
- public new bool OwnerDraw
+ ///
+ /// Gets or sets the foreground color for the control.
+ ///
+ [Browsable(false)]
+ [Bindable(false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public override Color ForeColor
{
- get => base.OwnerDraw; // Should be true!
- // ReSharper disable once ValueParameterNotUsed
- set { /*Do nothing*/}
+ get => base.ForeColor;
+ set => base.ForeColor = value;
}
- /// Gets or sets the associated with this control.
- /// The for this control, or if there is no . The default is .
- [Category(@"Behavior")]
- [Description(@"Consider using KryptonContextMenu within the behaviors section.\nThe Winforms shortcut menu to show when the user right-clicks the page.\nNote: The ContextMenu will be rendered.")]
- [DefaultValue(null)]
- public override ContextMenuStrip? ContextMenuStrip
+ ///
+ /// Gets and sets the internal padding space.
+ ///
+ [DefaultValue(typeof(Padding), "1,1,1,1")]
+ public new Padding Padding
{
- [DebuggerStepThrough]
- get => base.ContextMenuStrip;
+ get => base.Padding;
set
{
- // Unhook from any current menu strip
- if (base.ContextMenuStrip != null)
- {
- base.ContextMenuStrip.Opening -= OnContextMenuStripOpening;
- base.ContextMenuStrip.Closed -= OnContextMenuClosed;
- }
-
- // Let parent handle actual storage
- base.ContextMenuStrip = value;
-
- // Hook into the strip being shown (so we can set the correct renderer)
- if (base.ContextMenuStrip != null)
- {
- base.ContextMenuStrip.Opening += OnContextMenuStripOpening;
- base.ContextMenuStrip.Closed += OnContextMenuClosed;
- }
+ base.Padding = value;
+ _layoutFill.DisplayPadding = value;
+ PerformNeedPaint(true);
}
}
+ /// Gets the indexes of the currently checked items in the control.
+ /// A that contains the indexes of the currently checked items. If no items are currently checked, an empty is returned.
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public ListView.CheckedIndexCollection CheckedIndices => _listView.CheckedIndices;
- ///
- /// Gets and sets the KryptonContextMenu to show when right clicked.
- ///
- [Category(@"Behavior")]
- [Description(@"The KryptonContextMenu to show when the user right-clicks the Control.")]
- [DefaultValue(null)]
- public virtual KryptonContextMenu? KryptonContextMenu
- {
- get => _kryptonContextMenu;
+ /// Gets the currently checked items in the control.
+ /// A that contains the currently checked items. If no items are currently checked, an empty is returned.
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public ListView.CheckedListViewItemCollection CheckedItems => _listView.CheckedItems;
- set
- {
- if (_kryptonContextMenu != value)
- {
- if (_kryptonContextMenu != null)
- {
- _kryptonContextMenu.Closed -= OnContextMenuClosed;
- _kryptonContextMenu.Disposed -= OnKryptonContextMenuDisposed;
- }
+ /// Gets the collection of all column headers that appear in the control.
+ /// A that represents the column headers that appear when the property is set to .
+ [Category("CatBehavior")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ [Editor("System.Windows.Forms.Design.ColumnHeaderCollectionEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
+ [Description("collection of all column headers that appear in the control")]
+ [Localizable(true)]
+ [MergableProperty(false)]
+ public ListView.ColumnHeaderCollection Columns => _listView.Columns;
- _kryptonContextMenu = value;
- if (_kryptonContextMenu != null)
- {
- _kryptonContextMenu.Closed += OnContextMenuClosed;
- _kryptonContextMenu.Disposed += OnKryptonContextMenuDisposed;
- }
- }
- }
+ /// Gets or sets the item in the control that currently has focus.
+ /// A that represents the item that has focus, or if no item has the focus in the .
+ [Category("Appearance")]
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ [Description("ListViewFocusedItemDescr")]
+ public ListViewItem? FocusedItem
+ {
+ get => _listView.FocusedItem;
+ set => _listView.FocusedItem = value;
}
- #endregion public
- #region DrawItem and SubItem
- private void UpdateStateAndPalettes()
+ /// Gets or sets a value indicating whether clicking an item selects all its subitems.
+ ///
+ /// if clicking an item selects the item and all its subitems; if clicking an item selects only the item itself. The default is .
+ [Category("Appearance")]
+ [DefaultValue(false)]
+ [Description("if clicking an item selects the item and all its subitems")]
+ public bool FullRowSelect
{
- if (!IsDisposed)
- {
- // Get the correct palette settings to use
- IPaletteDouble doubleState = GetDoubleState();
- ViewDrawPanel.SetPalettes(doubleState.PaletteBack);
- _drawDockerOuter.SetPalettes(doubleState.PaletteBack, doubleState.PaletteBorder);
- _drawDockerOuter.Enabled = Enabled;
+ get => _listView.FullRowSelect;
+ set => _listView.FullRowSelect = value;
+ }
- // Find the new state of the main view element
- PaletteState state;
- if (IsActive)
- {
- state = PaletteState.Tracking;
- }
- else
- {
- state = Enabled ? PaletteState.Normal : PaletteState.Disabled;
- }
+ /// Gets or sets a value indicating whether grid lines appear between the rows and columns containing the items and subitems in the control.
+ ///
+ /// if grid lines are drawn around items and subitems; otherwise, . The default is .
+ [Category("Appearance")]
+ [DefaultValue(false)]
+ [Description("if grid lines are drawn around items and subitems")]
+ public bool GridLines
+ {
+ get => _listView.GridLines;
+ set => _listView.GridLines = value;
+ }
- ViewDrawPanel.ElementState = state;
- _drawDockerOuter.ElementState = state;
- }
+ /// Gets the collection of objects assigned to the control.
+ /// A that contains all the groups in the control.
+ [Category("Behavior")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ [Localizable(true)]
+ [Editor("System.Windows.Forms.Design.ListViewGroupCollectionEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
+ typeof(UITypeEditor))]
+ [Description("ListViewGroupsDescr")]
+ [MergableProperty(false)]
+ public ListViewGroupCollection Groups => _listView.Groups;
+
+ /// Gets or sets the column header style.
+ /// One of the values. The default is .
+ /// The value specified is not one of the values.
+ [Category("Behavior")]
+ [DefaultValue(ColumnHeaderStyle.Clickable)]
+ [Description("ListViewHeaderStyleDescr")]
+ public ColumnHeaderStyle HeaderStyle
+ {
+ get => _listView.HeaderStyle;
+ set => _listView.HeaderStyle = value;
}
- private IPaletteDouble GetDoubleState() => Enabled ? IsActive ? StateActive : StateNormal : StateDisabled;
+ /// Gets or sets a value indicating whether the selected item in the control remains highlighted when the control loses focus.
+ ///
+ /// if the selected item does not appear highlighted when the control loses focus; if the selected item still appears highlighted when the control loses focus. The default is .
+ [Category("Behavior")]
+ [DefaultValue(true)]
+ [Description("if the selected item does not appear highlighted when the control loses focus")]
+ public bool HideSelection
+ {
+ get => _listView.HideSelection;
+ set => _listView.HideSelection = value;
+ }
- /// Raises the DrawItem event.
- /// A DrawListViewItemEventArgs that contains the event data.
- protected override void OnDrawItem(DrawListViewItemEventArgs e)
+ /// Gets or sets a value indicating whether the text of an item or subitem has the appearance of a hyperlink when the mouse pointer passes over it.
+ ///
+ /// if the item text has the appearance of a hyperlink when the mouse passes over it; otherwise, . The default is .
+ [Category("Behavior")]
+ [DefaultValue(false)]
+ [Description("if the item text has the appearance of a hyperlink when the mouse passes over it")]
+ public bool HotTracking
{
- // We cannot do anything without a valid node
- if (e.Item == null)
- {
- return;
- }
+ get => _listView.HotTracking;
+ set => _listView.HotTracking = value;
+ }
- // Do we need an image?
- ImageList imgList = View switch
- {
- View.LargeIcon => LargeImageList,
- View.Tile => LargeImageList,
- View.SmallIcon => SmallImageList,
- _ => null
- };
- if (imgList != null)
- {
- _layoutImageStack.Visible = true;
- _layoutImage.SeparatorSize = imgList.ImageSize;
- }
- else
- {
- _layoutImageStack.Visible = false;
- }
+ /// Gets or sets a value indicating whether an item is automatically selected when the mouse pointer remains over the item for a few seconds.
+ ///
+ /// if an item is automatically selected when the mouse pointer hovers over it; otherwise, . The default is .
+ [Category("Behavior")]
+ [DefaultValue(false)]
+ [Description("if an item is automatically selected when the mouse pointer hovers over ")]
+ public bool HoverSelection
+ {
+ get => _listView.HoverSelection;
+ set => _listView.HoverSelection = value;
+ }
- // Work out if we need to draw a state image
- Image? drawStateImage = null;
- if (StateImageList != null)
- {
- try
- {
- // If showing check boxes then used fixed entries from the state image list
- if (CheckBoxes)
- {
- drawStateImage = e.Item.Checked ? StateImageList.Images[1] : StateImageList.Images[0];
- }
- else
- {
- // Check node values
- if ((e.Item.StateImageIndex >= 0)
- && (e.Item.StateImageIndex < StateImageList.Images.Count)
- )
- {
- drawStateImage = StateImageList.Images[e.Item.StateImageIndex];
- }
- }
- }
- catch
- {
- // ignored
- }
- }
- _layoutImageCenterState.Visible = drawStateImage != null;
- _layoutCheckBoxStack.Visible = (drawStateImage == null) && CheckBoxes && (View != View.Tile);
- if (_layoutCheckBoxStack.Visible)
- {
- _drawCheckBox.CheckState = e.Item.Checked ? CheckState.Checked : CheckState.Unchecked;
- }
- _contentValues.ShortText = View switch
- {
- View.LargeIcon => e.Item.Text,
- View.Tile => e.Item.Text,
- View.SmallIcon => $@"{e.Item.Text} ", // Hack to get the button to "Surround" the text
- _ => null
- };
+ /// Gets a collection containing all items in the control.
+ /// A that contains all the items in the control.
+ [Category("Behavior")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ [Localizable(true)]
+ [Editor(
+ "System.Windows.Forms.Design.ListViewItemCollectionEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
+ typeof(UITypeEditor))]
+ [Description("Gets a collection containing all items in the control")]
+ [MergableProperty(false)]
+ public ListView.ListViewItemCollection Items => _listView.Items;
+
+
+ /// Gets or sets a value indicating whether the user can edit the labels of items in the control.
+ ///
+ /// if the user can edit the labels of items at run time; otherwise, . The default is .
+ [Category("Behavior")]
+ [DefaultValue(false)]
+ [Description("ListViewLabelEditDescr")]
+ public bool LabelEdit
+ {
+ get => _listView.LabelEdit;
+ set => _listView.LabelEdit = value;
+ }
- // By default the button is in the normal state
- PaletteState buttonState;
+ /// Gets or sets a value indicating whether item labels wrap when items are displayed in the control as icons.
+ ///
+ /// if item labels wrap when items are displayed as icons; otherwise, . The default is .
+ [Category("Behavior")]
+ [DefaultValue(true)]
+ [Localizable(true)]
+ [Description("if item labels wrap when items are displayed as icons")]
+ public bool LabelWrap
+ {
+ get => _listView.LabelWrap;
+ set => _listView.LabelWrap = value;
+ }
- if (e.State.HasFlag(ListViewItemStates.Grayed))
- {
- buttonState = PaletteState.Disabled;
- }
- else
- {
- // If selected then show as a checked item
- if (e.Item.Selected)
- {
- _drawButton.Checked = true;
+ /// Gets or sets the to use when displaying items as large icons in the control.
+ /// An that contains the icons to use when the property is set to . The default is .
+ [Category("Behavior")]
+ [DefaultValue(null)]
+ [Description("contains the icons to use")]
+ public ImageList? LargeImageList
+ {
+ get => _listView.LargeImageList;
+ set => _listView.LargeImageList = value;
+ }
- buttonState = e.State.HasFlag(ListViewItemStates.Hot)
- ? PaletteState.CheckedTracking
- : PaletteState.CheckedNormal;
- }
- else
- {
- _drawButton.Checked = false;
+ /// Gets or sets the sorting comparer for the control.
+ /// An that represents the sorting comparer for the control.
+ [Category("Behavior")]
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ [Description("sorting comparer for the control")]
+ public IComparer? ListViewItemSorter
+ {
+ get => _listView.ListViewItemSorter;
+ set => _listView.ListViewItemSorter = value;
+ }
- buttonState = e.State.HasFlag(ListViewItemStates.Hot)
- ? PaletteState.Tracking
- : PaletteState.Normal;
- }
+ /// Gets or sets a value indicating whether multiple items can be selected.
+ ///
+ /// if multiple items in the control can be selected at one time; otherwise, . The default is .
+ [Category("Behavior")]
+ [DefaultValue(true)]
+ [Description("if multiple items in the control can be selected at one time")]
+ public bool MultiSelect
+ {
+ get => _listView.MultiSelect;
+ set => _listView.MultiSelect = value;
+ }
- // Do we need to show item as having the focus
- var hasFocus = e.Item.Focused;
+ /// Gets or sets a value indicating whether the control is laid out from right to left.
+ ///
+ /// to indicate the control is laid out from right to left; otherwise, .
+ [Category("Appearance")]
+ [Localizable(true)]
+ [DefaultValue(false)]
+ [Description("control is laid out from right to left")]
+ public bool RightToLeftLayout
+ {
+ get => _listView.RightToLeftLayout;
+ set => _listView.RightToLeftLayout = value;
+ }
- _overrideNormal.Apply = hasFocus;
- _overrideTracking.Apply = hasFocus;
- _overridePressed.Apply = hasFocus;
- _overrideCheckedTracking.Apply = hasFocus;
- _overrideCheckedNormal.Apply = hasFocus;
- _overrideCheckedPressed.Apply = hasFocus;
- }
+ /// Gets or sets a value indicating whether a scroll bar is added to the control when there is not enough room to display all items.
+ ///
+ /// if scroll bars are added to the control when necessary to allow the user to see all the items; otherwise, . The default is .
+ [Category("Behavior")]
+ [DefaultValue(true)]
+ [Description("if scroll bars are added to the control when necessary to allow the user to see all the items")]
+ public bool Scrollable
+ {
+ get => _listView.Scrollable;
+ set => _listView.Scrollable = value;
+ }
+
+ /// Gets the indexes of the selected items in the control.
+ /// A that contains the indexes of the selected items. If no items are currently selected, an empty is returned.
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public ListView.SelectedIndexCollection SelectedIndices => _listView.SelectedIndices;
+
+ /// Gets the items that are selected in the control.
+ /// A that contains the items that are selected in the control. If no items are currently selected, an empty is returned.
+ [Category("Appearance")]
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ [Description("Gets the items that are selected in the control")]
+ public ListView.SelectedListViewItemCollection SelectedItems => _listView.SelectedItems;
+
+ /// Gets or sets a value indicating whether items are displayed in groups.
+ ///
+ /// to display items in groups; otherwise, . The default value is .
+ [Category("Behavior")]
+ [DefaultValue(true)]
+ [Description("to display items in groups")]
+ public bool ShowGroups
+ {
+ get => _listView.ShowGroups;
+ set => _listView.ShowGroups = value;
+ }
+
+ /// Gets or sets the to use when displaying items as small icons in the control.
+ /// An that contains the icons to use when the property is set to . The default is .
+ [Category("Behavior")]
+ [DefaultValue(null)]
+ [Description("use when displaying items as small icons in the control")]
+ public ImageList? SmallImageList
+ {
+ get => _listView.SmallImageList;
+ set => _listView.SmallImageList = value;
+ }
+
+ /// Gets or sets a value indicating whether ToolTips are shown for the objects contained in the .
+ ///
+ /// if ToolTips should be shown; otherwise, . The default is .
+ [Category("Behavior")]
+ [DefaultValue(false)]
+ [Description("ToolTips should be shown")]
+ public bool ShowItemToolTips
+ {
+ get => _listView.ShowItemToolTips;
+ set => _listView.ShowItemToolTips = value;
+ }
- // Update the view with the calculated state
- _drawButton.ElementState = buttonState;
+ /// Gets or sets the sort order for items in the control.
+ /// One of the values. The default is .
+ /// The value specified is not one of the values.
+ [Category("Behavior")]
+ [DefaultValue(SortOrder.None)]
+ [Description("ListViewSortingDescr")]
+ public SortOrder Sorting
+ {
+ get => _listView.Sorting;
+ set => _listView.Sorting = value;
+ }
+
+ /// Gets or sets the associated with application-defined states in the control.
+ /// An that contains a set of state images that can be used to indicate an application-defined state of an item. The default is .
+ [Category("CatBehavior")]
+ [DefaultValue(null)]
+ [Description("ListViewStateImageListDescr")]
+ public ImageList? StateImageList
+ {
+ get => _listView.StateImageList;
+ set => _listView.StateImageList = value;
+ }
+
+ /// Gets or sets the size of the tiles shown in tile view.
+ /// A that contains the new tile size.
+ [Category("Appearance")]
+ [Browsable(true)]
+ [Description("contains the new tile size")]
+ public Size TileSize
+ {
+ get => _listView.TileSize;
+ set => _listView.TileSize = value;
+ }
+ private bool ShouldSerializeTileSize() => !TileSize.Equals(Size.Empty);
+
+ /// Gets or sets the first visible item in the control.
+ /// A that represents the first visible item in the control.
+ /// The property is set to , , or .
+ [Category("Appearance")]
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ [Description("ListViewTopItemDescr")]
+ public ListViewItem? TopItem
+ {
+ get => _listView.TopItem;
+ set => _listView.TopItem = value;
+ }
+
+ /// Gets or sets how items are displayed in the control.
+ /// One of the values. The default is .
+ /// The value specified is not one of the values.
+ [Category("Appearance")]
+ [DefaultValue(View.LargeIcon)]
+ [Description("ListViewViewDescr")]
+ public View View
+ {
+ get => _listView.View;
+ set => _listView.View = value;
+ }
+
+ /* TODO: Need to wire up the virtual events as well
+ /// Gets or sets the number of objects contained in the list when in virtual mode.
+ /// The number of objects contained in the when in virtual mode.
+ ///
+ /// is set to a value less than 0.
+ ///
+ /// is set to , is greater than 0, and is not handled.
+ [Category("Behavior")]
+ [DefaultValue(0)]
+ [RefreshProperties(RefreshProperties.Repaint)]
+ [Description("ListViewVirtualListSizeDescr")]
+ public int VirtualListSize
+ {
+ get => _listView.VirtualListSize;
+ set => _listView.VirtualListSize = value;
+ }
+
+ /// Gets or sets a value indicating whether you have provided your own data-management operations for the control.
+ ///
+ /// if uses data-management operations that you provide; otherwise, . The default is .
+ ///
+ /// is set to and one of the following conditions exist:
+ ///
+ /// is greater than 0 and is not handled.
+ /// -or-
+ ///
+ /// , , or contains items.
+ /// -or-
+ ///
+ /// Edits are made to .
+ [Category("Behavior")]
+ [DefaultValue(false)]
+ [RefreshProperties(RefreshProperties.Repaint)]
+ [Description("ListViewVirtualModeDescr")]
+ public bool VirtualMode
+ {
+ get => _listView.VirtualMode;
+ set => _listView.VirtualMode = value;
+ }
+ */
+
+ /// Arranges items in the control when they are displayed as icons with a specified alignment setting.
+ /// One of the values.
+ /// The value specified in the parameter is not a member of the enumeration.
+ public void ArrangeIcons(ListViewAlignment value) => _listView.ArrangeIcons(value);
+ /// Arranges items in the control when they are displayed as icons based on the value of the property.
+ public void ArrangeIcons() => _listView.ArrangeIcons(ListViewAlignment.Default);
+
+ /// Resizes the width of the columns as indicated by the resize style.
+ /// One of the values.
+ ///
+ /// is called with a value other than when is not set to .
+ public void AutoResizeColumns(ColumnHeaderAutoResizeStyle headerAutoResize) =>
+ _listView.AutoResizeColumns(headerAutoResize);
+
+ /// Resizes the width of the given column as indicated by the resize style.
+ /// The zero-based index of the column to resize.
+ /// One of the values.
+ ///
+ /// is greater than 0 when is
+ /// -or-
+ /// is less than 0 or greater than the number of columns set.
+ ///
+ /// is not a member of the enumeration.
+ public void AutoResizeColumn(int columnIndex, ColumnHeaderAutoResizeStyle headerAutoResize) => _listView.AutoResizeColumn(columnIndex, headerAutoResize);
+
+ /// Removes all items and columns from the control.
+ public void Clear() => _listView.Clear();
+
+ /// Finds the first that begins with the specified text value.
+ /// The text to search for.
+ /// The first that begins with the specified text value.
+ public ListViewItem? FindItemWithText(string text) => _listView.FindItemWithText(text);
+
+ /// Finds the first or , if indicated, that begins with the specified text value. The search starts at the specified index.
+ /// The text to search for.
+ ///
+ /// to include subitems in the search; otherwise, .
+ /// The index of the item at which to start the search.
+ /// The first that begins with the specified text value.
+ ///
+ /// is less 0 or more than the number items in the .
+ public ListViewItem? FindItemWithText(string text, bool includeSubItemsInSearch, int startIndex) =>
+ _listView.FindItemWithText(text, includeSubItemsInSearch, startIndex);
+
+ /// Finds the first or , if indicated, that begins with the specified text value. The search starts at the specified index.
+ /// The text to search for.
+ ///
+ /// to include subitems in the search; otherwise, .
+ /// The index of the item at which to start the search.
+ ///
+ /// to allow partial matches; otherwise, .
+ /// The first that begins with the specified text value.
+ ///
+ /// is less than 0 or more than the number of items in the .
+ public ListViewItem? FindItemWithText(
+ string text,
+ bool includeSubItemsInSearch,
+ int startIndex,
+ bool isPrefixSearch) =>
+ _listView.FindItemWithText(text, includeSubItemsInSearch, startIndex, isPrefixSearch);
+
+ /// Finds the next item from the given point, searching in the specified direction
+ /// One of the values.
+ /// The point at which to begin searching.
+ /// The that is closest to the given point, searching in the specified direction.
+ ///
+ /// is set to a value other than or .
+ public ListViewItem? FindNearestItem(SearchDirectionHint dir, Point point) =>
+ _listView.FindNearestItem(dir, point);
+
+ /// Finds the next item from the given x- and y-coordinates, searching in the specified direction.
+ /// One of the values.
+ /// The x-coordinate for the point at which to begin searching.
+ /// The y-coordinate for the point at which to begin searching.
+ /// The that is closest to the given coordinates, searching in the specified direction.
+ ///
+ /// is set to a value other than or .
+ public ListViewItem? FindNearestItem(SearchDirectionHint searchDirection, int x, int y) =>
+ _listView.FindNearestItem(searchDirection, x, y);
+
+ /// Retrieves the item at the specified location.
+ /// The x-coordinate of the location to search for an item (expressed in client coordinates).
+ /// The y-coordinate of the location to search for an item (expressed in client coordinates).
+ /// A that represents the item at the specified position. If there is no item at the specified location, the method returns .
+ public ListViewItem? GetItemAt(int x, int y) => _listView.GetItemAt(x, y);
+
+ /// Retrieves the bounding rectangle for a specific item within the list view control.
+ /// The zero-based index of the item within the whose bounding rectangle you want to return.
+ /// A that represents the bounding rectangle of the specified .
+ public Rectangle GetItemRect(int index) => this.GetItemRect(index, ItemBoundsPortion.Entire);
+
+ /// Retrieves the specified portion of the bounding rectangle for a specific item within the list view control.
+ /// The zero-based index of the item within the whose bounding rectangle you want to return.
+ /// One of the values that represents a portion of the for which to retrieve the bounding rectangle.
+ /// A that represents the bounding rectangle for the specified portion of the specified .
+ public Rectangle GetItemRect(int index, ItemBoundsPortion portion) => _listView.GetItemRect(index, portion);
+
+ /// Provides item information, given a point.
+ /// The at which to retrieve the item information. The coordinates are relative to the upper-left corner of the control.
+ /// The item information, given a point.
+ /// The point contains coordinates that are less than 0.
+ public ListViewHitTestInfo HitTest(Point point) => this.HitTest(point.X, point.Y);
+
+ /// Provides item information, given x- and y-coordinates.
+ /// The x-coordinate at which to retrieve the item information. The coordinate is relative to the upper-left corner of the control.
+ /// The y-coordinate at which to retrieve the item information. The coordinate is relative to the upper-left corner of the control.
+ /// The item information, given x- and y- coordinates.
+ /// The x- or y-coordinate is less than 0.
+ public ListViewHitTestInfo HitTest(int x, int y) => _listView.HitTest(x, y);
+
+ /// Forces a range of objects to be redrawn.
+ /// The index for the first item in the range to be redrawn.
+ /// The index for the last item of the range to be redrawn.
+ ///
+ /// to invalidate the range of items; to invalidate and repaint the items.
+ ///
+ /// or is less than 0, greater than or equal to the number of items in the or, if in virtual mode, greater than the value of .
+ /// -or-
+ /// The given is greater than the
+ [EditorBrowsable(EditorBrowsableState.Advanced)]
+ public void RedrawItems(int startIndex, int endIndex, bool invalidateOnly) =>
+ _listView.RedrawItems(startIndex, endIndex, invalidateOnly);
+
+ /// Sorts the items of the list view.
+ public void Sort() => _listView.Sort();
+
+ /// Returns a string representation of the control.
+ /// A string that states the control type, the count of items in the control, and the type of the first item in the , if the count is not 0.
+ public override string ToString() => _listView.ToString();
+
+ ///
+ /// Maintains performance while items are added to the ListBox one at a time by preventing the control from drawing until the EndUpdate method is called.
+ ///
+ public void BeginUpdate() => _listView.BeginUpdate();
+
+ ///
+ /// Resumes painting the ListBox control after painting is suspended by the BeginUpdate method.
+ ///
+ public void EndUpdate() => _listView.EndUpdate();
+
+ /// Ensures that the specified item is visible within the control, scrolling the contents of the control if necessary.
+ /// The zero-based index of the item to scroll into view.
+ public void EnsureVisible(int index) => _listView.EnsureVisible(index);
+
+ ///
+ /// Gets access to the common appearance entries that other states can override.
+ ///
+ [Category(@"Visuals")]
+ [Description(@"Overrides for defining common appearance that other states can override.")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ public PaletteTreeStateRedirect StateCommon { get; }
+
+ private bool ShouldSerializeStateCommon() => !StateCommon.IsDefault;
+
+ ///
+ /// Gets access to the disabled appearance entries.
+ ///
+ [Category(@"Visuals")]
+ [Description(@"Overrides for defining disabled appearance.")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ public PaletteTreeState StateDisabled { get; }
+
+ private bool ShouldSerializeStateDisabled() => !StateDisabled.IsDefault;
+
+ ///
+ /// Gets access to the normal appearance entries.
+ ///
+ [Category(@"Visuals")]
+ [Description(@"Overrides for defining normal appearance.")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ public PaletteTreeState StateNormal { get; }
+
+ private bool ShouldSerializeStateNormal() => !StateNormal.IsDefault;
+
+ ///
+ /// Gets access to the active appearance entries.
+ ///
+ [Category(@"Visuals")]
+ [Description(@"Overrides for defining active appearance.")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ public PaletteDouble StateActive { get; }
+
+ private bool ShouldSerializeStateActive() => !StateActive.IsDefault;
+
+ ///
+ /// Gets access to the hot tracking item appearance entries.
+ ///
+ [Category(@"Visuals")]
+ [Description(@"Overrides for defining hot tracking item appearance.")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ public PaletteTreeNodeTriple StateTracking { get; }
+
+ private bool ShouldSerializeStateTracking() => !StateTracking.IsDefault;
+
+ ///
+ /// Gets access to the normal checked item appearance entries.
+ ///
+ [Category(@"Visuals")]
+ [Description(@"Overrides for defining normal checked item appearance.")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ public PaletteTreeNodeTriple StateCheckedNormal { get; }
+
+ private bool ShouldSerializeStateCheckedNormal() => !StateCheckedNormal.IsDefault;
+
+ ///
+ /// Gets access to the hot tracking checked item appearance entries.
+ ///
+ [Category(@"Visuals")]
+ [Description(@"Overrides for defining hot tracking checked item appearance.")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ public PaletteTreeNodeTriple StateCheckedTracking { get; }
+
+ private bool ShouldSerializeStateCheckedTracking() => !StateCheckedTracking.IsDefault;
- // Grab the raw device context for the graphics instance
- var hdc = e.Graphics.GetHdc();
+ ///
+ /// Gets and sets Determines if the control is always active or only when the mouse is over the control or has focus.
+ ///
+ [Category(@"Visuals")]
+ [Description(
+ @"Determines if the control is always active or only when the mouse is over the control or has focus.")]
+ [DefaultValue(false)]
+ public bool AlwaysActive
+ {
+ get => _alwaysActive;
- try
+ set
{
- Rectangle bounds = e.Bounds;
- ViewLayoutDocker layoutDocker = View switch
- {
- View.LargeIcon => _layoutDockerCheckLarge,
- View.SmallIcon => _layoutDockerSmall,
- View.Tile => _layoutDockerTile,
-#pragma warning disable CA2208 // Instantiate argument exceptions correctly
- _ => throw new ArgumentOutOfRangeException(nameof(View))
-#pragma warning restore CA2208 // Instantiate argument exceptions correctly
- };
-
- using (var context = new ViewLayoutContext(this, Renderer))
+ if (_alwaysActive != value)
{
- context.DisplayRectangle = e.Bounds;
- ViewDrawPanel.Layout(context);
- layoutDocker.Layout(context);
+ _alwaysActive = value;
+ Invalidate();
}
+ }
+ }
- // Create bitmap that all drawing occurs onto, then we can blit it later to remove flicker
- var hBitmap = PI.CreateCompatibleBitmap(hdc, bounds.Right, bounds.Bottom);
+ ///
+ /// Sets the fixed state of the control.
+ ///
+ /// Should the control be fixed as active.
+ public void SetFixedState(bool active) => _fixedActive = active;
- // If we managed to get a compatible bitmap
- if (hBitmap != IntPtr.Zero)
- {
- try
- {
- // Must use the screen device context for the bitmap when drawing into the
- // bitmap otherwise the Opacity and RightToLeftLayout will not work correctly.
- PI.SelectObject(_screenDC, hBitmap);
+ ///
+ /// Gets a value indicating if the input control is active.
+ ///
+ [Browsable(false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool IsActive => _fixedActive ?? DesignMode || AlwaysActive || ContainsFocus || _mouseOver;
- // Easier to draw using a graphics instance than a DC!
- using Graphics g = Graphics.FromHdc(_screenDC);
- using (var context = new RenderContext(this, g, e.Bounds, Renderer))
- {
- ViewDrawPanel.Render(context);
- }
+ ///
+ /// Sets input focus to the control.
+ ///
+ /// true if the input focus request was successful; otherwise, false.
+ public new bool Focus() => _listView.Focus();
- using (var context = new RenderContext(this, g, bounds, Renderer))
- {
- layoutDocker.Render(context);
- }
+ ///
+ /// Activates the control.
+ ///
+ public new void Select() => _listView.Select();
- // Do we draw an image for the node?
- if (imgList != null)
- {
- Image? drawImage = null;
- var imageCount = imgList.Images.Count;
+ #endregion public
- try
- {
- // Check node values before tree level values
- if (!string.IsNullOrEmpty(e.Item.ImageKey))
- {
- drawImage = imgList.Images[e.Item.ImageKey];
- }
- else if ((e.Item.ImageIndex >= 0) && (e.Item.ImageIndex < imageCount))
- {
- drawImage = imgList.Images[e.Item.ImageIndex];
- }
+ #region DrawItem and SubItem
- if (drawImage != null)
- {
- g.DrawImage(drawImage, _layoutImage.ClientRectangle);
- }
- }
- catch
- {
- // ignored
- }
- }
+ private void UpdateStateAndPalettes()
+ {
+ if (!IsDisposed)
+ {
+ // Find the new state of the main view element
+ PaletteState state = Enabled
+ ? (IsActive ? PaletteState.Tracking : PaletteState.Normal)
+ : PaletteState.Disabled;
+ // Get the correct palette settings to use
+ var doubleState = GetDoubleState();
+ _listView.ViewDrawPanel.SetPalettes(doubleState.PaletteBack);
+ _drawDockerOuter.SetPalettes(doubleState.PaletteBack, doubleState.PaletteBorder!);
+ _drawDockerOuter.Enabled = Enabled;
+ _listView.ViewDrawPanel.ElementState = state;
+ _drawDockerOuter.ElementState = state;
- // Draw a node state image?
- if (_layoutImageCenterState.Visible)
- {
- if (drawStateImage != null)
- {
- g.DrawImage(drawStateImage, _layoutImageState.ClientRectangle);
- }
- }
+ _listView.BackColor = doubleState.PaletteBack.GetBackColor1(state);
+ foreach (ListViewItem li in Items)
+ {
+ SetItemState(li);
+ }
+ }
+ }
+
+ private IPaletteDouble GetDoubleState() => Enabled ? (IsActive ? StateActive : StateNormal) : StateDisabled;
+
+ private void SetItemState(ListViewItem li)
+ {
+ // e.State == ListViewItemStates.Default
+ IPaletteTriple nodeState = _overrideDisabled;
+ PaletteState state = PaletteState.Disabled;
+
+ if (Enabled)
+ {
+ nodeState = _overrideNormal;
+ state = PaletteState.Normal;
+
+ // Do we need to show item as having the focus
+ var hasFocus = li.Focused;
- // Now blit from the bitmap from the screen to the real dc
- PI.BitBlt(hdc, e.Bounds.X, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height, _screenDC,
- e.Bounds.X, e.Bounds.Y, PI.SRCCOPY);
+ _overrideNormal.Apply = hasFocus;
+ _overrideTracking.Apply = hasFocus;
+ _overrideCheckedTracking.Apply = hasFocus;
+ _overrideCheckedNormal.Apply = hasFocus;
+ if (li.Selected)
+ {
+ if (li.Checked)
+ {
+ nodeState = _overrideCheckedTracking;
+ state = PaletteState.CheckedTracking;
}
- finally
+ else
{
- // Delete the temporary bitmap
- PI.DeleteObject(hBitmap);
+ nodeState = _overrideTracking;
+ state = PaletteState.Tracking;
}
}
- }
- catch
- {
- e.DrawDefault = true;
- }
- finally
- {
- // Must reserve the GetHdc() call before
- e.Graphics.ReleaseHdc();
+ else if (li.Checked)
+ {
+ nodeState = _overrideCheckedNormal;
+ state = PaletteState.CheckedNormal;
+ }
}
+ li.BackColor = nodeState.PaletteBack.GetBackColor1(state);
+ li.ForeColor = nodeState.PaletteContent!.GetContentShortTextColor1(state);
+ li.Font = nodeState.PaletteContent.GetContentShortTextFont(state) ?? Font;
}
#endregion
#region Others Overrides
- protected override void OnSelectedIndexChanged(EventArgs e)
- {
- UpdateStateAndPalettes();
- Invalidate();
- base.OnSelectedIndexChanged(e);
- }
///
/// Process Windows-based messages.
@@ -684,7 +1289,7 @@ protected override void WndProc(ref Message m)
// Do not draw the background here, always do it in the paint
// instead to prevent flicker because of a two stage drawing process
break;
- case PI.WM_.PRINTCLIENT:
+ //case PI.WM_.PRINTCLIENT:
//case PI.WM_.PAINT:
// WmPaint(ref m);
// break;
@@ -716,544 +1321,280 @@ protected override void WndProc(ref Message m)
mousePt = new Point(Width / 2, Height / 2);
}
else
- {
- mousePt = PointToClient(mousePt);
-
- // Mouse point up and left 1 pixel so that the mouse overlaps the top left corner
- // of the showing context menu just like it happens for a ContextMenuStrip.
- mousePt.X -= 1;
- mousePt.Y -= 1;
- }
-
- // If the mouse position is within our client area
- if (ClientRectangle.Contains(mousePt))
- {
- // Show the context menu
- KryptonContextMenu.Show(this, PointToScreen(mousePt));
- }
- }
-
- break;
- default:
- base.WndProc(ref m);
- break;
- }
- }
-
- protected override void OnGotFocus(EventArgs e)
- {
- UpdateStateAndPalettes();
- PerformNeedPaint(true);
- base.OnGotFocus(e);
- }
-
- protected override void OnLostFocus(EventArgs e)
- {
- UpdateStateAndPalettes();
- PerformNeedPaint(true);
- base.OnLostFocus(e);
- }
-
- protected override void OnEnabledChanged(EventArgs e)
- {
- UpdateStateAndPalettes();
- PerformNeedPaint(true);
- base.OnEnabledChanged(e);
- }
-
- protected override void OnMouseEnter(EventArgs e)
- {
- if (!_mouseOver)
- {
- _mouseOver = true;
- PerformNeedPaint(true);
- Invalidate();
- }
- base.OnMouseEnter(e);
- }
-
- protected override void OnMouseLeave(EventArgs e)
- {
- if (_mouseOver)
- {
- _mouseOver = false;
- PerformNeedPaint(true);
- Invalidate();
- }
- base.OnMouseLeave(e);
- }
-
- ///
- /// Releases all resources used by the Control.
- ///
- /// true to release both managed and unmanaged resources; false to release only unmanaged resources.
- protected override void Dispose(bool disposing)
- {
- if (disposing)
- {
- if (_screenDC != IntPtr.Zero)
- {
- PI.DeleteDC(_screenDC);
- }
- // Unhook from the palette events
- if (_palette != null)
- {
- _palette.PalettePaint -= OnPalettePaint;
- _palette = null;
- }
-
- // Unhook from the static events, otherwise we cannot be garbage collected
- KryptonManager.GlobalPaletteChanged -= OnGlobalPaletteChanged;
- _localPalette = null;
- }
-
- base.Dispose(disposing);
- }
-
- protected override void OnNotifyMessage(Message m)
- {
- if (m.Msg != 0x14)
- {
- base.OnNotifyMessage(m);
- }
- }
- #endregion
-
- #region Krypton
-
- ///
- /// Gets and sets the background style.
- ///
- [Category(@"Visuals")]
- [Description(@"Style used to draw the background.")]
- public PaletteBackStyle BackStyle
- {
- get => StateCommon.BackStyle;
-
- set
- {
- if (StateCommon.BackStyle != value)
- {
- StateCommon.BackStyle = value;
- PerformNeedPaint(true);
- }
- }
- }
-
- private void ResetBackStyle() => BackStyle = PaletteBackStyle.InputControlStandalone;
+ {
+ mousePt = PointToClient(mousePt);
- private bool ShouldSerializeBackStyle() => BackStyle != PaletteBackStyle.InputControlStandalone;
+ // Mouse point up and left 1 pixel so that the mouse overlaps the top left corner
+ // of the showing context menu just like it happens for a ContextMenuStrip.
+ mousePt.X -= 1;
+ mousePt.Y -= 1;
+ }
- ///
- /// Gets and sets the border style.
- ///
- [Category(@"Visuals")]
- [Description(@"Style used to draw the border.")]
- public new PaletteBorderStyle BorderStyle
- {
- get => StateCommon.BorderStyle;
+ // If the mouse position is within our client area
+ if (ClientRectangle.Contains(mousePt))
+ {
+ // Show the context menu
+ KryptonContextMenu.Show(this, PointToScreen(mousePt));
+ }
+ }
- set
- {
- if (StateCommon.BorderStyle != value)
- {
- StateCommon.BorderStyle = value;
- PerformNeedPaint(true);
- }
+ break;
+ default:
+ base.WndProc(ref m);
+ break;
}
}
- private void ResetBorderStyle() => BorderStyle = PaletteBorderStyle.InputControlStandalone;
-
- private bool ShouldSerializeBorderStyle() => BorderStyle != PaletteBorderStyle.InputControlStandalone;
-
- ///
- /// Gets access to the item appearance when it has focus.
- ///
- [Category(@"Visuals")]
- [Description(@"Overrides for defining item appearance when it has focus.")]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public PaletteListItemTripleRedirect OverrideFocus { get; }
-
- private bool ShouldSerializeOverrideFocus() => !OverrideFocus.IsDefault;
-
- ///
- /// Gets access to the check box image value overrides.
- ///
- [Category(@"Visuals")]
- [Description(@"CheckBox image value overrides.")]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public CheckBoxImages Images { get; }
+ private void OnListViewGotFocus(object? sender, EventArgs e)
+ {
+ UpdateStateAndPalettes();
+ _listView.Invalidate();
+ PerformNeedPaint(true);
+ OnGotFocus(e);
+ }
- [Category(@"Appearance")]
- [DefaultValue(View.LargeIcon)]
- [Description(@"Selects a subset of the view types that can be shown.")]
- public new View View
+ private void OnListViewLostFocus(object? sender, EventArgs e)
{
- get => base.View;
- set
- {
- if (DesignMode)
- {
- if (value is not (View.Details or View.List))
- {
- base.View = value;
- }
- return;
- }
+ UpdateStateAndPalettes();
+ _listView.Invalidate();
+ PerformNeedPaint(true);
+ OnLostFocus(e);
+ }
- switch (value)
- {
- case View.Details:
- throw new NotSupportedException(@"Use the Krypton DataGrid for this view type");
- case View.List:
- throw new NotSupportedException(@"Use the Krypton ListBox for this view type");
- case View.LargeIcon:
- StateCommon.Item.Content.ShortText.MultiLineH = PaletteRelativeAlign.Center;
- StateCommon.Item.Content.ShortText.TextH = PaletteRelativeAlign.Center;
- break;
- case View.SmallIcon:
- case View.Tile:
- StateCommon.Item.Content.ShortText.MultiLineH = PaletteRelativeAlign.Inherit;
- StateCommon.Item.Content.ShortText.TextH = PaletteRelativeAlign.Inherit;
- break;
- }
- base.View = value;
- }
+ ///
+ protected override void OnEnabledChanged(EventArgs e)
+ {
+ UpdateStateAndPalettes();
+ PerformNeedPaint(true);
+ base.OnEnabledChanged(e);
}
- private bool ShouldSerializeImages() => !Images.IsDefault;
///
- /// Gets access to the common appearance entries that other states can override.
+ /// Creates a new instance of the control collection for the KryptonTreeView.
///
- [Category(@"Visuals")]
- [Description(@"Overrides for defining common appearance that other states can override.")]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public PaletteListStateRedirect? StateCommon { get; }
-
- private bool ShouldSerializeStateCommon() => !StateCommon.IsDefault;
+ /// A new instance of Control.ControlCollection assigned to the control.
+ [EditorBrowsable(EditorBrowsableState.Advanced)]
+ protected override ControlCollection CreateControlsInstance() => new KryptonReadOnlyControls(this);
///
- /// Gets access to the disabled appearance entries.
+ /// Raises the PaletteChanged event.
///
- [Category(@"Visuals")]
- [Description(@"Overrides for defining disabled appearance.")]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public PaletteListState StateDisabled { get; }
-
- private bool ShouldSerializeStateDisabled() => !StateDisabled.IsDefault;
+ /// An EventArgs that contains the event data.
+ protected override void OnPaletteChanged(EventArgs e)
+ {
+ _listView.Recreate();
+ UpdateStateAndPalettes();
+ _listView.Invalidate();
+ base.OnPaletteChanged(e);
+ }
///
- /// Gets access to the normal appearance entries.
+ /// Raises the TabStop event.
///
- [Category(@"Visuals")]
- [Description(@"Overrides for defining normal appearance.")]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public PaletteListState StateNormal { get; }
-
- private bool ShouldSerializeStateNormal() => !StateNormal.IsDefault;
+ /// An EventArgs that contains the event data.
+ protected override void OnTabStopChanged(EventArgs e)
+ {
+ _listView.TabStop = TabStop;
+ base.OnTabStopChanged(e);
+ }
///
- /// Gets access to the active appearance entries.
+ /// Raises the CausesValidationChanged event.
///
- [Category(@"Visuals")]
- [Description(@"Overrides for defining active appearance.")]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public PaletteDouble StateActive { get; }
-
- private bool ShouldSerializeStateActive() => !StateActive.IsDefault;
+ /// An EventArgs that contains the event data.
+ protected override void OnCausesValidationChanged(EventArgs e)
+ {
+ _listView.CausesValidation = CausesValidation;
+ base.OnCausesValidationChanged(e);
+ }
///
- /// Gets access to the hot tracking item appearance entries.
+ /// Raises the HandleCreated event.
///
- [Category(@"Visuals")]
- [Description(@"Overrides for defining hot tracking item appearance.")]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public PaletteListItemTriple StateTracking { get; }
+ /// An EventArgs containing the event data.
+ protected override void OnHandleCreated(EventArgs e)
+ {
+ // Let base class do standard stuff
+ base.OnHandleCreated(e);
- private bool ShouldSerializeStateTracking() => !StateTracking.IsDefault;
+ // Force the font to be set into the text box child control
+ PerformNeedPaint(false);
- ///
- /// Gets access to the pressed item appearance entries.
- ///
- [Category(@"Visuals")]
- [Description(@"Overrides for defining pressed item appearance.")]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public PaletteListItemTriple StatePressed { get; }
+ // We need a layout to occur before any painting
+ InvokeLayout();
+ }
- private bool ShouldSerializeStatePressed() => !StatePressed.IsDefault;
///
- /// Gets access to the normal checked item appearance entries.
+ /// Raises the MouseDown event.
///
- [Category(@"Visuals")]
- [Description(@"Overrides for defining normal checked item appearance.")]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public PaletteListItemTriple StateCheckedNormal { get; }
+ /// A MouseEventArgs that contains the event data.
+ protected override void OnMouseDown(MouseEventArgs e)
+ {
+ _mouseOver = false;
- private bool ShouldSerializeStateCheckedNormal() => !StateCheckedNormal.IsDefault;
+ PerformNeedPaint(true);
- ///
- /// Gets access to the hot tracking checked item appearance entries.
- ///
- [Category(@"Visuals")]
- [Description(@"Overrides for defining hot tracking checked item appearance.")]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public PaletteListItemTriple StateCheckedTracking { get; }
+ _listView.Invalidate();
- private bool ShouldSerializeStateCheckedTracking() => !StateCheckedTracking.IsDefault;
+ base.OnMouseDown(e);
+ }
///
- /// Gets access to the pressed checked item appearance entries.
+ /// Gets the default size of the control.
///
- [Category(@"Visuals")]
- [Description(@"Overrides for defining pressed checked item appearance.")]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public PaletteListItemTriple StateCheckedPressed { get; }
-
- private bool ShouldSerializeStateCheckedPressed() => !StateCheckedPressed.IsDefault;
+ protected override Size DefaultSize => new Size(120, 96);
- ///
- /// Gets access to the need paint delegate.
- ///
- protected NeedPaintHandler NeedPaintDelegate { get; }
+ /// >
+ protected override void CreateHandle()
+ {
+ base.CreateHandle();
- ///
- /// Fires the NeedPaint event.
- ///
- /// Does the palette change require a layout.
- [Browsable(false)]
- [EditorBrowsable(EditorBrowsableState.Advanced)]
- protected virtual void PerformNeedPaint(bool needLayout) => OnNeedPaint(this, new NeedLayoutEventArgs(needLayout));
+ PI.SetWindowTheme(Handle, @"DarkMode_Explorer", null);
+ }
///
- /// Gets or sets the palette to be applied.
+ /// Force the layout logic to size and position the controls.
///
- [Category(@"Visuals")]
- [Description(@"Palette applied to drawing.")]
- public PaletteMode PaletteMode
+ protected void ForceControlLayout()
{
- [DebuggerStepThrough]
- get => _paletteMode;
-
- set
+ if (!IsHandleCreated)
{
- if (_paletteMode != value)
- {
- // Action depends on new value
- switch (value)
- {
- case PaletteMode.Custom:
- // Do nothing, you must assign a palette to the
- // 'Palette' property in order to get the custom mode
- break;
- default:
- // Use the new value
- _paletteMode = value;
-
- // Get a reference to the standard palette from its name
- CacheNewPalette(KryptonManager.GetPaletteForMode(_paletteMode));
-
- // Need to layout again use new palette
- PerformNeedPaint(true);
- Invalidate();
- break;
- }
- }
+ _forcedLayout = true;
+ OnLayout(new LayoutEventArgs(null, null));
+ _forcedLayout = false;
}
}
- private bool ShouldSerializePaletteMode() => PaletteMode != PaletteMode.Global;
-
+ ///
///
- /// Resets the PaletteMode property to its default value.
+ /// Processes a notification from palette storage of a paint and optional layout required.
///
- public void ResetPaletteMode() => PaletteMode = PaletteMode.Global;
-
- private void OnGlobalPaletteChanged(object sender, EventArgs e)
+ /// Source of notification.
+ /// An NeedLayoutEventArgs containing event data.
+ protected override void OnNeedPaint(object? sender, NeedLayoutEventArgs e)
{
- if (PaletteMode != PaletteMode.Global)
+ if (IsHandleCreated && !e.NeedLayout)
{
- return;
+ _listView.Invalidate();
}
- // Unhook events from old palette
- if (_palette != null)
+ else
{
- _palette.PalettePaint -= OnPalettePaint;
+ ForceControlLayout();
}
- CacheNewPalette(KryptonManager.CurrentGlobalPalette);
-
- // Change of palette means we should repaint to show any changes
- Invalidate();
+ // Update palette to reflect latest state
+ UpdateStateAndPalettes();
+ base.OnNeedPaint(sender, e);
}
- private void CacheNewPalette(PaletteBase? palette)
+ ///
+ /// Raises the Layout event.
+ ///
+ /// An EventArgs that contains the event data.
+ protected override void OnLayout(LayoutEventArgs levent)
{
- if (palette != _palette)
- {
- // Unhook from current palette events
- if (_palette != null)
- {
- _palette.PalettePaint -= OnPalettePaint;
- }
-
- // Remember the new palette
- _palette = palette;
- }
+ base.OnLayout(levent);
- // Hook into events for the new palette
- if (_palette != null)
+ // Only use layout logic if control is fully initialized or if being forced
+ // to allow a relayout or if in design mode.
+ if (IsHandleCreated || _forcedLayout || (DesignMode))
{
- // Get the renderer associated with the palette
- Renderer = _palette.GetRenderer();
- Redirector.Target = _palette;
- _palette.PalettePaint += OnPalettePaint;
+ Rectangle fillRect = _layoutFill.FillRect;
+ _listView.SetBounds(fillRect.X, fillRect.Y, fillRect.Width, fillRect.Height);
}
}
- private void OnPalettePaint(object sender, PaletteLayoutEventArgs e) => Invalidate();
-
///
- /// Processes a notification from palette storage of a paint and optional layout required.
+ /// Raises the MouseEnter event.
///
- /// Source of notification.
- /// An NeedLayoutEventArgs containing event data.
- ///
- protected virtual void OnNeedPaint(object? sender, [DisallowNull] NeedLayoutEventArgs e)
+ /// An EventArgs that contains the event data.
+ protected override void OnMouseEnter(EventArgs e)
{
- Debug.Assert(e != null);
+ _mouseOver = true;
+ PerformNeedPaint(true);
+ _listView.Invalidate();
+ base.OnMouseEnter(e);
+ }
- // Validate incoming reference
- if (e == null)
- {
- throw new ArgumentNullException(nameof(e));
- }
+ ///
+ /// Raises the MouseLeave event.
+ ///
+ /// An EventArgs that contains the event data.
+ protected override void OnMouseLeave(EventArgs e)
+ {
+ _mouseOver = false;
+ PerformNeedPaint(true);
+ _listView.Invalidate();
+ base.OnMouseLeave(e);
+ }
- // Never try and redraw or layout when disposed are trying to dispose
- if (!IsDisposed && !Disposing)
+ ///
+ protected override void OnNotifyMessage(Message m)
+ {
+ if (m.Msg != 0x14)
{
-
- // If required, layout the control
- if (e.NeedLayout && !_layoutDirty)
- {
- _layoutDirty = true;
- }
-
- if (IsHandleCreated && (!_refreshAll || !e.InvalidRect.IsEmpty))
- {
- // Always request the repaint immediately
- if (e.InvalidRect.IsEmpty)
- {
- _refreshAll = true;
- Invalidate();
- }
- else
- {
- Invalidate(e.InvalidRect);
- }
-
- }
- // Update palette to reflect latest state
- UpdateStateAndPalettes();
+ base.OnNotifyMessage(m);
}
}
+ #endregion
+
///
- /// Raises the Layout event.
+ /// Gets and sets the background style.
///
- /// A LayoutEventArgs that contains the event data.
- protected override void OnLayout(LayoutEventArgs levent)
+ [Category(@"Visuals")]
+ [Description(@"Style used to draw the background.")]
+ public PaletteBackStyle BackStyle
{
- // Cannot process a message for a disposed control
- if (!IsDisposed && !Disposing)
+ get => StateCommon.BackStyle;
+
+ set
{
- // Do we have a manager to use for laying out?
- if (ViewManager != null)
+ if (StateCommon.BackStyle != value)
{
- // Prevent infinite loop by looping a maximum number of times
- var max = 5;
-
- do
- {
- // Layout cannot now be dirty
- _layoutDirty = false;
-
- // Ask the view to perform a layout
- ViewManager.Layout(Renderer);
-
- } while (_layoutDirty && (max-- > 0));
+ StateCommon.BackStyle = value;
+ PerformNeedPaint(true);
}
}
-
- // Let base class layout child controls
- base.OnLayout(levent);
}
+ private void ResetBackStyle() => BackStyle = PaletteBackStyle.InputControlStandalone;
+
+ private bool ShouldSerializeBackStyle() => BackStyle != PaletteBackStyle.InputControlStandalone;
///
- /// Gets and sets the button style.
+ /// Gets and sets the border style.
///
[Category(@"Visuals")]
- [Description(@"Item style.")]
- public ButtonStyle ItemStyle
+ [Description(@"Style used to draw the border.")]
+ public PaletteBorderStyle BorderStyle
{
- get => _style;
+ get => StateCommon.BorderStyle;
set
{
- if (_style != value)
+ if (StateCommon.BorderStyle != value)
{
- _style = value;
- StateCommon.Item.SetStyles(_style);
- OverrideFocus.Item.SetStyles(_style);
+ StateCommon.BorderStyle = value;
PerformNeedPaint(true);
}
}
}
- private void OnContextMenuStripOpening(object sender, CancelEventArgs e)
- {
- // Get the actual strip instance
- ContextMenuStrip cms = base.ContextMenuStrip;
-
- // Make sure it has the correct renderer
- cms.Renderer = Renderer.RenderToolStrip(_palette);
- }
-
- private void OnKryptonContextMenuDisposed(object sender, EventArgs e) =>
- // When the current krypton context menu is disposed, we should remove
- // it to prevent it being used again, as that would just throw an exception
- // because it has been disposed.
- KryptonContextMenu = null;
+ private void ResetBorderStyle() => BorderStyle = PaletteBorderStyle.InputControlStandalone;
- private void OnContextMenuClosed(object sender, ToolStripDropDownClosedEventArgs e) => ContextMenuClosed();
+ private bool ShouldSerializeBorderStyle() => BorderStyle != PaletteBorderStyle.InputControlStandalone;
///
- /// Called when a context menu has just been closed.
+ /// Gets access to the item appearance when it has focus.
///
- protected virtual void ContextMenuClosed()
- {
- }
-
- #endregion
-
- #region Implementation
-
- private void SetCornerRoundingRadius(float? radius)
- {
- _cornerRoundingRadius = radius ?? GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
- StateCommon.Border.Rounding = _cornerRoundingRadius;
- }
-
- private void SetItemCornerRoundingRadius(float? radius)
- {
- _itemCornerRoundingRadius = radius ?? GlobalStaticValues.SECONDARY_CORNER_ROUNDING_VALUE;
+ [Category(@"Visuals")]
+ [Description(@"Overrides for defining item appearance when it has focus.")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ public PaletteTreeNodeTripleRedirect OverrideFocus { get; }
- StateCommon.Item.Border.Rounding = _itemCornerRoundingRadius;
- }
+ private bool ShouldSerializeOverrideFocus() => !OverrideFocus.IsDefault;
- #endregion
}
}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonManager.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonManager.cs
index e4c7cf458..1cc60cfd6 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonManager.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonManager.cs
@@ -1,12 +1,12 @@
#region BSD License
/*
- *
+ *
* Original BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE)
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
- *
+ *
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
- *
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2024. All rights reserved.
+ *
*/
#endregion
@@ -25,7 +25,9 @@ public sealed class KryptonManager : Component
#region Static Fields
// Initialize the global state
private static bool _globalApplyToolstrips = true;
- private static bool _globalAllowFormChrome = true;
+ private static bool _globalUseThemeFormChromeBorderWidth = true;
+ internal static bool _globalUseKryptonFileDialogs = true;
+ private static Font? _baseFont;
// Initialize the default modes
@@ -35,10 +37,6 @@ public sealed class KryptonManager : Component
private static PaletteProfessionalOffice2003? _paletteProfessionalOffice2003;
private static PaletteProfessionalSystem? _paletteProfessionalSystem;
- private static PaletteBase? _customPalette;
-
- private static KryptonLanguageManager? _languageManager;
-
#region Office 2007 Themes
private static PaletteOffice2007DarkGray? _paletteOffice2007DarkGray;
@@ -96,6 +94,7 @@ public sealed class KryptonManager : Component
private static PaletteMicrosoft365DarkGray? _paletteMicrosoft365DarkGray;
private static PaletteMicrosoft365Black? _paletteMicrosoft365Black;
private static PaletteMicrosoft365BlackDarkMode? _paletteMicrosoft365BlackDarkMode;
+ private static PaletteMicrosoft365BlackDarkModeAlternate? _paletteMicrosoft365BlackDarkModeAlternate;
private static PaletteMicrosoft365Blue? _paletteMicrosoft365Blue;
private static PaletteMicrosoft365BlueDarkMode? _paletteMicrosoft365BlueDarkMode;
private static PaletteMicrosoft365BlueLightMode? _paletteMicrosoft365BlueLightMode;
@@ -132,7 +131,6 @@ public sealed class KryptonManager : Component
private static RenderVisualStudio2010WithMicrosoft365? _renderVisualStudio2010WithMicrosoft365;
private static RenderVisualStudio? _renderVisualStudio;
- private static KryptonCustomPaletteManager? _customPaletteManager;
#endregion
#region Static Events
@@ -144,11 +142,11 @@ public sealed class KryptonManager : Component
public static event EventHandler? GlobalPaletteChanged;
///
- /// Occurs when the AllowFormChrome property changes.
+ /// Occurs when the UseThemeFormChromeBorderWidth property changes.
///
[Category(@"Property Changed")]
- [Description(@"Occurs when the value of the GlobalAllowFormChrome property is changed.")]
- public static event EventHandler? GlobalAllowFormChromeChanged;
+ [Description(@"Occurs when the value of the GlobalUseThemeFormChromeBorderWidth property is changed.")]
+ public static event EventHandler? GlobalUseThemeFormChromeBorderWidthChanged;
#endregion
#region Identity
@@ -164,9 +162,9 @@ static KryptonManager()
///
/// Initialize a new instance of the KryptonManager class.
///
- public KryptonManager() =>
- // This may not be the first form / object to init, so set to the global static
- GlobalPaletteMode = InternalGlobalPaletteMode;
+ public KryptonManager()
+ {
+ }
///
/// Initialize a new instance of the KryptonManager class.
@@ -187,7 +185,7 @@ public KryptonManager([DisallowNull] IContainer container)
container.Add(this);
}
- ///
+ ///
/// Clean up any resources being used.
///
/// true if managed resources should be disposed; otherwise, false.
@@ -206,156 +204,137 @@ protected override void Dispose(bool disposing)
///
/// Have any of the global values been modified
///
+ [Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public bool IsDefault => !(ShouldSerializeGlobalPaletteMode() ||
- ShouldSerializeGlobalPalette() ||
+ public bool IsDefault => !(ShouldSerializeGlobalCustomPalette() ||
ShouldSerializeGlobalApplyToolstrips() ||
- ShouldSerializeGlobalAllowFormChrome() /*||
- ShouldSerializeToolkitStringValues() */);
+ ShouldSerializeGlobalUseThemeFormChromeBorderWidth() ||
+ ShouldSerializeToolkitStrings() ||
+ ShouldSerializeUseKryptonFileDialogs() ||
+ ShouldSerializeBaseFont() ||
+ ShouldSerializeGlobalPaletteMode());
///
/// Reset All values
///
public void Reset()
{
- ResetGlobalPaletteMode();
- ResetGlobalPalette();
+ ResetGlobalCustomPalette();
ResetGlobalApplyToolstrips();
- ResetGlobalAllowFormChrome();
- //ResetToolkitStringValues();
-
- _customPalette = null;
-
- _languageManager = null;
+ ResetGlobalUseThemeFormChromeBorderWidth();
+ ResetToolkitStrings();
+ ResetUseKryptonFileDialogs();
+ ResetBaseFont();
+ ResetGlobalPaletteMode();
}
///
/// Gets or sets the global palette used for drawing.
///
- [Category(@"Visuals")]
- [Description(@"Global palette applied to drawing.")]
+ [Category(@"GlobalPalette")]
+ [Description(@"Easy Set for the theme palette")]
[DefaultValue(PaletteMode.Microsoft365Blue)]
public PaletteMode GlobalPaletteMode
{
- get => InternalGlobalPaletteMode;
-
+ get => CurrentGlobalPaletteMode;
set
{
- // Only interested in changes of value
- if (InternalGlobalPaletteMode != value)
+ if (value != CurrentGlobalPaletteMode)
{
- // Action depends on the value
- switch (value)
+ if (value != PaletteMode.Custom)
+ {
+ // Get a reference to the standard palette from its name
+ SetPalette(GetPaletteForMode(value));
+ }
+ CurrentGlobalPaletteMode = value;
+ if (_baseFont != null)
+ {
+ CurrentGlobalPalette.BaseFont = _baseFont;
+ }
+
+ if (value != PaletteMode.Custom)
{
- case PaletteMode.Custom:
- // Do nothing, you must assign a palette to the
- // 'GlobalPalette' property in order to get the custom mode
- break;
- default:
- // Cache the new values
- PaletteMode tempMode = InternalGlobalPaletteMode;
- PaletteBase? tempPalette = InternalGlobalPalette;
-
- // Use the new value
- InternalGlobalPaletteMode = value;
- InternalGlobalPalette = null;
-
- // If the new value creates a circular reference
- if (HasCircularReference())
- {
- // Restore the original values before throwing
- InternalGlobalPaletteMode = tempMode;
- InternalGlobalPalette = tempPalette;
-
- throw new ArgumentOutOfRangeException(nameof(value),
- @"Cannot use palette that would create a circular reference");
- }
- else
- {
- // Restore the original global palette as 'SetPalette' will not
- // work correctly unless it still has the old value in place
- InternalGlobalPalette = tempPalette;
- }
-
- // Get a reference to the standard palette from its name
- SetPalette(CurrentGlobalPalette);
-
- // Raise the palette changed event
- OnGlobalPaletteChanged(EventArgs.Empty);
- break;
+ // Raise the palette changed event
+ OnGlobalPaletteChanged(EventArgs.Empty);
}
}
}
}
-
- private bool ShouldSerializeGlobalPaletteMode() => GlobalPaletteMode != PaletteMode.Microsoft365Blue;
-
- private void ResetGlobalPaletteMode() => GlobalPaletteMode = PaletteMode.Microsoft365Blue;
+ private bool ShouldSerializeGlobalPaletteMode() => GlobalPaletteMode != ThemeManager.DefaultGlobalPalette;
+ private void ResetGlobalPaletteMode() => GlobalPaletteMode = ThemeManager.DefaultGlobalPalette;
///
/// Gets and sets the global custom applied to drawing.
///
- [Category(@"Visuals")]
+ [Category(@"GlobalPalette")]
[Description(@"Global custom palette applied to drawing.")]
[DefaultValue(null)]
- public PaletteBase? GlobalPalette
+ public KryptonCustomPaletteBase? GlobalCustomPalette
{
- get => InternalGlobalPalette;
+ get => CurrentGlobalPalette as KryptonCustomPaletteBase;
set
{
// Only interested in changes of value
- if (InternalGlobalPalette != value)
+ if (CurrentGlobalPalette != value)
{
- // Cache the current values
- PaletteMode tempMode = InternalGlobalPaletteMode;
- PaletteBase? tempPalette = InternalGlobalPalette;
-
- // Use the new values
- InternalGlobalPaletteMode = (value == null) ? PaletteMode.Microsoft365Blue : PaletteMode.Custom;
- InternalGlobalPalette = value;
-
- // If the new value creates a circular reference
- if (HasCircularReference())
+ if (value != null)
{
- // Restore the original values
- InternalGlobalPaletteMode = tempMode;
- InternalGlobalPalette = tempPalette;
-
- throw new ArgumentOutOfRangeException(nameof(value), @"Cannot use palette that would create a circular reference");
+ // If no custom palette is required
+ CurrentGlobalPalette = value;
+ // Use the provided palette value
+ SetPalette(value);
+ CurrentGlobalPaletteMode = GetModeForPalette(value);
+ // Notify the KryptonManager that there is a custom palette assigned to it
+ // Fixes bug: https://github.com/Krypton-Suite/Standard-Toolkit/issues/1092
+ GlobalPaletteMode = PaletteMode.Custom;
}
else
{
- // Restore the original global palette as 'SetPalette' will not
- // work correctly unless it still has the old value in place
- InternalGlobalPalette = tempPalette;
+ ResetGlobalPaletteMode();
+ CurrentGlobalPalette = GetPaletteForMode(GlobalPaletteMode);
}
-
- // Use the provided palette value
- SetPalette(value);
-
- // If no custom palette is required
- if (value == null)
- {
- // Get a reference to current global palette defined by the mode
- SetPalette(CurrentGlobalPalette);
- }
- else
- {
- // No longer using a standard palette
- InternalGlobalPaletteMode = PaletteMode.Custom;
- }
-
// Raise the palette changed event
OnGlobalPaletteChanged(EventArgs.Empty);
}
}
}
+ private void ResetGlobalCustomPalette()
+ {
+ GlobalCustomPalette = null;
+ ResetGlobalPaletteMode();
+ }
+ private bool ShouldSerializeGlobalCustomPalette() => GlobalCustomPalette != null;
- private bool ShouldSerializeGlobalPalette() => GlobalPalette != null;
+ /// Override the Current global palette font.
+ [Category(@"GlobalPalette")]
+ [Description(@"Override the Current global palette font.")]
+ [AllowNull]
+ public Font BaseFont
+ {
+ get => _baseFont ?? CurrentGlobalPalette.BaseFont;
- private void ResetGlobalPalette() => GlobalPaletteMode = PaletteMode.Microsoft365Blue;
+ set
+ {
+ if (value != null)
+ {
+ _baseFont = value;
+ CurrentGlobalPalette.BaseFont = value;
+ }
+ else
+ {
+ ResetBaseFont();
+ }
+ }
+ }
+
+ private void ResetBaseFont()
+ {
+ _baseFont = null;
+ CurrentGlobalPalette.ResetBaseFont();
+ }
+ private bool ShouldSerializeBaseFont() => _baseFont != null;
///
/// Gets or sets a value indicating if the palette colors are applied to the tool-strips.
@@ -368,67 +347,58 @@ public bool GlobalApplyToolstrips
get => ApplyToolstrips;
set => ApplyToolstrips = value;
}
-
private bool ShouldSerializeGlobalApplyToolstrips() => !GlobalApplyToolstrips;
-
private void ResetGlobalApplyToolstrips() => GlobalApplyToolstrips = true;
- ///
- /// Gets or sets a value indicating if KryptonForm instances are allowed to show custom chrome.
- ///
+ /// Gets or sets a value indicating whether [use krypton file dialogs for internal openings like CustomPalette Import].
+ /// true if [use krypton file dialogs]; otherwise, false .
[Category(@"Visuals")]
- [Description(@"Should KryptonForm instances be allowed to show custom chrome.")]
+ [Description(@"Should use krypton file dialogs for internal openings like CustomPalette Import")]
[DefaultValue(true)]
- public bool GlobalAllowFormChrome
+ public bool UseKryptonFileDialogs
{
- get => AllowFormChrome;
- set => AllowFormChrome = value;
+ get => _globalUseKryptonFileDialogs;
+ set => _globalUseKryptonFileDialogs = value;
}
+ private bool ShouldSerializeUseKryptonFileDialogs() => !UseKryptonFileDialogs;
+ private void ResetUseKryptonFileDialogs() => UseKryptonFileDialogs = true;
- private bool ShouldSerializeGlobalAllowFormChrome() => !GlobalAllowFormChrome;
- private void ResetGlobalAllowFormChrome() => GlobalAllowFormChrome = true;
-
- [Category(@"Visuals")]
- [Description(@"")]
- [DefaultValue(null)]
- public KryptonCustomPaletteManager? CustomPaletteManager
- {
- get => _customPaletteManager;
- set => _customPaletteManager = value;
- }
-
- /// Specify a custom palette outside the existing palettes.
- /// A custom palette.
+ ///
+ /// Gets or sets a value indicating if KryptonForm instances are allowed to UseThemeFormChromeBorderWidth.
+ ///
[Category(@"Visuals")]
- [Description(@"Specify a custom palette outside the existing palettes.")]
- [DefaultValue(null)]
- public PaletteBase? CustomPalette
+ [Description(@"Should KryptonForm instances be allowed to UseThemeFormChromeBorderWidth.")]
+ [DefaultValue(true)]
+ public bool GlobalUseThemeFormChromeBorderWidth
{
- get => _customPalette;
- set => _customPalette = value;
+ get => UseThemeFormChromeBorderWidth;
+ set => UseThemeFormChromeBorderWidth = value;
}
+ private bool ShouldSerializeGlobalUseThemeFormChromeBorderWidth() => !GlobalUseThemeFormChromeBorderWidth;
+ private void ResetGlobalUseThemeFormChromeBorderWidth() => GlobalUseThemeFormChromeBorderWidth = true;
- /// Gets or sets the language manager.
- /// The language manager.
- [Category(@"Visuals")]
- [Description(@"")]
- [DefaultValue(null)]
- public KryptonLanguageManager? LanguageManager { get => _languageManager; set => _languageManager = value; }
-
- /*/// Gets the global toolkit strings.
- /// The global toolkit strings.
- [Category(@"Visuals")]
- [Description(@"Collection of toolkit strings.")]
+ /// Gets the toolkit strings that can be localised.
+ [Category(@"Data")]
+ [Description(@"A collection of global toolkit strings that can be localised.")]
[MergableProperty(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
[Localizable(true)]
- public ToolkitStringValues ToolkitStringValues => _toolkitStringValues;
+ public KryptonGlobalToolkitStrings ToolkitStrings => Strings;
+ private bool ShouldSerializeToolkitStrings() => !Strings.IsDefault;
+ private void ResetToolkitStrings() => Strings.Reset();
+
+ #endregion
- private bool ShouldSerializeToolkitStringValues() => !_toolkitStringValues.IsDefault;
+ #region Static Properties
- /// Resets the toolkit string values.
- public void ResetToolkitStringValues() => _toolkitStringValues.Reset();*/
+ /// Gets the strings.
+ /// The strings.
+ public static KryptonGlobalToolkitStrings Strings { get; } = new KryptonGlobalToolkitStrings();
+
+ /// Gets the images.
+ /// The images.
+ public static KryptonImageStorage Images { get; } = new KryptonImageStorage();
#endregion
@@ -462,151 +432,36 @@ public static bool ApplyToolstrips
}
#endregion
- #region Static AllowFormChrome
+ #region Static UseThemeFormChromeBorderWidth
///
/// Gets and sets the global flag that decides if form chrome should be customized.
///
- public static bool AllowFormChrome
+ public static bool UseThemeFormChromeBorderWidth
{
- get => _globalAllowFormChrome;
+ get => _globalUseThemeFormChromeBorderWidth;
set
{
// Only interested if the value changes
- if (_globalAllowFormChrome != value)
+ if (_globalUseThemeFormChromeBorderWidth != value)
{
// Use new value
- _globalAllowFormChrome = value;
+ _globalUseThemeFormChromeBorderWidth = value;
// Fire change event
- OnGlobalAllowFormChromeChanged(EventArgs.Empty);
+ OnGlobalUseThemeFormChromeBorderWidthChanged(EventArgs.Empty);
}
}
}
#endregion
#region Static Palette
- ///
- /// Gets the current global palette instance given the manager settings.
- ///
- public static PaletteBase? CurrentGlobalPalette
- {
- get
- {
- switch (InternalGlobalPaletteMode)
- {
- case PaletteMode.ProfessionalSystem:
- return PaletteProfessionalSystem;
- case PaletteMode.ProfessionalOffice2003:
- return PaletteProfessionalOffice2003;
- case PaletteMode.Office2007DarkGray:
- return PaletteOffice2007DarkGray;
- case PaletteMode.Office2007Blue:
- return PaletteOffice2007Blue;
- case PaletteMode.Office2007BlueDarkMode:
- return PaletteOffice2007BlueDarkMode;
- case PaletteMode.Office2007BlueLightMode:
- return PaletteOffice2007BlueLightMode;
- case PaletteMode.Office2007Silver:
- return PaletteOffice2007Silver;
- case PaletteMode.Office2007SilverDarkMode:
- return PaletteOffice2007SilverDarkMode;
- case PaletteMode.Office2007SilverLightMode:
- return PaletteOffice2007SilverLightMode;
- case PaletteMode.Office2007White:
- return PaletteOffice2007White;
- case PaletteMode.Office2007Black:
- return PaletteOffice2007Black;
- case PaletteMode.Office2007BlackDarkMode:
- return PaletteOffice2007BlackDarkMode;
- case PaletteMode.Office2010DarkGray:
- return PaletteOffice2010DarkGray;
- case PaletteMode.Office2010Blue:
- return PaletteOffice2010Blue;
- case PaletteMode.Office2010BlueDarkMode:
- return PaletteOffice2010BlueDarkMode;
- case PaletteMode.Office2010BlueLightMode:
- return PaletteOffice2010BlueLightMode;
- case PaletteMode.Office2010Silver:
- return PaletteOffice2010Silver;
- case PaletteMode.Office2010SilverDarkMode:
- return PaletteOffice2010SilverDarkMode;
- case PaletteMode.Office2010SilverLightMode:
- return PaletteOffice2010SilverLightMode;
- case PaletteMode.Office2010White:
- return PaletteOffice2010White;
- case PaletteMode.Office2010Black:
- return PaletteOffice2010Black;
- case PaletteMode.Office2010BlackDarkMode:
- return PaletteOffice2010BlackDarkMode;
- case PaletteMode.Office2013DarkGray:
- return PaletteOffice2013DarkGray;
- case PaletteMode.Office2013LightGray:
- return PaletteOffice2013LightGray;
- case PaletteMode.Office2013White:
- return PaletteOffice2013White;
- case PaletteMode.SparkleBlue:
- return PaletteSparkleBlue;
- case PaletteMode.SparkleBlueDarkMode:
- return PaletteSparkleBlueDarkMode;
- case PaletteMode.SparkleBlueLightMode:
- return PaletteSparkleBlueLightMode;
- case PaletteMode.SparkleOrange:
- return PaletteSparkleOrange;
- case PaletteMode.SparkleOrangeDarkMode:
- return PaletteSparkleOrangeDarkMode;
- case PaletteMode.SparkleOrangeLightMode:
- return PaletteSparkleOrangeLightMode;
- case PaletteMode.SparklePurple:
- return PaletteSparklePurple;
- case PaletteMode.SparklePurpleDarkMode:
- return PaletteSparklePurpleDarkMode;
- case PaletteMode.SparklePurpleLightMode:
- return PaletteSparklePurpleLightMode;
- case PaletteMode.Microsoft365Black:
- return PaletteMicrosoft365Black;
- case PaletteMode.Microsoft365BlackDarkMode:
- return PaletteMicrosoft365BlackDarkMode;
- case PaletteMode.Microsoft365Blue:
- return PaletteMicrosoft365Blue;
- case PaletteMode.Microsoft365BlueDarkMode:
- return PaletteMicrosoft365BlueDarkMode;
- case PaletteMode.Microsoft365BlueLightMode:
- return PaletteMicrosoft365BlueLightMode;
- case PaletteMode.Microsoft365DarkGray:
- return PaletteMicrosoft365DarkGray;
- case PaletteMode.Microsoft365Silver:
- return PaletteMicrosoft365Silver;
- case PaletteMode.Microsoft365SilverDarkMode:
- return PaletteMicrosoft365SilverDarkMode;
- case PaletteMode.Microsoft365SilverLightMode:
- return PaletteMicrosoft365SilverLightMode;
- case PaletteMode.Microsoft365White:
- return PaletteMicrosoft365White;
- case PaletteMode.VisualStudio2010Render2007:
- return PaletteVisualStudio2010Office2007Variation;
- case PaletteMode.VisualStudio2010Render2010:
- return PaletteVisualStudio2010Office2010Variation;
- case PaletteMode.VisualStudio2010Render2013:
- return PaletteVisualStudio2010Office2013Variation;
- case PaletteMode.VisualStudio2010Render365:
- return PaletteVisualStudio2010Microsoft365Variation;
- case PaletteMode.Custom:
- case PaletteMode.Global:
- return InternalGlobalPalette;
- default:
- Debug.Assert(false);
- return null;
- }
- }
- }
-
///
/// Gets the implementation for the requested palette mode.
///
/// Requested palette mode.
- /// PaletteBase reference is available; otherwise false.
- public static PaletteBase? GetPaletteForMode(PaletteMode mode)
+ /// PaletteBase reference is available; otherwise null exception.
+ public static PaletteBase GetPaletteForMode(PaletteMode mode)
{
switch (mode)
{
@@ -616,8 +471,9 @@ public static PaletteBase? CurrentGlobalPalette
return PaletteProfessionalOffice2003;
case PaletteMode.Office2007Blue:
return PaletteOffice2007Blue;
- case PaletteMode.Office2007DarkGray:
- return PaletteOffice2007DarkGray;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2007DarkGray:
+ // return PaletteOffice2007DarkGray;
case PaletteMode.Office2007BlueDarkMode:
return PaletteOffice2007BlueDarkMode;
case PaletteMode.Office2007BlueLightMode:
@@ -632,8 +488,9 @@ public static PaletteBase? CurrentGlobalPalette
return PaletteOffice2007White;
case PaletteMode.Office2007Black:
return PaletteOffice2007Black;
- case PaletteMode.Office2010DarkGray:
- return PaletteOffice2010DarkGray;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2010DarkGray:
+ // return PaletteOffice2010DarkGray;
case PaletteMode.Office2007BlackDarkMode:
return PaletteOffice2007BlackDarkMode;
case PaletteMode.Office2010Blue:
@@ -654,10 +511,11 @@ public static PaletteBase? CurrentGlobalPalette
return PaletteOffice2010Black;
case PaletteMode.Office2010BlackDarkMode:
return PaletteOffice2010BlackDarkMode;
- case PaletteMode.Office2013DarkGray:
- return PaletteOffice2013DarkGray;
- case PaletteMode.Office2013LightGray:
- return PaletteOffice2013LightGray;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Office2013DarkGray:
+ // return PaletteOffice2013DarkGray;
+ // case PaletteMode.Office2013LightGray:
+ // return PaletteOffice2013LightGray;
case PaletteMode.Office2013White:
return PaletteOffice2013White;
case PaletteMode.SparkleBlue:
@@ -682,14 +540,17 @@ public static PaletteBase? CurrentGlobalPalette
return PaletteMicrosoft365Black;
case PaletteMode.Microsoft365BlackDarkMode:
return PaletteMicrosoft365BlackDarkMode;
+ case PaletteMode.Microsoft365BlackDarkModeAlternate:
+ return PaletteMicrosoft365BlackDarkModeAlternate;
case PaletteMode.Microsoft365BlueDarkMode:
return PaletteMicrosoft365BlueDarkMode;
case PaletteMode.Microsoft365BlueLightMode:
return PaletteMicrosoft365BlueLightMode;
case PaletteMode.Microsoft365Blue:
return PaletteMicrosoft365Blue;
- case PaletteMode.Microsoft365DarkGray:
- return PaletteMicrosoft365DarkGray;
+ // TODO: Re-enable this once completed
+ // case PaletteMode.Microsoft365DarkGray:
+ // return PaletteMicrosoft365DarkGray;
case PaletteMode.Microsoft365Silver:
return PaletteMicrosoft365Silver;
case PaletteMode.Microsoft365SilverDarkMode:
@@ -698,8 +559,6 @@ public static PaletteBase? CurrentGlobalPalette
return PaletteMicrosoft365SilverLightMode;
case PaletteMode.Microsoft365White:
return PaletteMicrosoft365White;
- case PaletteMode.Global:
- return CurrentGlobalPalette;
case PaletteMode.VisualStudio2010Render2007:
return PaletteVisualStudio2010Office2007Variation;
case PaletteMode.VisualStudio2010Render2010:
@@ -708,13 +567,44 @@ public static PaletteBase? CurrentGlobalPalette
return PaletteVisualStudio2010Office2013Variation;
case PaletteMode.VisualStudio2010Render365:
return PaletteVisualStudio2010Microsoft365Variation;
+
case PaletteMode.Custom:
+ case PaletteMode.Global:
+ return CurrentGlobalPalette;
default:
Debug.Assert(false);
- return null;
+ throw new ArgumentOutOfRangeException(nameof(mode), @"mode must be PaletteMode value.");
}
}
+ ///
+ /// Gets the implementation for the requested palette mode.
+ ///
+ /// Requested palette to mode.
+ /// PaletteMode is available; otherwise Custom.
+ public static PaletteMode GetModeForPalette(PaletteBase? palette)
+ {
+ if (palette is KryptonCustomPaletteBase)
+ {
+ return PaletteMode.Custom;
+ }
+
+ object? mode = null;
+ if (palette != null)
+ {
+ var modeConverter = new Krypton.Toolkit.Converters.PaletteClassTypeConverter();
+
+ mode = modeConverter.ConvertFrom(palette.GetType());
+ }
+
+ if (mode == null)
+ {
+ return PaletteMode.Global;
+ }
+
+ return (PaletteMode)mode;
+ }
+
///
/// Gets the single instance of the professional system palette.
///
@@ -843,22 +733,21 @@ public static PaletteBase? CurrentGlobalPalette
///
/// Gets the palette Microsoft365 black.
///
- ///
- /// The palette Microsoft365 black.
- ///
public static PaletteMicrosoft365Black PaletteMicrosoft365Black => _paletteMicrosoft365Black ??= new PaletteMicrosoft365Black();
///
- /// Gets the single instance of the ### palette.
+ /// Gets the palette Microsft 365 black dark mode.
///
public static PaletteMicrosoft365BlackDarkMode PaletteMicrosoft365BlackDarkMode => _paletteMicrosoft365BlackDarkMode ??= new PaletteMicrosoft365BlackDarkMode();
+ ///
+ /// Gets the palette Microsft 365 black dark mode alternate.
+ ///
+ public static PaletteMicrosoft365BlackDarkModeAlternate PaletteMicrosoft365BlackDarkModeAlternate => _paletteMicrosoft365BlackDarkModeAlternate ??= new PaletteMicrosoft365BlackDarkModeAlternate();
+
///
/// Gets the palette Microsoft365 blue.
///
- ///
- /// The palette Microsoft365 blue.
- ///
public static PaletteMicrosoft365Blue PaletteMicrosoft365Blue => _paletteMicrosoft365Blue ??= new PaletteMicrosoft365Blue();
///
@@ -879,9 +768,6 @@ public static PaletteBase? CurrentGlobalPalette
///
/// Gets the palette Microsoft365 silver.
///
- ///
- /// The palette Microsoft365 silver.
- ///
public static PaletteMicrosoft365Silver PaletteMicrosoft365Silver => _paletteMicrosoft365Silver ??= new PaletteMicrosoft365Silver();
///
@@ -935,21 +821,33 @@ public static PaletteBase? CurrentGlobalPalette
public static PaletteSparklePurple PaletteSparklePurple => _paletteSparklePurple ??= new PaletteSparklePurple();
///
- /// Gets the single instance of the ### palette.
+ /// Gets palette Sparkle Purpke dark moode.
///
public static PaletteSparklePurpleDarkMode PaletteSparklePurpleDarkMode => _paletteSparklePurpleDarkMode ??= new PaletteSparklePurpleDarkMode();
///
- /// Gets the single instance of the ### palette.
+ /// Gets palette Sparkle Purpke light moode.
///
public static PaletteSparklePurpleLightMode PaletteSparklePurpleLightMode => _paletteSparklePurpleLightMode ??= new PaletteSparklePurpleLightMode();
+ ///
+ /// Gets palette Visual Studio 2010 Office 2007 variant.
+ ///
public static PaletteVisualStudio2010Office2007Variation PaletteVisualStudio2010Office2007Variation => _paletteVisualStudio2010Office2007Variation ??= new PaletteVisualStudio2010Office2007Variation();
+ ///
+ /// Gets palette Visual Studio 2010 Office 2010 variant.
+ ///
public static PaletteVisualStudio2010Office2010Variation PaletteVisualStudio2010Office2010Variation => _paletteVisualStudio2010Office2010Variation ??= new PaletteVisualStudio2010Office2010Variation();
+ ///
+ /// Gets palette Visual Studio 2010 Office 2013 variant.
+ ///
public static PaletteVisualStudio2010Office2013Variation PaletteVisualStudio2010Office2013Variation => _paletteVisualStudio2010Office2013Variation ??= new PaletteVisualStudio2010Office2013Variation();
+ ///
+ /// Gets palette Visual Studio 2010 Office 365 variant.
+ ///
public static PaletteVisualStudio2010Microsoft365Variation PaletteVisualStudio2010Microsoft365Variation => _paletteVisualStudio2010Microsoft365Variation ??= new PaletteVisualStudio2010Microsoft365Variation();
//public static PaletteBase CustomPaletteBase => _customPalette ??= new PaletteBase ();
@@ -959,7 +857,7 @@ public static PaletteBase? CurrentGlobalPalette
///
/// Requested renderer mode.
/// IRenderer reference is available; otherwise false.
- public static IRenderer? GetRendererForMode(RendererMode mode)
+ public static IRenderer GetRendererForMode(RendererMode mode)
{
switch (mode)
{
@@ -992,7 +890,7 @@ public static PaletteBase? CurrentGlobalPalette
default:
// Should never be passed
Debug.Assert(false);
- return null;
+ throw new ArgumentOutOfRangeException(nameof(mode), @"mode must be RendererMode value.");
}
}
@@ -1026,16 +924,29 @@ public static PaletteBase? CurrentGlobalPalette
///
public static RenderProfessional RenderProfessional => _renderProfessional ??= new RenderProfessional();
- /// Gets the render visual studio.
- /// The render visual studio.
+ ///
+ /// Gets the single instance of the Visual Studio renderer.
+ ///
public static RenderVisualStudio RenderVisualStudio => _renderVisualStudio ??= new RenderVisualStudio();
+ ///
+ /// Gets the single instance of the Visual Studio 2010 Office 2007 renderer.
+ ///
public static RenderVisualStudio2010With2007 RenderVisualStudio2010With2007 => _renderVisualStudio2010With2007 ??= new RenderVisualStudio2010With2007();
+ ///
+ /// Gets the single instance of the Visual Studio 2010 Office 2010 renderer.
+ ///
public static RenderVisualStudio2010With2010 RenderVisualStudio2010With2010 => _renderVisualStudio2010With2010 ??= new RenderVisualStudio2010With2010();
+ ///
+ /// Gets the single instance of the Visual Studio 2010 Office 2013 renderer.
+ ///
public static RenderVisualStudio2010With2013 RenderVisualStudio2010With2013 => _renderVisualStudio2010With2013 ??= new RenderVisualStudio2010With2013();
+ ///
+ /// Gets the single instance of the Visual Studio 2010 Office 365 renderer.
+ ///
public static RenderVisualStudio2010WithMicrosoft365 RenderVisualStudio2010WithMicrosoft365 => _renderVisualStudio2010WithMicrosoft365 ??= new RenderVisualStudio2010WithMicrosoft365();
///
@@ -1046,58 +957,16 @@ public static PaletteBase? CurrentGlobalPalette
#endregion
#region Static Internal
- internal static PaletteMode InternalGlobalPaletteMode { get; private set; } = PaletteMode.Microsoft365Blue;
-
- 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();
-
- PaletteBase? palette = null;
-
- // Get the next palette up in hierarchy
- if (InternalGlobalPaletteMode == PaletteMode.Custom)
- {
- palette = InternalGlobalPalette;
- }
-
- // Keep searching until no more palettes found
- while (palette != null)
- {
- // If the palette has already been encountered then it is a circular reference
- if (paletteSet.ContainsKey(palette))
- {
- return true;
- }
- else
- {
- // Otherwise, add to the set
- paletteSet.Add(palette, true);
- // Cast to correct type
+ ///
+ /// What is the CurrentGlobalPaletteMode in use
+ ///
+ public static PaletteMode CurrentGlobalPaletteMode { get; private set; } = ThemeManager.DefaultGlobalPalette;
- // If this is a KryptonPalette instance
- if (palette is KryptonCustomPaletteBase owner)
- {
- // Get the next palette up in hierarchy
- palette = owner.BasePaletteMode switch
- {
- PaletteMode.Custom => owner.BasePalette,
- PaletteMode.Global => InternalGlobalPalette,
- _ => null
- };
- }
- else
- {
- palette = null;
- }
- }
- }
+ ///
+ /// Access the Current Palette
+ ///
+ public static PaletteBase CurrentGlobalPalette { get; private set; } = GetPaletteForMode(CurrentGlobalPaletteMode);
- // No circular reference encountered
- return false;
- }
#endregion
#region Static Implementation
@@ -1138,7 +1007,7 @@ private static void OnUserPreferenceChanged(object sender, UserPreferenceChanged
UpdateToolStripManager();
}
- private static void OnPalettePaint(object sender, PaletteLayoutEventArgs e)
+ private static void OnPalettePaint(object? sender, PaletteLayoutEventArgs e)
{
// If the color table has changed then need to update tool strip immediately
if (e.NeedColorTable)
@@ -1147,41 +1016,118 @@ private static void OnPalettePaint(object sender, PaletteLayoutEventArgs e)
}
}
- private static void SetPalette(PaletteBase? globalPalette)
+ private static void SetPalette(PaletteBase globalPalette)
{
- if (globalPalette != InternalGlobalPalette)
+ if (globalPalette != CurrentGlobalPalette)
{
// Unhook from current palette events
- if (InternalGlobalPalette != null)
+ if (CurrentGlobalPalette != null)
{
- InternalGlobalPalette.PalettePaint -= OnPalettePaint;
+ CurrentGlobalPalette.PalettePaint -= OnPalettePaint;
}
// Remember the new palette
- InternalGlobalPalette = globalPalette;
+ CurrentGlobalPalette = globalPalette;
// Hook to new palette events
- if (InternalGlobalPalette != null)
+ if (CurrentGlobalPalette != null)
{
- InternalGlobalPalette.PalettePaint += OnPalettePaint;
+ CurrentGlobalPalette.PalettePaint += OnPalettePaint;
}
}
}
- private static void OnGlobalAllowFormChromeChanged(EventArgs e) => GlobalAllowFormChromeChanged?.Invoke(null, e);
+ private static void OnGlobalUseThemeFormChromeBorderWidthChanged(EventArgs e) => GlobalUseThemeFormChromeBorderWidthChanged?.Invoke(null, e);
private static void OnGlobalPaletteChanged(EventArgs e)
{
UpdateToolStripManager();
+ UpdatePaletteImages(CurrentGlobalPaletteMode);
+
GlobalPaletteChanged?.Invoke(null, e);
}
+ private static void UpdatePaletteImages(PaletteMode paletteMode)
+ {
+ switch (paletteMode)
+ {
+ case PaletteMode.Global:
+ case PaletteMode.Custom:
+ Images.ToolbarImages.SetToolBarImages(GlobalStaticValues.GenericToolBarImages);
+ break;
+ case PaletteMode.ProfessionalSystem:
+ Images.ToolbarImages.SetToolBarImages(GlobalStaticValues.SystemToolBarImages);
+ break;
+ case PaletteMode.ProfessionalOffice2003:
+ Images.ToolbarImages.SetToolBarImages(GlobalStaticValues.Office2003ToolBarImages);
+ break;
+ case PaletteMode.Office2007Blue:
+ case PaletteMode.Office2007BlueDarkMode:
+ case PaletteMode.Office2007BlueLightMode:
+ case PaletteMode.Office2007Silver:
+ case PaletteMode.Office2007SilverDarkMode:
+ case PaletteMode.Office2007SilverLightMode:
+ case PaletteMode.Office2007White:
+ case PaletteMode.Office2007Black:
+ case PaletteMode.Office2007BlackDarkMode:
+ case PaletteMode.VisualStudio2010Render2007:
+ Images.ToolbarImages.SetToolBarImages(GlobalStaticValues.Office2007ToolBarImages);
+ break;
+ case PaletteMode.Office2010Blue:
+ case PaletteMode.Office2010BlueDarkMode:
+ case PaletteMode.Office2010BlueLightMode:
+ case PaletteMode.Office2010Silver:
+ case PaletteMode.Office2010SilverDarkMode:
+ case PaletteMode.Office2010SilverLightMode:
+ case PaletteMode.Office2010White:
+ case PaletteMode.Office2010Black:
+ case PaletteMode.Office2010BlackDarkMode:
+ case PaletteMode.SparkleBlue:
+ case PaletteMode.SparkleBlueDarkMode:
+ case PaletteMode.SparkleBlueLightMode:
+ case PaletteMode.SparkleOrange:
+ case PaletteMode.SparkleOrangeDarkMode:
+ case PaletteMode.SparkleOrangeLightMode:
+ case PaletteMode.SparklePurple:
+ case PaletteMode.SparklePurpleDarkMode:
+ case PaletteMode.SparklePurpleLightMode:
+ case PaletteMode.VisualStudio2010Render2010:
+ Images.ToolbarImages.SetToolBarImages(GlobalStaticValues.Office2010ToolBarImages);
+ break;
+ case PaletteMode.Office2013White:
+ case PaletteMode.VisualStudio2010Render2013:
+ Images.ToolbarImages.SetToolBarImages(GlobalStaticValues.Office2013ToolBarImages);
+ break;
+ case PaletteMode.Microsoft365Black:
+ case PaletteMode.Microsoft365BlackDarkMode:
+ case PaletteMode.Microsoft365BlackDarkModeAlternate:
+ case PaletteMode.Microsoft365Blue:
+ case PaletteMode.Microsoft365BlueDarkMode:
+ case PaletteMode.Microsoft365BlueLightMode:
+ case PaletteMode.Microsoft365Silver:
+ case PaletteMode.Microsoft365SilverDarkMode:
+ case PaletteMode.Microsoft365SilverLightMode:
+ case PaletteMode.Microsoft365White:
+ case PaletteMode.VisualStudio2010Render365:
+ Images.ToolbarImages.SetToolBarImages(GlobalStaticValues.Microsoft365ToolBarImages);
+ break;
+ default:
+ // Should not happen!
+
+ // Disable since palette mode is an enum and is not nullable
+ //Debug.Assert(paletteMode is not null);
+
+ DebugTools.NotImplemented(paletteMode.ToString());
+ break;
+ }
+ }
+
private static void UpdateToolStripManager()
{
if (_globalApplyToolstrips)
{
- ToolStripManager.Renderer = InternalGlobalPalette?.GetRenderer()?.RenderToolStrip(InternalGlobalPalette);
+ ToolStripManager.Renderer = CurrentGlobalPalette?.GetRenderer()?.RenderToolStrip(CurrentGlobalPalette);
}
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonMaskedTextBox.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonMaskedTextBox.cs
index 4837d663e..9c806bab1 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonMaskedTextBox.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonMaskedTextBox.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -46,7 +46,7 @@ public string? Hint
if (string.IsNullOrEmpty(Text) && !string.IsNullOrWhiteSpace(Hint))
{
- PI.SendMessage(Handle, PI.EM_SETCUEBANNER, (IntPtr)1, Hint);
+ PI.SendMessage(Handle, PI.EM_SETCUEBANNER, (IntPtr)1, Hint!);
}
Refresh();
@@ -193,7 +193,7 @@ protected override void WndProc(ref Message m)
// Set the correct text rendering hint for the text drawing. We only draw if the edit text is disabled so we
// just always grab the disable state value. Without this line the wrong hint can occur because it inherits
// it from the device context. Resulting in blurred text.
- g.TextRenderingHint = CommonHelper.PaletteTextHintToRenderingHint(_kryptonMaskedTextBox.StateDisabled.PaletteContent.GetContentShortTextHint(PaletteState.Disabled));
+ g.TextRenderingHint = CommonHelper.PaletteTextHintToRenderingHint(_kryptonMaskedTextBox.StateDisabled.PaletteContent!.GetContentShortTextHint(PaletteState.Disabled));
// Define the string formatting requirements
var stringFormat = new StringFormat
@@ -230,7 +230,7 @@ protected override void WndProc(ref Message m)
catch (ArgumentException)
{
using var foreBrush = new SolidBrush(ForeColor);
- g.DrawString(drawText, _kryptonMaskedTextBox.GetTripleState().PaletteContent.GetContentShortTextFont(PaletteState.Disabled), foreBrush,
+ g.DrawString(drawText, _kryptonMaskedTextBox.GetTripleState().PaletteContent?.GetContentShortTextFont(PaletteState.Disabled)!, foreBrush,
new RectangleF(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top),
stringFormat);
}
@@ -324,7 +324,6 @@ public MaskedTextBoxButtonSpecCollection(KryptonMaskedTextBox owner)
private bool _mouseOver;
private bool _alwaysActive;
private bool _trackingMouseEnter;
- private float _cornerRoundingRadius;
private int _cachedHeight;
#endregion
@@ -505,10 +504,10 @@ public KryptonMaskedTextBox()
// Create button specification collection manager
_buttonManager = new ButtonSpecManagerLayout(this, Redirector, ButtonSpecs, null,
- new[] { _drawDockerInner },
- new IPaletteMetric[] { StateCommon },
- new[] { PaletteMetricInt.HeaderButtonEdgeInsetInputControl },
- new[] { PaletteMetricPadding.HeaderButtonPaddingInputControl },
+ [_drawDockerInner],
+ [StateCommon],
+ [PaletteMetricInt.HeaderButtonEdgeInsetInputControl],
+ [PaletteMetricPadding.HeaderButtonPaddingInputControl],
CreateToolStripRenderer,
NeedPaintDelegate);
@@ -520,8 +519,6 @@ public KryptonMaskedTextBox()
// Add text box to the controls collection
((KryptonReadOnlyControls)Controls).AddInternal(_maskedTextBox);
-
- _cornerRoundingRadius = GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
}
///
@@ -536,7 +533,7 @@ protected override void Dispose(bool disposing)
OnCancelToolTip(this, EventArgs.Empty);
// Remember to pull down the manager instance
- _buttonManager.Destruct();
+ _buttonManager?.Destruct();
}
base.Dispose(disposing);
@@ -544,18 +541,6 @@ protected override void Dispose(bool disposing)
#endregion
#region Public
-
- /// Gets or sets the corner rounding radius.
- /// The corner rounding radius.
- [Category(@"Visuals")]
- [Description(@"Gets or sets the corner rounding radius.")]
- [DefaultValue(GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE)]
- public float CornerRoundingRadius
- {
- get => _cornerRoundingRadius;
- set => SetCornerRoundingRadius(value);
- }
-
///
/// Hint text placed into empty control
///
@@ -601,7 +586,7 @@ public string? Hint
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[EditorBrowsable(EditorBrowsableState.Always)]
[Browsable(false)]
- public MaskedTextBox? MaskedTextBox => _maskedTextBox;
+ public MaskedTextBox MaskedTextBox => _maskedTextBox;
///
/// Gets access to the contained input control.
@@ -662,7 +647,7 @@ public override Color BackColor
public override Font Font
{
get => base.Font;
- set => base.Font = value;
+ set => base.Font = value!;
}
///
@@ -818,11 +803,11 @@ public Type? ValidatingType
[DefaultValue(true)]
public bool UseMnemonic
{
- get => _buttonManager.UseMnemonic;
+ get => _buttonManager!.UseMnemonic;
set
{
- if (_buttonManager.UseMnemonic != value)
+ if (_buttonManager!.UseMnemonic != value)
{
_buttonManager.UseMnemonic = value;
PerformNeedPaint(true);
@@ -1520,7 +1505,7 @@ protected override void OnEnabledChanged(EventArgs e)
_drawDockerOuter.Enabled = Enabled;
// Update state to reflect change in enabled state
- _buttonManager.RefreshButtons();
+ _buttonManager?.RefreshButtons();
PerformNeedPaint(true);
@@ -1574,7 +1559,7 @@ protected override void OnLayout(LayoutEventArgs levent)
if (!IsDisposed && !Disposing)
{
// Update with latest content padding for placing around the contained text box control
- Padding contentPadding = GetTripleState().PaletteContent.GetContentPadding(_drawDockerOuter.State);
+ Padding contentPadding = GetTripleState().PaletteContent!.GetContentPadding(_drawDockerOuter.State);
_layoutFill.DisplayPadding = contentPadding;
}
@@ -1694,13 +1679,13 @@ protected override void OnNeedPaint(object? sender, NeedLayoutEventArgs e)
IPaletteTriple triple = GetTripleState();
PaletteState state = _drawDockerOuter.State;
_maskedTextBox.BackColor = triple.PaletteBack.GetBackColor1(state);
- _maskedTextBox.ForeColor = triple.PaletteContent.GetContentShortTextColor1(state);
+ _maskedTextBox.ForeColor = triple.PaletteContent!.GetContentShortTextColor1(state);
// Only set the font if the masked text box has been created
- Font font = triple.PaletteContent.GetContentShortTextFont(state);
+ Font? font = triple.PaletteContent.GetContentShortTextFont(state);
if ((_maskedTextBox.Handle != IntPtr.Zero) && !_maskedTextBox.Font.Equals(font))
{
- _maskedTextBox.Font = font;
+ _maskedTextBox.Font = font!;
}
}
@@ -1775,13 +1760,13 @@ private void UpdateStateAndPalettes()
{
// Get the correct palette settings to use
IPaletteTriple tripleState = GetTripleState();
- _drawDockerOuter.SetPalettes(tripleState.PaletteBack, tripleState.PaletteBorder);
+ _drawDockerOuter.SetPalettes(tripleState.PaletteBack, tripleState.PaletteBorder!);
// Update enabled state
_drawDockerOuter.Enabled = Enabled;
// Find the new state of the main view element
- PaletteState state = IsActive ? PaletteState.Tracking : PaletteState.Normal;
+ PaletteState state = Enabled ? (IsActive ? PaletteState.Tracking : PaletteState.Normal) : PaletteState.Disabled;
_drawDockerOuter.ElementState = state;
}
@@ -1809,51 +1794,51 @@ private void AdjustHeight(bool ignoreAnchored)
}
}
- private void OnMaskedTextBoxTextChanged(object sender, EventArgs e) => OnTextChanged(e);
+ private void OnMaskedTextBoxTextChanged(object? sender, EventArgs e) => OnTextChanged(e);
- private void OnMaskedTextBoxTextAlignChanged(object sender, EventArgs e) => OnTextAlignChanged(e);
+ private void OnMaskedTextBoxTextAlignChanged(object? sender, EventArgs e) => OnTextAlignChanged(e);
- private void OnMaskedTextBoxHideSelectionChanged(object sender, EventArgs e) => OnHideSelectionChanged(e);
+ private void OnMaskedTextBoxHideSelectionChanged(object? sender, EventArgs e) => OnHideSelectionChanged(e);
- private void OnMaskedTextBoxModifiedChanged(object sender, EventArgs e) => OnModifiedChanged(e);
+ private void OnMaskedTextBoxModifiedChanged(object? sender, EventArgs e) => OnModifiedChanged(e);
- private void OnMaskedTextBoxReadOnlyChanged(object sender, EventArgs e) => OnReadOnlyChanged(e);
+ private void OnMaskedTextBoxReadOnlyChanged(object? sender, EventArgs e) => OnReadOnlyChanged(e);
- private void OnMaskedMaskChanged(object sender, EventArgs e) => OnMaskChanged(e);
+ private void OnMaskedMaskChanged(object? sender, EventArgs e) => OnMaskChanged(e);
- private void OnMaskedIsOverwriteModeChanged(object sender, EventArgs e) => OnIsOverwriteModeChanged(e);
+ private void OnMaskedIsOverwriteModeChanged(object? sender, EventArgs e) => OnIsOverwriteModeChanged(e);
- private void OnMaskedMaskInputRejected(object sender, MaskInputRejectedEventArgs e) => OnMaskInputRejected(e);
+ private void OnMaskedMaskInputRejected(object? sender, MaskInputRejectedEventArgs e) => OnMaskInputRejected(e);
- private void OnMaskedTypeValidationCompleted(object sender, TypeValidationEventArgs e) => OnTypeValidationCompleted(e);
+ private void OnMaskedTypeValidationCompleted(object? sender, TypeValidationEventArgs e) => OnTypeValidationCompleted(e);
- private void OnMaskedTextBoxGotFocus(object sender, EventArgs e)
+ private void OnMaskedTextBoxGotFocus(object? sender, EventArgs e)
{
UpdateStateAndPalettes();
PerformNeedPaint(true);
OnGotFocus(e);
}
- private void OnMaskedTextBoxLostFocus(object sender, EventArgs e)
+ private void OnMaskedTextBoxLostFocus(object? sender, EventArgs e)
{
UpdateStateAndPalettes();
PerformNeedPaint(true);
OnLostFocus(e);
}
- private void OnMaskedTextBoxKeyPress(object sender, KeyPressEventArgs e) => OnKeyPress(e);
+ private void OnMaskedTextBoxKeyPress(object? sender, KeyPressEventArgs e) => OnKeyPress(e);
- private void OnMaskedTextBoxKeyUp(object sender, KeyEventArgs e) => OnKeyUp(e);
+ private void OnMaskedTextBoxKeyUp(object? sender, KeyEventArgs e) => OnKeyUp(e);
- private void OnMaskedTextBoxKeyDown(object sender, KeyEventArgs e) => OnKeyDown(e);
+ private void OnMaskedTextBoxKeyDown(object? sender, KeyEventArgs e) => OnKeyDown(e);
- private void OnMaskedTextBoxPreviewKeyDown(object sender, PreviewKeyDownEventArgs e) => OnPreviewKeyDown(e);
+ private void OnMaskedTextBoxPreviewKeyDown(object? sender, PreviewKeyDownEventArgs e) => OnPreviewKeyDown(e);
- private void OnMaskedTextBoxValidated(object sender, EventArgs e) => OnValidated(e);
+ private void OnMaskedTextBoxValidated(object? sender, EventArgs e) => OnValidated(e);
- private void OnMaskedTextBoxValidating(object sender, CancelEventArgs e) => OnValidating(e);
+ private void OnMaskedTextBoxValidating(object? sender, CancelEventArgs e) => OnValidating(e);
- private void OnShowToolTip(object sender, ToolTipEventArgs e)
+ private void OnShowToolTip(object? sender, ToolTipEventArgs e)
{
if (!IsDisposed && !Disposing)
{
@@ -1873,7 +1858,7 @@ private void OnShowToolTip(object sender, ToolTipEventArgs e)
var shadow = true;
// Find the button spec associated with the tooltip request
- ButtonSpec? buttonSpec = _buttonManager.ButtonSpecFromView(e.Target);
+ ButtonSpec? buttonSpec = _buttonManager?.ButtonSpecFromView(e.Target);
// If the tooltip is for a button spec
if (buttonSpec != null)
@@ -1920,24 +1905,24 @@ private void OnShowToolTip(object sender, ToolTipEventArgs e)
}
}
- private void OnCancelToolTip(object sender, EventArgs e)
+ private void OnCancelToolTip(object? sender, EventArgs e)
{
// Remove any currently showing tooltip
_visualPopupToolTip?.Dispose();
_visualPopupToolTip = null;
}
- private void OnVisualPopupToolTipDisposed(object sender, EventArgs e)
+ private void OnVisualPopupToolTipDisposed(object? sender, EventArgs e)
{
// Unhook events from the specific instance that generated event
- var popupToolTip = (VisualPopupToolTip)sender;
+ var popupToolTip = sender as VisualPopupToolTip ?? throw new ArgumentNullException(nameof(sender));
popupToolTip.Disposed -= OnVisualPopupToolTipDisposed;
// Not showing a popup page any more
_visualPopupToolTip = null;
}
- private void OnMaskedTextBoxMouseChange(object sender, EventArgs e)
+ private void OnMaskedTextBoxMouseChange(object? sender, EventArgs e)
{
// Change in tracking state?
if (_maskedTextBox.MouseOver != _trackingMouseEnter)
@@ -1957,14 +1942,6 @@ private void OnMaskedTextBoxMouseChange(object sender, EventArgs e)
}
}
}
-
- private void SetCornerRoundingRadius(float? radius)
- {
- _cornerRoundingRadius = radius ?? GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
- StateCommon.Border.Rounding = _cornerRoundingRadius;
- }
-
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonMessageBox.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonMessageBox.cs
index bd9f6ed3d..5b73f042e 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonMessageBox.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonMessageBox.cs
@@ -5,13 +5,11 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
-using ContentAlignment = System.Drawing.ContentAlignment;
-
// ReSharper disable ClassNeverInstantiated.Global
// ReSharper disable UnusedMethodReturnValue.Global
@@ -19,6 +17,11 @@ namespace Krypton.Toolkit
{
///
/// Displays a message box that can contain text, buttons, and symbols that inform and instruct the user.
+ /// The API's mimic the "legacy ones" from WinForms, with the addition of optional params to
+ /// - force ShowCtrl
+ /// - Hide the close button
+ /// - "displayHelpButton" has been moved in order to not collide with the above options
+ /// "HelpInfo" is used instead of passing individual elements to the help location(s)
///
[ToolboxItem(false)]
[DesignerCategory(@"code")]
@@ -26,101 +29,91 @@ public static class KryptonMessageBox
{
#region Public
+ ///
+ /// Displays a message box in front+center of the application and with the specified text, caption and buttons.
+ ///
+ /// The text to display in the message box.
+ /// Show extraText in title. If null (default) then only when Warning or Error icon is used.
+ /// Displays the close button. If null (default), then the close button will be displayed.
+ /// One of the System.Windows.Forms.DialogResult values.
+ public static DialogResult Show(string text,
+ bool? showCtrlCopy = null,
+ bool? showCloseButton = null) =>
+ ShowCore(null, text, string.Empty,
+ showCtrlCopy: showCtrlCopy,
+ showHelpButton: false,
+ showCloseButton: showCloseButton);
+
///
/// Displays a message box in front+center of the application and with the specified text, caption and buttons.
///
/// The text to display in the message box.
/// The text to display in the title bar of the message box. default="string.Empty"
- /// Show extraText in title. If null(default) then only when Warning or Error icon is used.
- /// Specifies the .
- /// Specifies a if using the type.
- /// Specifies the if a has not been defined.
- /// Specifies the area within the to be regarded as a link. See .
- /// Specifies how the message text should be aligned. See for supported values.
+ /// Show extraText in title. If null (default) then only when Warning or Error icon is used.
+ /// Displays the close button. If null (default), then the close button will be displayed.
/// One of the System.Windows.Forms.DialogResult values.
public static DialogResult Show(string text, string caption, bool? showCtrlCopy = null,
- MessageBoxContentAreaType? contentAreaType = null,
- KryptonCommand? linkAreaCommand = null,
- ProcessStartInfo? linkLaunchArgument = null,
- LinkArea? contentLinkArea = null,
- ContentAlignment? messageTextAlignment = ContentAlignment.MiddleLeft) =>
- ShowCore(null, text, caption, KryptonMessageBoxButtons.OK, KryptonMessageBoxIcon.None,
- KryptonMessageBoxDefaultButton.Button4, 0, null, showCtrlCopy,
- null, null, @"", null, null, @"",
- contentAreaType, linkAreaCommand, linkLaunchArgument, contentLinkArea, messageTextAlignment);
+ bool? showCloseButton = null) =>
+ ShowCore(null, text, caption,
+ showCtrlCopy: showCtrlCopy,
+ showHelpButton: false,
+ showCloseButton: showCloseButton);
+
///
/// Displays a message box in front+center of the application and with the specified text, caption and buttons.
///
/// The text to display in the message box.
- /// Show extraText in title. If null(default) then only when Warning or Error icon is used.
- /// Specifies the .
- /// Specifies a if using the type.
- /// Specifies the if a has not been defined.
- /// Specifies the area within the to be regarded as a link. See .
- /// Specifies how the message text should be aligned. See for supported values.
+ /// The text to display in the title bar of the message box. default="string.Empty"
+ /// One of the System.Windows.Forms.KryptonMessageBoxButtons values that specifies which buttons to display in the message box.
+ /// Show extraText in title. If null (default) then only when Warning or Error icon is used.
+ /// Displays the close button. If null (default), then the close button will be displayed.
/// One of the System.Windows.Forms.DialogResult values.
- public static DialogResult Show(string text, bool? showCtrlCopy = null,
- MessageBoxContentAreaType? contentAreaType = null,
- KryptonCommand? linkAreaCommand = null,
- ProcessStartInfo? linkLaunchArgument = null,
- LinkArea? contentLinkArea = null,
- ContentAlignment? messageTextAlignment = ContentAlignment.MiddleLeft) =>
- ShowCore(null, text, @"", KryptonMessageBoxButtons.OK, KryptonMessageBoxIcon.None,
- KryptonMessageBoxDefaultButton.Button4, 0,
- null, showCtrlCopy, false, null, @"",
- null, null, @"",
- contentAreaType, linkAreaCommand, linkLaunchArgument,
- contentLinkArea, messageTextAlignment);
+ public static DialogResult Show(string text, string caption, KryptonMessageBoxButtons buttons,
+ bool? showCtrlCopy = null,
+ bool? showCloseButton = null) =>
+ ShowCore(null, text, caption, buttons,
+ showCtrlCopy: showCtrlCopy,
+ showHelpButton: false,
+ showCloseButton: showCloseButton);
///
- /// Displays a message box in front+center of the specified object and with the specified text, caption, buttons, icon, default button, and options.
+ /// Displays a message box in front+center of the application and with the specified text, caption and buttons.
///
- /// Owner of the modal dialog box.
/// The text to display in the message box.
- /// Show extraText in title. If null(default) then only when Warning or Error icon is used.
- /// Specifies the .
- /// Specifies a if using the type.
- /// Specifies the if a has not been defined.
- /// Specifies the area within the to be regarded as a link. See .
- /// Specifies how the message text should be aligned. See for supported values.
+ /// The text to display in the title bar of the message box. default="string.Empty"
+ /// One of the System.Windows.Forms.KryptonMessageBoxButtons values that specifies which buttons to display in the message box.
+ /// One of the KryptonMessageBoxIcon values that specifies which icon to display in the message box.
+ /// Show extraText in title. If null (default) then only when Warning or Error icon is used.
+ /// Displays the close button. If null (default), then the close button will be displayed.
/// One of the System.Windows.Forms.DialogResult values.
- public static DialogResult Show(IWin32Window? owner, string text, bool? showCtrlCopy = null,
- MessageBoxContentAreaType? contentAreaType = null,
- KryptonCommand? linkAreaCommand = null,
- ProcessStartInfo? linkLaunchArgument = null,
- LinkArea? contentLinkArea = null,
- ContentAlignment? messageTextAlignment = ContentAlignment.MiddleLeft) =>
- ShowCore(owner, text, @"", KryptonMessageBoxButtons.OK, KryptonMessageBoxIcon.None,
- KryptonMessageBoxDefaultButton.Button4, 0, null, showCtrlCopy,
- false, null, @"", null,
- null, @"",
- contentAreaType, linkAreaCommand, linkLaunchArgument, contentLinkArea, messageTextAlignment);
+ public static DialogResult Show(string text, string caption, KryptonMessageBoxButtons buttons, KryptonMessageBoxIcon icon,
+ bool? showCtrlCopy = null,
+ bool? showCloseButton = null) =>
+ ShowCore(null, text, caption, buttons, icon,
+ showCtrlCopy: showCtrlCopy,
+ showHelpButton: false,
+ showCloseButton: showCloseButton);
///
- /// Displays a message box in front+center of the specified object and with the specified text, caption, buttons, icon, default button, and options.
+ /// Displays a message box in front+center of the application and with the specified text, caption and buttons.
///
- /// Owner of the modal dialog box.
/// The text to display in the message box.
/// The text to display in the title bar of the message box. default="string.Empty"
- /// Show extraText in title. If null(default) then only when Warning or Error icon is used.
- /// Specifies the .
- /// Specifies a if using the type.
- /// Specifies the if a has not been defined.
- /// Specifies the area within the to be regarded as a link. See .
- /// Specifies how the message text should be aligned. See for supported values.
+ /// One of the System.Windows.Forms.KryptonMessageBoxButtons values that specifies which buttons to display in the message box.
+ /// One of the KryptonMessageBoxIcon values that specifies which icon to display in the message box.
+ /// Show extraText in title. If null (default) then only when Warning or Error icon is used.
+ /// Displays the close button. If null (default), then the close button will be displayed.
+ /// One of the KryptonMessageBoxDefaultButton values that specifies the default button for the message box.
/// One of the System.Windows.Forms.DialogResult values.
- public static DialogResult Show(IWin32Window? owner, string text, string caption, bool? showCtrlCopy = null,
- MessageBoxContentAreaType? contentAreaType = null,
- KryptonCommand? linkAreaCommand = null,
- ProcessStartInfo? linkLaunchArgument = null,
- LinkArea? contentLinkArea = null,
- ContentAlignment? messageTextAlignment = ContentAlignment.MiddleLeft) =>
- ShowCore(owner, text, caption, KryptonMessageBoxButtons.OK, KryptonMessageBoxIcon.None,
- KryptonMessageBoxDefaultButton.Button4, 0, null, showCtrlCopy,
- false, null, @"", null,
- null, @"",
- contentAreaType, linkAreaCommand, linkLaunchArgument, contentLinkArea, messageTextAlignment);
+ public static DialogResult Show(string text, string caption, KryptonMessageBoxButtons buttons,
+ KryptonMessageBoxIcon icon, KryptonMessageBoxDefaultButton defaultButton,
+ bool? showCtrlCopy = null,
+ bool? showCloseButton = null) =>
+ ShowCore(null, text, caption, buttons, icon, defaultButton,
+ showCtrlCopy: showCtrlCopy,
+ showHelpButton: false,
+ showCloseButton: showCloseButton);
///
/// Displays a message box in front+center of the application and with the specified text, caption and buttons.
@@ -128,209 +121,223 @@ public static DialogResult Show(IWin32Window? owner, string text, string caption
/// The text to display in the message box.
/// The text to display in the title bar of the message box. default="string.Empty"
/// One of the System.Windows.Forms.KryptonMessageBoxButtons values that specifies which buttons to display in the message box.
- /// Show extraText in title. If null(default) then only when Warning or Error icon is used.
- /// Specifies the .
- /// Specifies a if using the type.
- /// Specifies the if a has not been defined.
- /// Specifies the area within the to be regarded as a link. See .
- /// Specifies how the message text should be aligned. See for supported values.
+ /// One of the KryptonMessageBoxIcon values that specifies which icon to display in the message box.
+ /// Show extraText in title. If null (default) then only when Warning or Error icon is used.
+ /// Displays the close button. If null (default), then the close button will be displayed.
+ /// One of the KryptonMessageBoxDefaultButton values that specifies the default button for the message box.
+ /// One of the System.Windows.Forms.MessageBoxOptions values that specifies which display and association options will be used for the message box. You may pass in 0 if you wish to use the defaults.
/// One of the System.Windows.Forms.DialogResult values.
public static DialogResult Show(string text, string caption, KryptonMessageBoxButtons buttons,
- bool? showCtrlCopy = null,
- MessageBoxContentAreaType? contentAreaType = null,
- KryptonCommand? linkAreaCommand = null,
- ProcessStartInfo? linkLaunchArgument = null,
- LinkArea? contentLinkArea = null,
- ContentAlignment? messageTextAlignment = ContentAlignment.MiddleLeft) =>
- ShowCore(null, text, caption, buttons, KryptonMessageBoxIcon.None,
- KryptonMessageBoxDefaultButton.Button1, 0,
- new HelpInfo(@"", 0, null), showCtrlCopy,
- null, null, @"",
- null, null, @"",
- contentAreaType, linkAreaCommand, linkLaunchArgument,
- contentLinkArea, messageTextAlignment);
+ KryptonMessageBoxIcon icon, KryptonMessageBoxDefaultButton defaultButton, MessageBoxOptions options,
+ bool? showCtrlCopy = null,
+ bool? showCloseButton = null) =>
+ ShowCore(null, text, caption, buttons, icon, defaultButton, options,
+ showCtrlCopy: showCtrlCopy,
+ showHelpButton: false,
+ showCloseButton: showCloseButton);
///
- /// Displays a message box in front+center of the application and with the specified text, caption, buttons, icon, default button, and options.
+ /// Displays a message box in front+center of the application and with the specified text, caption and buttons.
///
/// The text to display in the message box.
/// The text to display in the title bar of the message box. default="string.Empty"
/// One of the System.Windows.Forms.KryptonMessageBoxButtons values that specifies which buttons to display in the message box.
- /// One of the KryptonMessageBoxIcon values that specifies which icon to display in the message box.
- /// One of the KryptonMessageBoxDefaultButton values that specifies the default button for the message box.
- /// One of the System.Windows.Forms.MessageBoxOptions values that specifies which display and association options will be used for the message box. You may pass in 0 if you wish to use the defaults.
- /// Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button.
- /// Show extraText in title. If null(default) then only when Warning or Error icon is used.
- /// Displays a 'Help' button, as seen in .NET 6 and higher.
- /// Shows the optional action button.
- /// The action button text.
- /// The attached to the action button.
- /// The image of the application.
- /// The application path. To be used in conjunction with type.
- /// Specifies the .
- /// Specifies a if using the type.
- /// Specifies the if a has not been defined.
- /// Specifies the area within the to be regarded as a link. See .
- /// Specifies how the message text should be aligned. See for supported values.
+ /// One of the KryptonMessageBoxIcon values that specifies which icon to display in the message box.
+ /// Show extraText in title. If null (default) then only when Warning or Error icon is used.
+ /// Displays the close button. If null (default), then the close button will be displayed.
+ /// One of the KryptonMessageBoxDefaultButton values that specifies the default button for the message box.
+ /// One of the System.Windows.Forms.MessageBoxOptions values that specifies which display and association options will be used for the message box. You may pass in 0 if you wish to use the defaults.
+ /// Contains the help data of the .
/// One of the System.Windows.Forms.DialogResult values.
public static DialogResult Show(string text, string caption, KryptonMessageBoxButtons buttons,
- KryptonMessageBoxIcon icon,
- KryptonMessageBoxDefaultButton defaultButton = KryptonMessageBoxDefaultButton.Button4,
- MessageBoxOptions options = 0, bool displayHelpButton = false,
- bool? showCtrlCopy = null, bool? showHelpButton = null, bool? showActionButton = null,
- string? actionButtonText = @"", KryptonCommand? actionButtonCommand = null,
- ProcessStartInfo? linkLaunchArgument = null, Image? applicationImage = null,
- string? applicationPath = @"",
- MessageBoxContentAreaType? contentAreaType = null,
- KryptonCommand? linkAreaCommand = null,
- LinkArea? contentLinkArea = null,
- ContentAlignment? messageTextAlignment = ContentAlignment.MiddleLeft)
- =>
- ShowCore(null, text, caption, buttons, icon, defaultButton, options,
- displayHelpButton ? new HelpInfo() : null, showCtrlCopy,
- showHelpButton, showActionButton,
- actionButtonText, actionButtonCommand, applicationImage, applicationPath,
- contentAreaType, linkAreaCommand, linkLaunchArgument,
- contentLinkArea, messageTextAlignment);
+ KryptonMessageBoxIcon icon, KryptonMessageBoxDefaultButton defaultButton, MessageBoxOptions options, HelpInfo helpInfo,
+ bool? showCtrlCopy = null,
+ bool? showCloseButton = null) =>
+ ShowCore(null, text, caption, buttons, icon, defaultButton, options, helpInfo,
+ showCtrlCopy: showCtrlCopy,
+ showHelpButton: false,
+ showCloseButton: showCloseButton);
+ ///
+ /// Displays a message box in front+center of the application and with the specified text, caption and buttons.
+ ///
+ /// The text to display in the message box.
+ /// The text to display in the title bar of the message box. default="string.Empty"
+ /// One of the System.Windows.Forms.KryptonMessageBoxButtons values that specifies which buttons to display in the message box.
+ /// Displays a 'Help' button, as seen in .NET 6 and higher.
+ /// One of the KryptonMessageBoxIcon values that specifies which icon to display in the message box.
+ /// Show extraText in title. If null (default) then only when Warning or Error icon is used.
+ /// Displays the close button. If null (default), then the close button will be displayed.
+ /// One of the KryptonMessageBoxDefaultButton values that specifies the default button for the message box.
+ /// One of the System.Windows.Forms.MessageBoxOptions values that specifies which display and association options will be used for the message box. You may pass in 0 if you wish to use the defaults.
+ /// One of the System.Windows.Forms.DialogResult values.
+ public static DialogResult Show(string text, string caption, KryptonMessageBoxButtons buttons, bool displayHelpButton,
+ KryptonMessageBoxIcon icon, KryptonMessageBoxDefaultButton defaultButton, MessageBoxOptions options,
+ bool? showCtrlCopy = null,
+ bool? showCloseButton = null) =>
+ ShowCore(null, text, caption, buttons, icon, defaultButton, options,
+ showCtrlCopy: showCtrlCopy,
+ showHelpButton: displayHelpButton,
+ showCloseButton: showCloseButton);
///
- /// Displays a message box in front+center of the specified object and with the specified text, caption, buttons, icon, default button, and options.
+ /// Displays a message box in front+center of the application and with the specified text, caption and buttons.
///
/// Owner of the modal dialog box.
/// The text to display in the message box.
- /// The text to display in the title bar of the message box. default="string.Empty"
+ /// Show extraText in title. If null (default) then only when Warning or Error icon is used.
+ /// Displays the close button. If null (default), then the close button will be displayed.
+ /// One of the System.Windows.Forms.DialogResult values.
+ public static DialogResult Show(IWin32Window owner, string text,
+ bool? showCtrlCopy = null,
+ bool? showCloseButton = null) =>
+ ShowCore(owner, text, string.Empty,
+ showCtrlCopy: showCtrlCopy,
+ showHelpButton: false,
+ showCloseButton: showCloseButton);
+
+ ///
+ /// Displays a message box in front+center of the application and with the specified text, caption and buttons.
+ ///
+ /// Owner of the modal dialog box.
+ /// The text to display in the message box.
+ /// The text to display in the title bar of the message box. default="string.Empty"
+ /// Show extraText in title. If null (default) then only when Warning or Error icon is used.
+ /// Displays the close button. If null (default), then the close button will be displayed.
+ /// One of the System.Windows.Forms.DialogResult values.
+ public static DialogResult Show(IWin32Window owner, string? text, string? caption, bool? showCtrlCopy = null,
+ bool? showCloseButton = null) =>
+ ShowCore(owner, text, caption,
+ showCtrlCopy: showCtrlCopy,
+ showHelpButton: false,
+ showCloseButton: showCloseButton);
+
+
+ ///
+ /// Displays a message box in front+center of the application and with the specified text, caption and buttons.
+ ///
+ /// Owner of the modal dialog box.
+ /// The text to display in the message box.
+ /// The text to display in the title bar of the message box. default="string.Empty"
+ /// One of the System.Windows.Forms.KryptonMessageBoxButtons values that specifies which buttons to display in the message box.
+ /// Show extraText in title. If null (default) then only when Warning or Error icon is used.
+ /// Displays the close button. If null (default), then the close button will be displayed.
+ /// One of the System.Windows.Forms.DialogResult values.
+ public static DialogResult Show(IWin32Window owner, string? text, string? caption, KryptonMessageBoxButtons buttons,
+ bool? showCtrlCopy = null,
+ bool? showCloseButton = null) =>
+ ShowCore(owner, text, caption, buttons,
+ showCtrlCopy: showCtrlCopy,
+ showHelpButton: false,
+ showCloseButton: showCloseButton);
+
+ ///
+ /// Displays a message box in front+center of the application and with the specified text, caption and buttons.
+ ///
+ /// Owner of the modal dialog box.
+ /// The text to display in the message box.
+ /// The text to display in the title bar of the message box. default="string.Empty"
/// One of the System.Windows.Forms.KryptonMessageBoxButtons values that specifies which buttons to display in the message box.
/// One of the KryptonMessageBoxIcon values that specifies which icon to display in the message box.
- /// One of the KryptonMessageBoxDefaultButton values that specifies the default button for the message box.
- /// One of the System.Windows.Forms.MessageBoxOptions values that specifies which display and association options will be used for the message box. You may pass in 0 if you wish to use the defaults.
- /// Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button.
- /// Show extraText in title. If null(default) then only when Warning or Error icon is used.
- /// Displays a 'Help' button, as seen in .NET 6 and higher.
- /// Shows the optional action button.
- /// The action button text.
- /// The attached to the action button.
- /// The image of the application.
- /// The application path. To be used in conjunction with type.
- /// Specifies the .
- /// Specifies a if using the type.
- /// Specifies the if a has not been defined.
- /// Specifies the area within the to be regarded as a link. See .
- /// Specifies how the message text should be aligned. See for supported values.
+ /// Show extraText in title. If null (default) then only when Warning or Error icon is used.
+ /// Displays the close button. If null (default), then the close button will be displayed.
/// One of the System.Windows.Forms.DialogResult values.
- public static DialogResult Show(IWin32Window? owner, string text, string caption,
- KryptonMessageBoxButtons buttons, KryptonMessageBoxIcon icon,
- KryptonMessageBoxDefaultButton defaultButton = KryptonMessageBoxDefaultButton.Button4,
- MessageBoxOptions options = 0, bool displayHelpButton = false,
- bool? showCtrlCopy = null, bool? showHelpButton = null,
- bool? showActionButton = null, string? actionButtonText = @"",
- KryptonCommand? actionButtonCommand = null, Image? applicationImage = null,
- string? applicationPath = @"",
- MessageBoxContentAreaType? contentAreaType = null,
- KryptonCommand? linkAreaCommand = null,
- ProcessStartInfo? linkLaunchArgument = null,
- LinkArea? contentLinkArea = null,
- ContentAlignment? messageTextAlignment = ContentAlignment.MiddleLeft)
- =>
- ShowCore(owner, text, caption, buttons, icon, defaultButton, options,
- displayHelpButton ? new HelpInfo() : null, showCtrlCopy,
- showHelpButton, showActionButton, actionButtonText,
- actionButtonCommand, applicationImage, applicationPath,
- contentAreaType, linkAreaCommand, linkLaunchArgument,
- contentLinkArea, messageTextAlignment);
+ public static DialogResult Show(IWin32Window owner, string? text, string? caption, KryptonMessageBoxButtons buttons, KryptonMessageBoxIcon icon,
+ bool? showCtrlCopy = null,
+ bool? showCloseButton = null) =>
+ ShowCore(owner, text, caption, buttons, icon,
+ showCtrlCopy: showCtrlCopy,
+ showHelpButton: false,
+ showCloseButton: showCloseButton);
+ ///
+ /// Displays a message box in front+center of the application and with the specified text, caption and buttons.
+ ///
+ /// Owner of the modal dialog box.
/// The text to display in the message box.
- /// The text to display in the title bar of the message box. default="string.Empty"
- /// One of the System.Windows.Forms.KryptonMessageBoxButtons values that specifies which buttons to display in the message box.
- /// One of the KryptonMessageBoxIcon values that specifies which icon to display in the message box.
- /// One of the KryptonMessageBoxDefaultButton values that specifies the default button for the message box.
- /// One of the System.Windows.Forms.MessageBoxOptions values that specifies which display and association options will be used for the message box. You may pass in 0 if you wish to use the defaults.
- /// The path and name of the Help file to display when the user clicks the Help button.
- /// One of the System.Windows.Forms.HelpNavigator values.
- /// The numeric ID of the Help topic to display when the user clicks the Help button.
- /// Show extraText in title. If null(default) then only when Warning or Error icon is used.
- /// Displays a 'Help' button, as seen in .NET 6 and higher.
- /// Shows the optional action button.
- /// The action button text.
- /// The attached to the action button.
- /// The image of the application.
- /// The application path. To be used in conjunction with type.
- /// Specifies the .
- /// Specifies a if using the type.
- /// Specifies the if a has not been defined.
- /// Specifies the area within the to be regarded as a link. See .
- /// Specifies how the message text should be aligned. See for supported values.
+ /// The text to display in the title bar of the message box. default="string.Empty"
+ /// One of the System.Windows.Forms.KryptonMessageBoxButtons values that specifies which buttons to display in the message box.
+ /// One of the KryptonMessageBoxIcon values that specifies which icon to display in the message box.
+ /// Show extraText in title. If null (default) then only when Warning or Error icon is used.
+ /// Displays the close button. If null (default), then the close button will be displayed.
+ /// One of the KryptonMessageBoxDefaultButton values that specifies the default button for the message box.
/// One of the System.Windows.Forms.DialogResult values.
- public static DialogResult Show(string text, string caption, KryptonMessageBoxButtons buttons,
- KryptonMessageBoxIcon icon, KryptonMessageBoxDefaultButton defaultButton,
- MessageBoxOptions options, string? helpFilePath,
- HelpNavigator navigator, object? param, bool? showCtrlCopy = null,
- bool? showHelpButton = null, bool? showActionButton = null,
- string? actionButtonText = @"", KryptonCommand? actionButtonCommand = null,
- Image? applicationImage = null, string? applicationPath = @"",
- MessageBoxContentAreaType? contentAreaType = null,
- KryptonCommand? linkAreaCommand = null,
- ProcessStartInfo? linkLaunchArgument = null,
- LinkArea? contentLinkArea = null,
- ContentAlignment? messageTextAlignment = ContentAlignment.MiddleLeft)
- => ShowCore(null, text, caption, buttons, icon, defaultButton, options,
- new HelpInfo(helpFilePath, navigator, param), showCtrlCopy,
- showHelpButton, showActionButton, actionButtonText,
- actionButtonCommand, applicationImage, applicationPath,
- contentAreaType, linkAreaCommand, linkLaunchArgument,
- contentLinkArea, messageTextAlignment);
+ public static DialogResult Show(IWin32Window owner, string? text, string? caption, KryptonMessageBoxButtons buttons,
+ KryptonMessageBoxIcon icon, KryptonMessageBoxDefaultButton defaultButton,
+ bool? showCtrlCopy = null,
+ bool? showCloseButton = null) =>
+ ShowCore(owner, text, caption, buttons, icon, defaultButton,
+ showCtrlCopy: showCtrlCopy,
+ showHelpButton: false,
+ showCloseButton: showCloseButton);
///
- /// Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file, HelpNavigator, and Help topic.
+ /// Displays a message box in front+center of the application and with the specified text, caption and buttons.
///
/// Owner of the modal dialog box.
/// The text to display in the message box.
- /// The text to display in the title bar of the message box.
+ /// The text to display in the title bar of the message box. default="string.Empty"
/// One of the System.Windows.Forms.KryptonMessageBoxButtons values that specifies which buttons to display in the message box.
/// One of the KryptonMessageBoxIcon values that specifies which icon to display in the message box.
+ /// Show extraText in title. If null (default) then only when Warning or Error icon is used.
+ /// Displays the close button. If null (default), then the close button will be displayed.
/// One of the KryptonMessageBoxDefaultButton values that specifies the default button for the message box.
/// One of the System.Windows.Forms.MessageBoxOptions values that specifies which display and association options will be used for the message box. You may pass in 0 if you wish to use the defaults.
- /// The path and name of the Help file to display when the user clicks the Help button.
- /// One of the System.Windows.Forms.HelpNavigator values.
- /// The numeric ID of the Help topic to display when the user clicks the Help button.
- /// Show extraText in title. If null(default) then only when Warning or Error icon is used.
- /// Displays a 'Help' button, as seen in .NET 6 and higher.
- /// Shows the optional action button.
- /// The action button text.
- /// The attached to the action button.
- /// The image of the application.
- /// The application path. To be used in conjunction with type.
- /// Specifies the .
- /// Specifies a if using the type.
- /// Specifies the if a has not been defined.
- /// Specifies the area within the to be regarded as a link. See .
- /// Specifies how the message text should be aligned. See for supported values.
/// One of the System.Windows.Forms.DialogResult values.
- public static DialogResult Show(IWin32Window? owner, string text, string caption,
- KryptonMessageBoxButtons buttons,
- KryptonMessageBoxIcon icon,
- KryptonMessageBoxDefaultButton defaultButton,
- MessageBoxOptions options,
- string? helpFilePath, HelpNavigator navigator,
- object? param, bool? showCtrlCopy = null,
- bool? showHelpButton = null,
- bool? showActionButton = null,
- string? actionButtonText = @"",
- KryptonCommand? actionButtonCommand = null,
- Image? applicationImage = null,
- string? applicationPath = @"",
- MessageBoxContentAreaType? contentAreaType = null,
- KryptonCommand? linkAreaCommand = null,
- ProcessStartInfo? linkLaunchArgument = null,
- LinkArea? contentLinkArea = null,
- ContentAlignment? messageTextAlignment = ContentAlignment.MiddleLeft)
- => ShowCore(owner, text, caption, buttons, icon, defaultButton, options,
- new HelpInfo(helpFilePath, navigator, param),
- showCtrlCopy, showHelpButton, showActionButton,
- actionButtonText, actionButtonCommand, applicationImage,
- applicationPath, contentAreaType, linkAreaCommand,
- linkLaunchArgument, contentLinkArea, messageTextAlignment);
+ public static DialogResult Show(IWin32Window owner, string? text, string? caption, KryptonMessageBoxButtons buttons,
+ KryptonMessageBoxIcon icon, KryptonMessageBoxDefaultButton defaultButton, MessageBoxOptions options,
+ bool? showCtrlCopy = null,
+ bool? showCloseButton = null) =>
+ ShowCore(owner, text, caption, buttons, icon, defaultButton, options,
+ showCtrlCopy: showCtrlCopy,
+ showHelpButton: false,
+ showCloseButton: showCloseButton);
+
+ ///
+ /// Displays a message box in front+center of the application and with the specified text, caption and buttons.
+ ///
+ /// Owner of the modal dialog box.
+ /// The text to display in the message box.
+ /// The text to display in the title bar of the message box. default="string.Empty"
+ /// One of the System.Windows.Forms.KryptonMessageBoxButtons values that specifies which buttons to display in the message box.
+ /// One of the KryptonMessageBoxIcon values that specifies which icon to display in the message box.
+ /// Show extraText in title. If null (default) then only when Warning or Error icon is used.
+ /// Displays the close button. If null (default), then the close button will be displayed.
+ /// One of the KryptonMessageBoxDefaultButton values that specifies the default button for the message box.
+ /// One of the System.Windows.Forms.MessageBoxOptions values that specifies which display and association options will be used for the message box. You may pass in 0 if you wish to use the defaults.
+ /// Contains the help data of the .
+ /// One of the System.Windows.Forms.DialogResult values.
+ public static DialogResult Show(IWin32Window owner, string? text, string? caption, KryptonMessageBoxButtons buttons,
+ KryptonMessageBoxIcon icon, KryptonMessageBoxDefaultButton defaultButton, MessageBoxOptions options, HelpInfo helpInfo,
+ bool? showCtrlCopy = null,
+ bool? showCloseButton = null) =>
+ ShowCore(owner, text, caption, buttons, icon, defaultButton, options,
+ showCtrlCopy: showCtrlCopy,
+ helpInfo: helpInfo,
+ showCloseButton: showCloseButton);
+ ///
+ /// Displays a message box in front+center of the application and with the specified text, caption and buttons.
+ ///
+ /// Owner of the modal dialog box.
+ /// The text to display in the message box.
+ /// The text to display in the title bar of the message box. default="string.Empty"
+ /// One of the System.Windows.Forms.KryptonMessageBoxButtons values that specifies which buttons to display in the message box.
+ /// Displays a 'Help' button, as seen in .NET 6 and higher.
+ /// One of the KryptonMessageBoxIcon values that specifies which icon to display in the message box.
+ /// Show extraText in title. If null (default) then only when Warning or Error icon is used.
+ /// Displays the close button. If null (default), then the close button will be displayed.
+ /// One of the KryptonMessageBoxDefaultButton values that specifies the default button for the message box.
+ /// One of the System.Windows.Forms.MessageBoxOptions values that specifies which display and association options will be used for the message box. You may pass in 0 if you wish to use the defaults.
+ /// One of the System.Windows.Forms.DialogResult values.
+ public static DialogResult Show(IWin32Window owner, string? text, string? caption, KryptonMessageBoxButtons buttons, bool displayHelpButton,
+ KryptonMessageBoxIcon icon, KryptonMessageBoxDefaultButton defaultButton, MessageBoxOptions options,
+ bool? showCtrlCopy = null,
+ bool? showCloseButton = null) =>
+ ShowCore(owner, text, caption, buttons, icon, defaultButton, options,
+ showCtrlCopy: showCtrlCopy,
+ showHelpButton: displayHelpButton,
+ showCloseButton: showCloseButton);
#endregion
#region Implementation
@@ -345,51 +352,45 @@ public static DialogResult Show(IWin32Window? owner, string text, string caption
/// One of the KryptonMessageBoxDefaultButton values that specifies the default button for the message box.
/// One of the System.Windows.Forms.MessageBoxOptions values that specifies which display and association options will be used for the message box. You may pass in 0 if you wish to use the defaults.
/// Contains the help data of the .
- /// Show extraText in title. If null(default) then only when Warning or Error icon is used.
+ /// Show extraText in title. If null (default) then only when Warning or Error icon is used.
/// Displays a 'Help' button, as seen in .NET 6 and higher.
- /// Shows the optional action button.
- /// The action button text.
- /// The attached to the action button.
- /// The image of the application.
- /// The application path. To be used in conjunction with type.
- /// Specifies the .
- /// Specifies a if using the type.
- /// Specifies the if a has not been defined.
- /// Specifies the area within the to be regarded as a link. See .
- /// Specifies how the message text should be aligned. See for supported values.
+ /// Displays the close button. If null (default), then the close button will be displayed.
/// One of the System.Windows.Forms.DialogResult values.
private static DialogResult ShowCore(IWin32Window? owner,
- string text, string caption,
- KryptonMessageBoxButtons buttons,
- KryptonMessageBoxIcon icon,
- KryptonMessageBoxDefaultButton defaultButton,
- MessageBoxOptions options,
- HelpInfo? helpInfo, bool? showCtrlCopy,
- bool? showHelpButton,
- bool? showActionButton, string? actionButtonText,
- KryptonCommand? actionButtonCommand,
- Image? applicationImage, string? applicationPath,
- MessageBoxContentAreaType? contentAreaType,
- KryptonCommand? linkLabelCommand,
- ProcessStartInfo? linkLaunchArgument,
- LinkArea? contentLinkArea,
- ContentAlignment? messageTextAlignment)
+ string? text, string? caption,
+ KryptonMessageBoxButtons buttons = KryptonMessageBoxButtons.OK,
+ KryptonMessageBoxIcon icon = KryptonMessageBoxIcon.None,
+ KryptonMessageBoxDefaultButton defaultButton = KryptonMessageBoxDefaultButton.Button4,
+ MessageBoxOptions options = 0,
+ HelpInfo? helpInfo = null,
+ bool? showCtrlCopy = null,
+ bool? showHelpButton = null,
+ bool? showCloseButton = null)
{
caption = string.IsNullOrEmpty(caption) ? @" " : caption;
IWin32Window? showOwner = ValidateOptions(owner, options, helpInfo);
- // Show message box window as a modal dialog and then dispose of it afterwards
- using var kmb = new KryptonMessageBoxForm(showOwner, text, caption, buttons, icon,
- defaultButton, options, helpInfo, showCtrlCopy, showHelpButton,
- showActionButton, actionButtonText,
- actionButtonCommand, applicationImage, applicationPath,
- contentAreaType, linkLabelCommand,
- linkLaunchArgument, contentLinkArea, messageTextAlignment);
+ // Show message box window as a modal dialog and then dispose of it after-wards
+
+ if (options is MessageBoxOptions.RightAlign or MessageBoxOptions.RtlReading)
+ {
+ using var kmbRtl = new VisualMessageBoxRtlAwareForm(showOwner, text, caption, buttons, icon,
+ defaultButton, helpInfo, showCtrlCopy, showHelpButton, showCloseButton);
+
+ kmbRtl.StartPosition = showOwner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
- kmb.StartPosition = showOwner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
+ return kmbRtl.ShowDialog(showOwner);
+ }
+ else
+ {
+ using var kmb = new VisualMessageBoxForm(showOwner, text, caption, buttons, icon,
+ defaultButton, helpInfo, showCtrlCopy, showHelpButton, showCloseButton);
- return kmb.ShowDialog(showOwner);
+ kmb.StartPosition = showOwner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
+
+ return kmb.ShowDialog(showOwner);
+ }
}
#region WinForm Compatibility
@@ -420,16 +421,13 @@ private static DialogResult ShowCore(IWin32Window? owner,
if ((helpInfo != null) ||
((options & (MessageBoxOptions.ServiceNotification | MessageBoxOptions.DefaultDesktopOnly)) == 0))
{
- // If do not have an owner passed in then get the active window and use that instead
+ // If this does not have an owner passed in? then get the active window and use that instead
showOwner = owner ?? Control.FromHandle(PI.GetActiveWindow());
}
return showOwner;
}
-
#endregion
-
-
#endregion
}
}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonMessageBoxDep.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonMessageBoxDep.cs
new file mode 100644
index 000000000..e599ec050
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonMessageBoxDep.cs
@@ -0,0 +1,456 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+// ReSharper disable ClassNeverInstantiated.Global
+// ReSharper disable UnusedMethodReturnValue.Global
+
+namespace Krypton.Toolkit
+{
+ ///
+ /// Displays a message box, that has extended controls.
+ ///
+ [ToolboxItem(false)]
+ [DesignerCategory(@"code")]
+ public static class KryptonMessageBoxDep
+ {
+ #region Public
+
+ ///
+ /// Displays a message box in front+center of the application and with the specified text, caption and buttons.
+ ///
+ /// The text to display in the message box.
+ /// The text to display in the title bar of the message box. default="string.Empty"
+ /// Show extraText in title. If null (default) then only when Warning or Error icon is used.
+ /// Specifies the .
+ /// Specifies a if using the type.
+ /// Specifies the if a has not been defined.
+ /// Specifies the area within the to be regarded as a link. See .
+ /// Displays the close button. If null (default), then the close button will be displayed.
+ /// One of the System.Windows.Forms.DialogResult values.
+ public static DialogResult Show(string text, string caption, bool? showCtrlCopy = null,
+ MessageBoxContentAreaType? contentAreaType = null,
+ KryptonCommand? linkAreaCommand = null,
+ ProcessStartInfo? linkLaunchArgument = null,
+ LinkArea? contentLinkArea = null,
+ bool? showCloseButton = null) =>
+ ShowCore(null, text, caption, KryptonMessageBoxButtons.OK, KryptonMessageBoxIcon.None,
+ KryptonMessageBoxDefaultButton.Button4, 0, null, showCtrlCopy,
+ null, null, @"",
+ contentAreaType, linkAreaCommand, linkLaunchArgument, contentLinkArea, null,
+ showCloseButton);
+
+ ///
+ /// Displays a message box in front+center of the application and with the specified text, caption and buttons.
+ ///
+ /// The text to display in the message box.
+ /// Show extraText in title. If null (default) then only when Warning or Error icon is used.
+ /// Specifies the .
+ /// Specifies a if using the type.
+ /// Specifies the if a has not been defined.
+ /// Specifies the area within the to be regarded as a link. See .
+ /// Displays the close button. If null (default), then the close button will be displayed.
+ /// One of the System.Windows.Forms.DialogResult values.
+ public static DialogResult Show(string text, bool? showCtrlCopy = null,
+ MessageBoxContentAreaType? contentAreaType = null,
+ KryptonCommand? linkAreaCommand = null,
+ ProcessStartInfo? linkLaunchArgument = null,
+ LinkArea? contentLinkArea = null,
+ bool? showCloseButton = null) =>
+ ShowCore(null, text, @"", KryptonMessageBoxButtons.OK, KryptonMessageBoxIcon.None,
+ KryptonMessageBoxDefaultButton.Button4, 0,
+ null, showCtrlCopy, false, null, @"",
+ contentAreaType, linkAreaCommand, linkLaunchArgument,
+ contentLinkArea, null, showCloseButton);
+
+ ///
+ /// Displays a message box in front+center of the specified object and with the specified text, caption, buttons, icon, default button, and options.
+ ///
+ /// Owner of the modal dialog box.
+ /// The text to display in the message box.
+ /// Show extraText in title. If null (default) then only when Warning or Error icon is used.
+ /// Specifies the .
+ /// Specifies a if using the type.
+ /// Specifies the if a has not been defined.
+ /// Specifies the area within the to be regarded as a link. See .
+ /// Displays the close button. If null (default), then the close button will be displayed.
+ /// One of the System.Windows.Forms.DialogResult values.
+ public static DialogResult Show(IWin32Window? owner, string text, bool? showCtrlCopy = null,
+ MessageBoxContentAreaType? contentAreaType = null,
+ KryptonCommand? linkAreaCommand = null,
+ ProcessStartInfo? linkLaunchArgument = null,
+ LinkArea? contentLinkArea = null,
+ bool? showCloseButton = null) =>
+ ShowCore(owner, text, @"", KryptonMessageBoxButtons.OK, KryptonMessageBoxIcon.None,
+ KryptonMessageBoxDefaultButton.Button4, 0, null, showCtrlCopy,
+ false,
+ null, @"",
+ contentAreaType, linkAreaCommand, linkLaunchArgument, contentLinkArea,
+ null, showCloseButton);
+
+ ///
+ /// Displays a message box in front+center of the specified object and with the specified text, caption, buttons, icon, default button, and options.
+ ///
+ /// Owner of the modal dialog box.
+ /// The text to display in the message box.
+ /// The text to display in the title bar of the message box. default="string.Empty"
+ /// Show extraText in title. If null (default) then only when Warning or Error icon is used.
+ /// Specifies the .
+ /// Specifies a if using the type.
+ /// Specifies the if a has not been defined.
+ /// Specifies the area within the to be regarded as a link. See .
+ /// Displays the close button. If null (default), then the close button will be displayed.
+ /// One of the System.Windows.Forms.DialogResult values.
+ public static DialogResult Show(IWin32Window? owner, string? text, string caption, bool? showCtrlCopy = null,
+ MessageBoxContentAreaType? contentAreaType = null,
+ KryptonCommand? linkAreaCommand = null,
+ ProcessStartInfo? linkLaunchArgument = null,
+ LinkArea? contentLinkArea = null,
+ bool? showCloseButton = null) =>
+ ShowCore(owner, text, caption, KryptonMessageBoxButtons.OK, KryptonMessageBoxIcon.None,
+ KryptonMessageBoxDefaultButton.Button4, 0, null, showCtrlCopy,
+ false,
+ null, @"",
+ contentAreaType, linkAreaCommand, linkLaunchArgument, contentLinkArea,
+ null, showCloseButton);
+
+ ///
+ /// Displays a message box in front+center of the application and with the specified text, caption and buttons.
+ ///
+ /// The text to display in the message box.
+ /// The text to display in the title bar of the message box. default="string.Empty"
+ /// One of the System.Windows.Forms.KryptonMessageBoxButtons values that specifies which buttons to display in the message box.
+ /// Show extraText in title. If null (default) then only when Warning or Error icon is used.
+ /// Specifies the .
+ /// Specifies a if using the type.
+ /// Specifies the if a has not been defined.
+ /// Specifies the area within the to be regarded as a link. See .
+ /// Displays the close button. If null (default), then the close button will be displayed.
+ /// One of the System.Windows.Forms.DialogResult values.
+ public static DialogResult Show(string text, string caption, KryptonMessageBoxButtons buttons,
+ bool? showCtrlCopy = null,
+ MessageBoxContentAreaType? contentAreaType = null,
+ KryptonCommand? linkAreaCommand = null,
+ ProcessStartInfo? linkLaunchArgument = null,
+ LinkArea? contentLinkArea = null,
+ bool? showCloseButton = null) =>
+ ShowCore(null, text, caption, buttons, KryptonMessageBoxIcon.None,
+ KryptonMessageBoxDefaultButton.Button1, 0,
+ new HelpInfo(@"", 0, null), showCtrlCopy,
+ null, null, @"",
+ contentAreaType, linkAreaCommand, linkLaunchArgument,
+ contentLinkArea, null,
+ showCloseButton);
+
+ ///
+ /// Displays a message box in front+center of the application and with the specified text, caption, buttons, icon, default button, and options.
+ ///
+ /// The text to display in the message box.
+ /// The text to display in the title bar of the message box. default="string.Empty"
+ /// One of the System.Windows.Forms.KryptonMessageBoxButtons values that specifies which buttons to display in the message box.
+ /// One of the KryptonMessageBoxIcon values that specifies which icon to display in the message box.
+ /// One of the KryptonMessageBoxDefaultButton values that specifies the default button for the message box.
+ /// One of the System.Windows.Forms.MessageBoxOptions values that specifies which display and association options will be used for the message box. You may pass in 0 if you wish to use the defaults.
+ /// Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button.
+ /// Show extraText in title. If null (default) then only when Warning or Error icon is used.
+ /// Displays a 'Help' button, as seen in .NET 6 and higher.
+ /// The image of the application.
+ /// The application path. To be used in conjunction with type.
+ /// Specifies the .
+ /// Specifies a if using the type.
+ /// Specifies the if a has not been defined.
+ /// Specifies the area within the to be regarded as a link. See .
+ /// If set to true, the will use standard operating system icons.
+ /// Displays the close button. If null (default), then the close button will be displayed.
+ /// One of the System.Windows.Forms.DialogResult values.
+ public static DialogResult Show(string text, string caption, KryptonMessageBoxButtons buttons,
+ KryptonMessageBoxIcon icon,
+ KryptonMessageBoxDefaultButton defaultButton = KryptonMessageBoxDefaultButton.Button4,
+ MessageBoxOptions options = 0, bool displayHelpButton = false,
+ bool? showCtrlCopy = null, bool? showHelpButton = null,
+ ProcessStartInfo? linkLaunchArgument = null, Image? applicationImage = null,
+ string applicationPath = @"",
+ MessageBoxContentAreaType? contentAreaType = null,
+ KryptonCommand? linkAreaCommand = null,
+ LinkArea? contentLinkArea = null,
+ bool? forceUseOfOperatingSystemIcons = null,
+ bool? showCloseButton = null)
+ =>
+ ShowCore(null, text, caption, buttons, icon, defaultButton, options,
+ displayHelpButton ? new HelpInfo() : null, showCtrlCopy,
+ showHelpButton, applicationImage, applicationPath,
+ contentAreaType, linkAreaCommand, linkLaunchArgument,
+ contentLinkArea, forceUseOfOperatingSystemIcons, showCloseButton);
+
+
+ ///
+ /// Displays a message box in front+center of the specified object and with the specified text, caption, buttons, icon, default button, and options.
+ ///
+ /// Owner of the modal dialog box.
+ /// The text to display in the message box.
+ /// The text to display in the title bar of the message box. default="string.Empty"
+ /// One of the System.Windows.Forms.KryptonMessageBoxButtons values that specifies which buttons to display in the message box.
+ /// One of the KryptonMessageBoxIcon values that specifies which icon to display in the message box.
+ /// One of the KryptonMessageBoxDefaultButton values that specifies the default button for the message box.
+ /// One of the System.Windows.Forms.MessageBoxOptions values that specifies which display and association options will be used for the message box. You may pass in 0 if you wish to use the defaults.
+ /// Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button.
+ /// Show extraText in title. If null (default) then only when Warning or Error icon is used.
+ /// Displays a 'Help' button, as seen in .NET 6 and higher.
+ /// The image of the application.
+ /// The application path. To be used in conjunction with type.
+ /// Specifies the .
+ /// Specifies a if using the type.
+ /// Specifies the if a has not been defined.
+ /// Specifies the area within the to be regarded as a link. See .
+ /// If set to true, the will use standard operating system icons.
+ /// Displays the close button. If null (default), then the close button will be displayed.
+ /// One of the System.Windows.Forms.DialogResult values.
+ public static DialogResult Show(IWin32Window? owner, string text, string caption,
+ KryptonMessageBoxButtons buttons, KryptonMessageBoxIcon icon,
+ KryptonMessageBoxDefaultButton defaultButton = KryptonMessageBoxDefaultButton.Button4,
+ MessageBoxOptions options = 0, bool displayHelpButton = false,
+ bool? showCtrlCopy = null, bool? showHelpButton = null, Image? applicationImage = null,
+ string applicationPath = @"",
+ MessageBoxContentAreaType? contentAreaType = null,
+ KryptonCommand? linkAreaCommand = null,
+ ProcessStartInfo? linkLaunchArgument = null,
+ LinkArea? contentLinkArea = null,
+ bool? forceUseOfOperatingSystemIcons = null,
+ bool? showCloseButton = null)
+ =>
+ ShowCore(owner, text, caption, buttons, icon, defaultButton, options,
+ displayHelpButton ? new HelpInfo() : null, showCtrlCopy,
+ showHelpButton, applicationImage, applicationPath,
+ contentAreaType, linkAreaCommand, linkLaunchArgument,
+ contentLinkArea, forceUseOfOperatingSystemIcons,
+ showCloseButton);
+
+ /// The text to display in the message box.
+ /// The text to display in the title bar of the message box. default="string.Empty"
+ /// One of the System.Windows.Forms.KryptonMessageBoxButtons values that specifies which buttons to display in the message box.
+ /// One of the KryptonMessageBoxIcon values that specifies which icon to display in the message box.
+ /// One of the KryptonMessageBoxDefaultButton values that specifies the default button for the message box.
+ /// One of the System.Windows.Forms.MessageBoxOptions values that specifies which display and association options will be used for the message box. You may pass in 0 if you wish to use the defaults.
+ /// The path and name of the Help file to display when the user clicks the Help button.
+ /// One of the System.Windows.Forms.HelpNavigator values.
+ /// The numeric ID of the Help topic to display when the user clicks the Help button.
+ /// Show extraText in title. If null (default) then only when Warning or Error icon is used.
+ /// Displays a 'Help' button, as seen in .NET 6 and higher.
+ /// The image of the application.
+ /// The application path. To be used in conjunction with type.
+ /// Specifies the .
+ /// Specifies a if using the type.
+ /// Specifies the if a has not been defined.
+ /// Specifies the area within the to be regarded as a link. See .
+ /// If set to true, the will use standard operating system icons.
+ /// Displays the close button. If null (default), then the close button will be displayed.
+ /// One of the System.Windows.Forms.DialogResult values.
+ public static DialogResult Show(string text, string caption, KryptonMessageBoxButtons buttons,
+ KryptonMessageBoxIcon icon, KryptonMessageBoxDefaultButton defaultButton,
+ MessageBoxOptions options, string helpFilePath,
+ HelpNavigator navigator, object? param, bool? showCtrlCopy = null,
+ bool? showHelpButton = null,
+ Image? applicationImage = null, string applicationPath = @"",
+ MessageBoxContentAreaType? contentAreaType = null,
+ KryptonCommand? linkAreaCommand = null,
+ ProcessStartInfo? linkLaunchArgument = null,
+ LinkArea? contentLinkArea = null,
+ bool? forceUseOfOperatingSystemIcons = null,
+ bool? showCloseButton = null)
+ => ShowCore(null, text, caption, buttons, icon, defaultButton, options,
+ new HelpInfo(helpFilePath, navigator, param), showCtrlCopy,
+ showHelpButton, applicationImage, applicationPath,
+ contentAreaType, linkAreaCommand, linkLaunchArgument,
+ contentLinkArea, forceUseOfOperatingSystemIcons,
+ showCloseButton);
+
+ ///
+ /// Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file, HelpNavigator, and Help topic.
+ ///
+ /// Owner of the modal dialog box.
+ /// The text to display in the message box.
+ /// The text to display in the title bar of the message box.
+ /// One of the System.Windows.Forms.KryptonMessageBoxButtons values that specifies which buttons to display in the message box.
+ /// One of the KryptonMessageBoxIcon values that specifies which icon to display in the message box.
+ /// One of the KryptonMessageBoxDefaultButton values that specifies the default button for the message box.
+ /// One of the System.Windows.Forms.MessageBoxOptions values that specifies which display and association options will be used for the message box. You may pass in 0 if you wish to use the defaults.
+ /// The path and name of the Help file to display when the user clicks the Help button.
+ /// One of the System.Windows.Forms.HelpNavigator values.
+ /// The numeric ID of the Help topic to display when the user clicks the Help button.
+ /// Show extraText in title. If null (default) then only when Warning or Error icon is used.
+ /// Displays a 'Help' button, as seen in .NET 6 and higher.
+ /// The image of the application.
+ /// The application path. To be used in conjunction with type.
+ /// Specifies the .
+ /// Specifies a if using the type.
+ /// Specifies the if a has not been defined.
+ /// Specifies the area within the to be regarded as a link. See .
+ /// If set to true, the will use standard operating system icons.
+ /// Displays the close button. If null (default), then the close button will be displayed.
+ /// One of the System.Windows.Forms.DialogResult values.
+ public static DialogResult Show(IWin32Window? owner, string text, string caption,
+ KryptonMessageBoxButtons buttons,
+ KryptonMessageBoxIcon icon,
+ KryptonMessageBoxDefaultButton defaultButton,
+ MessageBoxOptions options,
+ string helpFilePath, HelpNavigator navigator,
+ object? param, bool? showCtrlCopy = null,
+ bool? showHelpButton = null,
+ Image? applicationImage = null,
+ string applicationPath = @"",
+ MessageBoxContentAreaType? contentAreaType = null,
+ KryptonCommand? linkAreaCommand = null,
+ ProcessStartInfo? linkLaunchArgument = null,
+ LinkArea? contentLinkArea = null,
+ bool? forceUseOfOperatingSystemIcons = null,
+ bool? showCloseButton = null)
+ => ShowCore(owner, text, caption, buttons, icon, defaultButton, options,
+ new HelpInfo(helpFilePath, navigator, param),
+ showCtrlCopy, showHelpButton, applicationImage,
+ applicationPath, contentAreaType, linkAreaCommand,
+ linkLaunchArgument, contentLinkArea, forceUseOfOperatingSystemIcons, showCloseButton);
+
+ /// Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file, HelpNavigator, and Help topic.
+ /// The message box data.
+ /// One of the System.Windows.Forms.DialogResult values.
+ public static DialogResult Show(KryptonMessageBoxDataDep messageBoxData) => ShowCore(messageBoxData);
+
+ #endregion
+
+ #region Implementation
+ ///
+ /// Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file, HelpNavigator, and Help topic.
+ ///
+ /// Owner of the modal dialog box.
+ /// The text to display in the message box.
+ /// The text to display in the title bar of the message box.
+ /// One of the System.Windows.Forms.KryptonMessageBoxButtons values that specifies which buttons to display in the message box.
+ /// One of the KryptonMessageBoxIcon values that specifies which icon to display in the message box.
+ /// One of the KryptonMessageBoxDefaultButton values that specifies the default button for the message box.
+ /// One of the System.Windows.Forms.MessageBoxOptions values that specifies which display and association options will be used for the message box. You may pass in 0 if you wish to use the defaults.
+ /// Contains the help data of the .
+ /// Show extraText in title. If null (default) then only when Warning or Error icon is used.
+ /// Displays a 'Help' button, as seen in .NET 6 and higher.
+ /// The image of the application.
+ /// The application path. To be used in conjunction with type.
+ /// Specifies the .
+ /// Specifies a if using the type.
+ /// Specifies the if a has not been defined.
+ /// Specifies the area within the to be regarded as a link. See .
+ /// If set to true, the will use standard operating system icons.
+ /// Displays the close button. If null (default), then the close button will be displayed.
+ /// One of the System.Windows.Forms.DialogResult values.
+ private static DialogResult ShowCore(IWin32Window? owner,
+ string? text, string? caption,
+ KryptonMessageBoxButtons buttons,
+ KryptonMessageBoxIcon icon,
+ KryptonMessageBoxDefaultButton defaultButton,
+ MessageBoxOptions options,
+ HelpInfo? helpInfo, bool? showCtrlCopy,
+ bool? showHelpButton,
+ Image? applicationImage, string? applicationPath,
+ MessageBoxContentAreaType? contentAreaType,
+ KryptonCommand? linkLabelCommand,
+ ProcessStartInfo? linkLaunchArgument,
+ LinkArea? contentLinkArea,
+ bool? forceUseOfOperatingSystemIcons,
+ bool? showCloseButton)
+ {
+ caption = string.IsNullOrEmpty(caption) ? @" " : caption;
+
+ IWin32Window? showOwner = ValidateOptions(owner, options, helpInfo);
+
+ // Show message box window as a modal dialog and then dispose of it after-wards
+
+ if (options is MessageBoxOptions.RightAlign or MessageBoxOptions.RtlReading)
+ {
+ using var kmbrtl = new VisualMessageBoxRtlAwareFormDep(showOwner, text, caption, buttons, icon,
+ defaultButton, helpInfo, showCtrlCopy, showHelpButton, applicationImage, applicationPath,
+ contentAreaType, linkLabelCommand,
+ linkLaunchArgument, contentLinkArea,
+ forceUseOfOperatingSystemIcons, showCloseButton);
+
+ kmbrtl.StartPosition = showOwner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
+
+ return kmbrtl.ShowDialog(showOwner);
+ }
+ else
+ {
+ using var kmb = new VisualMessageBoxFormDep(showOwner, text, caption, buttons, icon,
+ defaultButton, helpInfo, showCtrlCopy, showHelpButton, applicationImage, applicationPath,
+ contentAreaType, linkLabelCommand,
+ linkLaunchArgument, contentLinkArea,
+ forceUseOfOperatingSystemIcons, showCloseButton);
+
+ kmb.StartPosition = showOwner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
+
+ return kmb.ShowDialog(showOwner);
+ }
+ }
+
+ private static DialogResult ShowCore(KryptonMessageBoxDataDep messageBoxData)
+ {
+ messageBoxData.Caption = string.IsNullOrEmpty(messageBoxData.Caption) ? @" " : messageBoxData.Caption;
+
+ IWin32Window? showOwner = ValidateOptions(messageBoxData.Owner, messageBoxData.Options, messageBoxData.HelpInfo);
+
+ if (messageBoxData.Options is MessageBoxOptions.RightAlign or MessageBoxOptions.RtlReading)
+ {
+ using var kmbrtl = new VisualMessageBoxRtlAwareFormDep(messageBoxData);
+
+ kmbrtl.StartPosition = showOwner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
+
+ return kmbrtl.ShowDialog(showOwner);
+ }
+ else
+ {
+ using var kmb = new VisualMessageBoxFormDep(messageBoxData);
+
+ kmb.StartPosition = showOwner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
+
+ return kmb.ShowDialog(showOwner);
+ }
+ }
+
+ #region WinForm Compatibility
+ private static IWin32Window? ValidateOptions(IWin32Window? owner, MessageBoxOptions options, HelpInfo? helpInfo)
+ {
+ // Check if trying to show a message box from a non-interactive process, this is not possible
+ if (!SystemInformation.UserInteractive &&
+ ((options & (MessageBoxOptions.ServiceNotification | MessageBoxOptions.DefaultDesktopOnly)) == 0))
+ {
+ throw new InvalidOperationException("Cannot show modal dialog when non-interactive");
+ }
+
+ // Check if trying to show a message box from a service and the owner has been specified, this is not possible
+ if ((owner != null) &&
+ ((options & (MessageBoxOptions.ServiceNotification | MessageBoxOptions.DefaultDesktopOnly)) != 0))
+ {
+ throw new ArgumentException(@"Cannot show message box from a service with an owner specified", nameof(options));
+ }
+
+ // Check if trying to show a message box from a service and help information is specified, this is not possible
+ if ((helpInfo != null) &&
+ ((options & (MessageBoxOptions.ServiceNotification | MessageBoxOptions.DefaultDesktopOnly)) != 0))
+ {
+ throw new ArgumentException(@"Cannot show message box from a service with help specified", nameof(options));
+ }
+
+ IWin32Window? showOwner = null;
+ if ((helpInfo != null) ||
+ ((options & (MessageBoxOptions.ServiceNotification | MessageBoxOptions.DefaultDesktopOnly)) == 0))
+ {
+ // If do not have an owner passed in? then get the active window and use that instead
+ showOwner = owner ?? Control.FromHandle(PI.GetActiveWindow());
+ }
+
+ return showOwner;
+ }
+ #endregion
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonMonthCalendar.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonMonthCalendar.cs
index b386e6984..49c43730b 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonMonthCalendar.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonMonthCalendar.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -29,7 +29,7 @@ public class KryptonMonthCalendar : VisualSimpleBase,
#region Instance Fields
private readonly ViewDrawDocker _drawDocker;
- private readonly ViewLayoutMonths _drawMonths;
+ private readonly ViewLayoutMonths? _drawMonths;
private readonly PaletteTripleOverride _boldedDisabled;
private readonly PaletteTripleOverride _boldedNormal;
private readonly PaletteTripleOverride _boldedTracking;
@@ -60,11 +60,6 @@ public class KryptonMonthCalendar : VisualSimpleBase,
private int _maxSelectionCount;
private int _scrollChange;
private bool _hasFocus;
- private float _cornerRoundingRadius;
- private float _dayCornerRoundingRadius;
- private float _dayOfWeekCornerRoundingRadius;
- private float _headerCornerRoundingRadius;
-
#endregion
#region Events
@@ -75,6 +70,11 @@ public class KryptonMonthCalendar : VisualSimpleBase,
[Description(@"Occurs when the selected date changes.")]
public event DateRangeEventHandler? DateChanged;
+ /// Occurs when the date is selected.
+ [Category(@"Action")]
+ [Description(@"Occurs when the date is selected.")]
+ public event DateRangeEventHandler? DateSelected;
+
///
/// Occurs when the selected start date changes.
///
@@ -235,70 +235,32 @@ public KryptonMonthCalendar()
_maxDate = DateTimePicker.MaximumDateTime;
_maxSelectionCount = 7;
AnnuallyBoldedDatesMask = new int[12];
- _annualDates = new DateTimeList();
- _monthlyDates = new DateTimeList();
- BoldedDatesList = new DateTimeList();
+ _annualDates = [];
+ _monthlyDates = [];
+ BoldedDatesList = [];
_scrollChange = 0;
_todayFormat = "d";
-
- _cornerRoundingRadius = GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
- _dayCornerRoundingRadius = GlobalStaticValues.SECONDARY_CORNER_ROUNDING_VALUE;
-
- _dayOfWeekCornerRoundingRadius = GlobalStaticValues.SECONDARY_CORNER_ROUNDING_VALUE;
-
- _headerCornerRoundingRadius = GlobalStaticValues.SECONDARY_CORNER_ROUNDING_VALUE;
}
#endregion
#region Public
-
- /// Gets or sets the corner rounding radius.
- /// The corner rounding radius.
- [Category(@"Visuals")]
- [Description(@"Gets or sets the corner rounding radius.")]
- [DefaultValue(GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE)]
- public float CornerRoundingRadius
- {
- get => _cornerRoundingRadius;
-
- set => SetCornerRoundingRadius(value);
- }
-
- /// Gets or sets the day corner rounding radius.
- /// The day corner rounding radius.
- [Category(@"Visuals")]
- [Description(@"Gets or sets the day corner rounding radius.")]
- [DefaultValue(GlobalStaticValues.SECONDARY_CORNER_ROUNDING_VALUE)]
- public float DayCornerRoundingRadius
- {
- get => _dayCornerRoundingRadius;
-
- set => SetDayCornerRoundingRadius(value);
- }
-
- /// Gets or sets the day of week corner rounding radius.
- /// The day of week corner rounding radius.
- [Category(@"Visuals")]
- [Description(@"Gets or sets the day of week corner rounding radius.")]
- [DefaultValue(GlobalStaticValues.SECONDARY_CORNER_ROUNDING_VALUE)]
- public float DayOfWeekCornerRoundingRadius
+ ///
+ /// Sets date as the current selected date. The start and begin of
+ /// the selection range will both be equal to date.
+ ///
+ public void SetDate(DateTime date)
{
- get => _dayOfWeekCornerRoundingRadius;
-
- set => SetDayOfWeekCornerRoundingRadius(value);
- }
+ if (date.Ticks < _minDate.Ticks)
+ {
+ throw new ArgumentOutOfRangeException(nameof(date), date, string.Format(@"Value of '{1}' is not valid for '{0}'. '{0}' must be greater than or equal to {2}.", nameof(date), FormatDate(date), nameof(MinDate)));
+ }
- /// Gets or sets the header corner rounding radius.
- /// The header corner rounding radius.
- [Category(@"Visuals")]
- [Description(@"Gets or sets the header corner rounding radius.")]
- [DefaultValue(GlobalStaticValues.SECONDARY_CORNER_ROUNDING_VALUE)]
- public float HeaderCornerRoundingRadius
- {
- get => _headerCornerRoundingRadius;
+ if (date.Ticks > _maxDate.Ticks)
+ {
+ throw new ArgumentOutOfRangeException(nameof(date), date, string.Format(@"Value of '{1}' is not valid for '{0}'. '{0}' must be less than or equal to {2}.", nameof(date), FormatDate(date), nameof(MaxDate)));
+ }
- set => SetHeaderCornerRoundingRadius(value);
+ SetSelectionRange(date, date);
}
///
@@ -396,13 +358,14 @@ public DateTime MinDate
[DefaultValue("d")]
[RefreshProperties(RefreshProperties.Repaint)]
[Localizable(true)]
+ [DisallowNull]
public string TodayFormat
{
get => _todayFormat;
set
{
- if ((_todayFormat != value) && (value != null))
+ if (_todayFormat != value)
{
_todayFormat = value;
PerformNeedPaint(true);
@@ -437,17 +400,13 @@ public int ScrollChange
///
[Category(@"Behavior")]
[Description(@"Today's date.")]
+ [DisallowNull]
public DateTime TodayDate
{
get => _todayDate;
set
{
- if (value == null)
- {
- value = DateTime.Now.Date;
- }
-
_todayDate = value;
PerformNeedPaint(true);
}
@@ -462,7 +421,8 @@ public DateTime TodayDate
///
[Localizable(true)]
[Description(@"Indicates which annual dates should be boldface.")]
- public DateTime[] AnnuallyBoldedDates
+ [AllowNull]
+ public DateTime[]? AnnuallyBoldedDates
{
get => _annualDates.ToArray();
@@ -497,7 +457,8 @@ public DateTime[] AnnuallyBoldedDates
///
[Localizable(true)]
[Description(@"Indicates which monthly dates should be boldface.")]
- public DateTime[] MonthlyBoldedDates
+ [AllowNull]
+ public DateTime[]? MonthlyBoldedDates
{
get => _monthlyDates.ToArray();
@@ -528,7 +489,8 @@ public DateTime[] MonthlyBoldedDates
///
[Localizable(true)]
[Description(@"Indicates which dates should be boldface.")]
- public DateTime[] BoldedDates
+ [AllowNull]
+ public DateTime[]? BoldedDates
{
get => BoldedDatesList.ToArray();
@@ -903,10 +865,7 @@ public ButtonStyle DayOfWeekStyle
}
}
}
-
private bool ShouldSerializeDayOfWeekStyle() => _dayOfWeekStyle != ButtonStyle.CalendarDay;
-
-
private void ResetDayOfWeekStyle() => DayOfWeekStyle = ButtonStyle.CalendarDay;
///
@@ -917,11 +876,11 @@ public ButtonStyle DayOfWeekStyle
[DefaultValue(true)]
public bool ShowToday
{
- get => _drawMonths.ShowToday;
+ get => _drawMonths!.ShowToday;
set
{
- if (_drawMonths.ShowToday != value)
+ if (_drawMonths!.ShowToday != value)
{
_drawMonths.ShowToday = value;
PerformNeedPaint(true);
@@ -937,11 +896,11 @@ public bool ShowToday
[DefaultValue(true)]
public bool ShowTodayCircle
{
- get => _drawMonths.ShowTodayCircle;
+ get => _drawMonths!.ShowTodayCircle;
set
{
- if (_drawMonths.ShowTodayCircle != value)
+ if (_drawMonths!.ShowTodayCircle != value)
{
_drawMonths.ShowTodayCircle = value;
PerformNeedPaint(true);
@@ -957,11 +916,11 @@ public bool ShowTodayCircle
[DefaultValue(false)]
public bool ShowWeekNumbers
{
- get => _drawMonths.ShowWeekNumbers;
+ get => _drawMonths!.ShowWeekNumbers;
set
{
- if (_drawMonths.ShowWeekNumbers != value)
+ if (_drawMonths!.ShowWeekNumbers != value)
{
_drawMonths.ShowWeekNumbers = value;
PerformNeedPaint(true);
@@ -976,7 +935,6 @@ public bool ShowWeekNumbers
[Description(@"Overrides for defining month calendar appearance when it has focus.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public PaletteMonthCalendarStateRedirect OverrideFocus { get; }
-
private bool ShouldSerializeOverrideFocus() => !OverrideFocus.IsDefault;
///
@@ -986,7 +944,6 @@ public bool ShowWeekNumbers
[Description(@"Overrides for defining month calendar appearance when it is bolded.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public PaletteMonthCalendarStateRedirect OverrideBolded { get; }
-
private bool ShouldSerializeOverrideBolded() => !OverrideBolded.IsDefault;
///
@@ -996,7 +953,6 @@ public bool ShowWeekNumbers
[Description(@"Overrides for defining month calendar appearance when it is today.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public PaletteMonthCalendarStateRedirect OverrideToday { get; }
-
private bool ShouldSerializeOverrideToday() => !OverrideToday.IsDefault;
///
@@ -1005,8 +961,7 @@ public bool ShowWeekNumbers
[Category(@"Visuals")]
[Description(@"Overrides for defining common month calendar appearance that other states can override.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public PaletteMonthCalendarRedirect? StateCommon { get; }
-
+ public PaletteMonthCalendarRedirect StateCommon { get; }
private bool ShouldSerializeStateCommon() => !StateCommon.IsDefault;
///
@@ -1016,7 +971,6 @@ public bool ShowWeekNumbers
[Description(@"Overrides for defining month calendar disabled appearance.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public PaletteMonthCalendarDoubleState StateDisabled { get; }
-
private bool ShouldSerializeStateDisabled() => !StateDisabled.IsDefault;
///
@@ -1026,7 +980,6 @@ public bool ShowWeekNumbers
[Description(@"Overrides for defining month calendar normal appearance.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public PaletteMonthCalendarDoubleState StateNormal { get; }
-
private bool ShouldSerializeStateNormal() => !StateNormal.IsDefault;
///
@@ -1036,7 +989,6 @@ public bool ShowWeekNumbers
[Description(@"Overrides for defining tracking month calendar appearance.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public PaletteMonthCalendarState StateTracking { get; }
-
private bool ShouldSerializeStateTracking() => !StateTracking.IsDefault;
///
@@ -1046,7 +998,6 @@ public bool ShowWeekNumbers
[Description(@"Overrides for defining pressed month calendar appearance.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public PaletteMonthCalendarState StatePressed { get; }
-
private bool ShouldSerializeStatePressed() => !StatePressed.IsDefault;
///
@@ -1056,7 +1007,6 @@ public bool ShowWeekNumbers
[Description(@"Overrides for defining checked normal month calendar appearance.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public PaletteMonthCalendarState StateCheckedNormal { get; }
-
private bool ShouldSerializeStateCheckedNormal() => !StateCheckedNormal.IsDefault;
///
@@ -1066,7 +1016,6 @@ public bool ShowWeekNumbers
[Description(@"Overrides for defining checked tracking month calendar appearance.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public PaletteMonthCalendarState StateCheckedTracking { get; }
-
private bool ShouldSerializeStateCheckedTracking() => !StateCheckedTracking.IsDefault;
///
@@ -1076,7 +1025,6 @@ public bool ShowWeekNumbers
[Description(@"Overrides for defining checked pressed month calendar appearance.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public PaletteMonthCalendarState StateCheckedPressed { get; }
-
private bool ShouldSerializeStateCheckedPressed() => !StateCheckedPressed.IsDefault;
///
@@ -1085,7 +1033,7 @@ public bool ShowWeekNumbers
[Category(@"Visuals")]
[Description(@"Collection of button specifications.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public MonthCalendarButtonSpecCollection ButtonSpecs => _drawMonths.ButtonSpecs;
+ public MonthCalendarButtonSpecCollection ButtonSpecs => _drawMonths!.ButtonSpecs;
///
/// Gets and sets a value indicating if tooltips should be Displayed for button specs.
@@ -1095,8 +1043,8 @@ public bool ShowWeekNumbers
[DefaultValue(false)]
public bool AllowButtonSpecToolTips
{
- get => _drawMonths.AllowButtonSpecToolTips;
- set => _drawMonths.AllowButtonSpecToolTips = value;
+ get => _drawMonths!.AllowButtonSpecToolTips;
+ set => _drawMonths!.AllowButtonSpecToolTips = value;
}
///
@@ -1173,7 +1121,6 @@ public void RemoveAllMonthlyBoldedDates()
PerformNeedPaint(true);
}
-
///
/// Gets access to the owning control
///
@@ -1297,15 +1244,19 @@ public void SetSelectionRange(DateTime start, DateTime end)
end = start;
}
+ // If the range exceeds maxSelectionCount, compare with the previous range and adjust whichever
+ // limit hasn't changed.
TimeSpan span = end - start;
if (span.Days >= _maxSelectionCount)
{
if (start.Ticks == _selectionStart.Ticks)
{
+ // Bring start date forward
start = end.AddDays(1 - _maxSelectionCount);
}
else
{
+ // Bring end date back
end = start.AddDays(_maxSelectionCount - 1);
}
}
@@ -1403,9 +1354,9 @@ public bool DesignerGetHitTest(Point pt)
/// Mouse location.
[EditorBrowsable(EditorBrowsableState.Never)]
[Browsable(false)]
- public Component DesignerComponentFromPoint(Point pt) =>
+ public Component? DesignerComponentFromPoint(Point pt) =>
// Ignore call as view builder is already destructed
- IsDisposed ? null : ViewManager.ComponentFromPoint(pt);
+ IsDisposed ? null : ViewManager?.ComponentFromPoint(pt);
// Ask the current view for a decision
///
@@ -1426,10 +1377,10 @@ public void DesignerMouseLeave() =>
///
/// Source of notification.
/// An EventArgs containing event data.
- protected override void OnButtonSpecChanged(object sender, EventArgs e)
+ protected override void OnButtonSpecChanged(object? sender, EventArgs e)
{
// Recreate all the button specs with new values
- _drawMonths.RecreateButtons();
+ _drawMonths?.RecreateButtons();
// Let base class perform standard processing
base.OnButtonSpecChanged(sender, e);
@@ -1464,7 +1415,7 @@ protected override void OnKeyDown(KeyEventArgs e)
// Cannot process a message for a disposed control
if (!IsDisposed && !Disposing)
{
- if (_drawMonths.ProcessKeyDown(this, e))
+ if (_drawMonths!.ProcessKeyDown(this, e))
{
return;
}
@@ -1480,6 +1431,8 @@ protected override void OnKeyDown(KeyEventArgs e)
/// An EventArgs that contains the event data.
protected virtual void OnDateChanged(DateRangeEventArgs e) => DateChanged?.Invoke(this, e);
+ protected virtual void OnDateSelected(DateRangeEventArgs e) => DateSelected?.Invoke(this, e);
+
///
/// Raises when the SelectionStartChanged event.
///
@@ -1529,9 +1482,9 @@ protected override void OnLostFocus(EventArgs e)
/// Raises the Paint event.
///
/// An PaintEventArgs that contains the event data.
- protected override void OnPaint(PaintEventArgs e)
+ protected override void OnPaint(PaintEventArgs? e)
{
- Paint?.Invoke(this, e);
+ Paint?.Invoke(this, e!);
base.OnPaint(e);
}
@@ -1643,7 +1596,7 @@ protected override void OnEnabledChanged(EventArgs e)
{
// Update view elements
_drawDocker.Enabled = Enabled;
- _drawMonths.Enabled = Enabled;
+ _drawMonths!.Enabled = Enabled;
// Change in enabled state requires a layout and repaint
PerformNeedPaint(true);
@@ -1693,6 +1646,13 @@ protected override void SetBoundsCore(int x, int y, int width, int height, Bound
#endregion
#region Private
+ ///
+ /// Return a localized string representation of the given DateTime value.
+ /// Used for throwing exceptions, etc.
+ ///
+ private static string FormatDate(DateTime value)
+ => value.ToString("d", CultureInfo.CurrentCulture);
+
private DateTime EffectiveMaxDate(DateTime maxDate)
{
DateTime maximumDateTime = DateTimePicker.MaximumDateTime;
@@ -1712,7 +1672,7 @@ private void AdjustSize(ref int width, ref int height)
Size backBorderSize = _drawDocker.GetNonChildSize(context);
// Ask for the size needed to draw a single month
- Size singleMonthSize = _drawMonths.GetSingleMonthSize(context);
+ Size singleMonthSize = _drawMonths!.GetSingleMonthSize(context);
// How many full months can be fit in each dimension (with a minimum of 1 month showing)
var gap = ViewLayoutMonths.GAP;
@@ -1781,6 +1741,8 @@ private void SetRange()
OnDateChanged(new DateRangeEventArgs(_selectionStart, _selectionEnd));
}
+ OnDateSelected(new DateRangeEventArgs(minDate, maxDate));
+
SetFocusDay();
}
@@ -1842,37 +1804,5 @@ private void SetFocusDay()
private void UpdateFocusOverride(bool focus) => _hasFocus = focus;
#endregion
-
- #region Implementation
-
- private void SetCornerRoundingRadius(float? radius)
- {
- _cornerRoundingRadius = radius ?? GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
- StateCommon.Border.Rounding = _cornerRoundingRadius;
- }
-
- private void SetDayCornerRoundingRadius(float? radius)
- {
- _dayCornerRoundingRadius = radius ?? GlobalStaticValues.SECONDARY_CORNER_ROUNDING_VALUE;
-
- StateCommon.Day.Border.Rounding = _dayCornerRoundingRadius;
- }
-
- private void SetDayOfWeekCornerRoundingRadius(float? radius)
- {
- _dayOfWeekCornerRoundingRadius = radius ?? GlobalStaticValues.SECONDARY_CORNER_ROUNDING_VALUE;
-
- StateCommon.DayOfWeek.Border.Rounding = _dayOfWeekCornerRoundingRadius;
- }
-
- private void SetHeaderCornerRoundingRadius(float? radius)
- {
- _headerCornerRoundingRadius = radius ?? GlobalStaticValues.SECONDARY_CORNER_ROUNDING_VALUE;
-
- StateCommon.Header.Border.Rounding = _headerCornerRoundingRadius;
- }
-
- #endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonMultilineStringEditor.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonMultilineStringEditor.cs
new file mode 100644
index 000000000..e387256c1
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonMultilineStringEditor.cs
@@ -0,0 +1,72 @@
+#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. 2023 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+namespace Krypton.Toolkit
+{
+ /// Public API to display the .
+ public class KryptonMultilineStringEditor
+ {
+ #region Public
+
+ /// Shows a new with default options.
+ /// A new with default data.
+ public static DialogResult Show() => ShowCore(null, null, null, null, null);
+
+ /// Shows a new with specified options.
+ /// The string contents array.
+ /// A new with specified data.
+ public static DialogResult Show(string[]? contents) => ShowCore(contents, null, null, null, null);
+
+ /// Shows a new with specified options.
+ /// The string contents array.
+ /// The use rich text box.
+ /// A new with specified data.
+ public static DialogResult Show(string[]? contents, bool? useRichTextBox) => ShowCore(contents, null, useRichTextBox, null, null);
+
+ /// Shows a new with specified options.
+ /// The string contents array.
+ /// The use rich text box.
+ /// The header text.
+ /// The window text.
+ /// A new with specified data.
+ public static DialogResult Show(string[]? contents, bool? useRichTextBox, string? headerText, string? windowText) => ShowCore(contents, null, useRichTextBox, headerText, windowText);
+
+ /// Shows a new with specified options.
+ /// The string collection.
+ /// A new with specified data.
+ public static DialogResult Show(StringCollection? collection) => ShowCore(null, collection, null, null, null);
+
+ /// Shows a new with specified options.
+ /// The string collection.
+ /// The use rich text box.
+ /// A new with specified data.
+ public static DialogResult Show(StringCollection? collection, bool? useRichTextBox) => ShowCore(null, collection, useRichTextBox, null, null);
+
+ /// Shows a new with specified options.
+ /// The string collection.
+ /// The use rich text box.
+ /// The header text.
+ /// The window text.
+ /// A new with specified data.
+ public static DialogResult Show(StringCollection? collection, bool? useRichTextBox, string? headerText, string? windowText) => ShowCore(null, collection, useRichTextBox, headerText, windowText);
+
+ #endregion
+
+ #region Implementation
+
+ private static DialogResult ShowCore(string[]? contents, StringCollection? collection,
+ bool? useRichTextBox, string? headerText, string? windowTitle)
+ {
+ using var kmse = new VisualMultilineStringEditorForm(contents, collection, useRichTextBox, headerText, windowTitle);
+
+ return kmse.ShowDialog();
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonNumericUpDown.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonNumericUpDown.cs
index 8aa23b2e2..1890bdc1e 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonNumericUpDown.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonNumericUpDown.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -521,7 +521,7 @@ public void Dispose()
///
/// The state for which the image is needed.
/// Color value.
- public virtual Color GetImageTransparentColor(PaletteState state) => Color.Empty;
+ public virtual Color GetImageTransparentColor(PaletteState state) => GlobalStaticValues.EMPTY_COLOR;
///
/// Gets the content long text.
@@ -655,7 +655,7 @@ private void DrawUpDownButtons(Graphics g, Rectangle clientRect)
_viewButton.ElementState = ButtonElementState(upRect);
_viewButton.Layout(layoutContext);
_viewButton.Render(renderContext);
- renderContext.Renderer.RenderGlyph.DrawInputControlNumericUpGlyph(renderContext, _viewButton.ClientRectangle, _palette.PaletteContent, _viewButton.ElementState);
+ renderContext.Renderer!.RenderGlyph.DrawInputControlNumericUpGlyph(renderContext, _viewButton.ClientRectangle, _palette.PaletteContent, _viewButton.ElementState);
// Down button
layoutContext.DisplayRectangle = downRect;
@@ -719,22 +719,20 @@ public NumericUpDownButtonSpecCollection(KryptonNumericUpDown owner)
#region Instance Fields
private VisualPopupToolTip? _visualPopupToolTip;
- private readonly ButtonSpecManagerLayout _buttonManager;
+ private readonly ButtonSpecManagerLayout? _buttonManager;
private readonly ViewLayoutDocker _drawDockerInner;
private readonly ViewDrawDocker _drawDockerOuter;
private readonly ViewLayoutFill _layoutFill;
private readonly InternalNumericUpDown _numericUpDown;
private InputControlStyle _inputControlStyle;
private ButtonStyle _upDownButtonStyle;
- private SubclassEdit _subclassEdit;
+ private SubclassEdit? _subclassEdit;
private SubclassButtons? _subclassButtons;
private bool? _fixedActive;
private bool _forcedLayout;
private bool _mouseOver;
private bool _alwaysActive;
private bool _trackingMouseEnter;
- private float _cornerRoundingRadius;
-
#endregion
#region Events
@@ -873,10 +871,10 @@ public KryptonNumericUpDown()
// Create button specification collection manager
_buttonManager = new ButtonSpecManagerLayout(this, Redirector, ButtonSpecs, null,
- new[] { _drawDockerInner },
- new IPaletteMetric[] { StateCommon },
- new[] { PaletteMetricInt.HeaderButtonEdgeInsetInputControl },
- new[] { PaletteMetricPadding.HeaderButtonPaddingInputControl },
+ [_drawDockerInner],
+ [StateCommon],
+ [PaletteMetricInt.HeaderButtonEdgeInsetInputControl],
+ [PaletteMetricPadding.HeaderButtonPaddingInputControl],
CreateToolStripRenderer,
NeedPaintDelegate);
@@ -888,8 +886,6 @@ public KryptonNumericUpDown()
// Add text box to the controls collection
((KryptonReadOnlyControls)Controls).AddInternal(_numericUpDown);
-
- _cornerRoundingRadius = GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
}
///
@@ -904,7 +900,7 @@ protected override void Dispose(bool disposing)
OnCancelToolTip(this, EventArgs.Empty);
// Remember to pull down the manager instance
- _buttonManager.Destruct();
+ _buttonManager?.Destruct();
// Tell the buttons class to cleanup resources
_subclassButtons?.Dispose();
@@ -915,19 +911,6 @@ protected override void Dispose(bool disposing)
#endregion
#region Public
-
- /// Gets or sets the corner rounding radius.
- /// The corner rounding radius.
- [Category(@"Visuals")]
- [Description(@"Gets or sets the corner rounding radius.")]
- [DefaultValue(GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE)]
- public float CornerRoundingRadius
- {
- get => _cornerRoundingRadius;
-
- set => SetCornerRoundingRadius(value);
- }
-
///
/// Gets and sets if the control is in the tab chain.
///
@@ -951,7 +934,7 @@ public float CornerRoundingRadius
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[EditorBrowsable(EditorBrowsableState.Always)]
[Browsable(false)]
- public NumericUpDown? NumericUpDown => _numericUpDown;
+ public NumericUpDown NumericUpDown => _numericUpDown;
///
/// Gets access to the contained input control.
@@ -988,7 +971,7 @@ public override Color BackColor
public override Font Font
{
get => base.Font;
- set => base.Font = value;
+ set => base.Font = value!;
}
///
@@ -1102,11 +1085,11 @@ public bool TrailingZeroes
[DefaultValue(true)]
public bool UseMnemonic
{
- get => _buttonManager.UseMnemonic;
+ get => _buttonManager!.UseMnemonic;
set
{
- if (_buttonManager.UseMnemonic != value)
+ if (_buttonManager!.UseMnemonic != value)
{
_buttonManager.UseMnemonic = value;
PerformNeedPaint(true);
@@ -1400,7 +1383,7 @@ public ButtonStyle UpDownButtonStyle
///
/// The position of the first character in the current text selection within the text box.
/// The number of characters to select.
- public void Select(int start, int length) => _numericUpDown.Select(start, length);
+ public void Select(int start, int length) => _numericUpDown?.Select(start, length);
///
/// Sets the fixed state of the control.
@@ -1440,12 +1423,12 @@ public ButtonStyle UpDownButtonStyle
///
/// Displays the previous item in the collection.
///
- public void UpButton() => NumericUpDown.UpButton();
+ public void UpButton() => NumericUpDown?.UpButton();
///
/// Displays the next item in the collection.
///
- public void DownButton() => NumericUpDown.DownButton();
+ public void DownButton() => NumericUpDown?.DownButton();
///
/// Get the preferred size of the control based on a proposed size.
@@ -1550,9 +1533,9 @@ public bool DesignerGetHitTest(Point pt)
/// Mouse location.
[EditorBrowsable(EditorBrowsableState.Never)]
[Browsable(false)]
- public Component DesignerComponentFromPoint(Point pt) =>
+ public Component? DesignerComponentFromPoint(Point pt) =>
// Ignore call as view builder is already destructed
- IsDisposed ? null : ViewManager.ComponentFromPoint(pt);
+ IsDisposed ? null : ViewManager?.ComponentFromPoint(pt);
// Ask the current view for a decision
///
@@ -1661,7 +1644,7 @@ protected override void OnEnabledChanged(EventArgs e)
_drawDockerOuter.Enabled = Enabled;
// Update state to reflect change in enabled state
- _buttonManager.RefreshButtons();
+ _buttonManager?.RefreshButtons();
PerformNeedPaint(true);
@@ -1684,7 +1667,7 @@ protected override void OnPaletteChanged(EventArgs e)
///
/// Source of notification.
/// An NeedLayoutEventArgs containing event data.
- protected override void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e)
+ protected override void OnPaletteNeedPaint(object? sender, NeedLayoutEventArgs e)
{
InvalidateChildren();
base.OnPaletteChanged(e);
@@ -1750,7 +1733,7 @@ protected override void OnLayout(LayoutEventArgs levent)
if (IsHandleCreated || _forcedLayout || (DesignMode && (_numericUpDown != null)))
{
Rectangle fillRect = _layoutFill.FillRect;
- _numericUpDown.SetBounds(fillRect.X, fillRect.Y, fillRect.Width, fillRect.Height);
+ _numericUpDown?.SetBounds(fillRect.X, fillRect.Y, fillRect.Width, fillRect.Height);
}
}
}
@@ -1786,7 +1769,7 @@ protected override void OnMouseLeave(EventArgs e)
protected override void OnGotFocus(EventArgs e)
{
base.OnGotFocus(e);
- _numericUpDown.Focus();
+ _numericUpDown?.Focus();
}
///
@@ -1848,13 +1831,13 @@ protected override void OnNeedPaint(object? sender, NeedLayoutEventArgs e)
IPaletteTriple triple = GetTripleState();
PaletteState state = _drawDockerOuter.State;
_numericUpDown.BackColor = triple.PaletteBack.GetBackColor1(state);
- _numericUpDown.ForeColor = triple.PaletteContent.GetContentShortTextColor1(state);
+ _numericUpDown.ForeColor = triple.PaletteContent!.GetContentShortTextColor1(state);
// Only set the font if the numeric up down has been created
- Font font = triple.PaletteContent.GetContentShortTextFont(state);
+ Font? font = triple.PaletteContent.GetContentShortTextFont(state);
if ((_numericUpDown.Handle != IntPtr.Zero) && !_numericUpDown.Font.Equals(font))
{
- _numericUpDown.Font = font;
+ _numericUpDown.Font = font!;
}
}
@@ -1999,13 +1982,13 @@ private void UpdateStateAndPalettes()
{
// Get the correct palette settings to use
IPaletteTriple tripleState = GetTripleState();
- _drawDockerOuter.SetPalettes(tripleState.PaletteBack, tripleState.PaletteBorder);
+ _drawDockerOuter.SetPalettes(tripleState.PaletteBack, tripleState.PaletteBorder!);
// Update enabled state
_drawDockerOuter.Enabled = Enabled;
// Find the new state of the main view element
- PaletteState state = IsActive ? PaletteState.Tracking : PaletteState.Normal;
+ PaletteState state = Enabled ? (IsActive ? PaletteState.Tracking : PaletteState.Normal) : PaletteState.Disabled;
_drawDockerOuter.ElementState = state;
}
@@ -2024,11 +2007,11 @@ private int PreferredHeight
}
}
- private void OnNumericUpDownTextChanged(object sender, EventArgs e) => OnTextChanged(e);
+ private void OnNumericUpDownTextChanged(object? sender, EventArgs e) => OnTextChanged(e);
- private void OnNumericUpDownValueChanged(object sender, EventArgs e) => OnValueChanged(e);
+ private void OnNumericUpDownValueChanged(object? sender, EventArgs e) => OnValueChanged(e);
- private void OnNumericUpDownGotFocus(object sender, EventArgs e)
+ private void OnNumericUpDownGotFocus(object? sender, EventArgs e)
{
UpdateStateAndPalettes();
PerformNeedPaint(true);
@@ -2038,7 +2021,7 @@ private void OnNumericUpDownGotFocus(object sender, EventArgs e)
// ReSharper restore RedundantBaseQualifier
}
- private void OnNumericUpDownLostFocus(object sender, EventArgs e)
+ private void OnNumericUpDownLostFocus(object? sender, EventArgs e)
{
UpdateStateAndPalettes();
PerformNeedPaint(true);
@@ -2048,19 +2031,19 @@ private void OnNumericUpDownLostFocus(object sender, EventArgs e)
// ReSharper restore RedundantBaseQualifier
}
- private void OnNumericUpDownKeyPress(object sender, KeyPressEventArgs e) => OnKeyPress(e);
+ private void OnNumericUpDownKeyPress(object? sender, KeyPressEventArgs e) => OnKeyPress(e);
- private void OnNumericUpDownKeyUp(object sender, KeyEventArgs e) => OnKeyUp(e);
+ private void OnNumericUpDownKeyUp(object? sender, KeyEventArgs e) => OnKeyUp(e);
- private void OnNumericUpDownKeyDown(object sender, KeyEventArgs e) => OnKeyDown(e);
+ private void OnNumericUpDownKeyDown(object? sender, KeyEventArgs e) => OnKeyDown(e);
- private void OnNumericUpDownPreviewKeyDown(object sender, PreviewKeyDownEventArgs e) => OnPreviewKeyDown(e);
+ private void OnNumericUpDownPreviewKeyDown(object? sender, PreviewKeyDownEventArgs e) => OnPreviewKeyDown(e);
- private void OnNumericUpDownValidated(object sender, EventArgs e) => OnValidated(e);
+ private void OnNumericUpDownValidated(object? sender, EventArgs e) => OnValidated(e);
- private void OnNumericUpDownValidating(object sender, CancelEventArgs e) => OnValidating(e);
+ private void OnNumericUpDownValidating(object? sender, CancelEventArgs e) => OnValidating(e);
- private void OnShowToolTip(object sender, ToolTipEventArgs e)
+ private void OnShowToolTip(object? sender, ToolTipEventArgs e)
{
if (!IsDisposed && !Disposing)
{
@@ -2080,7 +2063,7 @@ private void OnShowToolTip(object sender, ToolTipEventArgs e)
var shadow = true;
// Find the button spec associated with the tooltip request
- ButtonSpec? buttonSpec = _buttonManager.ButtonSpecFromView(e.Target);
+ ButtonSpec? buttonSpec = _buttonManager?.ButtonSpecFromView(e.Target);
// If the tooltip is for a button spec
if (buttonSpec != null)
@@ -2127,21 +2110,21 @@ private void OnShowToolTip(object sender, ToolTipEventArgs e)
}
}
- private void OnCancelToolTip(object sender, EventArgs e) =>
+ private void OnCancelToolTip(object? sender, EventArgs e) =>
// Remove any currently showing tooltip
_visualPopupToolTip?.Dispose();
- private void OnVisualPopupToolTipDisposed(object sender, EventArgs e)
+ private void OnVisualPopupToolTipDisposed(object? sender, EventArgs e)
{
// Unhook events from the specific instance that generated event
- var popupToolTip = (VisualPopupToolTip)sender;
+ var popupToolTip = sender as VisualPopupToolTip ?? throw new ArgumentNullException(nameof(sender));
popupToolTip.Disposed -= OnVisualPopupToolTipDisposed;
- // Not showing a popup page any more
+ // Not showing a popup page anymore
_visualPopupToolTip = null;
}
- private void OnNumericUpDownMouseChange(object sender, EventArgs e)
+ private void OnNumericUpDownMouseChange(object? sender, EventArgs e)
{
// Find new tracking mouse change state
var tracking = _numericUpDown.MouseOver ||
@@ -2167,14 +2150,6 @@ private void OnNumericUpDownMouseChange(object sender, EventArgs e)
}
}
}
-
- private void SetCornerRoundingRadius(float? radius)
- {
- _cornerRoundingRadius = radius ?? GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
- StateCommon.Border.Rounding = _cornerRoundingRadius;
- }
-
#endregion
}
}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonOpenFileDialog.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonOpenFileDialog.cs
index 9d1bcc244..2852c4f36 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonOpenFileDialog.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonOpenFileDialog.cs
@@ -2,7 +2,7 @@
/*
*
* 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. 2023 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2024. All rights reserved.
*
*/
#endregion
@@ -86,7 +86,7 @@ public override bool CheckPathExists
set => _internalOpenFileDialog.CheckPathExists = value;
}
-#if NET60_OR_GREATER
+#if NET6_0_OR_GREATER
///
public override Guid? ClientGuid
{
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonOutlookGrid.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonOutlookGrid.cs
new file mode 100644
index 000000000..39e482099
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonOutlookGrid.cs
@@ -0,0 +1,3230 @@
+#region Licences
+
+/*
+ *
+ * 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. 2024 - 2024. All rights reserved.
+ *
+ */
+
+//--------------------------------------------------------------------------------
+// Copyright (C) 2013-2021 JDH Software -
+//
+// This program is provided to you under the terms of the Microsoft Public
+// License (Ms-PL) as published at https://github.com/Cocotteseb/Krypton-OutlookGrid/blob/master/LICENSE.md
+//
+// Visit https://www.jdhsoftware.com and follow @jdhsoftware on Twitter
+//
+//--------------------------------------------------------------------------------
+
+#endregion
+
+namespace Krypton.Toolkit
+{
+ ///
+ /// Krypton DataGridView allowing nested grouping and unlimited sorting
+ ///
+ ///
+ public partial class KryptonOutlookGrid : KryptonDataGridView
+ {
+ #region Design Code
+ private IContainer? components;
+
+ private void InitializeComponent()
+ {
+ components = new Container();
+
+ }
+ #endregion
+
+ #region Variables
+
+ private RightToLeftLayout _rightToLeftLayout;
+
+ private KryptonOutlookGridGroupBox? _groupBox;
+ //Krypton
+ private PaletteBase? _palette;
+ private readonly PaletteRedirect _paletteRedirect;
+ private PaletteBackInheritRedirect _paletteBack;
+ private PaletteBorderInheritRedirect _paletteBorder;
+ //private PaletteContentInheritRedirect _paletteContent;
+ private IDisposable? _mementoBack;
+
+ private OutlookGridGroupCollection _groupCollection; // List of Groups (of rows)
+ private List _internalRows; // List of Rows in order to keep them as is (without grouping,...)
+ private readonly OutlookGridColumnCollection _internalColumns; // List of columns in order to know if sorted, Grouped, types,...
+ private int _previousGroupRowSelected = -1; //Useful to allow the selection of a group row or not when on mouse down
+
+ //Krypton ContextMenu for the columns header
+ private KryptonContextMenu? _contextMenu;
+ private KryptonContextMenuItems? _menuItems;
+ private KryptonContextMenuItem _menuSortAscending;
+ private KryptonContextMenuItem _menuSortDescending;
+ private KryptonContextMenuItem _menuClearSorting;
+ private KryptonContextMenuSeparator _menuSeparator1;
+ private KryptonContextMenuItem _menuGroupByThisColumn;
+ private KryptonContextMenuItem _menuUngroupByThisColumn;
+ private KryptonContextMenuItem _menuShowGroupBox;
+ private KryptonContextMenuItem _menuHideGroupBox;
+ private KryptonContextMenuSeparator _menuSeparator2;
+ private KryptonContextMenuItem _menuBestFitColumn;
+ private KryptonContextMenuItem _menuBestFitAllColumns;
+ private KryptonContextMenuSeparator _menuSeparator3;
+ private KryptonContextMenuItem _menuVisibleColumns;
+ private KryptonContextMenuItem _menuGroupInterval;
+ private KryptonContextMenuItem _menuSortBySummary;
+ private KryptonContextMenuItem _menuExpand;
+ private KryptonContextMenuItem _menuCollapse;
+ private KryptonContextMenuSeparator _menuSeparator4;
+ private KryptonContextMenuSeparator _menuSeparator5;
+ private KryptonContextMenuItem _menuConditionalFormatting;
+ private int _colSelected = 1; //for menu
+ private const int FORMATTING_BAR_SOLID_GRADIENT_SEP_INDEX = 3;
+
+ //For the Drag and drop of columns
+ private Rectangle _dragDropRectangle;
+ private int _dragDropSourceIndex;
+ private int _dragDropTargetIndex;
+ private int _dragDropCurrentIndex = -1;
+ private int _dragDropType; //0=column, 1=row
+
+ private bool _hideColumnOnGrouping;
+
+ //Nodes
+ private bool _showLines;
+ internal bool InExpandCollapseMouseCapture;
+ private GridFillMode _fillMode;
+
+ //Formatting
+ private List _formatConditions;
+
+ private readonly float _factorX;
+ private readonly float _factorY;
+
+ #endregion
+
+ #region Events
+
+ ///
+ /// Group Image Click Event
+ ///
+ public event EventHandler? GroupImageClick;
+ ///
+ /// Node expanding event
+ ///
+ public event EventHandler? NodeExpanding;
+ ///
+ /// Node Expanded event
+ ///
+ public event EventHandler? NodeExpanded;
+ ///
+ /// Node Collapsing Event
+ ///
+ public event EventHandler? NodeCollapsing;
+ ///
+ /// Node Collapsed event
+ ///
+ public event EventHandler? NodeCollapsed;
+
+ #endregion
+
+ #region Identity
+
+ ///
+ /// Constructor
+ ///
+ public KryptonOutlookGrid()
+ {
+ InitializeComponent();
+
+ // very important, this indicates that a new default row class is going to be used to fill the grid
+ // in this case our custom OutlookGridRow class
+ base.RowTemplate = new OutlookGridRow();
+ _groupCollection = new OutlookGridGroupCollection(null);
+ _internalRows = new List();
+ _internalColumns = new OutlookGridColumnCollection();
+ _fillMode = GridFillMode.GroupsOnly;
+
+ // Cache the current global palette setting
+ _palette = KryptonManager.CurrentGlobalPalette;
+
+ // Hook into palette events
+ if (_palette != null)
+ {
+ _palette.PalettePaint += OnPalettePaint;
+ }
+
+ // (4) We want to be notified whenever the global palette changes
+ KryptonManager.GlobalPaletteChanged += OnGlobalPaletteChanged;
+
+ // Create redirection object to the base palette
+ _paletteRedirect = new PaletteRedirect(_palette);
+
+ // Create accessor objects for the back, border and content
+ _paletteBack = new PaletteBackInheritRedirect(_paletteRedirect);
+ _paletteBorder = new PaletteBorderInheritRedirect(_paletteRedirect);
+ //_paletteContent = new PaletteContentInheritRedirect(_paletteRedirect);
+
+ AllowUserToOrderColumns = false; //we will handle it ourselves
+ _hideColumnOnGrouping = false;
+ _formatConditions = new List();
+
+ using (Graphics g = CreateGraphics())
+ {
+ _factorX = g.DpiX > 96 ? 1f * g.DpiX / 96 : 1f;
+ _factorY = g.DpiY > 96 ? 1f * g.DpiY / 96 : 1f;
+ }
+
+ //Update StaticValues
+ //ColumnHeadersHeight = (int)(ColumnHeadersHeight * factorY); //No need already done in KryptonDataGridView
+ GlobalStaticValues.DefaultGroupRowHeight = (int)(GlobalStaticValues.DefaultGroupRowHeight * _factorY);
+ GlobalStaticValues.Office2013GroupRowHeight = (int)(GlobalStaticValues.Office2013GroupRowHeight * _factorY);
+ GlobalStaticValues.DefaultOffsetHeight = (int)(GlobalStaticValues.DefaultOffsetHeight * _factorY);
+ GlobalStaticValues.Office2013OffsetHeight = (int)(GlobalStaticValues.DefaultOffsetHeight * _factorY);
+ GlobalStaticValues.ImageOffsetWidth = (int)(GlobalStaticValues.ImageOffsetWidth * _factorX);
+ GlobalStaticValues.GroupLevelMultiplier = (int)(GlobalStaticValues.GroupLevelMultiplier * _factorX);
+ GlobalStaticValues.GroupImageSide = (int)(GlobalStaticValues.GroupImageSide * _factorX);
+
+ _rightToLeftLayout = RightToLeftLayout.LeftToRight;
+ }
+
+ ///
+ /// Definitely removes flickering - may not work on some systems/can cause higher CPU usage.
+ ///
+ protected override CreateParams CreateParams
+ {
+ get
+ {
+ CreateParams cp = base.CreateParams;
+ cp.ExStyle |= 0x02000000; // Turn on WS_EX_COMPOSITED
+ return cp;
+ }
+ }
+
+
+ #endregion OutlookGrid constructor
+
+ #region OutlookGrid Properties
+
+ ///
+ /// Gets the RowTemplate of the grid.
+ ///
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public new DataGridViewRow RowTemplate => base.RowTemplate;
+
+ ///
+ /// Gets if the grid is grouped
+ ///
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public bool IsGridGrouped => !(_groupCollection.Count == 0);
+
+ ///
+ /// Gets or sets the OutlookGridGroupBox
+ ///
+ [Category("Behavior")]
+ [Description("Associate the OutlookGridGroupBox with the grid.")]
+ [DefaultValue(null)]
+ public KryptonOutlookGridGroupBox? GroupBox
+ {
+ get => _groupBox;
+ set => _groupBox = value;
+ }
+
+ ///
+ /// Gets or sets the list of rows in the grid (without grouping,... for having a copy)
+ ///
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public List InternalRows
+ {
+ get => _internalRows;
+ set => _internalRows = value;
+ }
+
+ ///
+ /// Gets or sets the previous selected group row
+ ///
+ [Browsable(false)]
+ public int PreviousSelectedGroupRow
+ {
+ get => _previousGroupRowSelected;
+
+ set => _previousGroupRowSelected = value;
+ }
+
+ ///
+ /// Gets the Krypton Palette of the OutlookGrid
+ ///
+ [Browsable(false)]
+ public PaletteBase? GridPalette => _palette;
+
+ ///
+ /// Gets or sets the group collection.
+ ///
+ /// OutlookGridGroupCollection.
+ [Browsable(false)]
+ public OutlookGridGroupCollection GroupCollection
+ {
+ get => _groupCollection;
+ set => _groupCollection = value;
+ }
+
+ ///
+ /// Gets or sets the HideColumnOnGrouping property.
+ ///
+ /// True if the column should be hidden when it is grouped, false otherwise.
+ [Category("Behavior")]
+ [Description("Hide the column when it is grouped.")]
+ [DefaultValue(false)]
+ public bool HideColumnOnGrouping
+ {
+ get => _hideColumnOnGrouping;
+ set => _hideColumnOnGrouping = value;
+ }
+
+ ///
+ /// Gets or sets the conditional formatting items list.
+ ///
+ ///
+ /// The conditional formatting items list.
+ ///
+ [Category("Behavior")]
+ [Description("Conditional formatting.")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ public List ConditionalFormatting
+ {
+ get => _formatConditions;
+ set => _formatConditions = value;
+ }
+
+
+ ///
+ /// Gets or sets a value indicating whether the lines are shown between nodes.
+ ///
+ ///
+ /// true if [show lines]; otherwise, false .
+ ///
+ [DefaultValue(true)]
+ public bool ShowLines
+ {
+ get => _showLines;
+ set
+ {
+ if (value != _showLines)
+ {
+ _showLines = value;
+ Invalidate();
+ }
+ }
+ }
+
+ ///
+ /// Gets or sets the fill mode.
+ ///
+ ///
+ /// The fill mode.
+ ///
+ public GridFillMode FillMode
+ {
+ get => _fillMode;
+ set
+ {
+ if (value != _fillMode)
+ {
+ _fillMode = value;
+ Invalidate();
+ }
+ }
+ }
+
+ public RightToLeftLayout RightToLeftLayout
+ {
+ get => _rightToLeftLayout;
+
+ set => _rightToLeftLayout = value;
+ }
+
+ #endregion OutlookGrid property definitions
+
+ #region OutlookGrid Overrides
+
+ ///
+ /// Releases unmanaged and - optionally - managed resources.
+ ///
+ /// true to release both managed and unmanaged resources; false to release only unmanaged resources.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ if (_mementoBack != null)
+ {
+ _mementoBack.Dispose();
+ _mementoBack = null;
+ }
+
+ // (10) Unhook from the palette events
+ if (_palette != null)
+ {
+ _palette.PalettePaint -= OnPalettePaint;
+ _palette = null;
+ }
+
+ // (11) Unhook from the static events, otherwise we cannot be garbage collected
+ KryptonManager.GlobalPaletteChanged -= OnGlobalPaletteChanged;
+
+ //Unhook from specific events
+ if (_groupBox != null)
+ {
+ _groupBox.ColumnGroupAdded -= ColumnGroupAddedEvent;
+ _groupBox.ColumnSortChanged -= ColumnSortChangedEvent;
+ _groupBox.ColumnGroupRemoved -= ColumnGroupRemovedEvent;
+ _groupBox.ClearGrouping -= ClearGroupingEvent;
+ _groupBox.FullCollapse -= FullCollapseEvent;
+ _groupBox.FullExpand -= FullExpandEvent;
+ _groupBox.ColumnGroupOrderChanged -= ColumnGroupIndexChangedEvent;
+ _groupBox.GroupExpand -= GridGroupExpandEvent;
+ _groupBox.GroupCollapse -= GridGroupCollapseEvent;
+ _groupBox.GroupIntervalClick -= GroupIntervalClickEvent;
+ _groupBox.SortBySummaryCount -= SortBySummaryCountEvent;
+ }
+ }
+
+ if (disposing && components != null)
+ {
+ components.Dispose();
+ }
+
+ base.Dispose(disposing);
+ }
+
+ ///
+ /// Raises the event.
+ ///
+ /// The instance containing the event data.
+ protected override void OnCellBeginEdit(DataGridViewCellCancelEventArgs e)
+ {
+ OutlookGridRow row = (OutlookGridRow)Rows[e.RowIndex];
+ if (row.IsGroupRow)
+ {
+ e.Cancel = true;
+ }
+ else
+ {
+ base.OnCellBeginEdit(e);
+ }
+ }
+
+ ///
+ /// Raises the event.
+ ///
+ /// The instance containing the event data.
+ protected override void OnCellDoubleClick(DataGridViewCellEventArgs e)
+ {
+ if (e.RowIndex >= 0)
+ {
+ OutlookGridRow row = (OutlookGridRow)Rows[e.RowIndex];
+ if (row.IsGroupRow)
+ {
+ if (row.Group != null)
+ {
+ row.Group.Collapsed = !row.Group.Collapsed;
+ }
+
+ //this is a workaround to make the grid re-calculate it's contents and background bounds
+ // so the background is updated correctly.
+ // this will also invalidate the control, so it will redraw itself
+ row.Visible = false;
+ row.Visible = true;
+ return;
+ }
+ }
+ base.OnCellDoubleClick(e);
+ }
+
+ ///
+ /// Raises the event.
+ ///
+ /// The instance containing the event data.
+ protected override void OnMouseUp(MouseEventArgs e)
+ {
+ // used to keep extra mouse moves from selecting more rows when collapsing
+ base.OnMouseUp(e);
+ InExpandCollapseMouseCapture = false;
+ }
+
+ ///
+ /// Raises the event.
+ ///
+ /// The instance containing the event data.
+ protected override void OnMouseDown(MouseEventArgs e)
+ {
+ //stores values for drag/drop operations if necessary
+ if (AllowDrop)
+ {
+ if (HitTest(e.X, e.Y).ColumnIndex == -1 && HitTest(e.X, e.Y).RowIndex > -1)
+ {
+ //if this is a row header cell
+ if (Rows[HitTest(e.X, e.Y).RowIndex].Selected)
+ {
+ //if this row is selected
+ _dragDropType = 1;
+ Size dragSize = SystemInformation.DragSize;
+ _dragDropRectangle = new Rectangle(new Point(e.X - dragSize.Width / 2, e.Y - dragSize.Height / 2), dragSize);
+ _dragDropSourceIndex = HitTest(e.X, e.Y).RowIndex;
+ }
+ else
+ {
+ _dragDropRectangle = Rectangle.Empty;
+ }
+ }
+ else if (HitTest(e.X, e.Y).ColumnIndex > -1 && HitTest(e.X, e.Y).RowIndex == -1)
+ {
+ //if this is a column header cell
+ //if (this.Columns[this.HitTest(e.X, e.Y).ColumnIndex].Selected)
+ //{
+ _dragDropType = 0;
+ _dragDropSourceIndex = HitTest(e.X, e.Y).ColumnIndex;
+ Size dragSize = SystemInformation.DragSize;
+ _dragDropRectangle = new Rectangle(new Point(e.X - dragSize.Width / 2, e.Y - dragSize.Height / 2), dragSize);
+ //}
+ //else
+ //{
+ // DragDropRectangle = Rectangle.Empty;
+ //} //end if
+ }
+ else
+ {
+ _dragDropRectangle = Rectangle.Empty;
+ }
+ }
+ else
+ {
+ _dragDropRectangle = Rectangle.Empty;
+ }
+ base.OnMouseDown(e);
+ }
+
+ ///
+ /// Raises the event.
+ ///
+ /// The instance containing the event data.
+ protected override void OnMouseMove(MouseEventArgs e)
+ {
+ // while we are expanding and collapsing a node mouse moves are
+ // suppressed to keep selections from being messed up.
+ if (!InExpandCollapseMouseCapture)
+ {
+ bool dragDropDone = false;
+ //handles drag/drop operations
+ if (AllowDrop)
+ {
+ if ((e.Button & MouseButtons.Left) == MouseButtons.Left && Cursor.Current! != Cursors.SizeWE)
+ {
+ if (_dragDropRectangle != Rectangle.Empty && !_dragDropRectangle.Contains(e.X, e.Y))
+ {
+ if (_dragDropType == 0)
+ {
+ OutlookGridColumn col = (OutlookGridColumn)_internalColumns.FindFromColumnIndex(_dragDropSourceIndex)!;
+ string groupInterval = "";
+ string groupType = "";
+ string? groupSortBySummaryCount = "";
+
+ if (col.GroupingType != null)
+ {
+ groupType = col.GroupingType.GetType().Name;
+ if (groupType == nameof(OutlookGridDateTimeGroup))
+ {
+ groupInterval = ((OutlookGridDateTimeGroup)col.GroupingType).Interval.ToString();
+ }
+
+ groupSortBySummaryCount = CommonHelper.BoolToString(col.GroupingType.SortBySummaryCount);
+ }
+ //column drag/drop
+ string info =
+ $"{col.Name}|{col.DataGridViewColumn!.HeaderText}|{col.DataGridViewColumn.HeaderCell.SortGlyphDirection}|{col.DataGridViewColumn.SortMode.ToString()}|{groupType}|{groupInterval}|{groupSortBySummaryCount}";
+ DragDropEffects dropEffect = DoDragDrop(info, DragDropEffects.Move);
+ dragDropDone = true;
+ }
+ else if (_dragDropType == 1)
+ {
+ //row drag/drop
+ DragDropEffects dropEffect = DoDragDrop(Rows[_dragDropSourceIndex], DragDropEffects.Move);
+ dragDropDone = true;
+ }
+ }
+ }
+ }
+ base.OnMouseMove(e);
+ if (dragDropDone)
+ {
+ CellOver = new Point(-2, -2);//To avoid that the column header appears in a pressed state - Modification of ToolKit
+ }
+ }
+ }
+
+ ///
+ /// Raises the event.
+ ///
+ /// The instance containing the event data.
+ protected override void OnDragLeave(EventArgs e)
+ {
+ if (_dragDropCurrentIndex > -1 && _dragDropType == 0)
+ {
+ DataGridViewColumn col = Columns[_dragDropCurrentIndex];
+ if (_groupBox != null && _groupBox.Contains(col.Name))
+ {
+ _dragDropCurrentIndex = -1;
+ //this.InvalidateColumn(col.Index);
+ Invalidate();
+ }
+ else
+ {
+ _dragDropCurrentIndex = -1;
+ }
+ }
+
+ base.OnDragLeave(e);
+ }
+
+ ///
+ /// Raises the event.
+ ///
+ /// The instance containing the event data.
+ protected override void OnDragOver(DragEventArgs drgevent)
+ {
+ //runs while the drag/drop is in progress
+ if (AllowDrop)
+ {
+ drgevent.Effect = DragDropEffects.Move;
+ if (_dragDropType == 0)
+ {
+ //column drag/drop
+ int curCol = HitTest(PointToClient(new Point(drgevent.X, drgevent.Y)).X, PointToClient(new Point(drgevent.X, drgevent.Y)).Y).ColumnIndex;
+ if (_dragDropCurrentIndex != curCol)
+ {
+ _dragDropCurrentIndex = curCol;
+ Invalidate(); //repaint
+ }
+ }
+ else if (_dragDropType == 1)
+ {
+ //row drag/drop
+ int curRow = HitTest(PointToClient(new Point(drgevent.X, drgevent.Y)).X, PointToClient(new Point(drgevent.X, drgevent.Y)).Y).RowIndex;
+ if (_dragDropCurrentIndex != curRow)
+ {
+ _dragDropCurrentIndex = curRow;
+ Invalidate(); //repaint
+ }
+ }
+ }
+ base.OnDragOver(drgevent);
+ }
+
+ ///
+ /// Raises the event.
+ ///
+ /// The instance containing the event data.
+ protected override void OnDragDrop(DragEventArgs drgevent)
+ {
+ //runs after a drag/drop operation for column/row has completed
+ if (AllowDrop)
+ {
+ if (drgevent.Effect == DragDropEffects.Move)
+ {
+ Point clientPoint = PointToClient(new Point(drgevent.X, drgevent.Y));
+ if (_dragDropType == 0)
+ {
+ //if this is a column drag/drop operation
+ _dragDropTargetIndex = HitTest(clientPoint.X, clientPoint.Y).ColumnIndex;
+ if (_dragDropTargetIndex > -1 && _dragDropCurrentIndex < ColumnCount - 1)
+ {
+ _dragDropCurrentIndex = -1;
+ //*************************************************
+ //'SourceColumn' is null after the line of code
+ //below executes... Why? This works fine for rows!!
+ if (drgevent.Data!.GetData(typeof(string)) is string r)
+ {
+ string[] res = r.Split('|');
+ DataGridViewColumn? sourceColumn = Columns[res[0]];
+ //int SourceDisplayIndex = SourceColumn.DisplayIndex;
+ DataGridViewColumn targetColumn = Columns[_dragDropTargetIndex];
+ // int TargetDisplayIndex = TargetColumn.DisplayIndex;
+ if (sourceColumn != null)
+ {
+ sourceColumn.DisplayIndex = targetColumn.DisplayIndex;
+
+ //Debug
+ List listcol = new();
+ foreach (DataGridViewColumn col in Columns)
+ {
+ listcol.Add(col);
+ }
+
+ foreach (DataGridViewColumn col in listcol.OrderBy(x => x.DisplayIndex))
+ {
+ Console.WriteLine($@"{col.Name} {col.DisplayIndex}");
+ }
+
+ Console.WriteLine(@"-----------------");
+
+ //*************************************************
+ //this.Columns.RemoveAt(DragDropSourceIndex);
+ //this.Columns.Insert(DragDropTargetIndex, SourceColumn);
+
+ sourceColumn.Selected = false;
+ }
+
+ targetColumn.Selected = false;
+ }
+
+ //this.Columns[DragDropTargetIndex].Selected = true;
+ CurrentCell = this[_dragDropTargetIndex, 0];
+ } //end if
+ }
+ else if (_dragDropType == 1)
+ {
+ //if this is a row drag/drop operation
+ _dragDropTargetIndex = HitTest(clientPoint.X, clientPoint.Y).RowIndex;
+ if (_dragDropTargetIndex > -1 && _dragDropCurrentIndex < RowCount - 1)
+ {
+ _dragDropCurrentIndex = -1;
+ DataGridViewRow? sourceRow = drgevent.Data?.GetData(typeof(DataGridViewRow)) as DataGridViewRow;
+ Rows.RemoveAt(_dragDropSourceIndex);
+ if (sourceRow != null)
+ {
+ Rows.Insert(_dragDropTargetIndex, sourceRow);
+ }
+ Rows[_dragDropTargetIndex].Selected = true;
+ CurrentCell = this[0, _dragDropTargetIndex];
+ }
+ }
+ }
+ }
+ _dragDropCurrentIndex = -1;
+ Invalidate();
+ base.OnDragDrop(drgevent);
+ }
+
+ ///
+ /// Raises the event.
+ ///
+ /// The instance containing the event data.
+ /// Draws a line for drag and drop
+ protected override void OnCellPainting(DataGridViewCellPaintingEventArgs e)
+ {
+ //draws red drag/drop target indicator lines if necessary
+ if (_dragDropCurrentIndex > -1)
+ {
+ if (_dragDropType == 0)
+ {
+ //column drag/drop
+ if (e.ColumnIndex == _dragDropCurrentIndex)// && DragDropCurrentIndex < this.ColumnCount)
+ {
+ //if this cell is in the same column as the mouse cursor
+ using (Pen p = new(Color.Red, 1))
+ {
+ e.Graphics?.DrawLine(p, e.CellBounds.Left - 1, e.CellBounds.Top, e.CellBounds.Left - 1, e.CellBounds.Bottom);
+ }
+ } //end if
+ }
+ else if (_dragDropType == 1)
+ {
+ //row drag/drop
+ if (e.RowIndex == _dragDropCurrentIndex && _dragDropCurrentIndex < RowCount - 1)
+ {
+ //if this cell is in the same row as the mouse cursor
+
+ using (Pen p = new(Color.Red, 1))
+ {
+ e.Graphics?.DrawLine(p, e.CellBounds.Left, e.CellBounds.Top - 1, e.CellBounds.Right, e.CellBounds.Top - 1);
+ }
+ }
+ }
+ }
+ base.OnCellPainting(e);
+ }
+
+ ///
+ /// Overrides OnCellMouseEnter
+ ///
+ /// DataGridViewCellEventArgs
+ protected override void OnCellMouseEnter(DataGridViewCellEventArgs e)
+ {
+ base.OnCellMouseEnter(e);
+ }
+
+ ///
+ /// Overrides OnCellMouseDown - Check if the user has clicked on +/- of a group row
+ ///
+ ///
+ protected override void OnCellMouseDown(DataGridViewCellMouseEventArgs e)
+ {
+ //base.OnCellMouseDown(e); //needed.
+ if (e.RowIndex < 0)
+ {
+ base.OnCellMouseDown(e); // To allow column resizing
+ return;
+ }
+ OutlookGridRow row = (OutlookGridRow)Rows[e.RowIndex];
+ //DebugUtilities.WriteLine("OnCellMouseDown " + DateTime.Now.Ticks.ToString() + "IsIconHit" + row.IsIconHit(e).ToString());
+ if (_previousGroupRowSelected != -1 && _previousGroupRowSelected != e.RowIndex)
+ {
+ InvalidateRow(PreviousSelectedGroupRow);
+ }
+
+ PreviousSelectedGroupRow = -1;
+ if (row.IsGroupRow)
+ {
+ PreviousSelectedGroupRow = e.RowIndex;
+ ClearSelection(); //unselect
+ if (row.IsIconHit(e))
+ {
+ if (row.Group != null)
+ {
+ row.Group.Collapsed = !row.Group.Collapsed;
+ }
+
+ //this is a workaround to make the grid re-calculate it's contents and backgroun bounds
+ // so the background is updated correctly.
+ // this will also invalidate the control, so it will redraw itself
+ row.Visible = false;
+ row.Visible = true;
+ //When collapsing the first row still seeing it.
+ if (row.Index < FirstDisplayedScrollingRowIndex)
+ {
+ FirstDisplayedScrollingRowIndex = row.Index;
+ }
+ }
+ else if (row.IsGroupImageHit(e))
+ {
+ OnGroupImageClick(new OutlookGridGroupImageEventArgs(row));
+ }
+ else
+ {
+ InvalidateRow(e.RowIndex);
+ }
+ }
+ else
+ {
+ base.OnCellMouseDown(e);
+ }
+ }
+
+ ///
+ /// Overrides OnColumnHeaderMouseClick
+ ///
+ /// DataGridViewCellMouseEventArgs
+ protected override void OnColumnHeaderMouseClick(DataGridViewCellMouseEventArgs e)
+ {
+ _colSelected = e.ColumnIndex; //To keep a track on which column we have pressed
+ //runs when the mouse is clicked over a column header cell
+ if (e.ColumnIndex > -1)
+ {
+ if (e.Button == MouseButtons.Right)
+ {
+ ShowColumnHeaderContextMenu(e.ColumnIndex);
+ }
+ else if (e.Button == MouseButtons.Left)
+ {
+ OutlookGridColumn? col = _internalColumns.FindFromColumnIndex(e.ColumnIndex) ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull("col"));
+ if (col.DataGridViewColumn!.SortMode != DataGridViewColumnSortMode.NotSortable)
+ {
+ SortOrder previousSort = col.SortDirection;
+ //Reset all sorting column only if not Ctrl or Shift or the column is grouped
+ if (ModifierKeys != Keys.Shift && ModifierKeys != Keys.Control && !col.IsGrouped)
+ {
+ ResetAllSortingColumns();
+ }
+
+ //Remove this SortIndex
+ if (ModifierKeys == Keys.Control)
+ {
+ UnSortColumn(col);
+ }
+ //Add the first or a new SortIndex
+ else
+ {
+ if (previousSort == SortOrder.None)
+ {
+ SortColumn(col, SortOrder.Ascending);
+ }
+ else
+ {
+ SortColumn(col, previousSort == SortOrder.Ascending ? SortOrder.Descending : SortOrder.Ascending);
+ }
+ }
+
+ // Note Can we remove this?
+ //#if DEBUG
+ // internalColumns.DebugOutput();
+ //#endif
+
+ //Refresh the groupBox if the column is grouped
+ if (col.IsGrouped)
+ {
+ ForceRefreshGroupBox();
+ }
+
+ //Apply the changes
+ Fill();
+ }
+ }
+ }
+ base.OnColumnHeaderMouseClick(e);
+ }
+
+ //protected override void OnColumnAdded(DataGridViewColumnEventArgs e)
+ //{
+ // var header = new FilterColumnHeaderCell();
+ // // header.FilterButtonClicked += new EventHandler(header_FilterButtonClicked);
+ // e.Column.HeaderCell = header;
+
+
+ // base.OnColumnAdded(e);
+ //}
+
+
+
+ ///
+ /// Raises the event.
+ ///
+ /// The instance containing the event data.
+ protected override void OnCellFormatting(DataGridViewCellFormattingEventArgs e)
+ {
+ //Allows to have a picture in the first column
+ if (e.DesiredType?.Name == "Image" && e.Value != null && e.Value.GetType().Name != e.DesiredType.Name && e.Value.GetType().Name != "Bitmap")
+ {
+ e.Value = null;
+ }
+
+ base.OnCellFormatting(e);
+ }
+
+ #endregion
+
+ #region OutlookGrid Events
+
+ ///
+ /// Called when [palette paint].
+ ///
+ /// The sender.
+ /// The instance containing the event data.
+ private void OnPalettePaint(object? sender, PaletteLayoutEventArgs e)
+ {
+ Invalidate();
+ }
+
+ ///
+ /// Called when [global palette changed].
+ ///
+ /// The sender.
+ /// The instance containing the event data.
+ private void OnGlobalPaletteChanged(object? sender, EventArgs e)
+ {
+ // (5) Unhook events from old palette
+ if (_palette != null)
+ {
+ _palette.PalettePaint -= OnPalettePaint;
+ }
+
+ // (6) Cache the new IPalette that is the global palette
+ _palette = KryptonManager.CurrentGlobalPalette;
+ _paletteRedirect.Target = _palette; //!!!!!! important
+
+ //Reflect changes for the grouped heights
+ int h = GlobalStaticValues.DefaultGroupRowHeight; // default height
+ if (KryptonManager.CurrentGlobalPalette != null && KryptonManager.CurrentGlobalPalette.GetRenderer() ==
+ KryptonManager.RenderOffice2013)
+ {
+ h = GlobalStaticValues.Office2013GroupRowHeight; // special height for office 2013
+ }
+
+ //For each outlookgridcolumn
+ for (int j = 0; j < _internalColumns.Count; j++)
+ {
+ if (_internalColumns[j].GroupingType != null)
+ {
+ var outlookGridGroup = _internalColumns[j].GroupingType;
+ if (outlookGridGroup != null)
+ {
+ outlookGridGroup.Height = h;
+ }
+ }
+ }
+
+ // (7) Hook into events for the new palette
+ if (_palette != null)
+ {
+ _palette.PalettePaint += OnPalettePaint;
+ }
+
+ // (8) Change of palette means we should repaint to show any changes
+ Invalidate();
+ }
+
+ ///
+ /// Clear sorting for the column selected by the menu
+ ///
+ ///
+ ///
+ private void OnColumnClearSorting(object? sender, EventArgs e)
+ {
+ if (_colSelected > -1)
+ {
+ OutlookGridColumn col = (OutlookGridColumn)_internalColumns.FindFromColumnIndex(_colSelected)!;
+ UnSortColumn(col);
+ Fill();
+ }
+ }
+
+ ///
+ /// Ascending sort for the column selected by the menu
+ ///
+ ///
+ ///
+ private void OnColumnSortAscending(object? sender, EventArgs e)
+ {
+ if (_colSelected > -1)
+ {
+ OutlookGridColumn col = (OutlookGridColumn)_internalColumns.FindFromColumnIndex(_colSelected)!;
+ SortColumn(col, SortOrder.Ascending);
+ if (col.IsGrouped)
+ {
+ ForceRefreshGroupBox();
+ }
+ Fill();
+ }
+ }
+
+ ///
+ /// Descending sort for the column selected by the menu
+ ///
+ ///
+ ///
+ private void OnColumnSortDescending(object? sender, EventArgs e)
+ {
+ if (_colSelected > -1)
+ {
+ OutlookGridColumn col = (OutlookGridColumn)_internalColumns.FindFromColumnIndex(_colSelected)!;
+ SortColumn(col, SortOrder.Descending);
+ if (col.IsGrouped)
+ {
+ ForceRefreshGroupBox();
+ }
+ Fill();
+ }
+ }
+
+ ///
+ /// Grouping for the column selected by the menu
+ ///
+ ///
+ ///
+ private void OnGroupByThisColumn(object? sender, EventArgs e)
+ {
+ if (_colSelected > -1)
+ {
+ OutlookGridColumn col = (OutlookGridColumn)_internalColumns.FindFromColumnIndex(_colSelected)!;
+ GroupColumn(col, SortOrder.Ascending, null);
+ ForceRefreshGroupBox();
+ Fill();
+ }
+ }
+
+ ///
+ /// Ungrouping for the column selected by the menu
+ ///
+ ///
+ ///
+ private void OnUnGroupByThisColumn(object? sender, EventArgs e)
+ {
+ if (_colSelected > -1)
+ {
+ OutlookGridColumn col = (OutlookGridColumn)_internalColumns.FindFromColumnIndex(_colSelected)!;
+ UnGroupColumn(col.Name!);
+ ForceRefreshGroupBox();
+ Fill();
+ }
+ }
+
+ private void OnGroupCollapse(object? sender, EventArgs e)
+ {
+ OutlookGridColumn col = (OutlookGridColumn)_internalColumns.FindFromColumnIndex(_colSelected)!;
+ Collapse(col.Name);
+ }
+
+ private void OnGroupExpand(object? sender, EventArgs e)
+ {
+ OutlookGridColumn col = (OutlookGridColumn)_internalColumns.FindFromColumnIndex(_colSelected)!;
+ Expand(col.Name);
+ }
+
+ private void OnSortBySummary(object? sender, EventArgs e)
+ {
+
+ var item = sender as KryptonContextMenuItem ?? throw new ArgumentNullException(nameof(sender));
+ OutlookGridColumn col = (OutlookGridColumn)_internalColumns.FindFromColumnIndex(_colSelected)!;
+ if (col.GroupingType != null)
+ {
+ col.GroupingType.SortBySummaryCount = item.Checked;
+ }
+ ForceRefreshGroupBox();
+ Fill();
+ }
+
+ private void OnGroupIntervalClick(object? sender, EventArgs e)
+ {
+ var item = sender as KryptonContextMenuItem ?? throw new ArgumentNullException(nameof(sender));
+ OutlookGridColumn col = (OutlookGridColumn)_internalColumns.FindFromColumnIndex(_colSelected)!;
+ if (col.GroupingType != null)
+ {
+ if (item != null)
+ {
+ if (item.Tag != null)
+ {
+ ((OutlookGridDateTimeGroup)col.GroupingType).Interval =
+ (DateInterval)Enum.Parse(typeof(DateInterval), item.Tag.ToString()!);
+ }
+ }
+ }
+ ForceRefreshGroupBox();
+ Fill();
+ }
+
+ private void OnConditionalFormattingClick(object? sender, EventArgs e)
+ {
+ var item = sender as KryptonContextMenuImageSelect ?? throw new ArgumentNullException(nameof(sender));
+ OutlookGridColumn col = (OutlookGridColumn)_internalColumns.FindFromColumnIndex(_colSelected)!;
+ ConditionalFormatting? format = _formatConditions.FirstOrDefault(x => x.ColumnName == col.Name);
+ ConditionalFormatting newformat = (item.Tag as List)![item.SelectedIndex];
+ if (format == null)
+ {
+ _formatConditions.Add(new ConditionalFormatting(col.DataGridViewColumn!.Name, newformat.FormatType, newformat.FormatParams));
+ }
+ else
+ {
+ format.FormatType = newformat.FormatType;
+ format.FormatParams = newformat.FormatParams;
+ }
+ item.SelectedIndex = -1; //I'm unable to get only one imageselect checked between solid and gradient, so reset the selected image
+ Fill();
+ }
+
+ private void OnTwoColorsCustomClick(object? sender, EventArgs e)
+ {
+ if (_rightToLeftLayout == RightToLeftLayout.LeftToRight)
+ {
+ VisualCustomFormatRuleForm fm = new VisualCustomFormatRuleForm(EnumConditionalFormatType.TwoColorsRange);
+ fm.ShowDialog();
+ if (fm.DialogResult == DialogResult.OK)
+ {
+ OutlookGridColumn col = (OutlookGridColumn)_internalColumns.FindFromColumnIndex(_colSelected)!;
+ ConditionalFormatting? format = _formatConditions.FirstOrDefault(x => x.ColumnName == col.Name);
+ if (format == null)
+ {
+ ConditionalFormatting newformat = new(col.DataGridViewColumn!.Name, EnumConditionalFormatType.TwoColorsRange, new TwoColorsParams(fm.MinimumColor, fm.MaximumColor));
+ _formatConditions.Add(newformat);
+ }
+ else
+ {
+ format.FormatType = EnumConditionalFormatType.TwoColorsRange;
+ format.FormatParams = new TwoColorsParams(fm.MinimumColor, fm.MaximumColor);
+ }
+ Fill();
+ }
+ fm.Dispose();
+ }
+ else
+ {
+ VisualCustomFormatRuleRtlAwareForm fm = new VisualCustomFormatRuleRtlAwareForm(EnumConditionalFormatType.TwoColorsRange);
+ fm.ShowDialog();
+ if (fm.DialogResult == DialogResult.OK)
+ {
+ OutlookGridColumn col = (OutlookGridColumn)_internalColumns.FindFromColumnIndex(_colSelected)!;
+ ConditionalFormatting? format = _formatConditions.FirstOrDefault(x => x.ColumnName == col.Name);
+ if (format == null)
+ {
+ ConditionalFormatting newformat = new(col.DataGridViewColumn!.Name, EnumConditionalFormatType.TwoColorsRange, new TwoColorsParams(fm.MinimumColor, fm.MaximumColor));
+ _formatConditions.Add(newformat);
+ }
+ else
+ {
+ format.FormatType = EnumConditionalFormatType.TwoColorsRange;
+ format.FormatParams = new TwoColorsParams(fm.MinimumColor, fm.MaximumColor);
+ }
+ Fill();
+ }
+ fm.Dispose();
+ }
+ }
+
+
+ private void OnThreeColorsCustomClick(object? sender, EventArgs e)
+ {
+ if (_rightToLeftLayout == RightToLeftLayout.LeftToRight)
+ {
+ VisualCustomFormatRuleForm fm = new VisualCustomFormatRuleForm(EnumConditionalFormatType.ThreeColorsRange);
+ fm.ShowDialog();
+ if (fm.DialogResult == DialogResult.OK)
+ {
+ OutlookGridColumn col = (OutlookGridColumn)_internalColumns.FindFromColumnIndex(_colSelected)!;
+ ConditionalFormatting? format = _formatConditions.FirstOrDefault(x => x.ColumnName == col.Name);
+ if (format == null)
+ {
+ ConditionalFormatting newformat = new(col.DataGridViewColumn!.Name, EnumConditionalFormatType.ThreeColorsRange, new ThreeColorsParams(Color.FromArgb(248, 105, 107), Color.FromArgb(255, 235, 132), Color.FromArgb(99, 190, 123)));
+ _formatConditions.Add(newformat);
+ }
+ else
+ {
+ format.FormatType = EnumConditionalFormatType.ThreeColorsRange;
+ format.FormatParams = new ThreeColorsParams(Color.FromArgb(248, 105, 107), Color.FromArgb(255, 235, 132), Color.FromArgb(99, 190, 123));
+ }
+ Fill();
+ }
+ fm.Dispose();
+ }
+ else
+ {
+ VisualCustomFormatRuleRtlAwareForm fm = new VisualCustomFormatRuleRtlAwareForm(EnumConditionalFormatType.ThreeColorsRange);
+ fm.ShowDialog();
+ if (fm.DialogResult == DialogResult.OK)
+ {
+ OutlookGridColumn col = (OutlookGridColumn)_internalColumns.FindFromColumnIndex(_colSelected)!;
+ ConditionalFormatting? format = _formatConditions.FirstOrDefault(x => x.ColumnName == col.Name);
+ if (format == null)
+ {
+ ConditionalFormatting newformat = new(col.DataGridViewColumn!.Name, EnumConditionalFormatType.ThreeColorsRange, new ThreeColorsParams(Color.FromArgb(248, 105, 107), Color.FromArgb(255, 235, 132), Color.FromArgb(99, 190, 123)));
+ _formatConditions.Add(newformat);
+ }
+ else
+ {
+ format.FormatType = EnumConditionalFormatType.ThreeColorsRange;
+ format.FormatParams = new ThreeColorsParams(Color.FromArgb(248, 105, 107), Color.FromArgb(255, 235, 132), Color.FromArgb(99, 190, 123));
+ }
+ Fill();
+ }
+ fm.Dispose();
+ }
+ }
+
+ private void OnBarCustomClick(object? sender, EventArgs e)
+ {
+ if (_rightToLeftLayout == RightToLeftLayout.LeftToRight)
+ {
+ VisualCustomFormatRuleForm fm = new VisualCustomFormatRuleForm(EnumConditionalFormatType.Bar);
+ fm.ShowDialog();
+ if (fm.DialogResult == DialogResult.OK)
+ {
+ OutlookGridColumn col = (OutlookGridColumn)_internalColumns.FindFromColumnIndex(_colSelected)!;
+ ConditionalFormatting? format = _formatConditions.FirstOrDefault(x => x.ColumnName == col.Name);
+ if (format == null)
+ {
+ ConditionalFormatting newformat = new(col.DataGridViewColumn!.Name, EnumConditionalFormatType.Bar, new BarParams(fm.MinimumColor, fm.Gradient));
+ _formatConditions.Add(newformat);
+ }
+ else
+ {
+ format.FormatType = EnumConditionalFormatType.Bar;
+ format.FormatParams = new BarParams(fm.MinimumColor, fm.Gradient);
+ }
+ Fill();
+ }
+ fm.Dispose();
+ }
+ else
+ {
+ VisualCustomFormatRuleRtlAwareForm fm = new VisualCustomFormatRuleRtlAwareForm(EnumConditionalFormatType.Bar);
+ fm.ShowDialog();
+ if (fm.DialogResult == DialogResult.OK)
+ {
+ OutlookGridColumn col = (OutlookGridColumn)_internalColumns.FindFromColumnIndex(_colSelected)!;
+ ConditionalFormatting? format = _formatConditions.FirstOrDefault(x => x.ColumnName == col.Name);
+ if (format == null)
+ {
+ ConditionalFormatting newformat = new(col.DataGridViewColumn!.Name, EnumConditionalFormatType.Bar, new BarParams(fm.MinimumColor, fm.Gradient));
+ _formatConditions.Add(newformat);
+ }
+ else
+ {
+ format.FormatType = EnumConditionalFormatType.Bar;
+ format.FormatParams = new BarParams(fm.MinimumColor, fm.Gradient);
+ }
+ Fill();
+ }
+ fm.Dispose();
+ }
+ }
+
+ private void OnClearConditionalClick(object? sender, EventArgs e)
+ {
+ OutlookGridColumn col = (OutlookGridColumn)_internalColumns.FindFromColumnIndex(_colSelected)!;
+ _formatConditions.RemoveAll(x => x.ColumnName == col.Name);
+ for (int i = 0; i < _internalRows.Count; i++)
+ {
+ FormattingCell fCell = (FormattingCell)_internalRows[i].Cells[_colSelected];
+ //fCell.FormatType = formatConditions[i].FormatType;
+ fCell.FormatParams = null;
+ }
+ Fill();
+ }
+
+
+ private void OnColumnVisibleCheckedChanged(object? sender, EventArgs e)
+ {
+ var item = sender as KryptonContextMenuCheckBox ?? throw new ArgumentNullException(nameof(sender));
+ Columns[(int)item.Tag!].Visible = item.Checked;
+ }
+
+ ///
+ /// Shows the groupbox
+ ///
+ ///
+ ///
+ private void OnShowGroupBox(object? sender, EventArgs e)
+ {
+ if (_groupBox != null)
+ {
+ _groupBox.Show();
+ }
+ }
+
+ ///
+ /// Hide the groupbox
+ ///
+ ///
+ ///
+ private void OnHideGroupBox(object? sender, EventArgs e)
+ {
+ if (_groupBox != null)
+ {
+ _groupBox.Hide();
+ }
+ }
+
+ ///
+ /// Resizes the selected column by the menu to best fit
+ ///
+ ///
+ ///
+ private void OnBestFitColumn(object? sender, EventArgs e)
+ {
+ if (_colSelected > -1)
+ {
+ Cursor.Current = Cursors.WaitCursor;
+ AutoResizeColumn(_colSelected, DataGridViewAutoSizeColumnMode.AllCells);
+ Cursor.Current = Cursors.Default;
+ }
+ }
+
+ ///
+ /// Resizes all columns to best fit
+ ///
+ ///
+ ///
+ private void OnBestFitAllColumns(object? sender, EventArgs e)
+ {
+ Cursor.Current = Cursors.WaitCursor;
+ AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCellsExceptHeader);
+ Cursor.Current = Cursors.Default;
+ }
+
+ ///
+ /// Handles the ColumnSortChangedEvent event. Update the header (glyph) and fill the grid too.
+ ///
+ /// Source of the event.
+ /// A OutlookGridColumnEventArgs that contains the event data.
+ private void ColumnSortChangedEvent(object? sender, OutlookGridColumnEventArgs e)
+ {
+ if (e is null)
+ {
+ throw new ArgumentNullException(nameof(e));
+ }
+#if DEBUG
+ Console.WriteLine(@"OutlookGrid - Receives ColumnSortChangedEvent : " + e.Column.Name + @" " + e.Column.SortDirection);
+#endif
+ _internalColumns[e.Column.Name!]!.SortDirection = e.Column.SortDirection;
+ _internalColumns[e.Column.Name!]!.DataGridViewColumn!.HeaderCell.SortGlyphDirection = e.Column.SortDirection;
+ Fill();
+ }
+
+ ///
+ /// Handles the ColumnGroupAddedEvent event. Fill the grid too.
+ ///
+ /// Source of the event.
+ /// A OutlookGridColumnEventArgs that contains the event data.
+ private void ColumnGroupAddedEvent(object? sender, OutlookGridColumnEventArgs e)
+ {
+ GroupColumn(e.Column.Name!, e.Column.SortDirection, null);
+ //We fill again the grid with the new Grouping info
+ Fill();
+#if DEBUG
+ Console.WriteLine(@"OutlookGrid - Receives ColumnGroupAddedEvent : " + e.Column.Name);
+#endif
+ }
+
+ ///
+ /// Handles the ColumnGroupRemovedEvent event. Fill the grid too.
+ ///
+ /// Source of the event.
+ /// A OutlookGridColumnEventArgs that contains the event data.
+ private void ColumnGroupRemovedEvent(object? sender, OutlookGridColumnEventArgs e)
+ {
+ UnGroupColumn(e.Column.Name!);
+ //We fill again the grid with the new Grouping info
+ Fill();
+#if DEBUG
+ Console.WriteLine(@"OutlookGrid - Receives ColumnGroupRemovedEvent : " + e.Column.Name);
+#endif
+ }
+
+ ///
+ /// Handles the ClearGroupingEvent event. Fill the grid too.
+ ///
+ /// Source of the event.
+ /// A EventArgs that contains the event data.
+ private void ClearGroupingEvent(object? sender, EventArgs e)
+ {
+ ClearGroups();
+#if DEBUG
+ Console.WriteLine(@"OutlookGrid - Receives ClearGroupingEvent");
+#endif
+ }
+
+ ///
+ /// Handles the FullCollapseEvent event.
+ ///
+ /// Source of the event.
+ /// A EventArgs that contains the event data.
+ private void FullCollapseEvent(object? sender, EventArgs e)
+ {
+ CollapseAll();
+#if DEBUG
+ Console.WriteLine(@"OutlookGrid - Receives FullCollapseEvent");
+#endif
+ }
+
+ ///
+ /// Handles the FullExpandEvent event.
+ ///
+ /// Source of the event.
+ /// A EventArgs that contains the event data.
+ private void FullExpandEvent(object? sender, EventArgs e)
+ {
+ ExpandAll();
+#if DEBUG
+ Console.WriteLine(@"OutlookGrid - Receives FullExpandEvent");
+#endif
+ }
+
+ ///
+ /// Handles the GroupExpandEvent event.
+ ///
+ ///
+ ///
+ private void GridGroupExpandEvent(object? sender, OutlookGridColumnEventArgs e)
+ {
+ Expand(e.Column.Name);
+#if DEBUG
+ Console.WriteLine(@"OutlookGrid - Receives GridGroupExpandEvent");
+#endif
+ }
+
+ private void GridGroupCollapseEvent(object? sender, OutlookGridColumnEventArgs e)
+ {
+ Collapse(e.Column.Name);
+#if DEBUG
+ Console.WriteLine(@"OutlookGrid - Receives GridGroupCollapseEvent");
+#endif
+ }
+
+ private void ColumnGroupIndexChangedEvent(object? sender, OutlookGridColumnEventArgs e)
+ {
+ //TODO 25/01/2014
+ _internalColumns.ChangeGroupIndex(e.Column);
+ Fill(); //to reflect the changes
+ ForceRefreshGroupBox();
+#if DEBUG
+ Console.WriteLine(@"OutlookGrid - Receives ColumnGroupIndexChangedEvent");
+#endif
+ }
+
+ private void GroupIntervalClickEvent(object? sender, OutlookGridColumnEventArgs e)
+ {
+ OutlookGridColumn col = (OutlookGridColumn)_internalColumns.FindFromColumnName(e.Column.Name)!;
+ (col.GroupingType as OutlookGridDateTimeGroup)!.Interval =
+ (e.Column.GroupingType as OutlookGridDateTimeGroup)!.Interval;
+ Fill();
+#if DEBUG
+ Console.WriteLine(@"OutlookGrid - Receives GroupIntervalClickEvent");
+#endif
+ }
+
+ private void SortBySummaryCountEvent(object? sender, OutlookGridColumnEventArgs e)
+ {
+ OutlookGridColumn col = (OutlookGridColumn)_internalColumns.FindFromColumnName(e.Column.Name)!;
+ if (col.GroupingType != null)
+ {
+ if (e.Column.GroupingType != null)
+ {
+ col.GroupingType.SortBySummaryCount = e.Column.GroupingType.SortBySummaryCount;
+ }
+ }
+ Fill();
+#if DEBUG
+ Console.WriteLine(@"OutlookGrid - Receives SortBySummaryCountEvent");
+#endif
+ }
+
+ ///
+ /// Raises the GroupImageClick event.
+ ///
+ /// A OutlookGridGroupImageEventArgs that contains the event data.
+ protected virtual void OnGroupImageClick(OutlookGridGroupImageEventArgs e)
+ {
+ if (GroupImageClick != null)
+ {
+ GroupImageClick(this, e);
+ }
+ }
+
+ ///
+ /// Raises the NodeExpanding event.
+ ///
+ /// A ExpandingEventArgs that contains the event data.
+ protected virtual void OnNodeExpanding(ExpandingEventArgs e)
+ {
+ if (NodeExpanding != null)
+ {
+ NodeExpanding(this, e);
+ }
+ }
+
+ ///
+ /// Raises the NodeExpanded event.
+ ///
+ /// A ExpandedEventArgs that contains the event data.
+ protected virtual void OnNodeExpanded(ExpandedEventArgs e)
+ {
+ if (NodeExpanded != null)
+ {
+ NodeExpanded(this, e);
+ }
+ }
+
+ ///
+ /// Raises the NodeCollapsing event.
+ ///
+ /// A CollapsingEventArgs that contains the event data.
+ protected virtual void OnNodeCollapsing(CollapsingEventArgs e)
+ {
+ if (NodeCollapsing != null)
+ {
+ NodeCollapsing(this, e);
+ }
+
+ }
+
+ ///
+ /// Raises the NodeCollapsed event.
+ ///
+ /// A CollapsedEventArgs that contains the event data.
+ protected virtual void OnNodeCollapsed(CollapsedEventArgs e)
+ {
+ if (NodeCollapsed != null)
+ {
+ NodeCollapsed(this, e);
+ }
+ }
+
+ #endregion
+
+ #region OutlookGrid methods
+
+ ///
+ /// Add a column for internal uses of the OutlookGrid. The column must already exists in the datagridview. Do this *BEFORE* using the grid (sorting and grouping, filling,...)
+ ///
+ /// The DataGridViewColumn.
+ /// The group type for the column.
+ /// The sort direction.
+ /// The column's position in grouping and at which level.
+ /// the column's position among sorted columns.
+ /// The comparer if needed
+ public void AddInternalColumn(DataGridViewColumn col, IOutlookGridGroup group, SortOrder sortDirection, int groupIndex, int sortIndex, IComparer? comparer)
+ {
+ AddInternalColumn(new OutlookGridColumn(col, group, sortDirection, groupIndex, sortIndex, comparer));
+ //internalColumns.Add(new OutlookGridColumn(col, group, sortDirection, groupIndex, sortIndex));
+ ////Already reflect the SortOrder on the column
+ //col.HeaderCell.SortGlyphDirection = sortDirection;
+ //if (this._hideColumnOnGrouping && groupIndex > -1 && group.AllowHiddenWhenGrouped)
+ // col.Visible = false;
+ }
+
+ ///
+ /// Add a column for internal uses of the OutlookGrid. The column must already exists in the datagridview. Do this *BEFORE* using the grid (sorting and grouping, filling,...)
+ ///
+ /// The DataGridViewColumn.
+ /// The group type for the column.
+ /// The sort direction.
+ /// The column's position in grouping and at which level.
+ /// the column's position among sorted columns.
+ public void AddInternalColumn(DataGridViewColumn col, IOutlookGridGroup group, SortOrder sortDirection, int groupIndex, int sortIndex) =>
+ AddInternalColumn(new OutlookGridColumn(col, group, sortDirection, groupIndex, sortIndex, null));
+
+ ///
+ /// Add a column for internal uses of the OutlookGrid. The column must already exists in the datagridview. Do this *BEFORE* using the grid (sorting and grouping, filling,...)
+ ///
+ /// The configured OutlookGridColumn.
+ public void AddInternalColumn(OutlookGridColumn col)
+ {
+ Debug.Assert(col != null);
+ if (col != null)
+ {
+ _internalColumns.Add(col);
+ //Already reflect the SortOrder on the column
+ col.DataGridViewColumn!.HeaderCell.SortGlyphDirection = col.SortDirection;
+ if (col.GroupingType != null && _hideColumnOnGrouping && col.GroupIndex > -1 && col.GroupingType.AllowHiddenWhenGrouped)
+ {
+ col.DataGridViewColumn.Visible = false;
+ }
+ }
+ }
+
+ ///
+ /// Add an array of OutlookGridColumns for internal use of OutlookGrid. The columns must already exist in the datagridview. Do this *BEFORE* using the grid (sorting and grouping, filling,...)
+ ///
+ /// The array of columns
+ public void AddRangeInternalColumns(params OutlookGridColumn[] cols)
+ {
+ Debug.Assert(cols != null);
+ // All columns with DisplayIndex != -1 are put into the initialColumns array
+ if (cols != null)
+ {
+ foreach (OutlookGridColumn col in cols)
+ {
+ AddInternalColumn(col);
+ }
+ }
+ }
+
+ ///
+ /// Add an array of OutlookGridColumns for internal use of OutlookGrid. The columns must already exist in the datagridview. Do this *BEFORE* using the grid (sorting and grouping, filling,...)
+ ///
+ /// The list of columns.
+ public void AddRangeInternalColumns(List cols)
+ {
+ Debug.Assert(cols != null);
+ // All columns with DisplayIndex != -1 are put into the initialColumns array
+ if (cols != null)
+ {
+ foreach (OutlookGridColumn col in cols)
+ {
+ AddInternalColumn(col);
+ }
+ }
+ }
+
+ ///
+ /// Group a column
+ ///
+ /// The name of the column.
+ /// The sort direction of the group./
+ /// The IOutlookGridGroup object.
+ public void GroupColumn(string columnName, SortOrder sortDirection, IOutlookGridGroup? gr) => GroupColumn(_internalColumns[columnName]!, sortDirection, gr);
+
+ ///
+ /// Group a column
+ ///
+ /// The name of the column.
+ /// The sort direction of the group./
+ /// The IOutlookGridGroup object.
+ public void GroupColumn(OutlookGridColumn col, SortOrder sortDirection, IOutlookGridGroup? gr)
+ {
+ if (!col.IsGrouped)
+ {
+ col.GroupIndex = ++_internalColumns.MaxGroupIndex;
+ if (col.SortIndex > -1)
+ {
+ _internalColumns.RemoveSortIndex(col);
+ }
+
+ col.SortDirection = sortDirection;
+ col.DataGridViewColumn!.HeaderCell.SortGlyphDirection = sortDirection;
+ if (gr != null)
+ {
+ col.GroupingType = gr;
+ }
+
+ if (col.GroupingType != null && _hideColumnOnGrouping && col.GroupingType.AllowHiddenWhenGrouped)
+ {
+ col.DataGridViewColumn.Visible = false;
+ }
+ }
+ }
+
+ ///
+ /// Ungroup a column
+ ///
+ /// The OutlookGridColumn.
+ public void UnGroupColumn(string columnName)
+ {
+ UnGroupColumn(_internalColumns[columnName]!);
+ }
+
+ ///
+ /// Ungroup a column
+ ///
+ /// The OutlookGridColumn.
+ public void UnGroupColumn(OutlookGridColumn col)
+ {
+ if (col.IsGrouped)
+ {
+ _internalColumns.RemoveGroupIndex(col);
+ col.SortDirection = SortOrder.None;
+ col.DataGridViewColumn!.HeaderCell.SortGlyphDirection = SortOrder.None;
+ if (col.GroupingType != null)
+ {
+ col.GroupingType.Collapsed = false;
+ if (_hideColumnOnGrouping && col.GroupingType.AllowHiddenWhenGrouped)
+ {
+ col.DataGridViewColumn.Visible = true;
+ }
+ }
+ }
+#if DEBUG
+ _internalColumns.DebugOutput();
+#endif
+ }
+
+ ///
+ /// Sort the column. Call Fill after to make the changes
+ ///
+ /// The outlookGridColumn
+ /// The new SortOrder.
+ public void SortColumn(OutlookGridColumn col, SortOrder sort)
+ {
+ //Change the SortIndex and MaxSortIndex only if it is not a grouped column
+ if (!col.IsGrouped && col.SortIndex == -1)
+ {
+ col.SortIndex = ++_internalColumns.MaxSortIndex;
+ }
+
+ //Change the order in all cases
+ col.SortDirection = sort;
+ col.DataGridViewColumn!.HeaderCell.SortGlyphDirection = sort;
+#if DEBUG
+ _internalColumns.DebugOutput();
+#endif
+ }
+
+ ///
+ /// UnSort the column. Call Fill after to make the changes
+ ///
+ /// The outlookGridColumn.
+ public void UnSortColumn(OutlookGridColumn col)
+ {
+ //Remove the SortIndex and rearrange the SortIndexes only if the column is not grouped
+ if (!col.IsGrouped)
+ {
+ _internalColumns.RemoveSortIndex(col);
+ col.SortDirection = SortOrder.None;
+ col.DataGridViewColumn!.HeaderCell.SortGlyphDirection = SortOrder.None;
+ }
+#if DEBUG
+ _internalColumns.DebugOutput();
+#endif
+ }
+
+ ///
+ /// Collapse all groups
+ ///
+ public void CollapseAll()
+ {
+ SetGroupCollapse(true);
+ }
+
+ ///
+ /// Expand all groups
+ ///
+ public void ExpandAll()
+ {
+ SetGroupCollapse(false);
+ }
+
+ ///
+ /// Expand all groups associated to a specific column
+ ///
+ /// The DataGridViewColumn
+ public void Expand(string? col)
+ {
+ SetGroupCollapse(col, false);
+ }
+
+ ///
+ /// Collapse all groups associated to a specific column
+ ///
+ /// The DataGridViewColumn
+ public void Collapse(string? col)
+ {
+ SetGroupCollapse(col, true);
+ }
+
+ ///
+ /// Expand a group row
+ ///
+ /// Index of the row
+ public void Expand(int row)
+ {
+ SetGroupCollapse(row, false);
+ }
+
+ ///
+ /// Collapse a group row
+ ///
+ /// Index of the row
+ public void Collapse(int row)
+ {
+ SetGroupCollapse(row, true);
+ }
+
+ ///
+ /// Clear all groups. Performs a fill grid too.
+ ///
+ public void ClearGroups()
+ {
+ ClearGroupsWithoutFilling();
+ Fill();
+ }
+
+ ///
+ /// Clear all groups. No FillGrid calls.
+ ///
+ public void ClearGroupsWithoutFilling()
+ {
+ //TODO check that
+ //reset groups and collapsed statuses
+ _groupCollection.Clear();
+ //reset groups in columns
+ _internalColumns.MaxGroupIndex = -1;
+ for (int i = 0; i < _internalColumns.Count; i++)
+ {
+ if (_internalColumns[i].IsGrouped)
+ {
+ _internalColumns[i].DataGridViewColumn!.Visible = true;
+ }
+
+ _internalColumns[i].GroupIndex = -1;
+ }
+ }
+
+ ///
+ /// Gets the index of the previous group row if any.
+ ///
+ /// Current row index
+ /// Index of the group row, -1 otherwise
+ public int PreviousGroupRowIndex(int currentRow)
+ {
+ for (int i = currentRow - 1; i >= 0; i--)
+ {
+ OutlookGridRow row = (OutlookGridRow)Rows[i];
+ if (row.IsGroupRow)
+ {
+ return i;
+ }
+ }
+ return -1;
+ }
+
+ ///
+ /// Gets all the subrows of a grouprow (recursive)
+ ///
+ /// The result list of OutlookGridRows
+ /// The IOutlookGridGroup that contains rows to inspect.
+ /// A list of OutlookGridRows
+ public List GetSubRows(ref List list, IOutlookGridGroup? groupRow)
+ {
+ list.AddRange(groupRow!.Rows);
+ for (int i = 0; i < groupRow.Children.Count; i++)
+ {
+ if (groupRow.Children.Count > 0)
+ {
+ GetSubRows(ref list, groupRow.Children[i]);
+ }
+ }
+
+ return list;
+ }
+
+ ///
+ /// Register for events concerning the groupbox
+ ///
+ public void RegisterGroupBoxEvents()
+ {
+ //Register for event of the associated KryptonGroupBox
+ if (GroupBox != null)
+ {
+ if (_groupBox != null)
+ {
+ _groupBox.ColumnGroupAdded += ColumnGroupAddedEvent;
+ _groupBox.ColumnSortChanged += ColumnSortChangedEvent;
+ _groupBox.ColumnGroupRemoved += ColumnGroupRemovedEvent;
+ _groupBox.ClearGrouping += ClearGroupingEvent;
+ _groupBox.FullCollapse += FullCollapseEvent;
+ _groupBox.FullExpand += FullExpandEvent;
+ _groupBox.ColumnGroupOrderChanged += ColumnGroupIndexChangedEvent;
+ _groupBox.GroupCollapse += GridGroupCollapseEvent;
+ _groupBox.GroupExpand += GridGroupExpandEvent;
+ _groupBox.GroupIntervalClick += GroupIntervalClickEvent;
+ _groupBox.SortBySummaryCount += SortBySummaryCountEvent;
+ }
+ }
+ }
+
+ ///
+ /// Synchronize the OutlookGrid Group Box with the current status of the grid
+ ///
+ public void ForceRefreshGroupBox()
+ {
+ if (_groupBox != null)
+ {
+ _groupBox.UpdateGroupingColumns(_internalColumns.FindGroupedColumns());
+ }
+ }
+
+ ///
+ /// Show the context menu header
+ ///
+ /// The column used by the context menu.
+ private void ShowColumnHeaderContextMenu(int columnIndex)
+ {
+ OutlookGridColumn? col = _internalColumns.FindFromColumnIndex(columnIndex);
+ // Create menu items the first time they are needed
+ if (_menuItems == null)
+ {
+ // Create individual items
+ /*_menuSortAscending = new KryptonContextMenuItem(LanguageManager.Instance.GetString("SORTASCENDING"), Resources.OutlookGridImageResources.sort_az_ascending2, OnColumnSortAscending);
+ _menuSortDescending = new KryptonContextMenuItem(LanguageManager.Instance.GetString("SORTDESCENDING"), Resources.OutlookGridImageResources.sort_az_descending2, new EventHandler(OnColumnSortDescending));
+ _menuClearSorting = new KryptonContextMenuItem(LanguageManager.Instance.GetString("CLEARSORTING"), Resources.OutlookGridImageResources.sort_up_down_delete_16, new EventHandler(OnColumnClearSorting));
+ _menuSeparator1 = new KryptonContextMenuSeparator();
+ _menuExpand = new KryptonContextMenuItem(LanguageManager.Instance.GetString("EXPAND"), Resources.OutlookGridImageResources.element_plus_16, new EventHandler(OnGroupExpand));
+ _menuCollapse = new KryptonContextMenuItem(LanguageManager.Instance.GetString("COLLAPSE"), Resources.OutlookGridImageResources.element_minus_16, new EventHandler(OnGroupCollapse));
+ _menuSeparator4 = new KryptonContextMenuSeparator();
+ _menuGroupByThisColumn = new KryptonContextMenuItem(LanguageManager.Instance.GetString("GROUP"), Resources.OutlookGridImageResources.element, new EventHandler(OnGroupByThisColumn));
+ _menuUngroupByThisColumn = new KryptonContextMenuItem(LanguageManager.Instance.GetString("UNGROUP"), Resources.OutlookGridImageResources.element_delete, new EventHandler(OnUnGroupByThisColumn));
+ _menuShowGroupBox = new KryptonContextMenuItem(LanguageManager.Instance.GetString("SHOWGROUPBOX"), null, new EventHandler(OnShowGroupBox));
+ _menuHideGroupBox = new KryptonContextMenuItem(LanguageManager.Instance.GetString("HIDEGROUPBOX"), null, new EventHandler(OnHideGroupBox));
+ _menuSeparator2 = new KryptonContextMenuSeparator();
+ _menuBestFitColumn = new KryptonContextMenuItem(LanguageManager.Instance.GetString("BESTFIT"), null, new EventHandler(OnBestFitColumn));
+ _menuBestFitAllColumns = new KryptonContextMenuItem(LanguageManager.Instance.GetString("BESTFITALL"), Resources.OutlookGridImageResources.fit_to_size, new EventHandler(OnBestFitAllColumns));
+ _menuSeparator3 = new KryptonContextMenuSeparator();
+ _menuVisibleColumns = new KryptonContextMenuItem(LanguageManager.Instance.GetString("COLUMNS"), Resources.OutlookGridImageResources.table2_selection_column, null);
+ _menuGroupInterval = new KryptonContextMenuItem(LanguageManager.Instance.GetString("GROUPINTERVAL"));
+ _menuSortBySummary = new KryptonContextMenuItem(LanguageManager.Instance.GetString("SORTBYSUMMARYCOUNT"), null, new EventHandler(OnSortBySummary));
+ _menuSortBySummary.CheckOnClick = true;
+ _menuSeparator5 = new KryptonContextMenuSeparator();
+ _menuConditionalFormatting = new KryptonContextMenuItem(LanguageManager.Instance.GetString("CONDITIONALFORMATTING"), Resources.OutlookGridImageResources.table_conditional_16, null);*/
+
+ #region Localisation
+
+ _menuSortAscending = new KryptonContextMenuItem(KryptonManager.Strings.OutlookGridStrings.SortAscending, SortingImageResources.sort_az_ascending2, OnColumnSortAscending);
+ _menuSortDescending = new KryptonContextMenuItem(KryptonManager.Strings.OutlookGridStrings.SortDescending, SortingImageResources.sort_az_descending2, OnColumnSortDescending);
+ _menuClearSorting = new KryptonContextMenuItem(KryptonManager.Strings.OutlookGridStrings.ClearSorting, SortingImageResources.sort_up_down_delete_16, OnColumnClearSorting);
+ _menuSeparator1 = new KryptonContextMenuSeparator();
+ _menuExpand = new KryptonContextMenuItem(KryptonManager.Strings.OutlookGridStrings.Expand, ElementsImageResources.element_plus_16, OnGroupExpand);
+ _menuCollapse = new KryptonContextMenuItem(KryptonManager.Strings.OutlookGridStrings.Collapse, ElementsImageResources.element_minus_16, OnGroupCollapse);
+ _menuSeparator4 = new KryptonContextMenuSeparator();
+ _menuGroupByThisColumn = new KryptonContextMenuItem(KryptonManager.Strings.OutlookGridStrings.Group, ElementsImageResources.element, OnGroupByThisColumn);
+ _menuUngroupByThisColumn = new KryptonContextMenuItem(KryptonManager.Strings.OutlookGridStrings.Ungroup, ElementsImageResources.element_delete, OnUnGroupByThisColumn);
+ _menuShowGroupBox = new KryptonContextMenuItem(KryptonManager.Strings.OutlookGridStrings.ShowGroupBox, null, OnShowGroupBox);
+ _menuHideGroupBox = new KryptonContextMenuItem(KryptonManager.Strings.OutlookGridStrings.HideGroupBox, null, OnHideGroupBox);
+ _menuSeparator2 = new KryptonContextMenuSeparator();
+ _menuBestFitColumn = new KryptonContextMenuItem(KryptonManager.Strings.OutlookGridStrings.BestFit, null, OnBestFitColumn);
+ _menuBestFitAllColumns = new KryptonContextMenuItem(KryptonManager.Strings.OutlookGridStrings.BestFitAll, GenericImageResources.fit_to_size, OnBestFitAllColumns);
+ _menuSeparator3 = new KryptonContextMenuSeparator();
+ _menuVisibleColumns = new KryptonContextMenuItem(KryptonManager.Strings.OutlookGridStrings.Columns, GenericImageResources.table2_selection_column, null);
+ _menuGroupInterval = new KryptonContextMenuItem(KryptonManager.Strings.OutlookGridStrings.GroupInterval);
+ _menuSortBySummary = new KryptonContextMenuItem(KryptonManager.Strings.OutlookGridStrings.SortBySummaryCount, null, OnSortBySummary);
+ _menuSortBySummary.CheckOnClick = true;
+ _menuSeparator5 = new KryptonContextMenuSeparator();
+ _menuConditionalFormatting = new KryptonContextMenuItem(KryptonManager.Strings.OutlookGridStrings.ConditionalFormatting, GenericImageResources.table_conditional_16, null);
+
+ #endregion
+
+ //Group Interval
+ KryptonContextMenuItems groupIntervalItems;
+ KryptonContextMenuItem? it;
+ string[] names = Enum.GetNames(typeof(DateInterval));
+ KryptonContextMenuItemBase[] arrayOptions = new KryptonContextMenuItemBase[names.Length];
+ for (int i = 0; i < names.Length; i++)
+ {
+ it = new KryptonContextMenuItem(OutlookGridLanguageManager.Instance.GetString(names[i]));
+ it.Tag = names[i];
+ it.Click += OnGroupIntervalClick;
+ arrayOptions[i] = it;
+ }
+ groupIntervalItems = new KryptonContextMenuItems(arrayOptions);
+ _menuGroupInterval.Items.Add(groupIntervalItems);
+
+ //Visible Columns
+ KryptonContextMenuCheckBox? itCheckbox;
+ KryptonContextMenuItemBase?[] arrayCols = new KryptonContextMenuItemBase?[Columns.Count];
+ for (int i = 0; i < Columns.Count; i++)
+ {
+ itCheckbox = new KryptonContextMenuCheckBox(Columns[i].HeaderText);
+ itCheckbox.Checked = Columns[i].Visible;
+ itCheckbox.Tag = Columns[i].Index;
+ itCheckbox.CheckedChanged += OnColumnVisibleCheckedChanged;
+ arrayCols[i] = itCheckbox;
+ }
+ _menuVisibleColumns.Items.AddRange(arrayCols!);
+
+ //Conditional formatting
+ ImageList imgListFormatting = new();
+ imgListFormatting.ColorDepth = ColorDepth.Depth32Bit;
+ imgListFormatting.ImageSize = new Size(32, 32);
+ List tmpTag = new();
+ imgListFormatting.Images.Add(DataBarImageResources.Databar_solid_blue_32);
+ tmpTag.Add(new ConditionalFormatting(EnumConditionalFormatType.Bar, new BarParams(Color.FromArgb(76, 118, 255), false)));
+ imgListFormatting.Images.Add(DataBarImageResources.Databar_solid_green_32);
+ tmpTag.Add(new ConditionalFormatting(EnumConditionalFormatType.Bar, new BarParams(Color.FromArgb(95, 173, 123), false)));
+ imgListFormatting.Images.Add(DataBarImageResources.Databar_solid_red_32);
+ tmpTag.Add(new ConditionalFormatting(EnumConditionalFormatType.Bar, new BarParams(Color.FromArgb(248, 108, 103), false)));
+ imgListFormatting.Images.Add(DataBarImageResources.Databar_solid_yellow_32);
+ tmpTag.Add(new ConditionalFormatting(EnumConditionalFormatType.Bar, new BarParams(Color.FromArgb(255, 185, 56), false)));
+ imgListFormatting.Images.Add(DataBarImageResources.Databar_solid_violet_32);
+ tmpTag.Add(new ConditionalFormatting(EnumConditionalFormatType.Bar, new BarParams(Color.FromArgb(185, 56, 255), false)));
+ imgListFormatting.Images.Add(DataBarImageResources.Databar_solid_pink_32);
+ tmpTag.Add(new ConditionalFormatting(EnumConditionalFormatType.Bar, new BarParams(Color.FromArgb(255, 56, 185), false)));
+
+ imgListFormatting.Images.Add(DataBarImageResources.Databar_gradient_blue_32);
+ tmpTag.Add(new ConditionalFormatting(EnumConditionalFormatType.Bar, new BarParams(Color.FromArgb(76, 118, 255), true)));
+ imgListFormatting.Images.Add(DataBarImageResources.Databar_gradient_green_32);
+ tmpTag.Add(new ConditionalFormatting(EnumConditionalFormatType.Bar, new BarParams(Color.FromArgb(95, 173, 123), true)));
+ imgListFormatting.Images.Add(DataBarImageResources.Databar_gradient_red_32);
+ tmpTag.Add(new ConditionalFormatting(EnumConditionalFormatType.Bar, new BarParams(Color.FromArgb(248, 108, 103), true)));
+ imgListFormatting.Images.Add(DataBarImageResources.Databar_gradient_yellow_32);
+ tmpTag.Add(new ConditionalFormatting(EnumConditionalFormatType.Bar, new BarParams(Color.FromArgb(255, 185, 56), true)));
+ imgListFormatting.Images.Add(DataBarImageResources.Databar_gradient_violet_32);
+ tmpTag.Add(new ConditionalFormatting(EnumConditionalFormatType.Bar, new BarParams(Color.FromArgb(185, 56, 255), true)));
+ imgListFormatting.Images.Add(DataBarImageResources.Databar_gradient_pink_32);
+ tmpTag.Add(new ConditionalFormatting(EnumConditionalFormatType.Bar, new BarParams(Color.FromArgb(255, 56, 185), true)));
+
+ imgListFormatting.Images.Add(OutlookGridImageResources.TwoColors_white_blue_32);
+ tmpTag.Add(new ConditionalFormatting(EnumConditionalFormatType.TwoColorsRange, new TwoColorsParams(Color.White, Color.FromArgb(76, 118, 255))));
+ imgListFormatting.Images.Add(OutlookGridImageResources.TwoColors_blue_white_32);
+ tmpTag.Add(new ConditionalFormatting(EnumConditionalFormatType.TwoColorsRange, new TwoColorsParams(Color.FromArgb(76, 118, 255), Color.White)));
+ imgListFormatting.Images.Add(OutlookGridImageResources.TwoColors_white_green_32);
+ tmpTag.Add(new ConditionalFormatting(EnumConditionalFormatType.TwoColorsRange, new TwoColorsParams(Color.White, Color.FromArgb(95, 173, 123))));
+ imgListFormatting.Images.Add(OutlookGridImageResources.TwoColors_green_white_32);
+ tmpTag.Add(new ConditionalFormatting(EnumConditionalFormatType.TwoColorsRange, new TwoColorsParams(Color.FromArgb(95, 173, 123), Color.White)));
+ imgListFormatting.Images.Add(OutlookGridImageResources.TwoColors_white_red_32);
+ tmpTag.Add(new ConditionalFormatting(EnumConditionalFormatType.TwoColorsRange, new TwoColorsParams(Color.White, Color.FromArgb(248, 108, 103))));
+ imgListFormatting.Images.Add(OutlookGridImageResources.TwoColors_red_white_32);
+ tmpTag.Add(new ConditionalFormatting(EnumConditionalFormatType.TwoColorsRange, new TwoColorsParams(Color.FromArgb(248, 108, 103), Color.White)));
+ imgListFormatting.Images.Add(OutlookGridImageResources.TwoColors_white_yellow_32);
+ tmpTag.Add(new ConditionalFormatting(EnumConditionalFormatType.TwoColorsRange, new TwoColorsParams(Color.White, Color.FromArgb(255, 185, 56))));
+ imgListFormatting.Images.Add(OutlookGridImageResources.TwoColors_yellow_white_32);
+ tmpTag.Add(new ConditionalFormatting(EnumConditionalFormatType.TwoColorsRange, new TwoColorsParams(Color.FromArgb(255, 185, 56), Color.White)));
+ imgListFormatting.Images.Add(OutlookGridImageResources.TwoColors_white_violet_32);
+ tmpTag.Add(new ConditionalFormatting(EnumConditionalFormatType.TwoColorsRange, new TwoColorsParams(Color.White, Color.FromArgb(185, 56, 255))));
+ imgListFormatting.Images.Add(OutlookGridImageResources.TwoColors_violet_white_32);
+ tmpTag.Add(new ConditionalFormatting(EnumConditionalFormatType.TwoColorsRange, new TwoColorsParams(Color.FromArgb(185, 56, 255), Color.White)));
+ imgListFormatting.Images.Add(OutlookGridImageResources.TwoColors_white_pink_32);
+ tmpTag.Add(new ConditionalFormatting(EnumConditionalFormatType.TwoColorsRange, new TwoColorsParams(Color.White, Color.FromArgb(255, 56, 185))));
+ imgListFormatting.Images.Add(OutlookGridImageResources.TwoColors_pink_white_32);
+ tmpTag.Add(new ConditionalFormatting(EnumConditionalFormatType.TwoColorsRange, new TwoColorsParams(Color.FromArgb(255, 56, 185), Color.White)));
+
+ imgListFormatting.Images.Add(OutlookGridImageResources.ThreeColors_green_yellow_red_32);
+ tmpTag.Add(new ConditionalFormatting(EnumConditionalFormatType.ThreeColorsRange, new ThreeColorsParams(Color.FromArgb(84, 179, 112), Color.FromArgb(252, 229, 130), Color.FromArgb(243, 120, 97))));
+ imgListFormatting.Images.Add(OutlookGridImageResources.ThreeColors_red_yellow_green_32);
+ tmpTag.Add(new ConditionalFormatting(EnumConditionalFormatType.ThreeColorsRange, new ThreeColorsParams(Color.FromArgb(243, 120, 97), Color.FromArgb(252, 229, 130), Color.FromArgb(84, 179, 112))));
+ imgListFormatting.Images.Add(OutlookGridImageResources.ThreeColors_green_white_red_32);
+ tmpTag.Add(new ConditionalFormatting(EnumConditionalFormatType.ThreeColorsRange, new ThreeColorsParams(Color.FromArgb(84, 179, 112), Color.White, Color.FromArgb(243, 120, 97))));
+ imgListFormatting.Images.Add(OutlookGridImageResources.ThreeColors_red_white_green_32);
+ tmpTag.Add(new ConditionalFormatting(EnumConditionalFormatType.ThreeColorsRange, new ThreeColorsParams(Color.FromArgb(243, 120, 97), Color.White, Color.FromArgb(84, 179, 112))));
+ imgListFormatting.Images.Add(OutlookGridImageResources.ThreeColors_blue_white_red_32);
+ tmpTag.Add(new ConditionalFormatting(EnumConditionalFormatType.ThreeColorsRange, new ThreeColorsParams(Color.FromArgb(134, 166, 253), Color.White, Color.FromArgb(243, 120, 97))));
+ imgListFormatting.Images.Add(OutlookGridImageResources.ThreeColors_red_white_blue_32);
+ tmpTag.Add(new ConditionalFormatting(EnumConditionalFormatType.ThreeColorsRange, new ThreeColorsParams(Color.FromArgb(243, 120, 97), Color.White, Color.FromArgb(134, 166, 253))));
+
+
+ it = null;
+ names = Enum.GetNames(typeof(EnumConditionalFormatType));
+ arrayOptions = new KryptonContextMenuItemBase[names.Length + 2];
+ for (int i = 0; i < names.Length; i++)
+ {
+ it = new KryptonContextMenuItem(OutlookGridLanguageManager.Instance.GetString(names[i]));
+ it.Tag = names[i];
+
+ if (names[i] == EnumConditionalFormatType.Bar.ToString())
+ {
+ it.Image = DataBarImageResources.databar_generic_16;
+
+ //Solid
+ KryptonContextMenuHeading kFormattingBarHeadingSolid = new();
+ kFormattingBarHeadingSolid.Text = KryptonManager.Strings.OutlookGridStrings.SolidFill;
+ KryptonContextMenuImageSelect kFormattingBarImgSelectSolid = new();
+ kFormattingBarImgSelectSolid.ImageList = imgListFormatting;
+ kFormattingBarImgSelectSolid.ImageIndexStart = 0;
+ kFormattingBarImgSelectSolid.ImageIndexEnd = 5;
+ kFormattingBarImgSelectSolid.LineItems = 4;
+ kFormattingBarImgSelectSolid.Tag = tmpTag;
+ kFormattingBarImgSelectSolid.Click += OnConditionalFormattingClick;
+
+ //Gradient
+ KryptonContextMenuHeading kFormattingBarHeadingGradient = new();
+ kFormattingBarHeadingGradient.Text = KryptonManager.Strings.OutlookGridStrings.GradientFill;
+ KryptonContextMenuImageSelect kFormattingBarImgSelectGradient = new();
+ kFormattingBarImgSelectGradient.ImageList = imgListFormatting;
+ kFormattingBarImgSelectGradient.ImageIndexStart = 6;
+ kFormattingBarImgSelectGradient.ImageIndexEnd = 11;
+ kFormattingBarImgSelectGradient.LineItems = 4;
+ kFormattingBarImgSelectGradient.Tag = tmpTag;
+ kFormattingBarImgSelectGradient.Click += OnConditionalFormattingClick;
+
+ //Custom
+ KryptonContextMenuHeading kFormattingBarHeadingOther = new();
+ kFormattingBarHeadingOther.Text = KryptonManager.Strings.OutlookGridStrings.Other;
+ KryptonContextMenuItem? it2;
+ it2 = new KryptonContextMenuItem(KryptonManager.Strings.OutlookGridStrings.CustomThreeDots);
+ it2.Tag = "";
+ it2.Image = GenericImageResources.paint_bucket_green;
+ it2.Click += OnBarCustomClick;
+
+ KryptonContextMenuItems bars = new(new KryptonContextMenuItemBase[] { it2 });
+
+ //Menu construction
+ it.Items.AddRange(new KryptonContextMenuItemBase[] {
+ kFormattingBarHeadingSolid,
+ kFormattingBarImgSelectSolid,
+ kFormattingBarHeadingGradient,
+ kFormattingBarImgSelectGradient,
+ kFormattingBarHeadingOther,
+ bars
+ });
+ }
+ else if (names[i] == EnumConditionalFormatType.TwoColorsRange.ToString())
+ {
+ it.Image = OutlookGridImageResources.color2scale_generic_16;
+
+ KryptonContextMenuItems twoColors;
+
+ KryptonContextMenuImageSelect kTwoColorsImgSelect = new();
+ kTwoColorsImgSelect.ImageList = imgListFormatting;
+ kTwoColorsImgSelect.ImageIndexStart = 12;
+ kTwoColorsImgSelect.ImageIndexEnd = 23;
+ kTwoColorsImgSelect.LineItems = 4;
+ kTwoColorsImgSelect.Tag = tmpTag;
+ kTwoColorsImgSelect.Click += OnConditionalFormattingClick;
+ it.Items.Add(kTwoColorsImgSelect);
+
+ KryptonContextMenuSeparator sep1 = new();
+ sep1.Tag = "";
+
+ KryptonContextMenuItem? it2;
+ it2 = new KryptonContextMenuItem(KryptonManager.Strings.OutlookGridStrings.CustomThreeDots);
+ it2.Tag = "";
+ it2.Image = GenericImageResources.paint_bucket_green;
+ it2.Click += OnTwoColorsCustomClick;
+
+ twoColors = new KryptonContextMenuItems(new KryptonContextMenuItemBase[] { sep1, it2 });
+ it.Items.Add(twoColors);
+ }
+ else if (names[i] == EnumConditionalFormatType.ThreeColorsRange.ToString())
+ {
+ it.Image = OutlookGridImageResources.color3scale_generic_16;
+
+ KryptonContextMenuItems threeColors;
+
+ KryptonContextMenuImageSelect kThreeColorsImgSelect = new();
+ kThreeColorsImgSelect.ImageList = imgListFormatting;
+ kThreeColorsImgSelect.ImageIndexStart = 24;
+ kThreeColorsImgSelect.ImageIndexEnd = 29;
+ kThreeColorsImgSelect.LineItems = 4;
+ kThreeColorsImgSelect.Tag = tmpTag;
+ kThreeColorsImgSelect.Click += OnConditionalFormattingClick;
+ it.Items.Add(kThreeColorsImgSelect);
+
+ KryptonContextMenuSeparator sep1 = new();
+ sep1.Tag = "";
+
+ KryptonContextMenuItem? it2;
+ it2 = new KryptonContextMenuItem(KryptonManager.Strings.OutlookGridStrings.CustomThreeDots);
+ it2.Tag = "";
+ it2.Image = GenericImageResources.paint_bucket_green;
+ it2.Click += OnThreeColorsCustomClick;
+
+ threeColors = new KryptonContextMenuItems(new KryptonContextMenuItemBase[] { sep1, it2 });
+ it.Items.Add(threeColors);
+ }
+
+ arrayOptions[i] = it;
+ KryptonContextMenuSeparator sep2 = new();
+ sep2.Tag = "";
+ arrayOptions[i + 1] = sep2;
+ KryptonContextMenuItem? it3;
+ it3 = new KryptonContextMenuItem(KryptonManager.Strings.OutlookGridStrings.ClearRules);
+ it3.Image = GenericImageResources.eraser;
+ it3.Tag = "";
+ it3.Click += OnClearConditionalClick;
+ arrayOptions[i + 2] = it3;
+ }
+ KryptonContextMenuItems conditionalFormattingItems = new(arrayOptions);
+ _menuConditionalFormatting.Items.Add(conditionalFormattingItems);
+
+ //Add items inside an items collection (apart from separator1 which is only added if required)
+ _menuItems = new KryptonContextMenuItems(new KryptonContextMenuItemBase[] { _menuSortAscending,
+ _menuSortDescending,
+ _menuSortBySummary,
+ _menuClearSorting,
+ _menuSeparator1,
+ _menuExpand,
+ _menuCollapse,
+ _menuSeparator4,
+ _menuGroupByThisColumn,
+ _menuGroupInterval,
+ _menuUngroupByThisColumn,
+ _menuShowGroupBox,
+ _menuHideGroupBox,
+ _menuSeparator2,
+ _menuBestFitColumn,
+ _menuBestFitAllColumns,
+ _menuSeparator3,
+ _menuVisibleColumns,
+ _menuSeparator5,
+ _menuConditionalFormatting});
+ }
+
+ // Ensure we have a krypton context menu if not already present
+ _contextMenu ??= new KryptonContextMenu();
+
+ // Update the individual menu options
+ if (col != null)
+ {
+ _menuSortAscending.Visible = col.DataGridViewColumn!.SortMode != DataGridViewColumnSortMode.NotSortable;
+ _menuSortAscending.Checked = col.SortDirection == SortOrder.Ascending ? true : false;
+ _menuSortDescending.Checked = col.SortDirection == SortOrder.Descending ? true : false;
+ _menuSortDescending.Visible = col.DataGridViewColumn.SortMode != DataGridViewColumnSortMode.NotSortable;
+ _menuSortBySummary.Visible = col.IsGrouped && col.GroupingType != null;
+ if (_menuSortBySummary.Visible)
+ {
+ _menuSortBySummary.Checked = col.GroupingType!.SortBySummaryCount;
+ }
+
+ _menuClearSorting.Enabled = col.SortDirection != SortOrder.None && !col.IsGrouped;
+ _menuClearSorting.Visible = col.DataGridViewColumn.SortMode != DataGridViewColumnSortMode.NotSortable;
+ _menuSeparator1.Visible = _menuSortAscending.Visible || _menuSortDescending.Visible || _menuClearSorting.Visible;
+ _menuExpand.Visible = col.IsGrouped;
+ _menuCollapse.Visible = col.IsGrouped;
+ _menuSeparator4.Visible = _menuExpand.Visible || _menuCollapse.Visible;
+ _menuGroupByThisColumn.Visible = !col.IsGrouped && col.DataGridViewColumn.SortMode != DataGridViewColumnSortMode.NotSortable;
+ _menuGroupInterval.Visible = col.IsGrouped && col.DataGridViewColumn.SortMode != DataGridViewColumnSortMode.NotSortable && col.GroupingType?.GetType() == typeof(OutlookGridDateTimeGroup);
+ if (_menuGroupInterval.Visible)
+ {
+ string? currentInterval = Enum.GetName(typeof(DateInterval), ((col.GroupingType as OutlookGridDateTimeGroup)!).Interval);
+ foreach (KryptonContextMenuItem item in ((KryptonContextMenuItems)_menuGroupInterval.Items[0]).Items)
+ {
+ item.Checked = item.Tag!.ToString() == currentInterval;
+ }
+ }
+ _menuUngroupByThisColumn.Visible = col.IsGrouped && col.DataGridViewColumn.SortMode != DataGridViewColumnSortMode.NotSortable;
+ _menuShowGroupBox.Visible = _groupBox != null && !_groupBox.Visible;
+ _menuHideGroupBox.Visible = _groupBox != null && _groupBox.Visible;
+ _menuSeparator2.Visible = _menuGroupByThisColumn.Visible || _menuUngroupByThisColumn.Visible || _menuShowGroupBox.Visible || _menuHideGroupBox.Visible;
+ _menuBestFitColumn.Visible = true;
+ if (col.DataGridViewColumn.GetType() == typeof(KryptonDataGridViewFormattingColumn))
+ {
+ _menuSeparator5.Visible = true;
+ _menuConditionalFormatting.Visible = true;
+
+ //Get the format condition
+ ConditionalFormatting format = _formatConditions.FirstOrDefault(x => x.ColumnName == col.Name)!;
+
+ for (int i = 0; i < _menuConditionalFormatting.Items[0].ItemChildCount; i++)
+ {
+ if (format != null
+ && (_menuConditionalFormatting.Items[0] as KryptonContextMenuItems)!.Items[i].Tag!.ToString()!.Equals(format.FormatType.ToString()))
+ {
+ ((KryptonContextMenuItem)((KryptonContextMenuItems)_menuConditionalFormatting.Items[0]).Items[i]).Checked = true;
+ }
+ else
+ {
+ if (((KryptonContextMenuItems)_menuConditionalFormatting.Items[0]).Items[i].GetType() != typeof(KryptonContextMenuSeparator))
+ {
+ ((KryptonContextMenuItem)((KryptonContextMenuItems)_menuConditionalFormatting.Items[0]).Items[i]).Checked = false;
+ }
+ }
+ }
+ }
+ else
+ {
+ _menuSeparator5.Visible = false;
+ _menuConditionalFormatting.Visible = false;
+ }
+ }
+ else
+ {
+ _menuSortAscending.Visible = false;
+ _menuSortDescending.Visible = false;
+ _menuSortBySummary.Visible = false;
+ _menuClearSorting.Visible = false;
+ _menuSeparator1.Visible = _menuSortAscending.Visible || _menuSortDescending.Visible || _menuClearSorting.Visible;
+ _menuExpand.Visible = false;
+ _menuCollapse.Visible = false;
+ _menuSeparator4.Visible = _menuExpand.Visible || _menuCollapse.Visible;
+ _menuGroupByThisColumn.Visible = false;
+ _menuGroupInterval.Visible = false;
+ _menuUngroupByThisColumn.Visible = false;
+ _menuShowGroupBox.Visible = _groupBox != null && !_groupBox.Visible;
+ _menuHideGroupBox.Visible = _groupBox != null && _groupBox.Visible;
+ _menuSeparator2.Visible = _menuGroupByThisColumn.Visible || _menuUngroupByThisColumn.Visible || _menuShowGroupBox.Visible || _menuHideGroupBox.Visible;
+ _menuBestFitColumn.Visible = false;
+ _menuSeparator5.Visible = false;
+ _menuConditionalFormatting.Visible = false;
+
+ }
+
+ if (!_contextMenu.Items.Contains(_menuItems))
+ {
+ _contextMenu.Items.Add(_menuItems);
+ }
+
+ // Show the menu!
+ _contextMenu.Show(this);
+ }
+
+ ///
+ /// Clear all sorting columns only (not the grouped ones)
+ ///
+ public void ResetAllSortingColumns()
+ {
+ _internalColumns.MaxSortIndex = -1;
+ foreach (OutlookGridColumn col in _internalColumns)
+ {
+ if (!col.IsGrouped && col.SortDirection != SortOrder.None)
+ {
+ col.DataGridViewColumn!.HeaderCell.SortGlyphDirection = SortOrder.None;
+ col.SortDirection = SortOrder.None;
+ col.SortIndex = -1;
+ }
+ }
+#if DEBUG
+ _internalColumns.DebugOutput();
+#endif
+ }
+
+ /////
+ ///// Sort the grid
+ /////
+ ///// The IComparer object.
+ //public void Sort(IComparer comparer)
+ //{
+ // Fill();
+ //}
+
+ ///
+ /// Clears the internal rows.
+ ///
+ public void ClearInternalRows()
+ {
+ _internalRows.Clear();
+ }
+
+ ///
+ /// Assign the rows to the internal list.
+ ///
+ /// List of OutlookGridRows
+ public void AssignRows(List l)
+ {
+ _internalRows = l;
+ }
+
+ ///
+ /// Assign the rows to the internal list.
+ ///
+ /// DataGridViewRowCollection
+ public void AssignRows(DataGridViewRowCollection col)
+ {
+ //dataSource.Rows = col.Cast().ToList();
+ _internalRows = col.Cast().ToList();
+ }
+
+ ///
+ /// Collapse/Expand all group rows
+ ///
+ /// True if collapsed, false if expanded
+ private void SetGroupCollapse(bool collapsed)
+ {
+ if (!IsGridGrouped || _internalRows.Count == 0)
+ {
+ return;
+ }
+
+ //// loop through all rows to find the GroupRows
+ //for (int i = 0; i < this.Rows.Count; i++)
+ //{
+ // if (((OutlookGridRow)this.Rows[i]).IsGroupRow)
+ // ((OutlookGridRow)this.Rows[i]).Group.Collapsed = collapsed;
+ //}
+ RecursiveSetGroupCollapse(_groupCollection, collapsed);
+
+ // workaround, make the grid refresh properly
+ Rows[0].Visible = !Rows[0].Visible;
+ Rows[0].Visible = !Rows[0].Visible;
+
+ //When collapsing the first row still seeing it.
+ if (Rows[0].Index < FirstDisplayedScrollingRowIndex)
+ {
+ FirstDisplayedScrollingRowIndex = Rows[0].Index;
+ }
+ }
+
+ private void RecursiveSetGroupCollapse(OutlookGridGroupCollection col, bool collapsed)
+ {
+ for (int i = 0; i < col.Count; i++)
+ {
+ col[i]!.Collapsed = collapsed;
+ RecursiveSetGroupCollapse(col[i]!.Children, collapsed);
+ }
+ }
+
+ private void SetGroupCollapse(string? c, bool collapsed)
+ {
+ if (!IsGridGrouped || _internalRows.Count == 0)
+ {
+ return;
+ }
+
+ // loop through all rows to find the GroupRows
+ //for (int i = 0; i < this.Rows.Count; i++)
+ //{
+ // if (((OutlookGridRow)this.Rows[i]).IsGroupRow && ((OutlookGridRow)this.Rows[i]).Group.Column.DataGridViewColumn.Name == c.Name)
+ // ((OutlookGridRow)this.Rows[i]).Group.Collapsed = collapsed;
+ //}
+ RecursiveSetGroupCollapse(c, _groupCollection, collapsed);
+
+ // workaround, make the grid refresh properly
+ Rows[0].Visible = !Rows[0].Visible;
+ Rows[0].Visible = !Rows[0].Visible;
+
+ //When collapsing the first row still seeing it.
+ if (Rows[0].Index < FirstDisplayedScrollingRowIndex)
+ {
+ FirstDisplayedScrollingRowIndex = Rows[0].Index;
+ }
+ }
+
+ private void RecursiveSetGroupCollapse(string? c, OutlookGridGroupCollection col, bool collapsed)
+ {
+ for (int i = 0; i < col.Count; i++)
+ {
+ if (col[i]!.Column.Name == c)
+ {
+ col[i]!.Collapsed = collapsed;
+ }
+
+ RecursiveSetGroupCollapse(c, col[i]!.Children, collapsed);
+ }
+ }
+
+ ///
+ /// Collapse/Expand a group row
+ ///
+ /// The index of the group row.
+ /// True if collapsed, false if expanded.
+ private void SetGroupCollapse(int rowindex, bool collapsed)
+ {
+ if (!IsGridGrouped || _internalRows.Count == 0 || rowindex < 0)
+ {
+ return;
+ }
+
+ OutlookGridRow row = (OutlookGridRow)Rows[rowindex];
+ if (row.IsGroupRow)
+ {
+ if (row.Group != null)
+ {
+ row.Group.Collapsed = collapsed;
+ }
+
+ //this is a workaround to make the grid re-calculate it's contents and backgroun bounds
+ // so the background is updated correctly.
+ // this will also invalidate the control, so it will redraw itself
+ row.Visible = false;
+ row.Visible = true;
+
+ //When collapsing the first row still seeing it.
+ if (row.Index < FirstDisplayedScrollingRowIndex)
+ {
+ FirstDisplayedScrollingRowIndex = row.Index;
+ }
+ }
+ }
+
+ ///
+ /// Expand all nodes
+ ///
+ public void ExpandAllNodes()
+ {
+ if (Rows.Count > 0)
+ {
+ foreach (OutlookGridRow r in Rows)
+ {
+ RecursiveDescendantSetNodeCollapse(r, false);
+ }
+ Rows[0].Visible = !Rows[0].Visible;
+ Rows[0].Visible = !Rows[0].Visible;
+
+ //When collapsing the first row still seeing it.
+ if (Rows[0].Index < FirstDisplayedScrollingRowIndex)
+ {
+ FirstDisplayedScrollingRowIndex = Rows[0].Index;
+ }
+ }
+ }
+
+ ///
+ /// Collapse all nodes
+ ///
+ public void CollapseAllNodes()
+ {
+ if (Rows.Count > 0)
+ {
+ foreach (OutlookGridRow r in Rows)
+ {
+ RecursiveDescendantSetNodeCollapse(r, true);
+ }
+ Rows[0].Visible = !Rows[0].Visible;
+ Rows[0].Visible = !Rows[0].Visible;
+
+ //When collapsing the first row still seeing it.
+ if (Rows[0].Index < FirstDisplayedScrollingRowIndex)
+ {
+ FirstDisplayedScrollingRowIndex = Rows[0].Index;
+ }
+ }
+ }
+
+ private void RecursiveDescendantSetNodeCollapse(OutlookGridRow r, bool collapsed)
+ {
+ //No events - for speed
+ if (r.HasChildren)
+ {
+ r.Collapsed = collapsed;
+ foreach (OutlookGridRow r2 in r.Nodes.Nodes)
+ {
+ RecursiveDescendantSetNodeCollapse(r2, collapsed);
+ }
+ }
+ }
+
+ //private void RecursiveUpwardSetNodeCollaspse(OutlookGridRow r, bool collasped)
+ //{
+ // //No events - for speed
+ // if (r.ParentNode != null)
+ // {
+ // if (r.ParentNode.Collapsed)
+ // {
+ // r.ParentNode.Collapsed = collasped;
+ // RecursiveUpwardSetNodeCollaspse(r.ParentNode, collapsed);
+ // }
+ // }
+ // //sw.Stop();
+ // //Console.WriteLine(sw.ElapsedMilliseconds.ToString() + " ms" + r.ToString());
+
+ //}
+
+ private void RecursiveUpwardSetNodeCollapse(OutlookGridRow? r, bool collapsed)
+ {
+ //No events - for speed
+ if (r != null && r.ParentNode != null)
+ {
+ r.ParentNode.Collapsed = collapsed;
+ RecursiveUpwardSetNodeCollapse(r.ParentNode, collapsed);
+ }
+ }
+
+
+ ///
+ /// Ensure the node is visible (all parents exanded)
+ ///
+ /// The OutlookGridRow which needs to be visible.
+ public void EnsureVisibleNode(OutlookGridRow r) => RecursiveUpwardSetNodeCollapse(r, false);
+
+ ///
+ /// Collapses the node.
+ ///
+ /// The OutlookGridRow node.
+ ///
+ public bool CollapseNode(OutlookGridRow node)
+ {
+ if (!node.Collapsed)
+ {
+ CollapsingEventArgs exp = new(node);
+ OnNodeCollapsing(exp);
+
+ if (!exp.Cancel)
+ {
+ node.SetNodeCollapse(true);
+
+ CollapsedEventArgs exped = new(node);
+ OnNodeCollapsed(exped);
+ }
+
+ return !exp.Cancel;
+ }
+ else
+ {
+ // row isn't expanded, so we didn't do anything.
+ return false;
+ }
+ }
+
+ ///
+ /// Expands the node.
+ ///
+ /// The OutlookGridRow node.
+ ///
+ public bool ExpandNode(OutlookGridRow node)
+ {
+ if (node.Collapsed)
+ {
+ ExpandingEventArgs exp = new(node);
+ OnNodeExpanding(exp);
+
+ if (!exp.Cancel)
+ {
+ node.SetNodeCollapse(false);
+
+ ExpandedEventArgs exped = new(node);
+ OnNodeExpanded(exped);
+ }
+
+ return !exp.Cancel;
+ }
+ else
+ {
+ // row isn't expanded, so we didn't do anything.
+ return false;
+ }
+ }
+
+ ///
+ /// Expand Node and all its subnodes (without events)
+ ///
+ public void ExpandNodeAndSubNodes(OutlookGridRow r)
+ {
+ RecursiveDescendantSetNodeCollapse(r, false);
+ r.Visible = !r.Visible;
+ r.Visible = !r.Visible;
+
+ ////When collapsing the first row still seeing it.
+ //if (this.Rows[0].Index < this.FirstDisplayedScrollingRowIndex)
+ // this.FirstDisplayedScrollingRowIndex = this.Rows[0].Index;
+ }
+
+ ///
+ /// Collapse Node and all its subnodes (without events)
+ ///
+ public void CollapseNodeAndSubNodes(OutlookGridRow r)
+ {
+ RecursiveDescendantSetNodeCollapse(r, true);
+ r.Visible = !r.Visible;
+ r.Visible = !r.Visible;
+
+ ////When collapsing the first row still seeing it.
+ //if (this.Rows[0].Index < this.FirstDisplayedScrollingRowIndex)
+ // this.FirstDisplayedScrollingRowIndex = this.Rows[0].Index;
+ }
+
+ #region Grid Fill functions
+
+
+ private void NonGroupedRecursiveFillOutlookGridRows(List l, List tmp)
+ {
+ for (int i = 0; i < l.Count; i++)
+ {
+ tmp.Add(l[i]);
+
+ //Recusive call
+ if (l[i].HasChildren)
+ {
+ NonGroupedRecursiveFillOutlookGridRows(l[i].Nodes.Nodes, tmp);
+ }
+ }
+ }
+
+ private void FillMinMaxFormatConditions(Type? typeColumn, int j, List list, int formatColumn)
+ {
+ if (typeColumn == typeof(TimeSpan))
+ {
+ for (var i = 0; i < list.Count; i++)
+ {
+ if (list[i].Cells[formatColumn].Value != null)
+ {
+
+ if (((TimeSpan)list[i].Cells[formatColumn].Value!).TotalMinutes < _formatConditions[j].MinValue)
+ {
+ _formatConditions[j].MinValue = ((TimeSpan)list[i].Cells[formatColumn].Value!).TotalMinutes;
+ }
+
+ if (((TimeSpan)list[i].Cells[formatColumn].Value!).TotalMinutes > _formatConditions[j].MaxValue)
+ {
+ _formatConditions[j].MaxValue = ((TimeSpan)list[i].Cells[formatColumn].Value!).TotalMinutes;
+ }
+ }
+ if (list[i].HasChildren)
+ {
+ FillMinMaxFormatConditions(typeColumn, j, list[i].Nodes.Nodes, formatColumn);
+ }
+ }
+ }
+ else if (typeColumn == typeof(decimal))
+ {
+ for (var i = 0; i < list.Count; i++)
+ {
+ if (list[i].Cells[formatColumn].Value != null)
+ {
+ if (Convert.ToDouble(list[i].Cells[formatColumn].Value) < _formatConditions[j].MinValue)
+ {
+ _formatConditions[j].MinValue = Convert.ToDouble(list[i].Cells[formatColumn].Value);
+ }
+
+ if (Convert.ToDouble(list[i].Cells[formatColumn].Value) > _formatConditions[j].MaxValue)
+ {
+ _formatConditions[j].MaxValue = Convert.ToDouble(list[i].Cells[formatColumn].Value);
+ }
+ }
+ if (list[i].HasChildren)
+ {
+ FillMinMaxFormatConditions(typeColumn, j, list[i].Nodes.Nodes, formatColumn);
+ }
+ }
+ }
+ else
+ {
+ for (var i = 0; i < list.Count; i++)
+ {
+ if (list[i].Cells[formatColumn].Value != null)
+ {
+ if (Convert.ToDouble(list[i].Cells[formatColumn].Value) < _formatConditions[j].MinValue)
+ {
+ _formatConditions[j].MinValue = (double)list[i].Cells[formatColumn].Value!;
+ }
+
+ if (Convert.ToDouble(list[i].Cells[formatColumn].Value) > _formatConditions[j].MaxValue)
+ {
+ _formatConditions[j].MaxValue = (double)list[i].Cells[formatColumn].Value!;
+ }
+ }
+ if (list[i].HasChildren)
+ {
+ FillMinMaxFormatConditions(typeColumn, j, list[i].Nodes.Nodes, formatColumn);
+ }
+ }
+ }
+ }
+
+ private void FillValueFormatConditions(int formatColumn, Type? typeColumn, List list)
+ {
+ for (var i = 0; i < list.Count; i++)
+ {
+ for (var j = 0; j < _formatConditions.Count; j++)
+ {
+ formatColumn = Columns[_formatConditions[j].ColumnName]!.Index;
+ if (list[i].Cells[formatColumn].Value != null)
+ {
+ typeColumn = Columns[_formatConditions[j].ColumnName]!.ValueType;
+ FormattingCell fCell = new(list[i].Cells[formatColumn])
+ {
+ FormatType = _formatConditions[j].FormatType,
+ FormatParams = _formatConditions[j].FormatParams?.Clone() as IFormatParams
+ };
+
+ switch (_formatConditions[j].FormatType)
+ {
+ case EnumConditionalFormatType.Bar:
+ if (typeColumn == typeof(TimeSpan))
+ {
+ (fCell.FormatParams as BarParams)!.ProportionValue =
+ ColorFormatting.ConvertBar(
+ ((TimeSpan)list[i].Cells[formatColumn].Value!).TotalMinutes,
+ _formatConditions[j].MinValue, _formatConditions[j].MaxValue);
+ }
+ else if (typeColumn == typeof(decimal))
+ {
+ (fCell.FormatParams as BarParams)!.ProportionValue = ColorFormatting.ConvertBar(Convert.ToDouble(list[i].Cells[formatColumn].Value), _formatConditions[j].MinValue, _formatConditions[j].MaxValue);
+ }
+ else
+ {
+ (fCell.FormatParams as BarParams)!.ProportionValue = ColorFormatting.ConvertBar((double)list[i].Cells[formatColumn].Value!, _formatConditions[j].MinValue, _formatConditions[j].MaxValue);
+ }
+ break;
+ case EnumConditionalFormatType.TwoColorsRange:
+ if (typeColumn == typeof(TimeSpan))
+ {
+ (fCell.FormatParams as TwoColorsParams)!.ValueColor = ColorFormatting.ConvertTwoRange(((TimeSpan)list[i].Cells[formatColumn].Value!).TotalMinutes, _formatConditions[j].MinValue, _formatConditions[j].MaxValue, (TwoColorsParams)_formatConditions[j].FormatParams!);
+ }
+ else if (typeColumn == typeof(decimal))
+ {
+ (fCell.FormatParams as TwoColorsParams)!.ValueColor = ColorFormatting.ConvertTwoRange(Convert.ToDouble(list[i].Cells[formatColumn].Value), _formatConditions[j].MinValue, _formatConditions[j].MaxValue, (TwoColorsParams)_formatConditions[j].FormatParams!);
+ }
+ else
+ {
+ (fCell.FormatParams as TwoColorsParams)!.ValueColor =
+ ColorFormatting.ConvertTwoRange(
+ Convert.ToDouble(list[i].Cells[formatColumn].Value), _formatConditions[j].MinValue, _formatConditions[j].MaxValue, (TwoColorsParams)_formatConditions[j].FormatParams!);
+ }
+ //list[i].Cells[formatColumn].Style.SelectionBackColor = list[i].Cells[formatColumn].Style.BackColor;
+ break;
+ case EnumConditionalFormatType.ThreeColorsRange:
+ if (typeColumn == typeof(TimeSpan))
+ {
+ (fCell.FormatParams as ThreeColorsParams)!.ValueColor = ColorFormatting.ConvertThreeRange(((TimeSpan)list[i].Cells[formatColumn].Value!).TotalMinutes, _formatConditions[j].MinValue, _formatConditions[j].MaxValue, _formatConditions[j].FormatParams as ThreeColorsParams);
+ }
+ else if (typeColumn == typeof(decimal))
+ {
+ (fCell.FormatParams as ThreeColorsParams)!.ValueColor = ColorFormatting.ConvertThreeRange(Convert.ToDouble(list[i].Cells[formatColumn].Value), _formatConditions[j].MinValue, _formatConditions[j].MaxValue, _formatConditions[j].FormatParams as ThreeColorsParams);
+ }
+ else
+ {
+ (fCell.FormatParams as ThreeColorsParams)!.ValueColor = ColorFormatting.ConvertThreeRange(Convert.ToDouble(list[i].Cells[formatColumn].Value), _formatConditions[j].MinValue, _formatConditions[j].MaxValue, _formatConditions[j].FormatParams as ThreeColorsParams);
+ }
+ //list[i].Cells[formatColumn].Style.SelectionBackColor = list[i].Cells[formatColumn].Style.BackColor;
+ break;
+ }
+ }
+ }
+
+ if (list[i].HasChildren)
+ {
+ FillValueFormatConditions(formatColumn, typeColumn, list[i].Nodes.Nodes);
+ }
+ }
+ }
+
+
+ ///
+ /// Fill the grid (grouping, sorting,...)
+ ///
+ public void Fill()
+ {
+ Cursor.Current = Cursors.WaitCursor;
+#if (DEBUG)
+ Stopwatch azer = new Stopwatch();
+ azer.Start();
+#endif
+ List list;
+ List tmp; // = new List();
+ IOutlookGridGroup? grParent = null;
+ Rows.Clear();
+ _groupCollection.Clear();
+
+ if (_internalRows.Count == 0)
+ {
+ return;
+ }
+
+ list = _internalRows;
+
+
+ //Apply Formatting
+ int formatColumn = 0;
+ Type? typeColumn = null;
+
+ //Determine mix and max value
+ for (int j = 0; j < _formatConditions.Count; j++)
+ {
+ formatColumn = Columns[_formatConditions[j].ColumnName]!.Index;
+ typeColumn = Columns[_formatConditions[j].ColumnName]!.ValueType;
+ _formatConditions[j].MinValue = double.MaxValue;
+ _formatConditions[j].MaxValue = double.MinValue;
+ FillMinMaxFormatConditions(typeColumn, j, list, formatColumn);
+ }
+
+ //Passing the necessary information to cells
+ FillValueFormatConditions(formatColumn, typeColumn, list);
+
+ //End of Formatting
+#if DEBUG
+ azer.Stop();
+ Console.WriteLine(@"Formatting : " + azer.ElapsedMilliseconds + @" ms");
+ azer.Start();
+#endif
+ // this block is used of grouping is turned off
+ // this will simply list all attributes of each object in the list
+ if (_internalColumns.CountGrouped() == 0)
+ {
+ //Applying sort
+ //try
+ //{
+ list.Sort(new OutlookGridRowComparer2(_internalColumns.GetIndexAndSortSortedOnlyColumns()));
+ //}
+ //catch (Exception e)
+ //{
+ // MessageBox.Show("Failed to sort.\n\n Error:" + e.Message,
+ // "Grid Sorting",
+ // MessageBoxButtons.OK,
+ // MessageBoxIcon.Error);
+ // }
+
+ //Add rows to underlying DataGridView
+ if (_fillMode == GridFillMode.GroupsOnly)
+ {
+ if (list != null)
+ {
+ Rows.AddRange(list.ToArray());
+ }
+ }
+ else
+ {
+ tmp = new List();
+ NonGroupedRecursiveFillOutlookGridRows(list, tmp);
+
+ //Add all the rows to the grid
+ if (tmp != null)
+ {
+ Rows.AddRange(tmp.ToArray());
+ }
+ }
+
+ }
+ // this block is used when grouping is used
+ // items in the list must be sorted, and then they will automatically be grouped
+ else
+ {
+ //Group part of the job
+ //try
+ //{
+ //We get the columns that are grouped
+ List? groupedColumns = _internalColumns.FindGroupedColumns();
+
+ //For each outlookgrid row in the grid
+ for (int j = 0; j < list.Count; j++)
+ {
+ //Reload the groups collection for each rows !!
+ OutlookGridGroupCollection children = _groupCollection;
+
+ //For each grouped column (ordered by GroupIndex)
+ if (groupedColumns != null)
+ {
+ for (int i = 0; i < groupedColumns.Count; i++)
+ {
+ if (i == 0)
+ {
+ grParent = null;
+ }
+
+ //Gets the stored value
+ object? value = list[j].Cells[groupedColumns[i].DataGridViewColumn!.Index].Value;
+ object? formattedValue;
+
+ //We get the formatting value according to the type of group (Alphabetic, DateTime,...)
+ var outlookGridGroup = groupedColumns[i].GroupingType;
+ if (outlookGridGroup != null)
+ {
+ outlookGridGroup.Value = value;
+ formattedValue = outlookGridGroup.Value;
+
+ //We search the corresponding group.
+ IOutlookGridGroup? gr = children.FindGroup(formattedValue);
+ if (gr == null)
+ {
+ gr = (IOutlookGridGroup)outlookGridGroup.Clone();
+ gr.ParentGroup = grParent;
+ gr.Column = groupedColumns[i];
+ gr.Value = value;
+ gr.FormatStyle =
+ groupedColumns[i].DataGridViewColumn!.DefaultCellStyle
+ .Format; //We can the formatting applied to the cell to the group
+ if (value is TextAndImage)
+ {
+ gr.GroupImage = (value as TextAndImage)?.Image;
+ }
+ else if (value is Token)
+ {
+ Bitmap bmp = new(13, 13);
+ using (Graphics gfx = Graphics.FromImage(bmp))
+ {
+ using (SolidBrush brush = new(((Token)value).BackColor))
+ {
+ gfx.FillRectangle(brush, 0, 0, bmp.Width, bmp.Height);
+ }
+ }
+
+ gr.GroupImage = bmp;
+ }
+ else if (value is Bitmap)
+ {
+ gr.GroupImage = (Bitmap)value;
+ }
+ //else if (groupedColumns[i].DataGridViewColumn.GetType() == typeof(KryptonDataGridViewRatingColumn))
+ //{
+ // gr.GroupImage = (Image)Resources.OutlookGridImageResources.ResourceManager.GetObject("star" + value.ToString());
+ //}
+
+ gr.Level = i;
+ children.Add(gr);
+ }
+
+ //Go deeper in the groups, set current group as parent
+ grParent = gr;
+ children = gr.Children;
+
+ //if we have browsed all the groups we are sure to be in the righr group: add rows and update counters !
+ if (i == groupedColumns.Count - 1)
+ {
+ list[j].Group = gr;
+ gr.Rows.Add(list[j]);
+ RecursiveIncrementParentGroupCounters(gr);
+ }
+ }
+ }
+ }
+ }
+
+ //reset local variable for GC
+ groupedColumns = null;
+ //}
+ //catch (Exception e)
+ //{
+ // MessageBox.Show("Failed to add rows.\n\n Error:" + e.Message,
+ // "Grid Filling",
+ // MessageBoxButtons.OK,
+ // MessageBoxIcon.Error);
+ //}
+
+ //Sorting part : sort the groups between them and sort the rows inside the groups
+ //try
+ //{
+ //int index = internalColumns.FindSortedColumnNotgrouped();
+ //RecursiveSort(this.groupCollection, index, (index == -1) ? SortOrder.None : internalColumns.FindFromColumnIndex(index).SortDirection);
+ List> sortList = _internalColumns.GetIndexAndSortSortedOnlyColumns();
+ if (sortList.Count > 0)
+ {
+ RecursiveSort(_groupCollection, sortList);
+ }
+ else
+ {
+ RecursiveSort(_groupCollection, _internalColumns.GetIndexAndSortGroupedColumns());
+ }
+ //}
+ //catch (Exception e)
+ //{
+ // MessageBox.Show("Failed to sort.\n\n Error:" + e.Message,
+ // "Grid Sorting",
+ // MessageBoxButtons.OK,
+ // MessageBoxIcon.Error);
+ //}
+
+ //Reinit!
+ tmp = new List();
+ //Get a list of rows (grouprow and non-grouprow)
+ RecursiveFillOutlookGridRows(_groupCollection, tmp);
+
+ //Finally add the rows to underlying datagridview after all the magic !
+ Rows.AddRange(tmp.ToArray());
+ }
+ Cursor.Current = Cursors.Default;
+#if DEBUG
+ azer.Stop();
+ Console.WriteLine(@"FillGrid : " + azer.ElapsedMilliseconds + @" ms");
+#endif
+ }
+
+ ///
+ /// Sort recursively the OutlookGridRows within groups
+ ///
+ /// The OutlookGridGroupCollection.
+ /// The list of sorted columns
+ private void RecursiveSort(OutlookGridGroupCollection groupCollection, List> sortList)
+ {
+ //We sort the groups
+ if (groupCollection.Count > 0)
+ {
+ if (groupCollection[0]!.Column.GroupingType!.SortBySummaryCount)
+ {
+ groupCollection.Sort(new OutlookGridGroupCountComparer());
+ }
+ else
+ {
+ groupCollection.Sort();
+ }
+ }
+
+ //Sort the rows inside each group
+ for (int i = 0; i < groupCollection.Count; i++)
+ {
+ //If there is no child group then we have only rows...
+ if (groupCollection[i]!.Children.Count == 0 && sortList.Count > 0)
+ {
+ //We sort the rows according to the sorted only columns
+ groupCollection[i]!.Rows.Sort(new OutlookGridRowComparer2(sortList));
+ }
+ //else
+ //{
+ // Console.WriteLine("groupCollection[i].Rows" + groupCollection[i].Rows.Count.ToString());
+ // //We sort the rows according to the group sort (useful for alphbetics for example)
+ // groupCollection[i].Rows.Sort(new OutlookGridRowComparer(groupCollection[i].Column.DataGridViewColumn.Index, internalColumns[groupCollection[i].Column.DataGridViewColumn.Name].SortDirection));
+ //}
+
+ //Recursive call for children
+ RecursiveSort(groupCollection[i]!.Children, sortList);
+ }
+ }
+
+ ///
+ /// Update all the parents counters of a group
+ ///
+ /// The group whic
+ private void RecursiveIncrementParentGroupCounters(IOutlookGridGroup? l)
+ {
+ //Add +1 to the counter
+ if (l != null)
+ {
+ l.ItemCount++;
+ if (l.ParentGroup != null)
+ {
+ //Recursive call for parent
+ RecursiveIncrementParentGroupCounters(l.ParentGroup);
+ }
+ }
+ }
+
+ ///
+ /// Transform a group in a list of OutlookGridRows. Recursive call
+ ///
+ /// The OutlookGridGroupCollection that contains the groups and associated rows.
+ /// A List of OutlookGridRow
+ private void RecursiveFillOutlookGridRows(OutlookGridGroupCollection l, List tmp)
+ {
+ OutlookGridRow? gridRow;
+ IOutlookGridGroup? gridGroup;
+
+ //for each group
+ for (var i = 0; i < l.List.Count; i++)
+ {
+ gridGroup = l.List[i];
+
+ //Create the group row
+ gridRow = RowTemplate.Clone() as OutlookGridRow;
+ gridRow!.Group = gridGroup;
+ gridRow.IsGroupRow = true;
+ if (gridGroup != null)
+ {
+ gridRow.Height = gridGroup.Height;
+ gridRow.MinimumHeight = gridRow.Height; //To handle auto resize rows correctly on high dpi
+ gridRow.CreateCells(this, gridGroup.Value!);
+ tmp.Add(gridRow);
+
+ //Recursive call
+ if (gridGroup.Children.Count > 0)
+ {
+ RecursiveFillOutlookGridRows(gridGroup.Children, tmp);
+ }
+
+ //We add the rows associated with the current group
+ if (_fillMode == GridFillMode.GroupsOnly)
+ {
+ tmp.AddRange(gridGroup.Rows);
+ }
+ else
+ {
+ NonGroupedRecursiveFillOutlookGridRows(gridGroup.Rows, tmp);
+ }
+ }
+ }
+ }
+ #endregion Grid Fill functions
+
+ ///
+ /// Persist the configuration of the KryptonOutlookGrid
+ ///
+ /// The path where the .xml file will be saved.
+ /// The version of the config file.
+ public void PersistConfiguration(string path, string version)
+ {
+ OutlookGridColumn? col;
+ using (XmlWriter writer = XmlWriter.Create(path, new XmlWriterSettings { Indent = true }))
+ {
+ writer.WriteStartDocument();
+ writer.WriteStartElement("OutlookGrid");
+ writer.WriteAttributeString("V", version);
+ writer.WriteElementString("GroupBox", (_groupBox != null && _groupBox.Visible).ToString());
+ writer.WriteElementString("HideColumnOnGrouping", CommonHelper.BoolToString(HideColumnOnGrouping));
+ writer.WriteStartElement("Columns");
+ for (int i = 0; i < _internalColumns.Count; i++)
+ {
+ col = _internalColumns[i];
+ writer.WriteStartElement("Column");
+ writer.WriteElementString("Name", col.Name);
+ writer.WriteStartElement("GroupingType");
+ if (col.GroupingType != null)
+ {
+ writer.WriteElementString("Name", col.GroupingType.GetType().AssemblyQualifiedName); //.GetType().Name.ToString());
+ writer.WriteElementString("OneItemText", col.GroupingType.OneItemText);
+ writer.WriteElementString("XXXItemsText", col.GroupingType.XxxItemsText);
+ writer.WriteElementString("SortBySummaryCount", CommonHelper.BoolToString(col.GroupingType.SortBySummaryCount));
+ //writer.WriteElementString("ItemsComparer", (col.GroupingType.ItemsComparer == null) ? "" : col.GroupingType.ItemsComparer.GetType().AssemblyQualifiedName);
+ if (col.GroupingType.GetType() == typeof(OutlookGridDateTimeGroup))
+ {
+ writer.WriteElementString("GroupDateInterval", ((OutlookGridDateTimeGroup)col.GroupingType).Interval.ToString());
+ }
+ }
+ writer.WriteEndElement();
+ writer.WriteElementString("SortDirection", col.SortDirection.ToString());
+ writer.WriteElementString("GroupIndex", col.GroupIndex.ToString());
+ writer.WriteElementString("SortIndex", col.SortIndex.ToString());
+ writer.WriteElementString("Visible", col.DataGridViewColumn!.Visible.ToString());
+ writer.WriteElementString("Width", col.DataGridViewColumn.Width.ToString());
+ writer.WriteElementString("Index", col.DataGridViewColumn.Index.ToString());
+ writer.WriteElementString("DisplayIndex", col.DataGridViewColumn.DisplayIndex.ToString());
+ writer.WriteElementString("RowsComparer", col != null && col.RowsComparer == null ? "" : col?.RowsComparer!.GetType().AssemblyQualifiedName);
+ writer.WriteEndElement();
+ }
+ writer.WriteEndElement();
+
+ //Conditional formatting
+ writer.WriteStartElement("ConditionalFormatting");
+ for (int i = 0; i < _formatConditions.Count; i++)
+ {
+ _formatConditions[i].Persist(writer);
+ }
+ writer.WriteEndElement(); // End ConditionalFormatting
+ writer.WriteEndElement(); //End OutlookGrid
+ writer.WriteEndDocument();
+ writer.Flush();
+ }
+ }
+
+ ///
+ /// Clears everything in the OutlookGrid (groups, rows, columns, DataGridViewColumns). Ready for a completely new start.
+ ///
+ public void ClearEverything()
+ {
+ _groupCollection.Clear();
+ _internalRows.Clear();
+ _internalColumns.Clear();
+ Columns.Clear();
+ ConditionalFormatting.Clear();
+ //Snif everything is gone ! Be Ready for a new start !
+ }
+
+ ///
+ /// Finds the column from its name.
+ ///
+ /// The name.
+ ///
+ public OutlookGridColumn? FindFromColumnName(string name) => _internalColumns.FindFromColumnName(name);
+
+ ///
+ /// Finds the column from its index.
+ ///
+ /// The index.
+ ///
+ public OutlookGridColumn? FindFromColumnIndex(int index) => _internalColumns.FindFromColumnIndex(index);
+
+ #endregion OutlookGrid methods
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonOutlookGridGroupBox.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonOutlookGridGroupBox.cs
new file mode 100644
index 000000000..686f6bf9a
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonOutlookGridGroupBox.cs
@@ -0,0 +1,1125 @@
+#region Licences
+
+/*
+ *
+ * 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. 2024 - 2024. All rights reserved.
+ *
+ */
+
+//--------------------------------------------------------------------------------
+// Copyright (C) 2013-2021 JDH Software -
+//
+// This program is provided to you under the terms of the Microsoft Public
+// License (Ms-PL) as published at https://github.com/Cocotteseb/Krypton-OutlookGrid/blob/master/LICENSE.md
+//
+// Visit https://www.jdhsoftware.com and follow @jdhsoftware on Twitter
+//
+//--------------------------------------------------------------------------------
+
+#endregion
+
+namespace Krypton.Toolkit
+{
+ ///
+ /// GroupBox for the Krypton OutlookGrid
+ ///
+ [ToolboxBitmap(typeof(KryptonGroupBox))]
+ public partial class KryptonOutlookGridGroupBox : UserControl
+ {
+ #region Design Code
+ private IContainer? components = null;
+
+ private void InitializeComponent()
+ {
+ SuspendLayout();
+ //
+ // KryptonOutlookGridGroupBox
+ //
+ AllowDrop = true;
+ Name = "KryptonOutlookGridGroupBox";
+ Size = new Size(744, 46);
+ DragDrop += KryptonOutlookGridGroupBox_DragDrop;
+ DragEnter += KryptonOutlookGridGroupBox_DragEnter;
+ ResumeLayout(false);
+
+ }
+ #endregion
+
+ #region Instance Fields
+ private List _columnsList;
+ private string _dragColumnToGroupText;
+
+ //Krypton
+ private PaletteBase? _palette;
+ private PaletteRedirect _paletteRedirect;
+ private PaletteBackInheritRedirect _paletteBack;
+ private PaletteBorderInheritRedirect _paletteBorder;
+ private PaletteContentInheritRedirect? _paletteContent;
+ private PaletteDataGridViewRedirect? _paletteDataGridView;
+ private PaletteDataGridViewAll _paletteDataGridViewAll;
+ private IDisposable? _mementoBack;
+ private PaletteBorder _border;
+
+ //Mouse
+ private Point _mouse;
+ private bool _isDragging;
+ private int _indexselected;
+
+ //Dpi scaling
+ private float _factorX, _factorY;
+
+ //Context menu
+ private KryptonContextMenu? _kCtxMenu;
+ private KryptonContextMenuItems? _menuItems;
+ private KryptonContextMenuItem _menuSortAscending;
+ private KryptonContextMenuItem _menuSortDescending;
+ private KryptonContextMenuSeparator _menuSeparator1;
+ private KryptonContextMenuItem _menuExpand;
+ private KryptonContextMenuItem _menuCollapse;
+ private KryptonContextMenuItem _menuUnGroup;
+ private KryptonContextMenuSeparator _menuSeparator2;
+ private KryptonContextMenuItem _menuFullExpand;
+ private KryptonContextMenuItem _menuFullCollapse;
+ private KryptonContextMenuSeparator _menuSeparator3;
+ private KryptonContextMenuItem _menuClearGrouping;
+ private KryptonContextMenuItem? _menuHideGroupBox;
+ private KryptonContextMenuItem _menuGroupInterval;
+ private KryptonContextMenuItem _menuSortBySummary;
+ #endregion
+
+ #region Custom Events
+ ///
+ /// Column Sort Changed Event
+ ///
+ public event EventHandler? ColumnSortChanged;
+ ///
+ /// Column Group Added Event
+ ///
+ public event EventHandler? ColumnGroupAdded;
+ ///
+ /// Column Group removed Event
+ ///
+ public event EventHandler? ColumnGroupRemoved;
+ ///
+ /// Clear grouping event
+ ///
+ public event EventHandler? ClearGrouping;
+ ///
+ /// Full Expand event
+ ///
+ public event EventHandler? FullExpand;
+ ///
+ /// Full Collapse event
+ ///
+ public event EventHandler? FullCollapse;
+ ///
+ /// Group Expand event
+ ///
+ public event EventHandler? GroupExpand;
+ ///
+ /// Group Collapse event
+ ///
+ public event EventHandler? GroupCollapse;
+ ///
+ /// Column Group Order Changed Event
+ ///
+ public event EventHandler? ColumnGroupOrderChanged;
+ ///
+ /// Group Interval Click event
+ ///
+ public event EventHandler? GroupIntervalClick;
+ ///
+ /// Sort by Summary Count event
+ ///
+ public event EventHandler? SortBySummaryCount;
+ #endregion
+
+ #region Constructor
+
+ ///
+ /// Constructor
+ ///
+ public KryptonOutlookGridGroupBox()
+ {
+ // To remove flicker we use double buffering for drawing
+ SetStyle(
+ ControlStyles.AllPaintingInWmPaint |
+ ControlStyles.OptimizedDoubleBuffer |
+ ControlStyles.ResizeRedraw, true);
+
+ InitializeComponent();
+
+ _columnsList = new List();
+
+ // Cache the current global palette setting
+ _palette = KryptonManager.CurrentGlobalPalette;
+
+ // Hook into palette events
+ if (_palette != null)
+ {
+ _palette.PalettePaint += OnPalettePaint;
+ }
+
+ // (4) We want to be notified whenever the global palette changes
+ KryptonManager.GlobalPaletteChanged += OnGlobalPaletteChanged;
+
+ // Create redirection object to the base palette
+ _paletteRedirect = new PaletteRedirect(_palette);
+
+ // Create accessor objects for the back, border and content
+ // Store the inherit instances
+ _paletteBack = new PaletteBackInheritRedirect(_paletteRedirect);
+ _paletteBorder = new PaletteBorderInheritRedirect(_paletteRedirect);
+ _paletteContent = new PaletteContentInheritRedirect(_paletteRedirect);
+ _paletteDataGridView = new PaletteDataGridViewRedirect(_paletteRedirect, null);
+ _paletteDataGridViewAll = new PaletteDataGridViewAll(_paletteDataGridView, null);
+
+ // Create storage that maps onto the inherit instances
+ _border = new PaletteBorder(_paletteBorder, null);
+ _dragColumnToGroupText = KryptonManager.Strings.OutlookGridStrings.DragColumnToGroup;
+
+ using (Graphics? g = CreateGraphics())
+ {
+ _factorX = g.DpiX > 96 ? 1f * g.DpiX / 96 : 1f;
+ _factorY = g.DpiY > 96 ? 1f * g.DpiY / 96 : 1f;
+ }
+ }
+
+ #endregion
+
+ #region Properties
+
+ ///
+ /// Gets access to the common textbox appearance entries that other states can override.
+ ///
+ [Category("Visuals")]
+ [Description("Overrides borders settings.")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ public PaletteBorder Border => _border;
+
+ ///
+ /// Getsor sets the text that appears when no column is grouped.
+ ///
+ [Category("Text")]
+ [Description("The text that appears when no column is grouped.")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ [Localizable(true)]
+ public String DragColumnToGroupText
+ {
+ get => _dragColumnToGroupText;
+ set => _dragColumnToGroupText = value;
+ }
+
+ #endregion
+
+ #region Overrides
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ if (_mementoBack != null)
+ {
+ _mementoBack.Dispose();
+ _mementoBack = null;
+ }
+
+ // (10) Unhook from the palette events
+ if (_palette != null)
+ {
+ _palette.PalettePaint -= OnPalettePaint;
+ _palette = null;
+ }
+
+ // (11) Unhook from the static events, otherwise we cannot be garbage collected
+ KryptonManager.GlobalPaletteChanged -= OnGlobalPaletteChanged;
+ }
+
+ if (disposing && components != null)
+ {
+ components.Dispose();
+ }
+
+ base.Dispose(disposing);
+ }
+
+ ///
+ /// Overrides the paint event
+ ///
+ /// PaintEventArgs
+ protected override void OnPaint(PaintEventArgs e)
+ {
+ int nextPosition = (int)(5 * _factorX);
+ if (_palette != null)
+ {
+ // (3) Get the renderer associated with this palette
+ IRenderer renderer = _palette.GetRenderer();
+
+ // (4) Create the rendering context that is passed into all renderer calls
+ using (RenderContext renderContext = new(this, e.Graphics, e.ClipRectangle, renderer))
+ {
+ _paletteBack.Style = PaletteBackStyle.PanelClient;
+ _paletteBorder.Style = PaletteBorderStyle.HeaderPrimary;
+ using (GraphicsPath path = renderer.RenderStandardBorder.GetBackPath(renderContext, e.ClipRectangle, _paletteBorder, VisualOrientation.Top, PaletteState.Normal))
+ {
+ _mementoBack = renderer.RenderStandardBack.DrawBack(renderContext,
+ ClientRectangle,
+ path,
+ _paletteBack,
+ VisualOrientation.Top,
+ PaletteState.Normal,
+ _mementoBack);
+ }
+ renderer.RenderStandardBorder.DrawBorder(renderContext, ClientRectangle, _border, VisualOrientation.Top, PaletteState.Normal);
+
+ //If no grouped columns, draw to the indicating text
+ if (_columnsList.Count == 0)
+ {
+ TextRenderer.DrawText(e.Graphics, _dragColumnToGroupText, _palette.GetContentShortTextFont(PaletteContentStyle.LabelNormalPanel, PaletteState.Normal), e.ClipRectangle, _palette.GetContentShortTextColor1(PaletteContentStyle.LabelNormalPanel, PaletteState.Normal),
+ TextFormatFlags.EndEllipsis | TextFormatFlags.VerticalCenter | TextFormatFlags.SingleLine | TextFormatFlags.PreserveGraphicsClipping);
+ }
+
+ PaletteState state;
+ _paletteBack.Style = PaletteBackStyle.GridHeaderColumnList;
+ _paletteBorder.Style = PaletteBorderStyle.GridHeaderColumnList;
+ // PaintGroupBox(e.Graphics, e.ClipRectangle, this.Font, "Drag a column here to group", columnsList.Count > 0);
+
+
+
+ //Draw the column boxes
+ foreach (OutlookGridGroupBoxColumn? current in _columnsList)
+ {
+ Rectangle rectangle = default(Rectangle);
+ rectangle.Width = (int)(100 * _factorX);
+ rectangle.X = nextPosition;
+ rectangle.Y = (e.ClipRectangle.Height - (int)(25 * _factorY)) / 2;
+ rectangle.Height = (int)(25 * _factorY);
+ nextPosition += (int)(105 * _factorX); //next position
+ current!.Rect = rectangle;
+
+ if (current.IsHovered)
+ {
+ state = PaletteState.Tracking;
+ }
+ else if (current.Pressed)
+ {
+ state = PaletteState.Pressed;
+ }
+ else
+ {
+ state = PaletteState.Normal;
+ }
+
+ // Do we need to draw the background?
+ if (_paletteBack.GetBackDraw(PaletteState.Normal) == InheritBool.True)
+ {
+ //Back
+ using (GraphicsPath path = renderer.RenderStandardBorder.GetBackPath(renderContext, rectangle, _paletteBorder, VisualOrientation.Top, PaletteState.Normal))
+ {
+ _mementoBack = renderer.RenderStandardBack.DrawBack(renderContext,
+ rectangle,
+ path,
+ _paletteBack,
+ VisualOrientation.Top,
+ state,
+ _mementoBack);
+ }
+
+ //Border
+ renderer.RenderStandardBorder.DrawBorder(renderContext, rectangle, _paletteBorder, VisualOrientation.Top, state);
+
+ //Text
+ TextRenderer.DrawText(e.Graphics, current.Text, _palette.GetContentShortTextFont(PaletteContentStyle.GridHeaderColumnList, state), rectangle, _palette.GetContentShortTextColor1(PaletteContentStyle.GridHeaderColumnList, state),
+ TextFormatFlags.EndEllipsis | TextFormatFlags.VerticalCenter | TextFormatFlags.SingleLine | TextFormatFlags.PreserveGraphicsClipping);
+
+ //Sort Glyph
+ renderer.RenderGlyph.DrawGridSortGlyph(renderContext, current.SortDirection, rectangle, _paletteDataGridViewAll.HeaderColumn.Content, state, false);
+ }
+
+ //Draw the column box while it is moving
+ if (current.IsMoving)
+ {
+ Rectangle rectangle1 = new(_mouse.X, _mouse.Y, current.Rect.Width, current.Rect.Height);
+ //this.Renderer.PaintMovingColumn(graphics, this.currentDragColumn, rectangle1);
+ using (SolidBrush solidBrush = new(Color.FromArgb(70, Color.Gray)))
+ {
+ e.Graphics.FillRectangle(solidBrush, rectangle1);
+ }
+
+ TextRenderer.DrawText(e.Graphics, current.Text, _palette.GetContentShortTextFont(PaletteContentStyle.GridHeaderColumnList, PaletteState.Disabled), rectangle1, _palette.GetContentShortTextColor1(PaletteContentStyle.GridHeaderColumnList, PaletteState.Disabled),
+ TextFormatFlags.EndEllipsis | TextFormatFlags.VerticalCenter | TextFormatFlags.SingleLine | TextFormatFlags.PreserveGraphicsClipping);
+ }
+ }
+ }
+ }
+
+ base.OnPaint(e);
+ }
+
+ ///
+ /// Overrides the MouseDown event.
+ ///
+ /// A MouseEventArgs that contains the event data.
+ protected override void OnMouseDown(MouseEventArgs e)
+ {
+ foreach (OutlookGridGroupBoxColumn? c in _columnsList)
+ {
+ if (c?.Rect != null)
+ {
+ if (c.Rect.Contains(e.X, e.Y) && e.Button == MouseButtons.Left)
+ {
+ c.Pressed = true;
+ }
+ }
+ }
+ Invalidate();
+ base.OnMouseDown(e);
+ }
+
+ ///
+ /// Overrides the MouseUp event.
+ ///
+ /// A MouseEventArgs that contains the event data.
+ protected override void OnMouseUp(MouseEventArgs e)
+ {
+ List l = new List();
+ OutlookGridGroupBoxColumn? columnMovingInsideGroupBox = null;
+
+ foreach (OutlookGridGroupBoxColumn? c in _columnsList)
+ {
+ if (c?.Rect != null)
+ {
+ if (c.IsMoving && !Bounds.Contains(e.Location))
+ {
+ l.Add(c);
+ }
+ //We move an existing colum inside the groupbox
+ else if (c.IsMoving && Bounds.Contains(e.Location))
+ {
+ columnMovingInsideGroupBox = c;
+ }
+
+ //Stop moving and pressing
+ c.Pressed = false;
+ c.IsMoving = false;
+ }
+ }
+
+ //no more dragging
+ _isDragging = false;
+
+ //Ungroup columns dragged outside the box
+ if (l.Count > 0)
+ {
+ foreach (OutlookGridGroupBoxColumn? c in l)
+ {
+ //Warn the Grid
+ OnColumnGroupRemoved(new OutlookGridColumnEventArgs(new OutlookGridColumn(c?.ColumnName!, null, null, SortOrder.None, -1, -1, null)));
+
+ _columnsList.Remove(c);
+ }
+ }
+
+
+ if (columnMovingInsideGroupBox != null)
+ {
+ if (e.Location.X != columnMovingInsideGroupBox.Rect.X && (e.Location.X < columnMovingInsideGroupBox.Rect.X || e.Location.X > columnMovingInsideGroupBox.Rect.X + columnMovingInsideGroupBox.Rect.Width))
+ {
+ int i = 0; //first group order is 0
+
+ foreach (OutlookGridGroupBoxColumn? existingColumns in _columnsList)
+ {
+ if (e.Location.X > existingColumns!.Rect.X + existingColumns.Rect.Width / 2 && existingColumns != columnMovingInsideGroupBox)
+ {
+ i++;
+ }
+ }
+ OnColumnGroupOrderChanged(new OutlookGridColumnEventArgs(new OutlookGridColumn(columnMovingInsideGroupBox.ColumnName, null, null, SortOrder.None, i, -1, null)));
+ //MessageBox.Show("Changed order = " + i.ToString());
+ }
+ }
+
+ Invalidate();
+ base.OnMouseDown(e);
+ }
+
+ ///
+ /// Overrides the MouseClick event.
+ ///
+ /// A MouseEventArgs that contains the event data.
+ protected override void OnMouseClick(MouseEventArgs e)
+ {
+ if (e.Button == MouseButtons.Right)
+ {
+ _indexselected = -1;
+ for (int i = 0; i < _columnsList.Count; i++)
+ {
+ if (_columnsList[i]?.Rect != null && _columnsList[i]!.Rect.Contains(e.X, e.Y))
+ {
+ _indexselected = i;
+ }
+ }
+ ShowColumnBoxContextMenu();
+ }
+ else if (e.Button == MouseButtons.Left)
+ {
+ //On MouseClick is before OnMouseUp, so if it is moving, don't click...
+ bool somethingIsMoving = false;
+ foreach (OutlookGridGroupBoxColumn? c in _columnsList)
+ {
+ if (c!.IsMoving)
+ {
+ somethingIsMoving = true;
+ }
+ }
+
+ if (!somethingIsMoving)
+ {
+ foreach (OutlookGridGroupBoxColumn? c in _columnsList)
+ {
+ if (c?.Rect != null && c.Rect.Contains(e.X, e.Y))
+ {
+ c.SortDirection = c.SortDirection == SortOrder.Ascending ? SortOrder.Descending : SortOrder.Ascending;
+ //Warn the Grid
+ OnColumnSortChanged(new OutlookGridColumnEventArgs(new OutlookGridColumn(c.ColumnName, null, null, c.SortDirection, -1, -1, null)));
+ }
+ }
+ }
+ }
+
+ base.OnMouseClick(e);
+ }
+
+ ///
+ /// Overrides the MouseMove event.
+ ///
+ /// A MouseEventArgs that contains the event data.
+ protected override void OnMouseMove(MouseEventArgs e)
+ {
+ base.OnMouseMove(e);
+ _mouse = e.Location;
+ foreach (OutlookGridGroupBoxColumn? c in _columnsList)
+ {
+ if (c?.Rect != null)
+ {
+ //Update hovering
+ c.IsHovered = c.Rect.Contains(e.X, e.Y);
+
+ //declare dragging
+ if (c.Rect.Contains(e.X, e.Y) && e.Button == MouseButtons.Left && !_isDragging)
+ {
+ _isDragging = true;
+ c.IsMoving = true;
+ //Console.WriteLine(_mouse.ToString());
+ }
+ }
+ }
+ Invalidate();
+ }
+
+ #endregion
+
+ #region Events
+
+ ///
+ /// Handles OnPalettePaint Event
+ ///
+ /// Source of the event.
+ /// A PaletteLayoutEventArgs that contains the event data.
+ private void OnPalettePaint(object? sender, PaletteLayoutEventArgs e)
+ {
+ Invalidate();
+ }
+
+ ///
+ /// Handles OnGlobalPaletteChanged event
+ ///
+ /// Source of the event.
+ /// A EventArgs that contains the event data.
+ private void OnGlobalPaletteChanged(object? sender, EventArgs e)
+ {
+ // (5) Unhook events from old palette
+ if (_palette != null)
+ {
+ _palette.PalettePaint -= OnPalettePaint;
+ }
+
+ // (6) Cache the new IPalette that is the global palette
+ _palette = KryptonManager.CurrentGlobalPalette;
+ _paletteRedirect.Target = _palette; //!!!!!!
+
+ // (7) Hook into events for the new palette
+ if (_palette != null)
+ {
+ _palette.PalettePaint += OnPalettePaint;
+ }
+
+ // (8) Change of palette means we should repaint to show any changes
+ Invalidate();
+ }
+
+ ///
+ /// Raises the ColumnSortChanged event.
+ ///
+ /// A OutlookGridColumnEventArgs that contains the event data.
+ protected virtual void OnColumnSortChanged(OutlookGridColumnEventArgs e)
+ {
+ if (ColumnSortChanged != null)
+ {
+ ColumnSortChanged(this, e);
+ }
+ }
+
+ ///
+ /// Raises the ColumnGroupAdded event.
+ ///
+ /// A OutlookGridColumnEventArgs that contains the event data.
+ protected virtual void OnColumnGroupAdded(OutlookGridColumnEventArgs e)
+ {
+ if (ColumnGroupAdded != null)
+ {
+ ColumnGroupAdded(this, e);
+ }
+ }
+
+ ///
+ /// Raises the ColumnGroupRemoved event.
+ ///
+ /// A OutlookGridColumnEventArgs that contains the event data.
+ protected virtual void OnColumnGroupRemoved(OutlookGridColumnEventArgs e)
+ {
+ if (ColumnGroupRemoved != null)
+ {
+ ColumnGroupRemoved(this, e);
+ }
+ }
+
+ ///
+ /// Raises the ColumnGroupOrderChanged event.
+ ///
+ /// A OutlookGridColumnEventArgs that contains the event data.
+ protected virtual void OnColumnGroupOrderChanged(OutlookGridColumnEventArgs e)
+ {
+ if (ColumnGroupOrderChanged != null)
+ {
+ ColumnGroupOrderChanged(this, e);
+ }
+ }
+
+ ///
+ /// Raises the ClearGrouping event.
+ ///
+ /// A EventArgs that contains the event data.
+ protected virtual void OnClearGrouping(EventArgs e)
+ {
+ if (ClearGrouping != null)
+ {
+ ClearGrouping(this, e);
+ }
+ }
+
+ ///
+ /// Raises the FullExpand event.
+ ///
+ /// A EventArgs that contains the event data.
+ protected virtual void OnFullExpand(EventArgs e)
+ {
+ if (FullExpand != null)
+ {
+ FullExpand(this, e);
+ }
+ }
+
+ ///
+ /// Raises the FullCollapse event.
+ ///
+ /// A EventArgs that contains the event data.
+ protected virtual void OnFullCollapse(EventArgs e)
+ {
+ if (FullCollapse != null)
+ {
+ FullCollapse(this, e);
+ }
+ }
+
+ ///
+ /// Raises the Group Expand event.
+ ///
+ /// A EventArgs that contains the event data.
+ protected virtual void OnGroupExpand(OutlookGridColumnEventArgs e)
+ {
+ if (GroupExpand != null)
+ {
+ GroupExpand(this, e);
+ }
+ }
+
+ ///
+ /// Raises the Group Collapse event.
+ ///
+ /// A EventArgs that contains the event data.
+ protected virtual void OnGroupCollapse(OutlookGridColumnEventArgs e)
+ {
+ if (GroupCollapse != null)
+ {
+ GroupCollapse(this, e);
+ }
+ }
+
+ ///
+ /// Raises the GroupIntervalClick event.
+ ///
+ /// A EventArgs that contains the event data.
+ private void OnGroupIntervalClick(OutlookGridColumnEventArgs e)
+ {
+ if (GroupIntervalClick != null)
+ {
+ GroupIntervalClick(this, e);
+ }
+ }
+
+ ///
+ /// Raises the OnSortBySummaryCount event.
+ ///
+ /// A EventArgs that contains the event data.
+ private void OnSortBySummaryCount(OutlookGridColumnEventArgs e)
+ {
+ if (SortBySummaryCount != null)
+ {
+ SortBySummaryCount(this, e);
+ }
+ }
+
+ ///
+ /// Handles the HideGroupBox event
+ ///
+ /// Source of the event.
+ /// A EventArgs that contains the event data.
+ private void OnHideGroupBox(object? sender, EventArgs e)
+ {
+ Hide();
+ }
+
+ ///
+ /// Handles the ClearGrouping event
+ ///
+ /// Source of the event.
+ /// A EventArgs that contains the event data.
+ private void OnClearGrouping(object? sender, EventArgs e)
+ {
+ OnClearGrouping(new EventArgs());
+ _columnsList.Clear();
+ Invalidate();
+ }
+
+ ///
+ /// Handles the FullCollapse event
+ ///
+ /// Source of the event.
+ /// A EventArgs that contains the event data.
+ private void OnFullCollapse(object? sender, EventArgs e)
+ {
+ OnFullCollapse(new EventArgs());
+ }
+
+ ///
+ /// Handles the FullExpand event
+ ///
+ /// Source of the event.
+ /// A EventArgs that contains the event data.
+ private void OnFullExpand(object? sender, EventArgs e)
+ {
+ OnFullExpand(new EventArgs());
+ }
+
+ ///
+ /// Handles the GroupCollapse event
+ ///
+ /// Source of the event.
+ /// A OutlookGridColumnEventArgs that contains the event data.
+ private void OnGroupCollapse(object? sender, EventArgs e)
+ {
+ OnGroupCollapse(new OutlookGridColumnEventArgs(new OutlookGridColumn(_columnsList[_indexselected]?.ColumnName, null, null, SortOrder.None, -1, -1, null)));
+ }
+
+ ///
+ /// Handles the GroupExpand event
+ ///
+ /// Source of the event.
+ /// A OutlookGridColumnEventArgs that contains the event data.
+ private void OnGroupExpand(object? sender, EventArgs e)
+ {
+ OnGroupExpand(new OutlookGridColumnEventArgs(new OutlookGridColumn(_columnsList[_indexselected]?.ColumnName, null, null, SortOrder.None, -1, -1, null)));
+ }
+
+ ///
+ /// Handles the SortAscending event
+ ///
+ /// Source of the event.
+ /// A EventArgs that contains the event data.
+ private void OnSortAscending(object? sender, EventArgs e)
+ {
+ //Change the sortOrder in the list
+ OutlookGridGroupBoxColumn? col = _columnsList[_indexselected];
+ col!.SortDirection = SortOrder.Ascending;
+ //Raise event
+ OnColumnSortChanged(new OutlookGridColumnEventArgs(new OutlookGridColumn(col.ColumnName, null, null, SortOrder.Ascending, -1, -1, null)));
+ //Redraw
+ Invalidate();
+ }
+
+ ///
+ /// Handles the SortDescending event
+ ///
+ /// Source of the event.
+ /// A EventArgs that contains the event data.
+ private void OnSortDescending(object? sender, EventArgs e)
+ {
+ //Change the sortOrder in the list
+ OutlookGridGroupBoxColumn? col = _columnsList[_indexselected];
+ col!.SortDirection = SortOrder.Descending;
+ //Raise event
+ OnColumnSortChanged(new OutlookGridColumnEventArgs(new OutlookGridColumn(col.ColumnName, null, null, SortOrder.Descending, -1, -1, null)));
+ //Redraw
+ Invalidate();
+ }
+
+ ///
+ /// Handles the UnGroup event
+ ///
+ /// Source of the event.
+ /// A EventArgs that contains the event data.
+ private void OnUngroup(object? sender, EventArgs e)
+ {
+ OutlookGridGroupBoxColumn? col = _columnsList[_indexselected];
+ OnColumnGroupRemoved(new OutlookGridColumnEventArgs(new OutlookGridColumn(col!.ColumnName, null, null, SortOrder.None, -1, -1, null)));
+ _columnsList.Remove(col);
+ Invalidate();
+ }
+
+ ///
+ /// Handles the GroupIntervalClick event
+ ///
+ /// Source of the event.
+ /// A EventArgs that contains the event data.
+ private void OnGroupIntervalClick(object? sender, EventArgs e)
+ {
+ var item = sender as KryptonContextMenuItem ?? throw new ArgumentNullException(nameof(sender));
+ OutlookGridGroupBoxColumn? col = _columnsList[_indexselected];
+ OutlookGridColumn colEvent = new(col!.ColumnName, null, null, SortOrder.None, -1, -1, null)
+ {
+ GroupingType = new OutlookGridDateTimeGroup(null) { Interval = (DateInterval)Enum.Parse(typeof(DateInterval), item.Tag?.ToString()!) }
+ };
+ col.GroupInterval = ((OutlookGridDateTimeGroup)colEvent.GroupingType).Interval.ToString();
+ //Raise event
+ OnGroupIntervalClick(new OutlookGridColumnEventArgs(colEvent));
+ }
+
+ ///
+ /// Handles the OnSortBySummaryCount event
+ ///
+ /// Source of the event.
+ /// A EventArgs that contains the event data.
+ private void OnSortBySummaryCount(object? sender, EventArgs e)
+ {
+ var item = sender as KryptonContextMenuItem ?? throw new ArgumentNullException(nameof(sender));
+ OutlookGridGroupBoxColumn? col = _columnsList[_indexselected];
+ OutlookGridColumn colEvent = new(col!.ColumnName, null, null, SortOrder.None, -1, -1, null)
+ {
+ GroupingType = new OutlookGridDefaultGroup(null) { SortBySummaryCount = item.Checked }
+ };
+ col.SortBySummaryCount = item.Checked;
+ //Raise event
+ OnSortBySummaryCount(new OutlookGridColumnEventArgs(colEvent));
+ }
+
+ ///
+ /// Handles the DragDrop event. Add a new grouping column following a drag drop from the grid
+ ///
+ /// Source of the event.
+ /// A DragEventArgs that contains the event data.
+ private void KryptonOutlookGridGroupBox_DragDrop(object? sender, DragEventArgs e)
+ {
+ string? columnToMove = e.Data?.GetData(typeof(string)) as string;
+ string? columnName;
+ string? columnText;
+ SortOrder sortOrder;
+ DataGridViewColumnSortMode? sortMode;
+ string[]? res = columnToMove?.Split('|');
+ columnName = res![0];
+ columnText = res[1];
+ sortOrder = (SortOrder)Enum.Parse(typeof(SortOrder), res[2]);//SortOrder.Ascending;
+ if (sortOrder == SortOrder.None)
+ {
+ sortOrder = SortOrder.Ascending;
+ }
+
+ sortMode = (DataGridViewColumnSortMode)Enum.Parse(typeof(DataGridViewColumnSortMode), res[3]);
+ OutlookGridGroupBoxColumn colToAdd = new(columnName, columnText, sortOrder, res[4])
+ {
+ //if (res[4] == typeof(OutlookGridDateTimeGroup).Name)
+ GroupInterval = res[5],
+ SortBySummaryCount = CommonHelper.StringToBool(res[6])
+ };
+ if (!String.IsNullOrEmpty(columnToMove) && !_columnsList.Contains(colToAdd) && sortMode != DataGridViewColumnSortMode.NotSortable)
+ {
+ //Determine the position of the new Group amongst the others
+ int i = 0; //first group order is 0
+ //We are sure that we are going to browse the columns from left to right
+ foreach (OutlookGridGroupBoxColumn? existingColumn in _columnsList)
+ {
+ if (e.X > existingColumn!.Rect.X + existingColumn.Rect.Width / 2)
+ {
+ i++;
+ }
+ }
+ _columnsList.Insert(i, colToAdd);
+
+ //try
+ //{
+ //Warns the grid of a new grouping
+ OnColumnGroupAdded(new OutlookGridColumnEventArgs(new OutlookGridColumn(columnName, null, null, sortOrder, i, -1, null)));
+ Invalidate();
+ //}
+ //catch (Exception exc)
+ //{
+ // MessageBox.Show("Failed to group.\n\n Error:" + exc.Message,
+ // "Grid GroupBox",
+ // MessageBoxButtons.OK,
+ // MessageBoxIcon.Error);
+ //}
+ }
+ }
+
+ ///
+ /// Hnadles the DragEnter event.
+ ///
+ /// Source of the event.
+ /// A DragEventArgs that contains the event data.
+ private void KryptonOutlookGridGroupBox_DragEnter(object? sender, DragEventArgs e)
+ {
+ e.Effect = DragDropEffects.Move;
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// Creates the group box.
+ /// The column.
+ /// Type of the grouping.
+ /// The order.
+ /// if set to true [sort by summary].
+ public void CreateGroupBox(DataGridViewColumn column, string groupingType, SortOrder order, bool sortBySummary)
+ {
+ var columnToMove = column.Name;
+ var columnName = column.Name;
+ var columnText = column.HeaderText;
+ SortOrder sortOrder;
+ DataGridViewColumnSortMode? sortMode;
+ var res = columnToMove.Split('|');
+ sortOrder = order;
+
+ if (sortOrder == SortOrder.None)
+ {
+ sortOrder = SortOrder.Ascending;
+ }
+
+ sortMode = (DataGridViewColumnSortMode)Enum.Parse(typeof(DataGridViewColumnSortMode), column.SortMode.ToString());
+ OutlookGridGroupBoxColumn colToAdd = new(columnName, columnText, sortOrder, groupingType)
+ {
+ GroupInterval = res[0],
+ SortBySummaryCount = sortBySummary
+ };
+
+ if (!string.IsNullOrEmpty(columnToMove) && !_columnsList.Contains(colToAdd) &&
+ sortMode != DataGridViewColumnSortMode.NotSortable)
+ {
+ _columnsList.Insert(0, colToAdd);
+
+
+ //Warns the grid of a new grouping
+ OnColumnGroupAdded(
+ new OutlookGridColumnEventArgs(new OutlookGridColumn(columnName, null, null, sortOrder, 0, -1, null)));
+
+ Invalidate();
+ }
+ }
+
+ ///
+ /// Show the context menu for column box
+ ///
+ private void ShowColumnBoxContextMenu()
+ {
+ if (_menuItems == null)
+ {
+ // Create individual items
+ /*_menuSortAscending = new KryptonContextMenuItem(LanguageManager.Instance.GetString("SORTASCENDING"), Resources.OutlookGridImageResources.sort_az_ascending2, new EventHandler(OnSortAscending));
+ _menuSortDescending = new KryptonContextMenuItem(LanguageManager.Instance.GetString("SORTDESCENDING"), Resources.OutlookGridImageResources.sort_az_descending2, new EventHandler(OnSortDescending));
+ _menuSeparator1 = new KryptonContextMenuSeparator();
+ _menuExpand = new KryptonContextMenuItem(LanguageManager.Instance.GetString("EXPAND"), Resources.OutlookGridImageResources.element_plus_16, new EventHandler(OnGroupExpand));
+ _menuCollapse = new KryptonContextMenuItem(LanguageManager.Instance.GetString("COLLAPSE"), Resources.OutlookGridImageResources.element_minus_16, new EventHandler(OnGroupCollapse));
+ _menuUnGroup = new KryptonContextMenuItem(LanguageManager.Instance.GetString("UNGROUP"), Resources.OutlookGridImageResources.element_delete, new EventHandler(OnUngroup));
+ _menuSeparator2 = new KryptonContextMenuSeparator();
+ _menuFullExpand = new KryptonContextMenuItem(LanguageManager.Instance.GetString("FULLEXPAND"), Resources.OutlookGridImageResources.elements_plus_16, new EventHandler(OnFullExpand));
+ _menuFullCollapse = new KryptonContextMenuItem(LanguageManager.Instance.GetString("FULLCOLLAPSE"), Resources.OutlookGridImageResources.elements_minus_16, new EventHandler(OnFullCollapse));
+ _menuSeparator3 = new KryptonContextMenuSeparator();
+ _menuClearGrouping = new KryptonContextMenuItem(LanguageManager.Instance.GetString("CLEARGROUPING"), Resources.OutlookGridImageResources.element_selection_delete, new EventHandler(OnClearGrouping));
+ _menuHideGroupBox = new KryptonContextMenuItem(LanguageManager.Instance.GetString("HIDEGROUPBOX"), null, new EventHandler(OnHideGroupBox));
+ _menuGroupInterval = new KryptonContextMenuItem(LanguageManager.Instance.GetString("GROUPINTERVAL"));
+ _menuSortBySummary = new KryptonContextMenuItem(LanguageManager.Instance.GetString("SORTBYSUMMARYCOUNT"), null, new EventHandler(OnSortBySummaryCount));*/
+
+ #region Localisation
+
+ _menuSortAscending = new KryptonContextMenuItem(KryptonManager.Strings.OutlookGridStrings.SortAscending, SortingImageResources.sort_az_ascending2, OnSortAscending);
+ _menuSortDescending = new KryptonContextMenuItem(KryptonManager.Strings.OutlookGridStrings.SortDescending, SortingImageResources.sort_az_descending2, OnSortDescending);
+ _menuSeparator1 = new KryptonContextMenuSeparator();
+ _menuExpand = new KryptonContextMenuItem(KryptonManager.Strings.OutlookGridStrings.Expand, ElementsImageResources.element_plus_16, OnGroupExpand);
+ _menuCollapse = new KryptonContextMenuItem(KryptonManager.Strings.OutlookGridStrings.Collapse, ElementsImageResources.element_minus_16, OnGroupCollapse);
+ _menuUnGroup = new KryptonContextMenuItem(KryptonManager.Strings.OutlookGridStrings.Ungroup, ElementsImageResources.element_delete, OnUngroup);
+ _menuSeparator2 = new KryptonContextMenuSeparator();
+ _menuFullExpand = new KryptonContextMenuItem(KryptonManager.Strings.OutlookGridStrings.FullExpand, ElementsImageResources.elements_plus_16, OnFullExpand);
+ _menuFullCollapse = new KryptonContextMenuItem(KryptonManager.Strings.OutlookGridStrings.FullCollapse, ElementsImageResources.elements_minus_16, OnFullCollapse);
+ _menuSeparator3 = new KryptonContextMenuSeparator();
+ _menuClearGrouping = new KryptonContextMenuItem(KryptonManager.Strings.OutlookGridStrings.ClearGrouping, ElementsImageResources.element_selection_delete, OnClearGrouping);
+ _menuHideGroupBox = new KryptonContextMenuItem(KryptonManager.Strings.OutlookGridStrings.HideGroupBox, null, OnHideGroupBox);
+ _menuGroupInterval = new KryptonContextMenuItem(KryptonManager.Strings.OutlookGridStrings.GroupInterval);
+ _menuSortBySummary = new KryptonContextMenuItem(KryptonManager.Strings.OutlookGridStrings.SortBySummaryCount, null, OnSortBySummaryCount);
+
+ #endregion
+
+ _menuSortBySummary.CheckOnClick = true;
+
+ //Group Interval
+ KryptonContextMenuItems? groupIntervalItems;
+ KryptonContextMenuItem? it;
+ string[] names = Enum.GetNames(typeof(DateInterval));
+ KryptonContextMenuItemBase[] arrayOptions = new KryptonContextMenuItemBase[names.Length];
+ for (int i = 0; i < names.Length; i++)
+ {
+ it = new KryptonContextMenuItem(OutlookGridLanguageManager.Instance.GetString(names[i]));
+ it.Tag = names[i];
+ it.Click += OnGroupIntervalClick;
+ arrayOptions[i] = it;
+ }
+ groupIntervalItems = new KryptonContextMenuItems(arrayOptions);
+ _menuGroupInterval.Items.Add(groupIntervalItems);
+
+ // Add items inside an items collection (apart from separator1 which is only added if required)
+ _menuItems = new KryptonContextMenuItems(new KryptonContextMenuItemBase[] { _menuSortAscending,
+ _menuSortDescending,
+ _menuSortBySummary,
+ _menuSeparator1,
+ _menuGroupInterval,
+ _menuExpand,
+ _menuCollapse,
+ _menuUnGroup,
+ _menuSeparator2,
+ _menuFullExpand,
+ _menuFullCollapse,
+ _menuSeparator3,
+ _menuClearGrouping,
+ _menuHideGroupBox
+ });
+ }
+
+ // Ensure we have a krypton context menu if not already present
+ if (_kCtxMenu == null)
+ {
+ _kCtxMenu = new KryptonContextMenu();
+ }
+
+
+ // Update the individual menu options
+ OutlookGridGroupBoxColumn? col = null;
+ if (_indexselected > -1)
+ {
+ col = _columnsList[_indexselected];
+ }
+
+ _menuSortAscending.Visible = col != null;
+ _menuSortDescending.Visible = col != null;
+ _menuSortAscending.Checked = col != null && col.SortDirection == SortOrder.Ascending;
+ _menuSortDescending.Checked = col != null && col.SortDirection == SortOrder.Descending;
+ _menuSortBySummary.Visible = col != null;
+ _menuSortBySummary.Checked = col != null && col.SortBySummaryCount;
+ _menuExpand.Visible = col != null;
+ _menuCollapse.Visible = col != null;
+ _menuGroupInterval.Visible = col != null && col.GroupingType == nameof(OutlookGridDateTimeGroup);
+ if (_menuGroupInterval.Visible)
+ {
+ foreach (var kryptonContextMenuItemBase in ((KryptonContextMenuItems)_menuGroupInterval.Items[0]).Items)
+ {
+ var item = kryptonContextMenuItemBase as KryptonContextMenuItem;
+ item!.Checked = item.Tag!.ToString() == col!.GroupInterval;
+ }
+ }
+ _menuUnGroup.Visible = col != null;
+ _menuFullExpand.Enabled = _columnsList.Count > 0;
+ _menuFullCollapse.Enabled = _columnsList.Count > 0;
+ _menuClearGrouping.Enabled = _columnsList.Count > 0;
+
+ _menuSeparator1.Visible = _menuSortAscending.Visible || _menuSortDescending.Visible;
+ _menuSeparator2.Visible = _menuExpand.Visible || _menuCollapse.Visible || _menuUnGroup.Visible;
+ _menuSeparator3.Visible = _menuFullExpand.Visible || _menuFullCollapse.Visible;
+
+ if (!_kCtxMenu.Items.Contains(_menuItems))
+ {
+ _kCtxMenu.Items.Add(_menuItems);
+ }
+
+ // Show the menu!
+ _kCtxMenu.Show(this);
+ }
+
+ ///
+ /// DO NOT USE THIS FUNCTION YOURSELF, USE the corresponding function in OutlookGrid
+ /// Update the grouping columns.
+ ///
+ /// The list of OutlookGridColumn
+ public void UpdateGroupingColumns(List? list)
+ {
+ _columnsList.Clear();
+ OutlookGridGroupBoxColumn? colToAdd;
+ for (int i = 0; i < list!.Count; i++)
+ {
+ if (list[i].IsGrouped)
+ {
+ colToAdd = new OutlookGridGroupBoxColumn(list[i].DataGridViewColumn?.Name, list[i].DataGridViewColumn?.HeaderText, list[i].SortDirection, list[i].GroupingType?.GetType().Name!);
+
+ if (colToAdd.GroupingType == nameof(OutlookGridDateTimeGroup))
+ {
+ colToAdd.GroupInterval = (list[i].GroupingType! as OutlookGridDateTimeGroup)?.Interval.ToString();
+ }
+
+ _columnsList.Add(colToAdd);
+ }
+ }
+ Invalidate();
+ }
+
+
+ ///
+ /// Checks if the column exists in the GroupBox control
+ ///
+ /// The column name.
+ /// True if exists, otherwise false.
+ public bool Contains(string columnName)
+ {
+ for (int i = 0; i < _columnsList.Count; i++)
+ {
+ if (_columnsList[i]?.ColumnName == columnName)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPanel.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPanel.cs
index 7c160024d..ac99c5b63 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPanel.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPanel.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -27,7 +27,7 @@ public class KryptonPanel : VisualPanel
{
#region Instance Fields
- private readonly PaletteDoubleRedirect? _stateCommon;
+ private readonly PaletteDoubleRedirect _stateCommon;
private readonly PaletteDouble? _stateDisabled;
private readonly PaletteDouble? _stateNormal;
#endregion
@@ -41,7 +41,7 @@ public KryptonPanel()
SetStyle(ControlStyles.SupportsTransparentBackColor | ControlStyles.OptimizedDoubleBuffer, true);
// Create the palette storage
- _stateCommon = new PaletteDoubleRedirect(Redirector, PaletteBackStyle.PanelClient, PaletteBorderStyle.ControlClient, NeedPaintDelegate);
+ _stateCommon = new PaletteDoubleRedirect(Redirector!, PaletteBackStyle.PanelClient, PaletteBorderStyle.ControlClient, NeedPaintDelegate);
_stateDisabled = new PaletteDouble(_stateCommon, NeedPaintDelegate);
_stateNormal = new PaletteDouble(_stateCommon, NeedPaintDelegate);
@@ -54,18 +54,20 @@ public KryptonPanel()
/// Common appearance state to inherit from.
/// Disabled appearance state.
/// Normal appearance state.
- public KryptonPanel([DisallowNull] PaletteDoubleRedirect stateCommon,
- [DisallowNull] PaletteDouble stateDisabled,
- [DisallowNull] PaletteDouble stateNormal)
+ public KryptonPanel(PaletteDoubleRedirect stateCommon,
+ PaletteDouble stateDisabled,
+ PaletteDouble stateNormal)
{
SetStyle(ControlStyles.SupportsTransparentBackColor | ControlStyles.OptimizedDoubleBuffer, true);
- Debug.Assert(stateCommon != null);
- Debug.Assert(stateDisabled != null);
- Debug.Assert(stateNormal != null);
+ // Debug.Assert() causes the null assignment warning.
+ // Suppressed by the null forgiving operator
+ Debug.Assert(stateCommon is not null);
+ Debug.Assert(stateDisabled is not null);
+ Debug.Assert(stateNormal is not null);
// Remember the palette storage
- _stateCommon = stateCommon;
+ _stateCommon = stateCommon!;
_stateDisabled = stateDisabled;
_stateNormal = stateNormal;
@@ -113,9 +115,9 @@ public PaletteBackStyle PanelBackStyle
[Category(@"Visuals")]
[Description(@"Overrides for defining disabled panel appearance.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public PaletteBack StateDisabled => _stateDisabled.Back;
+ public PaletteBack StateDisabled => _stateDisabled!.Back;
- private bool ShouldSerializeStateDisabled() => !_stateDisabled.Back.IsDefault;
+ private bool ShouldSerializeStateDisabled() => !_stateDisabled!.Back.IsDefault;
///
/// Gets access to the normal panel appearance.
@@ -123,9 +125,9 @@ public PaletteBackStyle PanelBackStyle
[Category(@"Visuals")]
[Description(@"Overrides for defining normal panel appearance.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public PaletteBack StateNormal => _stateNormal.Back;
+ public PaletteBack StateNormal => _stateNormal!.Back;
- private bool ShouldSerializeStateNormal() => !_stateNormal.Back.IsDefault;
+ private bool ShouldSerializeStateNormal() => !_stateNormal!.Back.IsDefault;
///
/// Fix the control to a particular palette state.
@@ -149,7 +151,7 @@ public virtual void SetFixedState(PaletteState state) =>
protected override void OnEnabledChanged(EventArgs e)
{
// Push correct palettes into the view
- ViewDrawPanel.SetPalettes(Enabled ? _stateNormal.Back : _stateDisabled.Back);
+ ViewDrawPanel.SetPalettes(Enabled ? _stateNormal!.Back : _stateDisabled!.Back);
// Update with latest enabled state
ViewDrawPanel.Enabled = Enabled;
@@ -166,7 +168,7 @@ protected override void OnEnabledChanged(EventArgs e)
private void Construct()
{
// Our view contains just a simple canvas that covers entire client area
- ViewDrawPanel = new ViewDrawPanel(_stateNormal.Back);
+ ViewDrawPanel = new ViewDrawPanel(_stateNormal!.Back);
// Create the view manager instance
ViewManager = new ViewManager(this, ViewDrawPanel);
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPictureBox.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPictureBox.cs
index 78caf028e..122467e0f 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPictureBox.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPictureBox.cs
@@ -1,7 +1,7 @@
#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. 2023 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2024. All rights reserved.
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPrintDialog.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPrintDialog.cs
index 6f69df16d..74b35949b 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPrintDialog.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPrintDialog.cs
@@ -2,7 +2,7 @@
/*
*
* 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. 2021 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2021 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonProgressBar.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonProgressBar.cs
index 900fc69d2..f6d2dad01 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonProgressBar.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonProgressBar.cs
@@ -1,7 +1,7 @@
#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.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2022 - 2024. All rights reserved.
*/
#endregion
@@ -18,9 +18,14 @@ namespace Krypton.Toolkit
[DefaultBindingProperty("Value")]
[DesignerCategory(@"code")]
[Description(@"Represents a Krypton progress bar control.")]
- [Designer(typeof(KryptonButtonDesigner))]
+ //[Designer(typeof(KryptonButtonDesigner))]
public class KryptonProgressBar : Control, IContentValues
{
+ // Progressbar designer is incorrect.
+ // Disabled for now.
+ // Control works fine without it.
+ // Will discuss later if a specific designer is desired and what it should look like.
+
#region Instance Fields
private ProgressBarStyle _style;
@@ -33,7 +38,6 @@ public class KryptonProgressBar : Control, IContentValues
private IDisposable? _mementoBackProgressBar;
private IDisposable? _mementoBackProgressValue;
private bool _useValueAsText;
- private float _cornerRoundingRadius;
private int _marqueeSpeed;
private int _maximum;
private int _minimum;
@@ -74,7 +78,7 @@ public KryptonProgressBar()
{
Interval = _marqueeSpeed
};
- _marqueeTimer.Tick += OnMarqueeTick!;
+ _marqueeTimer.Tick += OnMarqueeTick;
// Cache the current global palette setting
_palette = KryptonManager.CurrentGlobalPalette;
@@ -82,7 +86,7 @@ public KryptonProgressBar()
// Hook into palette events
if (_palette != null)
{
- _palette.PalettePaint += OnPalettePaint!;
+ _palette.PalettePaint += OnPalettePaint;
}
// Create content storage
@@ -90,10 +94,10 @@ public KryptonProgressBar()
{
Text = string.Empty
};
- Values.TextChanged += OnLabelTextChanged!;
+ Values.TextChanged += OnLabelTextChanged;
// We want to be notified whenever the global palette changes
- KryptonManager.GlobalPaletteChanged += OnGlobalPaletteChanged!;
+ KryptonManager.GlobalPaletteChanged += OnGlobalPaletteChanged;
// Create redirection object to the base palette
_paletteRedirect = new PaletteRedirect(_palette);
@@ -111,7 +115,6 @@ public KryptonProgressBar()
Color1 = Color.Green
}
};
- SetCornerRoundingRadius(null);
StateDisabled = new PaletteTriple(StateCommon, OnNeedPaintHandler);
((PaletteBack)StateDisabled.PaletteBack).ColorStyle = PaletteColorStyle.OneNote;
StateNormal = new PaletteTriple(StateCommon, OnNeedPaintHandler);
@@ -152,12 +155,12 @@ protected override void Dispose(bool disposing)
// Unhook from the palette events
if (_palette != null)
{
- _palette.PalettePaint -= OnPalettePaint!;
+ _palette.PalettePaint -= OnPalettePaint;
_palette = null;
}
// Unhook from the static events, otherwise we cannot be garbage collected
- KryptonManager.GlobalPaletteChanged -= OnGlobalPaletteChanged!;
+ KryptonManager.GlobalPaletteChanged -= OnGlobalPaletteChanged;
}
base.Dispose(disposing);
@@ -385,7 +388,6 @@ public int Value
}
}
-
///
/// Gets or sets the text associated with this control.
///
@@ -395,6 +397,9 @@ public int Value
[AllowNull]
public override string Text
{
+ // Values.Text can be set to null
+ // The getter will always return a string
+
get => Values.Text;
set
@@ -447,19 +452,6 @@ public void PerformStep()
public override string ToString() =>
$"{base.ToString()}, Minimum: {Minimum.ToString(CultureInfo.CurrentCulture)}, Maximum: {Maximum.ToString(CultureInfo.CurrentCulture)}, Value: {Value.ToString(CultureInfo.CurrentCulture)}";
- /// Gets or sets the corner rounding radius.
- /// The corner rounding radius.
- [Category(@"Visuals")]
- [Description(@"Gets or sets the corner rounding radius.")]
- [RefreshProperties(RefreshProperties.Repaint)]
- [DefaultValue(GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE)]
- public float CornerRoundingRadius
- {
- get => _cornerRoundingRadius;
-
- set => SetCornerRoundingRadius(value);
- }
-
///
/// Gets and sets the visual orientation of the control.
///
@@ -564,7 +556,7 @@ protected override void OnLayout(LayoutEventArgs e)
var (barPaletteState, barState) = GetBarPaletteState();
// Get the renderer associated with this palette
- IRenderer renderer = _palette.GetRenderer()!;
+ IRenderer renderer = _palette.GetRenderer();
// Create a layout context used to allow the renderer to layout the content
using var viewContext = new ViewLayoutContext(this, renderer);
@@ -574,8 +566,8 @@ protected override void OnLayout(LayoutEventArgs e)
// Ask the renderer to work out how the Content values will be laid out and
// return a memento object that we cache for use when actually performing painting
- _mementoContent = renderer.RenderStandardContent.LayoutContent(viewContext, ClientRectangle, barPaletteState.PaletteContent,
- this, Orientation, barState, false, true);
+ _mementoContent = renderer.RenderStandardContent.LayoutContent(viewContext, ClientRectangle, barPaletteState.PaletteContent!,
+ this, Orientation, barState);
}
base.OnLayout(e);
@@ -584,144 +576,148 @@ protected override void OnLayout(LayoutEventArgs e)
///
protected override void OnPaint(PaintEventArgs e)
{
- if (_palette != null)
- {
- // Get the renderer associated with this palette
- IRenderer? renderer = _palette.GetRenderer();
+ // Get the renderer associated with this palette
+ IRenderer renderer = _palette!.GetRenderer();
- // Create the rendering context that is passed into all renderer calls
- using var renderContext = new RenderContext(this, e.Graphics, e.ClipRectangle, renderer);
- // Set the style we want picked up from the base palette
- var (barPaletteState, barState) = GetBarPaletteState();
+ // Create the rendering context that is passed into all renderer calls
+ using var renderContext = new RenderContext(this, e.Graphics, e.ClipRectangle, renderer);
+ // Set the style we want picked up from the base palette
+ var (barPaletteState, barState) = GetBarPaletteState();
- // Draw the background of the entire control over the entire client area.
- using (GraphicsPath path = CreateRectGraphicsPath(ClientRectangle))
- {
- var panelState = !Parent.Enabled
- ? PaletteState.Disabled
- : PaletteState.Normal;
- // Ask renderer to draw the background
- _mementoBackClientPanel = renderer.RenderStandardBack.DrawBack(renderContext, ClientRectangle, path, _paletteBackClientPanel, Orientation,
- panelState, _mementoBackClientPanel);
- }
+ // Draw the background of the entire control over the entire client area.
+ using (GraphicsPath path = CreateRectGraphicsPath(ClientRectangle))
+ {
+ var panelState = !Parent!.Enabled
+ ? PaletteState.Disabled
+ : PaletteState.Normal;
+ // Ask renderer to draw the background
+ _mementoBackClientPanel = renderer.RenderStandardBack.DrawBack(renderContext, ClientRectangle, path, _paletteBackClientPanel, Orientation,
+ panelState, _mementoBackClientPanel);
+ }
- //////////////////////////////////////////////////////////////////////////////////
- // In case the border has a rounded effect we need to get the background path //
- // to draw from the border part of the renderer. It will return a path that is //
- // appropriate for use drawing within the border settings. //
- //////////////////////////////////////////////////////////////////////////////////
- using (GraphicsPath path = renderer.RenderStandardBorder.GetBackPath(renderContext,
- ClientRectangle,
- barPaletteState.PaletteBorder,
- Orientation,
- barState))
- {
- // Ask renderer to draw the background
- _mementoBackProgressBar = renderer.RenderStandardBack.DrawBack(renderContext, ClientRectangle, path, barPaletteState.PaletteBack,
- Orientation, barState, _mementoBackProgressBar);
- }
+ //////////////////////////////////////////////////////////////////////////////////
+ // In case the border has a rounded effect we need to get the background path //
+ // to draw from the border part of the renderer. It will return a path that is //
+ // appropriate for use drawing within the border settings. //
+ //////////////////////////////////////////////////////////////////////////////////
+ using (GraphicsPath fullLozengePath = renderer.RenderStandardBorder.GetBackPath(renderContext,
+ ClientRectangle,
+ barPaletteState.PaletteBorder!,
+ Orientation,
+ barState))
+ {
+ // Ask renderer to draw the background
+ using var gh = new GraphicsHint(renderContext.Graphics, barPaletteState.PaletteBorder!.GetBorderGraphicsHint(barState));
+ _mementoBackProgressBar = renderer.RenderStandardBack.DrawBack(renderContext, ClientRectangle,
+ fullLozengePath, barPaletteState.PaletteBack,
+ Orientation, barState, _mementoBackProgressBar);
+ using var region = new Region(fullLozengePath);
+ // Set the clipping region, So that "Small" rounded values do not escape the draw area
+ e.Graphics.SetClip(region, CombineMode.Replace);
+ }
- // Create a rectangle inset
- Rectangle innerRect = ClientRectangle;
- var maximumRange = (Maximum - Minimum);
- if (_style == ProgressBarStyle.Marquee)
+ // Create a rectangle inset
+ Rectangle innerRect = ClientRectangle;
+ var maximumRange = (Maximum - Minimum);
+ if (_style == ProgressBarStyle.Marquee)
+ {
+ float ratio = 1.0f / maximumRange;
+ int half = (int)(3 * ratio);
+ int lower = Math.Max(_marqueeLocation - Minimum - half, Minimum);
+ int higher = Math.Min(lower + half, maximumRange);
+ switch (Orientation)
{
- float ratio = 1.0f / maximumRange;
- int half = (int)(3 * ratio);
- int lower = Math.Max(_marqueeLocation - Minimum - half, Minimum);
- int higher = Math.Min(lower + half, maximumRange);
- switch (Orientation)
- {
- case VisualOrientation.Top:
- case VisualOrientation.Bottom:
+ case VisualOrientation.Top:
+ case VisualOrientation.Bottom:
+ {
+ int width = innerRect.Width;
+
+ innerRect.X += (int)(ratio * width * lower);
+ innerRect.Width = (int)(ratio * width * higher);
+ // Now do special clipping handling for curved borders
+ if (innerRect.Right > ClientRectangle.Right)
{
- int width = innerRect.Width;
-
- innerRect.X += (int)(ratio * width * lower);
- innerRect.Width = (int)(ratio * width * higher);
- // Now do special clipping handling for curved borders
- if (innerRect.Right > ClientRectangle.Right)
- {
- innerRect.Width -= (innerRect.Right - ClientRectangle.Right);
- }
- if (innerRect.X > ClientRectangle.Right)
- {
- innerRect.X = ClientRectangle.Right;
- }
+ innerRect.Width -= (innerRect.Right - ClientRectangle.Right);
}
- break;
-
- case VisualOrientation.Left:
- case VisualOrientation.Right:
+ if (innerRect.X > ClientRectangle.Right)
{
- int height = innerRect.Height;
-
- innerRect.Y += (int)(ratio * height * lower);
- innerRect.Height = (int)(ratio * height * higher);
- // Now do special clipping handling for curved borders
- if (innerRect.Bottom > ClientRectangle.Bottom)
- {
- innerRect.Height -= (innerRect.Bottom - ClientRectangle.Bottom);
- }
-
- if (innerRect.Y > ClientRectangle.Bottom)
- {
- innerRect.Y = ClientRectangle.Bottom;
- }
+ innerRect.X = ClientRectangle.Right;
}
- break;
- }
- }
- else
- {
- // Draw the value offset
- float v = (Value - Minimum);
- float ratio = v / maximumRange;
- switch (Orientation)
- {
- case VisualOrientation.Top:
- case VisualOrientation.Bottom:
- innerRect.Width = (int)(ratio * innerRect.Width);
- if (RightToLeft == RightToLeft.Yes)
+ }
+ break;
+
+ case VisualOrientation.Left:
+ case VisualOrientation.Right:
+ {
+ int height = innerRect.Height;
+
+ innerRect.Y += (int)(ratio * height * lower);
+ innerRect.Height = (int)(ratio * height * higher);
+ // Now do special clipping handling for curved borders
+ if (innerRect.Bottom > ClientRectangle.Bottom)
{
- innerRect.X = ClientRectangle.Right - innerRect.Width;
+ innerRect.Height -= (innerRect.Bottom - ClientRectangle.Bottom);
}
- break;
-
- case VisualOrientation.Left:
- case VisualOrientation.Right:
- innerRect.Height = (int)(ratio * innerRect.Height);
- if (RightToLeft == RightToLeft.Yes)
+ if (innerRect.Y > ClientRectangle.Bottom)
{
- innerRect.Y = ClientRectangle.Bottom - innerRect.Height;
+ innerRect.Y = ClientRectangle.Bottom;
}
-
- break;
- }
+ }
+ break;
}
-
- using (GraphicsPath path = renderer.RenderStandardBorder.GetBackPath(renderContext,
- innerRect,
- barPaletteState.PaletteBorder,
- Orientation,
- barState))
+ }
+ else
+ {
+ // Draw the value offset
+ float v = (Value - Minimum);
+ float ratio = v / maximumRange;
+ switch (Orientation)
{
- // Ask renderer to draw the background
- _mementoBackProgressValue = renderer.RenderStandardBack.DrawBack(renderContext, innerRect, path, _stateBackValue,
- Orientation, barState, _mementoBackProgressValue);
+ case VisualOrientation.Top:
+ case VisualOrientation.Bottom:
+ innerRect.Width = (int)(ratio * innerRect.Width);
+ if (RightToLeft == RightToLeft.Yes)
+ {
+ innerRect.X = ClientRectangle.Right - innerRect.Width;
+ }
+
+ break;
+
+ case VisualOrientation.Left:
+ case VisualOrientation.Right:
+ innerRect.Height = (int)(ratio * innerRect.Height);
+ if (RightToLeft == RightToLeft.Yes)
+ {
+ innerRect.Y = ClientRectangle.Bottom - innerRect.Height;
+ }
+
+ break;
}
+ }
- // Now we draw the border of the inner area
- renderer.RenderStandardBorder.DrawBorder(renderContext, ClientRectangle, barPaletteState.PaletteBorder,
- Orientation, barState);
-
- // Last of all we draw the content over the top of the border and background
- renderer.RenderStandardContent.DrawContent(renderContext, ClientRectangle,
- barPaletteState.PaletteContent, _mementoContent,
- Orientation, barState, false, true, false);
+ using (GraphicsPath valueLozengePath = renderer.RenderStandardBorder.GetBackPath(renderContext,
+ innerRect,
+ barPaletteState.PaletteBorder!,
+ Orientation,
+ barState))
+ {
+ using var gh = new GraphicsHint(renderContext.Graphics,
+ barPaletteState.PaletteBorder.GetBorderGraphicsHint(PaletteState.Normal));
+ // Ask renderer to Fill the Progress lozenge
+ _mementoBackProgressValue = renderer.RenderStandardBack.DrawBack(renderContext, innerRect, valueLozengePath, _stateBackValue,
+ Orientation, barState, _mementoBackProgressValue);
}
+ // Now we draw the border of the inner area
+ renderer.RenderStandardBorder.DrawBorder(renderContext, ClientRectangle, barPaletteState.PaletteBorder,
+ Orientation, barState);
+
+ // Last of all we draw the content over the top of the border and background
+ renderer.RenderStandardContent.DrawContent(renderContext, ClientRectangle,
+ barPaletteState.PaletteContent!, _mementoContent!,
+ Orientation, barState, false);
+
base.OnPaint(e);
}
#endregion
@@ -742,12 +738,12 @@ private GraphicsPath CreateRectGraphicsPath(Rectangle rect)
return path;
}
- private void OnGlobalPaletteChanged(object sender, EventArgs e)
+ private void OnGlobalPaletteChanged(object? sender, EventArgs e)
{
// Unhook events from old palette
if (_palette != null)
{
- _palette.PalettePaint -= OnPalettePaint!;
+ _palette.PalettePaint -= OnPalettePaint;
}
// Cache the new PaletteBase that is the global palette
@@ -757,7 +753,7 @@ private void OnGlobalPaletteChanged(object sender, EventArgs e)
// Hook into events for the new palette
if (_palette != null)
{
- _palette.PalettePaint += OnPalettePaint!;
+ _palette.PalettePaint += OnPalettePaint;
}
// Change of palette means we should repaint to show any changes
@@ -777,16 +773,8 @@ private void OnNeedPaintHandler(object? sender, NeedLayoutEventArgs e)
}
// Palette indicates we might need to repaint, so lets do it
- private void OnPalettePaint(object sender, PaletteLayoutEventArgs e) => Invalidate();
-
- private void SetCornerRoundingRadius(float? radius)
- {
- _cornerRoundingRadius = radius ?? GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
- StateCommon.Border.Rounding = _cornerRoundingRadius;
- }
-
- private void OnLabelTextChanged(object sender, EventArgs e) => OnTextChanged(EventArgs.Empty);
+ private void OnPalettePaint(object? sender, PaletteLayoutEventArgs e) => Invalidate();
+ private void OnLabelTextChanged(object? sender, EventArgs e) => OnTextChanged(EventArgs.Empty);
private void StartMarquee()
{
@@ -796,7 +784,7 @@ private void StartMarquee()
_marqueeTimer.Start();
}
- private void OnMarqueeTick(object sender, EventArgs e)
+ private void OnMarqueeTick(object? sender, EventArgs e)
{
_marqueeLocation++;
if (_marqueeLocation > Maximum)
@@ -808,14 +796,9 @@ private void OnMarqueeTick(object sender, EventArgs e)
private void UpdateTextWithValue(bool value)
{
- if (value)
- {
- Text = $@"{Value}%";
- }
- else
- {
- Text = string.Empty;
- }
+ Text = value
+ ? $@"{Value}%"
+ : string.Empty;
}
#endregion
@@ -843,6 +826,7 @@ public override Color BackColor
///
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
+ [AllowNull, MaybeNull]
public override Image BackgroundImage
{
get => base.BackgroundImage;
@@ -899,9 +883,10 @@ public override ImageLayout BackgroundImageLayout
///
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
+ [AllowNull, MaybeNull]
public override ContextMenuStrip ContextMenuStrip
{
- get => base.ContextMenuStrip;
+ get => base.ContextMenuStrip!;
set => base.ContextMenuStrip = value;
}
@@ -917,8 +902,12 @@ protected override bool DoubleBuffered
///
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
+ [AllowNull]
public override Font Font
{
+ // base.Font will always return a Font
+ // base can take null as a value
+
get => base.Font;
set => base.Font = value;
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonProgressBarToolStripItem.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonProgressBarToolStripItem.cs
index 42b881109..606ff89b1 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonProgressBarToolStripItem.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonProgressBarToolStripItem.cs
@@ -1,7 +1,7 @@
#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. 2023 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2024. All rights reserved.
*/
#endregion
@@ -156,8 +156,12 @@ public int Value
///
[DefaultValue("")]
+ [AllowNull]
public override string Text
{
+ // KryptonProgress.Values.Text can be set to null
+ // The getter will always return a string
+
get => KryptonProgressBarHost.Text;
set => KryptonProgressBarHost.Text = value;
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPropertyGrid.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPropertyGrid.cs
index db82e9e0f..8a97ece76 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPropertyGrid.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPropertyGrid.cs
@@ -1,155 +1,997 @@
#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. 2021 - 2023. All rights reserved.
- *
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2021 - 2024. All rights reserved.
*/
#endregion
+// ReSharper disable UnusedMember.Global
+
+// ReSharper disable UnusedMember.Local
+using System.ComponentModel;
+
namespace Krypton.Toolkit
{
- /// A property grid control that supports the Krypton render.
+ ///A property grid control that supports the Krypton render.
+ /// ///
[Description(@"A property grid control that supports the Krypton render.")]
[Designer(typeof(KryptonPropertyGridDesigner))]
[ToolboxBitmap(typeof(PropertyGrid), "ToolboxBitmaps.KryptonPropertyGridVersion2.bmp")]
[ToolboxItem(true)]
- public class KryptonPropertyGrid : PropertyGrid
+ public class KryptonPropertyGrid : VisualControlBase,
+ IContainedInputControl
{
- #region Variables
- private PaletteBase? _palette;
+ #region Classes
+ private class InternalPropertyGrid : PropertyGrid
+ {
+ #region Instance Fields
+ private readonly ViewManager? _viewManager;
+ private readonly KryptonPropertyGrid _kryptonPropertyGrid;
+ private readonly IntPtr _screenDC;
+ private bool _mouseOver;
+ #endregion
+
+ #region Events
+ ///
+ /// Occurs when the mouse enters the InternalListView.
+ ///
+ public event EventHandler? TrackMouseEnter;
+
+ ///
+ /// Occurs when the mouse leaves the InternalListView.
+ ///
+ public event EventHandler? TrackMouseLeave;
+ #endregion
+
+ #region Identity
+ ///
+ /// Initialize a new instance of the InternalPropertyGrid class.
+ ///
+ /// Reference to owning control.
+ public InternalPropertyGrid(KryptonPropertyGrid kryptonPropertyGrid)
+ {
+ SetStyle(ControlStyles.ResizeRedraw
+ | ControlStyles.AllPaintingInWmPaint
+ | ControlStyles.OptimizedDoubleBuffer, true);
+ _kryptonPropertyGrid = kryptonPropertyGrid;
+
+ // Create manager and view for drawing the background
+ ViewDrawPanel = new ViewDrawPanel();
+ _viewManager = new ViewManager(this, ViewDrawPanel);
+
+ // ReSharper disable RedundantBaseQualifier
+ base.Size = Size.Empty;
+ //base.BorderStyle = BorderStyle.None;
+ // ReSharper restore RedundantBaseQualifier
+
+ // We need to create and cache a device context compatible with the display
+ _screenDC = PI.CreateCompatibleDC(IntPtr.Zero);
+ ToolStripRenderer = ToolStripManager.Renderer;
+ UseCompatibleTextRendering = false;
+ }
+
+ ///
+ /// Releases all resources used by the Control.
+ ///
+ /// true to release both managed and unmanaged resources; false to release only unmanaged resources.
+ protected override void Dispose(bool disposing)
+ {
+ base.Dispose(disposing);
+ if (_screenDC != IntPtr.Zero)
+ {
+ PI.DeleteDC(_screenDC);
+ }
+ }
+
+ #endregion
+
+ #region Public
- private readonly PaletteRedirect? _paletteRedirect;
- private readonly PaletteInputControlTripleRedirect _stateCommon;
- private readonly PaletteInputControlTripleStates _stateNormal;
- private readonly PaletteInputControlTripleStates _stateDisabled;
- private readonly PaletteInputControlTripleStates _stateActive;
+ ///
+ /// Recreate the window handle.
+ ///
+ public void Recreate() => RecreateHandle();
+ ///
+ /// Gets access to the contained view draw panel instance.
+ ///
+ public ViewDrawPanel ViewDrawPanel { get; }
+ ///
+ /// Gets and sets if the mouse is currently over the combo box.
+ ///
+ public bool MouseOver
+ {
+ get => _mouseOver;
+ set
+ {
+ // Only interested in changes
+ if (_mouseOver != value)
+ {
+ _mouseOver = value;
+
+ // Generate appropriate change event
+ if (_mouseOver)
+ {
+ OnTrackMouseEnter(EventArgs.Empty);
+ }
+ else
+ {
+ OnTrackMouseLeave(EventArgs.Empty);
+ }
+ }
+ }
+ }
+ #endregion
+
+ #region Protected
+ /// Raises the event.
+ /// An that contains the event data.
+ protected override void OnSystemColorsChanged(EventArgs e)
+ {
+ // DO nothing, It's Krypton Colours that are in use !
+ }
+
+ ///
+ /// Raises the Layout event.
+ ///
+ /// A LayoutEventArgs containing the event data.
+ protected override void OnLayout(LayoutEventArgs levent)
+ {
+ if (!IsHandleCreated || !Visible)
+ {
+ return;
+ }
+ base.OnLayout(levent);
+
+ // Ask the panel to layout given our available size
+ using var context =
+ new ViewLayoutContext(_viewManager, this, _kryptonPropertyGrid, _kryptonPropertyGrid.Renderer);
+ ViewDrawPanel.Layout(context);
+ }
+
+ ///
+ /// Process Windows-based messages.
+ ///
+ /// A Windows-based message.
+ protected override void WndProc(ref Message m)
+ {
+ switch (m.Msg)
+ {
+ case PI.WM_.ERASEBKGND:
+ // Do not draw the background here, always do it in the paint
+ // instead to prevent flicker because of a two stage drawing process
+ break;
+
+ case PI.WM_.PRINTCLIENT:
+ case PI.WM_.PAINT:
+ WmPaint(ref m);
+ break;
+
+ case PI.WM_.VSCROLL:
+ case PI.WM_.HSCROLL:
+ case PI.WM_.MOUSEWHEEL:
+ Invalidate();
+ base.WndProc(ref m);
+ break;
+
+ case PI.WM_.MOUSELEAVE:
+ if (MouseOver)
+ {
+ MouseOver = false;
+ _kryptonPropertyGrid.PerformNeedPaint(true);
+ Invalidate();
+ }
+ base.WndProc(ref m);
+ break;
+
+ case PI.WM_.MOUSEMOVE:
+ if (!MouseOver)
+ {
+ MouseOver = true;
+ _kryptonPropertyGrid.PerformNeedPaint(true);
+ Invalidate();
+ }
+ base.WndProc(ref m);
+ break;
+
+ default:
+ base.WndProc(ref m);
+ break;
+ }
+ }
+
+ #endregion
+
+ #region Private
+
+ ///
+ /// Raises the TrackMouseEnter event.
+ ///
+ /// An EventArgs containing the event data.
+ private void OnTrackMouseEnter(EventArgs e) => TrackMouseEnter?.Invoke(this, e);
+
+ ///
+ /// Raises the TrackMouseLeave event.
+ ///
+ /// An EventArgs containing the event data.
+ private void OnTrackMouseLeave(EventArgs e) => TrackMouseLeave?.Invoke(this, e);
+
+ private void WmPaint(ref Message m)
+ {
+ var ps = new PI.PAINTSTRUCT();
+
+ // Do we need to BeginPaint or just take the given HDC?
+ IntPtr hdc = m.WParam == IntPtr.Zero ? PI.BeginPaint(Handle, ref ps) : m.WParam;
+
+ // Create bitmap that all drawing occurs onto, then we can blit it later to remove flicker
+ Rectangle realRect = CommonHelper.RealClientRectangle(Handle);
+
+ // No point drawing when one of the dimensions is zero
+ if (realRect is { Width: > 0, Height: > 0 })
+ {
+ IntPtr hBitmap = PI.CreateCompatibleBitmap(hdc, realRect.Width, realRect.Height);
+
+ // If we managed to get a compatible bitmap
+ if (hBitmap != IntPtr.Zero)
+ {
+ try
+ {
+ // Must use the screen device context for the bitmap when drawing into the
+ // bitmap otherwise the Opacity and RightToLeftLayout will not work correctly.
+ PI.SelectObject(_screenDC, hBitmap);
+
+ // Easier to draw using a graphics instance than a DC!
+ using (Graphics g = Graphics.FromHdc(_screenDC))
+ {
+ // Ask the view element to layout in given space, needs this before a render call
+ using (var context = new ViewLayoutContext(this, _kryptonPropertyGrid.Renderer))
+ {
+ context.DisplayRectangle = realRect;
+ ViewDrawPanel.Layout(context);
+ }
+
+ using (var context = new RenderContext(this, _kryptonPropertyGrid, g, realRect,
+ _kryptonPropertyGrid.Renderer))
+ {
+ ViewDrawPanel.Render(context);
+ }
+
+ // We can only control the background color by using the built in property and not
+ // by overriding the drawing directly, therefore we can only provide a single color.
+ Color color1 = ViewDrawPanel.GetPalette().GetBackColor1(ViewDrawPanel.State);
+ if (color1 != BackColor)
+ {
+ BackColor = color1;
+ }
+
+ // Replace given DC with the screen DC for base window proc drawing
+ IntPtr beforeDC = m.WParam;
+ m.WParam = _screenDC;
+ DefWndProc(ref m);
+ m.WParam = beforeDC;
+ }
+
+ // Now blit from the bitmap from the screen to the real dc
+ PI.BitBlt(hdc, 0, 0, realRect.Width, realRect.Height, _screenDC, 0, 0, PI.SRCCOPY);
+ }
+ finally
+ {
+ // Delete the temporary bitmap
+ PI.DeleteObject(hBitmap);
+ }
+ }
+ }
+
+ // Do we need to match the original BeginPaint?
+ if (m.WParam == IntPtr.Zero)
+ {
+ PI.EndPaint(Handle, ref ps);
+ }
+ }
+ #endregion
+ }
+
+ #endregion
+
+ #region Instance Fields
+
+ private readonly ViewDrawDocker _drawDockerOuter;
+ private readonly ViewLayoutFill _layoutFill;
+ private readonly InternalPropertyGrid _propertyGrid;
+ private bool? _fixedActive;
+ private readonly IntPtr _screenDC;
+ private bool _mouseOver;
+ private bool _alwaysActive;
+ private bool _forcedLayout;
#endregion
+ #region Events
+
+ // TODO:
+
+ #endregion
+
+
#region Constructor
+
+ /// Initializes a new instance of the class.
public KryptonPropertyGrid()
{
- SetStyle(ControlStyles.UserPaint
- | ControlStyles.OptimizedDoubleBuffer
- | ControlStyles.SupportsTransparentBackColor,
- true);
+ // Contains another control and needs marking as such for validation to work
+ SetStyle(ControlStyles.ContainerControl, true);
+ // Cannot select this control, only the child tree view and does not generate a
+ SetStyle(ControlStyles.Selectable | ControlStyles.StandardClick, false);
- UpdateStyles();
+ // Default fields
+ base.Padding = new Padding(1);
- // Add Palette Handler
- if (_palette != null)
+ // Create the palette provider
+ StateCommon = new PaletteInputControlTripleRedirect(Redirector, PaletteBackStyle.InputControlStandalone, PaletteBorderStyle.HeaderCalendar, PaletteContentStyle.LabelNormalPanel, null);
+ StateDisabled = new PaletteInputControlTripleStates(StateCommon, NeedPaintDelegate);
+ StateNormal = new PaletteInputControlTripleStates(StateCommon, NeedPaintDelegate);
+ StateActive = new PaletteInputControlTripleStates(StateCommon, NeedPaintDelegate);
+
+ // Create the internal list box used for containing content
+ _propertyGrid = new InternalPropertyGrid(this);
+ _propertyGrid.Click += OnPropertyGridClick; // SKC: make sure that the default click is also routed.
+ _propertyGrid.GotFocus += OnPropertyGridGotFocus;
+ _propertyGrid.LostFocus += OnPropertyGridLostFocus;
+
+ _layoutFill = new ViewLayoutFill(_propertyGrid)
{
- _palette.PalettePaint += OnPalettePaint;
- }
+ DisplayPadding = new Padding(1)
+ };
+
+ // Create inner view for placing inside the drawing docker
+ var drawDockerInner = new ViewLayoutDocker
+ {
+ { _layoutFill, ViewDockStyle.Fill }
+ };
- KryptonManager.GlobalPaletteChanged += OnGlobalPaletteChanged;
+ // Create view for the control border and background
+ _drawDockerOuter = new ViewDrawDocker(StateNormal.Back, StateNormal.Border)
+ {
+ { drawDockerInner, ViewDockStyle.Fill }
+ };
- _palette = KryptonManager.CurrentGlobalPalette;
+ // Create the view manager instance
+ ViewManager = new ViewManager(this, _drawDockerOuter);
- _paletteRedirect = new PaletteRedirect(_palette);
- // Create the palette provider
- _stateCommon = new PaletteInputControlTripleRedirect(_paletteRedirect, PaletteBackStyle.InputControlStandalone, PaletteBorderStyle.HeaderCalendar, PaletteContentStyle.LabelNormalPanel, null);
- _stateDisabled = new PaletteInputControlTripleStates(_stateCommon, null);
- _stateNormal = new PaletteInputControlTripleStates(_stateCommon, null);
- _stateActive = new PaletteInputControlTripleStates(_stateCommon, null);
+ // We need to create and cache a device context compatible with the display
+ _screenDC = PI.CreateCompatibleDC(IntPtr.Zero);
- InitColours();
+ // Add tree view to the controls collection
+ ((KryptonReadOnlyControls)Controls).AddInternal(_propertyGrid);
+ }
+ private void OnPropertyGridClick(object? sender, EventArgs e) => OnClick(e);
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ base.Dispose(disposing);
+ if (_screenDC != IntPtr.Zero)
+ {
+ PI.DeleteDC(_screenDC);
+ }
}
#endregion
#region Public
+ ///
+ /// Gets access to the contained TreeView instance.
+ ///
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ [EditorBrowsable(EditorBrowsableState.Always)]
+ [Browsable(false)]
+ public PropertyGrid PropertyGrid => _propertyGrid;
+
+ ///
+ /// Gets access to the contained input control.
+ ///
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ [EditorBrowsable(EditorBrowsableState.Always)]
+ [Browsable(false)]
+ public Control ContainedControl => _propertyGrid;
+
+ ///
+ /// Gets access to the common appearance entries that other states can override.
+ ///
+ [Category(@"Visuals")]
+ [Description(@"Overrides for defining common appearance that other states can override.")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ public PaletteInputControlTripleRedirect StateCommon { get; }
+ private bool ShouldSerializeStateCommon() => !StateCommon.IsDefault;
+
+ ///
+ /// Gets access to the disabled appearance entries.
+ ///
+ [Category(@"Visuals")]
+ [Description(@"Overrides for defining disabled appearance.")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ public PaletteInputControlTripleStates StateDisabled { get; }
+ private bool ShouldSerializeStateDisabled() => !StateDisabled.IsDefault;
+
+ ///
+ /// Gets access to the normal appearance entries.
+ ///
+ [Category(@"Visuals")]
+ [Description(@"Overrides for defining normal appearance.")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ public PaletteInputControlTripleStates StateNormal { get; }
+ private bool ShouldSerializeStateNormal() => !StateNormal.IsDefault;
+
+ ///
+ /// Gets access to the active appearance entries.
+ ///
+ [Category(@"Visuals")]
+ [Description(@"Overrides for defining active appearance.")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ public PaletteInputControlTripleStates StateActive { get; }
+ private bool ShouldSerializeStateActive() => !StateActive.IsDefault;
+
+
+ ///
+ /// Gets and sets Determines if the control is always active or only when the mouse is over the control or has focus.
+ ///
+ [Category(@"Visuals")]
+ [Description(
+ @"Determines if the control is always active or only when the mouse is over the control or has focus.")]
+ [DefaultValue(false)]
+ public bool AlwaysActive
+ {
+ get => _alwaysActive;
+ set
+ {
+ if (_alwaysActive != value)
+ {
+ _alwaysActive = value;
+ Invalidate();
+ }
+ }
+ }
+
+ ///
+ /// Sets the fixed state of the control.
+ ///
+ /// Should the control be fixed as active.
+ public void SetFixedState(bool active) => _fixedActive = active;
+
+ ///
+ /// Gets a value indicating if the input control is active.
+ ///
+ [Browsable(false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool IsActive => _fixedActive ?? DesignMode || AlwaysActive || ContainsFocus || _mouseOver;
+
+ ///
+ /// Sets input focus to the control.
+ ///
+ /// true if the input focus request was successful; otherwise, false.
+ public new bool Focus() => _propertyGrid.Focus();
+
+ ///
+ /// Activates the control.
+ ///
+ public new void Select() => _propertyGrid.Select();
+ #endregion
+
+ #region Expose Useful parts
+
+ ///
+ /// Returns true if the commands pane will be shown for objects
+ /// that expose verbs.
+ ///
+ [Category("Appearance")]
+ [DefaultValue(true)]
+ [Description("the commands pane will be shown for objects")]
+ public bool CommandsVisibleIfAvailable
+ {
+ get => _propertyGrid.CommandsVisibleIfAvailable;
+ set => _propertyGrid.CommandsVisibleIfAvailable = value;
+ }
+
+ ///
+ /// Sets or gets the visibility state of the help pane.
+ ///
+ [Category("Appearance")]
+ [DefaultValue(true)]
+ [Localizable(true)]
+ [Description("visibility state of the help pane")]
+ public virtual bool HelpVisible
+ {
+ get => _propertyGrid.HelpVisible;
+ set => _propertyGrid.HelpVisible = value;
+ }
- /// Refreshes the colours.
- public void RefreshColours() => InitColours();
+ ///
+ /// Gets or sets a value that indicates whether OS-specific visual style glyphs are used for the expansion
+ /// nodes in the grid area.
+ ///
+ [Category("Appearance")]
+ [Description("indicates whether OS-specific visual style glyphs are used for the expansion nodes in the grid area")]
+ [DefaultValue(true)]
+ public bool CanShowVisualStyleGlyphs
+ {
+ get => _propertyGrid.CanShowVisualStyleGlyphs;
+ set => _propertyGrid.CanShowVisualStyleGlyphs = value;
+ }
+ ///
+ /// Sets or gets the current property sort type, which can be
+ /// PropertySort.Categorized or PropertySort.Alphabetical.
+ ///
+ [Category("Appearance")]
+ [DefaultValue(PropertySort.CategorizedAlphabetical)]
+ [Description("current property sort type")]
+ public PropertySort PropertySort
+ {
+ get => _propertyGrid.PropertySort;
+ set => _propertyGrid.PropertySort = value;
+ }
+
+ internal class SelectedObjectConverter : ReferenceConverter
+ {
+ public SelectedObjectConverter()
+ : base(typeof(IComponent))
+ {
+ }
+ }
+
+ ///
+ /// Sets a single object into the grid to be browsed. If multiple objects are being browsed, this property
+ /// will return the first one in the list. If no objects are selected, null is returned.
+ ///
+ [Category("Behavior")]
+ [DefaultValue(null)]
+ [Description("")]
+ [TypeConverter(typeof(SelectedObjectConverter))]
+ public object? SelectedObject
+ {
+ get => _propertyGrid.SelectedObject;
+ set => _propertyGrid.SelectedObject = value;
+ }
+
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ [AllowNull]
+ public object[] SelectedObjects
+ {
+ get => _propertyGrid.SelectedObjects;
+ set => _propertyGrid.SelectedObjects = value;
+ }
+
+ /// Gets or sets the background color for the control.
+ /// A that represents the background color of the control. The default is the value of the property.
+ [Category("Appearance")]
+ [Description("ControlBackColorDescr")]
+ [Browsable(false)]
+ [EditorBrowsable(EditorBrowsableState.Advanced)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public override Color BackColor
+ {
+ get => base.BackColor;
+ set => base.BackColor = value;
+ }
+
+ /// Gets or sets the font of the text displayed by the control.
+ /// The to apply to the text displayed by the control. The default is the value of the property.
+ [Category("Appearance")]
+ [AmbientValue(null)]
+ [Description("ControlFontDescr")]
+ [Browsable(false)]
+ [EditorBrowsable(EditorBrowsableState.Advanced)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ [AllowNull]
+ public override Font Font
+ {
+ get => base.Font;
+ set => base.Font = value;
+ }
+
+ [Browsable(false)]
+ [EditorBrowsable(EditorBrowsableState.Advanced)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public PropertyTab SelectedTab => _propertyGrid.SelectedTab;
+
+ [Browsable(false)]
+ [EditorBrowsable(EditorBrowsableState.Advanced)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ [DisallowNull]
+ public GridItem? SelectedGridItem => _propertyGrid.SelectedGridItem;
+
+ [Category("Appearance")]
+ [Description("PropertyGridLargeButtonsDesc")]
+ [DefaultValue(false)]
+ public bool LargeButtons
+ {
+ get => _propertyGrid.LargeButtons;
+ set => _propertyGrid.LargeButtons = value;
+ }
+
+ ///
+ /// Sets or gets the visibility state of the toolStrip.
+ ///
+ [Category("Appearance")]
+ [DefaultValue(true)]
+ [Description("the visibility state of the toolStrip")]
+ public virtual bool ToolbarVisible
+ {
+ get => _propertyGrid.ToolbarVisible;
+ set => _propertyGrid.ToolbarVisible = value;
+ }
+
+ /// Collapses all the nodes in the PropertyGrid
+ public void CollapseAllGridItems() => _propertyGrid.CollapseAllGridItems();
+
+ /// Expands all the categories in the .
+ public void ExpandAllGridItems() => _propertyGrid.ExpandAllGridItems();
+
+ ///
+ /// Refreshes the tabs of the specified .
+ ///
+ ///
+ /// Either or .
+ ///
+ ///
+ ///
+ /// The method first deletes the property tabs of the specified
+ /// scope, it then requires the objects and documents to rebuild the tabs.
+ ///
+ ///
+ public void RefreshTabs(PropertyTabScope tabScope) => _propertyGrid.RefreshTabs(tabScope);
+
+ /// Resets the selected property to its default value.
+ public void ResetSelectedProperty() => _propertyGrid.ResetSelectedProperty();
#endregion
#region Krypton
- // Krypton Palette Events
- /// Called when [global palette changed].
- /// The sender.
- /// The instance containing the event data.
- private void OnGlobalPaletteChanged(object sender, EventArgs e)
+
+ /// Initialises the colours.
+ private void UpdateStateAndPalettes()
{
- if (_palette != null)
+ if (!IsDisposed)
{
- _palette.PalettePaint -= OnPalettePaint;
+ // Attempt to stop Flickering
+ //PI.SendMessage(_propertyGrid.Handle, PI.WM_.SETREDRAW, IntPtr.Zero, IntPtr.Zero);
+
+ var colorTable = KryptonManager.CurrentGlobalPalette.ColorTable;
+ _propertyGrid.LineColor = colorTable.ToolStripGradientMiddle;
+
+ _propertyGrid.CategoryForeColor = KryptonManager.CurrentGlobalPalette.ToString().Contains("DarkMode")
+ ? colorTable.MenuStripText
+ : colorTable.ToolStripDropDownBackground;
+
+ var gridState = GetTripleState();
+ _propertyGrid.ViewDrawPanel.SetPalettes(gridState.PaletteBack);
+ _drawDockerOuter.SetPalettes(gridState.PaletteBack, gridState.PaletteBorder!);
+ _drawDockerOuter.Enabled = Enabled;
+ // Find the new state of the main view element
+ PaletteState pState = Enabled
+ ? (IsActive ? PaletteState.Tracking : PaletteState.Normal)
+ : PaletteState.Disabled;
+ _propertyGrid.ViewDrawPanel.ElementState = pState;
+ _drawDockerOuter.ElementState = pState;
+
+ var normalFont = gridState.PaletteContent?.GetContentShortTextFont(PaletteState.ContextNormal);
+ var disabledFont = gridState.PaletteContent?.GetContentShortTextFont(PaletteState.Disabled);
+
+ _propertyGrid.Font = (Enabled ? normalFont : disabledFont)!;
+ _propertyGrid.BackColor =
+ gridState.PaletteBack.GetBackColor1(Enabled ? PaletteState.Normal : PaletteState.Disabled);
+
+ var controlsCollection = _propertyGrid.Controls;
+ foreach (Control control in controlsCollection)
+ {
+ PaletteState state;
+ IPaletteTriple triple;
+ if (control.Focused)
+ {
+ state = PaletteState.FocusOverride;
+ triple = StateActive;
+ control.Font = StateActive.PaletteContent?.GetContentShortTextFont(PaletteState.FocusOverride)!;
+ }
+ else if (control.Enabled)
+ {
+ state = PaletteState.ContextNormal;
+ triple = StateNormal;
+ // Note: tobitege commented out to avoid unrecoverable exception in System.Drawing, when toggling theme back and forth
+ control.Font = normalFont!;
+ }
+ else
+ {
+ state = PaletteState.Disabled;
+ triple = StateDisabled;
+ control.Font = disabledFont!;
+ }
+
+ control.ForeColor = triple.PaletteContent!.GetContentShortTextColor1(state);
+ control.BackColor = triple.PaletteBack.GetBackColor1(state);
+ }
+
+ // Original code caused several themes to have white-on-white text.
+ // This has been tested as working against all schemes and fixes all previously
+ // observed white-on-white/low-contrast colors!
+ // Needed to be moved below the loop!
+ _propertyGrid.HelpForeColor = ContrastColor(_propertyGrid.HelpBackColor);
+ _propertyGrid.ViewForeColor = ContrastColor(_propertyGrid.ViewBackColor);
+ //PI.SendMessage(_propertyGrid.Handle, PI.WM_.SETREDRAW, (IntPtr)PI.BOOL.TRUE, IntPtr.Zero);
+ Invalidate();
}
+ }
- _palette = KryptonManager.CurrentGlobalPalette;
- _paletteRedirect.Target = _palette;
+ private IPaletteTriple GetTripleState() => Enabled ? (IsActive ? StateActive : StateNormal) : StateDisabled;
- if (_palette != null)
- {
- _palette.PalettePaint += OnPalettePaint;
- //repaint with new values
- InitColours();
+ private static Color ContrastColor(Color color)
+ {
+ // Counting the perceptive luminance
+ var a = 1
+ - (((0.299 * color.R)
+ + ((0.587 * color.G) + (0.114 * color.B)))
+ / 255);
+ var d = a < 0.5 ? 0 : 255;
+
+ // dark colours - white font and vice versa
+ return Color.FromArgb(d, d, d);
+ }
+
+ #endregion
+
+ #region private
+ ///
+ /// Process Windows-based messages.
+ ///
+ /// A Windows-based message.
+ protected override void WndProc(ref Message m)
+ {
+ switch (m.Msg)
+ {
+ case PI.WM_.ERASEBKGND:
+ // Do not draw the background here, always do it in the paint
+ // instead to prevent flicker because of a two stage drawing process
+ break;
+ //case PI.WM_.PRINTCLIENT:
+ //case PI.WM_.PAINT:
+ // WmPaint(ref m);
+ // break;
+ case PI.WM_.VSCROLL:
+ case PI.WM_.HSCROLL:
+ case PI.WM_.MOUSEWHEEL:
+ Invalidate();
+ base.WndProc(ref m);
+ break;
+ //case PI.WM_.MOUSEMOVE:// TODO: On Mouse Enter ??
+ // if (!_mouseOver)
+ // {
+ // _mouseOver = true;
+ // Invalidate();
+ // }
+ // base.WndProc(ref m);
+ // break;
+ // We need to snoop the need to show a context menu
+ case PI.WM_.CONTEXTMENU:
+ // Only interested in overriding the behaviour when we have a krypton context menu...
+ if (KryptonContextMenu != null)
+ {
+ // Extract the screen mouse position (if might not actually be provided)
+ var mousePt = new Point(PI.LOWORD(m.LParam), PI.HIWORD(m.LParam));
+
+ // If keyboard activated, the menu position is centered
+ if (((int)(long)m.LParam) == -1)
+ {
+ mousePt = new Point(Width / 2, Height / 2);
+ }
+ else
+ {
+ mousePt = PointToClient(mousePt);
+
+ // Mouse point up and left 1 pixel so that the mouse overlaps the top left corner
+ // of the showing context menu just like it happens for a ContextMenuStrip.
+ mousePt.X -= 1;
+ mousePt.Y -= 1;
+ }
+
+ // If the mouse position is within our client area
+ if (ClientRectangle.Contains(mousePt))
+ {
+ // Show the context menu
+ KryptonContextMenu.Show(this, PointToScreen(mousePt));
+ }
+ }
+
+ break;
+ default:
+ base.WndProc(ref m);
+ break;
}
+ }
- Invalidate();
+ ///
+ /// Raises the TabStop event.
+ ///
+ /// An EventArgs that contains the event data.
+ protected override void OnTabStopChanged(EventArgs e)
+ {
+ _propertyGrid.TabStop = TabStop;
+ base.OnTabStopChanged(e);
}
- // Krypton Palette Events
- /// Called when [palette paint].
- /// The sender.
- /// The instance containing the event data.
- private void OnPalettePaint(object sender, PaletteLayoutEventArgs e) => Invalidate();
+ ///
+ /// Raises the CausesValidationChanged event.
+ ///
+ /// An EventArgs that contains the event data.
+ protected override void OnCausesValidationChanged(EventArgs e)
+ {
+ _propertyGrid.CausesValidation = CausesValidation;
+ base.OnCausesValidationChanged(e);
+ }
- /// Initialises the colours.
- private void InitColours()
+ ///
+ /// Raises the HandleCreated event.
+ ///
+ /// An EventArgs containing the event data.
+ protected override void OnHandleCreated(EventArgs e)
+ {
+ // Let base class do standard stuff
+ base.OnHandleCreated(e);
+
+ // Force the font to be set into the text box child control
+ PerformNeedPaint(false);
+
+ // We need a layout to occur before any painting
+ InvokeLayout();
+ }
+
+
+ ///
+ /// Raises the MouseDown event.
+ ///
+ /// A MouseEventArgs that contains the event data.
+ protected override void OnMouseDown(MouseEventArgs e)
{
- ToolStripRenderer = ToolStripManager.Renderer;
+ _mouseOver = false;
- HelpBackColor = _palette.ColorTable.MenuStripGradientBegin;
+ PerformNeedPaint(true);
- HelpForeColor = _palette.ColorTable.ToolStripText;
+ _propertyGrid.Invalidate();
- LineColor = _palette.ColorTable.ToolStripGradientMiddle;
+ base.OnMouseDown(e);
+ }
- CategoryForeColor = _palette.ColorTable.ToolStripDropDownBackground;
+ ///
+ /// Gets the default size of the control.
+ ///
+ protected override Size DefaultSize => new Size(120, 96);
- var normalFont = _stateNormal.PaletteContent.GetContentShortTextFont(PaletteState.ContextNormal);
- var disabledFont = _stateDisabled.PaletteContent.GetContentShortTextFont(PaletteState.Disabled);
+ /// >
+ protected override void CreateHandle()
+ {
+ base.CreateHandle();
- Font = Enabled ? normalFont : disabledFont;
- BackColor = _stateNormal.PaletteBack.GetBackColor1(Enabled? PaletteState.Normal : PaletteState.Disabled);
+ PI.SetWindowTheme(Handle, @"DarkMode_Explorer", null);
+ }
- ControlCollection controlsCollection = Controls;
- foreach (Control control in controlsCollection)
+ ///
+ /// Force the layout logic to size and position the controls.
+ ///
+ protected void ForceControlLayout()
+ {
+ if (!IsHandleCreated)
{
- IPaletteTriple triple;
- PaletteState state;
- if (control.Focused)
- {
- state = PaletteState.FocusOverride;
- triple = _stateActive;
- control.Font = _stateActive.PaletteContent.GetContentShortTextFont(PaletteState.FocusOverride);
- }
- else if (control.Enabled)
- {
- state = PaletteState.ContextNormal;
- triple = _stateNormal;
- control.Font = normalFont;
- }
- else
- {
- state = PaletteState.Disabled;
- triple = _stateDisabled;
- control.Font = disabledFont;
- }
+ _forcedLayout = true;
+ OnLayout(new LayoutEventArgs(null, null));
+ _forcedLayout = false;
+ }
+ }
+
+ ///
+ ///
+ /// Processes a notification from palette storage of a paint and optional layout required.
+ ///
+ /// Source of notification.
+ /// An NeedLayoutEventArgs containing event data.
+ protected override void OnNeedPaint(object? sender, NeedLayoutEventArgs e)
+ {
+ if (IsHandleCreated && !e.NeedLayout)
+ {
+ _propertyGrid.Invalidate();
+ }
+ else
+ {
+ ForceControlLayout();
+ }
+
+ // Update palette to reflect latest state
+ UpdateStateAndPalettes();
+ base.OnNeedPaint(sender, e);
+ }
- control.ForeColor = triple.PaletteContent.GetContentShortTextColor1(state);
- control.BackColor = triple.PaletteBack.GetBackColor1(state);
+ ///
+ /// Raises the Layout event.
+ ///
+ /// An EventArgs that contains the event data.
+ protected override void OnLayout(LayoutEventArgs levent)
+ {
+ base.OnLayout(levent);
+
+ // Only use layout logic if control is fully initialized or if being forced
+ // to allow a relayout or if in design mode.
+ if (IsHandleCreated || _forcedLayout || (DesignMode))
+ {
+ Rectangle fillRect = _layoutFill.FillRect;
+ _propertyGrid.SetBounds(fillRect.X, fillRect.Y, fillRect.Width, fillRect.Height);
+ }
+ }
+
+ ///
+ /// Raises the MouseEnter event.
+ ///
+ /// An EventArgs that contains the event data.
+ protected override void OnMouseEnter(EventArgs e)
+ {
+ _mouseOver = true;
+ PerformNeedPaint(true);
+ _propertyGrid.Invalidate();
+ base.OnMouseEnter(e);
+ }
+
+ ///
+ /// Raises the MouseLeave event.
+ ///
+ /// An EventArgs that contains the event data.
+ protected override void OnMouseLeave(EventArgs e)
+ {
+ _mouseOver = false;
+ PerformNeedPaint(true);
+ _propertyGrid.Invalidate();
+ base.OnMouseLeave(e);
+ }
+
+ ///
+ protected override void OnNotifyMessage(Message m)
+ {
+ if (m.Msg != 0x14)
+ {
+ base.OnNotifyMessage(m);
}
+ }
- Invalidate();
+ private void OnPropertyGridGotFocus(object? sender, EventArgs e)
+ {
+ UpdateStateAndPalettes();
+ _propertyGrid.Invalidate();
+ PerformNeedPaint(true);
+ OnGotFocus(e);
+ }
+ private void OnPropertyGridLostFocus(object? sender, EventArgs e)
+ {
+ UpdateStateAndPalettes();
+ _propertyGrid.Invalidate();
+ PerformNeedPaint(true);
+ OnLostFocus(e);
}
+ ///
+ protected override void OnEnabledChanged(EventArgs e)
+ {
+ UpdateStateAndPalettes();
+ PerformNeedPaint(true);
+ base.OnEnabledChanged(e);
+ }
+
+ ///
+ /// Creates a new instance of the control collection for the KryptonTreeView.
+ ///
+ /// A new instance of Control.ControlCollection assigned to the control.
+ [EditorBrowsable(EditorBrowsableState.Advanced)]
+ protected override ControlCollection CreateControlsInstance() => new KryptonReadOnlyControls(this);
+
#endregion
}
}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonRadioButton.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonRadioButton.cs
index 8216cbd78..33d466ba0 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonRadioButton.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonRadioButton.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -636,14 +636,14 @@ protected override bool EvalTransparentPaint() =>
#endregion
#region Implementation
- private void OnRadioButtonTextChanged(object sender, EventArgs e) => OnTextChanged(EventArgs.Empty);
+ private void OnRadioButtonTextChanged(object? sender, EventArgs e) => OnTextChanged(EventArgs.Empty);
private void AutoUpdateOthers()
{
// Only uncheck others if we are checked and in auto check
if (AutoCheck && Checked)
{
- Control parent = Parent;
+ Control? parent = Parent;
if (parent != null)
{
// Search all sibling controls
@@ -666,7 +666,7 @@ private void AutoUpdateOthers()
}
}
- private void OnControllerClick(object sender, EventArgs e) => OnClick(e);
+ private void OnControllerClick(object? sender, EventArgs e) => OnClick(e);
private void UpdateForOrientation()
{
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonRichTextBox.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonRichTextBox.cs
index 5a0413d19..168b0578f 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonRichTextBox.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonRichTextBox.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -303,7 +303,7 @@ public RichTextBoxButtonSpecCollection(KryptonRichTextBox owner)
#region Instance Fields
private VisualPopupToolTip? _visualPopupToolTip;
- private readonly ButtonSpecManagerLayout _buttonManager;
+ private readonly ButtonSpecManagerLayout? _buttonManager;
private readonly ViewLayoutDocker _drawDockerInner;
private readonly ViewDrawDocker _drawDockerOuter;
private readonly ViewLayoutFill _layoutFill;
@@ -316,8 +316,6 @@ public RichTextBoxButtonSpecCollection(KryptonRichTextBox owner)
private bool _alwaysActive;
private bool _trackingMouseEnter;
private bool _firstPaint;
- private float _cornerRoundingRadius;
-
#endregion
#region Events
@@ -510,10 +508,10 @@ public KryptonRichTextBox()
// Create button specification collection manager
_buttonManager = new ButtonSpecManagerLayout(this, Redirector, ButtonSpecs, null,
- new[] { _drawDockerInner },
- new IPaletteMetric[] { StateCommon },
- new[] { PaletteMetricInt.HeaderButtonEdgeInsetInputControl },
- new[] { PaletteMetricPadding.HeaderButtonPaddingInputControl },
+ [_drawDockerInner],
+ [StateCommon],
+ [PaletteMetricInt.HeaderButtonEdgeInsetInputControl],
+ [PaletteMetricPadding.HeaderButtonPaddingInputControl],
CreateToolStripRenderer,
NeedPaintDelegate);
@@ -529,15 +527,13 @@ public KryptonRichTextBox()
// Update the back/fore/font from the palette settings
UpdateStateAndPalettes();
_richTextBox.BackColor = StateActive.PaletteBack.GetBackColor1(PaletteState.Tracking);
- _richTextBox.ForeColor = StateActive.PaletteContent.GetContentShortTextColor1(PaletteState.Tracking);
+ _richTextBox.ForeColor = StateActive.PaletteContent!.GetContentShortTextColor1(PaletteState.Tracking);
// Only set the font if the rich text box has been created
if (_richTextBox.Handle != IntPtr.Zero)
{
- _richTextBox.Font = StateActive.PaletteContent.GetContentShortTextFont(PaletteState.Tracking);
+ _richTextBox.Font = StateActive.PaletteContent.GetContentShortTextFont(PaletteState.Tracking)!;
}
-
- _cornerRoundingRadius = GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
}
///
@@ -552,7 +548,7 @@ protected override void Dispose(bool disposing)
OnCancelToolTip(this, EventArgs.Empty);
// Remember to pull down the manager instance
- _buttonManager.Destruct();
+ _buttonManager?.Destruct();
}
base.Dispose(disposing);
@@ -560,16 +556,6 @@ protected override void Dispose(bool disposing)
#endregion
#region Public
-
- /// Gets or sets the corner rounding radius.
- /// The corner rounding radius.
- [Category(@"Visuals"), DefaultValue(GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE), Description(@"Defines the corner roundness on the current window (-1 is the default look).")]
- public float CornerRoundingRadius
- {
- get => _cornerRoundingRadius;
- set => SetCornerRoundingRadius(value);
- }
-
[Category(@"Visuals")]
[Description(@"Set a watermark/prompt message for the user.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
@@ -600,7 +586,7 @@ public float CornerRoundingRadius
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[EditorBrowsable(EditorBrowsableState.Always)]
[Browsable(false)]
- public RichTextBox? RichTextBox => _richTextBox;
+ public RichTextBox RichTextBox => _richTextBox;
///
/// Gets access to the contained input control.
@@ -661,7 +647,7 @@ public override Color BackColor
public override Font Font
{
get => base.Font;
- set => base.Font = value;
+ set => base.Font = value!;
}
///
@@ -762,14 +748,14 @@ public RichTextBoxLanguageOptions LanguageOption
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public string RedoActionName => _richTextBox.RedoActionName;
+ public string? RedoActionName => _richTextBox.RedoActionName;
///
/// Gets and sets the name of the action to be undone.
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public string UndoActionName => _richTextBox.UndoActionName;
+ public string? UndoActionName => _richTextBox.UndoActionName;
///
/// Gets and sets if keyboard shortcuts are enabled.
@@ -791,7 +777,7 @@ public bool RichTextShortcutsEnabled
[RefreshProperties(RefreshProperties.All)]
public string Rtf
{
- get => _richTextBox.Rtf;
+ get => _richTextBox.Rtf is null ? string.Empty : _richTextBox.Rtf;
set
{
@@ -921,7 +907,9 @@ public Color SelectionColor
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public Font SelectionFont
{
- get => _richTextBox.SelectionFont;
+ // Tested that: the System.WWindows.Forms.RichTextBox returns RichtTextBox.Font when no text has been selected.
+ // Null forgiving operator removes the warning.
+ get => _richTextBox.SelectionFont!;
set
{
@@ -1057,11 +1045,11 @@ public int[] SelectionTabs
[DefaultValue(true)]
public bool UseMnemonic
{
- get => _buttonManager.UseMnemonic;
+ get => _buttonManager!.UseMnemonic;
set
{
- if (_buttonManager.UseMnemonic != value)
+ if (_buttonManager!.UseMnemonic != value)
{
_buttonManager.UseMnemonic = value;
PerformNeedPaint(true);
@@ -1385,32 +1373,32 @@ public InputControlStyle InputControlStyle
/// Appends text to the current text of a rich text box.
///
/// The text to append to the current contents of the text box.
- public void AppendText(string text) => _richTextBox.AppendText(text);
+ public void AppendText(string text) => _richTextBox?.AppendText(text);
///
/// Clears all text from the text box control.
///
- public void Clear() => _richTextBox.Clear();
+ public void Clear() => _richTextBox?.Clear();
///
/// Clears information about the most recent operation from the undo buffer of the rich text box.
///
- public void ClearUndo() => _richTextBox.ClearUndo();
+ public void ClearUndo() => _richTextBox?.ClearUndo();
///
/// Copies the current selection in the text box to the Clipboard.
///
- public void Copy() => _richTextBox.Copy();
+ public void Copy() => _richTextBox?.Copy();
///
/// Moves the current selection in the text box to the Clipboard.
///
- public void Cut() => _richTextBox.Cut();
+ public void Cut() => _richTextBox?.Cut();
///
/// Specifies that the value of the SelectionLength property is zero so that no characters are selected in the control.
///
- public void DeselectAll() => _richTextBox.DeselectAll();
+ public void DeselectAll() => _richTextBox?.DeselectAll();
///
/// Determines whether you can paste information from the Clipboard in the specified data format.
@@ -1541,60 +1529,60 @@ public InputControlStyle InputControlStyle
///
/// Replaces the current selection in the text box with the contents of the Clipboard.
///
- public void Paste() => _richTextBox.Paste();
+ public void Paste() => _richTextBox?.Paste();
///
/// Undoes the last edit operation in the text box.
///
- public void Undo() => _richTextBox.Undo();
+ public void Undo() => _richTextBox?.Undo();
///
/// Pastes the contents of the Clipboard in the specified Clipboard format.
///
/// The Clipboard format in which the data should be obtained from the Clipboard.
- public void Paste(DataFormats.Format clipFormat) => _richTextBox.Paste(clipFormat);
+ public void Paste(DataFormats.Format clipFormat) => _richTextBox?.Paste(clipFormat);
///
/// Reapplies the last operation that was undone in the control.
///
- public void Redo() => _richTextBox.Redo();
+ public void Redo() => _richTextBox?.Redo();
///
/// Saves the contents of the RichTextBox to a rich text format (RTF) file.
///
/// The name and location of the file to save.
- public void SaveFile(string path) => _richTextBox.SaveFile(path);
+ public void SaveFile(string path) => _richTextBox?.SaveFile(path);
///
/// Saves the contents of a RichTextBox control to an open data stream.
///
/// The data stream that contains the file to save to.
/// One of the RichTextBoxStreamType values.
- public void SaveFile(Stream data, RichTextBoxStreamType fileType) => _richTextBox.SaveFile(data, fileType);
+ public void SaveFile(Stream data, RichTextBoxStreamType fileType) => _richTextBox?.SaveFile(data, fileType);
///
/// Saves the contents of the KryptonRichTextBox to a specific type of file.
///
/// The name and location of the file to save.
/// One of the RichTextBoxStreamType values.
- public void SaveFile(string path, RichTextBoxStreamType fileType) => _richTextBox.SaveFile(path, fileType);
+ public void SaveFile(string path, RichTextBoxStreamType fileType) => _richTextBox?.SaveFile(path, fileType);
///
/// Scrolls the contents of the control to the current caret position.
///
- public void ScrollToCaret() => _richTextBox.ScrollToCaret();
+ public void ScrollToCaret() => _richTextBox?.ScrollToCaret();
///
/// Selects a range of text in the control.
///
/// The position of the first character in the current text selection within the text box.
/// The number of characters to select.
- public void Select(int start, int length) => _richTextBox.Select(start, length);
+ public void Select(int start, int length) => _richTextBox?.Select(start, length);
///
/// Selects all text in the control.
///
- public void SelectAll() => _richTextBox.SelectAll();
+ public void SelectAll() => _richTextBox?.SelectAll();
///
/// Sets the fixed state of the control.
@@ -1727,9 +1715,9 @@ public bool DesignerGetHitTest(Point pt)
/// Mouse location.
[EditorBrowsable(EditorBrowsableState.Never)]
[Browsable(false)]
- public Component DesignerComponentFromPoint(Point pt) =>
+ public Component? DesignerComponentFromPoint(Point pt) =>
// Ignore call as view builder is already destructed
- IsDisposed ? null : ViewManager.ComponentFromPoint(pt);
+ IsDisposed ? null : ViewManager?.ComponentFromPoint(pt);
// Ask the current view for a decision
///
@@ -1868,7 +1856,7 @@ protected override void OnEnabledChanged(EventArgs e)
_drawDockerOuter.Enabled = Enabled;
// Update state to reflect change in enabled state
- _buttonManager.RefreshButtons();
+ _buttonManager?.RefreshButtons();
PerformNeedPaint(true);
@@ -1942,11 +1930,11 @@ protected override void OnLayout(LayoutEventArgs levent)
if (!IsDisposed && !Disposing)
{
// Update with latest content padding for placing around the contained text box control
- Padding contentPadding = GetTripleState().PaletteContent.GetContentPadding(_drawDockerOuter.State);
+ Padding contentPadding = GetTripleState().PaletteContent!.GetContentPadding(_drawDockerOuter.State);
_layoutFill.DisplayPadding = contentPadding;
}
- // Let base class calulcate fill rectangle
+ // Let base class calculate fill rectangle
base.OnLayout(levent);
if (!IsDisposed && !Disposing)
@@ -1956,7 +1944,7 @@ protected override void OnLayout(LayoutEventArgs levent)
if (_forcedLayout || (DesignMode && (_richTextBox != null)))
{
Rectangle fillRect = _layoutFill.FillRect;
- _richTextBox.SetBounds(fillRect.X, fillRect.Y, fillRect.Width, fillRect.Height);
+ _richTextBox?.SetBounds(fillRect.X, fillRect.Y, fillRect.Width, fillRect.Height);
}
}
}
@@ -1969,7 +1957,7 @@ protected override void OnMouseEnter(EventArgs e)
{
_mouseOver = true;
PerformNeedPaint(true);
- _richTextBox.Invalidate();
+ _richTextBox?.Invalidate();
base.OnMouseEnter(e);
}
@@ -1981,7 +1969,7 @@ protected override void OnMouseLeave(EventArgs e)
{
_mouseOver = false;
PerformNeedPaint(true);
- _richTextBox.Invalidate();
+ _richTextBox?.Invalidate();
base.OnMouseLeave(e);
}
@@ -1992,7 +1980,7 @@ protected override void OnMouseLeave(EventArgs e)
protected override void OnGotFocus(EventArgs e)
{
base.OnGotFocus(e);
- _richTextBox.Focus();
+ _richTextBox?.Focus();
}
///
@@ -2009,7 +1997,7 @@ protected override void OnNeedPaint(object? sender, NeedLayoutEventArgs e)
{
if (!e.NeedLayout)
{
- _richTextBox.Invalidate();
+ _richTextBox?.Invalidate();
}
else
{
@@ -2024,22 +2012,22 @@ protected override void OnNeedPaint(object? sender, NeedLayoutEventArgs e)
PaletteState state = _drawDockerOuter.State;
Color backColor = triple.PaletteBack.GetBackColor1(state);
- if (_richTextBox.BackColor != backColor)
+ if (_richTextBox!.BackColor != backColor)
{
_richTextBox.BackColor = backColor;
}
- Color foreColor = triple.PaletteContent.GetContentShortTextColor1(state);
+ Color foreColor = triple.PaletteContent!.GetContentShortTextColor1(state);
if (_richTextBox.ForeColor != foreColor)
{
_richTextBox.ForeColor = foreColor;
}
// Only set the font if the rich text box has been created
- Font font = triple.PaletteContent.GetContentShortTextFont(state);
+ Font? font = triple.PaletteContent.GetContentShortTextFont(state);
if ((_richTextBox.Handle != IntPtr.Zero) && !_richTextBox.Font.Equals(font))
{
- _richTextBox.Font = font;
+ _richTextBox.Font = font!;
}
}
@@ -2050,7 +2038,7 @@ protected override void OnNeedPaint(object? sender, NeedLayoutEventArgs e)
/// Raises the Paint event.
///
/// A PaintEventArgs containing the event data.
- protected override void OnPaint(PaintEventArgs e)
+ protected override void OnPaint(PaintEventArgs? e)
{
if (_firstPaint)
{
@@ -2109,20 +2097,20 @@ private void UpdateStateAndPalettes()
{
// Get the correct palette settings to use
IPaletteTriple tripleState = GetTripleState();
- _drawDockerOuter.SetPalettes(tripleState.PaletteBack, tripleState.PaletteBorder);
+ _drawDockerOuter.SetPalettes(tripleState.PaletteBack, tripleState.PaletteBorder!);
// Update enabled state
_drawDockerOuter.Enabled = Enabled;
// Find the new state of the main view element
- PaletteState state = IsActive ? PaletteState.Tracking : PaletteState.Normal;
+ PaletteState state = Enabled ? (IsActive ? PaletteState.Tracking : PaletteState.Normal) : PaletteState.Disabled;
_drawDockerOuter.ElementState = state;
}
private IPaletteTriple GetTripleState() => Enabled ? (IsActive ? StateActive : StateNormal) : StateDisabled;
- private void OnRichTextBoxMouseChange(object sender, EventArgs e)
+ private void OnRichTextBoxMouseChange(object? sender, EventArgs e)
{
// Change in tracking state?
if (_richTextBox.MouseOver != _trackingMouseEnter)
@@ -2143,66 +2131,66 @@ private void OnRichTextBoxMouseChange(object sender, EventArgs e)
}
}
- private void OnRichTextBoxAcceptsTabChanged(object sender, EventArgs e) => OnAcceptsTabChanged(e);
+ private void OnRichTextBoxAcceptsTabChanged(object? sender, EventArgs e) => OnAcceptsTabChanged(e);
- private void OnRichTextBoxTextChanged(object sender, EventArgs e)
+ private void OnRichTextBoxTextChanged(object? sender, EventArgs e)
{
if (!string.IsNullOrWhiteSpace(CueHint.CueHintText)
&& TextLength <= 1)
{
// Needed to prevent character turds being left behind
// Oh, and to get rid of the initial cuetext drawing ;-)
- _richTextBox.Invalidate();
+ _richTextBox?.Invalidate();
}
OnTextChanged(e);
}
- private void OnRichTextBoxHideSelectionChanged(object sender, EventArgs e) => OnHideSelectionChanged(e);
+ private void OnRichTextBoxHideSelectionChanged(object? sender, EventArgs e) => OnHideSelectionChanged(e);
- private void OnRichTextBoxModifiedChanged(object sender, EventArgs e) => OnModifiedChanged(e);
+ private void OnRichTextBoxModifiedChanged(object? sender, EventArgs e) => OnModifiedChanged(e);
- private void OnRichTextBoxMultilineChanged(object sender, EventArgs e) => OnMultilineChanged(e);
+ private void OnRichTextBoxMultilineChanged(object? sender, EventArgs e) => OnMultilineChanged(e);
- private void OnRichTextBoxReadOnlyChanged(object sender, EventArgs e) => OnReadOnlyChanged(e);
+ private void OnRichTextBoxReadOnlyChanged(object? sender, EventArgs e) => OnReadOnlyChanged(e);
- private void OnRichTextBoxGotFocus(object sender, EventArgs e)
+ private void OnRichTextBoxGotFocus(object? sender, EventArgs e)
{
UpdateStateAndPalettes();
PerformNeedPaint(true);
OnGotFocus(e);
}
- private void OnRichTextBoxLostFocus(object sender, EventArgs e)
+ private void OnRichTextBoxLostFocus(object? sender, EventArgs e)
{
UpdateStateAndPalettes();
PerformNeedPaint(true);
OnLostFocus(e);
}
- private void OnRichTextBoxKeyPress(object sender, KeyPressEventArgs e) => OnKeyPress(e);
+ private void OnRichTextBoxKeyPress(object? sender, KeyPressEventArgs e) => OnKeyPress(e);
- private void OnRichTextBoxKeyUp(object sender, KeyEventArgs e) => OnKeyUp(e);
+ private void OnRichTextBoxKeyUp(object? sender, KeyEventArgs e) => OnKeyUp(e);
- private void OnRichTextBoxKeyDown(object sender, KeyEventArgs e) => OnKeyDown(e);
+ private void OnRichTextBoxKeyDown(object? sender, KeyEventArgs e) => OnKeyDown(e);
- private void OnRichTextBoxPreviewKeyDown(object sender, PreviewKeyDownEventArgs e) => OnPreviewKeyDown(e);
+ private void OnRichTextBoxPreviewKeyDown(object? sender, PreviewKeyDownEventArgs e) => OnPreviewKeyDown(e);
- private void OnRichTextBoxVScroll(object sender, EventArgs e) => OnVScroll(e);
+ private void OnRichTextBoxVScroll(object? sender, EventArgs e) => OnVScroll(e);
- private void OnRichTextBoxHScroll(object sender, EventArgs e) => OnHScroll(e);
+ private void OnRichTextBoxHScroll(object? sender, EventArgs e) => OnHScroll(e);
- private void OnRichTextBoxSelectionChanged(object sender, EventArgs e) => OnSelectionChanged(e);
+ private void OnRichTextBoxSelectionChanged(object? sender, EventArgs e) => OnSelectionChanged(e);
- private void OnRichTextBoxProtected(object sender, EventArgs e) => OnProtected(e);
+ private void OnRichTextBoxProtected(object? sender, EventArgs e) => OnProtected(e);
- private void OnRichTextBoxLinkClicked(object sender, LinkClickedEventArgs e) => OnLinkClicked(e);
+ private void OnRichTextBoxLinkClicked(object? sender, LinkClickedEventArgs e) => OnLinkClicked(e);
- private void OnRichTextBoxValidated(object sender, EventArgs e) => OnValidated(e);
+ private void OnRichTextBoxValidated(object? sender, EventArgs e) => OnValidated(e);
- private void OnRichTextBoxValidating(object sender, CancelEventArgs e) => OnValidating(e);
+ private void OnRichTextBoxValidating(object? sender, CancelEventArgs e) => OnValidating(e);
- private void OnShowToolTip(object sender, ToolTipEventArgs e)
+ private void OnShowToolTip(object? sender, ToolTipEventArgs e)
{
if (!IsDisposed && !Disposing)
{
@@ -2222,7 +2210,7 @@ private void OnShowToolTip(object sender, ToolTipEventArgs e)
var shadow = true;
// Find the button spec associated with the tooltip request
- ButtonSpec? buttonSpec = _buttonManager.ButtonSpecFromView(e.Target);
+ ButtonSpec? buttonSpec = _buttonManager?.ButtonSpecFromView(e.Target);
// If the tooltip is for a button spec
if (buttonSpec != null)
@@ -2269,27 +2257,19 @@ private void OnShowToolTip(object sender, ToolTipEventArgs e)
}
}
- private void OnCancelToolTip(object sender, EventArgs e) =>
+ private void OnCancelToolTip(object? sender, EventArgs e) =>
// Remove any currently showing tooltip
_visualPopupToolTip?.Dispose();
- private void OnVisualPopupToolTipDisposed(object sender, EventArgs e)
+ private void OnVisualPopupToolTipDisposed(object? sender, EventArgs e)
{
// Unhook events from the specific instance that generated event
- var popupToolTip = (VisualPopupToolTip)sender;
+ var popupToolTip = sender as VisualPopupToolTip ?? throw new ArgumentNullException(nameof(sender));
popupToolTip.Disposed -= OnVisualPopupToolTipDisposed;
// Not showing a popup page any more
_visualPopupToolTip = null;
}
-
- private void SetCornerRoundingRadius(float? radius)
- {
- _cornerRoundingRadius = radius ?? GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
- StateCommon.Border.Rounding = _cornerRoundingRadius;
- }
-
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonSaveFileDialog.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonSaveFileDialog.cs
index 4cb49b1a2..7ec398618 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonSaveFileDialog.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonSaveFileDialog.cs
@@ -2,7 +2,7 @@
/*
*
* 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. 2023 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2024. All rights reserved.
*
*/
#endregion
@@ -25,7 +25,7 @@ public class KryptonSaveFileDialog : FileSaveDialogWrapper, IDisposable
///
protected override DialogResult ShowActualDialog(IWin32Window? owner) => _internalSaveFileDialog.ShowDialog(owner);
-#if NET7_0 || NET8_0
+#if NET7_0 || NET8_0_OR_GREATER
///
/// Gets or sets a value indicating whether the dialog box verifies if the creation of the specified file will be successful.
/// If this flag is not set, the calling application must handle errors, such as denial of access, discovered when the item is created.
@@ -104,7 +104,7 @@ public override bool CheckPathExists
set => _internalSaveFileDialog.CheckPathExists = value;
}
-#if NET60_OR_GREATER
+#if NET6_0_OR_GREATER
///
public override Guid? ClientGuid
{
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonScrollBar.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonScrollBar.cs
index fb915c90c..66b16e29f 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonScrollBar.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonScrollBar.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -56,7 +56,7 @@ public class KryptonScrollBar : Control
private ScrollBarArrowButtonState _topButtonState = ScrollBarArrowButtonState.UpNormal;
private ScrollBarArrowButtonState _bottomButtonState = ScrollBarArrowButtonState.DownNormal;
private int _minimum;
- private int _maximum = 100;
+ private int _maximum;
private int _smallChange = 1;
private int _largeChange = 10;
private int _value;
@@ -78,6 +78,14 @@ public class KryptonScrollBar : Control
private Color _borderColor = Color.FromArgb(93, 140, 201);
private Color _disabledBorderColor = Color.Gray;
+ private PaletteBase? _palette;
+
+ private readonly PaletteRedirect? _paletteRedirect;
+ private readonly PaletteInputControlTripleRedirect _stateCommon;
+ private readonly PaletteInputControlTripleStates _stateNormal;
+ private readonly PaletteInputControlTripleStates _stateDisabled;
+ private readonly PaletteInputControlTripleStates _stateActive;
+
#region Context Menu Items
private ContextMenuStrip _contextMenu;
@@ -97,6 +105,24 @@ public class KryptonScrollBar : Control
#endregion
+ #region Public
+
+ /// Gets or sets the width of the scroll bar.
+ /// The width of the scroll bar.
+ public int ScrollBarWidth
+ {
+ get => Width;
+ set => Width = value;
+ }
+
+ ///
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ [AllowNull]
+ public override string Text { get; set; }
+
+ #endregion
+
#region Identity
///
@@ -119,13 +145,30 @@ public KryptonScrollBar()
// sets the scrollbar up
SetUpScrollBar();
+ if (_palette != null)
+ {
+ _palette.PalettePaint += OnPalettePaint;
+ }
+
+ KryptonManager.GlobalPaletteChanged += OnGlobalPaletteChanged;
+
+ _palette = KryptonManager.CurrentGlobalPalette;
+
+ _paletteRedirect = new PaletteRedirect(_palette);
+
+ // Create the palette provider
+ _stateCommon = new PaletteInputControlTripleRedirect(_paletteRedirect, PaletteBackStyle.InputControlStandalone, PaletteBorderStyle.HeaderCalendar, PaletteContentStyle.LabelNormalPanel, null);
+ _stateDisabled = new PaletteInputControlTripleStates(_stateCommon, null);
+ _stateNormal = new PaletteInputControlTripleStates(_stateCommon, null);
+ _stateActive = new PaletteInputControlTripleStates(_stateCommon, null);
+
// timer for clicking and holding the mouse button
// over/below the thumb and on the arrow buttons
_progressTimer.Interval = 20;
_progressTimer.Tick += ProgressTimerTick;
// no image margin in context menu
- _contextMenu.ShowImageMargin = false;
+ _contextMenu!.ShowImageMargin = false;
ContextMenuStrip = _contextMenu;
_maximum = 100;
@@ -461,7 +504,7 @@ public void EndUpdate()
/// The that contains the event data.
protected virtual void OnScroll(ScrollEventArgs e) =>
// if event handler is attached - raise scroll event
- Scroll.Invoke(this, e);
+ Scroll?.Invoke(this, e);
///
/// Paints the background of the control.
@@ -479,7 +522,7 @@ protected override void OnPaintBackground(PaintEventArgs e)
protected override void OnPaint(PaintEventArgs e)
{
// sets the smoothing mode to none
- e.Graphics.SmoothingMode = SmoothingMode.None;
+ using var gh = new GraphicsHint(e.Graphics, PaletteGraphicsHint.None);
// save client rectangle
Rectangle rect = ClientRectangle;
@@ -500,23 +543,23 @@ protected override void OnPaint(PaintEventArgs e)
rect.Height -= 2;
}
- ScrollBarKryptonRenderer.InitColours();
+ KryptonScrollBarRenderer.InitColors();
// draws the background
- ScrollBarKryptonRenderer.DrawBackground(
+ KryptonScrollBarRenderer.DrawBackground(
e.Graphics,
ClientRectangle,
_orientation);
// draws the track
- ScrollBarKryptonRenderer.DrawTrack(
+ KryptonScrollBarRenderer.DrawTrack(
e.Graphics,
rect,
ScrollBarState.Normal,
_orientation);
// draw thumb and grip
- ScrollBarKryptonRenderer.DrawThumb(
+ KryptonScrollBarRenderer.DrawThumb(
e.Graphics,
_thumbRectangle,
_thumbState,
@@ -524,21 +567,21 @@ protected override void OnPaint(PaintEventArgs e)
if (Enabled)
{
- ScrollBarKryptonRenderer.DrawThumbGrip(
+ KryptonScrollBarRenderer.DrawThumbGrip(
e.Graphics,
_thumbRectangle,
_orientation);
}
// draw arrows
- ScrollBarKryptonRenderer.DrawArrowButton(
+ KryptonScrollBarRenderer.DrawArrowButton(
e.Graphics,
_topArrowRectangle,
_topButtonState,
true,
_orientation);
- ScrollBarKryptonRenderer.DrawArrowButton(
+ KryptonScrollBarRenderer.DrawArrowButton(
e.Graphics,
_bottomArrowRectangle,
_bottomButtonState,
@@ -561,7 +604,7 @@ protected override void OnPaint(PaintEventArgs e)
_thumbRectangle.X - _thumbTopLimit;
}
- ScrollBarKryptonRenderer.DrawTrack(
+ KryptonScrollBarRenderer.DrawTrack(
e.Graphics,
_clickedBarRectangle,
ScrollBarState.Pressed,
@@ -582,7 +625,7 @@ protected override void OnPaint(PaintEventArgs e)
_thumbBottomLimitBottom - _clickedBarRectangle.X + 1;
}
- ScrollBarKryptonRenderer.DrawTrack(
+ KryptonScrollBarRenderer.DrawTrack(
e.Graphics,
_clickedBarRectangle,
ScrollBarState.Pressed,
@@ -590,7 +633,7 @@ protected override void OnPaint(PaintEventArgs e)
}
// draw border
- using var pen = new Pen(Enabled ? ScrollBarKryptonRenderer.borderColours[0] : _disabledBorderColor);
+ using var pen = new Pen(Enabled ? KryptonScrollBarRenderer.BorderColors[0] : _disabledBorderColor);
e.Graphics.DrawRectangle(pen, 0, 0, Width - 1, Height - 1);
}
@@ -860,7 +903,7 @@ protected override void OnMouseMove(MouseEventArgs e)
}
}
- ///
+ /*///
/// Performs the work of setting the specified bounds of this control.
///
/// The new x value of the control.
@@ -899,7 +942,7 @@ protected override void SetBoundsCore(int x, int y, int width, int height, Bound
{
SetUpScrollBar();
}
- }
+ }*/
///
/// Raises the event.
@@ -1125,7 +1168,7 @@ private void SetUpScrollBar()
///
/// The sender.
/// An object that contains the event data.
- private void ProgressTimerTick(object sender, EventArgs e) => ProgressThumb(true);
+ private void ProgressTimerTick(object? sender, EventArgs e) => ProgressThumb(true);
///
/// Resets the scroll status of the scrollbar.
@@ -1384,24 +1427,48 @@ private void ChangeContextMenuItems()
{
_tsmiTop.Text = nameof(Top);
_tsmiBottom.Text = nameof(Bottom);
- _tsmiLargeDown.Text = KryptonLanguageManager.ScrollBarStrings.PageDown;
- _tsmiLargeUp.Text = KryptonLanguageManager.ScrollBarStrings.PageUp;
- _tsmiSmallDown.Text = KryptonLanguageManager.ScrollBarStrings.ScrollDown;
- _tsmiSmallUp.Text = KryptonLanguageManager.ScrollBarStrings.ScrollUp;
- _tsmiScrollHere.Text = KryptonLanguageManager.ScrollBarStrings.ScrollHere;
+ _tsmiLargeDown.Text = KryptonManager.Strings.ScrollBarStrings.PageDown;
+ _tsmiLargeUp.Text = KryptonManager.Strings.ScrollBarStrings.PageUp;
+ _tsmiSmallDown.Text = KryptonManager.Strings.ScrollBarStrings.ScrollDown;
+ _tsmiSmallUp.Text = KryptonManager.Strings.ScrollBarStrings.ScrollUp;
+ _tsmiScrollHere.Text = KryptonManager.Strings.ScrollBarStrings.ScrollHere;
}
else
{
_tsmiTop.Text = nameof(Left);
_tsmiBottom.Text = nameof(Right);
- _tsmiLargeDown.Text = KryptonLanguageManager.ScrollBarStrings.PageLeft;
- _tsmiLargeUp.Text = KryptonLanguageManager.ScrollBarStrings.PageRight;
- _tsmiSmallDown.Text = KryptonLanguageManager.ScrollBarStrings.ScrollRight;
- _tsmiSmallUp.Text = KryptonLanguageManager.ScrollBarStrings.ScrollLeft;
- _tsmiScrollHere.Text = KryptonLanguageManager.ScrollBarStrings.ScrollHere;
+ _tsmiLargeDown.Text = KryptonManager.Strings.ScrollBarStrings.PageLeft;
+ _tsmiLargeUp.Text = KryptonManager.Strings.ScrollBarStrings.PageRight;
+ _tsmiSmallDown.Text = KryptonManager.Strings.ScrollBarStrings.ScrollRight;
+ _tsmiSmallUp.Text = KryptonManager.Strings.ScrollBarStrings.ScrollLeft;
+ _tsmiScrollHere.Text = KryptonManager.Strings.ScrollBarStrings.ScrollHere;
+ }
+ }
+
+ private void OnGlobalPaletteChanged(object? sender, EventArgs e)
+ {
+ if (_palette != null)
+ {
+ _palette.PalettePaint -= OnPalettePaint;
+ }
+
+ _palette = KryptonManager.CurrentGlobalPalette;
+
+ _paletteRedirect!.Target = _palette;
+
+ if (_palette != null)
+ {
+ _palette.PalettePaint += OnPalettePaint;
+
+ // Repaint
+ KryptonScrollBarRenderer.InitColors();
}
+
+ Invalidate();
}
+ private void OnPalettePaint(object? sender, PaletteLayoutEventArgs e) => Invalidate();
+
#endregion
#region Context Menu Methods
@@ -1447,7 +1514,7 @@ private void InitializeComponent()
_tsmiScrollHere.DisplayStyle = ToolStripItemDisplayStyle.Text;
_tsmiScrollHere.Name = nameof(_tsmiScrollHere);
_tsmiScrollHere.Size = new Size(150, 22);
- _tsmiScrollHere.Text = KryptonLanguageManager.ScrollBarStrings.ScrollHere;
+ _tsmiScrollHere.Text = KryptonManager.Strings.ScrollBarStrings.ScrollHere;
_tsmiScrollHere.Click += ScrollHereClick;
//
// toolStripSeparator1
@@ -1481,7 +1548,7 @@ private void InitializeComponent()
_tsmiLargeUp.DisplayStyle = ToolStripItemDisplayStyle.Text;
_tsmiLargeUp.Name = nameof(_tsmiLargeUp);
_tsmiLargeUp.Size = new Size(150, 22);
- _tsmiLargeUp.Text = KryptonLanguageManager.ScrollBarStrings.PageUp;
+ _tsmiLargeUp.Text = KryptonManager.Strings.ScrollBarStrings.PageUp;
_tsmiLargeUp.Click += LargeUpClick;
//
// tsmiLargeDown
@@ -1489,7 +1556,7 @@ private void InitializeComponent()
_tsmiLargeDown.DisplayStyle = ToolStripItemDisplayStyle.Text;
_tsmiLargeDown.Name = nameof(_tsmiLargeDown);
_tsmiLargeDown.Size = new Size(150, 22);
- _tsmiLargeDown.Text = KryptonLanguageManager.ScrollBarStrings.PageDown;
+ _tsmiLargeDown.Text = KryptonManager.Strings.ScrollBarStrings.PageDown;
_tsmiLargeDown.Click += LargeDownClick;
//
// toolStripSeparator3
@@ -1502,7 +1569,7 @@ private void InitializeComponent()
_tsmiSmallUp.DisplayStyle = ToolStripItemDisplayStyle.Text;
_tsmiSmallUp.Name = nameof(_tsmiSmallUp);
_tsmiSmallUp.Size = new Size(150, 22);
- _tsmiSmallUp.Text = KryptonLanguageManager.ScrollBarStrings.ScrollUp;
+ _tsmiSmallUp.Text = KryptonManager.Strings.ScrollBarStrings.ScrollUp;
_tsmiSmallUp.Click += SmallUpClick;
//
// tsmiSmallDown
@@ -1510,7 +1577,7 @@ private void InitializeComponent()
_tsmiSmallDown.DisplayStyle = ToolStripItemDisplayStyle.Text;
_tsmiSmallDown.Name = nameof(_tsmiSmallDown);
_tsmiSmallDown.Size = new Size(150, 22);
- _tsmiSmallDown.Text = KryptonLanguageManager.ScrollBarStrings.ScrollDown;
+ _tsmiSmallDown.Text = KryptonManager.Strings.ScrollBarStrings.ScrollDown;
_tsmiSmallDown.Click += SmallDownClick;
_contextMenu.ResumeLayout(false);
ResumeLayout(false);
@@ -1521,7 +1588,7 @@ private void InitializeComponent()
///
/// The sender.
/// The event arguments.
- private void ScrollHereClick(object sender, EventArgs e)
+ private void ScrollHereClick(object? sender, EventArgs e)
{
int thumbSize, thumbPos, arrowSize, size;
@@ -1568,42 +1635,42 @@ private void ScrollHereClick(object sender, EventArgs e)
///
/// The sender.
/// The event arguments.
- private void TopClick(object sender, EventArgs e) => Value = _minimum;
+ private void TopClick(object? sender, EventArgs e) => Value = _minimum;
///
/// Context menu handler.
///
/// The sender.
/// The event arguments.
- private void BottomClick(object sender, EventArgs e) => Value = _maximum;
+ private void BottomClick(object? sender, EventArgs e) => Value = _maximum;
///
/// Context menu handler.
///
/// The sender.
/// The event arguments.
- private void LargeUpClick(object sender, EventArgs e) => Value = GetValue(false, true);
+ private void LargeUpClick(object? sender, EventArgs e) => Value = GetValue(false, true);
///
/// Context menu handler.
///
/// The sender.
/// The event arguments.
- private void LargeDownClick(object sender, EventArgs e) => Value = GetValue(false, false);
+ private void LargeDownClick(object? sender, EventArgs e) => Value = GetValue(false, false);
///
/// Context menu handler.
///
/// The sender.
/// The event arguments.
- private void SmallUpClick(object sender, EventArgs e) => Value = GetValue(true, true);
+ private void SmallUpClick(object? sender, EventArgs e) => Value = GetValue(true, true);
///
/// Context menu handler.
///
/// The sender.
/// The event arguments.
- private void SmallDownClick(object sender, EventArgs e) => Value = GetValue(true, false);
+ private void SmallDownClick(object? sender, EventArgs e) => Value = GetValue(true, false);
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonSeparator.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonSeparator.cs
index 8039c9c7f..96cc271e6 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonSeparator.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonSeparator.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -132,8 +132,8 @@ public KryptonSeparator()
StatePressed = new PaletteSeparatorPadding(StateCommon.Separator, StateCommon.Separator, NeedPaintDelegate);
// Our view contains just a simple canvas that covers entire client area and a separator view
- _drawSeparator = new ViewDrawSeparator(StateDisabled.Separator, StateNormal.Separator, StateTracking, StatePressed,
- StateDisabled.Separator, StateNormal.Separator, StateTracking, StatePressed,
+ _drawSeparator = new ViewDrawSeparator(StateDisabled.Separator!, StateNormal.Separator!, StateTracking, StatePressed,
+ StateDisabled.Separator!, StateNormal.Separator!, StateTracking, StatePressed,
PaletteMetricPadding.SeparatorPaddingLowProfile, Orientation.Vertical);
// Get the separator to fill the entire client area
@@ -228,7 +228,7 @@ public override Color BackColor
public override Font Font
{
get => base.Font;
- set => base.Font = value;
+ set => base.Font = value!;
}
///
@@ -279,7 +279,7 @@ public SeparatorStyle SeparatorStyle
if (_style != value)
{
_style = value;
- StateCommon.Separator.SetStyles(_style);
+ StateCommon?.Separator.SetStyles(_style);
_drawSeparator.MetricPadding = CommonHelper.SeparatorStyleToMetricPadding(_style);
PerformNeedPaint(true);
}
@@ -296,7 +296,7 @@ public SeparatorStyle SeparatorStyle
[Category(@"Visuals")]
[Description(@"Overrides for defining common separator appearance that other states can override.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public PaletteSplitContainerRedirect? StateCommon { get; }
+ public PaletteSplitContainerRedirect StateCommon { get; }
private bool ShouldSerializeStateCommon() => !StateCommon.IsDefault;
@@ -328,7 +328,7 @@ public SeparatorStyle SeparatorStyle
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public PaletteSeparatorPadding? StateTracking { get; }
- private bool ShouldSerializeStateTracking() => !StateTracking.IsDefault;
+ private bool ShouldSerializeStateTracking() => !StateTracking!.IsDefault;
///
/// Gets access to the pressed separator appearance entries.
@@ -338,7 +338,7 @@ public SeparatorStyle SeparatorStyle
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public PaletteSeparatorPadding? StatePressed { get; }
- private bool ShouldSerializeStatePressed() => !StatePressed.IsDefault;
+ private bool ShouldSerializeStatePressed() => !StatePressed!.IsDefault;
///
/// Gets and sets the thickness of the splitter.
@@ -713,7 +713,7 @@ private void UpdateSize()
}
}
- private void OnRedrawTick(object sender, EventArgs e)
+ private void OnRedrawTick(object? sender, EventArgs e)
{
_redrawTimer?.Stop();
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonSplitContainer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonSplitContainer.cs
index 23b01b9dd..733d3d043 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonSplitContainer.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonSplitContainer.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -119,8 +119,8 @@ public KryptonSplitContainer()
StatePressed = new PaletteSeparatorPadding(StateCommon.Separator, StateCommon.Separator, NeedPaintDelegate);
// Our view contains just a simple canvas that covers entire client area and a separator view
- _drawSeparator = new ViewDrawSeparator(StateDisabled.Separator, StateNormal.Separator, StateTracking, StatePressed,
- StateDisabled.Separator, StateNormal.Separator, StateTracking, StatePressed,
+ _drawSeparator = new ViewDrawSeparator(StateDisabled.Separator!, StateNormal.Separator!, StateTracking, StatePressed,
+ StateDisabled.Separator!, StateNormal.Separator!, StateTracking, StatePressed,
PaletteMetricPadding.SeparatorPaddingLowProfile, Orientation.Vertical);
_drawPanel = new ViewDrawPanel(StateNormal.Back)
@@ -248,7 +248,7 @@ public SeparatorStyle SeparatorStyle
[Category(@"Visuals")]
[Description(@"Overrides for defining common split container appearance that other states can override.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public PaletteSplitContainerRedirect? StateCommon { get; }
+ public PaletteSplitContainerRedirect StateCommon { get; }
private bool ShouldSerializeStateCommon() => !StateCommon.IsDefault;
@@ -280,7 +280,7 @@ public SeparatorStyle SeparatorStyle
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public PaletteSeparatorPadding? StateTracking { get; }
- private bool ShouldSerializeStateTracking() => !StateTracking.IsDefault;
+ private bool ShouldSerializeStateTracking() => !StateTracking!.IsDefault;
///
/// Gets access to the pressed separator appearance entries.
@@ -290,7 +290,7 @@ public SeparatorStyle SeparatorStyle
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public PaletteSeparatorPadding? StatePressed { get; }
- private bool ShouldSerializeStatePressed() => !StatePressed.IsDefault;
+ private bool ShouldSerializeStatePressed() => !StatePressed!.IsDefault;
///
/// Gets access to the first krypton splitter panel.
@@ -1137,7 +1137,7 @@ protected override void OnResize(EventArgs e)
/// Raises the Paint event.
///
/// A PaintEventArgs that contains the event data.
- protected override void OnPaint(PaintEventArgs e)
+ protected override void OnPaint(PaintEventArgs? e)
{
// Do we have a manager to use for painting?
if (ViewManager != null)
@@ -1404,7 +1404,7 @@ protected override void OnLayout(LayoutEventArgs levent)
#region Implementation
private bool Collapsed => Panel1.Collapsed || Panel2.Collapsed;
- private void SetStyles(SeparatorStyle separatorStyle) => StateCommon.Separator.SetStyles(separatorStyle);
+ private void SetStyles(SeparatorStyle separatorStyle) => StateCommon?.Separator.SetStyles(separatorStyle);
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonSplitterPanel.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonSplitterPanel.cs
index f7a6ac001..125571c27 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonSplitterPanel.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonSplitterPanel.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -80,9 +80,9 @@ public sealed class KryptonSplitterPanel : KryptonPanel
/// Reference to owning container.
public KryptonSplitterPanel([DisallowNull] KryptonSplitContainer container)
{
- Debug.Assert(container != null);
+ Debug.Assert(container is not null);
- Owner = container;
+ Owner = container ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(container)));
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonStatusStrip.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonStatusStrip.cs
index a2f308119..f0bd8bc12 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonStatusStrip.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonStatusStrip.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonStringCollectionEditor.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonStringCollectionEditor.cs
index b76b9c72a..380bda288 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonStringCollectionEditor.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonStringCollectionEditor.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -30,7 +30,7 @@ public static string[] Show(string[] inputStrings, bool useRichTextBox = true,
string windowText = @"String Collection Editor")
=> InternalShow(null, inputStrings, useRichTextBox, headerText, windowText);
- public static string[] Show(IWin32Window owner, string[] inputStrings, bool useRichTextBox = true,
+ public static string[] Show(IWin32Window? owner, string[] inputStrings, bool useRichTextBox = true,
string? headerText = @"Enter the strings in the collection (one per line):",
string windowText = @"String Collection Editor")
=> InternalShow(owner, inputStrings, useRichTextBox, headerText, windowText);
@@ -40,7 +40,7 @@ public static string[] Show(bool useRichTextBox = true,
string windowText = @"String Collection Editor")
=> InternalShow(null, null, useRichTextBox, headerText, windowText);
- public static string[] Show(IWin32Window owner, bool useRichTextBox = true,
+ public static string[] Show(IWin32Window? owner, bool useRichTextBox = true,
string? headerText = @"Enter the strings in the collection (one per line):",
string windowText = @"String Collection Editor")
=> InternalShow(owner, null, useRichTextBox, headerText, windowText);
@@ -76,8 +76,8 @@ public static StringCollection ShowDialog(IWin32Window owner, bool useRichTextBo
/// The header text.
/// The window title.
/// A collection of string items.
- private static string[] InternalShow(IWin32Window owner, string[] input, bool? useRichTextBox, string? headerText, string windowTitle)
- => KryptonMultilineStringEditorForm.InternalShow(owner, input, useRichTextBox, headerText, windowTitle);
+ private static string[] InternalShow(IWin32Window? owner, string[]? input, bool? useRichTextBox, string? headerText, string windowTitle)
+ => VisualMultilineStringEditorForm.InternalShow(owner, input!, useRichTextBox, headerText, windowTitle)!;
/// Shows the string collection editor.
/// The owner.
@@ -86,8 +86,8 @@ private static string[] InternalShow(IWin32Window owner, string[] input, bool? u
/// The header text.
/// The window title.
/// A collection of string items.
- private static StringCollection InternalShowStringCollection(IWin32Window owner, StringCollection input, bool useRichTextBox, string? headerText, string windowTitle)
- => KryptonMultilineStringEditorForm.InternalShowStringCollection(owner, input, useRichTextBox, headerText, windowTitle);
+ private static StringCollection InternalShowStringCollection(IWin32Window? owner, StringCollection? input, bool useRichTextBox, string? headerText, string windowTitle)
+ => VisualMultilineStringEditorForm.InternalShowStringCollection(owner, input!, useRichTextBox, headerText, windowTitle)!;
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTableLayoutPanel.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTableLayoutPanel.cs
index 8fbbd8a5a..ff91fdcf4 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTableLayoutPanel.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTableLayoutPanel.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -46,7 +46,7 @@ public KryptonTableLayoutPanel()
base.BackgroundImageLayout = ImageLayout.None;
}
- private void State_PropertyChanged(object sender, PropertyChangedEventArgs e) =>
+ private void State_PropertyChanged(object? sender, PropertyChangedEventArgs e) =>
// Handle explicit settings to the controls
BackGroundPanel_Refreshed();
@@ -84,7 +84,7 @@ public override Color BackColor
public override Font Font
{
get => base.Font;
- set => base.Font = value;
+ set => base.Font = value!;
}
///
@@ -166,10 +166,10 @@ public PaletteMode PaletteMode
[Category(@"Visuals")]
[Description(@"Custom palette applied to drawing.")]
[DefaultValue(null)]
- public PaletteBase? Palette
+ public PaletteBase Palette
{
[DebuggerStepThrough]
- get => _backGroundPanel.Palette;
+ get => _backGroundPanel.Palette!;
set
{
_backGroundPanel.Palette = value;
@@ -341,7 +341,7 @@ protected override void WndProc(ref Message m)
{
// Do the move thing first
base.WndProc(ref m);
- PI.WINDOWPOS structure = (PI.WINDOWPOS)Marshal.PtrToStructure(m.LParam, typeof(PI.WINDOWPOS));
+ PI.WINDOWPOS structure = (PI.WINDOWPOS)Marshal.PtrToStructure(m.LParam, typeof(PI.WINDOWPOS))!;
if (!structure.flags.HasFlag(PI.SWP_.NOZORDER))
{
if (_backGroundPanel.Parent != null
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTaskDialog.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTaskDialog.cs
index 2e1276ed8..a901246ac 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTaskDialog.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTaskDialog.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -23,13 +23,13 @@ namespace Krypton.Toolkit
public class KryptonTaskDialog : Component, INotifyPropertyChanged
{
#region Instance Fields
- private VisualTaskDialog? _taskDialog;
+ private VisualTaskDialogForm? _taskDialog;
private string _windowTitle;
private string _mainInstruction;
private string _content;
private Image? _customIcon;
private KryptonMessageBoxIcon _icon;
- private KryptonTaskDialogCommand _defaultRadioButton;
+ private KryptonTaskDialogCommand? _defaultRadioButton;
private TaskDialogButtons _commonButtons;
private TaskDialogButtons _defaultButton;
private KryptonMessageBoxIcon _footerIcon;
@@ -39,6 +39,7 @@ public class KryptonTaskDialog : Component, INotifyPropertyChanged
private string _checkboxText;
private bool _checkboxState;
private bool _allowDialogClose;
+ private bool _useNativeOSIcons;
private string _textExtra;
#endregion
@@ -65,8 +66,8 @@ public class KryptonTaskDialog : Component, INotifyPropertyChanged
///
public KryptonTaskDialog()
{
- RadioButtons = new KryptonTaskDialogCommandCollection();
- CommandButtons = new KryptonTaskDialogCommandCollection();
+ RadioButtons = [];
+ CommandButtons = [];
_commonButtons = TaskDialogButtons.OK;
_textExtra = @"Ctrl+C to copy";
}
@@ -245,7 +246,7 @@ public TaskDialogButtons CommonButtons
[Category(@"Appearance")]
[Description(@"Default radio button.")]
[DefaultValue(TaskDialogButtons.None)]
- public KryptonTaskDialogCommand DefaultRadioButton
+ public KryptonTaskDialogCommand? DefaultRadioButton
{
get => _defaultRadioButton;
@@ -427,6 +428,26 @@ public bool AllowDialogClose
}
}
+ /// Gets or sets a value indicating whether [use native os icons].
+ /// true if [use native os icons]; otherwise, false .
+ [Category(@"Appearance")]
+ [Description(@"Use the native OS icons.")]
+ [DefaultValue(true)]
+ public bool UseNativeOSIcons
+ {
+ get => _useNativeOSIcons;
+
+ set
+ {
+ if (_useNativeOSIcons != value)
+ {
+ _useNativeOSIcons = value;
+
+ OnPropertyChanged(new PropertyChangedEventArgs(nameof(UseNativeOSIcons)));
+ }
+ }
+ }
+
///
/// Gets and sets user-defined data associated with the object.
///
@@ -434,7 +455,7 @@ public bool AllowDialogClose
[Description(@"User-defined data associated with the object.")]
[TypeConverter(typeof(StringConverter))]
[Bindable(true)]
- public object Tag { get; set; }
+ public object? Tag { get; set; }
///
/// Allows user to override the default "Ctrl+c to copy" in window caption
@@ -465,7 +486,7 @@ public string TextExtra
/// Shows the task dialog as a modal dialog box with the currently active window set as its owner.
///
/// One of the DialogResult values.
- public DialogResult ShowDialog() => ShowDialog(Control.FromHandle(PI.GetActiveWindow()));
+ public DialogResult ShowDialog() => ShowDialog(Control.FromHandle(PI.GetActiveWindow())!);
///
/// Shows the form as a modal dialog box with the specified owner.
@@ -478,7 +499,7 @@ public DialogResult ShowDialog(IWin32Window owner)
_taskDialog?.Dispose();
// Create visual form to show our defined task properties
- _taskDialog = new VisualTaskDialog(this)
+ _taskDialog = new VisualTaskDialogForm(this)
{
StartPosition = owner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent
};
@@ -496,12 +517,14 @@ public DialogResult ShowDialog(IWin32Window owner)
/// Extra text.
/// Predefined icon.
/// Common buttons.
+ /// Use the OS set of icons.
/// One of the DialogResult values.
public static DialogResult Show(string windowTitle,
string mainInstruction,
string content,
KryptonMessageBoxIcon icon,
- TaskDialogButtons commonButtons)
+ TaskDialogButtons commonButtons,
+ bool? useNativeOSIcons)
{
// Create a temporary task dialog for storing definition whilst showing
using var taskDialog = new KryptonTaskDialog();
@@ -511,6 +534,7 @@ public static DialogResult Show(string windowTitle,
taskDialog.Content = content;
taskDialog.Icon = icon;
taskDialog.CommonButtons = commonButtons;
+ taskDialog.UseNativeOSIcons = useNativeOSIcons ?? true;
// Show as a modal dialog
return taskDialog.ShowDialog();
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTaskDialogCommand.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTaskDialogCommand.cs
index 7df52c8fa..b36a76023 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTaskDialogCommand.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTaskDialogCommand.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -59,7 +59,7 @@ public KryptonTaskDialogCommand()
_text = string.Empty;
_extraText = string.Empty;
_image = null;
- _imageTransparentColor = Color.Empty;
+ _imageTransparentColor = GlobalStaticValues.EMPTY_COLOR;
_dialogResult = DialogResult.OK;
}
@@ -204,7 +204,7 @@ public Image? Image
[Localizable(true)]
[Category(@"Appearance")]
[Description(@"Command image transparent color.")]
- [KryptonDefaultColor()]
+ [KryptonDefaultColor]
public Color ImageTransparentColor
{
get => _imageTransparentColor;
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTextBox.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTextBox.cs
index 0a3443b91..b8609a8f0 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTextBox.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTextBox.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -188,8 +188,7 @@ protected override void WndProc(ref Message m)
// it from the device context. Resulting in blurred text.
g.TextRenderingHint =
CommonHelper.PaletteTextHintToRenderingHint(
- _kryptonTextBox.StateDisabled.PaletteContent!.GetContentShortTextHint(
- PaletteState.Disabled));
+ _kryptonTextBox.StateDisabled.PaletteContent.GetContentShortTextHint(PaletteState.Disabled));
// Define the string formatting requirements
var stringFormat = new StringFormat
@@ -238,7 +237,7 @@ protected override void WndProc(ref Message m)
using var foreBrush = new SolidBrush(ForeColor);
g.DrawString(drawString,
_kryptonTextBox.GetTripleState().PaletteContent?
- .GetContentShortTextFont(PaletteState.Disabled), foreBrush,
+ .GetContentShortTextFont(PaletteState.Disabled)!, foreBrush,
new RectangleF(rect.left, rect.top, rect.right - rect.left,
rect.bottom - rect.top),
stringFormat);
@@ -338,8 +337,6 @@ public TextBoxButtonSpecCollection(KryptonTextBox owner)
private bool _showEllipsisButton;
//private bool _isInAlphaNumericMode;
private readonly ButtonSpecAny _editorButton;
- private float _cornerRoundingRadius;
-
#endregion
#region Events
@@ -439,7 +436,7 @@ public KryptonTextBox()
// Contains another control and needs marking as such for validation to work
SetStyle(ControlStyles.ContainerControl, true);
- // By default we are not multiline and so the height is fixed
+ // By default, we are not multiline and so the height is fixed
SetStyle(ControlStyles.FixedHeight, true);
// Cannot select this control, only the child TextBox, and does not generate a click event
@@ -457,7 +454,7 @@ public KryptonTextBox()
ButtonSpecs = new TextBoxButtonSpecCollection(this);
// Create the palette storage
- StateCommon = new PaletteInputControlTripleRedirect(Redirector!, PaletteBackStyle.InputControlStandalone, PaletteBorderStyle.InputControlStandalone, PaletteContentStyle.InputControlStandalone, NeedPaintDelegate);
+ StateCommon = new PaletteInputControlTripleRedirect(Redirector, PaletteBackStyle.InputControlStandalone, PaletteBorderStyle.InputControlStandalone, PaletteContentStyle.InputControlStandalone, NeedPaintDelegate);
StateDisabled = new PaletteInputControlTripleStates(StateCommon, NeedPaintDelegate);
StateNormal = new PaletteInputControlTripleStates(StateCommon, NeedPaintDelegate);
StateActive = new PaletteInputControlTripleStates(StateCommon, NeedPaintDelegate);
@@ -506,10 +503,10 @@ public KryptonTextBox()
// Create button specification collection manager
_buttonManager = new ButtonSpecManagerLayout(this, Redirector, ButtonSpecs, null,
- new[] { _drawDockerInner },
- new IPaletteMetric[] { StateCommon },
- new[] { PaletteMetricInt.HeaderButtonEdgeInsetInputControl },
- new[] { PaletteMetricPadding.HeaderButtonPaddingInputControl },
+ [_drawDockerInner],
+ [StateCommon],
+ [PaletteMetricInt.HeaderButtonEdgeInsetInputControl],
+ [PaletteMetricPadding.HeaderButtonPaddingInputControl],
CreateToolStripRenderer,
NeedPaintDelegate);
@@ -531,8 +528,6 @@ public KryptonTextBox()
// Add text box to the controls collection
((KryptonReadOnlyControls)Controls).AddInternal(_textBox);
- _cornerRoundingRadius = GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
//_isInAlphaNumericMode = false;
_showEllipsisButton = false;
@@ -567,15 +562,6 @@ protected override void Dispose(bool disposing)
public bool IsInAlphaNumericMode { get => _isInAlphaNumericMode; set { _isInAlphaNumericMode = value; SetIsInAlphaNumericMode(this); } }
*/
- /// Gets or sets the corner rounding radius.
- /// The corner rounding radius.
- [Category(@"Visuals"), DefaultValue(GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE), Description(@"Defines the corner roundness on the current window (-1 is the default look).")]
- public float CornerRoundingRadius
- {
- get => _cornerRoundingRadius;
- set => SetCornerRoundingRadius(value);
- }
-
///
/// Gets access to the common textbox appearance entries that other states can override.
///
@@ -715,7 +701,7 @@ public override Color BackColor
public override Font Font
{
get => base.Font;
- set => base.Font = value;
+ set => base.Font = value!;
}
///
@@ -829,11 +815,11 @@ public int SelectionStart
[DefaultValue(true)]
public bool UseMnemonic
{
- get => _buttonManager.UseMnemonic;
+ get => _buttonManager!.UseMnemonic;
set
{
- if (_buttonManager.UseMnemonic != value)
+ if (_buttonManager!.UseMnemonic != value)
{
_buttonManager.UseMnemonic = value;
PerformNeedPaint(true);
@@ -1029,7 +1015,7 @@ public bool ShortcutsEnabled
}
///
- /// Gets or sets a the character to display for password input for single-line edit controls.
+ /// Gets or sets the character to display for password input for single-line edit controls.
///
[Category(@"Behavior")]
[Description(@"Indicates the character to display for password input for single-line edit controls.")]
@@ -1301,13 +1287,13 @@ public AutoCompleteSource AutoCompleteSource
///
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
- public bool IsActive => _fixedActive ?? DesignMode || AlwaysActive || ContainsFocus || _mouseOver || _textBox.MouseOver;
+ public bool IsActive => (_fixedActive ?? DesignMode || AlwaysActive || ContainsFocus || _mouseOver || _textBox.MouseOver);
///
/// Sets input focus to the control.
///
/// true if the input focus request was successful; otherwise, false.
- public new bool Focus() => TextBox.Focus() == true;
+ public new bool Focus() => TextBox.Focus();
///
/// Activates the control.
@@ -1399,7 +1385,7 @@ public bool DesignerGetHitTest(Point pt)
[Browsable(false)]
public Component? DesignerComponentFromPoint(Point pt) =>
// Ignore call as view builder is already destructed
- IsDisposed ? null : ViewManager.ComponentFromPoint(pt);
+ IsDisposed ? null : ViewManager?.ComponentFromPoint(pt);
// Ask the current view for a decision
///
@@ -1731,13 +1717,13 @@ protected override void OnNeedPaint(object? sender, NeedLayoutEventArgs e)
IPaletteTriple triple = GetTripleState();
PaletteState state = _drawDockerOuter.State;
_textBox.BackColor = triple.PaletteBack.GetBackColor1(state);
- _textBox.ForeColor = triple.PaletteContent.GetContentShortTextColor1(state);
+ _textBox.ForeColor = triple.PaletteContent!.GetContentShortTextColor1(state);
// Only set the font if the text box has been created
- Font font = triple.PaletteContent.GetContentShortTextFont(state);
+ Font? font = triple.PaletteContent.GetContentShortTextFont(state);
if ((_textBox.Handle != IntPtr.Zero) && !_textBox.Font.Equals(font))
{
- _textBox.Font = font;
+ _textBox.Font = font!;
}
}
@@ -1760,7 +1746,7 @@ protected override void OnPaddingChanged(EventArgs e)
/// Raises the Paint event.
///
/// A PaintEventArgs containing the event data.
- protected override void OnPaint(PaintEventArgs e) => base.OnPaint(e);
+ protected override void OnPaint(PaintEventArgs? e) => base.OnPaint(e);
///
/// Raises the TabStop event.
@@ -1823,13 +1809,13 @@ private void UpdateStateAndPalettes()
{
// Get the correct palette settings to use
IPaletteTriple tripleState = GetTripleState();
- _drawDockerOuter.SetPalettes(tripleState.PaletteBack, tripleState.PaletteBorder);
+ _drawDockerOuter.SetPalettes(tripleState.PaletteBack, tripleState.PaletteBorder!);
// Update enabled state
_drawDockerOuter.Enabled = Enabled;
// Find the new state of the main view element
- PaletteState state = IsActive ? PaletteState.Tracking : PaletteState.Normal;
+ PaletteState state = Enabled ? (IsActive ? PaletteState.Tracking : PaletteState.Normal) : PaletteState.Disabled;
_drawDockerOuter.ElementState = state;
}
@@ -1858,47 +1844,47 @@ private void AdjustHeight(bool ignoreAnchored)
}
}
- private void OnTextBoxAcceptsTabChanged(object sender, EventArgs e) => OnAcceptsTabChanged(e);
+ private void OnTextBoxAcceptsTabChanged(object? sender, EventArgs e) => OnAcceptsTabChanged(e);
- private void OnTextBoxTextChanged(object sender, EventArgs e) => OnTextChanged(e);
+ private void OnTextBoxTextChanged(object? sender, EventArgs e) => OnTextChanged(e);
- private void OnTextBoxTextAlignChanged(object sender, EventArgs e) => OnTextAlignChanged(e);
+ private void OnTextBoxTextAlignChanged(object? sender, EventArgs e) => OnTextAlignChanged(e);
- private void OnTextBoxHideSelectionChanged(object sender, EventArgs e) => OnHideSelectionChanged(e);
+ private void OnTextBoxHideSelectionChanged(object? sender, EventArgs e) => OnHideSelectionChanged(e);
- private void OnTextBoxModifiedChanged(object sender, EventArgs e) => OnModifiedChanged(e);
+ private void OnTextBoxModifiedChanged(object? sender, EventArgs e) => OnModifiedChanged(e);
- private void OnTextBoxMultilineChanged(object sender, EventArgs e) => OnMultilineChanged(e);
+ private void OnTextBoxMultilineChanged(object? sender, EventArgs e) => OnMultilineChanged(e);
- private void OnTextBoxReadOnlyChanged(object sender, EventArgs e) => OnReadOnlyChanged(e);
+ private void OnTextBoxReadOnlyChanged(object? sender, EventArgs e) => OnReadOnlyChanged(e);
- private void OnTextBoxGotFocus(object sender, EventArgs e)
+ private void OnTextBoxGotFocus(object? sender, EventArgs e)
{
UpdateStateAndPalettes();
PerformNeedPaint(true);
OnGotFocus(e);
}
- private void OnTextBoxLostFocus(object sender, EventArgs e)
+ private void OnTextBoxLostFocus(object? sender, EventArgs e)
{
UpdateStateAndPalettes();
PerformNeedPaint(true);
OnLostFocus(e);
}
- private void OnTextBoxKeyPress(object sender, KeyPressEventArgs e) => OnKeyPress(e);
+ private void OnTextBoxKeyPress(object? sender, KeyPressEventArgs e) => OnKeyPress(e);
- private void OnTextBoxKeyUp(object sender, KeyEventArgs e) => OnKeyUp(e);
+ private void OnTextBoxKeyUp(object? sender, KeyEventArgs e) => OnKeyUp(e);
- private void OnTextBoxKeyDown(object sender, KeyEventArgs e) => OnKeyDown(e);
+ private void OnTextBoxKeyDown(object? sender, KeyEventArgs e) => OnKeyDown(e);
- private void OnTextBoxPreviewKeyDown(object sender, PreviewKeyDownEventArgs e) => OnPreviewKeyDown(e);
+ private void OnTextBoxPreviewKeyDown(object? sender, PreviewKeyDownEventArgs e) => OnPreviewKeyDown(e);
- private void OnTextBoxValidated(object sender, EventArgs e) => OnValidated(e);
+ private void OnTextBoxValidated(object? sender, EventArgs e) => OnValidated(e);
- private void OnTextBoxValidating(object sender, CancelEventArgs e) => OnValidating(e);
+ private void OnTextBoxValidating(object? sender, CancelEventArgs e) => OnValidating(e);
- private void OnShowToolTip(object sender, ToolTipEventArgs e)
+ private void OnShowToolTip(object? sender, ToolTipEventArgs e)
{
if (!IsDisposed && !Disposing)
{
@@ -1951,12 +1937,12 @@ private void OnShowToolTip(object sender, ToolTipEventArgs e)
if (AllowButtonSpecToolTipPriority)
{
- visualBasePopupToolTip.Dispose();
+ visualBasePopupToolTip?.Dispose();
}
}
// Create the actual tooltip popup object
- _visualPopupToolTip = new VisualPopupToolTip(Redirector,
+ _visualPopupToolTip = new VisualPopupToolTip(Redirector!,
sourceContent,
Renderer,
PaletteBackStyle.ControlToolTip,
@@ -1972,19 +1958,19 @@ private void OnShowToolTip(object sender, ToolTipEventArgs e)
}
// Remove any currently showing tooltip
- private void OnCancelToolTip(object sender, EventArgs e) => _visualPopupToolTip?.Dispose();
+ private void OnCancelToolTip(object? sender, EventArgs e) => _visualPopupToolTip?.Dispose();
- private void OnVisualPopupToolTipDisposed(object sender, EventArgs e)
+ private void OnVisualPopupToolTipDisposed(object? sender, EventArgs e)
{
// Unhook events from the specific instance that generated event
- var popupToolTip = (VisualPopupToolTip)sender;
+ var popupToolTip = sender as VisualPopupToolTip ?? throw new ArgumentNullException(nameof(sender));
popupToolTip.Disposed -= OnVisualPopupToolTipDisposed;
// Not showing a popup page any more
_visualPopupToolTip = null;
}
- private void OnTextBoxMouseChange(object sender, EventArgs e)
+ private void OnTextBoxMouseChange(object? sender, EventArgs e)
{
// Change in tracking state?
if (_textBox.MouseOver != _trackingMouseEnter)
@@ -2005,28 +1991,21 @@ private void OnTextBoxMouseChange(object sender, EventArgs e)
}
}
- private void OnEditorButtonClicked(object sender, EventArgs e) => new MultilineStringEditor1(this).ShowEditor();
+ private void OnEditorButtonClicked(object? sender, EventArgs e) => new MultilineStringEditor1(this).ShowEditor();
- private void OnMouseDoubleClick(object sender, MouseEventArgs e) => base.OnMouseDoubleClick(e);
+ private void OnMouseDoubleClick(object? sender, MouseEventArgs e) => base.OnMouseDoubleClick(e);
- private void OnDoubleClick(object sender, EventArgs e) => base.OnDoubleClick(e);
+ private void OnDoubleClick(object? sender, EventArgs e) => base.OnDoubleClick(e);
- private void OnTextBoxClick(object sender, EventArgs e) =>
+ private void OnTextBoxClick(object? sender, EventArgs e) =>
// ReSharper disable RedundantBaseQualifier
base.OnClick(e);
// ReSharper restore RedundantBaseQualifier
- private void SetCornerRoundingRadius(float? radius)
- {
- _cornerRoundingRadius = radius ?? GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
- StateCommon.Border.Rounding = _cornerRoundingRadius;
- }
-
- private void SetIsInAlphaNumericMode(KryptonTextBox owner)
- {
- // TODO: Return to this...
- }
+ //private void SetIsInAlphaNumericMode(KryptonTextBox owner)
+ //{
+ // // TODO: Return to this...
+ //}
private void ToggleEllipsisButtonVisibility(bool visible)
{
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonThemeBrowser.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonThemeBrowser.cs
index c51d4bd8a..c245769e6 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonThemeBrowser.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonThemeBrowser.cs
@@ -1,80 +1,39 @@
#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. 2023 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2024. All rights reserved.
*
*/
#endregion
namespace Krypton.Toolkit
{
- /// Public API to display the .
+ /// Public API to display the .
public class KryptonThemeBrowser
{
#region Public
- public static void Show() => ShowCore(FormStartPosition.CenterScreen, 33, null, null, null);
-
- /// Shows the theme browser window.
- /// The start position.
- public static void Show(FormStartPosition startPosition) => ShowCore(startPosition, 33, null, null, null);
-
- /// Shows the theme browser window.
- /// The start position.
- /// The window title.
- public static void Show(FormStartPosition startPosition, string windowTitle) => ShowCore(startPosition, 33, windowTitle, null, null);
-
- /// Shows the theme browser window.
- /// The start position.
- /// The start index.
- public static void Show(FormStartPosition startPosition, int startIndex) => ShowCore(startPosition, startIndex, null, null, null);
-
- /// Shows the theme browser window.
- /// The window title.
- public static void Show(string windowTitle) => ShowCore(FormStartPosition.CenterScreen, 33, windowTitle, null, null);
-
- /// Shows the theme browser window.
- /// The start index.
- /// The window title.
- public static void Show(int startIndex, string windowTitle) => ShowCore(FormStartPosition.CenterScreen, startIndex, windowTitle, null, null);
-
- /// Shows the theme browser window.
- /// The window title.
- /// if set to true [show import button].
- public static void Show(string windowTitle, bool showImportButton) => ShowCore(FormStartPosition.CenterScreen, 33, windowTitle, showImportButton, null);
-
- /// Shows the theme browser window.
- /// The window title.
- /// if set to true [show import button].
- /// if set to true [show silent option].
- public static void Show(string windowTitle, bool showImportButton, bool showSilentOption) => ShowCore(FormStartPosition.CenterScreen, 33, windowTitle, showImportButton, showSilentOption);
-
- /// Shows theme browser window.
- /// if set to true [show import button].
- /// if set to true [show silent option].
- public static void Show(bool showImportButton, bool showSilentOption) => ShowCore(FormStartPosition.CenterScreen, 336, null, showImportButton, showSilentOption);
-
- /// Shows the theme browser window.
- /// The start position.
- /// The start index.
- /// The window title.
- /// if set to true [show import button].
- /// if set to true [show silent option].
- public static void Show(FormStartPosition startPosition, int startIndex, string windowTitle, bool showImportButton, bool showSilentOption) => ShowCore(startPosition, startIndex, windowTitle, showImportButton, showSilentOption);
-
+ public static void Show(KryptonThemeBrowserData themeBrowserData, RightToLeftLayout? rightToLeftLayout = RightToLeftLayout.LeftToRight) => ShowCore(themeBrowserData, rightToLeftLayout);
#endregion
#region Implementation
- private static void ShowCore(FormStartPosition startPosition,
- int startIndex, string? windowTitle,
- bool? showImportButton, bool? showSilentOption)
+ private static void ShowCore(KryptonThemeBrowserData themeBrowserData,
+ RightToLeftLayout? layout)
{
- //using var ktb = new KryptonThemeBrowserForm(startPosition, startIndex, windowTitle, showImportButton,
- // showSilentOption);
-
- //ktb.ShowDialog();
+ if (layout == RightToLeftLayout.LeftToRight)
+ {
+ using var ktb = new VisualThemeBrowserForm(themeBrowserData);
+
+ ktb.ShowDialog();
+ }
+ else
+ {
+ using var ktbRTL = new VisualThemeBrowserFormRtlAware(themeBrowserData);
+
+ ktbRTL.ShowDialog();
+ }
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonThemeComboBox.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonThemeComboBox.cs
index f4b7cf62f..19818290a 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonThemeComboBox.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonThemeComboBox.cs
@@ -1,11 +1,8 @@
#region BSD License
/*
- *
- * Original BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE)
- * © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2024 - 2024. All rights reserved.
*
*/
#endregion
@@ -14,144 +11,138 @@ namespace Krypton.Toolkit
{
/// Allows the user to change themes using a .
///
- public class KryptonThemeComboBox : KryptonComboBox
+ [Designer(typeof(KryptonStubDesigner))]
+ public class KryptonThemeComboBox : KryptonComboBox, IKryptonThemeSelectorBase
{
#region Instance Fields
- private int _selectedIndex;
-
- private readonly int _defaultPaletteIndex = (int)PaletteMode.Microsoft365Blue;
-
- private PaletteMode _defaultPalette;
+ /// When we change the palette, Krypton Manager will notify us that there was a change. Since we are changing it that notification can be skipped.
+ private bool _isLocalUpdate = false;
+ /// Suppress code execution in the SelectedIndexChanged event handler, when a theme change via the KManager has been performed.
+ private bool _isExternalUpdate = false;
+ /// Backing var for the DefaultPalette property.
+ private PaletteMode _defaultPalette = PaletteMode.Global;
+ /// Local Krypton Manager instance.
+ private readonly KryptonManager _manager;
+ /// User defined palette.
+ private KryptonCustomPaletteBase? _kryptonCustomPalette = null;
#endregion
- #region Public
+ #region Identity
- /// Gets or sets the default palette mode.
- /// The default palette mode.
- [Category(@"Visuals")]
- [Description(@"The default palette mode.")]
- [DefaultValue(PaletteMode.Microsoft365Blue)]
- public PaletteMode DefaultPalette
+ /// Initializes a new instance of the class.
+ public KryptonThemeComboBox()
{
- get => _defaultPalette;
-
- set
- {
- _defaultPalette = value;
+ _manager = new KryptonManager();
+ DropDownStyle = ComboBoxStyle.DropDownList;
- UpdateDefaultPaletteIndex(value);
- }
- }
+ Items.Clear();
+ Items.AddRange(CommonHelperThemeSelectors.GetThemesArray());
- ///
- /// Gets and sets the ThemeSelectedIndex.
- ///
- [Category(@"Visuals")]
- [Description(@"Theme Selected Index. (Default = `Office 365 - Blue`)")]
- [DefaultValue((int)PaletteMode.Microsoft365Blue)]
- public int ThemeSelectedIndex
- {
- get => _selectedIndex = _defaultPaletteIndex;
+ // Sets the intial palette from either global or DefaultPalette property
+ SelectedIndex = CommonHelperThemeSelectors.GetInitialSelectedIndex(DefaultPalette, _manager, Items);
- private set => _selectedIndex = SelectedIndex = value;
}
+ #endregion
- private void ResetThemeSelectedIndex() => _selectedIndex = _defaultPaletteIndex;
-
- private bool ShouldSerializeThemeSelectedIndex() => _selectedIndex != _defaultPaletteIndex;
+ #region Public
- ///
- /// Gets and sets the ThemeSelectedIndex.
- ///
+ ///
[Category(@"Visuals")]
- [Description(@"Custom Theme to use when `Custom` is selected")]
+ [Description(@"The custom assigned palette mode.")]
[DefaultValue(null)]
- public KryptonCustomPaletteBase? KryptonCustomPalette { get; set; }
-
- [EditorBrowsable(EditorBrowsableState.Never)]
- public KryptonManager Manager
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
+ public KryptonCustomPaletteBase? KryptonCustomPalette
{
- get;
-
- } = new KryptonManager();
-
- #endregion
+ get => _kryptonCustomPalette;
+ set => _kryptonCustomPalette = value;
+ }
- #region Identity
+ private void ResetKryptonCustomPalette() => _kryptonCustomPalette = null;
+ private bool ShouldSerializeKryptonCustomPalette() => _kryptonCustomPalette is not null;
- /// Initializes a new instance of the class.
- public KryptonThemeComboBox()
+ ///
+ [Category(@"Visuals")]
+ [Description(@"The default palette mode.")]
+ [DefaultValue(PaletteMode.Global)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
+ public PaletteMode DefaultPalette
{
- DropDownStyle = ComboBoxStyle.DropDownList;
- foreach (var kvp in PaletteModeStrings.SupportedThemesMap)
- {
- Items.Add(kvp.Key);
- }
- Text = ThemeManager.ReturnPaletteModeAsString(PaletteMode.Microsoft365Blue);
- _selectedIndex = SelectedIndex = _defaultPaletteIndex;
+ get => _defaultPalette;
+ set => SelectedIndex = CommonHelperThemeSelectors.DefaultPaletteSetter(ref _defaultPalette, value, Items, SelectedIndex);
+ }
- _defaultPalette = PaletteMode.Microsoft365Blue;
+ private void ResetDefaultPalette() => DefaultPalette = PaletteMode.Global;
+ private bool ShouldSerializeDefaultPalette() => _defaultPalette != PaletteMode.Global;
- Debug.Assert(_selectedIndex == _defaultPaletteIndex, $@"Microsoft365Blue needs to be at the index position of {_defaultPaletteIndex} for backward compatibility");
- }
#endregion
#region Implementation
- private void UpdateDefaultPaletteIndex(PaletteMode mode) => ThemeSelectedIndex = (int)mode + 1;
-
- /// Returns the palette mode.
- ///
- ///
- ///
- public PaletteMode ReturnPaletteMode() => Manager.GlobalPaletteMode;
-
- // TODO: Refresh the theme names if the values have been altered
+ ///
+ /// Routine that will be executed when the control is fully instantiated.
+ ///
+ /// EventArgs param. Not used in this implementation.
+ protected override void OnHandleCreated(EventArgs e)
+ {
+ // React to theme changes from outside this control.
+ KryptonManager.GlobalPaletteChanged += KryptonManagerGlobalPaletteChanged;
+ base.OnHandleCreated(e);
+ }
+ ///
+ /// This method will run when the KryptonManager.GlobalPaletteChanged event is fired.
+ /// It will synchronize the SelectedIndex with the newly assigned Global Palette.
+ ///
+ /// Object that intiated the call.
+ /// Eventargs object data (not used).
+ private void KryptonManagerGlobalPaletteChanged(object? sender, EventArgs e)
+ {
+ SelectedIndex = CommonHelperThemeSelectors.KryptonManagerGlobalPaletteChanged(_isLocalUpdate, ref _isExternalUpdate, SelectedIndex, Items);
+ }
#endregion
#region Protected Overrides
- ///
- protected override void OnCreateControl()
- {
- base.OnCreateControl();
- SelectedIndex = _selectedIndex;
- }
-
///
protected override void OnSelectedIndexChanged(EventArgs e)
{
- ThemeManager.ApplyTheme(Text, Manager);
-
- ThemeSelectedIndex = SelectedIndex;
-
- base.OnSelectedIndexChanged(e);
- if ((ThemeManager.GetThemeManagerMode(Text) == PaletteMode.Custom)
- && (KryptonCustomPalette != null)
- )
+ if ( !CommonHelperThemeSelectors.OnSelectedIndexChanged(ref _isLocalUpdate, _isExternalUpdate, ref _defaultPalette, Text, _manager, _kryptonCustomPalette))
{
- Manager.GlobalPalette = KryptonCustomPalette;
+ //theme change went wrong, make the active theme the selected theme in the list.
+ SelectedIndex = CommonHelperThemeSelectors.GetPaletteIndex(Items, _manager.GlobalPaletteMode);
}
+
+ base.OnSelectedIndexChanged(e);
}
#endregion
#region Removed Designer Visibility
+
///
- /// Gets and sets the text associated associated with the control.
+ /// Gets and sets the text associated with the control.
///
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[AllowNull]
public override string Text
{
+ //nullable operator removed
get => base.Text;
set => base.Text = value;
}
+ /// Gets or sets the format specifier characters that indicate how a value is to be Displayed.
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public new string FormatString
+ {
+ get => base.FormatString;
+ set => base.FormatString = value;
+ }
+
///
/// Gets and sets the appearance and functionality of the KryptonComboBox.
///
@@ -191,11 +182,33 @@ public override string Text
set => base.AutoCompleteCustomSource = value;
}
+ /// Gets or sets the text completion behavior of the combobox.
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new int SelectedIndex { get => base.SelectedIndex; set => base.SelectedIndex = value; }
+ public new AutoCompleteMode AutoCompleteMode
+ {
+ get => base.AutoCompleteMode;
+ set => base.AutoCompleteMode = value;
+ }
+
+ /// Gets or sets the autocomplete source, which can be one of the values from AutoCompleteSource enumeration.
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public new AutoCompleteSource AutoCompleteSource
+ {
+ get => base.AutoCompleteSource;
+ set => base.AutoCompleteSource = value;
+ }
+
+ /// Gets and sets the selected index.
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public new int SelectedIndex
+ {
+ get => base.SelectedIndex;
+ set => base.SelectedIndex = value;
+ }
#endregion
}
-
}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonThemeListBox.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonThemeListBox.cs
index dcf5e6f4d..9ff311f1c 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonThemeListBox.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonThemeListBox.cs
@@ -2,7 +2,7 @@
/*
*
* 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. 2023 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2024. All rights reserved.
*
*/
#endregion
@@ -12,117 +12,154 @@ namespace Krypton.Toolkit
{
/// Allows the user to change themes using a .
///
- public class KryptonThemeListBox : KryptonListBox
+ [Designer(typeof(KryptonStubDesigner))]
+ public class KryptonThemeListBox : KryptonListBox, IKryptonThemeSelectorBase
{
#region Instance Fields
- private int _selectedThemeIndex;
+ /// When we change the palette, Krypton Manager will notify us that there was a change. Since we are changing it that notification can be skipped.
+ private bool _isLocalUpdate = false;
+ /// Suppress code execution in the SelectedIndexChanged event handler, when a theme change via the KManager has been performed.
+ private bool _isExternalUpdate = false;
+ /// Backing var for the DefaultPalette property.
+ private PaletteMode _defaultPalette = PaletteMode.Global;
+ /// Local Krypton Manager instance.
+ private readonly KryptonManager _manager;
+ /// User defined palette.
+ private KryptonCustomPaletteBase? _kryptonCustomPalette = null;
#endregion
- #region Public
+ #region Identity
- ///
- /// Gets and sets the ThemeSelectedIndex.
- ///
- [Category(@"Visuals")]
- [Description(@"Theme Selected Index. (Default = `Office 365 - Blue`)")]
- [DefaultValue(33)]
- public int ThemeSelectedIndex
+ /// Initializes a new instance of the class.
+ public KryptonThemeListBox()
{
- get => _selectedThemeIndex;
+ _manager = new KryptonManager();
- set => SelectedIndex = value;
+ Items.Clear();
+ Items.AddRange(CommonHelperThemeSelectors.GetThemesArray());
+
+ // Sets the intial palette from either global or DefaultPalette property
+ SelectedIndex = CommonHelperThemeSelectors.GetInitialSelectedIndex(DefaultPalette, _manager, Items);
}
- private void ResetThemeSelectedIndex() => _selectedThemeIndex = 33;
+ #endregion
- private bool ShouldSerializeThemeSelectedIndex() => _selectedThemeIndex != 33;
+ #region Public
- ///
- /// Gets and sets the ThemeSelectedIndex.
- ///
+ ///
[Category(@"Visuals")]
- [Description(@"Custom Theme to use when `Custom` is selected")]
+ [Description(@"The custom assigned palette mode.")]
[DefaultValue(null)]
- public KryptonCustomPaletteBase? KryptonCustomPalette { get; set; }
-
- [EditorBrowsable(EditorBrowsableState.Never)]
- public KryptonManager Manager
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
+ public KryptonCustomPaletteBase? KryptonCustomPalette
{
- get;
-
- } = new KryptonManager();
-
- #endregion
+ get => _kryptonCustomPalette;
+ set => _kryptonCustomPalette = value;
+ }
- #region Identity
+ private void ResetKryptonCustomPalette() => _kryptonCustomPalette = null;
+ private bool ShouldSerializeKryptonCustomPalette() => _kryptonCustomPalette is not null;
- /// Initializes a new instance of the class.
- public KryptonThemeListBox()
+ ///
+ [Category(@"Visuals")]
+ [Description(@"The default palette mode.")]
+ [DefaultValue(PaletteMode.Global)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
+ public PaletteMode DefaultPalette
{
- foreach (var kvp in PaletteModeStrings.SupportedThemesMap)
- {
- Items.Add(kvp.Key);
- }
- Text = ThemeManager.ReturnPaletteModeAsString(PaletteMode.Microsoft365Blue);
- _selectedThemeIndex = SelectedIndex;
- Debug.Assert(_selectedThemeIndex == 33, "Microsoft365Blue needs to be at the 33rd index for backward compatibility");
+ get => _defaultPalette;
+ set => SelectedIndex = CommonHelperThemeSelectors.DefaultPaletteSetter(ref _defaultPalette, value, Items, SelectedIndex);
}
- #endregion
-
- #region Implementation
-
- /// Returns the palette mode.
- public PaletteMode ReturnPaletteMode() => Manager.GlobalPaletteMode;
+ private void ResetDefaultPalette() => DefaultPalette = PaletteMode.Global;
+ private bool ShouldSerializeDefaultPalette() => _defaultPalette != PaletteMode.Global;
#endregion
- #region Protected
+ #region Implementation
- ///
- protected override void OnCreateControl()
+ ///
+ /// Routine that will be executed when the control is fully instantiated.
+ ///
+ /// EventArgs param. Not used in this implementation.
+ protected override void OnHandleCreated(EventArgs e)
{
- base.OnCreateControl();
+ // React to theme changes from outside this control.
+ KryptonManager.GlobalPaletteChanged += KryptonManagerGlobalPaletteChanged;
+ base.OnHandleCreated(e);
+ }
- SelectedIndex = _selectedThemeIndex;
+ ///
+ /// This method will run when the KryptonManager.GlobalPaletteChanged event is fired.
+ /// It will synchronize the SelectedIndex with the newly assigned Global Palette.
+ ///
+ /// Object that intiated the call.
+ /// Eventargs object data (not used).
+ private void KryptonManagerGlobalPaletteChanged(object? sender, EventArgs e)
+ {
+ SelectedIndex = CommonHelperThemeSelectors.KryptonManagerGlobalPaletteChanged(_isLocalUpdate, ref _isExternalUpdate, SelectedIndex, Items);
}
+ #endregion
+
+ #region Protected Overrides
+
///
protected override void OnSelectedIndexChanged(EventArgs e)
{
- ThemeManager.ApplyTheme(GetItemText(SelectedItem), Manager);
-
- ThemeSelectedIndex = SelectedIndex;
-
- base.OnSelectedIndexChanged(e);
+ // The theme listbox needs a check first since SelectedItem is of type: object?
+ string themeName = SelectedIndex > -1 && SelectedItem is string str && str.Length > 0
+ ? str
+ : string.Empty;
- if ((ThemeManager.GetThemeManagerMode(GetItemText(SelectedItem)) == PaletteMode.Custom) && (KryptonCustomPalette != null))
+ if (!CommonHelperThemeSelectors.OnSelectedIndexChanged(ref _isLocalUpdate, _isExternalUpdate, ref _defaultPalette, themeName, _manager, _kryptonCustomPalette))
{
- Manager.GlobalPalette = KryptonCustomPalette;
+ //theme change went wrong, make the active theme the selected theme in the list.
+ SelectedIndex = CommonHelperThemeSelectors.GetPaletteIndex(Items, _manager.GlobalPaletteMode);
}
+
+ base.OnSelectedIndexChanged(e);
}
#endregion
#region Removed Designer Visibility
- /// Gets and sets the text associated associated with the control.
+ /// Gets and sets the text associated with the control.
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- [DisallowNull]
+ [AllowNull]
public override string Text
{
get => base.Text;
set => base.Text = value;
}
+ /// Gets or sets the format specifier characters that indicate how a value is to be Displayed.
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public new string FormatString
+ {
+ get => base.FormatString;
+ set => base.FormatString = value;
+ }
+
/// Gets the items of the KryptonListBox.
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new ListBox.ObjectCollection Items => base.Items;
+ /// Gets and sets the selected index.
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public new int SelectedIndex
+ {
+ get => base.SelectedIndex;
+ set => base.SelectedIndex = value;
+ }
+
#endregion
}
}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonToastNotification.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonToastNotification.cs
new file mode 100644
index 000000000..57b69f4b0
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonToastNotification.cs
@@ -0,0 +1,85 @@
+#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. 2023 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+#pragma warning disable VSSpell001
+
+namespace Krypton.Toolkit
+{
+ /// The public interface to the class.
+ [ToolboxItem(false)]
+ [DesignerCategory(@"code")]
+ public static class KryptonToastNotification
+ {
+ #region Public
+
+ #region Basic Notification
+
+ /// Shows the basic notification with a boolean return value.
+ /// The toast notification data.
+ /// A boolean value, based on the 'Do not show again' option.
+ public static bool ShowBasicNotificationWithBooleanReturnValue(KryptonBasicToastNotificationData toastNotificationData)
+ => KryptonToastNotificationController.ShowNotificationWithBooleanDoNotShowAgainReturnValue(toastNotificationData);
+
+ /// Shows the basic notification with a return value.
+ /// The toast notification data.
+ /// A value, based on the 'Do not show again' option.b
+ public static CheckState ShowBasicNotificationWithCheckStateReturnValue(KryptonBasicToastNotificationData toastNotificationData)
+ => KryptonToastNotificationController.ShowNotificationWithCheckStateDoNotShowAgainReturnValue(toastNotificationData);
+
+ /// Shows the basic notification.
+ /// The toast notification data.
+ public static void ShowBasicNotification(KryptonBasicToastNotificationData toastNotificationData) =>
+ KryptonToastNotificationController.ShowBasicToastNotification(toastNotificationData);
+
+ #endregion
+
+ #region Basic Notification with Progress Bar
+
+ /// Shows the basic progress bar notification with a boolean return value.
+ /// The toast notification data.
+ /// A boolean value, based on the 'Do not show again' option.
+ public static bool ShowBasicProgressBarNotificationWithBooleanReturnValue(KryptonBasicToastNotificationData toastNotificationData) =>
+ KryptonToastNotificationController.ShowBasicProgressBarNotificationWithBooleanReturnValue(toastNotificationData);
+
+ /// Shows the basic progress bar notification with a return value.
+ /// The toast notification data.
+ /// A value, based on the 'Do not show again' option.
+ public static CheckState ShowBasicProgressBarNotificationWithCheckStateReturnValue(KryptonBasicToastNotificationData toastNotificationData) =>
+ KryptonToastNotificationController.ShowBasicProgressBarNotificationWithCheckStateReturnValue(toastNotificationData);
+
+ /// Shows the basic progress bar notification.
+ /// The toast notification data.
+ public static void ShowBasicProgressBarNotification(KryptonBasicToastNotificationData toastNotificationData) =>
+ KryptonToastNotificationController.ShowBasicProgressBarNotification(toastNotificationData);
+
+ #endregion
+
+ #region Notification with Return Values
+
+ #region Left to Right Reading
+
+ /// Shows the notification with ComboBox.
+ /// The data.
+ ///
+ public static object ShowNotification(KryptonUserInputToastNotificationData data) =>
+ KryptonToastNotificationController.ShowToast(data);
+
+ /// Shows the notification with progress bar.
+ /// The data.
+ ///
+ public static object ShowNotificationWithProgressBar(KryptonUserInputToastNotificationData data) =>
+ KryptonToastNotificationController.ShowToastWithProgressBar(data);
+
+ #endregion
+
+ #endregion
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonToastNotificationManager.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonToastNotificationManager.cs
new file mode 100644
index 000000000..6dde406f4
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonToastNotificationManager.cs
@@ -0,0 +1,15 @@
+#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. 2023 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+namespace Krypton.Toolkit
+{
+ [ToolboxItem(true)]
+ [ToolboxBitmap(typeof(KryptonToastNotificationManager), @"ToolboxBitmaps.KryptonInputBox.bmp")]
+ public class KryptonToastNotificationManager : Component;
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonToolStrip.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonToolStrip.cs
index 732757976..8672077b1 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonToolStrip.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonToolStrip.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonToolStripComboBox.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonToolStripComboBox.cs
new file mode 100644
index 000000000..f32e1edf0
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonToolStripComboBox.cs
@@ -0,0 +1,86 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+namespace Krypton.Toolkit
+{
+ [ToolboxBitmap(typeof(KryptonComboBox))]
+ [ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.All)]
+ //[DefaultEvent(nameof(SelectedIndexChanged))]
+ //[DefaultProperty(nameof(Text))]
+ public class KryptonToolStripComboBox : ToolStripControlHostFixed
+ {
+ #region Instance Fields
+
+
+
+ #endregion
+
+ #region Host Control
+
+ /// Gets access to the krypton ComboBox control.
+ /// The krypton ComboBox control.
+ [RefreshProperties(RefreshProperties.All)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ [Description(@"Access to the hosted KryptonComboBox.")]
+ public KryptonComboBox? KryptonComboBoxControl => Control as KryptonComboBox;
+
+ #endregion
+
+ #region Public
+
+ ///
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public override Color BackColor { get; set; }
+
+ ///
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public override Color ForeColor { get; set; }
+
+#if NET8_0_OR_GREATER
+ ///
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public override Image? BackgroundImage { get; set; }
+#else
+ ///
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public override Image BackgroundImage { get; set; }
+#endif
+
+ #endregion
+
+ #region Identity
+
+ /// Initializes a new instance of the class.
+ public KryptonToolStripComboBox() : base(new KryptonComboBox())
+ {
+ AutoSize = false;
+ }
+
+ #endregion
+
+ #region Protected Overrides
+
+ ///
+ protected override void OnSubscribeControlEvents(Control? control)
+ {
+ base.OnSubscribeControlEvents(control);
+ }
+
+ ///
+ protected override void OnUnsubscribeControlEvents(Control? control)
+ {
+ base.OnUnsubscribeControlEvents(control);
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonToolkitPoweredByControl.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonToolkitPoweredByControl.Designer.cs
index 0c59ceabf..c06fb779f 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonToolkitPoweredByControl.Designer.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonToolkitPoweredByControl.Designer.cs
@@ -1,7 +1,7 @@
#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. 2023 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2024. All rights reserved.
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonToolkitPoweredByControl.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonToolkitPoweredByControl.cs
index c680752b8..daab7d298 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonToolkitPoweredByControl.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonToolkitPoweredByControl.cs
@@ -1,7 +1,7 @@
#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. 2023 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2023 - 2024. All rights reserved.
*/
#endregion
@@ -121,7 +121,7 @@ private void klwlblDetails_LinkClicked(object sender, LinkLabelLinkClickedEventA
}
catch (Exception exception)
{
- ExceptionHandler.CaptureException(exception);
+ ExceptionHandler.CaptureException(exception, showStackTrace: GlobalStaticValues.DEFAULT_USE_STACK_TRACE);
}
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTrackBar.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTrackBar.cs
index b74b9e852..6535f38c4 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTrackBar.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTrackBar.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -743,9 +743,9 @@ private void AdjustSize()
}
}
- private void OnDrawValueChanged(object sender, EventArgs e) => OnValueChanged(e);
+ private void OnDrawValueChanged(object? sender, EventArgs e) => OnValueChanged(e);
- private void OnDrawScroll(object sender, EventArgs e) => OnScroll(e);
+ private void OnDrawScroll(object? sender, EventArgs e) => OnScroll(e);
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTreeNode.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTreeNode.cs
index 267b6a386..833d4f59f 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTreeNode.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTreeNode.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -21,7 +21,7 @@ public class KryptonTreeNode : TreeNode
#region Instance Fields
private string _longText;
private Color _longForeColor;
- private Font _longNodeFont;
+ private Font? _longNodeFont;
private bool _isCheckBoxVisible;
#endregion
@@ -92,7 +92,7 @@ public KryptonTreeNode(string text, int imageIndex, int selectedImageIndex, Tree
private void Init()
{
_longText = string.Empty;
- _longForeColor = Color.Empty;
+ _longForeColor = GlobalStaticValues.EMPTY_COLOR;
_longNodeFont = null;
_isCheckBoxVisible = true;
}
@@ -143,7 +143,7 @@ public Color LongForeColor
}
}
- private bool ShouldSerializeLongForeColor() => _longForeColor != Color.Empty;
+ private bool ShouldSerializeLongForeColor() => _longForeColor != GlobalStaticValues.EMPTY_COLOR;
#endregion
@@ -153,7 +153,7 @@ public Color LongForeColor
///
[Category(@"Appearance")]
[Description(@"Font of the long text")]
- public Font LongNodeFont
+ public Font? LongNodeFont
{
get => _longNodeFont;
@@ -194,7 +194,7 @@ public bool IsCheckBoxVisible
// Have to do this as RowBounds is not accessible ! and the check box is on the left, normally !
Rectangle nodeWidth = Rectangle.FromLTRB(0, callOnce.Top, callOnce.Right + callOnce.Left,
callOnce.Bottom);
- TreeView.Invalidate(nodeWidth);
+ TreeView!.Invalidate(nodeWidth);
TreeView.Update();
}
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTreeView.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTreeView.cs
index 0197ae176..8760e8256 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTreeView.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTreeView.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -30,7 +30,7 @@ public class KryptonTreeView : VisualControlBase,
private class InternalTreeView : TreeView
{
#region Static Fields
- private static MethodInfo _miRI;
+ private static MethodInfo? _miRI;
#endregion
#region Instance Fields
@@ -132,7 +132,7 @@ public bool MouseOver
public void ResetIndent()
{
// Only grab the required reference once
- if (_miRI == null)
+ if (_miRI is null)
{
// Use reflection so we can call the TreeView private method
_miRI = typeof(TreeView).GetMethod(nameof(ResetIndent),
@@ -141,7 +141,7 @@ public void ResetIndent()
Array.Empty(), null);
}
- _miRI.Invoke(this, Array.Empty());
+ _miRI!.Invoke(this, Array.Empty());
}
#endregion
@@ -214,13 +214,13 @@ protected override void WndProc(ref Message m)
/// Raises the TrackMouseEnter event.
///
/// An EventArgs containing the event data.
- protected virtual void OnTrackMouseEnter(EventArgs e) => TrackMouseEnter?.Invoke(this, e);
+ private void OnTrackMouseEnter(EventArgs e) => TrackMouseEnter?.Invoke(this, e);
///
/// Raises the TrackMouseLeave event.
///
/// An EventArgs containing the event data.
- protected virtual void OnTrackMouseLeave(EventArgs e) => TrackMouseLeave?.Invoke(this, e);
+ private void OnTrackMouseLeave(EventArgs e) => TrackMouseLeave?.Invoke(this, e);
#endregion
#region Private
@@ -229,7 +229,7 @@ private void WmPaint(ref Message m)
var ps = new PI.PAINTSTRUCT();
// Do we need to BeginPaint or just take the given HDC?
- var hdc = m.WParam == IntPtr.Zero ? PI.BeginPaint(Handle, ref ps) : m.WParam;
+ IntPtr hdc = m.WParam == IntPtr.Zero ? PI.BeginPaint(Handle, ref ps) : m.WParam;
// Create bitmap that all drawing occurs onto, then we can blit it later to remove flicker
Rectangle realRect = CommonHelper.RealClientRectangle(Handle);
@@ -237,7 +237,7 @@ private void WmPaint(ref Message m)
// No point drawing when one of the dimensions is zero
if (realRect is { Width: > 0, Height: > 0 })
{
- var hBitmap = PI.CreateCompatibleBitmap(hdc, realRect.Width, realRect.Height);
+ IntPtr hBitmap = PI.CreateCompatibleBitmap(hdc, realRect.Width, realRect.Height);
// If we managed to get a compatible bitmap
if (hBitmap != IntPtr.Zero)
@@ -273,7 +273,7 @@ private void WmPaint(ref Message m)
}
// Replace given DC with the screen DC for base window proc drawing
- var beforeDC = m.WParam;
+ IntPtr beforeDC = m.WParam;
m.WParam = _screenDC;
DefWndProc(ref m);
m.WParam = beforeDC;
@@ -304,10 +304,10 @@ private void WmPaint(ref Message m)
private readonly PaletteTripleOverride _overrideNormal;
private readonly PaletteTripleOverride _overrideTracking;
- private readonly PaletteTripleOverride _overridePressed;
+ private readonly PaletteTripleOverride _overrideMultiSelect;
private readonly PaletteTripleOverride _overrideCheckedNormal;
private readonly PaletteTripleOverride _overrideCheckedTracking;
- private readonly PaletteTripleOverride _overrideCheckedPressed;
+ private readonly PaletteTripleOverride _overrideCheckedMultiSelect;
private readonly PaletteNodeOverride _overrideNormalNode;
private readonly PaletteRedirectTreeView? _redirectImages;
private readonly ViewDrawDocker _drawDockerOuter;
@@ -331,9 +331,7 @@ private void WmPaint(ref Message m)
private bool _forcedLayout;
private bool _trackingMouseEnter;
private bool _isRecreating; // https://github.com/Krypton-Suite/Standard-Toolkit/issues/777
- private float _cornerRoundingRadius;
- private float _nodeCornerRoundingRadius;
-
+ private bool _multiSelect;
#endregion
#region Events
@@ -422,7 +420,7 @@ private void WmPaint(ref Message m)
public event TreeNodeMouseClickEventHandler? NodeMouseClick;
///
- /// Occurs when a node is double clicked with the mouse.
+ /// Occurs when a node is double-clicked with the mouse.
///
[Category(@"Behavior")]
[Description(@"Occurs when a node is double clicked with the mouse.")]
@@ -537,34 +535,34 @@ public KryptonTreeView()
StateCommon = new PaletteTreeStateRedirect(Redirector, commonBack, backInherit, commonBorder, borderInherit, NeedPaintDelegate);
var disabledBack = new PaletteBackColor1(StateCommon.PaletteBack, NeedPaintDelegate);
- var disabledBorder = new PaletteBorder(StateCommon.PaletteBorder, NeedPaintDelegate);
+ var disabledBorder = new PaletteBorder(StateCommon.PaletteBorder!, NeedPaintDelegate);
StateDisabled = new PaletteTreeState(StateCommon, disabledBack, disabledBorder, NeedPaintDelegate);
var normalBack = new PaletteBackColor1(StateCommon.PaletteBack, NeedPaintDelegate);
- var normalBorder = new PaletteBorder(StateCommon.PaletteBorder, NeedPaintDelegate);
+ var normalBorder = new PaletteBorder(StateCommon.PaletteBorder!, NeedPaintDelegate);
StateNormal = new PaletteTreeState(StateCommon, normalBack, normalBorder, NeedPaintDelegate);
var activeBack = new PaletteBackColor1(StateCommon.PaletteBack, NeedPaintDelegate);
- var activeBorder = new PaletteBorder(StateCommon.PaletteBorder, NeedPaintDelegate);
+ var activeBorder = new PaletteBorder(StateCommon.PaletteBorder!, NeedPaintDelegate);
StateActive = new PaletteDouble(StateCommon, activeBack, activeBorder, NeedPaintDelegate);
OverrideFocus = new PaletteTreeNodeTripleRedirect(Redirector, PaletteBackStyle.ButtonListItem, PaletteBorderStyle.ButtonListItem, PaletteContentStyle.ButtonListItem, NeedPaintDelegate);
StateTracking = new PaletteTreeNodeTriple(StateCommon.Node, NeedPaintDelegate);
- StatePressed = new PaletteTreeNodeTriple(StateCommon.Node, NeedPaintDelegate);
+ StateMultiSelect = new PaletteTreeNodeTriple(StateCommon.Node, NeedPaintDelegate);
StateCheckedNormal = new PaletteTreeNodeTriple(StateCommon.Node, NeedPaintDelegate);
StateCheckedTracking = new PaletteTreeNodeTriple(StateCommon.Node, NeedPaintDelegate);
- StateCheckedPressed = new PaletteTreeNodeTriple(StateCommon.Node, NeedPaintDelegate);
+ StateCheckedMultiSelect = new PaletteTreeNodeTriple(StateCommon.Node, NeedPaintDelegate);
// Create the override handling classes
_overrideNormal = new PaletteTripleOverride(OverrideFocus.Node, StateNormal.Node, PaletteState.FocusOverride);
_overrideTracking = new PaletteTripleOverride(OverrideFocus.Node, StateTracking.Node, PaletteState.FocusOverride);
- _overridePressed = new PaletteTripleOverride(OverrideFocus.Node, StatePressed.Node, PaletteState.FocusOverride);
+ _overrideMultiSelect = new PaletteTripleOverride(OverrideFocus.Node, StateMultiSelect.Node, PaletteState.FocusOverride);
_overrideCheckedNormal = new PaletteTripleOverride(OverrideFocus.Node, StateCheckedNormal.Node, PaletteState.FocusOverride);
_overrideCheckedTracking = new PaletteTripleOverride(OverrideFocus.Node, StateCheckedTracking.Node, PaletteState.FocusOverride);
- _overrideCheckedPressed = new PaletteTripleOverride(OverrideFocus.Node, StateCheckedPressed.Node, PaletteState.FocusOverride);
+ _overrideCheckedMultiSelect = new PaletteTripleOverride(OverrideFocus.Node, StateCheckedMultiSelect.Node, PaletteState.FocusOverride);
_overrideNormalNode = new PaletteNodeOverride(_overrideNormal);
- // Create the check box image drawer and place inside element so it is always centered
+ // Create the checkbox image drawer and place inside element so it is always centered
_drawCheckBox = new ViewDrawCheckBox(_redirectImages);
var layoutCheckBox = new ViewLayoutCenter
{
@@ -592,9 +590,9 @@ public KryptonTreeView()
// Create the draw element for owner drawing individual items
_contentValues = new FixedContentValue();
_drawButton = new ViewDrawButton(StateDisabled.Node, _overrideNormalNode,
- _overrideTracking, _overridePressed,
+ _overrideTracking, _overrideMultiSelect,
_overrideCheckedNormal, _overrideCheckedTracking,
- _overrideCheckedPressed,
+ _overrideCheckedMultiSelect,
new PaletteMetricRedirect(Redirector),
_contentValues, VisualOrientation.Top, false);
@@ -665,13 +663,9 @@ public KryptonTreeView()
// Add tree view to the controls collection
((KryptonReadOnlyControls)Controls).AddInternal(_treeView);
-
- _cornerRoundingRadius = GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
- _nodeCornerRoundingRadius = GlobalStaticValues.SECONDARY_CORNER_ROUNDING_VALUE;
}
- private void OnTreeClick(object sender, EventArgs e) => OnClick(e);
+ private void OnTreeClick(object? sender, EventArgs e) => OnClick(e);
///
/// Releases all resources used by the Control.
@@ -688,32 +682,13 @@ protected override void Dispose(bool disposing)
#endregion
#region Public
-
- /// Gets or sets the corner rounding radius.
- /// The corner rounding radius.
- [Category(@"Visuals"), DefaultValue(GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE), Description(@"Defines the corner roundness on the current window (-1 is the default look).")]
- public float CornerRoundingRadius
- {
- get => _cornerRoundingRadius;
- set => SetCornerRoundingRadius(value);
- }
-
- /// Gets or sets the node corner rounding radius.
- /// The node corner rounding radius.
- [Category(@"Visuals"), DefaultValue(GlobalStaticValues.SECONDARY_CORNER_ROUNDING_VALUE), Description(@"Defines the node corner roundness on the current window (-1 is the default look).")]
- public float NodeCornerRoundingRadius
- {
- get => _nodeCornerRoundingRadius;
- set => SetNodeCornerRoundingRadius(value);
- }
-
///
/// Gets access to the contained TreeView instance.
///
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[EditorBrowsable(EditorBrowsableState.Always)]
[Browsable(false)]
- public TreeView? TreeView => _treeView;
+ public TreeView TreeView => _treeView;
///
/// Gets access to the contained input control.
@@ -762,7 +737,7 @@ public override Color BackColor
public override Font Font
{
get => base.Font;
- set => base.Font = value;
+ set => base.Font = value!;
}
///
@@ -812,9 +787,7 @@ public int ItemHeight
}
}
}
-
private bool ShouldSerializeItemHeight() => !_itemHeightDefault;
-
private void ResetItemHeight()
{
_itemHeightDefault = true;
@@ -833,6 +806,27 @@ public bool CheckBoxes
set => _treeView.CheckBoxes = value;
}
+ ///
+ /// Gets or sets a value indicating whether check boxes are Displayed next to the tree nodes in the tree view control.
+ ///
+ [Category(@"Appearance")]
+ [Description(@"Indicates whether 'MultiSelect' is implemented on Selection")]
+ [DefaultValue(false)]
+ public bool MultiSelect
+ {
+ get => _multiSelect || CheckBoxes;
+ set
+ {
+ _multiSelect = value;
+ // Force redraw of current options
+ var checkedNodes = CheckedNodes;
+ CheckedNodes = checkedNodes;
+ }
+ }
+
+ private bool ShouldSerializeMultiSelect() => _multiSelect;
+ private void ResetMultiSelect() => _multiSelect = false;
+
///
/// Gets or sets a value indicating whether the selection highlight spans the width of the tree view control.
///
@@ -989,15 +983,45 @@ public string SelectedImageKey
/// Gets or sets the tree node that is currently selected in the tree view control.
///
[Category(@"Appearance")]
- [Description(@"Note that is currently selected.")]
+ [Description(@"Node that is currently selected.")]
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public TreeNode SelectedNode
+ public TreeNode? SelectedNode
{
get => _treeView.SelectedNode;
set => _treeView.SelectedNode = value;
}
+ ///
+ /// Gets or sets the tree node that is currently selected in the tree view control.
+ ///
+ [Category(@"Appearance")]
+ [Description(@"Node(s) that have check set; Will used in MultiSelect as well.")]
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public List CheckedNodes
+ {
+ get => TreeView.Nodes.Cast().Where(node => node.Checked).ToList();
+ set
+ {
+ foreach (TreeNode node in TreeView.Nodes)
+ {
+ node.Checked = false;
+ }
+
+ foreach (TreeNode node in value)
+ {
+ node.Checked = true;
+ if (!MultiSelect)
+ {
+ // Only do the first one !
+ break;
+ }
+ }
+ PerformNeedPaint(false);
+ }
+ }
+
///
/// Gets or sets a value indicating whether lines are drawn between tree nodes in the tree view control.
///
@@ -1065,7 +1089,7 @@ public ImageList? StateImageList
[Description(@"First fully-visible node.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Browsable(false)]
- public TreeNode TopNode
+ public TreeNode? TopNode
{
get => _treeView.TopNode;
set => _treeView.TopNode = value;
@@ -1078,7 +1102,7 @@ public TreeNode TopNode
[Description(@"IComparer used to perform custom sorting.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Browsable(false)]
- public IComparer TreeViewNodeSorter
+ public IComparer? TreeViewNodeSorter
{
get => _treeView.TreeViewNodeSorter;
set => _treeView.TreeViewNodeSorter = value;
@@ -1214,7 +1238,7 @@ public PaletteBorderStyle BorderStyle
private bool ShouldSerializePlusMinusImages() => !PlusMinusImages.IsDefault;
///
- /// Gets access to the check box image value overrides.
+ /// Gets access to the checkbox image value overrides.
///
[Category(@"Visuals")]
[Description(@"CheckBox image value overrides.")]
@@ -1287,11 +1311,11 @@ public PaletteBorderStyle BorderStyle
/// Gets access to the pressed item appearance entries.
///
[Category(@"Visuals")]
- [Description(@"Overrides for defining pressed item appearance.")]
+ [Description(@"Overrides for defining (Multi) Select item appearance.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public PaletteTreeNodeTriple StatePressed { get; }
+ public PaletteTreeNodeTriple StateMultiSelect { get; }
- private bool ShouldSerializeStatePressed() => !StatePressed.IsDefault;
+ private bool ShouldSerializeStateMultiSelect() => !StateMultiSelect.IsDefault;
///
/// Gets access to the normal checked item appearance entries.
@@ -1317,11 +1341,11 @@ public PaletteBorderStyle BorderStyle
/// Gets access to the pressed checked item appearance entries.
///
[Category(@"Visuals")]
- [Description(@"Overrides for defining pressed checked item appearance.")]
+ [Description(@"Overrides for defining (Multi) Select checked item appearance.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
- public PaletteTreeNodeTriple StateCheckedPressed { get; }
+ public PaletteTreeNodeTriple StateCheckedMultiSelect { get; }
- private bool ShouldSerializeStateCheckedPressed() => !StateCheckedPressed.IsDefault;
+ private bool ShouldSerializeStateCheckedMultiSelect() => !StateCheckedMultiSelect.IsDefault;
///
/// Gets and sets Determines if the control is always active or only when the mouse is over the control or has focus.
@@ -1373,7 +1397,7 @@ public bool AlwaysActive
///
/// The Point to evaluate and retrieve the node from.
/// The TreeNode at the specified point, in tree view (client) coordinates, or null if there is no node at that location.
- public TreeNode GetNodeAt(Point pt) => _treeView.GetNodeAt(pt);
+ public TreeNode? GetNodeAt(Point pt) => _treeView.GetNodeAt(pt);
///
/// Retrieves the tree node at the point with the specified coordinates.
@@ -1381,7 +1405,7 @@ public bool AlwaysActive
/// The X position to evaluate and retrieve the node from.
/// The Y position to evaluate and retrieve the node from.
/// The TreeNode at the specified location, in tree view (client) coordinates, or null if there is no node at that location.
- public TreeNode GetNodeAt(int x, int y) => _treeView.GetNodeAt(x, y);
+ public TreeNode? GetNodeAt(int x, int y) => _treeView.GetNodeAt(x, y);
///
/// Retrieves the number of tree nodes, optionally including those in all subtrees, assigned to the tree view control.
@@ -1422,12 +1446,12 @@ public bool AlwaysActive
/// Sets input focus to the control.
///
/// true if the input focus request was successful; otherwise, false.
- public new bool Focus() => TreeView != null && TreeView.Focus();
+ public new bool Focus() => TreeView.Focus();
///
/// Activates the control.
///
- public new void Select() => TreeView?.Select();
+ public new void Select() => TreeView.Select();
#endregion
#region Protected
@@ -1508,6 +1532,11 @@ protected virtual void OnAfterSelect(TreeViewEventArgs e)
{
if (!_isRecreating)
{
+ if (_multiSelect && e.Node is not null)
+ {
+ e.Node.Checked = !e.Node.Checked;
+ }
+
AfterSelect?.Invoke(this, e);
}
}
@@ -1669,7 +1698,7 @@ protected override void OnPaletteChanged(EventArgs e)
///
/// Source of notification.
/// An NeedLayoutEventArgs containing event data.
- protected override void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e)
+ protected override void OnPaletteNeedPaint(object? sender, NeedLayoutEventArgs e)
{
UpdateItemHeight();
base.OnPaletteChanged(e);
@@ -1752,9 +1781,12 @@ protected override void OnCausesValidationChanged(EventArgs e)
/// Raises the Paint event.
///
/// An PaintEventArgs that contains the event data.
- protected override void OnPaint(PaintEventArgs e)
+ protected override void OnPaint(PaintEventArgs? e)
{
- Paint?.Invoke(this, e);
+ if ( Paint is not null && e is not null)
+ {
+ Paint.Invoke(this, e);
+ }
base.OnPaint(e);
}
@@ -1825,7 +1857,7 @@ protected override void OnLayout(LayoutEventArgs levent)
// Only use layout logic if control is fully initialized or if being forced
// to allow a relayout or if in design mode.
- if (IsHandleCreated || _forcedLayout || (DesignMode && (_treeView != null)))
+ if (IsHandleCreated || _forcedLayout || (DesignMode))
{
Rectangle fillRect = _layoutFill.FillRect;
_treeView.SetBounds(fillRect.X, fillRect.Y, fillRect.Width, fillRect.Height);
@@ -1924,28 +1956,31 @@ private void UpdateContentFromNode(TreeNode? node)
{
_overrideNormalNode.TreeNode = node;
- if (node != null)
+ if (_contentValues is not null)
{
- // Get information from the node
- _contentValues.ShortText = node.Text;
- _contentValues.LongText = string.Empty;
- _contentValues.Image = null;
- _contentValues.ImageTransparentColor = Color.Empty;
+ if (node is not null)
+ {
+ // Get information from the node
+ _contentValues.ShortText = node.Text;
+ _contentValues.LongText = string.Empty;
+ _contentValues.Image = null;
+ _contentValues.ImageTransparentColor = GlobalStaticValues.EMPTY_COLOR;
- if (node is KryptonTreeNode kryptonNode)
+ if (node is KryptonTreeNode kryptonNode)
+ {
+ // Get long text from the Krypton extension
+ _contentValues.LongText = kryptonNode.LongText;
+ }
+ }
+ else
{
- // Get long text from the Krypton extension
- _contentValues.LongText = kryptonNode.LongText;
+ // Get the text string for the item
+ _contentValues.ShortText = @"A";
+ _contentValues.LongText = string.Empty;
+ _contentValues.Image = null;
+ _contentValues.ImageTransparentColor = GlobalStaticValues.EMPTY_COLOR;
}
}
- else
- {
- // Get the text string for the item
- _contentValues.ShortText = @"A";
- _contentValues.LongText = string.Empty;
- _contentValues.Image = null;
- _contentValues.ImageTransparentColor = Color.Empty;
- }
}
private void UpdateStateAndPalettes()
@@ -1955,24 +1990,15 @@ private void UpdateStateAndPalettes()
// Get the correct palette settings to use
IPaletteDouble doubleState = GetDoubleState();
_treeView.ViewDrawPanel.SetPalettes(doubleState.PaletteBack);
- _drawDockerOuter.SetPalettes(doubleState.PaletteBack, doubleState.PaletteBorder);
+ _drawDockerOuter.SetPalettes(doubleState.PaletteBack, doubleState.PaletteBorder!);
_drawDockerOuter.Enabled = Enabled;
// Find the new state of the main view element
- PaletteState state;
- if (IsActive)
- {
- state = PaletteState.Tracking;
- }
- else
- {
- state = Enabled ? PaletteState.Normal : PaletteState.Disabled;
- }
+ PaletteState state = Enabled ? (IsActive ? PaletteState.Tracking : PaletteState.Normal) : PaletteState.Disabled;
_treeView.ViewDrawPanel.ElementState = state;
_drawDockerOuter.ElementState = state;
_treeView.Font = StateCommon.Node.Content.ShortText.Font;
-
}
}
@@ -1983,8 +2009,8 @@ private int NodeIndent(TreeNode node)
var depth = 0;
// Count depth of our node in tree
- TreeNode current = node;
- while (current != null)
+ TreeNode? current = node;
+ while (current is not null)
{
depth++;
current = current.Parent;
@@ -1999,7 +2025,7 @@ private int NodeIndent(TreeNode node)
return depth * _treeView.Indent;
}
- private void OnTreeViewDrawNode(object sender, DrawTreeNodeEventArgs e)
+ private void OnTreeViewDrawNode(object? sender, DrawTreeNodeEventArgs e)
{
// We cannot do anything without a valid node
if (e.Node == null)
@@ -2058,7 +2084,7 @@ private void OnTreeViewDrawNode(object sender, DrawTreeNodeEventArgs e)
_layoutImageCenterState.Visible = drawStateImage != null;
- // Do we need the check box?
+ // Do we need the checkbox?
_layoutCheckBoxStack.Visible = (StateImageList == null)
&& CheckBoxes
&& (kryptonNode?.IsCheckBoxVisible != false);
@@ -2067,7 +2093,7 @@ private void OnTreeViewDrawNode(object sender, DrawTreeNodeEventArgs e)
_drawCheckBox.CheckState = e.Node.Checked ? CheckState.Checked : CheckState.Unchecked;
}
- // By default the button is in the normal state
+ // By default, the button is in the normal state
PaletteState buttonState;
// Is this item disabled
@@ -2082,17 +2108,39 @@ private void OnTreeViewDrawNode(object sender, DrawTreeNodeEventArgs e)
{
_drawButton.Checked = true;
- buttonState = (e.State & TreeNodeStates.Hot) == TreeNodeStates.Hot
- ? PaletteState.CheckedTracking
- : PaletteState.CheckedNormal;
+ if ((e.State & TreeNodeStates.Hot) == TreeNodeStates.Hot)
+ {
+ buttonState = PaletteState.CheckedTracking;
+ }
+ else if (e.Node.Checked)
+ {
+ buttonState = _layoutCheckBoxStack.Visible
+ ? PaletteState.CheckedPressed
+ : PaletteState.Pressed;
+ }
+ else
+ {
+ buttonState = PaletteState.CheckedNormal;
+ }
}
else
{
_drawButton.Checked = false;
- buttonState = (e.State & TreeNodeStates.Hot) == TreeNodeStates.Hot
- ? PaletteState.Tracking
- : PaletteState.Normal;
+ if ((e.State & TreeNodeStates.Hot) == TreeNodeStates.Hot)
+ {
+ buttonState = PaletteState.Tracking;
+ }
+ else if (e.Node.Checked)
+ {
+ buttonState = _layoutCheckBoxStack.Visible
+ ? PaletteState.CheckedPressed
+ : PaletteState.Pressed;
+ }
+ else
+ {
+ buttonState = PaletteState.Normal;
+ }
}
// Do we need to show item as having the focus
@@ -2100,10 +2148,10 @@ private void OnTreeViewDrawNode(object sender, DrawTreeNodeEventArgs e)
_overrideNormal.Apply = hasFocus;
_overrideTracking.Apply = hasFocus;
- _overridePressed.Apply = hasFocus;
+ _overrideMultiSelect.Apply = hasFocus;
_overrideCheckedTracking.Apply = hasFocus;
_overrideCheckedNormal.Apply = hasFocus;
- _overrideCheckedPressed.Apply = hasFocus;
+ _overrideCheckedMultiSelect.Apply = hasFocus;
}
// Update the view with the calculated state
@@ -2169,7 +2217,7 @@ private void OnTreeViewDrawNode(object sender, DrawTreeNodeEventArgs e)
_treeView.ViewDrawPanel.Render(context);
}
- // Do we have a indent area for drawing plus/minus/lines?
+ // Do we have an indent area for drawing plus/minus/lines?
if (indentBounds.X >= 0)
{
// Do we draw lines between nodes?
@@ -2220,7 +2268,7 @@ private void OnTreeViewDrawNode(object sender, DrawTreeNodeEventArgs e)
// Do we draw any plus/minus images in indent bounds?
if (ShowPlusMinus && (e.Node.Nodes.Count > 0))
{
- Image? drawImage = _redirectImages.GetTreeViewImage(e.Node.IsExpanded);
+ Image? drawImage = _redirectImages!.GetTreeViewImage(e.Node.IsExpanded);
if (drawImage != null)
{
g.DrawImage(drawImage, new Rectangle(indentBounds.X + ((indentBounds.Width - drawImage.Width) / 2) - 1,
@@ -2321,7 +2369,7 @@ private void OnTreeViewDrawNode(object sender, DrawTreeNodeEventArgs e)
}
}
- private void OnTreeViewGotFocus(object sender, EventArgs e)
+ private void OnTreeViewGotFocus(object? sender, EventArgs e)
{
UpdateStateAndPalettes();
_treeView.Invalidate();
@@ -2329,7 +2377,7 @@ private void OnTreeViewGotFocus(object sender, EventArgs e)
OnGotFocus(e);
}
- private void OnTreeViewLostFocus(object sender, EventArgs e)
+ private void OnTreeViewLostFocus(object? sender, EventArgs e)
{
UpdateStateAndPalettes();
_treeView.Invalidate();
@@ -2337,47 +2385,47 @@ private void OnTreeViewLostFocus(object sender, EventArgs e)
OnLostFocus(e);
}
- private void OnTreeViewKeyPress(object sender, KeyPressEventArgs e) => OnKeyPress(e);
+ private void OnTreeViewKeyPress(object? sender, KeyPressEventArgs e) => OnKeyPress(e);
- private void OnTreeViewKeyUp(object sender, KeyEventArgs e) => OnKeyUp(e);
+ private void OnTreeViewKeyUp(object? sender, KeyEventArgs e) => OnKeyUp(e);
- private void OnTreeViewKeyDown(object sender, KeyEventArgs e) => OnKeyDown(e);
+ private void OnTreeViewKeyDown(object? sender, KeyEventArgs e) => OnKeyDown(e);
- private void OnTreeViewPreviewKeyDown(object sender, PreviewKeyDownEventArgs e) => OnPreviewKeyDown(e);
+ private void OnTreeViewPreviewKeyDown(object? sender, PreviewKeyDownEventArgs e) => OnPreviewKeyDown(e);
- private void OnTreeViewValidated(object sender, EventArgs e) => OnValidated(e);
+ private void OnTreeViewValidated(object? sender, EventArgs e) => OnValidated(e);
- private void OnTreeViewValidating(object sender, CancelEventArgs e) => OnValidating(e);
+ private void OnTreeViewValidating(object? sender, CancelEventArgs e) => OnValidating(e);
- private void OnTreeViewNodeMouseHover(object sender, TreeNodeMouseHoverEventArgs e) => OnNodeMouseHover(e);
+ private void OnTreeViewNodeMouseHover(object? sender, TreeNodeMouseHoverEventArgs e) => OnNodeMouseHover(e);
- private void OnTreeViewNodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) => OnNodeMouseDoubleClick(e);
+ private void OnTreeViewNodeMouseDoubleClick(object? sender, TreeNodeMouseClickEventArgs e) => OnNodeMouseDoubleClick(e);
- private void OnTreeViewNodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) => OnNodeMouseClick(e);
+ private void OnTreeViewNodeMouseClick(object? sender, TreeNodeMouseClickEventArgs e) => OnNodeMouseClick(e);
- private void OnTreeViewItemDrag(object sender, ItemDragEventArgs e) => OnItemDrag(e);
+ private void OnTreeViewItemDrag(object? sender, ItemDragEventArgs e) => OnItemDrag(e);
- private void OnTreeViewBeforeSelect(object sender, TreeViewCancelEventArgs e) => OnBeforeSelect(e);
+ private void OnTreeViewBeforeSelect(object? sender, TreeViewCancelEventArgs e) => OnBeforeSelect(e);
- private void OnTreeViewBeforeLabelEdit(object sender, NodeLabelEditEventArgs e) => OnBeforeLabelEdit(e);
+ private void OnTreeViewBeforeLabelEdit(object? sender, NodeLabelEditEventArgs e) => OnBeforeLabelEdit(e);
- private void OnTreeViewBeforeExpand(object sender, TreeViewCancelEventArgs e) => OnBeforeExpand(e);
+ private void OnTreeViewBeforeExpand(object? sender, TreeViewCancelEventArgs e) => OnBeforeExpand(e);
- private void OnTreeViewBeforeCollapse(object sender, TreeViewCancelEventArgs e) => OnBeforeCollapse(e);
+ private void OnTreeViewBeforeCollapse(object? sender, TreeViewCancelEventArgs e) => OnBeforeCollapse(e);
- private void OnTreeViewBeforeCheck(object sender, TreeViewCancelEventArgs e) => OnBeforeCheck(e);
+ private void OnTreeViewBeforeCheck(object? sender, TreeViewCancelEventArgs e) => OnBeforeCheck(e);
- private void OnTreeViewAfterSelect(object sender, TreeViewEventArgs e) => OnAfterSelect(e);
+ private void OnTreeViewAfterSelect(object? sender, TreeViewEventArgs e) => OnAfterSelect(e);
- private void OnTreeViewAfterLabelEdit(object sender, NodeLabelEditEventArgs e) => OnAfterLabelEdit(e);
+ private void OnTreeViewAfterLabelEdit(object? sender, NodeLabelEditEventArgs e) => OnAfterLabelEdit(e);
- private void OnTreeViewAfterExpand(object sender, TreeViewEventArgs e) => OnAfterExpand(e);
+ private void OnTreeViewAfterExpand(object? sender, TreeViewEventArgs e) => OnAfterExpand(e);
- private void OnTreeViewAfterCollapse(object sender, TreeViewEventArgs e) => OnAfterCollapse(e);
+ private void OnTreeViewAfterCollapse(object? sender, TreeViewEventArgs e) => OnAfterCollapse(e);
- private void OnTreeViewAfterCheck(object sender, TreeViewEventArgs e) => OnAfterCheck(e);
+ private void OnTreeViewAfterCheck(object? sender, TreeViewEventArgs e) => OnAfterCheck(e);
- private void OnTreeViewMouseChange(object sender, EventArgs e)
+ private void OnTreeViewMouseChange(object? sender, EventArgs e)
{
// Change in tracking state?
if (_treeView.MouseOver != _trackingMouseEnter)
@@ -2398,23 +2446,9 @@ private void OnTreeViewMouseChange(object sender, EventArgs e)
}
}
- private void OnDoubleClick(object sender, EventArgs e) => base.OnDoubleClick(e);
-
- private void OnMouseDoubleClick(object sender, MouseEventArgs e) => base.OnMouseDoubleClick(e);
-
- private void SetCornerRoundingRadius(float? radius)
- {
- _cornerRoundingRadius = radius ?? GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
-
- StateCommon.Border.Rounding = _cornerRoundingRadius;
- }
-
- private void SetNodeCornerRoundingRadius(float? radius)
- {
- _nodeCornerRoundingRadius = radius ?? GlobalStaticValues.SECONDARY_CORNER_ROUNDING_VALUE;
+ private void OnDoubleClick(object? sender, EventArgs e) => base.OnDoubleClick(e);
- StateCommon.Node.Border.Rounding = _nodeCornerRoundingRadius;
- }
+ private void OnMouseDoubleClick(object? sender, MouseEventArgs e) => base.OnMouseDoubleClick(e);
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonWebBrowser.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonWebBrowser.cs
index fd7a3e097..4366040bc 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonWebBrowser.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonWebBrowser.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -23,7 +23,7 @@ namespace Krypton.Toolkit
public class KryptonWebBrowser : WebBrowser
{
#region Instance Fields
- private PaletteBase? _palette;
+ private PaletteBase _palette;
private readonly PaletteMode _paletteMode = PaletteMode.Global;
private KryptonContextMenu? _kryptonContextMenu;
private IRenderer _renderer;
@@ -125,13 +125,13 @@ public KryptonContextMenu? KryptonContextMenu
}
}
- private void OnContextMenuStripOpening(object sender, CancelEventArgs e)
+ private void OnContextMenuStripOpening(object? sender, CancelEventArgs e)
{
// Get the actual strip instance
- ContextMenuStrip cms = base.ContextMenuStrip;
+ ContextMenuStrip? cms = base.ContextMenuStrip;
// Make sure it has the correct renderer
- cms.Renderer = CreateToolStripRenderer();
+ cms!.Renderer = CreateToolStripRenderer();
}
@@ -185,7 +185,7 @@ protected override void WndProc(ref Message m)
}
- private void OnKryptonContextMenuDisposed(object sender, EventArgs e) =>
+ private void OnKryptonContextMenuDisposed(object? sender, EventArgs e) =>
// When the current krypton context menu is disposed, we should remove
// it to prevent it being used again, as that would just throw an exception
// because it has been disposed.
@@ -197,7 +197,7 @@ private void OnKryptonContextMenuDisposed(object sender, EventArgs e) =>
/// Sets the palette being used.
/// The chosen palette.
- private void SetPalette(PaletteBase? palette)
+ private void SetPalette(PaletteBase palette)
{
if (palette != _palette)
{
@@ -226,7 +226,7 @@ private void SetPalette(PaletteBase? palette)
/// Called when there is a change in base renderer or base palette.
/// The sender.
/// The instance containing the event data.
- private void OnBaseChanged(object sender, EventArgs e) =>
+ private void OnBaseChanged(object? sender, EventArgs e) =>
// Change in base renderer or base palette require we fetch the latest renderer
_renderer = _palette.GetRenderer();
@@ -258,7 +258,7 @@ protected virtual void OnGlobalPaletteChanged(object sender, EventArgs e)
///
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
- public PaletteBase? 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 41a010b83..8762f76db 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonWrapLabel.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonWrapLabel.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -428,7 +428,7 @@ public IRenderer? Renderer
///
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Advanced)]
- public ToolStripRenderer? CreateToolStripRenderer() => Renderer?.RenderToolStrip(GetResolvedPalette());
+ public ToolStripRenderer? CreateToolStripRenderer() => Renderer?.RenderToolStrip(GetResolvedPalette()!);
///
/// Update the font property.
@@ -461,10 +461,10 @@ public void UpdateFont()
font ??= StateCommon.Font ?? _redirector.GetContentShortTextFont(_labelContentStyle, ps);
// Recover text color from state common or as last resort the inherited palette
- if (textColor == Color.Empty)
+ if (textColor == GlobalStaticValues.EMPTY_COLOR)
{
textColor = StateCommon.TextColor;
- if (textColor == Color.Empty)
+ if (textColor == GlobalStaticValues.EMPTY_COLOR)
{
textColor = _redirector.GetContentShortTextColor1(_labelContentStyle, ps);
}
@@ -562,10 +562,10 @@ protected override void OnPaint(PaintEventArgs e)
font ??= StateCommon.Font ?? _redirector.GetContentShortTextFont(_labelContentStyle, ps);
// Recover text color from state common or as last resort the inherited palette
- if (textColor == Color.Empty)
+ if (textColor == GlobalStaticValues.EMPTY_COLOR)
{
textColor = StateCommon.TextColor;
- if (textColor == Color.Empty)
+ if (textColor == GlobalStaticValues.EMPTY_COLOR)
{
textColor = _redirector.GetContentShortTextColor1(_labelContentStyle, ps);
}
@@ -609,13 +609,13 @@ protected override void OnPaintBackground(PaintEventArgs? pEvent)
_miPtb = typeof(Control).GetMethod("PaintTransparentBackground",
BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.InvokeMethod,
null, CallingConventions.HasThis,
- new[] { typeof(PaintEventArgs), typeof(Rectangle), typeof(Region) },
+ [typeof(PaintEventArgs), typeof(Rectangle), typeof(Region)],
null);
}
if (pEvent != null)
{
- _miPtb?.Invoke(this, new object[] { pEvent, ClientRectangle, null });
+ _miPtb?.Invoke(this, [pEvent, ClientRectangle, null]);
}
}
else
@@ -789,7 +789,7 @@ private void SetPalette(PaletteBase? palette)
if (palette != _palette)
{
// Unhook from current palette events
- if (_palette != null)
+ if (_palette is not null)
{
_palette.PalettePaint -= OnPaletteNeedPaint;
_palette.BasePaletteChanged -= OnBaseChanged;
@@ -797,13 +797,13 @@ private void SetPalette(PaletteBase? palette)
}
// Remember the new palette
- _palette = palette;
+ _palette = palette!;
// Get the renderer associated with the palette
- Renderer = _palette?.GetRenderer();
+ Renderer = _palette?.GetRenderer()!;
// Hook to new palette events
- if (_palette != null)
+ if (_palette is not null)
{
_palette.PalettePaint += OnPaletteNeedPaint;
_palette.BasePaletteChanged += OnBaseChanged;
@@ -812,15 +812,15 @@ private void SetPalette(PaletteBase? palette)
}
}
- private void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e) => NeedPaint(e);
+ private void OnPaletteNeedPaint(object? sender, NeedLayoutEventArgs e) => NeedPaint(e);
// Change in base renderer or base palette require we fetch the latest renderer
- private void OnBaseChanged(object sender, EventArgs e) => Renderer = _palette?.GetRenderer();
+ private void OnBaseChanged(object? sender, EventArgs e) => Renderer = _palette?.GetRenderer()!;
/// Called when [global palette changed].
/// The sender.
/// The instance containing the event data.
- private void OnGlobalPaletteChanged(object sender, EventArgs e)
+ private void OnGlobalPaletteChanged(object? sender, EventArgs e)
{
// We only care if we are using the global palette
if (PaletteMode == PaletteMode.Global)
@@ -854,13 +854,13 @@ private void OnContextMenuStripOpening(object sender, CancelEventArgs e)
}
}
- private void OnKryptonContextMenuDisposed(object sender, EventArgs e) =>
+ private void OnKryptonContextMenuDisposed(object? sender, EventArgs e) =>
// When the current krypton context menu is disposed, we should remove
// it to prevent it being used again, as that would just throw an exception
// because it has been disposed.
KryptonContextMenu = null;
- private void OnContextMenuClosed(object sender, ToolStripDropDownClosedEventArgs e) => ContextMenuClosed();
+ private void OnContextMenuClosed(object? sender, ToolStripDropDownClosedEventArgs e) => ContextMenuClosed();
private void NeedPaint(bool layout) => NeedPaint(new NeedLayoutEventArgs(layout));
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/CommonDialogHandler.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/CommonDialogHandler.cs
index adfab9218..5ee9f83e5 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/CommonDialogHandler.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/CommonDialogHandler.cs
@@ -2,14 +2,12 @@
/*
*
* 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. 2021 - 2023. All rights reserved.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2021 - 2024. All rights reserved.
*
*/
#endregion
-// To get around bug in .NET 8, Preview 7
-// TODO: Remove when .NET 8 is GA
-#if NET8_0
+#if NET8_0_OR_GREATER
using MethodInvoker = System.Windows.Forms.MethodInvoker;
#endif
@@ -20,7 +18,6 @@ namespace Krypton.Toolkit
internal class CommonDialogHandler
{
private readonly bool _embed;
- private readonly KryptonManager _kryptonManager;
internal class Attributes
{
@@ -34,7 +31,7 @@ internal class Attributes
public VisualControlBase? Button { get; set; }
}
- private readonly List _controls = new List();
+ private readonly List _controls = [];
internal readonly Color _backColour;
private readonly Color _defaultFontColour;
private readonly Color _inputFontColour;
@@ -49,11 +46,11 @@ public CommonDialogHandler(bool embed)
{
_embed = embed;
// Gain access to the global palette
- _kryptonManager = new KryptonManager();
- _backColour = _kryptonManager.GlobalPalette!.GetBackColor1(PaletteBackStyle.PanelClient, PaletteState.Normal);
- _defaultFontColour = _kryptonManager.GlobalPalette.GetContentShortTextColor1(PaletteContentStyle.LabelNormalPanel, PaletteState.Normal);
- _inputFontColour = _kryptonManager.GlobalPalette.GetContentShortTextColor1(PaletteContentStyle.InputControlStandalone, PaletteState.Normal);
- _labelFont = _kryptonManager.GlobalPalette.GetContentShortTextFont(PaletteContentStyle.LabelNormalPanel, PaletteState.Normal);
+ var igp = KryptonManager.CurrentGlobalPalette;
+ _backColour = igp.GetBackColor1(PaletteBackStyle.PanelClient, PaletteState.Normal);
+ _defaultFontColour = igp.GetContentShortTextColor1(PaletteContentStyle.LabelNormalPanel, PaletteState.Normal);
+ _inputFontColour = igp.GetContentShortTextColor1(PaletteContentStyle.InputControlStandalone, PaletteState.Normal);
+ _labelFont = igp.GetContentShortTextFont(PaletteContentStyle.LabelNormalPanel, PaletteState.Normal)!;
}
internal string Title { get; set; }
@@ -113,8 +110,8 @@ public CommonDialogHandler(bool embed)
var labelLogFont = _labelFont.ToHfont();
//var buttonFont = _kryptonManager.GlobalPalette.GetContentShortTextFont(PaletteContentStyle.ButtonStandalone, PaletteState.Normal);
//var buttonLogFont = buttonFont.ToHfont();
- var editFont = _kryptonManager.GlobalPalette.GetContentShortTextFont(PaletteContentStyle.InputControlStandalone, PaletteState.Normal);
- var editLogFont = editFont.ToHfont();
+ var editFont = KryptonManager.CurrentGlobalPalette.GetContentShortTextFont(PaletteContentStyle.InputControlStandalone, PaletteState.Normal);
+ var editLogFont = editFont!.ToHfont();
foreach (Attributes control in _controls)
{
switch (control.ClassName)
@@ -202,7 +199,7 @@ public CommonDialogHandler(bool embed)
Text = control.Text,
Dock = DockStyle.Fill,
LabelStyle = LabelStyle.NormalPanel,
- Enabled = (control.WinInfo.dwStyle & PI.WS_.DISABLED) == 0,
+ Enabled = (control.WinInfo.dwStyle & PI.WS_.DISABLED) == 0
};
panel.Controls.Add(button);
control.Button = button;
@@ -235,7 +232,7 @@ public CommonDialogHandler(bool embed)
Text = control.Text,
Dock = DockStyle.Fill,
LabelStyle = LabelStyle.NormalPanel,
- Enabled = (control.WinInfo.dwStyle & PI.WS_.DISABLED) == 0,
+ Enabled = (control.WinInfo.dwStyle & PI.WS_.DISABLED) == 0
};
panel.Controls.Add(button);
control.Button = button;
@@ -320,11 +317,11 @@ public CommonDialogHandler(bool embed)
using (Graphics g = Graphics.FromHdc(hdc))
{
- g.SmoothingMode = SmoothingMode.AntiAlias;
- var lineColor = _kryptonManager.GlobalPalette.GetBorderColor1(PaletteBorderStyle.ControlGroupBox, PaletteState.Normal);
+ using var gh = new GraphicsHint(g, PaletteGraphicsHint.AntiAlias);
+ var lineColor = KryptonManager.CurrentGlobalPalette.GetBorderColor1(PaletteBorderStyle.ControlGroupBox, PaletteState.Normal);
DrawRoundedRectangle(g, new Pen(lineColor), new Point(0, 10),
control.Size - new Size(1, 11), 5);
- var font = _kryptonManager.GlobalPalette.GetContentShortTextFont(PaletteContentStyle.LabelNormalPanel, PaletteState.Normal);
+ var font = KryptonManager.CurrentGlobalPalette.GetContentShortTextFont(PaletteContentStyle.LabelNormalPanel, PaletteState.Normal);
TextRenderer.DrawText(g, control.Text, font, new Point(4, 0), _defaultFontColour,
_backColour,
TextFormatFlags.HidePrefix | TextFormatFlags.NoClipping);
@@ -366,8 +363,8 @@ public CommonDialogHandler(bool embed)
// Buttons with these styles are always drawn with the default system colors.
// Drawing push buttons requires several different brushes-face, highlight, and shadow
// but the WM_CTLCOLORBTN message allows only one brush to be returned.
- var fontColour = _kryptonManager.GlobalPalette.GetContentShortTextColor1(PaletteContentStyle.ButtonStandalone, PaletteState.Normal);
- var backColour = _kryptonManager.GlobalPalette.GetBackColor1(PaletteBackStyle.ButtonStandalone, PaletteState.Normal);
+ var fontColour = KryptonManager.CurrentGlobalPalette.GetContentShortTextColor1(PaletteContentStyle.ButtonStandalone, PaletteState.Normal);
+ var backColour = KryptonManager.CurrentGlobalPalette.GetBackColor1(PaletteBackStyle.ButtonStandalone, PaletteState.Normal);
PI.SetTextColor(wParam, ColorTranslator.ToWin32(fontColour));
PI.SetDCBrushColor(wParam, ColorTranslator.ToWin32(backColour));
PI.SetBkMode(wParam, ColorTranslator.ToWin32(Color.Transparent));
@@ -427,6 +424,7 @@ private void PerformEmbedding(IntPtr hWnd)
Padding = new Padding(0),
TopMost = true
};
+
if (ShowIcon)
{
_wrapperForm.FormBorderStyle = _isResizable ? FormBorderStyle.Sizable : FormBorderStyle.Fixed3D;
@@ -455,7 +453,7 @@ private void PerformEmbedding(IntPtr hWnd)
else
{
_resizeHandle = hWnd;
- _wrapperForm.Resize += FormResize!;
+ _wrapperForm.Resize += FormResize;
}
var wrapperParent = PI.GetParent(hWnd);
@@ -477,7 +475,7 @@ private void PerformEmbedding(IntPtr hWnd)
}
}
- private void OnResizeTimedEvent(object sender, ElapsedEventArgs e)
+ private void OnResizeTimedEvent(object? sender, ElapsedEventArgs e)
{
_resizeTimer.Dispose();
if (_wrapperForm != null)
@@ -493,14 +491,16 @@ private void OnResizeTimedEvent(object sender, ElapsedEventArgs e)
}
}
- private void FormResize(object sender, EventArgs e)
+ private void FormResize(object? sender, EventArgs e)
{
if (_resizeHandle != IntPtr.Zero)
{
if (_wrapperForm != null)
{
var clientSize = _wrapperForm.ClientSize;
- PI.MoveWindow(_resizeHandle, 0, 0, clientSize.Width, clientSize.Height, false);
+ _wrapperForm.SuspendLayout();
+ PI.MoveWindow(_resizeHandle, 0, 0, clientSize.Width, clientSize.Height, true);
+ _wrapperForm.ResumeLayout(false);
}
}
}
@@ -521,7 +521,7 @@ private static bool EnumerateChildWindow(IntPtr hWnd, IntPtr lParam)
private static void DrawRoundedRectangle(Graphics g, Pen pen, Point location, Size size, int radius)
{
- g.SmoothingMode = SmoothingMode.AntiAlias;
+ using var gh = new GraphicsHint(g, PaletteGraphicsHint.AntiAlias);
var roundRect = new RoundedRectangleF(size.Width, size.Height, radius, location.X, location.Y);
g.DrawPath(pen, roundRect.Path);
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonInputBoxForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonInputBoxForm.cs
deleted file mode 100644
index dfdd4111c..000000000
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonInputBoxForm.cs
+++ /dev/null
@@ -1,158 +0,0 @@
-#region BSD License
-/*
- *
- * Original BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE)
- * © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
- *
- * New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
- *
- */
-#endregion
-
-namespace Krypton.Toolkit
-{
- ///
- ///
- ///
- public partial class KryptonInputBoxForm : KryptonForm
- {
- #region Instance Fields
- private bool _usePasswordOption;
- private Color _cueColour;
- private string _prompt;
- private string _caption;
- private string _defaultResponse;
- private string _cueText;
- private Font? _cueTypeface;
- #endregion
-
- #region Identity
-
- ///
- ///
- ///
- public KryptonInputBoxForm()
- {
- InitializeComponent();
- }
-
- /// Initializes a new instance of the class.
- /// The prompt.
- /// The caption.
- /// The default response.
- /// The cue text.
- /// The cue colour.
- /// The cue typeface.
- /// if set to true [use password option].
- public KryptonInputBoxForm(string prompt,
- string caption,
- string defaultResponse,
- string cueText,
- Color cueColour,
- Font? cueTypeface,
- bool usePasswordOption)
- {
- InitializeComponent();
-
- StoreValues(prompt, caption, defaultResponse, cueText, cueColour, cueTypeface, usePasswordOption);
-
- // Update contents to match requirements
- UpdateText();
-
- UpdateCue();
-
- UpdateButtons();
- }
-
- #endregion
-
- #region Implementation
-
- private void StoreValues(string prompt, string caption, string defaultResponse, string cueText, Color cueColour,
- Font? cueTypeface, bool usePasswordOption)
- {
- _prompt = prompt;
-
- _caption = caption;
-
- _defaultResponse = defaultResponse;
-
- _cueText = cueText;
-
- _cueColour = cueColour;
-
- _cueTypeface = cueTypeface;
-
- _usePasswordOption = usePasswordOption;
- }
-
- internal static string InternalShow(IWin32Window? owner,
- string prompt,
- string caption,
- string defaultResponse,
- string cueText,
- Color cueColour,
- Font? cueTypeface,
- bool usePasswordOption)
- {
- // If do not have an owner passed in then get the active window and use that instead
- IWin32Window? showOwner = owner ?? FromHandle(PI.GetActiveWindow());
-
- // Show input box window as a modal dialog and then dispose of it afterwards
- using var ib = new KryptonInputBoxForm(prompt, caption, defaultResponse, cueText, cueColour,
- cueTypeface, usePasswordOption);
- ib.StartPosition = showOwner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
-
- return ib.ShowDialog(showOwner) == DialogResult.OK
- ? ib.InputResponse
- : string.Empty;
- }
-
- internal string InputResponse => _textBoxResponse.Text;
-
- private void UpdateText()
- {
- Text = _caption;
- _labelPrompt.Text = _prompt;
- _textBoxResponse.Text = _defaultResponse;
- _textBoxResponse.UseSystemPasswordChar = _usePasswordOption;
- }
-
- private void UpdateCue()
- {
- _textBoxResponse.CueHint.CueHintText = _cueText;
-
- if (!_cueColour.IsEmpty)
- {
- _textBoxResponse.CueHint.Color1 = _cueColour;
- }
-
- if (_cueTypeface != null)
- {
- _textBoxResponse.CueHint.Font = _cueTypeface;
- }
- }
-
- private void UpdateButtons()
- {
- _buttonOk.Text = KryptonLanguageManager.GeneralToolkitStrings.OK;
- _buttonCancel.Text = KryptonLanguageManager.GeneralToolkitStrings.Cancel;
- }
-
- private void Response_KeyDown(object sender, KeyEventArgs e)
- {
- switch (e.KeyCode)
- {
- case Keys.Enter:
- _buttonOk.PerformClick();
- break;
- case Keys.Escape:
- _buttonCancel.PerformClick();
- break;
- }
- }
-
- #endregion
- }
-}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonThemeBrowserForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonThemeBrowserForm.Designer.cs
deleted file mode 100644
index 7e8fb383b..000000000
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonThemeBrowserForm.Designer.cs
+++ /dev/null
@@ -1,200 +0,0 @@
-namespace Krypton.Toolkit
-{
- partial class KryptonThemeBrowserForm
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- this.kcpbCustom = new Krypton.Toolkit.KryptonCustomPaletteBase(this.components);
- this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel();
- this.klblSelectedIndex = new Krypton.Toolkit.KryptonLabel();
- this.kchkSilent = new Krypton.Toolkit.KryptonCheckBox();
- this.kbtnOK = new Krypton.Toolkit.KryptonButton();
- this.kbtnCancel = new Krypton.Toolkit.KryptonButton();
- this.kbtnImport = new Krypton.Toolkit.KryptonButton();
- this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
- this.kryptonPanel2 = new Krypton.Toolkit.KryptonPanel();
- this.klblDescription = new Krypton.Toolkit.KryptonLabel();
- this.klbThemeList = new Krypton.Toolkit.KryptonListBox();
- ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
- this.kryptonPanel1.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit();
- this.kryptonPanel2.SuspendLayout();
- this.SuspendLayout();
- //
- // kcpbCustom
- //
- this.kcpbCustom.BaseFont = new System.Drawing.Font("Segoe UI", 9F);
- this.kcpbCustom.BaseFontSize = 9F;
- this.kcpbCustom.BasePaletteMode = Krypton.Toolkit.PaletteMode.Microsoft365Blue;
- this.kcpbCustom.BasePaletteType = Krypton.Toolkit.BasePaletteType.Custom;
- this.kcpbCustom.ThemeName = null;
- this.kcpbCustom.UseKryptonFileDialogs = true;
- //
- // kryptonPanel1
- //
- this.kryptonPanel1.Controls.Add(this.klblSelectedIndex);
- this.kryptonPanel1.Controls.Add(this.kchkSilent);
- this.kryptonPanel1.Controls.Add(this.kbtnOK);
- this.kryptonPanel1.Controls.Add(this.kbtnCancel);
- this.kryptonPanel1.Controls.Add(this.kbtnImport);
- this.kryptonPanel1.Controls.Add(this.kryptonBorderEdge1);
- this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Bottom;
- this.kryptonPanel1.Location = new System.Drawing.Point(0, 445);
- this.kryptonPanel1.Name = "kryptonPanel1";
- this.kryptonPanel1.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
- this.kryptonPanel1.Size = new System.Drawing.Size(800, 50);
- this.kryptonPanel1.TabIndex = 0;
- //
- // klblSelectedIndex
- //
- this.klblSelectedIndex.LabelStyle = Krypton.Toolkit.LabelStyle.NormalPanel;
- this.klblSelectedIndex.Location = new System.Drawing.Point(170, 13);
- this.klblSelectedIndex.Name = "klblSelectedIndex";
- this.klblSelectedIndex.Size = new System.Drawing.Size(6, 2);
- this.klblSelectedIndex.TabIndex = 15;
- this.klblSelectedIndex.Values.Text = "";
- this.klblSelectedIndex.Visible = false;
- //
- // kchkSilent
- //
- this.kchkSilent.Location = new System.Drawing.Point(109, 16);
- this.kchkSilent.Name = "kchkSilent";
- this.kchkSilent.Size = new System.Drawing.Size(54, 20);
- this.kchkSilent.TabIndex = 13;
- this.kchkSilent.Values.Text = "&Silent";
- //
- // kbtnOK
- //
- this.kbtnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
- this.kbtnOK.Location = new System.Drawing.Point(602, 13);
- this.kbtnOK.Name = "kbtnOK";
- this.kbtnOK.Size = new System.Drawing.Size(90, 25);
- this.kbtnOK.TabIndex = 3;
- this.kbtnOK.UseAsADialogButton = true;
- this.kbtnOK.Values.Text = "O&K";
- this.kbtnOK.Click += new System.EventHandler(this.kbtnOK_Click);
- //
- // kbtnCancel
- //
- this.kbtnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- this.kbtnCancel.Location = new System.Drawing.Point(698, 13);
- this.kbtnCancel.Name = "kbtnCancel";
- this.kbtnCancel.Size = new System.Drawing.Size(90, 25);
- this.kbtnCancel.TabIndex = 2;
- this.kbtnCancel.UseAsADialogButton = true;
- this.kbtnCancel.Values.Text = "Cance&l";
- this.kbtnCancel.Click += new System.EventHandler(this.kbtnCancel_Click);
- //
- // kbtnImport
- //
- this.kbtnImport.Location = new System.Drawing.Point(13, 13);
- this.kbtnImport.Name = "kbtnImport";
- this.kbtnImport.Size = new System.Drawing.Size(90, 25);
- this.kbtnImport.TabIndex = 1;
- this.kbtnImport.Values.Text = "&Import...";
- this.kbtnImport.Click += new System.EventHandler(this.kbtnImport_Click);
- //
- // kryptonBorderEdge1
- //
- this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderSecondary;
- this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
- this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
- this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
- this.kryptonBorderEdge1.Size = new System.Drawing.Size(800, 1);
- this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
- //
- // kryptonPanel2
- //
- this.kryptonPanel2.Controls.Add(this.klblDescription);
- this.kryptonPanel2.Controls.Add(this.klbThemeList);
- this.kryptonPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
- this.kryptonPanel2.Location = new System.Drawing.Point(0, 0);
- this.kryptonPanel2.Name = "kryptonPanel2";
- this.kryptonPanel2.Size = new System.Drawing.Size(800, 445);
- this.kryptonPanel2.TabIndex = 1;
- //
- // klblDescription
- //
- this.klblDescription.LabelStyle = Krypton.Toolkit.LabelStyle.NormalPanel;
- this.klblDescription.Location = new System.Drawing.Point(13, 13);
- this.klblDescription.Name = "klblDescription";
- this.klblDescription.Size = new System.Drawing.Size(88, 20);
- this.klblDescription.TabIndex = 1;
- this.klblDescription.Values.Text = "kryptonLabel1";
- //
- // klbThemeList
- //
- this.klbThemeList.Location = new System.Drawing.Point(13, 39);
- this.klbThemeList.Name = "klbThemeList";
- this.klbThemeList.Size = new System.Drawing.Size(775, 400);
- this.klbThemeList.TabIndex = 0;
- this.klbThemeList.SelectedIndexChanged += new System.EventHandler(this.klbThemeList_SelectedIndexChanged);
- //
- // KryptonThemeBrowserForm
- //
- this.AcceptButton = this.kbtnOK;
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.CancelButton = this.kbtnCancel;
- this.ClientSize = new System.Drawing.Size(800, 495);
- this.Controls.Add(this.kryptonPanel2);
- this.Controls.Add(this.kryptonPanel1);
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
- this.MaximizeBox = false;
- this.MinimizeBox = false;
- this.Name = "KryptonThemeBrowserForm";
- this.ShowIcon = false;
- this.ShowInTaskbar = false;
- this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
- this.Text = "Select a Theme";
- this.Load += new System.EventHandler(this.KryptonThemeBrowserForm_Load);
- ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
- this.kryptonPanel1.ResumeLayout(false);
- this.kryptonPanel1.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit();
- this.kryptonPanel2.ResumeLayout(false);
- this.kryptonPanel2.PerformLayout();
- this.ResumeLayout(false);
-
- }
-
- #endregion
-
- private KryptonCustomPaletteBase kcpbCustom;
- private KryptonPanel kryptonPanel1;
- private KryptonPanel kryptonPanel2;
- private KryptonBorderEdge kryptonBorderEdge1;
- private KryptonButton kbtnImport;
- private KryptonButton kbtnCancel;
- private KryptonListBox klbThemeList;
- private KryptonButton kbtnOK;
- private KryptonCheckBox kchkSilent;
- private KryptonLabel klblDescription;
- private KryptonLabel klblSelectedIndex;
- }
-}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonThemeBrowserForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonThemeBrowserForm.cs
deleted file mode 100644
index dfca5cc17..000000000
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonThemeBrowserForm.cs
+++ /dev/null
@@ -1,103 +0,0 @@
-#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. 2023 - 2023. All rights reserved.
- *
- */
-#endregion
-
-namespace Krypton.Toolkit
-{
- public partial class KryptonThemeBrowserForm : KryptonForm
- {
- #region Instance Fields
-
- private readonly bool _showImportButton;
- private readonly bool _showSilentOption;
- private readonly FormStartPosition _formStartPosition;
- private readonly int _startIndex;
- private readonly string _windowTitle;
-
- #endregion
-
- #region Identity
-
- /// Initializes a new instance of the class.
- /// The start position.
- /// The start index.
- /// The window title.
- /// The show import button.
- /// The show silent option.
- public KryptonThemeBrowserForm(FormStartPosition startPosition = FormStartPosition.CenterScreen, int startIndex = 34, string? windowTitle = null, bool? showImportButton = null, bool? showSilentOption = null)
- {
- InitializeComponent();
-
- _showImportButton = showImportButton ?? false;
-
- _showSilentOption = showSilentOption ?? false;
-
- _formStartPosition = startPosition;
-
- _startIndex = startIndex;
-
- _windowTitle = windowTitle ?? KryptonLanguageManager.MiscellaneousThemeStrings.ThemeBrowserWindowTitle;
-
- AdjustUI();
- }
-
- #endregion
-
- #region Implementation
-
- private void AdjustUI()
- {
- Text = _windowTitle;
-
- kbtnImport.Visible = _showImportButton;
-
- kchkSilent.Visible = _showSilentOption;
-
- StartPosition = _formStartPosition;
-
- klblDescription.Text = KryptonLanguageManager.MiscellaneousThemeStrings.ThemeBrowserDescription;
-
- kbtnImport.Text = KryptonLanguageManager.MiscellaneousThemeStrings.Import;
-
- kchkSilent.Text = KryptonLanguageManager.MiscellaneousThemeStrings.Silent;
-
- kbtnCancel.Text = KryptonLanguageManager.GeneralToolkitStrings.Cancel;
-
- kbtnOK.Text = KryptonLanguageManager.GeneralToolkitStrings.OK;
- }
-
- private void kbtnImport_Click(object sender, EventArgs e) => kcpbCustom.Import(kchkSilent.Checked);
-
- private void KryptonThemeBrowserForm_Load(object sender, EventArgs e)
- {
- foreach (string? themeName in ThemeManager.SupportedInternalThemeNames)
- {
- if (themeName != null)
- {
- klbThemeList.Items.Add(themeName);
- }
- }
-
- klbThemeList.SelectedItem = _startIndex;
- }
-
- private void kbtnOK_Click(object sender, EventArgs e) => DialogResult = DialogResult.OK;
-
- private void kbtnCancel_Click(object sender, EventArgs e) => DialogResult = DialogResult.Cancel;
-
- private void klbThemeList_SelectedIndexChanged(object sender, EventArgs e)
- {
- ThemeManager.ApplyTheme(klbThemeList.GetItemText(klbThemeList.SelectedItem), new());
-
- SetIndexText($@"{klbThemeList.GetItemText(klbThemeList.SelectedItem)} - Index: {klbThemeList.SelectedIndex}");
- }
-
- private void SetIndexText(string v) => klblSelectedIndex.Text = v;
-
- #endregion
- }
-}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Base/VisualToastNotificationBaseForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Base/VisualToastNotificationBaseForm.Designer.cs
new file mode 100644
index 000000000..66a80bad7
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Base/VisualToastNotificationBaseForm.Designer.cs
@@ -0,0 +1,47 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualToastNotificationBaseForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.SuspendLayout();
+ //
+ // VisualToastNotificationBaseForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(800, 450);
+ this.Name = "VisualToastNotificationBaseForm";
+ this.Text = "VisualToastNotificationBaseForm";
+ this.Load += new System.EventHandler(this.VisualToastNotificationBaseForm_Load);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Base/VisualToastNotificationBaseForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Base/VisualToastNotificationBaseForm.cs
new file mode 100644
index 000000000..d15eb70b8
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Base/VisualToastNotificationBaseForm.cs
@@ -0,0 +1,116 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualToastNotificationBaseForm : KryptonForm
+ {
+ #region Instance Fields
+
+ private KryptonToastNotificationResult _notificationResult;
+
+ #endregion
+
+ #region Public
+
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public new DialogResult DialogResult
+ {
+ get => base.DialogResult;
+
+ set => base.DialogResult = value;
+ }
+
+ /// Gets or sets the notification result.
+ /// The notification result.
+ [Category(@"Behaviour")]
+ [Description(@"")]
+ [DefaultValue(KryptonToastNotificationResult.None)]
+ public KryptonToastNotificationResult NotificationResult
+ {
+ get => _notificationResult;
+
+ set => _notificationResult = value;
+ }
+
+ #endregion
+
+ #region Identity
+
+ /// Initializes a new instance of the class.
+ public VisualToastNotificationBaseForm()
+ {
+ InitializeComponent();
+
+ _notificationResult = KryptonToastNotificationResult.None;
+
+ Text = string.Empty;
+ }
+
+ #endregion
+
+ #region Protected
+
+ protected KryptonToastNotificationResult ShowToastNotificationResult(IWin32Window? owner)
+ {
+ var result = _notificationResult;
+
+ switch (result)
+ {
+ case KryptonToastNotificationResult.None:
+ DialogResult = DialogResult.None;
+ break;
+ case KryptonToastNotificationResult.Ok:
+ break;
+ case KryptonToastNotificationResult.Cancel:
+ break;
+ case KryptonToastNotificationResult.Abort:
+ break;
+ case KryptonToastNotificationResult.Retry:
+ break;
+ case KryptonToastNotificationResult.Ignore:
+ break;
+ case KryptonToastNotificationResult.Yes:
+ break;
+ case KryptonToastNotificationResult.No:
+ break;
+ case KryptonToastNotificationResult.Close:
+ break;
+ case KryptonToastNotificationResult.Help:
+ break;
+ case KryptonToastNotificationResult.TryAgain:
+ break;
+ case KryptonToastNotificationResult.Continue:
+ break;
+ case KryptonToastNotificationResult.TimeOut:
+ break;
+ case KryptonToastNotificationResult.DoNotShowAgain:
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+
+ return result;
+ }
+
+ protected KryptonToastNotificationResult ShowToastNotificationResult() => ShowToastNotificationResult(null);
+
+ #endregion
+
+ #region Implementation
+
+ private void VisualToastNotificationBaseForm_Load(object sender, EventArgs e)
+ {
+
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonInputBoxForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Base/VisualToastNotificationBaseForm.resx
similarity index 100%
rename from Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonInputBoxForm.resx
rename to Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Base/VisualToastNotificationBaseForm.resx
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Basic/LTR/VisualToastNotificationBasicForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Basic/LTR/VisualToastNotificationBasicForm.Designer.cs
new file mode 100644
index 000000000..9bfde5d1f
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Basic/LTR/VisualToastNotificationBasicForm.Designer.cs
@@ -0,0 +1,258 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualToastNotificationBasicForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.kpnlButtons = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnDismiss = new Krypton.Toolkit.KryptonButton();
+ this.klblToastLocation = new Krypton.Toolkit.KryptonLabel();
+ this.kchkDoNotShowAgain = new Krypton.Toolkit.KryptonCheckBox();
+ this.itbDismiss = new Krypton.Toolkit.InternalToastButton();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kryptonPanel2 = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ this.pbxIcon = new System.Windows.Forms.PictureBox();
+ this.kwlblHeader = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kwlblContent = new Krypton.Toolkit.KryptonWrapLabel();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit();
+ this.kpnlButtons.SuspendLayout();
+ this.tableLayoutPanel2.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit();
+ this.kryptonPanel2.SuspendLayout();
+ this.tableLayoutPanel1.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxIcon)).BeginInit();
+ this.SuspendLayout();
+ //
+ // kpnlButtons
+ //
+ this.kpnlButtons.Controls.Add(this.tableLayoutPanel2);
+ this.kpnlButtons.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlButtons.Location = new System.Drawing.Point(0, 129);
+ this.kpnlButtons.Name = "kpnlButtons";
+ this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlButtons.Size = new System.Drawing.Size(447, 50);
+ this.kpnlButtons.TabIndex = 0;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel2.ColumnCount = 4;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.Controls.Add(this.kbtnDismiss, 2, 0);
+ this.tableLayoutPanel2.Controls.Add(this.klblToastLocation, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.kchkDoNotShowAgain, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.itbDismiss, 3, 0);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 1;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(447, 49);
+ this.tableLayoutPanel2.TabIndex = 3;
+ //
+ // kbtnDismiss
+ //
+ this.kbtnDismiss.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnDismiss.AutoSize = true;
+ this.kbtnDismiss.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.kbtnDismiss.Location = new System.Drawing.Point(321, 13);
+ this.kbtnDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnDismiss.Name = "kbtnDismiss";
+ this.kbtnDismiss.Size = new System.Drawing.Size(48, 22);
+ this.kbtnDismiss.TabIndex = 2;
+ this.kbtnDismiss.Values.Text = "{0} ({1})";
+ this.kbtnDismiss.Visible = false;
+ this.kbtnDismiss.Click += new System.EventHandler(this.kbtnDismiss_Click);
+ //
+ // klblToastLocation
+ //
+ this.klblToastLocation.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.klblToastLocation.Location = new System.Drawing.Point(75, 23);
+ this.klblToastLocation.Margin = new System.Windows.Forms.Padding(10);
+ this.klblToastLocation.Name = "klblToastLocation";
+ this.klblToastLocation.Size = new System.Drawing.Size(6, 2);
+ this.klblToastLocation.TabIndex = 3;
+ this.klblToastLocation.Values.Text = "";
+ //
+ // kchkDoNotShowAgain
+ //
+ this.kchkDoNotShowAgain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kchkDoNotShowAgain.Location = new System.Drawing.Point(10, 10);
+ this.kchkDoNotShowAgain.Margin = new System.Windows.Forms.Padding(10);
+ this.kchkDoNotShowAgain.Name = "kchkDoNotShowAgain";
+ this.kchkDoNotShowAgain.Size = new System.Drawing.Size(45, 29);
+ this.kchkDoNotShowAgain.TabIndex = 4;
+ this.kchkDoNotShowAgain.Values.Text = "CB1";
+ this.kchkDoNotShowAgain.Visible = false;
+ //
+ // itbDismiss
+ //
+ this.itbDismiss.AutoSize = true;
+ this.itbDismiss.IsActionButton = false;
+ this.itbDismiss.IsDismissButton = true;
+ this.itbDismiss.Location = new System.Drawing.Point(389, 13);
+ this.itbDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.itbDismiss.Name = "itbDismiss";
+ this.itbDismiss.NotificationResult = Krypton.Toolkit.KryptonToastNotificationResult.None;
+ this.itbDismiss.Owner = null;
+ this.itbDismiss.ProcessPath = "";
+ this.itbDismiss.Size = new System.Drawing.Size(48, 22);
+ this.itbDismiss.TabIndex = 5;
+ this.itbDismiss.Values.Text = "{0} ({1})";
+ this.itbDismiss.Click += new System.EventHandler(this.itbDismiss_Click);
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(447, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kryptonPanel2
+ //
+ this.kryptonPanel2.Controls.Add(this.tableLayoutPanel1);
+ this.kryptonPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kryptonPanel2.Location = new System.Drawing.Point(0, 0);
+ this.kryptonPanel2.Name = "kryptonPanel2";
+ this.kryptonPanel2.Size = new System.Drawing.Size(447, 129);
+ this.kryptonPanel2.TabIndex = 1;
+ //
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel1.ColumnCount = 2;
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.Controls.Add(this.pbxIcon, 0, 0);
+ this.tableLayoutPanel1.Controls.Add(this.kwlblHeader, 1, 0);
+ this.tableLayoutPanel1.Controls.Add(this.kwlblContent, 1, 1);
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 2;
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(447, 129);
+ this.tableLayoutPanel1.TabIndex = 0;
+ //
+ // pbxIcon
+ //
+ this.pbxIcon.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pbxIcon.Location = new System.Drawing.Point(3, 3);
+ this.pbxIcon.Name = "pbxIcon";
+ this.tableLayoutPanel1.SetRowSpan(this.pbxIcon, 2);
+ this.pbxIcon.Size = new System.Drawing.Size(128, 123);
+ this.pbxIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pbxIcon.TabIndex = 0;
+ this.pbxIcon.TabStop = false;
+ //
+ // kwlblHeader
+ //
+ this.kwlblHeader.AutoSize = false;
+ this.kwlblHeader.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlblHeader.Font = new System.Drawing.Font("Segoe UI", 13.5F, System.Drawing.FontStyle.Bold);
+ this.kwlblHeader.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlblHeader.LabelStyle = Krypton.Toolkit.LabelStyle.TitleControl;
+ this.kwlblHeader.Location = new System.Drawing.Point(137, 0);
+ this.kwlblHeader.Name = "kwlblHeader";
+ this.kwlblHeader.Padding = new System.Windows.Forms.Padding(5);
+ this.kwlblHeader.Size = new System.Drawing.Size(307, 50);
+ this.kwlblHeader.Text = "kryptonWrapLabel1";
+ this.kwlblHeader.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // kwlblContent
+ //
+ this.kwlblContent.AutoSize = false;
+ this.kwlblContent.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlblContent.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.kwlblContent.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlblContent.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.kwlblContent.Location = new System.Drawing.Point(137, 50);
+ this.kwlblContent.Name = "kwlblContent";
+ this.kwlblContent.Padding = new System.Windows.Forms.Padding(5);
+ this.kwlblContent.Size = new System.Drawing.Size(307, 79);
+ this.kwlblContent.Text = "kryptonWrapLabel2";
+ this.kwlblContent.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // VisualToastNotificationBasicForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(447, 179);
+ this.Controls.Add(this.kryptonPanel2);
+ this.Controls.Add(this.kpnlButtons);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+ this.FormTitleAlign = Krypton.Toolkit.PaletteRelativeAlign.Inherit;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualToastNotificationBasicForm";
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.StateCommon.Border.DrawBorders = ((Krypton.Toolkit.PaletteDrawBorders)((((Krypton.Toolkit.PaletteDrawBorders.Top | Krypton.Toolkit.PaletteDrawBorders.Bottom)
+ | Krypton.Toolkit.PaletteDrawBorders.Left)
+ | Krypton.Toolkit.PaletteDrawBorders.Right)));
+ this.StateCommon.Border.Width = 2;
+ this.UseThemeFormChromeBorderWidth = false;
+ this.Load += new System.EventHandler(this.VisualToastNotificationBasicForm_Load);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit();
+ this.kpnlButtons.ResumeLayout(false);
+ this.kpnlButtons.PerformLayout();
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit();
+ this.kryptonPanel2.ResumeLayout(false);
+ this.tableLayoutPanel1.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.pbxIcon)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kpnlButtons;
+ private KryptonPanel kryptonPanel2;
+ private TableLayoutPanel tableLayoutPanel1;
+ private PictureBox pbxIcon;
+ private KryptonWrapLabel kwlblHeader;
+ private KryptonWrapLabel kwlblContent;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private TableLayoutPanel tableLayoutPanel2;
+ private KryptonButton kbtnDismiss;
+ private KryptonLabel klblToastLocation;
+ private KryptonCheckBox kchkDoNotShowAgain;
+ private InternalToastButton itbDismiss;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Basic/LTR/VisualToastNotificationBasicForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Basic/LTR/VisualToastNotificationBasicForm.cs
new file mode 100644
index 000000000..1c6e97856
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Basic/LTR/VisualToastNotificationBasicForm.cs
@@ -0,0 +1,429 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+using ContentAlignment = System.Drawing.ContentAlignment;
+using Timer = System.Windows.Forms.Timer;
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualToastNotificationBasicForm : VisualToastNotificationBaseForm
+ {
+ #region Instance Fields
+
+ private int _time;
+
+ private Timer _timer;
+
+ private SoundPlayer? _soundPlayer;
+
+ private PaletteBase _palette;
+
+ private readonly KryptonBasicToastNotificationData _basicToastNotificationData;
+
+ #endregion
+
+ #region Identity
+
+ /// Initializes a new instance of the class.
+ /// The data.
+ public VisualToastNotificationBasicForm(KryptonBasicToastNotificationData data)
+ {
+ _basicToastNotificationData = data;
+
+ InitializeComponent();
+
+ GotFocus += VisualToastNotificationBasicForm_GotFocus;
+
+ Resize += VisualToastNotificationBasicForm_Resize;
+
+ LocationChanged += VisualToastNotificationBasicForm_LocationChanged;
+
+ DoubleBuffered = true;
+
+ UpdateBorderColors();
+
+ /* FadeValues disabled and moved to extended until proven stable. Further development in V100
+ UpdateFadeValues();
+ */
+
+ UpdateFonts();
+
+ ShowDoNotShowAgainOption();
+ }
+
+ #endregion
+
+ #region Public
+
+ internal bool ReturnValue => kchkDoNotShowAgain.Checked;
+
+ internal CheckState ReturnCheckBoxStateValue => kchkDoNotShowAgain.CheckState;
+
+ #endregion
+
+ #region Implementation
+
+ private void UpdateText()
+ {
+ kwlblContent.Text = _basicToastNotificationData.NotificationContent ?? string.Empty;
+
+ kwlblHeader.Text = _basicToastNotificationData.NotificationTitle;
+
+ kwlblHeader.TextAlign =
+ _basicToastNotificationData.NotificationTitleAlignment ?? ContentAlignment.MiddleCenter;
+ }
+
+ private void UpdateBorderColors()
+ {
+ StateCommon!.Border.Color1 = _basicToastNotificationData.BorderColor1 ?? GlobalStaticValues.EMPTY_COLOR;
+
+ StateCommon.Border.Color2 = _basicToastNotificationData.BorderColor2 ?? GlobalStaticValues.EMPTY_COLOR;
+ }
+
+ /* FadeValues disabled and moved to extended until proven stable. Further development in V100
+ private void UpdateFadeValues() => FadeValues.FadingEnabled = _basicToastNotificationData.UseFade;
+ */
+
+ private void UpdateFonts()
+ {
+ kwlblContent.StateCommon.Font = _basicToastNotificationData.NotificationContentFont ??
+ KryptonManager.CurrentGlobalPalette.BaseFont;
+
+ if (_basicToastNotificationData.NotificationTitleFont != null)
+ {
+ kwlblContent.LabelStyle = LabelStyle.NormalControl;
+
+ kwlblHeader.StateCommon.Font =
+ _basicToastNotificationData.NotificationTitleFont ?? _palette.Header1ShortFont;
+ }
+ else
+ {
+ kwlblHeader.LabelStyle = LabelStyle.TitleControl;
+ }
+ }
+
+ private void UpdateIcon()
+ {
+ switch (_basicToastNotificationData.NotificationIcon)
+ {
+ case KryptonToastNotificationIcon.None:
+ SetIcon(null);
+ break;
+ case KryptonToastNotificationIcon.Hand:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Hand_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemHand:
+#if NET8_0_OR_GREATER
+ //SetIcon(GraphicsExtensions.ScaleImage());
+#else
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Hand.ToBitmap(), 128, 128));
+#endif
+ break;
+ case KryptonToastNotificationIcon.Question:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Question_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemQuestion:
+ break;
+ case KryptonToastNotificationIcon.Exclamation:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.SystemExclamation:
+ break;
+ case KryptonToastNotificationIcon.Asterisk:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Asterisk_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemAsterisk:
+ break;
+ case KryptonToastNotificationIcon.Stop:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Stop_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Error:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Critical_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Warning:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.Information:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Shield:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
+ }
+ else if (OSUtilities.IsWindowsTen)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_10_128_x_128);
+ }
+ else
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128);
+ }
+ break;
+ case KryptonToastNotificationIcon.WindowsLogo:
+ break;
+ case KryptonToastNotificationIcon.Application:
+ break;
+ case KryptonToastNotificationIcon.SystemApplication:
+ break;
+ case KryptonToastNotificationIcon.Ok:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Ok_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Custom:
+ SetIcon(_basicToastNotificationData.CustomImage != null
+ ? new Bitmap(_basicToastNotificationData.CustomImage)
+ : null);
+ break;
+ case null:
+ SetIcon(null);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+
+ private void UpdateDoNotShowAgainOptionChecked() =>
+ kchkDoNotShowAgain.Checked = _basicToastNotificationData.IsDoNotShowAgainOptionChecked;
+
+ private void UpdateDoNotShowAgainOptionCheckState() => kchkDoNotShowAgain.CheckState =
+ _basicToastNotificationData.DoNotShowAgainOptionCheckState ?? CheckState.Unchecked;
+
+ private void SetIcon(Bitmap? image) => pbxIcon.Image = image;
+
+ private void UpdateLocation() =>
+ //Once loaded, position the form, or position it to the bottom left of the screen with added padding
+ Location = _basicToastNotificationData.NotificationLocation ?? new Point(Screen.PrimaryScreen!.WorkingArea.Width - Width - 5,
+ Screen.PrimaryScreen.WorkingArea.Height - Height - 5);
+
+ private void ReportToastLocation() => klblToastLocation.Text = _basicToastNotificationData.ReportToastLocation ? $"Location: X: {Location.X}, Y: {Location.Y}" : string.Empty;
+
+ private void VisualToastNotificationBasicForm_Load(object sender, EventArgs e)
+ {
+ UpdateSizing();
+
+ UpdateLocation();
+
+ ReportToastLocation();
+
+ ShowCloseButton();
+
+ _timer?.Start();
+
+ _soundPlayer?.Play();
+ }
+
+ private void UpdateSizing()
+ {
+ if (FormBorderStyle == FormBorderStyle.None)
+ {
+ // Add some height, if form border style equals 'None'
+
+ var width = Size.Width;
+
+ // ToDo: Use scaling here, to support larger screens
+
+ var height = Size.Height + GlobalStaticValues.DEFAULT_PADDING;
+
+ Size = new Size(width, height);
+ }
+ }
+
+ private void VisualToastNotificationBasicForm_Resize(object? sender, EventArgs e)
+ {
+ WindowState = WindowState switch
+ {
+ FormWindowState.Maximized => FormWindowState.Normal,
+ _ => WindowState
+ };
+ }
+
+ private void VisualToastNotificationBasicForm_GotFocus(object? sender, EventArgs e) => kbtnDismiss.Focus();
+
+ private void VisualToastNotificationBasicForm_LocationChanged(object? sender, EventArgs e)
+ {
+ if (_basicToastNotificationData.ReportToastLocation)
+ {
+ ReportToastLocation();
+ }
+ }
+
+ private void kbtnDismiss_Click(object sender, EventArgs e) => Close();
+
+ private void ShowCloseButton()
+ {
+ CloseBox = _basicToastNotificationData.ShowCloseBox ?? false;
+
+ FormBorderStyle = CloseBox ? FormBorderStyle.Fixed3D : FormBorderStyle.FixedSingle;
+
+ ControlBox = _basicToastNotificationData.ShowCloseBox ?? false;
+ }
+
+ private void ShowDoNotShowAgainOption()
+ {
+ kchkDoNotShowAgain.Visible = _basicToastNotificationData.ShowDoNotShowAgainOption ?? false;
+
+ kchkDoNotShowAgain.Checked = _basicToastNotificationData.IsDoNotShowAgainOptionChecked;
+
+ kchkDoNotShowAgain.CheckState = _basicToastNotificationData.DoNotShowAgainOptionCheckState ?? CheckState.Unchecked;
+
+ kchkDoNotShowAgain.ThreeState = _basicToastNotificationData.UseDoNotShowAgainOptionThreeState ?? false;
+
+ kchkDoNotShowAgain.Text = _basicToastNotificationData.OptionalCheckBoxText ?? KryptonManager.Strings.CustomStrings.DoNotShowAgain;
+ }
+
+ private void itbDismiss_Click(object sender, EventArgs e) => Close();
+
+ #region Show
+
+ public new void Show()
+ {
+ TopMost = _basicToastNotificationData.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ if (_basicToastNotificationData.CountDownSeconds != 0)
+ {
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_basicToastNotificationData.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_basicToastNotificationData.CountDownSeconds - _time})";
+
+ _timer = new Timer();
+
+ _timer.Interval = _basicToastNotificationData.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_basicToastNotificationData.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_basicToastNotificationData.CountDownSeconds - _time})";
+
+ if (_time == _basicToastNotificationData.CountDownSeconds)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+
+ base.Show();
+ }
+
+ public new DialogResult ShowDialog()
+ {
+ TopMost = _basicToastNotificationData.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ if (_basicToastNotificationData.IsDoNotShowAgainOptionChecked)
+ {
+ UpdateDoNotShowAgainOptionChecked();
+ }
+
+ if (_basicToastNotificationData.DoNotShowAgainOptionCheckState != null)
+ {
+ UpdateDoNotShowAgainOptionCheckState();
+ }
+
+ if (_basicToastNotificationData.CountDownSeconds != 0)
+ {
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_basicToastNotificationData.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_basicToastNotificationData.CountDownSeconds - _time})";
+
+ _timer = new Timer();
+
+ _timer.Interval = _basicToastNotificationData.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_basicToastNotificationData.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_basicToastNotificationData.CountDownSeconds - _time})";
+
+ if (_time == _basicToastNotificationData.CountDownSeconds)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog();
+ }
+
+ #endregion
+
+ #region Internal Show Methods
+
+ internal static bool InternalShowWithBooleanReturnValue(KryptonBasicToastNotificationData toastNotificationData)
+ {
+ using var toast = new VisualToastNotificationBasicForm(toastNotificationData);
+
+ if (toast.ShowDialog() == DialogResult.OK)
+ {
+ return toast.ReturnValue;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ internal static CheckState InternalShowWithCheckStateReturnValue(
+ KryptonBasicToastNotificationData toastNotificationData)
+ {
+ using var toast = new VisualToastNotificationBasicForm(toastNotificationData);
+
+ return toast.ShowDialog() == DialogResult.OK
+ ? toast.ReturnCheckBoxStateValue
+ : CheckState.Unchecked;
+ }
+
+ internal static void InternalShow(KryptonBasicToastNotificationData toastNotificationData)
+ {
+ var toast = new VisualToastNotificationBasicForm(toastNotificationData);
+
+ toast.Show();
+ }
+
+ #endregion
+
+ #endregion
+
+ #region Protected Overrides
+
+ protected override void OnLoad(EventArgs e)
+ {
+ if (_basicToastNotificationData.DoNotShowAgainOptionCheckState == CheckState.Checked || _basicToastNotificationData.IsDoNotShowAgainOptionChecked)
+ {
+ Hide();
+ }
+
+ base.OnLoad(e);
+ }
+
+ protected override void OnFormClosing(FormClosingEventArgs e)
+ {
+ base.OnFormClosing(e);
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonMessageBoxForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Basic/LTR/VisualToastNotificationBasicForm.resx
similarity index 100%
rename from Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonMessageBoxForm.resx
rename to Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Basic/LTR/VisualToastNotificationBasicForm.resx
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Basic/LTR/VisualToastNotificationBasicWithProgressBarForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Basic/LTR/VisualToastNotificationBasicWithProgressBarForm.Designer.cs
new file mode 100644
index 000000000..f2afd2a5c
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Basic/LTR/VisualToastNotificationBasicWithProgressBarForm.Designer.cs
@@ -0,0 +1,267 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualToastNotificationBasicWithProgressBarForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.kpnlMain = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ this.kpbCountDown = new Krypton.Toolkit.KryptonProgressBar();
+ this.pbxImage = new System.Windows.Forms.PictureBox();
+ this.kwlblNotificationTitle = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kwlblNotificationContent = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kpnlFooter = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnDismiss = new Krypton.Toolkit.KryptonButton();
+ this.klblToastLocation = new Krypton.Toolkit.KryptonLabel();
+ this.kchkDoNotShowAgain = new Krypton.Toolkit.KryptonCheckBox();
+ this.itbDismiss = new Krypton.Toolkit.InternalToastButton();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).BeginInit();
+ this.kpnlMain.SuspendLayout();
+ this.tableLayoutPanel1.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxImage)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlFooter)).BeginInit();
+ this.kpnlFooter.SuspendLayout();
+ this.tableLayoutPanel2.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // kpnlMain
+ //
+ this.kpnlMain.Controls.Add(this.tableLayoutPanel1);
+ this.kpnlMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlMain.Location = new System.Drawing.Point(0, 0);
+ this.kpnlMain.Name = "kpnlMain";
+ this.kpnlMain.Size = new System.Drawing.Size(589, 250);
+ this.kpnlMain.TabIndex = 2;
+ //
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel1.ColumnCount = 2;
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.Controls.Add(this.kpbCountDown, 0, 2);
+ this.tableLayoutPanel1.Controls.Add(this.pbxImage, 0, 0);
+ this.tableLayoutPanel1.Controls.Add(this.kwlblNotificationTitle, 1, 0);
+ this.tableLayoutPanel1.Controls.Add(this.kwlblNotificationContent, 1, 1);
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 3;
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(589, 250);
+ this.tableLayoutPanel1.TabIndex = 0;
+ //
+ // kpbCountDown
+ //
+ this.tableLayoutPanel1.SetColumnSpan(this.kpbCountDown, 2);
+ this.kpbCountDown.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpbCountDown.Location = new System.Drawing.Point(3, 221);
+ this.kpbCountDown.Name = "kpbCountDown";
+ this.kpbCountDown.Size = new System.Drawing.Size(583, 26);
+ this.kpbCountDown.StateCommon.Back.Color1 = System.Drawing.Color.Green;
+ this.kpbCountDown.StateDisabled.Back.ColorStyle = Krypton.Toolkit.PaletteColorStyle.OneNote;
+ this.kpbCountDown.StateNormal.Back.ColorStyle = Krypton.Toolkit.PaletteColorStyle.OneNote;
+ this.kpbCountDown.TabIndex = 0;
+ this.kpbCountDown.Text = "kryptonProgressBar1";
+ this.kpbCountDown.Values.Text = "kryptonProgressBar1";
+ //
+ // pbxImage
+ //
+ this.pbxImage.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pbxImage.Location = new System.Drawing.Point(5, 5);
+ this.pbxImage.Margin = new System.Windows.Forms.Padding(5);
+ this.pbxImage.Name = "pbxImage";
+ this.tableLayoutPanel1.SetRowSpan(this.pbxImage, 2);
+ this.pbxImage.Size = new System.Drawing.Size(128, 208);
+ this.pbxImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pbxImage.TabIndex = 1;
+ this.pbxImage.TabStop = false;
+ //
+ // kwlblNotificationTitle
+ //
+ this.kwlblNotificationTitle.AutoSize = false;
+ this.kwlblNotificationTitle.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlblNotificationTitle.Font = new System.Drawing.Font("Segoe UI", 13.5F, System.Drawing.FontStyle.Bold);
+ this.kwlblNotificationTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlblNotificationTitle.LabelStyle = Krypton.Toolkit.LabelStyle.TitleControl;
+ this.kwlblNotificationTitle.Location = new System.Drawing.Point(141, 0);
+ this.kwlblNotificationTitle.Name = "kwlblNotificationTitle";
+ this.kwlblNotificationTitle.Size = new System.Drawing.Size(445, 49);
+ this.kwlblNotificationTitle.Text = "kryptonWrapLabel1";
+ this.kwlblNotificationTitle.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // kwlblNotificationContent
+ //
+ this.kwlblNotificationContent.AutoSize = false;
+ this.kwlblNotificationContent.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlblNotificationContent.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.kwlblNotificationContent.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlblNotificationContent.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.kwlblNotificationContent.Location = new System.Drawing.Point(141, 49);
+ this.kwlblNotificationContent.Name = "kwlblNotificationContent";
+ this.kwlblNotificationContent.Size = new System.Drawing.Size(445, 169);
+ this.kwlblNotificationContent.Text = "kryptonWrapLabel2";
+ this.kwlblNotificationContent.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(589, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kpnlFooter
+ //
+ this.kpnlFooter.Controls.Add(this.tableLayoutPanel2);
+ this.kpnlFooter.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlFooter.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlFooter.Location = new System.Drawing.Point(0, 250);
+ this.kpnlFooter.Name = "kpnlFooter";
+ this.kpnlFooter.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlFooter.Size = new System.Drawing.Size(589, 50);
+ this.kpnlFooter.TabIndex = 1;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel2.ColumnCount = 4;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.Controls.Add(this.kbtnDismiss, 2, 0);
+ this.tableLayoutPanel2.Controls.Add(this.klblToastLocation, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.kchkDoNotShowAgain, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.itbDismiss, 3, 0);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 1;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(589, 49);
+ this.tableLayoutPanel2.TabIndex = 5;
+ //
+ // kbtnDismiss
+ //
+ this.kbtnDismiss.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnDismiss.AutoSize = true;
+ this.kbtnDismiss.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.kbtnDismiss.Location = new System.Drawing.Point(513, 13);
+ this.kbtnDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnDismiss.Name = "kbtnDismiss";
+ this.kbtnDismiss.Size = new System.Drawing.Size(23, 22);
+ this.kbtnDismiss.TabIndex = 2;
+ this.kbtnDismiss.Values.Text = "{0}";
+ this.kbtnDismiss.Visible = false;
+ //
+ // klblToastLocation
+ //
+ this.klblToastLocation.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.klblToastLocation.Location = new System.Drawing.Point(75, 23);
+ this.klblToastLocation.Margin = new System.Windows.Forms.Padding(10);
+ this.klblToastLocation.Name = "klblToastLocation";
+ this.klblToastLocation.Size = new System.Drawing.Size(6, 2);
+ this.klblToastLocation.TabIndex = 3;
+ this.klblToastLocation.Values.Text = "";
+ //
+ // kchkDoNotShowAgain
+ //
+ this.kchkDoNotShowAgain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kchkDoNotShowAgain.Location = new System.Drawing.Point(10, 10);
+ this.kchkDoNotShowAgain.Margin = new System.Windows.Forms.Padding(10);
+ this.kchkDoNotShowAgain.Name = "kchkDoNotShowAgain";
+ this.kchkDoNotShowAgain.Size = new System.Drawing.Size(45, 29);
+ this.kchkDoNotShowAgain.TabIndex = 4;
+ this.kchkDoNotShowAgain.Values.Text = "CB1";
+ this.kchkDoNotShowAgain.Visible = false;
+ //
+ // itbDismiss
+ //
+ this.itbDismiss.AutoSize = true;
+ this.itbDismiss.IsActionButton = false;
+ this.itbDismiss.IsDismissButton = true;
+ this.itbDismiss.Location = new System.Drawing.Point(556, 13);
+ this.itbDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.itbDismiss.Name = "itbDismiss";
+ this.itbDismiss.NotificationResult = Krypton.Toolkit.KryptonToastNotificationResult.None;
+ this.itbDismiss.Owner = null;
+ this.itbDismiss.ProcessPath = "";
+ this.itbDismiss.Size = new System.Drawing.Size(23, 22);
+ this.itbDismiss.TabIndex = 5;
+ this.itbDismiss.Values.Text = "{0}";
+ this.itbDismiss.Click += new System.EventHandler(this.itbDismiss_Click);
+ //
+ // VisualToastNotificationBasicWithProgressBarForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(589, 300);
+ this.Controls.Add(this.kpnlMain);
+ this.Controls.Add(this.kpnlFooter);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualToastNotificationBasicWithProgressBarForm";
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.Load += new System.EventHandler(this.VisualToastNotificationBasicWithProgressBarForm_Load);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).EndInit();
+ this.kpnlMain.ResumeLayout(false);
+ this.tableLayoutPanel1.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.pbxImage)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlFooter)).EndInit();
+ this.kpnlFooter.ResumeLayout(false);
+ this.kpnlFooter.PerformLayout();
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+ private KryptonPanel kpnlMain;
+ private TableLayoutPanel tableLayoutPanel1;
+ private KryptonProgressBar kpbCountDown;
+ private PictureBox pbxImage;
+ private KryptonWrapLabel kwlblNotificationTitle;
+ private KryptonWrapLabel kwlblNotificationContent;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private KryptonPanel kpnlFooter;
+ private TableLayoutPanel tableLayoutPanel2;
+ private KryptonButton kbtnDismiss;
+ private KryptonLabel klblToastLocation;
+ private KryptonCheckBox kchkDoNotShowAgain;
+ private InternalToastButton itbDismiss;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Basic/LTR/VisualToastNotificationBasicWithProgressBarForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Basic/LTR/VisualToastNotificationBasicWithProgressBarForm.cs
new file mode 100644
index 000000000..bba558ef9
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Basic/LTR/VisualToastNotificationBasicWithProgressBarForm.cs
@@ -0,0 +1,383 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+using ContentAlignment = System.Drawing.ContentAlignment;
+using Timer = System.Windows.Forms.Timer;
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualToastNotificationBasicWithProgressBarForm : VisualToastNotificationBaseForm
+ {
+ #region Instance Fields
+
+ private int _time, _countdownValue;
+
+ private Timer _timer;
+
+ private SoundPlayer? _soundPlayer;
+
+ private PaletteBase _palette;
+
+ private readonly KryptonBasicToastNotificationData _basicToastNotificationData;
+
+ #endregion
+
+ #region Identity
+
+ public VisualToastNotificationBasicWithProgressBarForm(KryptonBasicToastNotificationData data)
+ {
+ _basicToastNotificationData = data;
+
+ InitializeComponent();
+
+ GotFocus += VisualToastNotificationBasicWithProgressBarForm_GotFocus;
+
+ Resize += VisualToastNotificationBasicWithProgressBarForm_Resize;
+
+ LocationChanged += VisualToastNotificationBasicWithProgressBarForm_LocationChanged;
+
+ DoubleBuffered = true;
+
+ UpdateBorderColors();
+
+ /* FadeValues disabled and moved to extended until proven stable. Further development in V100
+ UpdateFadeValues();
+ */
+
+ UpdateFonts();
+ }
+
+ #endregion
+
+ #region Public
+
+ internal bool ReturnValue => kchkDoNotShowAgain.Checked;
+
+ internal CheckState ReturnCheckBoxStateValue => kchkDoNotShowAgain.CheckState;
+
+ #endregion
+
+ #region Implementation
+
+ private void UpdateText()
+ {
+ kwlblNotificationContent.Text = _basicToastNotificationData.NotificationContent ?? string.Empty;
+
+ kwlblNotificationTitle.Text = _basicToastNotificationData.NotificationTitle;
+
+ kwlblNotificationTitle.TextAlign =
+ _basicToastNotificationData.NotificationTitleAlignment ?? ContentAlignment.MiddleCenter;
+ }
+
+ private void UpdateBorderColors()
+ {
+ StateCommon!.Border.Color1 = _basicToastNotificationData.BorderColor1 ?? GlobalStaticValues.EMPTY_COLOR;
+
+ StateCommon.Border.Color2 = _basicToastNotificationData.BorderColor2 ?? GlobalStaticValues.EMPTY_COLOR;
+ }
+
+ /* FadeValues disabled and moved to extended until proven stable. Further development in V100
+ private void UpdateFadeValues() => FadeValues.FadingEnabled = _basicToastNotificationData.UseFade;
+ */
+
+ private void UpdateFonts()
+ {
+ kwlblNotificationContent.StateCommon.Font = _basicToastNotificationData.NotificationContentFont ??
+ KryptonManager.CurrentGlobalPalette.BaseFont;
+
+ if (_basicToastNotificationData.NotificationTitleFont != null)
+ {
+ kwlblNotificationContent.LabelStyle = LabelStyle.NormalControl;
+
+ kwlblNotificationTitle.StateCommon.Font =
+ _basicToastNotificationData.NotificationTitleFont ?? _palette.Header1ShortFont;
+ }
+ else
+ {
+ kwlblNotificationTitle.LabelStyle = LabelStyle.TitleControl;
+ }
+ }
+
+ private void UpdateIcon()
+ {
+ switch (_basicToastNotificationData.NotificationIcon)
+ {
+ case KryptonToastNotificationIcon.None:
+ SetIcon(null);
+ break;
+ case KryptonToastNotificationIcon.Hand:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Hand_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemHand:
+#if NET8_0_OR_GREATER
+ //SetIcon(GraphicsExtensions.ScaleImage());
+#else
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Hand.ToBitmap(), 128, 128));
+#endif
+ break;
+ case KryptonToastNotificationIcon.Question:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Question_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemQuestion:
+ break;
+ case KryptonToastNotificationIcon.Exclamation:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.SystemExclamation:
+ break;
+ case KryptonToastNotificationIcon.Asterisk:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Asterisk_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemAsterisk:
+ break;
+ case KryptonToastNotificationIcon.Stop:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Stop_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Error:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Critical_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Warning:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.Information:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Shield:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
+ }
+ else if (OSUtilities.IsWindowsTen)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_10_128_x_128);
+ }
+ else
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128);
+ }
+ break;
+ case KryptonToastNotificationIcon.WindowsLogo:
+ break;
+ case KryptonToastNotificationIcon.Application:
+ break;
+ case KryptonToastNotificationIcon.SystemApplication:
+ break;
+ case KryptonToastNotificationIcon.Ok:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Ok_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Custom:
+ SetIcon(_basicToastNotificationData.CustomImage != null
+ ? new Bitmap(_basicToastNotificationData.CustomImage)
+ : null);
+ break;
+ case null:
+ SetIcon(null);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+
+ private void UpdateDoNotShowAgainOptionChecked() =>
+ kchkDoNotShowAgain.Checked = _basicToastNotificationData.IsDoNotShowAgainOptionChecked;
+
+ private void UpdateDoNotShowAgainOptionCheckState() =>
+ kchkDoNotShowAgain.CheckState =
+ _basicToastNotificationData.DoNotShowAgainOptionCheckState ?? CheckState.Unchecked;
+
+ private void SetIcon(Bitmap? image) => pbxImage.Image = image;
+
+ private void UpdateLocation()
+ {
+ //Once loaded, position the form, or position it to the bottom left of the screen with added padding
+ Location = _basicToastNotificationData.NotificationLocation ?? new Point(Screen.PrimaryScreen!.WorkingArea.Width - Width - 5,
+ Screen.PrimaryScreen!.WorkingArea.Height - Height - 5);
+ }
+
+ private void VisualToastNotificationBasicWithProgressBarForm_Load(object sender, EventArgs e)
+ {
+ UpdateLocation();
+
+ ShowCloseButton();
+
+ _timer.Start();
+
+ _soundPlayer?.Play();
+
+ kbtnDismiss.Text = KryptonManager.Strings.ToastNotificationStrings.Dismiss;
+
+ itbDismiss.Text = KryptonManager.Strings.ToastNotificationStrings.Dismiss;
+ }
+
+ private void VisualToastNotificationBasicWithProgressBarForm_Resize(object? sender, EventArgs e)
+ {
+ if (WindowState == FormWindowState.Maximized)
+ {
+ WindowState = FormWindowState.Normal;
+ }
+ }
+
+ private void VisualToastNotificationBasicWithProgressBarForm_GotFocus(object? sender, EventArgs e)
+ {
+ kbtnDismiss.Focus();
+ }
+
+ private void VisualToastNotificationBasicWithProgressBarForm_LocationChanged(object? sender, EventArgs e)
+ {
+ if (_basicToastNotificationData.ReportToastLocation)
+ {
+ ReportToastLocation();
+ }
+ }
+
+ private void ReportToastLocation() => klblToastLocation.Text = _basicToastNotificationData.ReportToastLocation ? $"Location: X: {Location.X}, Y: {Location.Y}" : string.Empty;
+
+ private void kbtnDismiss_Click(object sender, EventArgs e)
+ {
+ Close();
+ }
+
+ private void ShowCloseButton()
+ {
+ CloseBox = _basicToastNotificationData.ShowCloseBox ?? false;
+
+ FormBorderStyle = CloseBox ? FormBorderStyle.Fixed3D : FormBorderStyle.FixedSingle;
+
+ ControlBox = _basicToastNotificationData.ShowCloseBox ?? false;
+ }
+
+ private void UpdateProgressBarText() => kpbCountDown.Text = _basicToastNotificationData.ShowCountDownSecondsOnProgressBar ? $@"{_basicToastNotificationData.CountDownSeconds - _time}" : string.Empty;
+
+ public new void Show()
+ {
+ TopMost = _basicToastNotificationData.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ if (_basicToastNotificationData.CountDownSeconds != 0)
+ {
+ _countdownValue = _basicToastNotificationData.CountDownSeconds ?? 60;
+
+ kpbCountDown.Maximum = _countdownValue;
+
+ kpbCountDown.Value = _countdownValue;
+
+ UpdateProgressBarText();
+
+ _timer = new Timer();
+
+ _timer.Interval = _basicToastNotificationData.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kpbCountDown.Value -= 1;
+
+ UpdateProgressBarText();
+
+ if (kpbCountDown.Value == kpbCountDown.Minimum)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+
+ base.Show();
+ }
+
+ public new DialogResult ShowDialog()
+ {
+ TopMost = _basicToastNotificationData.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ if (_basicToastNotificationData.IsDoNotShowAgainOptionChecked)
+ {
+ UpdateDoNotShowAgainOptionChecked();
+ }
+
+ if (_basicToastNotificationData.DoNotShowAgainOptionCheckState != null)
+ {
+ UpdateDoNotShowAgainOptionCheckState();
+ }
+
+ if (_basicToastNotificationData.CountDownSeconds != 0)
+ {
+ _countdownValue = _basicToastNotificationData.CountDownSeconds ?? 60;
+
+ kpbCountDown.Maximum = _countdownValue;
+
+ kpbCountDown.Value = _countdownValue;
+
+ UpdateProgressBarText();
+
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss}";
+
+ _timer = new Timer();
+
+ _timer.Interval = _basicToastNotificationData.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kpbCountDown.Value -= 1;
+
+ UpdateProgressBarText();
+
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss}";
+
+ if (_time == _basicToastNotificationData.CountDownSeconds)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog();
+ }
+
+ internal static bool InternalShowWithBooleanReturnValue(KryptonBasicToastNotificationData toastNotificationData)
+ {
+ using var toast = new VisualToastNotificationBasicWithProgressBarForm(toastNotificationData);
+
+ return toast.ShowDialog() == DialogResult.OK && toast.ReturnValue;
+ }
+
+ internal static CheckState InternalShowWithCheckStateReturnValue(KryptonBasicToastNotificationData toastNotificationData)
+ {
+ using var toast = new VisualToastNotificationBasicWithProgressBarForm(toastNotificationData);
+
+ return toast.ShowDialog() == DialogResult.OK
+ ? toast.ReturnCheckBoxStateValue
+ : CheckState.Unchecked;
+ }
+
+ private void itbDismiss_Click(object sender, EventArgs e) => Close();
+
+ internal static void InternalShow(KryptonBasicToastNotificationData toastNotificationData)
+ {
+ var kt = new VisualToastNotificationBasicWithProgressBarForm(toastNotificationData);
+
+ kt.Show();
+ }
+
+ #endregion
+ }
+}
diff --git a/Source/Krypton Components/TestForm/Form2.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Basic/LTR/VisualToastNotificationBasicWithProgressBarForm.resx
similarity index 100%
rename from Source/Krypton Components/TestForm/Form2.resx
rename to Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Basic/LTR/VisualToastNotificationBasicWithProgressBarForm.resx
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Basic/RTL/VisualToastNotificationBasicRtlAwareForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Basic/RTL/VisualToastNotificationBasicRtlAwareForm.Designer.cs
new file mode 100644
index 000000000..b8addb780
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Basic/RTL/VisualToastNotificationBasicRtlAwareForm.Designer.cs
@@ -0,0 +1,267 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualToastNotificationBasicRtlAwareForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.kpnlButtons = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnDismiss = new Krypton.Toolkit.KryptonButton();
+ this.klblToastLocation = new Krypton.Toolkit.KryptonLabel();
+ this.kchkDoNotShowAgain = new Krypton.Toolkit.KryptonCheckBox();
+ this.itbDismiss = new Krypton.Toolkit.InternalToastButton();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ this.pbxImage = new System.Windows.Forms.PictureBox();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.kwlToastHeader = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kwlToastContent = new Krypton.Toolkit.KryptonWrapLabel();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit();
+ this.kpnlButtons.SuspendLayout();
+ this.tableLayoutPanel3.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
+ this.kryptonPanel1.SuspendLayout();
+ this.tableLayoutPanel1.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxImage)).BeginInit();
+ this.tableLayoutPanel2.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // kpnlButtons
+ //
+ this.kpnlButtons.Controls.Add(this.tableLayoutPanel3);
+ this.kpnlButtons.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlButtons.Location = new System.Drawing.Point(0, 219);
+ this.kpnlButtons.Name = "kpnlButtons";
+ this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlButtons.Size = new System.Drawing.Size(577, 50);
+ this.kpnlButtons.TabIndex = 0;
+ //
+ // tableLayoutPanel3
+ //
+ this.tableLayoutPanel3.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel3.ColumnCount = 4;
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel3.Controls.Add(this.kbtnDismiss, 2, 0);
+ this.tableLayoutPanel3.Controls.Add(this.klblToastLocation, 0, 0);
+ this.tableLayoutPanel3.Controls.Add(this.kchkDoNotShowAgain, 0, 0);
+ this.tableLayoutPanel3.Controls.Add(this.itbDismiss, 3, 0);
+ this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel3.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel3.Name = "tableLayoutPanel3";
+ this.tableLayoutPanel3.RowCount = 1;
+ this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel3.Size = new System.Drawing.Size(577, 49);
+ this.tableLayoutPanel3.TabIndex = 4;
+ //
+ // kbtnDismiss
+ //
+ this.kbtnDismiss.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnDismiss.AutoSize = true;
+ this.kbtnDismiss.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.kbtnDismiss.Location = new System.Drawing.Point(78, 13);
+ this.kbtnDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnDismiss.Name = "kbtnDismiss";
+ this.kbtnDismiss.Size = new System.Drawing.Size(48, 22);
+ this.kbtnDismiss.TabIndex = 2;
+ this.kbtnDismiss.Values.Text = "{0} ({1})";
+ this.kbtnDismiss.Visible = false;
+ //
+ // klblToastLocation
+ //
+ this.klblToastLocation.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.klblToastLocation.Location = new System.Drawing.Point(496, 23);
+ this.klblToastLocation.Margin = new System.Windows.Forms.Padding(10);
+ this.klblToastLocation.Name = "klblToastLocation";
+ this.klblToastLocation.Size = new System.Drawing.Size(6, 2);
+ this.klblToastLocation.TabIndex = 3;
+ this.klblToastLocation.Values.Text = "";
+ //
+ // kchkDoNotShowAgain
+ //
+ this.kchkDoNotShowAgain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kchkDoNotShowAgain.Location = new System.Drawing.Point(522, 10);
+ this.kchkDoNotShowAgain.Margin = new System.Windows.Forms.Padding(10);
+ this.kchkDoNotShowAgain.Name = "kchkDoNotShowAgain";
+ this.kchkDoNotShowAgain.Size = new System.Drawing.Size(45, 29);
+ this.kchkDoNotShowAgain.TabIndex = 4;
+ this.kchkDoNotShowAgain.Values.Text = "CB1";
+ this.kchkDoNotShowAgain.Visible = false;
+ //
+ // itbDismiss
+ //
+ this.itbDismiss.AutoSize = true;
+ this.itbDismiss.IsActionButton = false;
+ this.itbDismiss.IsDismissButton = true;
+ this.itbDismiss.Location = new System.Drawing.Point(10, 13);
+ this.itbDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.itbDismiss.Name = "itbDismiss";
+ this.itbDismiss.NotificationResult = Krypton.Toolkit.KryptonToastNotificationResult.None;
+ this.itbDismiss.Owner = null;
+ this.itbDismiss.ProcessPath = "";
+ this.itbDismiss.Size = new System.Drawing.Size(48, 22);
+ this.itbDismiss.TabIndex = 5;
+ this.itbDismiss.Values.Text = "{0} ({1})";
+ this.itbDismiss.Click += new System.EventHandler(this.itbDismiss_Click);
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(577, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kryptonPanel1
+ //
+ this.kryptonPanel1.Controls.Add(this.tableLayoutPanel1);
+ this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonPanel1.Name = "kryptonPanel1";
+ this.kryptonPanel1.Size = new System.Drawing.Size(577, 219);
+ this.kryptonPanel1.TabIndex = 1;
+ //
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel1.ColumnCount = 2;
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.Controls.Add(this.pbxImage, 0, 0);
+ this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 1, 0);
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 1;
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(577, 219);
+ this.tableLayoutPanel1.TabIndex = 0;
+ //
+ // pbxImage
+ //
+ this.pbxImage.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pbxImage.Location = new System.Drawing.Point(444, 5);
+ this.pbxImage.Margin = new System.Windows.Forms.Padding(5);
+ this.pbxImage.Name = "pbxImage";
+ this.pbxImage.Size = new System.Drawing.Size(128, 209);
+ this.pbxImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pbxImage.TabIndex = 0;
+ this.pbxImage.TabStop = false;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.ColumnCount = 1;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Controls.Add(this.kwlToastHeader, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.kwlToastContent, 0, 1);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 3);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 2;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(433, 213);
+ this.tableLayoutPanel2.TabIndex = 1;
+ //
+ // kwlToastHeader
+ //
+ this.kwlToastHeader.AutoSize = false;
+ this.kwlToastHeader.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlToastHeader.Font = new System.Drawing.Font("Segoe UI", 13.5F, System.Drawing.FontStyle.Bold);
+ this.kwlToastHeader.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlToastHeader.LabelStyle = Krypton.Toolkit.LabelStyle.TitleControl;
+ this.kwlToastHeader.Location = new System.Drawing.Point(3, 0);
+ this.kwlToastHeader.Name = "kwlToastHeader";
+ this.kwlToastHeader.Size = new System.Drawing.Size(427, 50);
+ this.kwlToastHeader.Text = "kryptonWrapLabel1";
+ this.kwlToastHeader.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // kwlToastContent
+ //
+ this.kwlToastContent.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlToastContent.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.kwlToastContent.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlToastContent.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.kwlToastContent.Location = new System.Drawing.Point(3, 50);
+ this.kwlToastContent.Name = "kwlToastContent";
+ this.kwlToastContent.Size = new System.Drawing.Size(427, 163);
+ this.kwlToastContent.Text = "kryptonWrapLabel2";
+ this.kwlToastContent.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // VisualToastNotificationBasicRtlAwareForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(577, 269);
+ this.Controls.Add(this.kryptonPanel1);
+ this.Controls.Add(this.kpnlButtons);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualToastNotificationBasicRtlAwareForm";
+ this.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.Load += new System.EventHandler(this.VisualToastNotificationBasicRtlAwareForm_Load);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit();
+ this.kpnlButtons.ResumeLayout(false);
+ this.kpnlButtons.PerformLayout();
+ this.tableLayoutPanel3.ResumeLayout(false);
+ this.tableLayoutPanel3.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
+ this.kryptonPanel1.ResumeLayout(false);
+ this.tableLayoutPanel1.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.pbxImage)).EndInit();
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kpnlButtons;
+ private KryptonPanel kryptonPanel1;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private TableLayoutPanel tableLayoutPanel1;
+ private PictureBox pbxImage;
+ private TableLayoutPanel tableLayoutPanel2;
+ private KryptonWrapLabel kwlToastHeader;
+ private KryptonWrapLabel kwlToastContent;
+ private TableLayoutPanel tableLayoutPanel3;
+ private KryptonButton kbtnDismiss;
+ private KryptonLabel klblToastLocation;
+ private KryptonCheckBox kchkDoNotShowAgain;
+ private InternalToastButton itbDismiss;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Basic/RTL/VisualToastNotificationBasicRtlAwareForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Basic/RTL/VisualToastNotificationBasicRtlAwareForm.cs
new file mode 100644
index 000000000..2d086ab90
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Basic/RTL/VisualToastNotificationBasicRtlAwareForm.cs
@@ -0,0 +1,313 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+using ContentAlignment = System.Drawing.ContentAlignment;
+using Timer = System.Windows.Forms.Timer;
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualToastNotificationBasicRtlAwareForm : VisualToastNotificationBaseForm
+ {
+ #region Instance Fields
+
+ private int _time;
+
+ private Timer _timer;
+
+ private SoundPlayer? _soundPlayer;
+
+ private PaletteBase _palette;
+
+ private readonly KryptonBasicToastNotificationData _basicToastNotificationData;
+
+ #endregion
+
+ #region Public
+
+ internal bool ReturnValue => kchkDoNotShowAgain.Checked;
+
+ internal CheckState ReturnCheckBoxStateValue => kchkDoNotShowAgain.CheckState;
+
+ #endregion
+
+ #region Identity
+
+ public VisualToastNotificationBasicRtlAwareForm(KryptonBasicToastNotificationData toastNotificationData)
+ {
+ _basicToastNotificationData = toastNotificationData;
+
+ InitializeComponent();
+
+ GotFocus += VisualToastNotificationBasicRtlAwareForm_GotFocus;
+
+ Resize += VisualToastNotificationBasicRtlAwareForm_Resize;
+
+ LocationChanged += VisualToastNotificationBasicRtlAwareForm_LocationChanged;
+
+ DoubleBuffered = true;
+
+ UpdateBorderColors();
+
+ /* FadeValues disabled and moved to extended until proven stable. Further development in V100
+ UpdateFadeValues();
+ */
+
+ UpdateFonts();
+ }
+
+ #endregion
+
+ #region Implementation
+
+ private void UpdateText()
+ {
+ kwlToastContent.Text = _basicToastNotificationData.NotificationContent ?? string.Empty;
+
+ kwlToastHeader.Text = _basicToastNotificationData.NotificationTitle;
+
+ kwlToastContent.TextAlign =
+ _basicToastNotificationData.NotificationTitleAlignment ?? ContentAlignment.MiddleCenter;
+ }
+
+ private void UpdateBorderColors()
+ {
+ StateCommon!.Border.Color1 = _basicToastNotificationData.BorderColor1 ?? GlobalStaticValues.EMPTY_COLOR;
+
+ StateCommon.Border.Color2 = _basicToastNotificationData.BorderColor2 ?? GlobalStaticValues.EMPTY_COLOR;
+ }
+
+ /* FadeValues disabled and moved to extended until proven stable. Further development in V100
+ private void UpdateFadeValues() => FadeValues.FadingEnabled = _basicToastNotificationData.UseFade;
+ */
+ private void UpdateFonts()
+ {
+ kwlToastContent.StateCommon.Font = _basicToastNotificationData.NotificationContentFont ??
+ KryptonManager.CurrentGlobalPalette.BaseFont;
+
+ if (_basicToastNotificationData.NotificationTitleFont != null)
+ {
+ kwlToastContent.LabelStyle = LabelStyle.NormalControl;
+
+ kwlToastHeader.StateCommon.Font =
+ _basicToastNotificationData.NotificationTitleFont ?? _palette.Header1ShortFont;
+ }
+ else
+ {
+ kwlToastContent.LabelStyle = LabelStyle.TitleControl;
+ }
+ }
+
+ private void UpdateIcon()
+ {
+ switch (_basicToastNotificationData.NotificationIcon)
+ {
+ case KryptonToastNotificationIcon.None:
+ SetIcon(null);
+ break;
+ case KryptonToastNotificationIcon.Hand:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Hand_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemHand:
+#if NET8_0_OR_GREATER
+ //SetIcon(GraphicsExtensions.ScaleImage());
+#else
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Hand.ToBitmap(), 128, 128));
+#endif
+ break;
+ case KryptonToastNotificationIcon.Question:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Question_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemQuestion:
+ break;
+ case KryptonToastNotificationIcon.Exclamation:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.SystemExclamation:
+ break;
+ case KryptonToastNotificationIcon.Asterisk:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Asterisk_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemAsterisk:
+ break;
+ case KryptonToastNotificationIcon.Stop:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Stop_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Error:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Critical_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Warning:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.Information:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Shield:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
+ }
+ else if (OSUtilities.IsWindowsTen)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_10_128_x_128);
+ }
+ else
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128);
+ }
+ break;
+ case KryptonToastNotificationIcon.WindowsLogo:
+ break;
+ case KryptonToastNotificationIcon.Application:
+ break;
+ case KryptonToastNotificationIcon.SystemApplication:
+ break;
+ case KryptonToastNotificationIcon.Ok:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Ok_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Custom:
+ SetIcon(_basicToastNotificationData.CustomImage != null
+ ? new Bitmap(_basicToastNotificationData.CustomImage)
+ : null);
+ break;
+ case null:
+ SetIcon(null);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+
+ private void SetIcon(Bitmap? image) => pbxImage.Image = image;
+
+ private void UpdateLocation()
+ {
+ //Once loaded, position the form, or position it to the bottom left of the screen with added padding
+ Location = _basicToastNotificationData.NotificationLocation ?? new Point(Screen.PrimaryScreen!.WorkingArea.Width - Width - 5,
+ Screen.PrimaryScreen.WorkingArea.Height - Height - 5);
+ }
+
+ private void ReportToastLocation() => klblToastLocation.Text = _basicToastNotificationData.ReportToastLocation ? $"Location: X: {Location.X}, Y: {Location.Y}" : string.Empty;
+
+ private void ShowCloseButton()
+ {
+ CloseBox = _basicToastNotificationData.ShowCloseBox ?? false;
+
+ FormBorderStyle = CloseBox ? FormBorderStyle.Fixed3D : FormBorderStyle.FixedSingle;
+
+ ControlBox = _basicToastNotificationData.ShowCloseBox ?? false;
+ }
+
+ private void VisualToastNotificationBasicRtlAwareForm_LocationChanged(object? sender, EventArgs e)
+ {
+ if (_basicToastNotificationData.ReportToastLocation)
+ {
+ ReportToastLocation();
+ }
+ }
+
+ private void VisualToastNotificationBasicRtlAwareForm_Resize(object? sender, EventArgs e)
+ {
+ if (WindowState == FormWindowState.Maximized)
+ {
+ WindowState = FormWindowState.Normal;
+ }
+ }
+
+ private void VisualToastNotificationBasicRtlAwareForm_GotFocus(object? sender, EventArgs e)
+ {
+ kbtnDismiss.Focus();
+ }
+
+ private void VisualToastNotificationBasicRtlAwareForm_Load(object sender, EventArgs e)
+ {
+ UpdateLocation();
+
+ ReportToastLocation();
+
+ ShowCloseButton();
+
+ _timer.Start();
+
+ _soundPlayer?.Play();
+ }
+
+ private void kbtnDismiss_Click(object sender, EventArgs e)
+ {
+ Close();
+ }
+
+ private void itbDismiss_Click(object sender, EventArgs e) => Close();
+
+ public new void Show()
+ {
+ TopMost = _basicToastNotificationData.TopMost ?? true;
+
+ //Opacity = 0;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ if (_basicToastNotificationData.CountDownSeconds != 0)
+ {
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_basicToastNotificationData.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_basicToastNotificationData.CountDownSeconds - _time})";
+
+ _timer = new Timer();
+
+ _timer.Interval = 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_basicToastNotificationData.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_basicToastNotificationData.CountDownSeconds - _time})";
+
+ if (_time == _basicToastNotificationData.CountDownSeconds)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+
+ base.Show();
+ }
+
+ internal static bool InternalShowWithBooleanReturnValue(KryptonBasicToastNotificationData toastNotificationData)
+ {
+ using var toast = new VisualToastNotificationBasicRtlAwareForm(toastNotificationData);
+
+ return toast.ShowDialog() == DialogResult.OK && toast.ReturnValue;
+ }
+
+ internal static CheckState InternalShowWithCheckStateReturnValue(KryptonBasicToastNotificationData toastNotificationData)
+ {
+ using var toast = new VisualToastNotificationBasicRtlAwareForm(toastNotificationData);
+
+ return toast.ShowDialog() == DialogResult.OK
+ ? toast.ReturnCheckBoxStateValue
+ : CheckState.Unchecked;
+ }
+
+ internal static void InternalShow(KryptonBasicToastNotificationData toastNotificationData)
+ {
+ using var toast = new VisualToastNotificationBasicRtlAwareForm(toastNotificationData);
+
+ toast.Show();
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/TestForm/Form3.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Basic/RTL/VisualToastNotificationBasicRtlAwareForm.resx
similarity index 100%
rename from Source/Krypton Components/TestForm/Form3.resx
rename to Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Basic/RTL/VisualToastNotificationBasicRtlAwareForm.resx
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Basic/RTL/VisualToastNotificationBasicWithProgressBarRtlAwareForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Basic/RTL/VisualToastNotificationBasicWithProgressBarRtlAwareForm.Designer.cs
new file mode 100644
index 000000000..0c5d55173
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Basic/RTL/VisualToastNotificationBasicWithProgressBarRtlAwareForm.Designer.cs
@@ -0,0 +1,269 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualToastNotificationBasicWithProgressBarRtlAwareForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.kpnlFooter = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnDismiss = new Krypton.Toolkit.KryptonButton();
+ this.klblToastLocation = new Krypton.Toolkit.KryptonLabel();
+ this.kchkDoNotShowAgain = new Krypton.Toolkit.KryptonCheckBox();
+ this.itbDismiss = new Krypton.Toolkit.InternalToastButton();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kpnlMain = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ this.kpbCountDown = new Krypton.Toolkit.KryptonProgressBar();
+ this.pbxImage = new System.Windows.Forms.PictureBox();
+ this.kwlblNotificationTitle = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kwlblNotificationContent = new Krypton.Toolkit.KryptonWrapLabel();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlFooter)).BeginInit();
+ this.kpnlFooter.SuspendLayout();
+ this.tableLayoutPanel2.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).BeginInit();
+ this.kpnlMain.SuspendLayout();
+ this.tableLayoutPanel1.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxImage)).BeginInit();
+ this.SuspendLayout();
+ //
+ // kpnlFooter
+ //
+ this.kpnlFooter.Controls.Add(this.tableLayoutPanel2);
+ this.kpnlFooter.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlFooter.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlFooter.Location = new System.Drawing.Point(0, 250);
+ this.kpnlFooter.Name = "kpnlFooter";
+ this.kpnlFooter.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlFooter.Size = new System.Drawing.Size(589, 50);
+ this.kpnlFooter.TabIndex = 2;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel2.ColumnCount = 4;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.Controls.Add(this.kbtnDismiss, 2, 0);
+ this.tableLayoutPanel2.Controls.Add(this.klblToastLocation, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.kchkDoNotShowAgain, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.itbDismiss, 3, 0);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 1;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(589, 49);
+ this.tableLayoutPanel2.TabIndex = 5;
+ //
+ // kbtnDismiss
+ //
+ this.kbtnDismiss.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnDismiss.AutoSize = true;
+ this.kbtnDismiss.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.kbtnDismiss.Location = new System.Drawing.Point(53, 13);
+ this.kbtnDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnDismiss.Name = "kbtnDismiss";
+ this.kbtnDismiss.Size = new System.Drawing.Size(23, 22);
+ this.kbtnDismiss.TabIndex = 2;
+ this.kbtnDismiss.Values.Text = "{0}";
+ this.kbtnDismiss.Visible = false;
+ //
+ // klblToastLocation
+ //
+ this.klblToastLocation.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.klblToastLocation.Location = new System.Drawing.Point(508, 23);
+ this.klblToastLocation.Margin = new System.Windows.Forms.Padding(10);
+ this.klblToastLocation.Name = "klblToastLocation";
+ this.klblToastLocation.Size = new System.Drawing.Size(6, 2);
+ this.klblToastLocation.TabIndex = 3;
+ this.klblToastLocation.Values.Text = "";
+ //
+ // kchkDoNotShowAgain
+ //
+ this.kchkDoNotShowAgain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kchkDoNotShowAgain.Location = new System.Drawing.Point(534, 10);
+ this.kchkDoNotShowAgain.Margin = new System.Windows.Forms.Padding(10);
+ this.kchkDoNotShowAgain.Name = "kchkDoNotShowAgain";
+ this.kchkDoNotShowAgain.Size = new System.Drawing.Size(45, 29);
+ this.kchkDoNotShowAgain.TabIndex = 4;
+ this.kchkDoNotShowAgain.Values.Text = "CB1";
+ this.kchkDoNotShowAgain.Visible = false;
+ //
+ // itbDismiss
+ //
+ this.itbDismiss.AutoSize = true;
+ this.itbDismiss.IsActionButton = false;
+ this.itbDismiss.IsDismissButton = true;
+ this.itbDismiss.Location = new System.Drawing.Point(10, 13);
+ this.itbDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.itbDismiss.Name = "itbDismiss";
+ this.itbDismiss.NotificationResult = Krypton.Toolkit.KryptonToastNotificationResult.None;
+ this.itbDismiss.Owner = null;
+ this.itbDismiss.ProcessPath = "";
+ this.itbDismiss.Size = new System.Drawing.Size(23, 22);
+ this.itbDismiss.TabIndex = 5;
+ this.itbDismiss.Values.Text = "{0}";
+ this.itbDismiss.Click += new System.EventHandler(this.itbDismiss_Click);
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(589, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kpnlMain
+ //
+ this.kpnlMain.Controls.Add(this.tableLayoutPanel1);
+ this.kpnlMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlMain.Location = new System.Drawing.Point(0, 0);
+ this.kpnlMain.Name = "kpnlMain";
+ this.kpnlMain.Size = new System.Drawing.Size(589, 250);
+ this.kpnlMain.TabIndex = 3;
+ //
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel1.ColumnCount = 2;
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.Controls.Add(this.kpbCountDown, 0, 2);
+ this.tableLayoutPanel1.Controls.Add(this.pbxImage, 0, 0);
+ this.tableLayoutPanel1.Controls.Add(this.kwlblNotificationTitle, 1, 0);
+ this.tableLayoutPanel1.Controls.Add(this.kwlblNotificationContent, 1, 1);
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 3;
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(589, 250);
+ this.tableLayoutPanel1.TabIndex = 0;
+ //
+ // kpbCountDown
+ //
+ this.tableLayoutPanel1.SetColumnSpan(this.kpbCountDown, 2);
+ this.kpbCountDown.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpbCountDown.Location = new System.Drawing.Point(3, 221);
+ this.kpbCountDown.Name = "kpbCountDown";
+ this.kpbCountDown.Size = new System.Drawing.Size(583, 26);
+ this.kpbCountDown.StateCommon.Back.Color1 = System.Drawing.Color.Green;
+ this.kpbCountDown.StateDisabled.Back.ColorStyle = Krypton.Toolkit.PaletteColorStyle.OneNote;
+ this.kpbCountDown.StateNormal.Back.ColorStyle = Krypton.Toolkit.PaletteColorStyle.OneNote;
+ this.kpbCountDown.TabIndex = 0;
+ this.kpbCountDown.Text = "kryptonProgressBar1";
+ this.kpbCountDown.Values.Text = "kryptonProgressBar1";
+ //
+ // pbxImage
+ //
+ this.pbxImage.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pbxImage.Location = new System.Drawing.Point(456, 5);
+ this.pbxImage.Margin = new System.Windows.Forms.Padding(5);
+ this.pbxImage.Name = "pbxImage";
+ this.tableLayoutPanel1.SetRowSpan(this.pbxImage, 2);
+ this.pbxImage.Size = new System.Drawing.Size(128, 208);
+ this.pbxImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pbxImage.TabIndex = 1;
+ this.pbxImage.TabStop = false;
+ //
+ // kwlblNotificationTitle
+ //
+ this.kwlblNotificationTitle.AutoSize = false;
+ this.kwlblNotificationTitle.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlblNotificationTitle.Font = new System.Drawing.Font("Segoe UI", 13.5F, System.Drawing.FontStyle.Bold);
+ this.kwlblNotificationTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlblNotificationTitle.LabelStyle = Krypton.Toolkit.LabelStyle.TitleControl;
+ this.kwlblNotificationTitle.Location = new System.Drawing.Point(3, 0);
+ this.kwlblNotificationTitle.Name = "kwlblNotificationTitle";
+ this.kwlblNotificationTitle.Size = new System.Drawing.Size(445, 49);
+ this.kwlblNotificationTitle.Text = "kryptonWrapLabel1";
+ this.kwlblNotificationTitle.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // kwlblNotificationContent
+ //
+ this.kwlblNotificationContent.AutoSize = false;
+ this.kwlblNotificationContent.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlblNotificationContent.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.kwlblNotificationContent.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlblNotificationContent.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.kwlblNotificationContent.Location = new System.Drawing.Point(3, 49);
+ this.kwlblNotificationContent.Name = "kwlblNotificationContent";
+ this.kwlblNotificationContent.Size = new System.Drawing.Size(445, 169);
+ this.kwlblNotificationContent.Text = "kryptonWrapLabel2";
+ this.kwlblNotificationContent.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // VisualToastNotificationBasicWithProgressBarRtlAwareForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(589, 300);
+ this.Controls.Add(this.kpnlMain);
+ this.Controls.Add(this.kpnlFooter);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualToastNotificationBasicWithProgressBarRtlAwareForm";
+ this.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.Load += new System.EventHandler(this.VisualToastNotificationBasicWithProgressBarRtlAwareForm_Load);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlFooter)).EndInit();
+ this.kpnlFooter.ResumeLayout(false);
+ this.kpnlFooter.PerformLayout();
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).EndInit();
+ this.kpnlMain.ResumeLayout(false);
+ this.tableLayoutPanel1.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.pbxImage)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kpnlFooter;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private KryptonPanel kpnlMain;
+ private TableLayoutPanel tableLayoutPanel1;
+ private KryptonProgressBar kpbCountDown;
+ private PictureBox pbxImage;
+ private KryptonWrapLabel kwlblNotificationTitle;
+ private KryptonWrapLabel kwlblNotificationContent;
+ private TableLayoutPanel tableLayoutPanel2;
+ private KryptonButton kbtnDismiss;
+ private KryptonLabel klblToastLocation;
+ private KryptonCheckBox kchkDoNotShowAgain;
+ private InternalToastButton itbDismiss;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Basic/RTL/VisualToastNotificationBasicWithProgressBarRtlAwareForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Basic/RTL/VisualToastNotificationBasicWithProgressBarRtlAwareForm.cs
new file mode 100644
index 000000000..f26a57c2a
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Basic/RTL/VisualToastNotificationBasicWithProgressBarRtlAwareForm.cs
@@ -0,0 +1,375 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+using ContentAlignment = System.Drawing.ContentAlignment;
+using Timer = System.Windows.Forms.Timer;
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualToastNotificationBasicWithProgressBarRtlAwareForm : VisualToastNotificationBaseForm
+ {
+ #region Instance Fields
+
+ private int _time, _countdownValue;
+
+ private Timer _timer;
+
+ private SoundPlayer? _soundPlayer;
+
+ private PaletteBase _palette;
+
+ private readonly KryptonBasicToastNotificationData _basicToastNotificationData;
+
+ #endregion
+
+ #region Public
+
+ internal bool ReturnValue => kchkDoNotShowAgain.Checked;
+
+ internal CheckState ReturnCheckBoxStateValue => kchkDoNotShowAgain.CheckState;
+
+ #endregion
+
+ #region Identity
+
+ public VisualToastNotificationBasicWithProgressBarRtlAwareForm(KryptonBasicToastNotificationData data)
+ {
+ InitializeComponent();
+
+ _basicToastNotificationData = data;
+
+ GotFocus += (sender, args) => kbtnDismiss.Focus();
+
+ LocationChanged += VisualToastNotificationBasicWithProgressBarRtlAwareForm_LocationChanged;
+
+ Resize += VisualToastNotificationBasicWithProgressBarRtlAwareForm_Resize;
+
+ DoubleBuffered = true;
+
+ UpdateBorderColors();
+
+ /* FadeValues disabled and moved to extended until proven stable. Further development in V100
+ UpdateFadeValues();
+ */
+
+ UpdateFonts();
+ }
+
+ #endregion
+
+ #region Implementation
+
+ private void UpdateText()
+ {
+ kwlblNotificationContent.Text = _basicToastNotificationData.NotificationContent ?? string.Empty;
+
+ kwlblNotificationTitle.Text = _basicToastNotificationData.NotificationTitle;
+
+ kwlblNotificationTitle.TextAlign =
+ _basicToastNotificationData.NotificationTitleAlignment ?? ContentAlignment.MiddleCenter;
+ }
+
+ private void UpdateBorderColors()
+ {
+ StateCommon!.Border.Color1 = _basicToastNotificationData.BorderColor1 ?? GlobalStaticValues.EMPTY_COLOR;
+
+ StateCommon.Border.Color2 = _basicToastNotificationData.BorderColor2 ?? GlobalStaticValues.EMPTY_COLOR;
+ }
+
+ /* FadeValues disabled and moved to extended until proven stable. Further development in V100
+ private void UpdateFadeValues() => FadeValues.FadingEnabled = _basicToastNotificationData.UseFade;
+ */
+
+ private void UpdateFonts()
+ {
+ kwlblNotificationContent.StateCommon.Font = _basicToastNotificationData.NotificationContentFont ??
+ KryptonManager.CurrentGlobalPalette.BaseFont;
+
+ if (_basicToastNotificationData.NotificationTitleFont != null)
+ {
+ kwlblNotificationContent.LabelStyle = LabelStyle.NormalControl;
+
+ kwlblNotificationTitle.StateCommon.Font =
+ _basicToastNotificationData.NotificationTitleFont ?? _palette.Header1ShortFont;
+ }
+ else
+ {
+ kwlblNotificationTitle.LabelStyle = LabelStyle.TitleControl;
+ }
+ }
+
+ private void UpdateIcon()
+ {
+ switch (_basicToastNotificationData.NotificationIcon)
+ {
+ case KryptonToastNotificationIcon.None:
+ SetIcon(null);
+ break;
+ case KryptonToastNotificationIcon.Hand:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Hand_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemHand:
+#if NET8_0_OR_GREATER
+ //SetIcon(GraphicsExtensions.ScaleImage());
+#else
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Hand.ToBitmap(), 128, 128));
+#endif
+ break;
+ case KryptonToastNotificationIcon.Question:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Question_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemQuestion:
+ break;
+ case KryptonToastNotificationIcon.Exclamation:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.SystemExclamation:
+ break;
+ case KryptonToastNotificationIcon.Asterisk:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Asterisk_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemAsterisk:
+ break;
+ case KryptonToastNotificationIcon.Stop:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Stop_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Error:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Critical_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Warning:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.Information:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Shield:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
+ }
+ else if (OSUtilities.IsWindowsTen)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_10_128_x_128);
+ }
+ else
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128);
+ }
+ break;
+ case KryptonToastNotificationIcon.WindowsLogo:
+ break;
+ case KryptonToastNotificationIcon.Application:
+ break;
+ case KryptonToastNotificationIcon.SystemApplication:
+ break;
+ case KryptonToastNotificationIcon.Ok:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Ok_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Custom:
+ SetIcon(_basicToastNotificationData.CustomImage != null
+ ? new Bitmap(_basicToastNotificationData.CustomImage)
+ : null);
+ break;
+ case null:
+ SetIcon(null);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+
+ private void UpdateDoNotShowAgainOptionChecked() =>
+ kchkDoNotShowAgain.Checked = _basicToastNotificationData.IsDoNotShowAgainOptionChecked;
+
+ private void UpdateDoNotShowAgainOptionCheckState() =>
+ kchkDoNotShowAgain.CheckState =
+ _basicToastNotificationData.DoNotShowAgainOptionCheckState ?? CheckState.Unchecked;
+
+ private void SetIcon(Bitmap? image) => pbxImage.Image = image;
+
+ private void UpdateLocation()
+ {
+ //Once loaded, position the form, or position it to the bottom left of the screen with added padding
+ Location = _basicToastNotificationData.NotificationLocation ?? new Point(Screen.PrimaryScreen!.WorkingArea.Width - Width - 5,
+ Screen.PrimaryScreen.WorkingArea.Height - Height - 5);
+ }
+
+ private void ReportToastLocation() => klblToastLocation.Text = _basicToastNotificationData.ReportToastLocation ? $"Location: X: {Location.X}, Y: {Location.Y}" : string.Empty;
+
+ private void ShowCloseButton()
+ {
+ CloseBox = _basicToastNotificationData.ShowCloseBox ?? false;
+
+ FormBorderStyle = CloseBox ? FormBorderStyle.Fixed3D : FormBorderStyle.FixedSingle;
+
+ ControlBox = _basicToastNotificationData.ShowCloseBox ?? false;
+ }
+
+ private void VisualToastNotificationBasicWithProgressBarRtlAwareForm_Resize(object? sender, EventArgs e)
+ {
+ if (WindowState == FormWindowState.Maximized)
+ {
+ WindowState = FormWindowState.Normal;
+ }
+ }
+
+ private void VisualToastNotificationBasicWithProgressBarRtlAwareForm_LocationChanged(object? sender, EventArgs e)
+ {
+ if (_basicToastNotificationData.ReportToastLocation)
+ {
+ ReportToastLocation();
+ }
+ }
+
+ private void VisualToastNotificationBasicWithProgressBarRtlAwareForm_Load(object sender, EventArgs e)
+ {
+ UpdateLocation();
+
+ ShowCloseButton();
+
+ _timer.Start();
+
+ _soundPlayer?.Play();
+
+ kbtnDismiss.Text = KryptonManager.Strings.ToastNotificationStrings.Dismiss;
+
+ itbDismiss.Text = KryptonManager.Strings.ToastNotificationStrings.Dismiss;
+ }
+
+ private void kbtnDismiss_Click(object sender, EventArgs e) => Close();
+
+ private void UpdateProgressBarText() => kpbCountDown.Text = _basicToastNotificationData.ShowCountDownSecondsOnProgressBar ? $@"{_basicToastNotificationData.CountDownSeconds - _time}" : string.Empty;
+
+ public new void Show()
+ {
+ TopMost = _basicToastNotificationData.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ if (_basicToastNotificationData.CountDownSeconds != 0)
+ {
+ _countdownValue = _basicToastNotificationData.CountDownSeconds ?? 60;
+
+ kpbCountDown.Maximum = _countdownValue;
+
+ kpbCountDown.Value = _countdownValue;
+
+ UpdateProgressBarText();
+
+ _timer = new Timer();
+
+ _timer.Interval = _basicToastNotificationData.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kpbCountDown.Value -= 1;
+
+ UpdateProgressBarText();
+
+ if (kpbCountDown.Value == kpbCountDown.Minimum)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+
+ base.Show();
+ }
+
+ public new DialogResult ShowDialog()
+ {
+ TopMost = _basicToastNotificationData.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ if (_basicToastNotificationData.IsDoNotShowAgainOptionChecked)
+ {
+ UpdateDoNotShowAgainOptionChecked();
+ }
+
+ if (_basicToastNotificationData.DoNotShowAgainOptionCheckState != null)
+ {
+ UpdateDoNotShowAgainOptionCheckState();
+ }
+
+ if (_basicToastNotificationData.CountDownSeconds != 0)
+ {
+ _countdownValue = _basicToastNotificationData.CountDownSeconds ?? 60;
+
+ kpbCountDown.Maximum = _countdownValue;
+
+ kpbCountDown.Value = _countdownValue;
+
+ UpdateProgressBarText();
+
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss}";
+
+ _timer = new Timer();
+
+ _timer.Interval = _basicToastNotificationData.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kpbCountDown.Value -= 1;
+
+ UpdateProgressBarText();
+
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss}";
+
+ if (_time == _basicToastNotificationData.CountDownSeconds)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog();
+ }
+
+ internal static bool InternalShowWithBooleanReturnValue(KryptonBasicToastNotificationData toastNotificationData)
+ {
+ using var toast = new VisualToastNotificationBasicWithProgressBarRtlAwareForm(toastNotificationData);
+
+ return toast.ShowDialog() == DialogResult.OK && toast.ReturnValue;
+ }
+
+ internal static CheckState InternalShowWithCheckStateReturnValue(KryptonBasicToastNotificationData toastNotificationData)
+ {
+ using var toast = new VisualToastNotificationBasicWithProgressBarRtlAwareForm(toastNotificationData);
+
+ return toast.ShowDialog() == DialogResult.OK
+ ? toast.ReturnCheckBoxStateValue
+ : CheckState.Unchecked;
+ }
+
+ private void itbDismiss_Click(object sender, EventArgs e) => Close();
+
+ internal static void ShowNotification(KryptonBasicToastNotificationData toastNotificationData)
+ {
+ var kt = new VisualToastNotificationBasicWithProgressBarRtlAwareForm(toastNotificationData);
+
+ kt.Show();
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/TestForm/Form6.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Basic/RTL/VisualToastNotificationBasicWithProgressBarRtlAwareForm.resx
similarity index 100%
rename from Source/Krypton Components/TestForm/Form6.resx
rename to Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/Basic/RTL/VisualToastNotificationBasicWithProgressBarRtlAwareForm.resx
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationComboBoxUserInputForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationComboBoxUserInputForm.Designer.cs
new file mode 100644
index 000000000..aee6c30ff
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationComboBoxUserInputForm.Designer.cs
@@ -0,0 +1,335 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualToastNotificationComboBoxUserInputForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.kpnlButtons = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnDismiss = new Krypton.Toolkit.KryptonButton();
+ this.klblToastLocation = new Krypton.Toolkit.KryptonLabel();
+ this.kchkDoNotShowAgain = new Krypton.Toolkit.KryptonCheckBox();
+ this.itbDismiss = new Krypton.Toolkit.InternalToastButton();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kpnlMain = new Krypton.Toolkit.KryptonPanel();
+ this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
+ this.pbxNotificationIcon = new System.Windows.Forms.PictureBox();
+ this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
+ this.kwlNotificationTitle = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kwlNotificationMessage = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kcmbUserInput = new Krypton.Toolkit.KryptonComboBox();
+ this.tlpMain = new System.Windows.Forms.TableLayoutPanel();
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit();
+ this.kpnlButtons.SuspendLayout();
+ this.tableLayoutPanel2.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).BeginInit();
+ this.kpnlMain.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
+ this.kryptonPanel1.SuspendLayout();
+ this.tableLayoutPanel3.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).BeginInit();
+ this.tableLayoutPanel4.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kcmbUserInput)).BeginInit();
+ this.tlpMain.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // kpnlButtons
+ //
+ this.kpnlButtons.Controls.Add(this.tableLayoutPanel2);
+ this.kpnlButtons.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlButtons.Location = new System.Drawing.Point(0, 327);
+ this.kpnlButtons.Name = "kpnlButtons";
+ this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlButtons.Size = new System.Drawing.Size(614, 50);
+ this.kpnlButtons.TabIndex = 3;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel2.ColumnCount = 4;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.Controls.Add(this.kbtnDismiss, 2, 0);
+ this.tableLayoutPanel2.Controls.Add(this.klblToastLocation, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.kchkDoNotShowAgain, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.itbDismiss, 3, 0);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 1;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(614, 49);
+ this.tableLayoutPanel2.TabIndex = 5;
+ //
+ // kbtnDismiss
+ //
+ this.kbtnDismiss.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnDismiss.AutoSize = true;
+ this.kbtnDismiss.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.kbtnDismiss.Location = new System.Drawing.Point(488, 13);
+ this.kbtnDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnDismiss.Name = "kbtnDismiss";
+ this.kbtnDismiss.Size = new System.Drawing.Size(48, 22);
+ this.kbtnDismiss.TabIndex = 2;
+ this.kbtnDismiss.Values.Text = "{0} ({1})";
+ this.kbtnDismiss.Visible = false;
+ //
+ // klblToastLocation
+ //
+ this.klblToastLocation.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.klblToastLocation.Location = new System.Drawing.Point(75, 23);
+ this.klblToastLocation.Margin = new System.Windows.Forms.Padding(10);
+ this.klblToastLocation.Name = "klblToastLocation";
+ this.klblToastLocation.Size = new System.Drawing.Size(6, 2);
+ this.klblToastLocation.TabIndex = 3;
+ this.klblToastLocation.Values.Text = "";
+ //
+ // kchkDoNotShowAgain
+ //
+ this.kchkDoNotShowAgain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kchkDoNotShowAgain.Location = new System.Drawing.Point(10, 10);
+ this.kchkDoNotShowAgain.Margin = new System.Windows.Forms.Padding(10);
+ this.kchkDoNotShowAgain.Name = "kchkDoNotShowAgain";
+ this.kchkDoNotShowAgain.Size = new System.Drawing.Size(45, 29);
+ this.kchkDoNotShowAgain.TabIndex = 4;
+ this.kchkDoNotShowAgain.Values.Text = "CB1";
+ this.kchkDoNotShowAgain.Visible = false;
+ //
+ // itbDismiss
+ //
+ this.itbDismiss.AutoSize = true;
+ this.itbDismiss.IsActionButton = false;
+ this.itbDismiss.IsDismissButton = true;
+ this.itbDismiss.Location = new System.Drawing.Point(556, 13);
+ this.itbDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.itbDismiss.Name = "itbDismiss";
+ this.itbDismiss.NotificationResult = Krypton.Toolkit.KryptonToastNotificationResult.None;
+ this.itbDismiss.Owner = null;
+ this.itbDismiss.ProcessPath = "";
+ this.itbDismiss.Size = new System.Drawing.Size(48, 22);
+ this.itbDismiss.TabIndex = 5;
+ this.itbDismiss.Values.Text = "{0} ({1})";
+ this.itbDismiss.Click += new System.EventHandler(this.itbDismiss_Click);
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(614, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kpnlMain
+ //
+ this.kpnlMain.Controls.Add(this.kryptonPanel1);
+ this.kpnlMain.Controls.Add(this.tlpMain);
+ this.kpnlMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlMain.Location = new System.Drawing.Point(0, 0);
+ this.kpnlMain.Name = "kpnlMain";
+ this.kpnlMain.Size = new System.Drawing.Size(614, 327);
+ this.kpnlMain.TabIndex = 4;
+ //
+ // kryptonPanel1
+ //
+ this.kryptonPanel1.Controls.Add(this.tableLayoutPanel3);
+ this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonPanel1.Name = "kryptonPanel1";
+ this.kryptonPanel1.Size = new System.Drawing.Size(614, 327);
+ this.kryptonPanel1.TabIndex = 4;
+ //
+ // tableLayoutPanel3
+ //
+ this.tableLayoutPanel3.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel3.ColumnCount = 2;
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel3.Controls.Add(this.pbxNotificationIcon, 0, 0);
+ this.tableLayoutPanel3.Controls.Add(this.tableLayoutPanel4, 1, 0);
+ this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel3.Location = new System.Drawing.Point(0, 0);
+ this.tableLayoutPanel3.Name = "tableLayoutPanel3";
+ this.tableLayoutPanel3.RowCount = 1;
+ this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel3.Size = new System.Drawing.Size(614, 327);
+ this.tableLayoutPanel3.TabIndex = 0;
+ //
+ // pbxNotificationIcon
+ //
+ this.pbxNotificationIcon.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pbxNotificationIcon.Location = new System.Drawing.Point(5, 5);
+ this.pbxNotificationIcon.Margin = new System.Windows.Forms.Padding(5);
+ this.pbxNotificationIcon.Name = "pbxNotificationIcon";
+ this.pbxNotificationIcon.Size = new System.Drawing.Size(128, 317);
+ this.pbxNotificationIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pbxNotificationIcon.TabIndex = 0;
+ this.pbxNotificationIcon.TabStop = false;
+ //
+ // tableLayoutPanel4
+ //
+ this.tableLayoutPanel4.ColumnCount = 1;
+ this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel4.Controls.Add(this.kwlNotificationTitle, 0, 0);
+ this.tableLayoutPanel4.Controls.Add(this.kwlNotificationMessage, 0, 1);
+ this.tableLayoutPanel4.Controls.Add(this.kcmbUserInput, 0, 2);
+ this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel4.Location = new System.Drawing.Point(141, 3);
+ this.tableLayoutPanel4.Name = "tableLayoutPanel4";
+ this.tableLayoutPanel4.RowCount = 3;
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel4.Size = new System.Drawing.Size(470, 321);
+ this.tableLayoutPanel4.TabIndex = 1;
+ //
+ // kwlNotificationTitle
+ //
+ this.kwlNotificationTitle.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationTitle.Font = new System.Drawing.Font("Segoe UI", 13.5F, System.Drawing.FontStyle.Bold);
+ this.kwlNotificationTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationTitle.LabelStyle = Krypton.Toolkit.LabelStyle.TitleControl;
+ this.kwlNotificationTitle.Location = new System.Drawing.Point(3, 0);
+ this.kwlNotificationTitle.Name = "kwlNotificationTitle";
+ this.kwlNotificationTitle.Size = new System.Drawing.Size(464, 25);
+ this.kwlNotificationTitle.Text = "kryptonWrapLabel1";
+ this.kwlNotificationTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // kwlNotificationMessage
+ //
+ this.kwlNotificationMessage.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationMessage.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.kwlNotificationMessage.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationMessage.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.kwlNotificationMessage.Location = new System.Drawing.Point(3, 25);
+ this.kwlNotificationMessage.Name = "kwlNotificationMessage";
+ this.kwlNotificationMessage.Size = new System.Drawing.Size(464, 269);
+ this.kwlNotificationMessage.Text = "kryptonWrapLabel2";
+ this.kwlNotificationMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // kcmbUserInput
+ //
+ this.kcmbUserInput.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kcmbUserInput.DropDownWidth = 464;
+ this.kcmbUserInput.IntegralHeight = false;
+ this.kcmbUserInput.Location = new System.Drawing.Point(3, 297);
+ this.kcmbUserInput.Name = "kcmbUserInput";
+ this.kcmbUserInput.Size = new System.Drawing.Size(464, 21);
+ this.kcmbUserInput.StateCommon.ComboBox.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near;
+ this.kcmbUserInput.TabIndex = 3;
+ //
+ // tlpMain
+ //
+ this.tlpMain.BackColor = System.Drawing.Color.Transparent;
+ this.tlpMain.ColumnCount = 2;
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Controls.Add(this.tableLayoutPanel1, 1, 0);
+ this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpMain.Location = new System.Drawing.Point(0, 0);
+ this.tlpMain.Name = "tlpMain";
+ this.tlpMain.RowCount = 1;
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Size = new System.Drawing.Size(614, 327);
+ this.tlpMain.TabIndex = 0;
+ //
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.ColumnCount = 1;
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 3);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 3;
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(608, 321);
+ this.tableLayoutPanel1.TabIndex = 1;
+ //
+ // VisualToastNotificationComboBoxUserInputForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(614, 377);
+ this.Controls.Add(this.kpnlMain);
+ this.Controls.Add(this.kpnlButtons);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualToastNotificationComboBoxUserInputForm";
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.Load += new System.EventHandler(this.VisualToastNotificationComboBoxUserInputForm_Load);
+ this.LocationChanged += new System.EventHandler(this.VisualToastNotificationComboBoxUserInputForm_LocationChanged);
+ this.Resize += new System.EventHandler(this.VisualToastNotificationComboBoxUserInputForm_Resize);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit();
+ this.kpnlButtons.ResumeLayout(false);
+ this.kpnlButtons.PerformLayout();
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).EndInit();
+ this.kpnlMain.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
+ this.kryptonPanel1.ResumeLayout(false);
+ this.tableLayoutPanel3.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).EndInit();
+ this.tableLayoutPanel4.ResumeLayout(false);
+ this.tableLayoutPanel4.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kcmbUserInput)).EndInit();
+ this.tlpMain.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kpnlButtons;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private KryptonPanel kpnlMain;
+ private KryptonPanel kryptonPanel1;
+ private TableLayoutPanel tableLayoutPanel3;
+ private PictureBox pbxNotificationIcon;
+ private TableLayoutPanel tableLayoutPanel4;
+ private KryptonWrapLabel kwlNotificationTitle;
+ private KryptonWrapLabel kwlNotificationMessage;
+ private TableLayoutPanel tlpMain;
+ private TableLayoutPanel tableLayoutPanel1;
+ private KryptonComboBox kcmbUserInput;
+ private TableLayoutPanel tableLayoutPanel2;
+ private KryptonButton kbtnDismiss;
+ private KryptonLabel klblToastLocation;
+ private KryptonCheckBox kchkDoNotShowAgain;
+ private InternalToastButton itbDismiss;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationComboBoxUserInputForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationComboBoxUserInputForm.cs
new file mode 100644
index 000000000..6aabeb744
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationComboBoxUserInputForm.cs
@@ -0,0 +1,344 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+using Timer = System.Windows.Forms.Timer;
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualToastNotificationComboBoxUserInputForm : VisualToastNotificationBaseForm
+ {
+ #region Instance Fields
+
+ private int _time;
+
+ private Timer _timer;
+
+ private readonly KryptonUserInputToastNotificationData _data;
+
+ #endregion
+
+ #region Internal
+
+ internal string UserResponse => kcmbUserInput.Text ?? string.Empty;
+
+ #endregion
+
+ #region Identity
+
+ public VisualToastNotificationComboBoxUserInputForm(KryptonUserInputToastNotificationData data)
+ {
+ InitializeComponent();
+
+ _data = data;
+
+ GotFocus += (sender, args) => kcmbUserInput.Focus();
+
+ UpdateBorderColors();
+ }
+
+ #endregion
+
+ #region Implementation
+
+ private void UpdateBorderColors()
+ {
+ StateCommon!.Border.Color1 = _data.BorderColor1 ?? GlobalStaticValues.EMPTY_COLOR;
+
+ StateCommon!.Border.Color2 = _data.BorderColor2 ?? GlobalStaticValues.EMPTY_COLOR;
+ }
+
+ private void UpdateText()
+ {
+ kwlNotificationTitle.Text = _data.NotificationTitle ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+
+ kwlNotificationMessage.Text = _data.NotificationContent ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+
+ private void UpdateComboBoxItems()
+ {
+ if (_data.UserInputList.Count > 0)
+ {
+ foreach (var item in _data.UserInputList)
+ {
+ kcmbUserInput.Items.Add(item);
+ }
+
+ kcmbUserInput.SelectedIndex = _data.SelectedIndex ?? 1;
+ }
+
+ kcmbUserInput.DropDownStyle = _data.UserInputComboBoxStyle ?? ComboBoxStyle.DropDown;
+ }
+
+ private void SetIcon(Bitmap? image) => pbxNotificationIcon.Image = image;
+
+ private void UpdateLocation()
+ {
+ //Once loaded, position the form, or position it to the bottom left of the screen with added padding
+ Location = _data.NotificationLocation ?? new Point(Screen.PrimaryScreen!.WorkingArea.Width - Width - 5,
+ Screen.PrimaryScreen.WorkingArea.Height - Height - 5);
+ }
+
+ private void UpdateIcon()
+ {
+ switch (_data.NotificationIcon)
+ {
+ case KryptonToastNotificationIcon.None:
+ SetIcon(null);
+ break;
+ case KryptonToastNotificationIcon.Hand:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Hand_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemHand:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Hand.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Question:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Question_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemQuestion:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Question.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Exclamation:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.SystemExclamation:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Exclamation.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Asterisk:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Asterisk_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemAsterisk:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Stop:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Stop_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Error:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Critical_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Warning:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.Information:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Shield:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
+ }
+ else if (OSUtilities.IsWindowsTen)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_10_128_x_128);
+ }
+ else
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128);
+ }
+ break;
+ case KryptonToastNotificationIcon.WindowsLogo:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_11_128_128);
+ }
+ else if (OSUtilities.IsWindowsEight || OSUtilities.IsWindowsEightPointOne || OSUtilities.IsWindowsTen)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_8_81_10_128_128);
+ }
+ else
+ {
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.WinLogo.ToBitmap(), new Size(128, 128)));
+ }
+ break;
+ case KryptonToastNotificationIcon.Application:
+ SetIcon(GraphicsExtensions.ScaleImage(_data.ApplicationIcon.ToBitmap(), new Size(128, 128)));
+ break;
+ case KryptonToastNotificationIcon.SystemApplication:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Ok:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Ok_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Custom:
+ SetIcon(_data.CustomImage != null
+ ? new Bitmap(_data.CustomImage)
+ : null);
+ break;
+ case null:
+ SetIcon(null);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+
+ private void ShowCloseButton()
+ {
+ CloseBox = _data.ShowCloseBox ?? false;
+
+ FormBorderStyle = CloseBox ? FormBorderStyle.Fixed3D : FormBorderStyle.FixedSingle;
+
+ ControlBox = _data.ShowCloseBox ?? false;
+ }
+
+ private void VisualToastNotificationComboBoxUserInputForm_Load(object sender, EventArgs e)
+ {
+ UpdateIcon();
+
+ UpdateLocation();
+
+ ShowCloseButton();
+
+ _timer.Start();
+
+ _data.DisplayDebugData(_data);
+ }
+
+ private void VisualToastNotificationComboBoxUserInputForm_Resize(object sender, EventArgs e)
+ {
+ if (WindowState == FormWindowState.Maximized)
+ {
+ WindowState = FormWindowState.Normal;
+ }
+ }
+
+ private void VisualToastNotificationComboBoxUserInputForm_LocationChanged(object sender, EventArgs e)
+ {
+ if (_data.ReportToastLocation)
+ {
+ ReportToastLocation();
+ }
+ }
+
+ private void ReportToastLocation() => klblToastLocation.Text = _data.ReportToastLocation ? $"Location: X: {Location.X}, Y: {Location.Y}" : string.Empty;
+
+ private void UpdateInputBoxStyle() =>
+ kcmbUserInput.DropDownStyle = _data.UserInputComboBoxStyle ?? ComboBoxStyle.DropDown;
+
+ private void UpdateOwner(IWin32Window? owner)
+ {
+ //_data.o
+ }
+
+ private void itbDismiss_Click(object sender, EventArgs e) => Close();
+
+ public new DialogResult ShowDialog()
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateComboBoxItems();
+
+ UpdateLocation();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ if (_time == _data.CountDownSeconds)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog();
+ }
+
+ public new DialogResult ShowDialog(IWin32Window owner)
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateComboBoxItems();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ if (_time == _data.CountDownSeconds)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog(owner);
+ }
+
+ public new KryptonToastNotificationResult ShowToastNotificationResult()
+ {
+
+ return base.ShowToastNotificationResult();
+ }
+
+ public new KryptonToastNotificationResult ShowToastNotificationResult(IWin32Window owner)
+ {
+
+ return base.ShowToastNotificationResult(owner);
+ }
+
+ internal static string ShowNotification(KryptonUserInputToastNotificationData data)
+ {
+ var owner = data.ToastHost ?? FromHandle(PI.GetActiveWindow());
+
+ using var toast = new VisualToastNotificationComboBoxUserInputForm(data);
+
+ if (owner != null)
+ {
+ toast.StartPosition = owner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
+
+ return toast.ShowDialog(owner!) == DialogResult.OK ? toast.UserResponse : string.Empty;
+ }
+ else
+ {
+ return toast.ShowDialog() == DialogResult.OK ? toast.UserResponse : string.Empty;
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationComboBoxUserInputForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationComboBoxUserInputForm.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationComboBoxUserInputForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationDateTimeUserInputForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationDateTimeUserInputForm.Designer.cs
new file mode 100644
index 000000000..d6cbe08b0
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationDateTimeUserInputForm.Designer.cs
@@ -0,0 +1,328 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualToastNotificationDateTimeUserInputForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.kpnlButtons = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnDismiss = new Krypton.Toolkit.KryptonButton();
+ this.klblToastLocation = new Krypton.Toolkit.KryptonLabel();
+ this.kchkDoNotShowAgain = new Krypton.Toolkit.KryptonCheckBox();
+ this.itbDismiss = new Krypton.Toolkit.InternalToastButton();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kpnlMain = new Krypton.Toolkit.KryptonPanel();
+ this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
+ this.pbxNotificationIcon = new System.Windows.Forms.PictureBox();
+ this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
+ this.kwlNotificationTitle = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kwlNotificationMessage = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kdtpUserInput = new Krypton.Toolkit.KryptonDateTimePicker();
+ this.tlpMain = new System.Windows.Forms.TableLayoutPanel();
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit();
+ this.kpnlButtons.SuspendLayout();
+ this.tableLayoutPanel2.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).BeginInit();
+ this.kpnlMain.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
+ this.kryptonPanel1.SuspendLayout();
+ this.tableLayoutPanel3.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).BeginInit();
+ this.tableLayoutPanel4.SuspendLayout();
+ this.tlpMain.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // kpnlButtons
+ //
+ this.kpnlButtons.Controls.Add(this.tableLayoutPanel2);
+ this.kpnlButtons.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlButtons.Location = new System.Drawing.Point(0, 327);
+ this.kpnlButtons.Name = "kpnlButtons";
+ this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlButtons.Size = new System.Drawing.Size(614, 50);
+ this.kpnlButtons.TabIndex = 4;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel2.ColumnCount = 4;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.Controls.Add(this.kbtnDismiss, 2, 0);
+ this.tableLayoutPanel2.Controls.Add(this.klblToastLocation, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.kchkDoNotShowAgain, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.itbDismiss, 3, 0);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 1;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(614, 49);
+ this.tableLayoutPanel2.TabIndex = 5;
+ //
+ // kbtnDismiss
+ //
+ this.kbtnDismiss.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnDismiss.AutoSize = true;
+ this.kbtnDismiss.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.kbtnDismiss.Location = new System.Drawing.Point(488, 13);
+ this.kbtnDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnDismiss.Name = "kbtnDismiss";
+ this.kbtnDismiss.Size = new System.Drawing.Size(48, 22);
+ this.kbtnDismiss.TabIndex = 2;
+ this.kbtnDismiss.Values.Text = "{0} ({1})";
+ this.kbtnDismiss.Visible = false;
+ //
+ // klblToastLocation
+ //
+ this.klblToastLocation.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.klblToastLocation.Location = new System.Drawing.Point(75, 23);
+ this.klblToastLocation.Margin = new System.Windows.Forms.Padding(10);
+ this.klblToastLocation.Name = "klblToastLocation";
+ this.klblToastLocation.Size = new System.Drawing.Size(6, 2);
+ this.klblToastLocation.TabIndex = 3;
+ this.klblToastLocation.Values.Text = "";
+ //
+ // kchkDoNotShowAgain
+ //
+ this.kchkDoNotShowAgain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kchkDoNotShowAgain.Location = new System.Drawing.Point(10, 10);
+ this.kchkDoNotShowAgain.Margin = new System.Windows.Forms.Padding(10);
+ this.kchkDoNotShowAgain.Name = "kchkDoNotShowAgain";
+ this.kchkDoNotShowAgain.Size = new System.Drawing.Size(45, 29);
+ this.kchkDoNotShowAgain.TabIndex = 4;
+ this.kchkDoNotShowAgain.Values.Text = "CB1";
+ this.kchkDoNotShowAgain.Visible = false;
+ //
+ // itbDismiss
+ //
+ this.itbDismiss.AutoSize = true;
+ this.itbDismiss.IsActionButton = false;
+ this.itbDismiss.IsDismissButton = true;
+ this.itbDismiss.Location = new System.Drawing.Point(556, 13);
+ this.itbDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.itbDismiss.Name = "itbDismiss";
+ this.itbDismiss.NotificationResult = Krypton.Toolkit.KryptonToastNotificationResult.None;
+ this.itbDismiss.Owner = null;
+ this.itbDismiss.ProcessPath = "";
+ this.itbDismiss.Size = new System.Drawing.Size(48, 22);
+ this.itbDismiss.TabIndex = 5;
+ this.itbDismiss.Values.Text = "{0} ({1})";
+ this.itbDismiss.Click += new System.EventHandler(this.itbDismiss_Click);
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(614, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kpnlMain
+ //
+ this.kpnlMain.Controls.Add(this.kryptonPanel1);
+ this.kpnlMain.Controls.Add(this.tlpMain);
+ this.kpnlMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlMain.Location = new System.Drawing.Point(0, 0);
+ this.kpnlMain.Name = "kpnlMain";
+ this.kpnlMain.Size = new System.Drawing.Size(614, 327);
+ this.kpnlMain.TabIndex = 5;
+ //
+ // kryptonPanel1
+ //
+ this.kryptonPanel1.Controls.Add(this.tableLayoutPanel3);
+ this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonPanel1.Name = "kryptonPanel1";
+ this.kryptonPanel1.Size = new System.Drawing.Size(614, 327);
+ this.kryptonPanel1.TabIndex = 4;
+ //
+ // tableLayoutPanel3
+ //
+ this.tableLayoutPanel3.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel3.ColumnCount = 2;
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel3.Controls.Add(this.pbxNotificationIcon, 0, 0);
+ this.tableLayoutPanel3.Controls.Add(this.tableLayoutPanel4, 1, 0);
+ this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel3.Location = new System.Drawing.Point(0, 0);
+ this.tableLayoutPanel3.Name = "tableLayoutPanel3";
+ this.tableLayoutPanel3.RowCount = 1;
+ this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel3.Size = new System.Drawing.Size(614, 327);
+ this.tableLayoutPanel3.TabIndex = 0;
+ //
+ // pbxNotificationIcon
+ //
+ this.pbxNotificationIcon.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pbxNotificationIcon.Location = new System.Drawing.Point(5, 5);
+ this.pbxNotificationIcon.Margin = new System.Windows.Forms.Padding(5);
+ this.pbxNotificationIcon.Name = "pbxNotificationIcon";
+ this.pbxNotificationIcon.Size = new System.Drawing.Size(128, 317);
+ this.pbxNotificationIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pbxNotificationIcon.TabIndex = 0;
+ this.pbxNotificationIcon.TabStop = false;
+ //
+ // tableLayoutPanel4
+ //
+ this.tableLayoutPanel4.ColumnCount = 1;
+ this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel4.Controls.Add(this.kwlNotificationTitle, 0, 0);
+ this.tableLayoutPanel4.Controls.Add(this.kwlNotificationMessage, 0, 1);
+ this.tableLayoutPanel4.Controls.Add(this.kdtpUserInput, 0, 2);
+ this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel4.Location = new System.Drawing.Point(141, 3);
+ this.tableLayoutPanel4.Name = "tableLayoutPanel4";
+ this.tableLayoutPanel4.RowCount = 3;
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel4.Size = new System.Drawing.Size(470, 321);
+ this.tableLayoutPanel4.TabIndex = 1;
+ //
+ // kwlNotificationTitle
+ //
+ this.kwlNotificationTitle.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationTitle.Font = new System.Drawing.Font("Segoe UI", 13.5F, System.Drawing.FontStyle.Bold);
+ this.kwlNotificationTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationTitle.LabelStyle = Krypton.Toolkit.LabelStyle.TitleControl;
+ this.kwlNotificationTitle.Location = new System.Drawing.Point(3, 0);
+ this.kwlNotificationTitle.Name = "kwlNotificationTitle";
+ this.kwlNotificationTitle.Size = new System.Drawing.Size(464, 25);
+ this.kwlNotificationTitle.Text = "kryptonWrapLabel1";
+ this.kwlNotificationTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // kwlNotificationMessage
+ //
+ this.kwlNotificationMessage.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationMessage.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.kwlNotificationMessage.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationMessage.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.kwlNotificationMessage.Location = new System.Drawing.Point(3, 25);
+ this.kwlNotificationMessage.Name = "kwlNotificationMessage";
+ this.kwlNotificationMessage.Size = new System.Drawing.Size(464, 269);
+ this.kwlNotificationMessage.Text = "kryptonWrapLabel2";
+ this.kwlNotificationMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // kdtpUserInput
+ //
+ this.kdtpUserInput.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kdtpUserInput.Location = new System.Drawing.Point(3, 297);
+ this.kdtpUserInput.Name = "kdtpUserInput";
+ this.kdtpUserInput.Size = new System.Drawing.Size(464, 21);
+ this.kdtpUserInput.TabIndex = 2;
+ //
+ // tlpMain
+ //
+ this.tlpMain.BackColor = System.Drawing.Color.Transparent;
+ this.tlpMain.ColumnCount = 2;
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Controls.Add(this.tableLayoutPanel1, 1, 0);
+ this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpMain.Location = new System.Drawing.Point(0, 0);
+ this.tlpMain.Name = "tlpMain";
+ this.tlpMain.RowCount = 1;
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Size = new System.Drawing.Size(614, 327);
+ this.tlpMain.TabIndex = 0;
+ //
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.ColumnCount = 1;
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 3);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 3;
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(608, 321);
+ this.tableLayoutPanel1.TabIndex = 1;
+ //
+ // VisualToastNotificationDateTimeUserInputForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(614, 377);
+ this.Controls.Add(this.kpnlMain);
+ this.Controls.Add(this.kpnlButtons);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualToastNotificationDateTimeUserInputForm";
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.Load += new System.EventHandler(this.VisualToastNotificationDateTimeUserInputForm_Load);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit();
+ this.kpnlButtons.ResumeLayout(false);
+ this.kpnlButtons.PerformLayout();
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).EndInit();
+ this.kpnlMain.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
+ this.kryptonPanel1.ResumeLayout(false);
+ this.tableLayoutPanel3.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).EndInit();
+ this.tableLayoutPanel4.ResumeLayout(false);
+ this.tableLayoutPanel4.PerformLayout();
+ this.tlpMain.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kpnlButtons;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private KryptonPanel kpnlMain;
+ private KryptonPanel kryptonPanel1;
+ private TableLayoutPanel tableLayoutPanel3;
+ private PictureBox pbxNotificationIcon;
+ private TableLayoutPanel tableLayoutPanel4;
+ private KryptonWrapLabel kwlNotificationTitle;
+ private KryptonWrapLabel kwlNotificationMessage;
+ private TableLayoutPanel tlpMain;
+ private TableLayoutPanel tableLayoutPanel1;
+ private KryptonDateTimePicker kdtpUserInput;
+ private TableLayoutPanel tableLayoutPanel2;
+ private KryptonButton kbtnDismiss;
+ private KryptonLabel klblToastLocation;
+ private KryptonCheckBox kchkDoNotShowAgain;
+ private InternalToastButton itbDismiss;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationDateTimeUserInputForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationDateTimeUserInputForm.cs
new file mode 100644
index 000000000..b5a66d535
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationDateTimeUserInputForm.cs
@@ -0,0 +1,303 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+using Timer = System.Windows.Forms.Timer;
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualToastNotificationDateTimeUserInputForm : VisualToastNotificationBaseForm
+ {
+ #region Instance Fields
+
+ private int _time;
+
+ private Timer _timer;
+
+ private readonly KryptonUserInputToastNotificationData _data;
+
+ #endregion
+
+ #region Internal
+
+ internal DateTime UserResponse => kdtpUserInput.Value;
+
+ #endregion
+
+ #region Identity
+
+ public VisualToastNotificationDateTimeUserInputForm(KryptonUserInputToastNotificationData data)
+ {
+ InitializeComponent();
+
+ _data = data;
+
+ GotFocus += (sender, args) => kdtpUserInput.Focus();
+
+ UpdateBorderColors();
+ }
+
+ #endregion
+
+ #region Impementation
+
+ private void UpdateBorderColors()
+ {
+ StateCommon!.Border.Color1 = _data.BorderColor1 ?? GlobalStaticValues.EMPTY_COLOR;
+
+ StateCommon!.Border.Color2 = _data.BorderColor2 ?? GlobalStaticValues.EMPTY_COLOR;
+ }
+
+ private void UpdateText()
+ {
+ kwlNotificationTitle.Text = _data.NotificationTitle;
+
+ kwlNotificationMessage.Text = _data.NotificationContent;
+ }
+
+ private void UpdateInitialValues()
+ {
+ // Set initial date and time values
+ kdtpUserInput.Value = _data.InitialDateTimeValue ?? GlobalStaticValues.DEFAULT_DATE_TIME_VALUE;
+
+ kdtpUserInput.Format = _data.DateTimeFormat ?? DateTimePickerFormat.Long;
+
+ kdtpUserInput.CustomFormat = _data.CustomDateTimeFormat ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+
+ kdtpUserInput.MaxDate = _data.MaximumDateTimeValue ?? DateTime.MaxValue;
+
+ kdtpUserInput.MinDate = _data.MinimumDateTimeValue ?? DateTime.MinValue;
+ }
+
+ private void SetIcon(Bitmap? image) => pbxNotificationIcon.Image = image;
+
+ private void UpdateLocation()
+ {
+ //Once loaded, position the form, or position it to the bottom left of the screen with added padding
+ Location = _data.NotificationLocation ?? new Point(Screen.PrimaryScreen!.WorkingArea.Width - Width - 5,
+ Screen.PrimaryScreen.WorkingArea.Height - Height - 5);
+ }
+
+ private void UpdateIcon()
+ {
+ switch (_data.NotificationIcon)
+ {
+ case KryptonToastNotificationIcon.None:
+ SetIcon(null);
+ break;
+ case KryptonToastNotificationIcon.Hand:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Hand_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemHand:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Hand.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Question:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Question_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemQuestion:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Question.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Exclamation:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.SystemExclamation:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Exclamation.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Asterisk:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Asterisk_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemAsterisk:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Stop:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Stop_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Error:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Critical_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Warning:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.Information:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Shield:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
+ }
+ else if (OSUtilities.IsWindowsTen)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_10_128_x_128);
+ }
+ else
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128);
+ }
+ break;
+ case KryptonToastNotificationIcon.WindowsLogo:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_11_128_128);
+ }
+ else if (OSUtilities.IsWindowsEight || OSUtilities.IsWindowsEightPointOne || OSUtilities.IsWindowsTen)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_8_81_10_128_128);
+ }
+ else
+ {
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.WinLogo.ToBitmap(), new Size(128, 128)));
+ }
+ break;
+ case KryptonToastNotificationIcon.Application:
+ SetIcon(GraphicsExtensions.ScaleImage(_data.ApplicationIcon.ToBitmap(), new Size(128, 128)));
+ break;
+ case KryptonToastNotificationIcon.SystemApplication:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Ok:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Ok_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Custom:
+ SetIcon(_data.CustomImage != null
+ ? new Bitmap(_data.CustomImage)
+ : null);
+ break;
+ case null:
+ SetIcon(null);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+
+ private void VisualToastNotificationDateTimeUserInputForm_Load(object sender, EventArgs e)
+ {
+ UpdateIcon();
+
+ UpdateLocation();
+
+ ShowCloseButton();
+
+ _timer.Start();
+ }
+
+ private void ShowCloseButton()
+ {
+ CloseBox = _data.ShowCloseBox ?? false;
+
+ FormBorderStyle = CloseBox ? FormBorderStyle.Fixed3D : FormBorderStyle.FixedSingle;
+
+ ControlBox = _data.ShowCloseBox ?? false;
+ }
+
+ private void itbDismiss_Click(object sender, EventArgs e) => Close();
+
+ public new DialogResult ShowDialog()
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ UpdateLocation();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ if (_time == _data.CountDownSeconds)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog();
+ }
+
+ public new DialogResult ShowDialog(IWin32Window owner)
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ if (_time == _data.CountDownSeconds)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog(owner);
+ }
+
+ internal static DateTime ShowNotification(KryptonUserInputToastNotificationData data)
+ {
+ var owner = data.ToastHost ?? FromHandle(PI.GetActiveWindow());
+
+ using var toast = new VisualToastNotificationDateTimeUserInputForm(data);
+
+ if (owner != null)
+ {
+ toast.StartPosition = owner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
+
+ return toast.ShowDialog(owner!) == DialogResult.OK ? toast.UserResponse : GlobalStaticValues.DEFAULT_DATE_TIME_VALUE;
+ }
+ else
+ {
+ return toast.ShowDialog() == DialogResult.OK ? toast.UserResponse : GlobalStaticValues.DEFAULT_DATE_TIME_VALUE;
+ }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationDateTimeUserInputForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationDateTimeUserInputForm.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationDateTimeUserInputForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationDomainUpDownUserInputForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationDomainUpDownUserInputForm.Designer.cs
new file mode 100644
index 000000000..2abbf86fd
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationDomainUpDownUserInputForm.Designer.cs
@@ -0,0 +1,328 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualToastNotificationDomainUpDownUserInputForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.kpnlButtons = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnDismiss = new Krypton.Toolkit.KryptonButton();
+ this.klblToastLocation = new Krypton.Toolkit.KryptonLabel();
+ this.kchkDoNotShowAgain = new Krypton.Toolkit.KryptonCheckBox();
+ this.itbDismiss = new Krypton.Toolkit.InternalToastButton();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kpnlMain = new Krypton.Toolkit.KryptonPanel();
+ this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
+ this.pbxNotificationIcon = new System.Windows.Forms.PictureBox();
+ this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
+ this.kwlNotificationTitle = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kwlNotificationMessage = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kdudUserInput = new Krypton.Toolkit.KryptonDomainUpDown();
+ this.tlpMain = new System.Windows.Forms.TableLayoutPanel();
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit();
+ this.kpnlButtons.SuspendLayout();
+ this.tableLayoutPanel2.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).BeginInit();
+ this.kpnlMain.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
+ this.kryptonPanel1.SuspendLayout();
+ this.tableLayoutPanel3.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).BeginInit();
+ this.tableLayoutPanel4.SuspendLayout();
+ this.tlpMain.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // kpnlButtons
+ //
+ this.kpnlButtons.Controls.Add(this.tableLayoutPanel2);
+ this.kpnlButtons.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlButtons.Location = new System.Drawing.Point(0, 327);
+ this.kpnlButtons.Name = "kpnlButtons";
+ this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlButtons.Size = new System.Drawing.Size(614, 50);
+ this.kpnlButtons.TabIndex = 5;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel2.ColumnCount = 4;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.Controls.Add(this.kbtnDismiss, 2, 0);
+ this.tableLayoutPanel2.Controls.Add(this.klblToastLocation, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.kchkDoNotShowAgain, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.itbDismiss, 3, 0);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 1;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(614, 49);
+ this.tableLayoutPanel2.TabIndex = 5;
+ //
+ // kbtnDismiss
+ //
+ this.kbtnDismiss.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnDismiss.AutoSize = true;
+ this.kbtnDismiss.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.kbtnDismiss.Location = new System.Drawing.Point(488, 13);
+ this.kbtnDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnDismiss.Name = "kbtnDismiss";
+ this.kbtnDismiss.Size = new System.Drawing.Size(48, 22);
+ this.kbtnDismiss.TabIndex = 2;
+ this.kbtnDismiss.Values.Text = "{0} ({1})";
+ this.kbtnDismiss.Visible = false;
+ //
+ // klblToastLocation
+ //
+ this.klblToastLocation.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.klblToastLocation.Location = new System.Drawing.Point(75, 23);
+ this.klblToastLocation.Margin = new System.Windows.Forms.Padding(10);
+ this.klblToastLocation.Name = "klblToastLocation";
+ this.klblToastLocation.Size = new System.Drawing.Size(6, 2);
+ this.klblToastLocation.TabIndex = 3;
+ this.klblToastLocation.Values.Text = "";
+ //
+ // kchkDoNotShowAgain
+ //
+ this.kchkDoNotShowAgain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kchkDoNotShowAgain.Location = new System.Drawing.Point(10, 10);
+ this.kchkDoNotShowAgain.Margin = new System.Windows.Forms.Padding(10);
+ this.kchkDoNotShowAgain.Name = "kchkDoNotShowAgain";
+ this.kchkDoNotShowAgain.Size = new System.Drawing.Size(45, 29);
+ this.kchkDoNotShowAgain.TabIndex = 4;
+ this.kchkDoNotShowAgain.Values.Text = "CB1";
+ this.kchkDoNotShowAgain.Visible = false;
+ //
+ // itbDismiss
+ //
+ this.itbDismiss.AutoSize = true;
+ this.itbDismiss.IsActionButton = false;
+ this.itbDismiss.IsDismissButton = true;
+ this.itbDismiss.Location = new System.Drawing.Point(556, 13);
+ this.itbDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.itbDismiss.Name = "itbDismiss";
+ this.itbDismiss.NotificationResult = Krypton.Toolkit.KryptonToastNotificationResult.None;
+ this.itbDismiss.Owner = null;
+ this.itbDismiss.ProcessPath = "";
+ this.itbDismiss.Size = new System.Drawing.Size(48, 22);
+ this.itbDismiss.TabIndex = 5;
+ this.itbDismiss.Values.Text = "{0} ({1})";
+ this.itbDismiss.Click += new System.EventHandler(this.itbDismiss_Click);
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(614, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kpnlMain
+ //
+ this.kpnlMain.Controls.Add(this.kryptonPanel1);
+ this.kpnlMain.Controls.Add(this.tlpMain);
+ this.kpnlMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlMain.Location = new System.Drawing.Point(0, 0);
+ this.kpnlMain.Name = "kpnlMain";
+ this.kpnlMain.Size = new System.Drawing.Size(614, 327);
+ this.kpnlMain.TabIndex = 6;
+ //
+ // kryptonPanel1
+ //
+ this.kryptonPanel1.Controls.Add(this.tableLayoutPanel3);
+ this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonPanel1.Name = "kryptonPanel1";
+ this.kryptonPanel1.Size = new System.Drawing.Size(614, 327);
+ this.kryptonPanel1.TabIndex = 4;
+ //
+ // tableLayoutPanel3
+ //
+ this.tableLayoutPanel3.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel3.ColumnCount = 2;
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel3.Controls.Add(this.pbxNotificationIcon, 0, 0);
+ this.tableLayoutPanel3.Controls.Add(this.tableLayoutPanel4, 1, 0);
+ this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel3.Location = new System.Drawing.Point(0, 0);
+ this.tableLayoutPanel3.Name = "tableLayoutPanel3";
+ this.tableLayoutPanel3.RowCount = 1;
+ this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel3.Size = new System.Drawing.Size(614, 327);
+ this.tableLayoutPanel3.TabIndex = 0;
+ //
+ // pbxNotificationIcon
+ //
+ this.pbxNotificationIcon.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pbxNotificationIcon.Location = new System.Drawing.Point(5, 5);
+ this.pbxNotificationIcon.Margin = new System.Windows.Forms.Padding(5);
+ this.pbxNotificationIcon.Name = "pbxNotificationIcon";
+ this.pbxNotificationIcon.Size = new System.Drawing.Size(128, 317);
+ this.pbxNotificationIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pbxNotificationIcon.TabIndex = 0;
+ this.pbxNotificationIcon.TabStop = false;
+ //
+ // tableLayoutPanel4
+ //
+ this.tableLayoutPanel4.ColumnCount = 1;
+ this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel4.Controls.Add(this.kwlNotificationTitle, 0, 0);
+ this.tableLayoutPanel4.Controls.Add(this.kwlNotificationMessage, 0, 1);
+ this.tableLayoutPanel4.Controls.Add(this.kdudUserInput, 0, 2);
+ this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel4.Location = new System.Drawing.Point(141, 3);
+ this.tableLayoutPanel4.Name = "tableLayoutPanel4";
+ this.tableLayoutPanel4.RowCount = 3;
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel4.Size = new System.Drawing.Size(470, 321);
+ this.tableLayoutPanel4.TabIndex = 1;
+ //
+ // kwlNotificationTitle
+ //
+ this.kwlNotificationTitle.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationTitle.Font = new System.Drawing.Font("Segoe UI", 13.5F, System.Drawing.FontStyle.Bold);
+ this.kwlNotificationTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationTitle.LabelStyle = Krypton.Toolkit.LabelStyle.TitleControl;
+ this.kwlNotificationTitle.Location = new System.Drawing.Point(3, 0);
+ this.kwlNotificationTitle.Name = "kwlNotificationTitle";
+ this.kwlNotificationTitle.Size = new System.Drawing.Size(464, 25);
+ this.kwlNotificationTitle.Text = "kryptonWrapLabel1";
+ this.kwlNotificationTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // kwlNotificationMessage
+ //
+ this.kwlNotificationMessage.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationMessage.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.kwlNotificationMessage.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationMessage.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.kwlNotificationMessage.Location = new System.Drawing.Point(3, 25);
+ this.kwlNotificationMessage.Name = "kwlNotificationMessage";
+ this.kwlNotificationMessage.Size = new System.Drawing.Size(464, 268);
+ this.kwlNotificationMessage.Text = "kryptonWrapLabel2";
+ this.kwlNotificationMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // kdudUserInput
+ //
+ this.kdudUserInput.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kdudUserInput.Location = new System.Drawing.Point(3, 296);
+ this.kdudUserInput.Name = "kdudUserInput";
+ this.kdudUserInput.Size = new System.Drawing.Size(464, 22);
+ this.kdudUserInput.TabIndex = 2;
+ //
+ // tlpMain
+ //
+ this.tlpMain.BackColor = System.Drawing.Color.Transparent;
+ this.tlpMain.ColumnCount = 2;
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Controls.Add(this.tableLayoutPanel1, 1, 0);
+ this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpMain.Location = new System.Drawing.Point(0, 0);
+ this.tlpMain.Name = "tlpMain";
+ this.tlpMain.RowCount = 1;
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Size = new System.Drawing.Size(614, 327);
+ this.tlpMain.TabIndex = 0;
+ //
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.ColumnCount = 1;
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 3);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 3;
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(608, 321);
+ this.tableLayoutPanel1.TabIndex = 1;
+ //
+ // VisualToastNotificationDomainUpDownUserInputForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(614, 377);
+ this.Controls.Add(this.kpnlMain);
+ this.Controls.Add(this.kpnlButtons);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualToastNotificationDomainUpDownUserInputForm";
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.Load += new System.EventHandler(this.VisualToastNotificationDomainUpDownUserInputForm_Load);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit();
+ this.kpnlButtons.ResumeLayout(false);
+ this.kpnlButtons.PerformLayout();
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).EndInit();
+ this.kpnlMain.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
+ this.kryptonPanel1.ResumeLayout(false);
+ this.tableLayoutPanel3.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).EndInit();
+ this.tableLayoutPanel4.ResumeLayout(false);
+ this.tableLayoutPanel4.PerformLayout();
+ this.tlpMain.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kpnlButtons;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private KryptonPanel kpnlMain;
+ private KryptonPanel kryptonPanel1;
+ private TableLayoutPanel tableLayoutPanel3;
+ private PictureBox pbxNotificationIcon;
+ private TableLayoutPanel tableLayoutPanel4;
+ private KryptonWrapLabel kwlNotificationTitle;
+ private KryptonWrapLabel kwlNotificationMessage;
+ private TableLayoutPanel tlpMain;
+ private TableLayoutPanel tableLayoutPanel1;
+ private KryptonDomainUpDown kdudUserInput;
+ private TableLayoutPanel tableLayoutPanel2;
+ private KryptonButton kbtnDismiss;
+ private KryptonLabel klblToastLocation;
+ private KryptonCheckBox kchkDoNotShowAgain;
+ private InternalToastButton itbDismiss;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationDomainUpDownUserInputForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationDomainUpDownUserInputForm.cs
new file mode 100644
index 000000000..eacd019b6
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationDomainUpDownUserInputForm.cs
@@ -0,0 +1,303 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+using Timer = System.Windows.Forms.Timer;
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualToastNotificationDomainUpDownUserInputForm : VisualToastNotificationBaseForm
+ {
+ #region Instance Fields
+
+ private int _time;
+
+ private Timer _timer;
+
+ private readonly KryptonUserInputToastNotificationData _data;
+
+ #endregion
+
+ #region Internal
+
+ internal string UserResponse => kdudUserInput.Text ?? string.Empty;
+
+ #endregion
+
+ #region Identity
+
+ public VisualToastNotificationDomainUpDownUserInputForm(KryptonUserInputToastNotificationData data)
+ {
+ InitializeComponent();
+
+ _data = data;
+
+ GotFocus += (sender, args) => kdudUserInput.Focus();
+
+ UpdateBorderColors();
+ }
+
+ #endregion
+
+ #region Implementation
+
+ private void UpdateBorderColors()
+ {
+ StateCommon!.Border.Color1 = _data.BorderColor1 ?? GlobalStaticValues.EMPTY_COLOR;
+
+ StateCommon!.Border.Color2 = _data.BorderColor2 ?? GlobalStaticValues.EMPTY_COLOR;
+ }
+
+ private void UpdateText()
+ {
+ kwlNotificationTitle.Text = _data.NotificationTitle;
+
+ kwlNotificationMessage.Text = _data.NotificationContent;
+ }
+
+ private void UpdateInitialValues()
+ {
+ // Set initial date and time values
+ if (_data.UserInputList.Count > 0)
+ {
+ foreach (var item in _data.UserInputList)
+ {
+ kdudUserInput.Items.Add(item);
+ }
+
+ kdudUserInput.SelectedIndex = _data.SelectedIndex ?? 1;
+ }
+ }
+
+ private void SetIcon(Bitmap? image) => pbxNotificationIcon.Image = image;
+
+ private void UpdateLocation()
+ {
+ //Once loaded, position the form, or position it to the bottom left of the screen with added padding
+ Location = _data.NotificationLocation ?? new Point(Screen.PrimaryScreen!.WorkingArea.Width - Width - 5,
+ Screen.PrimaryScreen.WorkingArea.Height - Height - 5);
+ }
+
+ private void VisualToastNotificationDomainUpDownUserInputForm_Load(object sender, EventArgs e)
+ {
+ UpdateIcon();
+
+ UpdateLocation();
+
+ ShowCloseButton();
+
+ _timer.Start();
+ }
+
+ private void ShowCloseButton()
+ {
+ CloseBox = _data.ShowCloseBox ?? false;
+
+ FormBorderStyle = CloseBox ? FormBorderStyle.Fixed3D : FormBorderStyle.FixedSingle;
+
+ ControlBox = _data.ShowCloseBox ?? false;
+ }
+
+ private void UpdateIcon()
+ {
+ switch (_data.NotificationIcon)
+ {
+ case KryptonToastNotificationIcon.None:
+ SetIcon(null);
+ break;
+ case KryptonToastNotificationIcon.Hand:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Hand_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemHand:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Hand.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Question:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Question_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemQuestion:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Question.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Exclamation:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.SystemExclamation:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Exclamation.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Asterisk:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Asterisk_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemAsterisk:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Stop:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Stop_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Error:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Critical_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Warning:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.Information:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Shield:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
+ }
+ else if (OSUtilities.IsWindowsTen)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_10_128_x_128);
+ }
+ else
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128);
+ }
+ break;
+ case KryptonToastNotificationIcon.WindowsLogo:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_11_128_128);
+ }
+ else if (OSUtilities.IsWindowsEight || OSUtilities.IsWindowsEightPointOne || OSUtilities.IsWindowsTen)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_8_81_10_128_128);
+ }
+ else
+ {
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.WinLogo.ToBitmap(), new Size(128, 128)));
+ }
+ break;
+ case KryptonToastNotificationIcon.Application:
+ SetIcon(GraphicsExtensions.ScaleImage(_data.ApplicationIcon.ToBitmap(), new Size(128, 128)));
+ break;
+ case KryptonToastNotificationIcon.SystemApplication:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Ok:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Ok_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Custom:
+ SetIcon(_data.CustomImage != null
+ ? new Bitmap(_data.CustomImage)
+ : null);
+ break;
+ case null:
+ SetIcon(null);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+
+ private void itbDismiss_Click(object sender, EventArgs e) => Close();
+
+ public new DialogResult ShowDialog()
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ UpdateLocation();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ if (_time == _data.CountDownSeconds)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog();
+ }
+
+ public new DialogResult ShowDialog(IWin32Window owner)
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ if (_time == _data.CountDownSeconds)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog(owner);
+ }
+
+ internal static string ShowNotification(KryptonUserInputToastNotificationData data)
+ {
+ var owner = data.ToastHost ?? FromHandle(PI.GetActiveWindow());
+
+ using var toast = new VisualToastNotificationDomainUpDownUserInputForm(data);
+
+ if (owner != null)
+ {
+ toast.StartPosition = owner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
+
+ return toast.ShowDialog(owner!) == DialogResult.OK ? toast.UserResponse : string.Empty;
+ }
+ else
+ {
+ return toast.ShowDialog() == DialogResult.OK ? toast.UserResponse : string.Empty;
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationDomainUpDownUserInputForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationDomainUpDownUserInputForm.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationDomainUpDownUserInputForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationMaskedTextBoxUserInputForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationMaskedTextBoxUserInputForm.Designer.cs
new file mode 100644
index 000000000..fbe1766bc
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationMaskedTextBoxUserInputForm.Designer.cs
@@ -0,0 +1,329 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualToastNotificationMaskedTextBoxUserInputForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.kpnlButtons = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnDismiss = new Krypton.Toolkit.KryptonButton();
+ this.klblToastLocation = new Krypton.Toolkit.KryptonLabel();
+ this.kchkDoNotShowAgain = new Krypton.Toolkit.KryptonCheckBox();
+ this.itbDismiss = new Krypton.Toolkit.InternalToastButton();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kpnlMain = new Krypton.Toolkit.KryptonPanel();
+ this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
+ this.pbxNotificationIcon = new System.Windows.Forms.PictureBox();
+ this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
+ this.kwlNotificationTitle = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kwlNotificationMessage = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kmtxtUserInput = new Krypton.Toolkit.KryptonMaskedTextBox();
+ this.tlpMain = new System.Windows.Forms.TableLayoutPanel();
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit();
+ this.kpnlButtons.SuspendLayout();
+ this.tableLayoutPanel2.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).BeginInit();
+ this.kpnlMain.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
+ this.kryptonPanel1.SuspendLayout();
+ this.tableLayoutPanel3.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).BeginInit();
+ this.tableLayoutPanel4.SuspendLayout();
+ this.tlpMain.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // kpnlButtons
+ //
+ this.kpnlButtons.Controls.Add(this.tableLayoutPanel2);
+ this.kpnlButtons.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlButtons.Location = new System.Drawing.Point(0, 327);
+ this.kpnlButtons.Name = "kpnlButtons";
+ this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlButtons.Size = new System.Drawing.Size(614, 50);
+ this.kpnlButtons.TabIndex = 5;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel2.ColumnCount = 4;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.Controls.Add(this.kbtnDismiss, 2, 0);
+ this.tableLayoutPanel2.Controls.Add(this.klblToastLocation, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.kchkDoNotShowAgain, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.itbDismiss, 3, 0);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 1;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(614, 49);
+ this.tableLayoutPanel2.TabIndex = 5;
+ //
+ // kbtnDismiss
+ //
+ this.kbtnDismiss.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnDismiss.AutoSize = true;
+ this.kbtnDismiss.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.kbtnDismiss.Location = new System.Drawing.Point(488, 13);
+ this.kbtnDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnDismiss.Name = "kbtnDismiss";
+ this.kbtnDismiss.Size = new System.Drawing.Size(48, 22);
+ this.kbtnDismiss.TabIndex = 2;
+ this.kbtnDismiss.Values.Text = "{0} ({1})";
+ this.kbtnDismiss.Visible = false;
+ //
+ // klblToastLocation
+ //
+ this.klblToastLocation.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.klblToastLocation.Location = new System.Drawing.Point(75, 23);
+ this.klblToastLocation.Margin = new System.Windows.Forms.Padding(10);
+ this.klblToastLocation.Name = "klblToastLocation";
+ this.klblToastLocation.Size = new System.Drawing.Size(6, 2);
+ this.klblToastLocation.TabIndex = 3;
+ this.klblToastLocation.Values.Text = "";
+ //
+ // kchkDoNotShowAgain
+ //
+ this.kchkDoNotShowAgain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kchkDoNotShowAgain.Location = new System.Drawing.Point(10, 10);
+ this.kchkDoNotShowAgain.Margin = new System.Windows.Forms.Padding(10);
+ this.kchkDoNotShowAgain.Name = "kchkDoNotShowAgain";
+ this.kchkDoNotShowAgain.Size = new System.Drawing.Size(45, 29);
+ this.kchkDoNotShowAgain.TabIndex = 4;
+ this.kchkDoNotShowAgain.Values.Text = "CB1";
+ this.kchkDoNotShowAgain.Visible = false;
+ //
+ // itbDismiss
+ //
+ this.itbDismiss.AutoSize = true;
+ this.itbDismiss.IsActionButton = false;
+ this.itbDismiss.IsDismissButton = true;
+ this.itbDismiss.Location = new System.Drawing.Point(556, 13);
+ this.itbDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.itbDismiss.Name = "itbDismiss";
+ this.itbDismiss.NotificationResult = Krypton.Toolkit.KryptonToastNotificationResult.None;
+ this.itbDismiss.Owner = null;
+ this.itbDismiss.ProcessPath = "";
+ this.itbDismiss.Size = new System.Drawing.Size(48, 22);
+ this.itbDismiss.TabIndex = 5;
+ this.itbDismiss.Values.Text = "{0} ({1})";
+ this.itbDismiss.Click += new System.EventHandler(this.itbDismiss_Click);
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(614, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kpnlMain
+ //
+ this.kpnlMain.Controls.Add(this.kryptonPanel1);
+ this.kpnlMain.Controls.Add(this.tlpMain);
+ this.kpnlMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlMain.Location = new System.Drawing.Point(0, 0);
+ this.kpnlMain.Name = "kpnlMain";
+ this.kpnlMain.Size = new System.Drawing.Size(614, 327);
+ this.kpnlMain.TabIndex = 6;
+ //
+ // kryptonPanel1
+ //
+ this.kryptonPanel1.Controls.Add(this.tableLayoutPanel3);
+ this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonPanel1.Name = "kryptonPanel1";
+ this.kryptonPanel1.Size = new System.Drawing.Size(614, 327);
+ this.kryptonPanel1.TabIndex = 4;
+ //
+ // tableLayoutPanel3
+ //
+ this.tableLayoutPanel3.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel3.ColumnCount = 2;
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel3.Controls.Add(this.pbxNotificationIcon, 0, 0);
+ this.tableLayoutPanel3.Controls.Add(this.tableLayoutPanel4, 1, 0);
+ this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel3.Location = new System.Drawing.Point(0, 0);
+ this.tableLayoutPanel3.Name = "tableLayoutPanel3";
+ this.tableLayoutPanel3.RowCount = 1;
+ this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel3.Size = new System.Drawing.Size(614, 327);
+ this.tableLayoutPanel3.TabIndex = 0;
+ //
+ // pbxNotificationIcon
+ //
+ this.pbxNotificationIcon.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pbxNotificationIcon.Location = new System.Drawing.Point(5, 5);
+ this.pbxNotificationIcon.Margin = new System.Windows.Forms.Padding(5);
+ this.pbxNotificationIcon.Name = "pbxNotificationIcon";
+ this.pbxNotificationIcon.Size = new System.Drawing.Size(128, 317);
+ this.pbxNotificationIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pbxNotificationIcon.TabIndex = 0;
+ this.pbxNotificationIcon.TabStop = false;
+ //
+ // tableLayoutPanel4
+ //
+ this.tableLayoutPanel4.ColumnCount = 1;
+ this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel4.Controls.Add(this.kwlNotificationTitle, 0, 0);
+ this.tableLayoutPanel4.Controls.Add(this.kwlNotificationMessage, 0, 1);
+ this.tableLayoutPanel4.Controls.Add(this.kmtxtUserInput, 0, 2);
+ this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel4.Location = new System.Drawing.Point(141, 3);
+ this.tableLayoutPanel4.Name = "tableLayoutPanel4";
+ this.tableLayoutPanel4.RowCount = 3;
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel4.Size = new System.Drawing.Size(470, 321);
+ this.tableLayoutPanel4.TabIndex = 1;
+ //
+ // kwlNotificationTitle
+ //
+ this.kwlNotificationTitle.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationTitle.Font = new System.Drawing.Font("Segoe UI", 13.5F, System.Drawing.FontStyle.Bold);
+ this.kwlNotificationTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationTitle.LabelStyle = Krypton.Toolkit.LabelStyle.TitleControl;
+ this.kwlNotificationTitle.Location = new System.Drawing.Point(3, 0);
+ this.kwlNotificationTitle.Name = "kwlNotificationTitle";
+ this.kwlNotificationTitle.Size = new System.Drawing.Size(464, 25);
+ this.kwlNotificationTitle.Text = "kryptonWrapLabel1";
+ this.kwlNotificationTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // kwlNotificationMessage
+ //
+ this.kwlNotificationMessage.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationMessage.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.kwlNotificationMessage.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationMessage.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.kwlNotificationMessage.Location = new System.Drawing.Point(3, 25);
+ this.kwlNotificationMessage.Name = "kwlNotificationMessage";
+ this.kwlNotificationMessage.Size = new System.Drawing.Size(464, 267);
+ this.kwlNotificationMessage.Text = "kryptonWrapLabel2";
+ this.kwlNotificationMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // kmtxtUserInput
+ //
+ this.kmtxtUserInput.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kmtxtUserInput.Location = new System.Drawing.Point(3, 295);
+ this.kmtxtUserInput.Name = "kmtxtUserInput";
+ this.kmtxtUserInput.Size = new System.Drawing.Size(464, 23);
+ this.kmtxtUserInput.TabIndex = 2;
+ this.kmtxtUserInput.Text = "kryptonMaskedTextBox1";
+ //
+ // tlpMain
+ //
+ this.tlpMain.BackColor = System.Drawing.Color.Transparent;
+ this.tlpMain.ColumnCount = 2;
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Controls.Add(this.tableLayoutPanel1, 1, 0);
+ this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpMain.Location = new System.Drawing.Point(0, 0);
+ this.tlpMain.Name = "tlpMain";
+ this.tlpMain.RowCount = 1;
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Size = new System.Drawing.Size(614, 327);
+ this.tlpMain.TabIndex = 0;
+ //
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.ColumnCount = 1;
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 3);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 3;
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(608, 321);
+ this.tableLayoutPanel1.TabIndex = 1;
+ //
+ // VisualToastNotificationMaskedTextBoxUserInputForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(614, 377);
+ this.Controls.Add(this.kpnlMain);
+ this.Controls.Add(this.kpnlButtons);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualToastNotificationMaskedTextBoxUserInputForm";
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.Load += new System.EventHandler(this.VisualToastNotificationMaskedTextBoxUserInputForm_Load);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit();
+ this.kpnlButtons.ResumeLayout(false);
+ this.kpnlButtons.PerformLayout();
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).EndInit();
+ this.kpnlMain.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
+ this.kryptonPanel1.ResumeLayout(false);
+ this.tableLayoutPanel3.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).EndInit();
+ this.tableLayoutPanel4.ResumeLayout(false);
+ this.tableLayoutPanel4.PerformLayout();
+ this.tlpMain.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kpnlButtons;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private KryptonPanel kpnlMain;
+ private KryptonPanel kryptonPanel1;
+ private TableLayoutPanel tableLayoutPanel3;
+ private PictureBox pbxNotificationIcon;
+ private TableLayoutPanel tableLayoutPanel4;
+ private KryptonWrapLabel kwlNotificationTitle;
+ private KryptonWrapLabel kwlNotificationMessage;
+ private TableLayoutPanel tlpMain;
+ private TableLayoutPanel tableLayoutPanel1;
+ private KryptonMaskedTextBox kmtxtUserInput;
+ private TableLayoutPanel tableLayoutPanel2;
+ private KryptonButton kbtnDismiss;
+ private KryptonLabel klblToastLocation;
+ private KryptonCheckBox kchkDoNotShowAgain;
+ private InternalToastButton itbDismiss;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationMaskedTextBoxUserInputForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationMaskedTextBoxUserInputForm.cs
new file mode 100644
index 000000000..74b522c53
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationMaskedTextBoxUserInputForm.cs
@@ -0,0 +1,295 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+using Timer = System.Windows.Forms.Timer;
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualToastNotificationMaskedTextBoxUserInputForm : VisualToastNotificationBaseForm
+ {
+ #region Instance Fields
+
+ private int _time;
+
+ private Timer _timer;
+
+ private readonly KryptonUserInputToastNotificationData _data;
+
+ #endregion
+
+ #region Internal
+
+ internal string UserResponse => kmtxtUserInput.Text ?? string.Empty;
+
+ #endregion
+
+ #region Identity
+
+ public VisualToastNotificationMaskedTextBoxUserInputForm(KryptonUserInputToastNotificationData data)
+ {
+ InitializeComponent();
+
+ _data = data;
+
+ GotFocus += (sender, args) => kmtxtUserInput.Focus();
+
+ UpdateBorderColors();
+ }
+
+ #endregion
+
+ #region Implementation
+
+ private void UpdateBorderColors()
+ {
+ StateCommon!.Border.Color1 = _data.BorderColor1 ?? GlobalStaticValues.EMPTY_COLOR;
+
+ StateCommon!.Border.Color2 = _data.BorderColor2 ?? GlobalStaticValues.EMPTY_COLOR;
+ }
+
+ private void UpdateText()
+ {
+ kwlNotificationTitle.Text = _data.NotificationTitle;
+
+ kwlNotificationMessage.Text = _data.NotificationContent;
+ }
+
+ private void UpdateInitialValues()
+ {
+ // Set initial date and time values
+ kmtxtUserInput.Text = GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+
+ private void SetIcon(Bitmap? image) => pbxNotificationIcon.Image = image;
+
+ private void UpdateLocation()
+ {
+ //Once loaded, position the form, or position it to the bottom left of the screen with added padding
+ Location = _data.NotificationLocation ?? new Point(Screen.PrimaryScreen!.WorkingArea.Width - Width - 5,
+ Screen.PrimaryScreen.WorkingArea.Height - Height - 5);
+ }
+
+ private void UpdateIcon()
+ {
+ switch (_data.NotificationIcon)
+ {
+ case KryptonToastNotificationIcon.None:
+ SetIcon(null);
+ break;
+ case KryptonToastNotificationIcon.Hand:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Hand_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemHand:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Hand.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Question:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Question_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemQuestion:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Question.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Exclamation:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.SystemExclamation:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Exclamation.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Asterisk:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Asterisk_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemAsterisk:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Stop:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Stop_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Error:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Critical_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Warning:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.Information:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Shield:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
+ }
+ else if (OSUtilities.IsWindowsTen)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_10_128_x_128);
+ }
+ else
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128);
+ }
+ break;
+ case KryptonToastNotificationIcon.WindowsLogo:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_11_128_128);
+ }
+ else if (OSUtilities.IsWindowsEight || OSUtilities.IsWindowsEightPointOne || OSUtilities.IsWindowsTen)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_8_81_10_128_128);
+ }
+ else
+ {
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.WinLogo.ToBitmap(), new Size(128, 128)));
+ }
+ break;
+ case KryptonToastNotificationIcon.Application:
+ SetIcon(GraphicsExtensions.ScaleImage(_data.ApplicationIcon.ToBitmap(), new Size(128, 128)));
+ break;
+ case KryptonToastNotificationIcon.SystemApplication:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Ok:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Ok_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Custom:
+ SetIcon(_data.CustomImage != null
+ ? new Bitmap(_data.CustomImage)
+ : null);
+ break;
+ case null:
+ SetIcon(null);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+
+ private void VisualToastNotificationMaskedTextBoxUserInputForm_Load(object sender, EventArgs e)
+ {
+ UpdateIcon();
+
+ UpdateLocation();
+
+ ShowCloseButton();
+
+ _timer.Start();
+ }
+
+ private void ShowCloseButton()
+ {
+ CloseBox = _data.ShowCloseBox ?? false;
+
+ FormBorderStyle = CloseBox ? FormBorderStyle.Fixed3D : FormBorderStyle.FixedSingle;
+
+ ControlBox = _data.ShowCloseBox ?? false;
+ }
+
+ private void itbDismiss_Click(object sender, EventArgs e) => Close();
+
+ public new DialogResult ShowDialog()
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ UpdateLocation();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ if (_time == _data.CountDownSeconds)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog();
+ }
+
+ public new DialogResult ShowDialog(IWin32Window owner)
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ if (_time == _data.CountDownSeconds)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog(owner);
+ }
+
+ internal static string ShowNotification(KryptonUserInputToastNotificationData data)
+ {
+ var owner = data.ToastHost ?? FromHandle(PI.GetActiveWindow());
+
+ using var toast = new VisualToastNotificationMaskedTextBoxUserInputForm(data);
+
+ if (owner != null)
+ {
+ toast.StartPosition = owner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
+
+ return toast.ShowDialog(owner!) == DialogResult.OK ? toast.UserResponse : GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+ else
+ {
+ return toast.ShowDialog() == DialogResult.OK ? toast.UserResponse : GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationMaskedTextBoxUserInputForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationMaskedTextBoxUserInputForm.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationMaskedTextBoxUserInputForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationNUDUserInputForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationNUDUserInputForm.Designer.cs
new file mode 100644
index 000000000..c1f89e363
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationNUDUserInputForm.Designer.cs
@@ -0,0 +1,348 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualToastNotificationNUDUserInputForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.kpnlButtons = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnDismiss = new Krypton.Toolkit.KryptonButton();
+ this.klblToastLocation = new Krypton.Toolkit.KryptonLabel();
+ this.kchkDoNotShowAgain = new Krypton.Toolkit.KryptonCheckBox();
+ this.itbDismiss = new Krypton.Toolkit.InternalToastButton();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kpnlMain = new Krypton.Toolkit.KryptonPanel();
+ this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
+ this.pbxNotificationIcon = new System.Windows.Forms.PictureBox();
+ this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
+ this.kwlNotificationTitle = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kwlNotificationMessage = new Krypton.Toolkit.KryptonWrapLabel();
+ this.knudUserInput = new Krypton.Toolkit.KryptonNumericUpDown();
+ this.tlpMain = new System.Windows.Forms.TableLayoutPanel();
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit();
+ this.kpnlButtons.SuspendLayout();
+ this.tableLayoutPanel2.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).BeginInit();
+ this.kpnlMain.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
+ this.kryptonPanel1.SuspendLayout();
+ this.tableLayoutPanel3.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).BeginInit();
+ this.tableLayoutPanel4.SuspendLayout();
+ this.tlpMain.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // kpnlButtons
+ //
+ this.kpnlButtons.Controls.Add(this.tableLayoutPanel2);
+ this.kpnlButtons.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlButtons.Location = new System.Drawing.Point(0, 327);
+ this.kpnlButtons.Name = "kpnlButtons";
+ this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlButtons.Size = new System.Drawing.Size(614, 50);
+ this.kpnlButtons.TabIndex = 6;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel2.ColumnCount = 4;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.Controls.Add(this.kbtnDismiss, 2, 0);
+ this.tableLayoutPanel2.Controls.Add(this.klblToastLocation, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.kchkDoNotShowAgain, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.itbDismiss, 3, 0);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 1;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(614, 49);
+ this.tableLayoutPanel2.TabIndex = 5;
+ //
+ // kbtnDismiss
+ //
+ this.kbtnDismiss.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnDismiss.AutoSize = true;
+ this.kbtnDismiss.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.kbtnDismiss.Location = new System.Drawing.Point(488, 13);
+ this.kbtnDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnDismiss.Name = "kbtnDismiss";
+ this.kbtnDismiss.Size = new System.Drawing.Size(48, 22);
+ this.kbtnDismiss.TabIndex = 2;
+ this.kbtnDismiss.Values.Text = "{0} ({1})";
+ this.kbtnDismiss.Visible = false;
+ //
+ // klblToastLocation
+ //
+ this.klblToastLocation.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.klblToastLocation.Location = new System.Drawing.Point(75, 23);
+ this.klblToastLocation.Margin = new System.Windows.Forms.Padding(10);
+ this.klblToastLocation.Name = "klblToastLocation";
+ this.klblToastLocation.Size = new System.Drawing.Size(6, 2);
+ this.klblToastLocation.TabIndex = 3;
+ this.klblToastLocation.Values.Text = "";
+ //
+ // kchkDoNotShowAgain
+ //
+ this.kchkDoNotShowAgain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kchkDoNotShowAgain.Location = new System.Drawing.Point(10, 10);
+ this.kchkDoNotShowAgain.Margin = new System.Windows.Forms.Padding(10);
+ this.kchkDoNotShowAgain.Name = "kchkDoNotShowAgain";
+ this.kchkDoNotShowAgain.Size = new System.Drawing.Size(45, 29);
+ this.kchkDoNotShowAgain.TabIndex = 4;
+ this.kchkDoNotShowAgain.Values.Text = "CB1";
+ this.kchkDoNotShowAgain.Visible = false;
+ //
+ // itbDismiss
+ //
+ this.itbDismiss.AutoSize = true;
+ this.itbDismiss.IsActionButton = false;
+ this.itbDismiss.IsDismissButton = true;
+ this.itbDismiss.Location = new System.Drawing.Point(556, 13);
+ this.itbDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.itbDismiss.Name = "itbDismiss";
+ this.itbDismiss.NotificationResult = Krypton.Toolkit.KryptonToastNotificationResult.None;
+ this.itbDismiss.Owner = null;
+ this.itbDismiss.ProcessPath = "";
+ this.itbDismiss.Size = new System.Drawing.Size(48, 22);
+ this.itbDismiss.TabIndex = 5;
+ this.itbDismiss.Values.Text = "{0} ({1})";
+ this.itbDismiss.Click += new System.EventHandler(this.itbDismiss_Click);
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(614, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kpnlMain
+ //
+ this.kpnlMain.Controls.Add(this.kryptonPanel1);
+ this.kpnlMain.Controls.Add(this.tlpMain);
+ this.kpnlMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlMain.Location = new System.Drawing.Point(0, 0);
+ this.kpnlMain.Name = "kpnlMain";
+ this.kpnlMain.Size = new System.Drawing.Size(614, 327);
+ this.kpnlMain.TabIndex = 7;
+ //
+ // kryptonPanel1
+ //
+ this.kryptonPanel1.Controls.Add(this.tableLayoutPanel3);
+ this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonPanel1.Name = "kryptonPanel1";
+ this.kryptonPanel1.Size = new System.Drawing.Size(614, 327);
+ this.kryptonPanel1.TabIndex = 4;
+ //
+ // tableLayoutPanel3
+ //
+ this.tableLayoutPanel3.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel3.ColumnCount = 2;
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel3.Controls.Add(this.pbxNotificationIcon, 0, 0);
+ this.tableLayoutPanel3.Controls.Add(this.tableLayoutPanel4, 1, 0);
+ this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel3.Location = new System.Drawing.Point(0, 0);
+ this.tableLayoutPanel3.Name = "tableLayoutPanel3";
+ this.tableLayoutPanel3.RowCount = 1;
+ this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel3.Size = new System.Drawing.Size(614, 327);
+ this.tableLayoutPanel3.TabIndex = 0;
+ //
+ // pbxNotificationIcon
+ //
+ this.pbxNotificationIcon.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pbxNotificationIcon.Location = new System.Drawing.Point(5, 5);
+ this.pbxNotificationIcon.Margin = new System.Windows.Forms.Padding(5);
+ this.pbxNotificationIcon.Name = "pbxNotificationIcon";
+ this.pbxNotificationIcon.Size = new System.Drawing.Size(128, 317);
+ this.pbxNotificationIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pbxNotificationIcon.TabIndex = 0;
+ this.pbxNotificationIcon.TabStop = false;
+ //
+ // tableLayoutPanel4
+ //
+ this.tableLayoutPanel4.ColumnCount = 1;
+ this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel4.Controls.Add(this.kwlNotificationTitle, 0, 0);
+ this.tableLayoutPanel4.Controls.Add(this.kwlNotificationMessage, 0, 1);
+ this.tableLayoutPanel4.Controls.Add(this.knudUserInput, 0, 2);
+ this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel4.Location = new System.Drawing.Point(141, 3);
+ this.tableLayoutPanel4.Name = "tableLayoutPanel4";
+ this.tableLayoutPanel4.RowCount = 3;
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel4.Size = new System.Drawing.Size(470, 321);
+ this.tableLayoutPanel4.TabIndex = 1;
+ //
+ // kwlNotificationTitle
+ //
+ this.kwlNotificationTitle.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationTitle.Font = new System.Drawing.Font("Segoe UI", 13.5F, System.Drawing.FontStyle.Bold);
+ this.kwlNotificationTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationTitle.LabelStyle = Krypton.Toolkit.LabelStyle.TitleControl;
+ this.kwlNotificationTitle.Location = new System.Drawing.Point(3, 0);
+ this.kwlNotificationTitle.Name = "kwlNotificationTitle";
+ this.kwlNotificationTitle.Size = new System.Drawing.Size(464, 25);
+ this.kwlNotificationTitle.Text = "kryptonWrapLabel1";
+ this.kwlNotificationTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // kwlNotificationMessage
+ //
+ this.kwlNotificationMessage.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationMessage.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.kwlNotificationMessage.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationMessage.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.kwlNotificationMessage.Location = new System.Drawing.Point(3, 25);
+ this.kwlNotificationMessage.Name = "kwlNotificationMessage";
+ this.kwlNotificationMessage.Size = new System.Drawing.Size(464, 268);
+ this.kwlNotificationMessage.Text = "kryptonWrapLabel2";
+ this.kwlNotificationMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // knudUserInput
+ //
+ this.knudUserInput.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.knudUserInput.Increment = new decimal(new int[] {
+ 1,
+ 0,
+ 0,
+ 0});
+ this.knudUserInput.Location = new System.Drawing.Point(3, 296);
+ this.knudUserInput.Maximum = new decimal(new int[] {
+ 100,
+ 0,
+ 0,
+ 0});
+ this.knudUserInput.Minimum = new decimal(new int[] {
+ 0,
+ 0,
+ 0,
+ 0});
+ this.knudUserInput.Name = "knudUserInput";
+ this.knudUserInput.Size = new System.Drawing.Size(464, 22);
+ this.knudUserInput.TabIndex = 2;
+ this.knudUserInput.Value = new decimal(new int[] {
+ 0,
+ 0,
+ 0,
+ 0});
+ //
+ // tlpMain
+ //
+ this.tlpMain.BackColor = System.Drawing.Color.Transparent;
+ this.tlpMain.ColumnCount = 2;
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Controls.Add(this.tableLayoutPanel1, 1, 0);
+ this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpMain.Location = new System.Drawing.Point(0, 0);
+ this.tlpMain.Name = "tlpMain";
+ this.tlpMain.RowCount = 1;
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Size = new System.Drawing.Size(614, 327);
+ this.tlpMain.TabIndex = 0;
+ //
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.ColumnCount = 1;
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 3);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 3;
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(608, 321);
+ this.tableLayoutPanel1.TabIndex = 1;
+ //
+ // VisualToastNotificationNumericUpDownUserInputForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(614, 377);
+ this.Controls.Add(this.kpnlMain);
+ this.Controls.Add(this.kpnlButtons);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualToastNotificationNumericUpDownUserInputForm";
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.Load += new System.EventHandler(this.VisualToastNotificationNumericUpDownUserInputForm_Load);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit();
+ this.kpnlButtons.ResumeLayout(false);
+ this.kpnlButtons.PerformLayout();
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).EndInit();
+ this.kpnlMain.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
+ this.kryptonPanel1.ResumeLayout(false);
+ this.tableLayoutPanel3.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).EndInit();
+ this.tableLayoutPanel4.ResumeLayout(false);
+ this.tableLayoutPanel4.PerformLayout();
+ this.tlpMain.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kpnlButtons;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private KryptonPanel kpnlMain;
+ private KryptonPanel kryptonPanel1;
+ private TableLayoutPanel tableLayoutPanel3;
+ private PictureBox pbxNotificationIcon;
+ private TableLayoutPanel tableLayoutPanel4;
+ private KryptonWrapLabel kwlNotificationTitle;
+ private KryptonWrapLabel kwlNotificationMessage;
+ private TableLayoutPanel tlpMain;
+ private TableLayoutPanel tableLayoutPanel1;
+ private KryptonNumericUpDown knudUserInput;
+ private TableLayoutPanel tableLayoutPanel2;
+ private KryptonButton kbtnDismiss;
+ private KryptonLabel klblToastLocation;
+ private KryptonCheckBox kchkDoNotShowAgain;
+ private InternalToastButton itbDismiss;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationNUDUserInputForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationNUDUserInputForm.cs
new file mode 100644
index 000000000..7bc3e24c9
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationNUDUserInputForm.cs
@@ -0,0 +1,299 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+using Timer = System.Windows.Forms.Timer;
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualToastNotificationNUDUserInputForm : VisualToastNotificationBaseForm
+ {
+ #region Instance Fields
+
+ private int _time;
+
+ private Timer _timer;
+
+ private readonly KryptonUserInputToastNotificationData _data;
+
+ #endregion
+
+ #region Internal
+
+ internal int UserResponse => Convert.ToInt32(knudUserInput.Value);
+
+ #endregion
+
+ #region Identity
+
+ public VisualToastNotificationNUDUserInputForm(KryptonUserInputToastNotificationData data)
+ {
+ InitializeComponent();
+
+ _data = data;
+
+ GotFocus += (sender, args) => knudUserInput.Focus();
+
+ UpdateBorderColors();
+ }
+
+ #endregion
+
+ #region Implementation
+
+ private void UpdateBorderColors()
+ {
+ StateCommon!.Border.Color1 = _data.BorderColor1 ?? GlobalStaticValues.EMPTY_COLOR;
+
+ StateCommon!.Border.Color2 = _data.BorderColor2 ?? GlobalStaticValues.EMPTY_COLOR;
+ }
+
+ private void UpdateText()
+ {
+ kwlNotificationTitle.Text = _data.NotificationTitle;
+
+ kwlNotificationMessage.Text = _data.NotificationContent;
+ }
+
+ private void UpdateInitialValues()
+ {
+ // Set initial date and time values
+ knudUserInput.Value = _data.InitialNumericUpDownValue ?? 0;
+
+ knudUserInput.Maximum = _data.MaximumNumericUpDownValue ?? 100;
+
+ knudUserInput.Minimum = _data.MinimumNumericUpDownValue ?? 0;
+ }
+
+ private void SetIcon(Bitmap? image) => pbxNotificationIcon.Image = image;
+
+ private void UpdateLocation()
+ {
+ //Once loaded, position the form, or position it to the bottom left of the screen with added padding
+ Location = _data.NotificationLocation ?? new Point(Screen.PrimaryScreen!.WorkingArea.Width - Width - 5,
+ Screen.PrimaryScreen.WorkingArea.Height - Height - 5);
+ }
+
+ private void UpdateIcon()
+ {
+ switch (_data.NotificationIcon)
+ {
+ case KryptonToastNotificationIcon.None:
+ SetIcon(null);
+ break;
+ case KryptonToastNotificationIcon.Hand:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Hand_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemHand:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Hand.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Question:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Question_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemQuestion:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Question.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Exclamation:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.SystemExclamation:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Exclamation.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Asterisk:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Asterisk_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemAsterisk:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Stop:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Stop_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Error:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Critical_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Warning:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.Information:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Shield:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
+ }
+ else if (OSUtilities.IsWindowsTen)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_10_128_x_128);
+ }
+ else
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128);
+ }
+ break;
+ case KryptonToastNotificationIcon.WindowsLogo:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_11_128_128);
+ }
+ else if (OSUtilities.IsWindowsEight || OSUtilities.IsWindowsEightPointOne || OSUtilities.IsWindowsTen)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_8_81_10_128_128);
+ }
+ else
+ {
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.WinLogo.ToBitmap(), new Size(128, 128)));
+ }
+ break;
+ case KryptonToastNotificationIcon.Application:
+ SetIcon(GraphicsExtensions.ScaleImage(_data.ApplicationIcon.ToBitmap(), new Size(128, 128)));
+ break;
+ case KryptonToastNotificationIcon.SystemApplication:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Ok:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Ok_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Custom:
+ SetIcon(_data.CustomImage != null
+ ? new Bitmap(_data.CustomImage)
+ : null);
+ break;
+ case null:
+ SetIcon(null);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+
+ private void VisualToastNotificationNumericUpDownUserInputForm_Load(object sender, EventArgs e)
+ {
+ UpdateIcon();
+
+ UpdateLocation();
+
+ ShowCloseButton();
+
+ _timer.Start();
+ }
+
+ private void ShowCloseButton()
+ {
+ CloseBox = _data.ShowCloseBox ?? false;
+
+ FormBorderStyle = CloseBox ? FormBorderStyle.Fixed3D : FormBorderStyle.FixedSingle;
+
+ ControlBox = _data.ShowCloseBox ?? false;
+ }
+
+ private void itbDismiss_Click(object sender, EventArgs e) => Close();
+
+ public new DialogResult ShowDialog()
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ UpdateLocation();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ if (_time == _data.CountDownSeconds)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog();
+ }
+
+ public new DialogResult ShowDialog(IWin32Window owner)
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ if (_time == _data.CountDownSeconds)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog(owner);
+ }
+
+ internal static decimal ShowNotification(KryptonUserInputToastNotificationData data)
+ {
+ var owner = data.ToastHost ?? FromHandle(PI.GetActiveWindow());
+
+ using var toast = new VisualToastNotificationNUDUserInputForm(data);
+
+ if (owner != null)
+ {
+ toast.StartPosition = owner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
+
+ return toast.ShowDialog(owner!) == DialogResult.OK ? toast.UserResponse : 0;
+ }
+ else
+ {
+ return toast.ShowDialog() == DialogResult.OK ? toast.UserResponse : 0;
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationNUDUserInputForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationNUDUserInputForm.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationNUDUserInputForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationTextBoxUserInputForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationTextBoxUserInputForm.Designer.cs
new file mode 100644
index 000000000..4a6797ed9
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationTextBoxUserInputForm.Designer.cs
@@ -0,0 +1,328 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualToastNotificationTextBoxUserInputForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.kpnlButtons = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnDismiss = new Krypton.Toolkit.KryptonButton();
+ this.klblToastLocation = new Krypton.Toolkit.KryptonLabel();
+ this.kchkDoNotShowAgain = new Krypton.Toolkit.KryptonCheckBox();
+ this.itbDismiss = new Krypton.Toolkit.InternalToastButton();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kpnlMain = new Krypton.Toolkit.KryptonPanel();
+ this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
+ this.pbxNotificationIcon = new System.Windows.Forms.PictureBox();
+ this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
+ this.kwlNotificationTitle = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kwlNotificationMessage = new Krypton.Toolkit.KryptonWrapLabel();
+ this.ktxtUserInput = new Krypton.Toolkit.KryptonTextBox();
+ this.tlpMain = new System.Windows.Forms.TableLayoutPanel();
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit();
+ this.kpnlButtons.SuspendLayout();
+ this.tableLayoutPanel2.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).BeginInit();
+ this.kpnlMain.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
+ this.kryptonPanel1.SuspendLayout();
+ this.tableLayoutPanel3.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).BeginInit();
+ this.tableLayoutPanel4.SuspendLayout();
+ this.tlpMain.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // kpnlButtons
+ //
+ this.kpnlButtons.Controls.Add(this.tableLayoutPanel2);
+ this.kpnlButtons.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlButtons.Location = new System.Drawing.Point(0, 327);
+ this.kpnlButtons.Name = "kpnlButtons";
+ this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlButtons.Size = new System.Drawing.Size(614, 50);
+ this.kpnlButtons.TabIndex = 7;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel2.ColumnCount = 4;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.Controls.Add(this.kbtnDismiss, 2, 0);
+ this.tableLayoutPanel2.Controls.Add(this.klblToastLocation, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.kchkDoNotShowAgain, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.itbDismiss, 3, 0);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 1;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(614, 49);
+ this.tableLayoutPanel2.TabIndex = 5;
+ //
+ // kbtnDismiss
+ //
+ this.kbtnDismiss.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnDismiss.AutoSize = true;
+ this.kbtnDismiss.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.kbtnDismiss.Location = new System.Drawing.Point(488, 13);
+ this.kbtnDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnDismiss.Name = "kbtnDismiss";
+ this.kbtnDismiss.Size = new System.Drawing.Size(48, 22);
+ this.kbtnDismiss.TabIndex = 2;
+ this.kbtnDismiss.Values.Text = "{0} ({1})";
+ this.kbtnDismiss.Visible = false;
+ //
+ // klblToastLocation
+ //
+ this.klblToastLocation.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.klblToastLocation.Location = new System.Drawing.Point(75, 23);
+ this.klblToastLocation.Margin = new System.Windows.Forms.Padding(10);
+ this.klblToastLocation.Name = "klblToastLocation";
+ this.klblToastLocation.Size = new System.Drawing.Size(6, 2);
+ this.klblToastLocation.TabIndex = 3;
+ this.klblToastLocation.Values.Text = "";
+ //
+ // kchkDoNotShowAgain
+ //
+ this.kchkDoNotShowAgain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kchkDoNotShowAgain.Location = new System.Drawing.Point(10, 10);
+ this.kchkDoNotShowAgain.Margin = new System.Windows.Forms.Padding(10);
+ this.kchkDoNotShowAgain.Name = "kchkDoNotShowAgain";
+ this.kchkDoNotShowAgain.Size = new System.Drawing.Size(45, 29);
+ this.kchkDoNotShowAgain.TabIndex = 4;
+ this.kchkDoNotShowAgain.Values.Text = "CB1";
+ this.kchkDoNotShowAgain.Visible = false;
+ //
+ // itbDismiss
+ //
+ this.itbDismiss.AutoSize = true;
+ this.itbDismiss.IsActionButton = false;
+ this.itbDismiss.IsDismissButton = true;
+ this.itbDismiss.Location = new System.Drawing.Point(556, 13);
+ this.itbDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.itbDismiss.Name = "itbDismiss";
+ this.itbDismiss.NotificationResult = Krypton.Toolkit.KryptonToastNotificationResult.None;
+ this.itbDismiss.Owner = null;
+ this.itbDismiss.ProcessPath = "";
+ this.itbDismiss.Size = new System.Drawing.Size(48, 22);
+ this.itbDismiss.TabIndex = 5;
+ this.itbDismiss.Values.Text = "{0} ({1})";
+ this.itbDismiss.Click += new System.EventHandler(this.itbDismiss_Click);
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(614, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kpnlMain
+ //
+ this.kpnlMain.Controls.Add(this.kryptonPanel1);
+ this.kpnlMain.Controls.Add(this.tlpMain);
+ this.kpnlMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlMain.Location = new System.Drawing.Point(0, 0);
+ this.kpnlMain.Name = "kpnlMain";
+ this.kpnlMain.Size = new System.Drawing.Size(614, 327);
+ this.kpnlMain.TabIndex = 8;
+ //
+ // kryptonPanel1
+ //
+ this.kryptonPanel1.Controls.Add(this.tableLayoutPanel3);
+ this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonPanel1.Name = "kryptonPanel1";
+ this.kryptonPanel1.Size = new System.Drawing.Size(614, 327);
+ this.kryptonPanel1.TabIndex = 4;
+ //
+ // tableLayoutPanel3
+ //
+ this.tableLayoutPanel3.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel3.ColumnCount = 2;
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel3.Controls.Add(this.pbxNotificationIcon, 0, 0);
+ this.tableLayoutPanel3.Controls.Add(this.tableLayoutPanel4, 1, 0);
+ this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel3.Location = new System.Drawing.Point(0, 0);
+ this.tableLayoutPanel3.Name = "tableLayoutPanel3";
+ this.tableLayoutPanel3.RowCount = 1;
+ this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel3.Size = new System.Drawing.Size(614, 327);
+ this.tableLayoutPanel3.TabIndex = 0;
+ //
+ // pbxNotificationIcon
+ //
+ this.pbxNotificationIcon.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pbxNotificationIcon.Location = new System.Drawing.Point(5, 5);
+ this.pbxNotificationIcon.Margin = new System.Windows.Forms.Padding(5);
+ this.pbxNotificationIcon.Name = "pbxNotificationIcon";
+ this.pbxNotificationIcon.Size = new System.Drawing.Size(128, 317);
+ this.pbxNotificationIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pbxNotificationIcon.TabIndex = 0;
+ this.pbxNotificationIcon.TabStop = false;
+ //
+ // tableLayoutPanel4
+ //
+ this.tableLayoutPanel4.ColumnCount = 1;
+ this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel4.Controls.Add(this.kwlNotificationTitle, 0, 0);
+ this.tableLayoutPanel4.Controls.Add(this.kwlNotificationMessage, 0, 1);
+ this.tableLayoutPanel4.Controls.Add(this.ktxtUserInput, 0, 2);
+ this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel4.Location = new System.Drawing.Point(141, 3);
+ this.tableLayoutPanel4.Name = "tableLayoutPanel4";
+ this.tableLayoutPanel4.RowCount = 3;
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel4.Size = new System.Drawing.Size(470, 321);
+ this.tableLayoutPanel4.TabIndex = 1;
+ //
+ // kwlNotificationTitle
+ //
+ this.kwlNotificationTitle.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationTitle.Font = new System.Drawing.Font("Segoe UI", 13.5F, System.Drawing.FontStyle.Bold);
+ this.kwlNotificationTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationTitle.LabelStyle = Krypton.Toolkit.LabelStyle.TitleControl;
+ this.kwlNotificationTitle.Location = new System.Drawing.Point(3, 0);
+ this.kwlNotificationTitle.Name = "kwlNotificationTitle";
+ this.kwlNotificationTitle.Size = new System.Drawing.Size(464, 25);
+ this.kwlNotificationTitle.Text = "kryptonWrapLabel1";
+ this.kwlNotificationTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // kwlNotificationMessage
+ //
+ this.kwlNotificationMessage.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationMessage.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.kwlNotificationMessage.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationMessage.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.kwlNotificationMessage.Location = new System.Drawing.Point(3, 25);
+ this.kwlNotificationMessage.Name = "kwlNotificationMessage";
+ this.kwlNotificationMessage.Size = new System.Drawing.Size(464, 267);
+ this.kwlNotificationMessage.Text = "kryptonWrapLabel2";
+ this.kwlNotificationMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // ktxtUserInput
+ //
+ this.ktxtUserInput.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.ktxtUserInput.Location = new System.Drawing.Point(3, 295);
+ this.ktxtUserInput.Name = "ktxtUserInput";
+ this.ktxtUserInput.Size = new System.Drawing.Size(464, 23);
+ this.ktxtUserInput.TabIndex = 2;
+ //
+ // tlpMain
+ //
+ this.tlpMain.BackColor = System.Drawing.Color.Transparent;
+ this.tlpMain.ColumnCount = 2;
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Controls.Add(this.tableLayoutPanel1, 1, 0);
+ this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpMain.Location = new System.Drawing.Point(0, 0);
+ this.tlpMain.Name = "tlpMain";
+ this.tlpMain.RowCount = 1;
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Size = new System.Drawing.Size(614, 327);
+ this.tlpMain.TabIndex = 0;
+ //
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.ColumnCount = 1;
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 3);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 3;
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(608, 321);
+ this.tableLayoutPanel1.TabIndex = 1;
+ //
+ // VisualToastNotificationTextBoxUserInputForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(614, 377);
+ this.Controls.Add(this.kpnlMain);
+ this.Controls.Add(this.kpnlButtons);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualToastNotificationTextBoxUserInputForm";
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.Load += new System.EventHandler(this.VisualToastNotificationTextBoxUserInputForm_Load);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit();
+ this.kpnlButtons.ResumeLayout(false);
+ this.kpnlButtons.PerformLayout();
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).EndInit();
+ this.kpnlMain.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
+ this.kryptonPanel1.ResumeLayout(false);
+ this.tableLayoutPanel3.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).EndInit();
+ this.tableLayoutPanel4.ResumeLayout(false);
+ this.tableLayoutPanel4.PerformLayout();
+ this.tlpMain.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kpnlButtons;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private KryptonPanel kpnlMain;
+ private KryptonPanel kryptonPanel1;
+ private TableLayoutPanel tableLayoutPanel3;
+ private PictureBox pbxNotificationIcon;
+ private TableLayoutPanel tableLayoutPanel4;
+ private KryptonWrapLabel kwlNotificationTitle;
+ private KryptonWrapLabel kwlNotificationMessage;
+ private TableLayoutPanel tlpMain;
+ private TableLayoutPanel tableLayoutPanel1;
+ private KryptonTextBox ktxtUserInput;
+ private TableLayoutPanel tableLayoutPanel2;
+ private KryptonButton kbtnDismiss;
+ private KryptonLabel klblToastLocation;
+ private KryptonCheckBox kchkDoNotShowAgain;
+ private InternalToastButton itbDismiss;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationTextBoxUserInputForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationTextBoxUserInputForm.cs
new file mode 100644
index 000000000..3d814fc81
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationTextBoxUserInputForm.cs
@@ -0,0 +1,331 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+using Timer = System.Windows.Forms.Timer;
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualToastNotificationTextBoxUserInputForm : VisualToastNotificationBaseForm
+ {
+ #region Instance Fields
+
+ private int _time;
+
+ private Timer _timer;
+
+ private readonly KryptonUserInputToastNotificationData _data;
+
+ #region Local Data
+
+ private string _notificationContentText;
+
+ private string _notificationTitleText;
+
+ private KryptonToastNotificationIcon _toastNotificationIcon;
+
+ #endregion
+
+ #endregion
+
+ #region Internal
+
+ internal string UserResponse => ktxtUserInput.Text ?? string.Empty;
+
+ #endregion
+
+ #region Identity
+
+ public VisualToastNotificationTextBoxUserInputForm(KryptonUserInputToastNotificationData data)
+ {
+ InitializeComponent();
+
+ _data = data;
+
+ LoadData();
+
+ Resize += VisualToastNotificationTextBoxUserInputForm_Resize;
+
+ GotFocus += VisualToastNotificationTextBoxUserInputForm_GotFocus;
+
+ UpdateBorderColors();
+ }
+
+ #endregion
+
+ #region Implementation
+
+ private void UpdateBorderColors()
+ {
+ StateCommon!.Border.Color1 = _data.BorderColor1 ?? GlobalStaticValues.EMPTY_COLOR;
+
+ StateCommon!.Border.Color2 = _data.BorderColor2 ?? GlobalStaticValues.EMPTY_COLOR;
+ }
+
+ private void LoadData()
+ {
+ _notificationContentText = _data.NotificationContent ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+
+ _notificationTitleText = _data.NotificationTitle ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+
+ _toastNotificationIcon = _data.NotificationIcon ?? KryptonToastNotificationIcon.None;
+ }
+
+ private void UpdateText()
+ {
+ kwlNotificationTitle.Text = _notificationTitleText;
+
+ kwlNotificationMessage.Text = _notificationContentText;
+ }
+
+ private void UpdateCueValues()
+ {
+ // Set cue values
+ ktxtUserInput.CueHint.CueHintText =
+ _data.ToastNotificationCueText ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+
+ ktxtUserInput.CueHint.Color1 = _data.ToastNotificationCueColor ?? Color.Gray;
+ }
+
+ private void SetIcon(Bitmap? image) => pbxNotificationIcon.Image = image;
+
+ private void UpdateLocation()
+ {
+ //Once loaded, position the form, or position it to the bottom left of the screen with added padding
+ Location = _data.NotificationLocation ?? new Point(Screen.PrimaryScreen!.WorkingArea.Width - Width - 5,
+ Screen.PrimaryScreen.WorkingArea.Height - Height - 5);
+ }
+
+ private void UpdateIcon()
+ {
+ switch (_toastNotificationIcon)
+ {
+ case KryptonToastNotificationIcon.None:
+ SetIcon(null);
+ break;
+ case KryptonToastNotificationIcon.Hand:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Hand_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemHand:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Hand.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Question:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Question_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemQuestion:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Question.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Exclamation:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.SystemExclamation:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Exclamation.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Asterisk:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Asterisk_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemAsterisk:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Stop:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Stop_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Error:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Critical_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Warning:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.Information:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Shield:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
+ }
+ else if (OSUtilities.IsWindowsTen)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_10_128_x_128);
+ }
+ else
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128);
+ }
+ break;
+ case KryptonToastNotificationIcon.WindowsLogo:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_11_128_128);
+ }
+ else if (OSUtilities.IsWindowsEight || OSUtilities.IsWindowsEightPointOne || OSUtilities.IsWindowsTen)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_8_81_10_128_128);
+ }
+ else
+ {
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.WinLogo.ToBitmap(), new Size(128, 128)));
+ }
+ break;
+ case KryptonToastNotificationIcon.Application:
+ SetIcon(GraphicsExtensions.ScaleImage(_data.ApplicationIcon.ToBitmap(), new Size(128, 128)));
+ break;
+ case KryptonToastNotificationIcon.SystemApplication:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Ok:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Ok_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Custom:
+ SetIcon(_data.CustomImage != null
+ ? new Bitmap(_data.CustomImage)
+ : null);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+
+ private void VisualToastNotificationTextBoxUserInputForm_GotFocus(object? sender, EventArgs e)
+ {
+ ktxtUserInput.Focus();
+ }
+
+ private void VisualToastNotificationTextBoxUserInputForm_Resize(object? sender, EventArgs e)
+ {
+ if (WindowState == FormWindowState.Maximized)
+ {
+ WindowState = FormWindowState.Normal;
+ }
+ }
+
+ private void VisualToastNotificationTextBoxUserInputForm_Load(object sender, EventArgs e)
+ {
+ UpdateIcon();
+
+ UpdateLocation();
+
+ ShowCloseButton();
+
+ _timer.Start();
+ }
+
+ private void ShowCloseButton()
+ {
+ CloseBox = _data.ShowCloseBox ?? false;
+
+ FormBorderStyle = CloseBox ? FormBorderStyle.Fixed3D : FormBorderStyle.FixedSingle;
+
+ ControlBox = _data.ShowCloseBox ?? false;
+ }
+
+ private void itbDismiss_Click(object sender, EventArgs e) => Close();
+
+ public new DialogResult ShowDialog()
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateCueValues();
+
+ UpdateLocation();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ if (_time == _data.CountDownSeconds)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog();
+ }
+
+ public new DialogResult ShowDialog(IWin32Window owner)
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateCueValues();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ if (_time == _data.CountDownSeconds)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog(owner);
+ }
+
+ internal static string ShowNotification(KryptonUserInputToastNotificationData data)
+ {
+ var owner = data.ToastHost ?? FromHandle(PI.GetActiveWindow());
+
+ using var toast = new VisualToastNotificationTextBoxUserInputForm(data);
+
+ if (owner != null)
+ {
+ toast.StartPosition = owner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
+
+ return toast.ShowDialog(owner!) == DialogResult.OK ? toast.UserResponse : GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+ else
+ {
+ return toast.ShowDialog() == DialogResult.OK ? toast.UserResponse : GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationTextBoxUserInputForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationTextBoxUserInputForm.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/Normal/VisualToastNotificationTextBoxUserInputForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationComboBoxUserInputWithProgressBarForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationComboBoxUserInputWithProgressBarForm.Designer.cs
new file mode 100644
index 000000000..b71b4b699
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationComboBoxUserInputWithProgressBarForm.Designer.cs
@@ -0,0 +1,300 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualToastNotificationComboBoxUserInputWithProgressBarForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.kpnlButtons = new Krypton.Toolkit.KryptonPanel();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kpnlMain = new Krypton.Toolkit.KryptonPanel();
+ this.tlpMain = new System.Windows.Forms.TableLayoutPanel();
+ this.tlpContent = new System.Windows.Forms.TableLayoutPanel();
+ this.kwlNotificationTitle = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kwlNotificationMessage = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kcmbUserInput = new Krypton.Toolkit.KryptonComboBox();
+ this.kpbCountDown = new Krypton.Toolkit.KryptonProgressBar();
+ this.pbxNotificationIcon = new System.Windows.Forms.PictureBox();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnDismiss = new Krypton.Toolkit.KryptonButton();
+ this.klblToastLocation = new Krypton.Toolkit.KryptonLabel();
+ this.kchkDoNotShowAgain = new Krypton.Toolkit.KryptonCheckBox();
+ this.itbDismiss = new Krypton.Toolkit.InternalToastButton();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit();
+ this.kpnlButtons.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).BeginInit();
+ this.kpnlMain.SuspendLayout();
+ this.tlpMain.SuspendLayout();
+ this.tlpContent.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kcmbUserInput)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).BeginInit();
+ this.tableLayoutPanel2.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // kpnlButtons
+ //
+ this.kpnlButtons.Controls.Add(this.tableLayoutPanel2);
+ this.kpnlButtons.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlButtons.Location = new System.Drawing.Point(0, 369);
+ this.kpnlButtons.Name = "kpnlButtons";
+ this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlButtons.Size = new System.Drawing.Size(630, 50);
+ this.kpnlButtons.TabIndex = 4;
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(630, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kpnlMain
+ //
+ this.kpnlMain.Controls.Add(this.tlpMain);
+ this.kpnlMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlMain.Location = new System.Drawing.Point(0, 0);
+ this.kpnlMain.Name = "kpnlMain";
+ this.kpnlMain.Size = new System.Drawing.Size(630, 369);
+ this.kpnlMain.TabIndex = 5;
+ //
+ // tlpMain
+ //
+ this.tlpMain.BackColor = System.Drawing.Color.Transparent;
+ this.tlpMain.ColumnCount = 2;
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Controls.Add(this.tlpContent, 1, 0);
+ this.tlpMain.Controls.Add(this.kpbCountDown, 0, 1);
+ this.tlpMain.Controls.Add(this.pbxNotificationIcon, 0, 0);
+ this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpMain.Location = new System.Drawing.Point(0, 0);
+ this.tlpMain.Name = "tlpMain";
+ this.tlpMain.RowCount = 2;
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpMain.Size = new System.Drawing.Size(630, 369);
+ this.tlpMain.TabIndex = 0;
+ //
+ // tlpContent
+ //
+ this.tlpContent.ColumnCount = 1;
+ this.tlpContent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpContent.Controls.Add(this.kwlNotificationTitle, 0, 0);
+ this.tlpContent.Controls.Add(this.kwlNotificationMessage, 0, 1);
+ this.tlpContent.Controls.Add(this.kcmbUserInput, 0, 2);
+ this.tlpContent.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpContent.Location = new System.Drawing.Point(141, 3);
+ this.tlpContent.Name = "tlpContent";
+ this.tlpContent.RowCount = 3;
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpContent.Size = new System.Drawing.Size(486, 331);
+ this.tlpContent.TabIndex = 6;
+ //
+ // kwlNotificationTitle
+ //
+ this.kwlNotificationTitle.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationTitle.Font = new System.Drawing.Font("Segoe UI", 13.5F, System.Drawing.FontStyle.Bold);
+ this.kwlNotificationTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationTitle.LabelStyle = Krypton.Toolkit.LabelStyle.TitleControl;
+ this.kwlNotificationTitle.Location = new System.Drawing.Point(3, 0);
+ this.kwlNotificationTitle.Name = "kwlNotificationTitle";
+ this.kwlNotificationTitle.Size = new System.Drawing.Size(480, 25);
+ this.kwlNotificationTitle.Text = "kryptonWrapLabel1";
+ this.kwlNotificationTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // kwlNotificationMessage
+ //
+ this.kwlNotificationMessage.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationMessage.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.kwlNotificationMessage.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationMessage.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.kwlNotificationMessage.Location = new System.Drawing.Point(3, 25);
+ this.kwlNotificationMessage.Name = "kwlNotificationMessage";
+ this.kwlNotificationMessage.Size = new System.Drawing.Size(480, 279);
+ this.kwlNotificationMessage.Text = "kryptonWrapLabel2";
+ this.kwlNotificationMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // kcmbUserInput
+ //
+ this.kcmbUserInput.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kcmbUserInput.DropDownWidth = 480;
+ this.kcmbUserInput.IntegralHeight = false;
+ this.kcmbUserInput.Location = new System.Drawing.Point(3, 307);
+ this.kcmbUserInput.Name = "kcmbUserInput";
+ this.kcmbUserInput.Size = new System.Drawing.Size(480, 21);
+ this.kcmbUserInput.StateCommon.ComboBox.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near;
+ this.kcmbUserInput.TabIndex = 3;
+ this.kcmbUserInput.Text = "kryptonComboBox1";
+ //
+ // kpbCountDown
+ //
+ this.tlpMain.SetColumnSpan(this.kpbCountDown, 2);
+ this.kpbCountDown.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpbCountDown.Location = new System.Drawing.Point(3, 340);
+ this.kpbCountDown.Name = "kpbCountDown";
+ this.kpbCountDown.Size = new System.Drawing.Size(624, 26);
+ this.kpbCountDown.StateCommon.Back.Color1 = System.Drawing.Color.Green;
+ this.kpbCountDown.StateDisabled.Back.ColorStyle = Krypton.Toolkit.PaletteColorStyle.OneNote;
+ this.kpbCountDown.StateNormal.Back.ColorStyle = Krypton.Toolkit.PaletteColorStyle.OneNote;
+ this.kpbCountDown.TabIndex = 5;
+ this.kpbCountDown.Text = "kryptonProgressBar1";
+ this.kpbCountDown.Values.Text = "kryptonProgressBar1";
+ //
+ // pbxNotificationIcon
+ //
+ this.pbxNotificationIcon.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pbxNotificationIcon.Location = new System.Drawing.Point(5, 5);
+ this.pbxNotificationIcon.Margin = new System.Windows.Forms.Padding(5);
+ this.pbxNotificationIcon.Name = "pbxNotificationIcon";
+ this.pbxNotificationIcon.Size = new System.Drawing.Size(128, 327);
+ this.pbxNotificationIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pbxNotificationIcon.TabIndex = 0;
+ this.pbxNotificationIcon.TabStop = false;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel2.ColumnCount = 4;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.Controls.Add(this.kbtnDismiss, 2, 0);
+ this.tableLayoutPanel2.Controls.Add(this.klblToastLocation, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.kchkDoNotShowAgain, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.itbDismiss, 3, 0);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 1;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(630, 49);
+ this.tableLayoutPanel2.TabIndex = 6;
+ //
+ // kbtnDismiss
+ //
+ this.kbtnDismiss.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnDismiss.AutoSize = true;
+ this.kbtnDismiss.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.kbtnDismiss.Location = new System.Drawing.Point(554, 13);
+ this.kbtnDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnDismiss.Name = "kbtnDismiss";
+ this.kbtnDismiss.Size = new System.Drawing.Size(23, 22);
+ this.kbtnDismiss.TabIndex = 2;
+ this.kbtnDismiss.Values.Text = "{0}";
+ this.kbtnDismiss.Visible = false;
+ //
+ // klblToastLocation
+ //
+ this.klblToastLocation.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.klblToastLocation.Location = new System.Drawing.Point(75, 23);
+ this.klblToastLocation.Margin = new System.Windows.Forms.Padding(10);
+ this.klblToastLocation.Name = "klblToastLocation";
+ this.klblToastLocation.Size = new System.Drawing.Size(6, 2);
+ this.klblToastLocation.TabIndex = 3;
+ this.klblToastLocation.Values.Text = "";
+ //
+ // kchkDoNotShowAgain
+ //
+ this.kchkDoNotShowAgain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kchkDoNotShowAgain.Location = new System.Drawing.Point(10, 10);
+ this.kchkDoNotShowAgain.Margin = new System.Windows.Forms.Padding(10);
+ this.kchkDoNotShowAgain.Name = "kchkDoNotShowAgain";
+ this.kchkDoNotShowAgain.Size = new System.Drawing.Size(45, 29);
+ this.kchkDoNotShowAgain.TabIndex = 4;
+ this.kchkDoNotShowAgain.Values.Text = "CB1";
+ this.kchkDoNotShowAgain.Visible = false;
+ //
+ // itbDismiss
+ //
+ this.itbDismiss.AutoSize = true;
+ this.itbDismiss.IsActionButton = false;
+ this.itbDismiss.IsDismissButton = true;
+ this.itbDismiss.Location = new System.Drawing.Point(597, 13);
+ this.itbDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.itbDismiss.Name = "itbDismiss";
+ this.itbDismiss.NotificationResult = Krypton.Toolkit.KryptonToastNotificationResult.None;
+ this.itbDismiss.Owner = null;
+ this.itbDismiss.ProcessPath = "";
+ this.itbDismiss.Size = new System.Drawing.Size(23, 22);
+ this.itbDismiss.TabIndex = 5;
+ this.itbDismiss.Values.Text = "{0}";
+ //
+ // VisualToastNotificationComboBoxUserInputWithProgressBarForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(630, 419);
+ this.Controls.Add(this.kpnlMain);
+ this.Controls.Add(this.kpnlButtons);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualToastNotificationComboBoxUserInputWithProgressBarForm";
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.Load += new System.EventHandler(this.VisualToastNotificationComboBoxUserInputWithProgressBarForm_Load);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit();
+ this.kpnlButtons.ResumeLayout(false);
+ this.kpnlButtons.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).EndInit();
+ this.kpnlMain.ResumeLayout(false);
+ this.tlpMain.ResumeLayout(false);
+ this.tlpContent.ResumeLayout(false);
+ this.tlpContent.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kcmbUserInput)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).EndInit();
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kpnlButtons;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private KryptonPanel kpnlMain;
+ private TableLayoutPanel tlpMain;
+ private TableLayoutPanel tlpContent;
+ private KryptonWrapLabel kwlNotificationTitle;
+ private KryptonWrapLabel kwlNotificationMessage;
+ private KryptonProgressBar kpbCountDown;
+ private PictureBox pbxNotificationIcon;
+ private KryptonComboBox kcmbUserInput;
+ private TableLayoutPanel tableLayoutPanel2;
+ private KryptonButton kbtnDismiss;
+ private KryptonLabel klblToastLocation;
+ private KryptonCheckBox kchkDoNotShowAgain;
+ private InternalToastButton itbDismiss;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationComboBoxUserInputWithProgressBarForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationComboBoxUserInputWithProgressBarForm.cs
new file mode 100644
index 000000000..12c176366
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationComboBoxUserInputWithProgressBarForm.cs
@@ -0,0 +1,320 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+using Timer = System.Windows.Forms.Timer;
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualToastNotificationComboBoxUserInputWithProgressBarForm : VisualToastNotificationBaseForm
+ {
+ #region Instance Fields
+
+ private int _time;
+
+ private Timer _timer;
+
+ private readonly KryptonUserInputToastNotificationData _data;
+
+ #endregion
+
+ #region Internal
+
+ internal string UserResponse => kcmbUserInput.Text ?? string.Empty;
+
+ #endregion
+
+ #region Identity
+
+ public VisualToastNotificationComboBoxUserInputWithProgressBarForm(KryptonUserInputToastNotificationData data)
+ {
+ InitializeComponent();
+
+ _data = data;
+
+ GotFocus += (sender, args) => kcmbUserInput.Focus();
+
+ Resize += VisualToastNotificationComboBoxUserInputWithProgressBarForm_Resize;
+
+ UpdateBorderColors();
+ }
+
+ #endregion
+
+ #region Implementation
+
+ private void UpdateBorderColors()
+ {
+ StateCommon!.Border.Color1 = _data.BorderColor1 ?? GlobalStaticValues.EMPTY_COLOR;
+
+ StateCommon!.Border.Color2 = _data.BorderColor2 ?? GlobalStaticValues.EMPTY_COLOR;
+ }
+
+ private void UpdateText()
+ {
+ kwlNotificationTitle.Text = _data.NotificationTitle ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+
+ kwlNotificationMessage.Text = _data.NotificationContent ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+
+ private void UpdateComboBoxItems()
+ {
+ if (_data.UserInputList.Count > 0)
+ {
+ foreach (var item in _data.UserInputList)
+ {
+ kcmbUserInput.Items.Add(item);
+ }
+
+ kcmbUserInput.SelectedIndex = _data.SelectedIndex ?? 1;
+ }
+
+ kcmbUserInput.DropDownStyle = _data.UserInputComboBoxStyle ?? ComboBoxStyle.DropDown;
+ }
+
+ private void SetIcon(Bitmap? image) => pbxNotificationIcon.Image = image;
+
+ private void UpdateLocation()
+ {
+ //Once loaded, position the form, or position it to the bottom left of the screen with added padding
+ Location = _data.NotificationLocation ?? new Point(Screen.PrimaryScreen!.WorkingArea.Width - Width - 5,
+ Screen.PrimaryScreen.WorkingArea.Height - Height - 5);
+ }
+
+ private void UpdateIcon()
+ {
+ switch (_data.NotificationIcon)
+ {
+ case KryptonToastNotificationIcon.None:
+ SetIcon(null);
+ break;
+ case KryptonToastNotificationIcon.Hand:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Hand_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemHand:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Hand.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Question:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Question_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemQuestion:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Question.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Exclamation:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.SystemExclamation:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Exclamation.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Asterisk:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Asterisk_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemAsterisk:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Stop:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Stop_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Error:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Critical_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Warning:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.Information:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Shield:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
+ }
+ else if (OSUtilities.IsWindowsTen)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_10_128_x_128);
+ }
+ else
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128);
+ }
+ break;
+ case KryptonToastNotificationIcon.WindowsLogo:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_11_128_128);
+ }
+ else if (OSUtilities.IsWindowsEight || OSUtilities.IsWindowsEightPointOne || OSUtilities.IsWindowsTen)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_8_81_10_128_128);
+ }
+ else
+ {
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.WinLogo.ToBitmap(), new Size(128, 128)));
+ }
+ break;
+ case KryptonToastNotificationIcon.Application:
+ SetIcon(GraphicsExtensions.ScaleImage(_data.ApplicationIcon.ToBitmap(), new Size(128, 128)));
+ break;
+ case KryptonToastNotificationIcon.SystemApplication:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Ok:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Ok_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Custom:
+ SetIcon(_data.CustomImage != null
+ ? new Bitmap(_data.CustomImage)
+ : null);
+ break;
+ case null:
+ SetIcon(null);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+
+ private void ShowCloseButton()
+ {
+ CloseBox = _data.ShowCloseBox ?? false;
+
+ FormBorderStyle = CloseBox ? FormBorderStyle.Fixed3D : FormBorderStyle.FixedSingle;
+
+ ControlBox = _data.ShowCloseBox ?? false;
+ }
+
+ private void VisualToastNotificationComboBoxUserInputWithProgressBarForm_Resize(object? sender, EventArgs e)
+ {
+ if (WindowState == FormWindowState.Maximized)
+ {
+ WindowState = FormWindowState.Normal;
+ }
+ }
+
+ private void VisualToastNotificationComboBoxUserInputWithProgressBarForm_Load(object sender, EventArgs e)
+ {
+ UpdateIcon();
+
+ UpdateLocation();
+
+ ShowCloseButton();
+
+ kbtnDismiss.Text = KryptonManager.Strings.ToastNotificationStrings.Dismiss;
+
+ _timer.Start();
+
+ _data.DisplayDebugData(_data);
+ }
+
+ public new DialogResult ShowDialog()
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateComboBoxItems();
+
+ UpdateLocation();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kpbCountDown.Maximum = _data.CountDownSeconds ?? 100;
+
+ kpbCountDown.Value = kpbCountDown.Maximum;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kpbCountDown.Value -= 1;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ if (kpbCountDown.Value == kpbCountDown.Minimum)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog();
+ }
+
+ public new DialogResult ShowDialog(IWin32Window owner)
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateComboBoxItems();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kpbCountDown.Maximum = _data.CountDownSeconds ?? 100;
+
+ kpbCountDown.Value = kpbCountDown.Maximum;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kpbCountDown.Value -= 1;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ if (kpbCountDown.Value == kpbCountDown.Minimum)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog(owner);
+ }
+
+ internal static string ShowNotification(KryptonUserInputToastNotificationData data)
+ {
+ var owner = data.ToastHost ?? FromHandle(PI.GetActiveWindow());
+
+ using var toast = new VisualToastNotificationComboBoxUserInputWithProgressBarForm(data);
+
+ if (owner != null)
+ {
+ toast.StartPosition = owner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
+
+ return toast.ShowDialog(owner!) == DialogResult.OK ? toast.UserResponse : string.Empty;
+ }
+ else
+ {
+ return toast.ShowDialog() == DialogResult.OK ? toast.UserResponse : string.Empty;
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationComboBoxUserInputWithProgressBarForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationComboBoxUserInputWithProgressBarForm.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationComboBoxUserInputWithProgressBarForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationDateTimeUserInputWithProgressBarForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationDateTimeUserInputWithProgressBarForm.Designer.cs
new file mode 100644
index 000000000..28d19f642
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationDateTimeUserInputWithProgressBarForm.Designer.cs
@@ -0,0 +1,294 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualToastNotificationDateTimeUserInputWithProgressBarForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.kpnlButtons = new Krypton.Toolkit.KryptonPanel();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kpnlMain = new Krypton.Toolkit.KryptonPanel();
+ this.tlpMain = new System.Windows.Forms.TableLayoutPanel();
+ this.tlpContent = new System.Windows.Forms.TableLayoutPanel();
+ this.kwlNotificationTitle = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kwlNotificationMessage = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kdtpUserInput = new Krypton.Toolkit.KryptonDateTimePicker();
+ this.kpbCountDown = new Krypton.Toolkit.KryptonProgressBar();
+ this.pbxNotificationIcon = new System.Windows.Forms.PictureBox();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnDismiss = new Krypton.Toolkit.KryptonButton();
+ this.klblToastLocation = new Krypton.Toolkit.KryptonLabel();
+ this.kchkDoNotShowAgain = new Krypton.Toolkit.KryptonCheckBox();
+ this.itbDismiss = new Krypton.Toolkit.InternalToastButton();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit();
+ this.kpnlButtons.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).BeginInit();
+ this.kpnlMain.SuspendLayout();
+ this.tlpMain.SuspendLayout();
+ this.tlpContent.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).BeginInit();
+ this.tableLayoutPanel2.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // kpnlButtons
+ //
+ this.kpnlButtons.Controls.Add(this.tableLayoutPanel2);
+ this.kpnlButtons.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlButtons.Location = new System.Drawing.Point(0, 369);
+ this.kpnlButtons.Name = "kpnlButtons";
+ this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlButtons.Size = new System.Drawing.Size(630, 50);
+ this.kpnlButtons.TabIndex = 5;
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(630, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kpnlMain
+ //
+ this.kpnlMain.Controls.Add(this.tlpMain);
+ this.kpnlMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlMain.Location = new System.Drawing.Point(0, 0);
+ this.kpnlMain.Name = "kpnlMain";
+ this.kpnlMain.Size = new System.Drawing.Size(630, 369);
+ this.kpnlMain.TabIndex = 6;
+ //
+ // tlpMain
+ //
+ this.tlpMain.BackColor = System.Drawing.Color.Transparent;
+ this.tlpMain.ColumnCount = 2;
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Controls.Add(this.tlpContent, 1, 0);
+ this.tlpMain.Controls.Add(this.kpbCountDown, 0, 1);
+ this.tlpMain.Controls.Add(this.pbxNotificationIcon, 0, 0);
+ this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpMain.Location = new System.Drawing.Point(0, 0);
+ this.tlpMain.Name = "tlpMain";
+ this.tlpMain.RowCount = 2;
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpMain.Size = new System.Drawing.Size(630, 369);
+ this.tlpMain.TabIndex = 0;
+ //
+ // tlpContent
+ //
+ this.tlpContent.ColumnCount = 1;
+ this.tlpContent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpContent.Controls.Add(this.kwlNotificationTitle, 0, 0);
+ this.tlpContent.Controls.Add(this.kwlNotificationMessage, 0, 1);
+ this.tlpContent.Controls.Add(this.kdtpUserInput, 0, 2);
+ this.tlpContent.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpContent.Location = new System.Drawing.Point(141, 3);
+ this.tlpContent.Name = "tlpContent";
+ this.tlpContent.RowCount = 3;
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpContent.Size = new System.Drawing.Size(486, 331);
+ this.tlpContent.TabIndex = 6;
+ //
+ // kwlNotificationTitle
+ //
+ this.kwlNotificationTitle.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationTitle.Font = new System.Drawing.Font("Segoe UI", 13.5F, System.Drawing.FontStyle.Bold);
+ this.kwlNotificationTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationTitle.LabelStyle = Krypton.Toolkit.LabelStyle.TitleControl;
+ this.kwlNotificationTitle.Location = new System.Drawing.Point(3, 0);
+ this.kwlNotificationTitle.Name = "kwlNotificationTitle";
+ this.kwlNotificationTitle.Size = new System.Drawing.Size(480, 25);
+ this.kwlNotificationTitle.Text = "kryptonWrapLabel1";
+ this.kwlNotificationTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // kwlNotificationMessage
+ //
+ this.kwlNotificationMessage.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationMessage.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.kwlNotificationMessage.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationMessage.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.kwlNotificationMessage.Location = new System.Drawing.Point(3, 25);
+ this.kwlNotificationMessage.Name = "kwlNotificationMessage";
+ this.kwlNotificationMessage.Size = new System.Drawing.Size(480, 279);
+ this.kwlNotificationMessage.Text = "kryptonWrapLabel2";
+ this.kwlNotificationMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // kdtpUserInput
+ //
+ this.kdtpUserInput.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kdtpUserInput.Location = new System.Drawing.Point(3, 307);
+ this.kdtpUserInput.Name = "kdtpUserInput";
+ this.kdtpUserInput.Size = new System.Drawing.Size(480, 21);
+ this.kdtpUserInput.TabIndex = 2;
+ //
+ // kpbCountDown
+ //
+ this.tlpMain.SetColumnSpan(this.kpbCountDown, 2);
+ this.kpbCountDown.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpbCountDown.Location = new System.Drawing.Point(3, 340);
+ this.kpbCountDown.Name = "kpbCountDown";
+ this.kpbCountDown.Size = new System.Drawing.Size(624, 26);
+ this.kpbCountDown.StateCommon.Back.Color1 = System.Drawing.Color.Green;
+ this.kpbCountDown.StateDisabled.Back.ColorStyle = Krypton.Toolkit.PaletteColorStyle.OneNote;
+ this.kpbCountDown.StateNormal.Back.ColorStyle = Krypton.Toolkit.PaletteColorStyle.OneNote;
+ this.kpbCountDown.TabIndex = 5;
+ this.kpbCountDown.Text = "kryptonProgressBar1";
+ this.kpbCountDown.Values.Text = "kryptonProgressBar1";
+ //
+ // pbxNotificationIcon
+ //
+ this.pbxNotificationIcon.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pbxNotificationIcon.Location = new System.Drawing.Point(5, 5);
+ this.pbxNotificationIcon.Margin = new System.Windows.Forms.Padding(5);
+ this.pbxNotificationIcon.Name = "pbxNotificationIcon";
+ this.pbxNotificationIcon.Size = new System.Drawing.Size(128, 327);
+ this.pbxNotificationIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pbxNotificationIcon.TabIndex = 0;
+ this.pbxNotificationIcon.TabStop = false;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel2.ColumnCount = 4;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.Controls.Add(this.kbtnDismiss, 2, 0);
+ this.tableLayoutPanel2.Controls.Add(this.klblToastLocation, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.kchkDoNotShowAgain, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.itbDismiss, 3, 0);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 1;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(630, 49);
+ this.tableLayoutPanel2.TabIndex = 6;
+ //
+ // kbtnDismiss
+ //
+ this.kbtnDismiss.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnDismiss.AutoSize = true;
+ this.kbtnDismiss.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.kbtnDismiss.Location = new System.Drawing.Point(554, 13);
+ this.kbtnDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnDismiss.Name = "kbtnDismiss";
+ this.kbtnDismiss.Size = new System.Drawing.Size(23, 22);
+ this.kbtnDismiss.TabIndex = 2;
+ this.kbtnDismiss.Values.Text = "{0}";
+ this.kbtnDismiss.Visible = false;
+ //
+ // klblToastLocation
+ //
+ this.klblToastLocation.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.klblToastLocation.Location = new System.Drawing.Point(75, 23);
+ this.klblToastLocation.Margin = new System.Windows.Forms.Padding(10);
+ this.klblToastLocation.Name = "klblToastLocation";
+ this.klblToastLocation.Size = new System.Drawing.Size(6, 2);
+ this.klblToastLocation.TabIndex = 3;
+ this.klblToastLocation.Values.Text = "";
+ //
+ // kchkDoNotShowAgain
+ //
+ this.kchkDoNotShowAgain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kchkDoNotShowAgain.Location = new System.Drawing.Point(10, 10);
+ this.kchkDoNotShowAgain.Margin = new System.Windows.Forms.Padding(10);
+ this.kchkDoNotShowAgain.Name = "kchkDoNotShowAgain";
+ this.kchkDoNotShowAgain.Size = new System.Drawing.Size(45, 29);
+ this.kchkDoNotShowAgain.TabIndex = 4;
+ this.kchkDoNotShowAgain.Values.Text = "CB1";
+ this.kchkDoNotShowAgain.Visible = false;
+ //
+ // itbDismiss
+ //
+ this.itbDismiss.AutoSize = true;
+ this.itbDismiss.IsActionButton = false;
+ this.itbDismiss.IsDismissButton = true;
+ this.itbDismiss.Location = new System.Drawing.Point(597, 13);
+ this.itbDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.itbDismiss.Name = "itbDismiss";
+ this.itbDismiss.NotificationResult = Krypton.Toolkit.KryptonToastNotificationResult.None;
+ this.itbDismiss.Owner = null;
+ this.itbDismiss.ProcessPath = "";
+ this.itbDismiss.Size = new System.Drawing.Size(23, 22);
+ this.itbDismiss.TabIndex = 5;
+ this.itbDismiss.Values.Text = "{0}";
+ //
+ // VisualToastNotificationDateTimeUserInputWithProgressBarForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(630, 419);
+ this.Controls.Add(this.kpnlMain);
+ this.Controls.Add(this.kpnlButtons);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualToastNotificationDateTimeUserInputWithProgressBarForm";
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.Load += new System.EventHandler(this.VisualToastNotificationDateTimeUserInputWithProgressBarForm_Load);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit();
+ this.kpnlButtons.ResumeLayout(false);
+ this.kpnlButtons.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).EndInit();
+ this.kpnlMain.ResumeLayout(false);
+ this.tlpMain.ResumeLayout(false);
+ this.tlpContent.ResumeLayout(false);
+ this.tlpContent.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).EndInit();
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kpnlButtons;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private KryptonPanel kpnlMain;
+ private TableLayoutPanel tlpMain;
+ private TableLayoutPanel tlpContent;
+ private KryptonWrapLabel kwlNotificationTitle;
+ private KryptonWrapLabel kwlNotificationMessage;
+ private KryptonProgressBar kpbCountDown;
+ private PictureBox pbxNotificationIcon;
+ private KryptonDateTimePicker kdtpUserInput;
+ private TableLayoutPanel tableLayoutPanel2;
+ private KryptonButton kbtnDismiss;
+ private KryptonLabel klblToastLocation;
+ private KryptonCheckBox kchkDoNotShowAgain;
+ private InternalToastButton itbDismiss;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationDateTimeUserInputWithProgressBarForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationDateTimeUserInputWithProgressBarForm.cs
new file mode 100644
index 000000000..4d407bd8e
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationDateTimeUserInputWithProgressBarForm.cs
@@ -0,0 +1,317 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+using Timer = System.Windows.Forms.Timer;
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualToastNotificationDateTimeUserInputWithProgressBarForm : VisualToastNotificationBaseForm
+ {
+ #region Instance Fields
+
+ private int _time;
+
+ private Timer _timer;
+
+ private readonly KryptonUserInputToastNotificationData _data;
+
+ #endregion
+
+ #region Internal
+
+ internal DateTime UserResponse => kdtpUserInput.Value;
+
+ #endregion
+
+ #region Identity
+
+ public VisualToastNotificationDateTimeUserInputWithProgressBarForm(KryptonUserInputToastNotificationData data)
+ {
+ InitializeComponent();
+
+ _data = data;
+
+ GotFocus += (sender, args) => kdtpUserInput.Focus();
+
+ Resize += VisualToastNotificationDateTimeUserInputWithProgressBarForm_Resize;
+
+ UpdateBorderColors();
+ }
+
+ #endregion
+
+ #region Implementation
+
+ private void UpdateBorderColors()
+ {
+ StateCommon!.Border.Color1 = _data.BorderColor1 ?? GlobalStaticValues.EMPTY_COLOR;
+
+ StateCommon!.Border.Color2 = _data.BorderColor2 ?? GlobalStaticValues.EMPTY_COLOR;
+ }
+
+ private void UpdateText()
+ {
+ kwlNotificationTitle.Text = _data.NotificationTitle ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+
+ kwlNotificationMessage.Text = _data.NotificationContent ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+
+ private void UpdateInitialValues()
+ {
+ // Set initial date and time values
+ kdtpUserInput.Value = _data.InitialDateTimeValue ?? GlobalStaticValues.DEFAULT_DATE_TIME_VALUE;
+
+ kdtpUserInput.Format = _data.DateTimeFormat ?? DateTimePickerFormat.Long;
+
+ kdtpUserInput.CustomFormat = _data.CustomDateTimeFormat ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+
+ kdtpUserInput.MaxDate = _data.MaximumDateTimeValue ?? DateTime.MaxValue;
+
+ kdtpUserInput.MinDate = _data.MinimumDateTimeValue ?? DateTime.MinValue;
+ }
+
+ private void SetIcon(Bitmap? image) => pbxNotificationIcon.Image = image;
+
+ private void UpdateLocation()
+ {
+ //Once loaded, position the form, or position it to the bottom left of the screen with added padding
+ Location = _data.NotificationLocation ?? new Point(Screen.PrimaryScreen!.WorkingArea.Width - Width - 5,
+ Screen.PrimaryScreen.WorkingArea.Height - Height - 5);
+ }
+
+ private void UpdateIcon()
+ {
+ switch (_data.NotificationIcon)
+ {
+ case KryptonToastNotificationIcon.None:
+ SetIcon(null);
+ break;
+ case KryptonToastNotificationIcon.Hand:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Hand_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemHand:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Hand.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Question:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Question_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemQuestion:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Question.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Exclamation:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.SystemExclamation:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Exclamation.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Asterisk:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Asterisk_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemAsterisk:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Stop:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Stop_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Error:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Critical_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Warning:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.Information:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Shield:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
+ }
+ else if (OSUtilities.IsWindowsTen)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_10_128_x_128);
+ }
+ else
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128);
+ }
+ break;
+ case KryptonToastNotificationIcon.WindowsLogo:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_11_128_128);
+ }
+ else if (OSUtilities.IsWindowsEight || OSUtilities.IsWindowsEightPointOne || OSUtilities.IsWindowsTen)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_8_81_10_128_128);
+ }
+ else
+ {
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.WinLogo.ToBitmap(), new Size(128, 128)));
+ }
+ break;
+ case KryptonToastNotificationIcon.Application:
+ SetIcon(GraphicsExtensions.ScaleImage(_data.ApplicationIcon.ToBitmap(), new Size(128, 128)));
+ break;
+ case KryptonToastNotificationIcon.SystemApplication:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Ok:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Ok_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Custom:
+ SetIcon(_data.CustomImage != null
+ ? new Bitmap(_data.CustomImage)
+ : null);
+ break;
+ case null:
+ SetIcon(null);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+
+ private void VisualToastNotificationDateTimeUserInputWithProgressBarForm_Resize(object? sender, EventArgs e)
+ {
+ if (WindowState == FormWindowState.Maximized)
+ {
+ WindowState = FormWindowState.Normal;
+ }
+ }
+
+ private void VisualToastNotificationDateTimeUserInputWithProgressBarForm_Load(object sender, EventArgs e)
+ {
+ UpdateIcon();
+
+ UpdateLocation();
+
+ ShowCloseButton();
+
+ kbtnDismiss.Text = KryptonManager.Strings.ToastNotificationStrings.Dismiss;
+
+ _timer.Start();
+ }
+
+ private void ShowCloseButton()
+ {
+ CloseBox = _data.ShowCloseBox ?? false;
+
+ FormBorderStyle = CloseBox ? FormBorderStyle.Fixed3D : FormBorderStyle.FixedSingle;
+
+ ControlBox = _data.ShowCloseBox ?? false;
+ }
+
+ public new DialogResult ShowDialog()
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ UpdateLocation();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kpbCountDown.Maximum = _data.CountDownSeconds ?? 100;
+
+ kpbCountDown.Value = kpbCountDown.Maximum;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kpbCountDown.Value -= 1;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ if (kpbCountDown.Value == kpbCountDown.Minimum)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog();
+ }
+
+ public new DialogResult ShowDialog(IWin32Window owner)
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kpbCountDown.Maximum = _data.CountDownSeconds ?? 100;
+
+ kpbCountDown.Value = kpbCountDown.Maximum;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kpbCountDown.Value -= 1;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ if (kpbCountDown.Value == kpbCountDown.Minimum)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog(owner);
+ }
+
+ internal static DateTime ShowNotification(KryptonUserInputToastNotificationData data)
+ {
+ var owner = data.ToastHost ?? FromHandle(PI.GetActiveWindow());
+
+ using var toast = new VisualToastNotificationDateTimeUserInputWithProgressBarForm(data);
+
+ if (owner != null)
+ {
+ toast.StartPosition = owner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
+
+ return toast.ShowDialog(owner!) == DialogResult.OK ? toast.UserResponse : GlobalStaticValues.DEFAULT_DATE_TIME_VALUE;
+ }
+ else
+ {
+ return toast.ShowDialog() == DialogResult.OK ? toast.UserResponse : GlobalStaticValues.DEFAULT_DATE_TIME_VALUE;
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationDateTimeUserInputWithProgressBarForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationDateTimeUserInputWithProgressBarForm.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationDateTimeUserInputWithProgressBarForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationDomianUpDownInputWithProgressBarForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationDomianUpDownInputWithProgressBarForm.Designer.cs
new file mode 100644
index 000000000..301dac1bb
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationDomianUpDownInputWithProgressBarForm.Designer.cs
@@ -0,0 +1,294 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualToastNotificationDomianUpDownInputWithProgressBarForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.kpnlButtons = new Krypton.Toolkit.KryptonPanel();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kpnlMain = new Krypton.Toolkit.KryptonPanel();
+ this.tlpMain = new System.Windows.Forms.TableLayoutPanel();
+ this.tlpContent = new System.Windows.Forms.TableLayoutPanel();
+ this.kwlNotificationTitle = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kwlNotificationMessage = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kdudUserInput = new Krypton.Toolkit.KryptonDomainUpDown();
+ this.kpbCountDown = new Krypton.Toolkit.KryptonProgressBar();
+ this.pbxNotificationIcon = new System.Windows.Forms.PictureBox();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnDismiss = new Krypton.Toolkit.KryptonButton();
+ this.klblToastLocation = new Krypton.Toolkit.KryptonLabel();
+ this.kchkDoNotShowAgain = new Krypton.Toolkit.KryptonCheckBox();
+ this.itbDismiss = new Krypton.Toolkit.InternalToastButton();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit();
+ this.kpnlButtons.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).BeginInit();
+ this.kpnlMain.SuspendLayout();
+ this.tlpMain.SuspendLayout();
+ this.tlpContent.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).BeginInit();
+ this.tableLayoutPanel2.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // kpnlButtons
+ //
+ this.kpnlButtons.Controls.Add(this.tableLayoutPanel2);
+ this.kpnlButtons.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlButtons.Location = new System.Drawing.Point(0, 369);
+ this.kpnlButtons.Name = "kpnlButtons";
+ this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlButtons.Size = new System.Drawing.Size(630, 50);
+ this.kpnlButtons.TabIndex = 6;
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(630, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kpnlMain
+ //
+ this.kpnlMain.Controls.Add(this.tlpMain);
+ this.kpnlMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlMain.Location = new System.Drawing.Point(0, 0);
+ this.kpnlMain.Name = "kpnlMain";
+ this.kpnlMain.Size = new System.Drawing.Size(630, 369);
+ this.kpnlMain.TabIndex = 7;
+ //
+ // tlpMain
+ //
+ this.tlpMain.BackColor = System.Drawing.Color.Transparent;
+ this.tlpMain.ColumnCount = 2;
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Controls.Add(this.tlpContent, 1, 0);
+ this.tlpMain.Controls.Add(this.kpbCountDown, 0, 1);
+ this.tlpMain.Controls.Add(this.pbxNotificationIcon, 0, 0);
+ this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpMain.Location = new System.Drawing.Point(0, 0);
+ this.tlpMain.Name = "tlpMain";
+ this.tlpMain.RowCount = 2;
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpMain.Size = new System.Drawing.Size(630, 369);
+ this.tlpMain.TabIndex = 0;
+ //
+ // tlpContent
+ //
+ this.tlpContent.ColumnCount = 1;
+ this.tlpContent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpContent.Controls.Add(this.kwlNotificationTitle, 0, 0);
+ this.tlpContent.Controls.Add(this.kwlNotificationMessage, 0, 1);
+ this.tlpContent.Controls.Add(this.kdudUserInput, 0, 2);
+ this.tlpContent.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpContent.Location = new System.Drawing.Point(141, 3);
+ this.tlpContent.Name = "tlpContent";
+ this.tlpContent.RowCount = 3;
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpContent.Size = new System.Drawing.Size(486, 331);
+ this.tlpContent.TabIndex = 6;
+ //
+ // kwlNotificationTitle
+ //
+ this.kwlNotificationTitle.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationTitle.Font = new System.Drawing.Font("Segoe UI", 13.5F, System.Drawing.FontStyle.Bold);
+ this.kwlNotificationTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationTitle.LabelStyle = Krypton.Toolkit.LabelStyle.TitleControl;
+ this.kwlNotificationTitle.Location = new System.Drawing.Point(3, 0);
+ this.kwlNotificationTitle.Name = "kwlNotificationTitle";
+ this.kwlNotificationTitle.Size = new System.Drawing.Size(480, 25);
+ this.kwlNotificationTitle.Text = "kryptonWrapLabel1";
+ this.kwlNotificationTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // kwlNotificationMessage
+ //
+ this.kwlNotificationMessage.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationMessage.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.kwlNotificationMessage.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationMessage.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.kwlNotificationMessage.Location = new System.Drawing.Point(3, 25);
+ this.kwlNotificationMessage.Name = "kwlNotificationMessage";
+ this.kwlNotificationMessage.Size = new System.Drawing.Size(480, 278);
+ this.kwlNotificationMessage.Text = "kryptonWrapLabel2";
+ this.kwlNotificationMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // kdudUserInput
+ //
+ this.kdudUserInput.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kdudUserInput.Location = new System.Drawing.Point(3, 306);
+ this.kdudUserInput.Name = "kdudUserInput";
+ this.kdudUserInput.Size = new System.Drawing.Size(480, 22);
+ this.kdudUserInput.TabIndex = 2;
+ //
+ // kpbCountDown
+ //
+ this.tlpMain.SetColumnSpan(this.kpbCountDown, 2);
+ this.kpbCountDown.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpbCountDown.Location = new System.Drawing.Point(3, 340);
+ this.kpbCountDown.Name = "kpbCountDown";
+ this.kpbCountDown.Size = new System.Drawing.Size(624, 26);
+ this.kpbCountDown.StateCommon.Back.Color1 = System.Drawing.Color.Green;
+ this.kpbCountDown.StateDisabled.Back.ColorStyle = Krypton.Toolkit.PaletteColorStyle.OneNote;
+ this.kpbCountDown.StateNormal.Back.ColorStyle = Krypton.Toolkit.PaletteColorStyle.OneNote;
+ this.kpbCountDown.TabIndex = 5;
+ this.kpbCountDown.Text = "kryptonProgressBar1";
+ this.kpbCountDown.Values.Text = "kryptonProgressBar1";
+ //
+ // pbxNotificationIcon
+ //
+ this.pbxNotificationIcon.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pbxNotificationIcon.Location = new System.Drawing.Point(5, 5);
+ this.pbxNotificationIcon.Margin = new System.Windows.Forms.Padding(5);
+ this.pbxNotificationIcon.Name = "pbxNotificationIcon";
+ this.pbxNotificationIcon.Size = new System.Drawing.Size(128, 327);
+ this.pbxNotificationIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pbxNotificationIcon.TabIndex = 0;
+ this.pbxNotificationIcon.TabStop = false;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel2.ColumnCount = 4;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.Controls.Add(this.kbtnDismiss, 2, 0);
+ this.tableLayoutPanel2.Controls.Add(this.klblToastLocation, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.kchkDoNotShowAgain, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.itbDismiss, 3, 0);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 1;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(630, 49);
+ this.tableLayoutPanel2.TabIndex = 6;
+ //
+ // kbtnDismiss
+ //
+ this.kbtnDismiss.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnDismiss.AutoSize = true;
+ this.kbtnDismiss.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.kbtnDismiss.Location = new System.Drawing.Point(554, 13);
+ this.kbtnDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnDismiss.Name = "kbtnDismiss";
+ this.kbtnDismiss.Size = new System.Drawing.Size(23, 22);
+ this.kbtnDismiss.TabIndex = 2;
+ this.kbtnDismiss.Values.Text = "{0}";
+ this.kbtnDismiss.Visible = false;
+ //
+ // klblToastLocation
+ //
+ this.klblToastLocation.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.klblToastLocation.Location = new System.Drawing.Point(75, 23);
+ this.klblToastLocation.Margin = new System.Windows.Forms.Padding(10);
+ this.klblToastLocation.Name = "klblToastLocation";
+ this.klblToastLocation.Size = new System.Drawing.Size(6, 2);
+ this.klblToastLocation.TabIndex = 3;
+ this.klblToastLocation.Values.Text = "";
+ //
+ // kchkDoNotShowAgain
+ //
+ this.kchkDoNotShowAgain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kchkDoNotShowAgain.Location = new System.Drawing.Point(10, 10);
+ this.kchkDoNotShowAgain.Margin = new System.Windows.Forms.Padding(10);
+ this.kchkDoNotShowAgain.Name = "kchkDoNotShowAgain";
+ this.kchkDoNotShowAgain.Size = new System.Drawing.Size(45, 29);
+ this.kchkDoNotShowAgain.TabIndex = 4;
+ this.kchkDoNotShowAgain.Values.Text = "CB1";
+ this.kchkDoNotShowAgain.Visible = false;
+ //
+ // itbDismiss
+ //
+ this.itbDismiss.AutoSize = true;
+ this.itbDismiss.IsActionButton = false;
+ this.itbDismiss.IsDismissButton = true;
+ this.itbDismiss.Location = new System.Drawing.Point(597, 13);
+ this.itbDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.itbDismiss.Name = "itbDismiss";
+ this.itbDismiss.NotificationResult = Krypton.Toolkit.KryptonToastNotificationResult.None;
+ this.itbDismiss.Owner = null;
+ this.itbDismiss.ProcessPath = "";
+ this.itbDismiss.Size = new System.Drawing.Size(23, 22);
+ this.itbDismiss.TabIndex = 5;
+ this.itbDismiss.Values.Text = "{0}";
+ //
+ // VisualToastNotificationDomianUpDownInputWithProgressBarForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(630, 419);
+ this.Controls.Add(this.kpnlMain);
+ this.Controls.Add(this.kpnlButtons);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualToastNotificationDomianUpDownInputWithProgressBarForm";
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.Load += new System.EventHandler(this.VisualToastNotificationDomianUpDownInputWithProgressBarForm_Load);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit();
+ this.kpnlButtons.ResumeLayout(false);
+ this.kpnlButtons.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).EndInit();
+ this.kpnlMain.ResumeLayout(false);
+ this.tlpMain.ResumeLayout(false);
+ this.tlpContent.ResumeLayout(false);
+ this.tlpContent.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).EndInit();
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kpnlButtons;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private KryptonPanel kpnlMain;
+ private TableLayoutPanel tlpMain;
+ private TableLayoutPanel tlpContent;
+ private KryptonWrapLabel kwlNotificationTitle;
+ private KryptonWrapLabel kwlNotificationMessage;
+ private KryptonProgressBar kpbCountDown;
+ private PictureBox pbxNotificationIcon;
+ private KryptonDomainUpDown kdudUserInput;
+ private TableLayoutPanel tableLayoutPanel2;
+ private KryptonButton kbtnDismiss;
+ private KryptonLabel klblToastLocation;
+ private KryptonCheckBox kchkDoNotShowAgain;
+ private InternalToastButton itbDismiss;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationDomianUpDownInputWithProgressBarForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationDomianUpDownInputWithProgressBarForm.cs
new file mode 100644
index 000000000..8b24932c5
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationDomianUpDownInputWithProgressBarForm.cs
@@ -0,0 +1,317 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+using Timer = System.Windows.Forms.Timer;
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualToastNotificationDomianUpDownInputWithProgressBarForm : VisualToastNotificationBaseForm
+ {
+ #region Instance Fields
+
+ private int _time;
+
+ private Timer _timer;
+
+ private readonly KryptonUserInputToastNotificationData _data;
+
+ #endregion
+
+ #region Internal
+
+ internal string UserResponse => kdudUserInput.Text;
+
+ #endregion
+
+ #region Identity
+
+ public VisualToastNotificationDomianUpDownInputWithProgressBarForm(KryptonUserInputToastNotificationData data)
+ {
+ InitializeComponent();
+
+ _data = data;
+
+ GotFocus += (sender, args) => kdudUserInput.Focus();
+
+ Resize += VisualToastNotificationDomianUpDownInputWithProgressBarForm_Resize;
+
+ UpdateBorderColors();
+ }
+
+ #endregion
+
+ #region Implementation
+
+ private void UpdateBorderColors()
+ {
+ StateCommon!.Border.Color1 = _data.BorderColor1 ?? GlobalStaticValues.EMPTY_COLOR;
+
+ StateCommon!.Border.Color2 = _data.BorderColor2 ?? GlobalStaticValues.EMPTY_COLOR;
+ }
+
+ private void UpdateText()
+ {
+ kwlNotificationTitle.Text = _data.NotificationTitle ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+
+ kwlNotificationMessage.Text = _data.NotificationContent ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+
+ private void UpdateInitialValues()
+ {
+ // Set initial date and time values
+ if (_data.UserInputList.Count > 0)
+ {
+ foreach (var item in _data.UserInputList)
+ {
+ kdudUserInput.Items.Add(item);
+ }
+
+ kdudUserInput.SelectedIndex = _data.SelectedIndex ?? 0;
+ }
+ }
+
+ private void SetIcon(Bitmap? image) => pbxNotificationIcon.Image = image;
+
+ private void UpdateLocation()
+ {
+ //Once loaded, position the form, or position it to the bottom left of the screen with added padding
+ Location = _data.NotificationLocation ?? new Point(Screen.PrimaryScreen!.WorkingArea.Width - Width - 5,
+ Screen.PrimaryScreen.WorkingArea.Height - Height - 5);
+ }
+
+ private void UpdateIcon()
+ {
+ switch (_data.NotificationIcon)
+ {
+ case KryptonToastNotificationIcon.None:
+ SetIcon(null);
+ break;
+ case KryptonToastNotificationIcon.Hand:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Hand_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemHand:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Hand.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Question:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Question_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemQuestion:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Question.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Exclamation:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.SystemExclamation:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Exclamation.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Asterisk:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Asterisk_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemAsterisk:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Stop:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Stop_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Error:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Critical_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Warning:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.Information:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Shield:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
+ }
+ else if (OSUtilities.IsWindowsTen)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_10_128_x_128);
+ }
+ else
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128);
+ }
+ break;
+ case KryptonToastNotificationIcon.WindowsLogo:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_11_128_128);
+ }
+ else if (OSUtilities.IsWindowsEight || OSUtilities.IsWindowsEightPointOne || OSUtilities.IsWindowsTen)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_8_81_10_128_128);
+ }
+ else
+ {
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.WinLogo.ToBitmap(), new Size(128, 128)));
+ }
+ break;
+ case KryptonToastNotificationIcon.Application:
+ SetIcon(GraphicsExtensions.ScaleImage(_data.ApplicationIcon.ToBitmap(), new Size(128, 128)));
+ break;
+ case KryptonToastNotificationIcon.SystemApplication:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Ok:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Ok_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Custom:
+ SetIcon(_data.CustomImage != null
+ ? new Bitmap(_data.CustomImage)
+ : null);
+ break;
+ case null:
+ SetIcon(null);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+
+ private void VisualToastNotificationDomianUpDownInputWithProgressBarForm_Resize(object? sender, EventArgs e)
+ {
+ if (WindowState == FormWindowState.Maximized)
+ {
+ WindowState = FormWindowState.Normal;
+ }
+ }
+
+ private void VisualToastNotificationDomianUpDownInputWithProgressBarForm_Load(object sender, EventArgs e)
+ {
+ UpdateIcon();
+
+ UpdateLocation();
+
+ ShowCloseButton();
+
+ kbtnDismiss.Text = KryptonManager.Strings.ToastNotificationStrings.Dismiss;
+
+ _timer.Start();
+ }
+
+ private void ShowCloseButton()
+ {
+ CloseBox = _data.ShowCloseBox ?? false;
+
+ FormBorderStyle = CloseBox ? FormBorderStyle.Fixed3D : FormBorderStyle.FixedSingle;
+
+ ControlBox = _data.ShowCloseBox ?? false;
+ }
+
+ public new DialogResult ShowDialog()
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ UpdateLocation();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kpbCountDown.Maximum = _data.CountDownSeconds ?? 100;
+
+ kpbCountDown.Value = kpbCountDown.Maximum;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kpbCountDown.Value -= 1;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ if (kpbCountDown.Value == kpbCountDown.Minimum)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog();
+ }
+
+ public new DialogResult ShowDialog(IWin32Window owner)
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kpbCountDown.Maximum = _data.CountDownSeconds ?? 100;
+
+ kpbCountDown.Value = kpbCountDown.Maximum;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kpbCountDown.Value -= 1;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ if (kpbCountDown.Value == kpbCountDown.Minimum)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog(owner);
+ }
+
+ internal static string ShowNotification(KryptonUserInputToastNotificationData data)
+ {
+ var owner = data.ToastHost ?? FromHandle(PI.GetActiveWindow());
+
+ using var toast = new VisualToastNotificationDomianUpDownInputWithProgressBarForm(data);
+
+ if (owner != null)
+ {
+ toast.StartPosition = owner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
+
+ return toast.ShowDialog(owner!) == DialogResult.OK ? toast.UserResponse : GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+ else
+ {
+ return toast.ShowDialog() == DialogResult.OK ? toast.UserResponse : GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationDomianUpDownInputWithProgressBarForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationDomianUpDownInputWithProgressBarForm.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationDomianUpDownInputWithProgressBarForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationMaskedTextBoxInputWithProgressBarForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationMaskedTextBoxInputWithProgressBarForm.Designer.cs
new file mode 100644
index 000000000..88a1d97d0
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationMaskedTextBoxInputWithProgressBarForm.Designer.cs
@@ -0,0 +1,294 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualToastNotificationMaskedTextBoxInputWithProgressBarForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.kpnlButtons = new Krypton.Toolkit.KryptonPanel();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kpnlMain = new Krypton.Toolkit.KryptonPanel();
+ this.tlpMain = new System.Windows.Forms.TableLayoutPanel();
+ this.tlpContent = new System.Windows.Forms.TableLayoutPanel();
+ this.kwlNotificationTitle = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kwlNotificationMessage = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kmtxtUserInput = new Krypton.Toolkit.KryptonMaskedTextBox();
+ this.kpbCountDown = new Krypton.Toolkit.KryptonProgressBar();
+ this.pbxNotificationIcon = new System.Windows.Forms.PictureBox();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnDismiss = new Krypton.Toolkit.KryptonButton();
+ this.klblToastLocation = new Krypton.Toolkit.KryptonLabel();
+ this.kchkDoNotShowAgain = new Krypton.Toolkit.KryptonCheckBox();
+ this.itbDismiss = new Krypton.Toolkit.InternalToastButton();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit();
+ this.kpnlButtons.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).BeginInit();
+ this.kpnlMain.SuspendLayout();
+ this.tlpMain.SuspendLayout();
+ this.tlpContent.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).BeginInit();
+ this.tableLayoutPanel2.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // kpnlButtons
+ //
+ this.kpnlButtons.Controls.Add(this.tableLayoutPanel2);
+ this.kpnlButtons.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlButtons.Location = new System.Drawing.Point(0, 369);
+ this.kpnlButtons.Name = "kpnlButtons";
+ this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlButtons.Size = new System.Drawing.Size(630, 50);
+ this.kpnlButtons.TabIndex = 6;
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(630, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kpnlMain
+ //
+ this.kpnlMain.Controls.Add(this.tlpMain);
+ this.kpnlMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlMain.Location = new System.Drawing.Point(0, 0);
+ this.kpnlMain.Name = "kpnlMain";
+ this.kpnlMain.Size = new System.Drawing.Size(630, 369);
+ this.kpnlMain.TabIndex = 7;
+ //
+ // tlpMain
+ //
+ this.tlpMain.BackColor = System.Drawing.Color.Transparent;
+ this.tlpMain.ColumnCount = 2;
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Controls.Add(this.tlpContent, 1, 0);
+ this.tlpMain.Controls.Add(this.kpbCountDown, 0, 1);
+ this.tlpMain.Controls.Add(this.pbxNotificationIcon, 0, 0);
+ this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpMain.Location = new System.Drawing.Point(0, 0);
+ this.tlpMain.Name = "tlpMain";
+ this.tlpMain.RowCount = 2;
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpMain.Size = new System.Drawing.Size(630, 369);
+ this.tlpMain.TabIndex = 0;
+ //
+ // tlpContent
+ //
+ this.tlpContent.ColumnCount = 1;
+ this.tlpContent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpContent.Controls.Add(this.kwlNotificationTitle, 0, 0);
+ this.tlpContent.Controls.Add(this.kwlNotificationMessage, 0, 1);
+ this.tlpContent.Controls.Add(this.kmtxtUserInput, 0, 2);
+ this.tlpContent.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpContent.Location = new System.Drawing.Point(141, 3);
+ this.tlpContent.Name = "tlpContent";
+ this.tlpContent.RowCount = 3;
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpContent.Size = new System.Drawing.Size(486, 331);
+ this.tlpContent.TabIndex = 6;
+ //
+ // kwlNotificationTitle
+ //
+ this.kwlNotificationTitle.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationTitle.Font = new System.Drawing.Font("Segoe UI", 13.5F, System.Drawing.FontStyle.Bold);
+ this.kwlNotificationTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationTitle.LabelStyle = Krypton.Toolkit.LabelStyle.TitleControl;
+ this.kwlNotificationTitle.Location = new System.Drawing.Point(3, 0);
+ this.kwlNotificationTitle.Name = "kwlNotificationTitle";
+ this.kwlNotificationTitle.Size = new System.Drawing.Size(480, 25);
+ this.kwlNotificationTitle.Text = "kryptonWrapLabel1";
+ this.kwlNotificationTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // kwlNotificationMessage
+ //
+ this.kwlNotificationMessage.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationMessage.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.kwlNotificationMessage.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationMessage.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.kwlNotificationMessage.Location = new System.Drawing.Point(3, 25);
+ this.kwlNotificationMessage.Name = "kwlNotificationMessage";
+ this.kwlNotificationMessage.Size = new System.Drawing.Size(480, 277);
+ this.kwlNotificationMessage.Text = "kryptonWrapLabel2";
+ this.kwlNotificationMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // kmtxtUserInput
+ //
+ this.kmtxtUserInput.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kmtxtUserInput.Location = new System.Drawing.Point(3, 305);
+ this.kmtxtUserInput.Name = "kmtxtUserInput";
+ this.kmtxtUserInput.Size = new System.Drawing.Size(480, 23);
+ this.kmtxtUserInput.TabIndex = 2;
+ //
+ // kpbCountDown
+ //
+ this.tlpMain.SetColumnSpan(this.kpbCountDown, 2);
+ this.kpbCountDown.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpbCountDown.Location = new System.Drawing.Point(3, 340);
+ this.kpbCountDown.Name = "kpbCountDown";
+ this.kpbCountDown.Size = new System.Drawing.Size(624, 26);
+ this.kpbCountDown.StateCommon.Back.Color1 = System.Drawing.Color.Green;
+ this.kpbCountDown.StateDisabled.Back.ColorStyle = Krypton.Toolkit.PaletteColorStyle.OneNote;
+ this.kpbCountDown.StateNormal.Back.ColorStyle = Krypton.Toolkit.PaletteColorStyle.OneNote;
+ this.kpbCountDown.TabIndex = 5;
+ this.kpbCountDown.Text = "kryptonProgressBar1";
+ this.kpbCountDown.Values.Text = "kryptonProgressBar1";
+ //
+ // pbxNotificationIcon
+ //
+ this.pbxNotificationIcon.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pbxNotificationIcon.Location = new System.Drawing.Point(5, 5);
+ this.pbxNotificationIcon.Margin = new System.Windows.Forms.Padding(5);
+ this.pbxNotificationIcon.Name = "pbxNotificationIcon";
+ this.pbxNotificationIcon.Size = new System.Drawing.Size(128, 327);
+ this.pbxNotificationIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pbxNotificationIcon.TabIndex = 0;
+ this.pbxNotificationIcon.TabStop = false;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel2.ColumnCount = 4;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.Controls.Add(this.kbtnDismiss, 2, 0);
+ this.tableLayoutPanel2.Controls.Add(this.klblToastLocation, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.kchkDoNotShowAgain, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.itbDismiss, 3, 0);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 1;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(630, 49);
+ this.tableLayoutPanel2.TabIndex = 6;
+ //
+ // kbtnDismiss
+ //
+ this.kbtnDismiss.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnDismiss.AutoSize = true;
+ this.kbtnDismiss.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.kbtnDismiss.Location = new System.Drawing.Point(554, 13);
+ this.kbtnDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnDismiss.Name = "kbtnDismiss";
+ this.kbtnDismiss.Size = new System.Drawing.Size(23, 22);
+ this.kbtnDismiss.TabIndex = 2;
+ this.kbtnDismiss.Values.Text = "{0}";
+ this.kbtnDismiss.Visible = false;
+ //
+ // klblToastLocation
+ //
+ this.klblToastLocation.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.klblToastLocation.Location = new System.Drawing.Point(75, 23);
+ this.klblToastLocation.Margin = new System.Windows.Forms.Padding(10);
+ this.klblToastLocation.Name = "klblToastLocation";
+ this.klblToastLocation.Size = new System.Drawing.Size(6, 2);
+ this.klblToastLocation.TabIndex = 3;
+ this.klblToastLocation.Values.Text = "";
+ //
+ // kchkDoNotShowAgain
+ //
+ this.kchkDoNotShowAgain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kchkDoNotShowAgain.Location = new System.Drawing.Point(10, 10);
+ this.kchkDoNotShowAgain.Margin = new System.Windows.Forms.Padding(10);
+ this.kchkDoNotShowAgain.Name = "kchkDoNotShowAgain";
+ this.kchkDoNotShowAgain.Size = new System.Drawing.Size(45, 29);
+ this.kchkDoNotShowAgain.TabIndex = 4;
+ this.kchkDoNotShowAgain.Values.Text = "CB1";
+ this.kchkDoNotShowAgain.Visible = false;
+ //
+ // itbDismiss
+ //
+ this.itbDismiss.AutoSize = true;
+ this.itbDismiss.IsActionButton = false;
+ this.itbDismiss.IsDismissButton = true;
+ this.itbDismiss.Location = new System.Drawing.Point(597, 13);
+ this.itbDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.itbDismiss.Name = "itbDismiss";
+ this.itbDismiss.NotificationResult = Krypton.Toolkit.KryptonToastNotificationResult.None;
+ this.itbDismiss.Owner = null;
+ this.itbDismiss.ProcessPath = "";
+ this.itbDismiss.Size = new System.Drawing.Size(23, 22);
+ this.itbDismiss.TabIndex = 5;
+ this.itbDismiss.Values.Text = "{0}";
+ //
+ // VisualToastNotificationMaskedTextBoxInputWithProgressBarForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(630, 419);
+ this.Controls.Add(this.kpnlMain);
+ this.Controls.Add(this.kpnlButtons);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualToastNotificationMaskedTextBoxInputWithProgressBarForm";
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.Load += new System.EventHandler(this.VisualToastNotificationMaskedTextBoxInputWithProgressBarForm_Load);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit();
+ this.kpnlButtons.ResumeLayout(false);
+ this.kpnlButtons.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).EndInit();
+ this.kpnlMain.ResumeLayout(false);
+ this.tlpMain.ResumeLayout(false);
+ this.tlpContent.ResumeLayout(false);
+ this.tlpContent.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).EndInit();
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kpnlButtons;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private KryptonPanel kpnlMain;
+ private TableLayoutPanel tlpMain;
+ private TableLayoutPanel tlpContent;
+ private KryptonWrapLabel kwlNotificationTitle;
+ private KryptonWrapLabel kwlNotificationMessage;
+ private KryptonProgressBar kpbCountDown;
+ private PictureBox pbxNotificationIcon;
+ private KryptonMaskedTextBox kmtxtUserInput;
+ private TableLayoutPanel tableLayoutPanel2;
+ private KryptonButton kbtnDismiss;
+ private KryptonLabel klblToastLocation;
+ private KryptonCheckBox kchkDoNotShowAgain;
+ private InternalToastButton itbDismiss;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationMaskedTextBoxInputWithProgressBarForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationMaskedTextBoxInputWithProgressBarForm.cs
new file mode 100644
index 000000000..31b22f6de
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationMaskedTextBoxInputWithProgressBarForm.cs
@@ -0,0 +1,309 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+using Timer = System.Windows.Forms.Timer;
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualToastNotificationMaskedTextBoxInputWithProgressBarForm : VisualToastNotificationBaseForm
+ {
+ #region Instance Fields
+
+ private int _time;
+
+ private Timer _timer;
+
+ private readonly KryptonUserInputToastNotificationData _data;
+
+ #endregion
+
+ #region Internal
+
+ internal string UserResponse => kmtxtUserInput.Text;
+
+ #endregion
+
+ #region Identity
+
+ public VisualToastNotificationMaskedTextBoxInputWithProgressBarForm(KryptonUserInputToastNotificationData data)
+ {
+ InitializeComponent();
+
+ _data = data;
+
+ GotFocus += (sender, args) => kmtxtUserInput.Focus();
+
+ Resize += VisualToastNotificationMaskedTextBoxInputWithProgressBarForm_Resize;
+
+ UpdateBorderColors();
+ }
+
+ #endregion
+
+ #region Implementation
+
+ private void UpdateBorderColors()
+ {
+ StateCommon!.Border.Color1 = _data.BorderColor1 ?? GlobalStaticValues.EMPTY_COLOR;
+
+ StateCommon!.Border.Color2 = _data.BorderColor2 ?? GlobalStaticValues.EMPTY_COLOR;
+ }
+
+ private void UpdateText()
+ {
+ kwlNotificationTitle.Text = _data.NotificationTitle ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+
+ kwlNotificationMessage.Text = _data.NotificationContent ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+
+ private void UpdateInitialValues()
+ {
+ // Set initial date and time values
+ kmtxtUserInput.Text = GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+
+ private void SetIcon(Bitmap? image) => pbxNotificationIcon.Image = image;
+
+ private void UpdateLocation()
+ {
+ //Once loaded, position the form, or position it to the bottom left of the screen with added padding
+ Location = _data.NotificationLocation ?? new Point(Screen.PrimaryScreen!.WorkingArea.Width - Width - 5,
+ Screen.PrimaryScreen.WorkingArea.Height - Height - 5);
+ }
+
+ private void UpdateIcon()
+ {
+ switch (_data.NotificationIcon)
+ {
+ case KryptonToastNotificationIcon.None:
+ SetIcon(null);
+ break;
+ case KryptonToastNotificationIcon.Hand:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Hand_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemHand:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Hand.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Question:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Question_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemQuestion:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Question.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Exclamation:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.SystemExclamation:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Exclamation.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Asterisk:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Asterisk_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemAsterisk:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Stop:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Stop_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Error:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Critical_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Warning:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.Information:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Shield:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
+ }
+ else if (OSUtilities.IsWindowsTen)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_10_128_x_128);
+ }
+ else
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128);
+ }
+ break;
+ case KryptonToastNotificationIcon.WindowsLogo:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_11_128_128);
+ }
+ else if (OSUtilities.IsWindowsEight || OSUtilities.IsWindowsEightPointOne || OSUtilities.IsWindowsTen)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_8_81_10_128_128);
+ }
+ else
+ {
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.WinLogo.ToBitmap(), new Size(128, 128)));
+ }
+ break;
+ case KryptonToastNotificationIcon.Application:
+ SetIcon(GraphicsExtensions.ScaleImage(_data.ApplicationIcon.ToBitmap(), new Size(128, 128)));
+ break;
+ case KryptonToastNotificationIcon.SystemApplication:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Ok:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Ok_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Custom:
+ SetIcon(_data.CustomImage != null
+ ? new Bitmap(_data.CustomImage)
+ : null);
+ break;
+ case null:
+ SetIcon(null);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+
+ private void VisualToastNotificationMaskedTextBoxInputWithProgressBarForm_Resize(object? sender, EventArgs e)
+ {
+ if (WindowState == FormWindowState.Maximized)
+ {
+ WindowState = FormWindowState.Normal;
+ }
+ }
+
+ private void VisualToastNotificationMaskedTextBoxInputWithProgressBarForm_Load(object sender, EventArgs e)
+ {
+ UpdateIcon();
+
+ UpdateLocation();
+
+ ShowCloseButton();
+
+ kbtnDismiss.Text = KryptonManager.Strings.ToastNotificationStrings.Dismiss;
+
+ _timer.Start();
+ }
+
+ private void ShowCloseButton()
+ {
+ CloseBox = _data.ShowCloseBox ?? false;
+
+ FormBorderStyle = CloseBox ? FormBorderStyle.Fixed3D : FormBorderStyle.FixedSingle;
+
+ ControlBox = _data.ShowCloseBox ?? false;
+ }
+
+ public new DialogResult ShowDialog()
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ UpdateLocation();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kpbCountDown.Maximum = _data.CountDownSeconds ?? 100;
+
+ kpbCountDown.Value = kpbCountDown.Maximum;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kpbCountDown.Value -= 1;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ if (kpbCountDown.Value == kpbCountDown.Minimum)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog();
+ }
+
+ public new DialogResult ShowDialog(IWin32Window owner)
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kpbCountDown.Maximum = _data.CountDownSeconds ?? 100;
+
+ kpbCountDown.Value = kpbCountDown.Maximum;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kpbCountDown.Value -= 1;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ if (kpbCountDown.Value == kpbCountDown.Minimum)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog(owner);
+ }
+
+ internal static string ShowNotification(KryptonUserInputToastNotificationData data)
+ {
+ var owner = data.ToastHost ?? FromHandle(PI.GetActiveWindow());
+
+ using var toast = new VisualToastNotificationMaskedTextBoxInputWithProgressBarForm(data);
+
+ if (owner != null)
+ {
+ toast.StartPosition = owner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
+
+ return toast.ShowDialog(owner!) == DialogResult.OK ? toast.UserResponse : GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+ else
+ {
+ return toast.ShowDialog() == DialogResult.OK ? toast.UserResponse : GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationMaskedTextBoxInputWithProgressBarForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationMaskedTextBoxInputWithProgressBarForm.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationMaskedTextBoxInputWithProgressBarForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationNUDUserInputWithProgressBarForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationNUDUserInputWithProgressBarForm.Designer.cs
new file mode 100644
index 000000000..29441d3ab
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationNUDUserInputWithProgressBarForm.Designer.cs
@@ -0,0 +1,314 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualToastNotificationNUDUserInputWithProgressBarForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.kpnlButtons = new Krypton.Toolkit.KryptonPanel();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kpnlMain = new Krypton.Toolkit.KryptonPanel();
+ this.tlpMain = new System.Windows.Forms.TableLayoutPanel();
+ this.tlpContent = new System.Windows.Forms.TableLayoutPanel();
+ this.kwlNotificationTitle = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kwlNotificationMessage = new Krypton.Toolkit.KryptonWrapLabel();
+ this.knudUserInput = new Krypton.Toolkit.KryptonNumericUpDown();
+ this.kpbCountDown = new Krypton.Toolkit.KryptonProgressBar();
+ this.pbxNotificationIcon = new System.Windows.Forms.PictureBox();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnDismiss = new Krypton.Toolkit.KryptonButton();
+ this.klblToastLocation = new Krypton.Toolkit.KryptonLabel();
+ this.kchkDoNotShowAgain = new Krypton.Toolkit.KryptonCheckBox();
+ this.itbDismiss = new Krypton.Toolkit.InternalToastButton();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit();
+ this.kpnlButtons.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).BeginInit();
+ this.kpnlMain.SuspendLayout();
+ this.tlpMain.SuspendLayout();
+ this.tlpContent.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).BeginInit();
+ this.tableLayoutPanel2.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // kpnlButtons
+ //
+ this.kpnlButtons.Controls.Add(this.tableLayoutPanel2);
+ this.kpnlButtons.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlButtons.Location = new System.Drawing.Point(0, 369);
+ this.kpnlButtons.Name = "kpnlButtons";
+ this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlButtons.Size = new System.Drawing.Size(630, 50);
+ this.kpnlButtons.TabIndex = 7;
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(630, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kpnlMain
+ //
+ this.kpnlMain.Controls.Add(this.tlpMain);
+ this.kpnlMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlMain.Location = new System.Drawing.Point(0, 0);
+ this.kpnlMain.Name = "kpnlMain";
+ this.kpnlMain.Size = new System.Drawing.Size(630, 369);
+ this.kpnlMain.TabIndex = 8;
+ //
+ // tlpMain
+ //
+ this.tlpMain.BackColor = System.Drawing.Color.Transparent;
+ this.tlpMain.ColumnCount = 2;
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Controls.Add(this.tlpContent, 1, 0);
+ this.tlpMain.Controls.Add(this.kpbCountDown, 0, 1);
+ this.tlpMain.Controls.Add(this.pbxNotificationIcon, 0, 0);
+ this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpMain.Location = new System.Drawing.Point(0, 0);
+ this.tlpMain.Name = "tlpMain";
+ this.tlpMain.RowCount = 2;
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpMain.Size = new System.Drawing.Size(630, 369);
+ this.tlpMain.TabIndex = 0;
+ //
+ // tlpContent
+ //
+ this.tlpContent.ColumnCount = 1;
+ this.tlpContent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpContent.Controls.Add(this.kwlNotificationTitle, 0, 0);
+ this.tlpContent.Controls.Add(this.kwlNotificationMessage, 0, 1);
+ this.tlpContent.Controls.Add(this.knudUserInput, 0, 2);
+ this.tlpContent.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpContent.Location = new System.Drawing.Point(141, 3);
+ this.tlpContent.Name = "tlpContent";
+ this.tlpContent.RowCount = 3;
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpContent.Size = new System.Drawing.Size(486, 331);
+ this.tlpContent.TabIndex = 6;
+ //
+ // kwlNotificationTitle
+ //
+ this.kwlNotificationTitle.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationTitle.Font = new System.Drawing.Font("Segoe UI", 13.5F, System.Drawing.FontStyle.Bold);
+ this.kwlNotificationTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationTitle.LabelStyle = Krypton.Toolkit.LabelStyle.TitleControl;
+ this.kwlNotificationTitle.Location = new System.Drawing.Point(3, 0);
+ this.kwlNotificationTitle.Name = "kwlNotificationTitle";
+ this.kwlNotificationTitle.Size = new System.Drawing.Size(480, 25);
+ this.kwlNotificationTitle.Text = "kryptonWrapLabel1";
+ this.kwlNotificationTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // kwlNotificationMessage
+ //
+ this.kwlNotificationMessage.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationMessage.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.kwlNotificationMessage.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationMessage.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.kwlNotificationMessage.Location = new System.Drawing.Point(3, 25);
+ this.kwlNotificationMessage.Name = "kwlNotificationMessage";
+ this.kwlNotificationMessage.Size = new System.Drawing.Size(480, 278);
+ this.kwlNotificationMessage.Text = "kryptonWrapLabel2";
+ this.kwlNotificationMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // knudUserInput
+ //
+ this.knudUserInput.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.knudUserInput.Increment = new decimal(new int[] {
+ 1,
+ 0,
+ 0,
+ 0});
+ this.knudUserInput.Location = new System.Drawing.Point(3, 306);
+ this.knudUserInput.Maximum = new decimal(new int[] {
+ 100,
+ 0,
+ 0,
+ 0});
+ this.knudUserInput.Minimum = new decimal(new int[] {
+ 0,
+ 0,
+ 0,
+ 0});
+ this.knudUserInput.Name = "knudUserInput";
+ this.knudUserInput.Size = new System.Drawing.Size(480, 22);
+ this.knudUserInput.TabIndex = 2;
+ this.knudUserInput.Value = new decimal(new int[] {
+ 0,
+ 0,
+ 0,
+ 0});
+ //
+ // kpbCountDown
+ //
+ this.tlpMain.SetColumnSpan(this.kpbCountDown, 2);
+ this.kpbCountDown.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpbCountDown.Location = new System.Drawing.Point(3, 340);
+ this.kpbCountDown.Name = "kpbCountDown";
+ this.kpbCountDown.Size = new System.Drawing.Size(624, 26);
+ this.kpbCountDown.StateCommon.Back.Color1 = System.Drawing.Color.Green;
+ this.kpbCountDown.StateDisabled.Back.ColorStyle = Krypton.Toolkit.PaletteColorStyle.OneNote;
+ this.kpbCountDown.StateNormal.Back.ColorStyle = Krypton.Toolkit.PaletteColorStyle.OneNote;
+ this.kpbCountDown.TabIndex = 5;
+ this.kpbCountDown.Text = "kryptonProgressBar1";
+ this.kpbCountDown.Values.Text = "kryptonProgressBar1";
+ //
+ // pbxNotificationIcon
+ //
+ this.pbxNotificationIcon.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pbxNotificationIcon.Location = new System.Drawing.Point(5, 5);
+ this.pbxNotificationIcon.Margin = new System.Windows.Forms.Padding(5);
+ this.pbxNotificationIcon.Name = "pbxNotificationIcon";
+ this.pbxNotificationIcon.Size = new System.Drawing.Size(128, 327);
+ this.pbxNotificationIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pbxNotificationIcon.TabIndex = 0;
+ this.pbxNotificationIcon.TabStop = false;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel2.ColumnCount = 4;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.Controls.Add(this.kbtnDismiss, 2, 0);
+ this.tableLayoutPanel2.Controls.Add(this.klblToastLocation, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.kchkDoNotShowAgain, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.itbDismiss, 3, 0);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 1;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(630, 49);
+ this.tableLayoutPanel2.TabIndex = 6;
+ //
+ // kbtnDismiss
+ //
+ this.kbtnDismiss.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnDismiss.AutoSize = true;
+ this.kbtnDismiss.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.kbtnDismiss.Location = new System.Drawing.Point(554, 13);
+ this.kbtnDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnDismiss.Name = "kbtnDismiss";
+ this.kbtnDismiss.Size = new System.Drawing.Size(23, 22);
+ this.kbtnDismiss.TabIndex = 2;
+ this.kbtnDismiss.Values.Text = "{0}";
+ this.kbtnDismiss.Visible = false;
+ //
+ // klblToastLocation
+ //
+ this.klblToastLocation.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.klblToastLocation.Location = new System.Drawing.Point(75, 23);
+ this.klblToastLocation.Margin = new System.Windows.Forms.Padding(10);
+ this.klblToastLocation.Name = "klblToastLocation";
+ this.klblToastLocation.Size = new System.Drawing.Size(6, 2);
+ this.klblToastLocation.TabIndex = 3;
+ this.klblToastLocation.Values.Text = "";
+ //
+ // kchkDoNotShowAgain
+ //
+ this.kchkDoNotShowAgain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kchkDoNotShowAgain.Location = new System.Drawing.Point(10, 10);
+ this.kchkDoNotShowAgain.Margin = new System.Windows.Forms.Padding(10);
+ this.kchkDoNotShowAgain.Name = "kchkDoNotShowAgain";
+ this.kchkDoNotShowAgain.Size = new System.Drawing.Size(45, 29);
+ this.kchkDoNotShowAgain.TabIndex = 4;
+ this.kchkDoNotShowAgain.Values.Text = "CB1";
+ this.kchkDoNotShowAgain.Visible = false;
+ //
+ // itbDismiss
+ //
+ this.itbDismiss.AutoSize = true;
+ this.itbDismiss.IsActionButton = false;
+ this.itbDismiss.IsDismissButton = true;
+ this.itbDismiss.Location = new System.Drawing.Point(597, 13);
+ this.itbDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.itbDismiss.Name = "itbDismiss";
+ this.itbDismiss.NotificationResult = Krypton.Toolkit.KryptonToastNotificationResult.None;
+ this.itbDismiss.Owner = null;
+ this.itbDismiss.ProcessPath = "";
+ this.itbDismiss.Size = new System.Drawing.Size(23, 22);
+ this.itbDismiss.TabIndex = 5;
+ this.itbDismiss.Values.Text = "{0}";
+ //
+ // VisualToastNotificationNumericUpDownUserInputWithProgressBarForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(630, 419);
+ this.Controls.Add(this.kpnlMain);
+ this.Controls.Add(this.kpnlButtons);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualToastNotificationNumericUpDownUserInputWithProgressBarForm";
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.Load += new System.EventHandler(this.VisualToastNotificationNumericUpDownUserInputWithProgressBarForm_Load);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit();
+ this.kpnlButtons.ResumeLayout(false);
+ this.kpnlButtons.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).EndInit();
+ this.kpnlMain.ResumeLayout(false);
+ this.tlpMain.ResumeLayout(false);
+ this.tlpContent.ResumeLayout(false);
+ this.tlpContent.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).EndInit();
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kpnlButtons;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private KryptonPanel kpnlMain;
+ private TableLayoutPanel tlpMain;
+ private TableLayoutPanel tlpContent;
+ private KryptonWrapLabel kwlNotificationTitle;
+ private KryptonWrapLabel kwlNotificationMessage;
+ private KryptonProgressBar kpbCountDown;
+ private PictureBox pbxNotificationIcon;
+ private KryptonNumericUpDown knudUserInput;
+ private TableLayoutPanel tableLayoutPanel2;
+ private KryptonButton kbtnDismiss;
+ private KryptonLabel klblToastLocation;
+ private KryptonCheckBox kchkDoNotShowAgain;
+ private InternalToastButton itbDismiss;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationNUDUserInputWithProgressBarForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationNUDUserInputWithProgressBarForm.cs
new file mode 100644
index 000000000..70bc52999
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationNUDUserInputWithProgressBarForm.cs
@@ -0,0 +1,314 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+using Timer = System.Windows.Forms.Timer;
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualToastNotificationNUDUserInputWithProgressBarForm : VisualToastNotificationBaseForm
+ {
+ #region Instance Fields
+
+ private int _time;
+
+ private Timer _timer;
+
+ private readonly KryptonUserInputToastNotificationData _data;
+
+ #endregion
+
+ #region Internal
+
+ internal int UserResponse => Convert.ToInt32(knudUserInput.Value);
+
+ #endregion
+
+ #region Identity
+
+ public VisualToastNotificationNUDUserInputWithProgressBarForm(KryptonUserInputToastNotificationData data)
+ {
+ InitializeComponent();
+
+ _data = data;
+
+ GotFocus += (sender, args) => knudUserInput.Focus();
+
+ Resize += VisualToastNotificationNumericUpDownUserInputWithProgressBarForm_Resize;
+
+ UpdateBorderColors();
+ }
+
+ #endregion
+
+ #region Implementation
+
+ private void UpdateBorderColors()
+ {
+ StateCommon!.Border.Color1 = _data.BorderColor1 ?? GlobalStaticValues.EMPTY_COLOR;
+
+ StateCommon!.Border.Color2 = _data.BorderColor2 ?? GlobalStaticValues.EMPTY_COLOR;
+ }
+
+ private void UpdateText()
+ {
+ kwlNotificationTitle.Text = _data.NotificationTitle ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+
+ kwlNotificationMessage.Text = _data.NotificationContent ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+
+ private void UpdateInitialValues()
+ {
+ // Set initial date and time values
+ knudUserInput.Maximum = _data.MaximumNumericUpDownValue ?? 100;
+
+ knudUserInput.Minimum = _data.MinimumNumericUpDownValue ?? 0;
+
+ knudUserInput.Value = _data.InitialNumericUpDownValue ?? 0;
+ }
+
+ private void SetIcon(Bitmap? image) => pbxNotificationIcon.Image = image;
+
+ private void UpdateLocation()
+ {
+ //Once loaded, position the form, or position it to the bottom left of the screen with added padding
+ Location = _data.NotificationLocation ?? new Point(Screen.PrimaryScreen!.WorkingArea.Width - Width - 5,
+ Screen.PrimaryScreen.WorkingArea.Height - Height - 5);
+ }
+
+ private void UpdateIcon()
+ {
+ switch (_data.NotificationIcon)
+ {
+ case KryptonToastNotificationIcon.None:
+ SetIcon(null);
+ break;
+ case KryptonToastNotificationIcon.Hand:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Hand_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemHand:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Hand.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Question:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Question_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemQuestion:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Question.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Exclamation:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.SystemExclamation:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Exclamation.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Asterisk:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Asterisk_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemAsterisk:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Stop:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Stop_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Error:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Critical_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Warning:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.Information:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Shield:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
+ }
+ else if (OSUtilities.IsWindowsTen)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_10_128_x_128);
+ }
+ else
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128);
+ }
+ break;
+ case KryptonToastNotificationIcon.WindowsLogo:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_11_128_128);
+ }
+ else if (OSUtilities.IsWindowsEight || OSUtilities.IsWindowsEightPointOne || OSUtilities.IsWindowsTen)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_8_81_10_128_128);
+ }
+ else
+ {
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.WinLogo.ToBitmap(), new Size(128, 128)));
+ }
+ break;
+ case KryptonToastNotificationIcon.Application:
+ SetIcon(GraphicsExtensions.ScaleImage(_data.ApplicationIcon.ToBitmap(), new Size(128, 128)));
+ break;
+ case KryptonToastNotificationIcon.SystemApplication:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Ok:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Ok_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Custom:
+ SetIcon(_data.CustomImage != null
+ ? new Bitmap(_data.CustomImage)
+ : null);
+ break;
+ case null:
+ SetIcon(null);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+
+ private void VisualToastNotificationNumericUpDownUserInputWithProgressBarForm_Resize(object? sender, EventArgs e)
+ {
+ if (WindowState == FormWindowState.Maximized)
+ {
+ WindowState = FormWindowState.Normal;
+ }
+ }
+
+ private void VisualToastNotificationNumericUpDownUserInputWithProgressBarForm_Load(object sender, EventArgs e)
+ {
+ UpdateIcon();
+
+ UpdateLocation();
+
+ ShowCloseButton();
+
+ kbtnDismiss.Text = KryptonManager.Strings.ToastNotificationStrings.Dismiss;
+
+ _timer.Start();
+ }
+
+ private void ShowCloseButton()
+ {
+ CloseBox = _data.ShowCloseBox ?? false;
+
+ FormBorderStyle = CloseBox ? FormBorderStyle.Fixed3D : FormBorderStyle.FixedSingle;
+
+ ControlBox = _data.ShowCloseBox ?? false;
+ }
+
+ public new DialogResult ShowDialog()
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ UpdateLocation();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kpbCountDown.Maximum = _data.CountDownSeconds ?? 100;
+
+ kpbCountDown.Value = kpbCountDown.Maximum;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kpbCountDown.Value -= 1;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ if (kpbCountDown.Value == kpbCountDown.Minimum)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog();
+ }
+
+ public new DialogResult ShowDialog(IWin32Window owner)
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kpbCountDown.Maximum = _data.CountDownSeconds ?? 100;
+
+ kpbCountDown.Value = kpbCountDown.Maximum;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kpbCountDown.Value -= 1;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ if (kpbCountDown.Value == kpbCountDown.Minimum)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog(owner);
+ }
+
+
+ public static decimal ShowToastNotification(KryptonUserInputToastNotificationData data)
+ {
+ var owner = data.ToastHost ?? FromHandle(PI.GetActiveWindow());
+
+ using var toast = new VisualToastNotificationNUDUserInputWithProgressBarForm(data);
+
+ if (owner != null)
+ {
+ toast.StartPosition = owner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
+
+ return toast.ShowDialog(owner!) == DialogResult.OK ? toast.UserResponse : 0;
+ }
+ else
+ {
+ return toast.ShowDialog() == DialogResult.OK ? toast.UserResponse : 0;
+ }
+ }
+ }
+
+ #endregion
+}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationNUDUserInputWithProgressBarForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationNUDUserInputWithProgressBarForm.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationNUDUserInputWithProgressBarForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationTextBoxUserInputWithProgressBarForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationTextBoxUserInputWithProgressBarForm.Designer.cs
new file mode 100644
index 000000000..cb0014226
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationTextBoxUserInputWithProgressBarForm.Designer.cs
@@ -0,0 +1,294 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualToastNotificationTextBoxUserInputWithProgressBarForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.kpnlButtons = new Krypton.Toolkit.KryptonPanel();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kpnlMain = new Krypton.Toolkit.KryptonPanel();
+ this.tlpMain = new System.Windows.Forms.TableLayoutPanel();
+ this.tlpContent = new System.Windows.Forms.TableLayoutPanel();
+ this.kwlNotificationTitle = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kwlNotificationMessage = new Krypton.Toolkit.KryptonWrapLabel();
+ this.ktxtUserInput = new Krypton.Toolkit.KryptonTextBox();
+ this.kpbCountDown = new Krypton.Toolkit.KryptonProgressBar();
+ this.pbxNotificationIcon = new System.Windows.Forms.PictureBox();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnDismiss = new Krypton.Toolkit.KryptonButton();
+ this.klblToastLocation = new Krypton.Toolkit.KryptonLabel();
+ this.kchkDoNotShowAgain = new Krypton.Toolkit.KryptonCheckBox();
+ this.itbDismiss = new Krypton.Toolkit.InternalToastButton();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit();
+ this.kpnlButtons.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).BeginInit();
+ this.kpnlMain.SuspendLayout();
+ this.tlpMain.SuspendLayout();
+ this.tlpContent.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).BeginInit();
+ this.tableLayoutPanel2.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // kpnlButtons
+ //
+ this.kpnlButtons.Controls.Add(this.tableLayoutPanel2);
+ this.kpnlButtons.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlButtons.Location = new System.Drawing.Point(0, 369);
+ this.kpnlButtons.Name = "kpnlButtons";
+ this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlButtons.Size = new System.Drawing.Size(630, 50);
+ this.kpnlButtons.TabIndex = 7;
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(630, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kpnlMain
+ //
+ this.kpnlMain.Controls.Add(this.tlpMain);
+ this.kpnlMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlMain.Location = new System.Drawing.Point(0, 0);
+ this.kpnlMain.Name = "kpnlMain";
+ this.kpnlMain.Size = new System.Drawing.Size(630, 369);
+ this.kpnlMain.TabIndex = 8;
+ //
+ // tlpMain
+ //
+ this.tlpMain.BackColor = System.Drawing.Color.Transparent;
+ this.tlpMain.ColumnCount = 2;
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Controls.Add(this.tlpContent, 1, 0);
+ this.tlpMain.Controls.Add(this.kpbCountDown, 0, 1);
+ this.tlpMain.Controls.Add(this.pbxNotificationIcon, 0, 0);
+ this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpMain.Location = new System.Drawing.Point(0, 0);
+ this.tlpMain.Name = "tlpMain";
+ this.tlpMain.RowCount = 2;
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpMain.Size = new System.Drawing.Size(630, 369);
+ this.tlpMain.TabIndex = 0;
+ //
+ // tlpContent
+ //
+ this.tlpContent.ColumnCount = 1;
+ this.tlpContent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpContent.Controls.Add(this.kwlNotificationTitle, 0, 0);
+ this.tlpContent.Controls.Add(this.kwlNotificationMessage, 0, 1);
+ this.tlpContent.Controls.Add(this.ktxtUserInput, 0, 2);
+ this.tlpContent.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpContent.Location = new System.Drawing.Point(141, 3);
+ this.tlpContent.Name = "tlpContent";
+ this.tlpContent.RowCount = 3;
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpContent.Size = new System.Drawing.Size(486, 331);
+ this.tlpContent.TabIndex = 6;
+ //
+ // kwlNotificationTitle
+ //
+ this.kwlNotificationTitle.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationTitle.Font = new System.Drawing.Font("Segoe UI", 13.5F, System.Drawing.FontStyle.Bold);
+ this.kwlNotificationTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationTitle.LabelStyle = Krypton.Toolkit.LabelStyle.TitleControl;
+ this.kwlNotificationTitle.Location = new System.Drawing.Point(3, 0);
+ this.kwlNotificationTitle.Name = "kwlNotificationTitle";
+ this.kwlNotificationTitle.Size = new System.Drawing.Size(480, 25);
+ this.kwlNotificationTitle.Text = "kryptonWrapLabel1";
+ this.kwlNotificationTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // kwlNotificationMessage
+ //
+ this.kwlNotificationMessage.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationMessage.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.kwlNotificationMessage.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationMessage.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.kwlNotificationMessage.Location = new System.Drawing.Point(3, 25);
+ this.kwlNotificationMessage.Name = "kwlNotificationMessage";
+ this.kwlNotificationMessage.Size = new System.Drawing.Size(480, 277);
+ this.kwlNotificationMessage.Text = "kryptonWrapLabel2";
+ this.kwlNotificationMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // ktxtUserInput
+ //
+ this.ktxtUserInput.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.ktxtUserInput.Location = new System.Drawing.Point(3, 305);
+ this.ktxtUserInput.Name = "ktxtUserInput";
+ this.ktxtUserInput.Size = new System.Drawing.Size(480, 23);
+ this.ktxtUserInput.TabIndex = 2;
+ //
+ // kpbCountDown
+ //
+ this.tlpMain.SetColumnSpan(this.kpbCountDown, 2);
+ this.kpbCountDown.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpbCountDown.Location = new System.Drawing.Point(3, 340);
+ this.kpbCountDown.Name = "kpbCountDown";
+ this.kpbCountDown.Size = new System.Drawing.Size(624, 26);
+ this.kpbCountDown.StateCommon.Back.Color1 = System.Drawing.Color.Green;
+ this.kpbCountDown.StateDisabled.Back.ColorStyle = Krypton.Toolkit.PaletteColorStyle.OneNote;
+ this.kpbCountDown.StateNormal.Back.ColorStyle = Krypton.Toolkit.PaletteColorStyle.OneNote;
+ this.kpbCountDown.TabIndex = 5;
+ this.kpbCountDown.Text = "kryptonProgressBar1";
+ this.kpbCountDown.Values.Text = "kryptonProgressBar1";
+ //
+ // pbxNotificationIcon
+ //
+ this.pbxNotificationIcon.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pbxNotificationIcon.Location = new System.Drawing.Point(5, 5);
+ this.pbxNotificationIcon.Margin = new System.Windows.Forms.Padding(5);
+ this.pbxNotificationIcon.Name = "pbxNotificationIcon";
+ this.pbxNotificationIcon.Size = new System.Drawing.Size(128, 327);
+ this.pbxNotificationIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pbxNotificationIcon.TabIndex = 0;
+ this.pbxNotificationIcon.TabStop = false;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel2.ColumnCount = 4;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.Controls.Add(this.kbtnDismiss, 2, 0);
+ this.tableLayoutPanel2.Controls.Add(this.klblToastLocation, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.kchkDoNotShowAgain, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.itbDismiss, 3, 0);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 1;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(630, 49);
+ this.tableLayoutPanel2.TabIndex = 6;
+ //
+ // kbtnDismiss
+ //
+ this.kbtnDismiss.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnDismiss.AutoSize = true;
+ this.kbtnDismiss.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.kbtnDismiss.Location = new System.Drawing.Point(554, 13);
+ this.kbtnDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnDismiss.Name = "kbtnDismiss";
+ this.kbtnDismiss.Size = new System.Drawing.Size(23, 22);
+ this.kbtnDismiss.TabIndex = 2;
+ this.kbtnDismiss.Values.Text = "{0}";
+ this.kbtnDismiss.Visible = false;
+ //
+ // klblToastLocation
+ //
+ this.klblToastLocation.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.klblToastLocation.Location = new System.Drawing.Point(75, 23);
+ this.klblToastLocation.Margin = new System.Windows.Forms.Padding(10);
+ this.klblToastLocation.Name = "klblToastLocation";
+ this.klblToastLocation.Size = new System.Drawing.Size(6, 2);
+ this.klblToastLocation.TabIndex = 3;
+ this.klblToastLocation.Values.Text = "";
+ //
+ // kchkDoNotShowAgain
+ //
+ this.kchkDoNotShowAgain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kchkDoNotShowAgain.Location = new System.Drawing.Point(10, 10);
+ this.kchkDoNotShowAgain.Margin = new System.Windows.Forms.Padding(10);
+ this.kchkDoNotShowAgain.Name = "kchkDoNotShowAgain";
+ this.kchkDoNotShowAgain.Size = new System.Drawing.Size(45, 29);
+ this.kchkDoNotShowAgain.TabIndex = 4;
+ this.kchkDoNotShowAgain.Values.Text = "CB1";
+ this.kchkDoNotShowAgain.Visible = false;
+ //
+ // itbDismiss
+ //
+ this.itbDismiss.AutoSize = true;
+ this.itbDismiss.IsActionButton = false;
+ this.itbDismiss.IsDismissButton = true;
+ this.itbDismiss.Location = new System.Drawing.Point(597, 13);
+ this.itbDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.itbDismiss.Name = "itbDismiss";
+ this.itbDismiss.NotificationResult = Krypton.Toolkit.KryptonToastNotificationResult.None;
+ this.itbDismiss.Owner = null;
+ this.itbDismiss.ProcessPath = "";
+ this.itbDismiss.Size = new System.Drawing.Size(23, 22);
+ this.itbDismiss.TabIndex = 5;
+ this.itbDismiss.Values.Text = "{0}";
+ //
+ // VisualToastNotificationTextBoxUserInputWithProgressBarForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(630, 419);
+ this.Controls.Add(this.kpnlMain);
+ this.Controls.Add(this.kpnlButtons);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualToastNotificationTextBoxUserInputWithProgressBarForm";
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.Load += new System.EventHandler(this.VisualToastNotificationTextBoxUserInputWithProgressBarForm_Load);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit();
+ this.kpnlButtons.ResumeLayout(false);
+ this.kpnlButtons.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).EndInit();
+ this.kpnlMain.ResumeLayout(false);
+ this.tlpMain.ResumeLayout(false);
+ this.tlpContent.ResumeLayout(false);
+ this.tlpContent.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).EndInit();
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kpnlButtons;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private KryptonPanel kpnlMain;
+ private TableLayoutPanel tlpMain;
+ private TableLayoutPanel tlpContent;
+ private KryptonWrapLabel kwlNotificationTitle;
+ private KryptonWrapLabel kwlNotificationMessage;
+ private KryptonProgressBar kpbCountDown;
+ private PictureBox pbxNotificationIcon;
+ private KryptonTextBox ktxtUserInput;
+ private TableLayoutPanel tableLayoutPanel2;
+ private KryptonButton kbtnDismiss;
+ private KryptonLabel klblToastLocation;
+ private KryptonCheckBox kchkDoNotShowAgain;
+ private InternalToastButton itbDismiss;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationTextBoxUserInputWithProgressBarForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationTextBoxUserInputWithProgressBarForm.cs
new file mode 100644
index 000000000..471de0086
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationTextBoxUserInputWithProgressBarForm.cs
@@ -0,0 +1,314 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+using Timer = System.Windows.Forms.Timer;
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualToastNotificationTextBoxUserInputWithProgressBarForm : VisualToastNotificationBaseForm
+ {
+ #region Instance Fields
+
+ private int _time;
+
+ private Timer _timer;
+
+ private readonly KryptonUserInputToastNotificationData _data;
+
+ #endregion
+
+ #region Internal
+
+ internal string UserResponse => ktxtUserInput.Text;
+
+ #endregion
+
+ #region Identity
+
+ public VisualToastNotificationTextBoxUserInputWithProgressBarForm(KryptonUserInputToastNotificationData data)
+ {
+ InitializeComponent();
+
+ _data = data;
+
+ GotFocus += (sender, args) => ktxtUserInput.Focus();
+
+ Resize += VisualToastNotificationTextBoxUserInputWithProgressBarForm_Resize;
+
+ UpdateBorderColors();
+ }
+
+ #endregion
+
+ #region Implementation
+
+ private void UpdateBorderColors()
+ {
+ StateCommon!.Border.Color1 = _data.BorderColor1 ?? GlobalStaticValues.EMPTY_COLOR;
+
+ StateCommon!.Border.Color2 = _data.BorderColor2 ?? GlobalStaticValues.EMPTY_COLOR;
+ }
+
+ private void UpdateText()
+ {
+ kwlNotificationTitle.Text = _data.NotificationTitle ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+
+ kwlNotificationMessage.Text = _data.NotificationContent ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+
+ private void UpdateInitialValues()
+ {
+ // Set initial date and time values
+ ktxtUserInput.Text = GlobalStaticValues.DEFAULT_EMPTY_STRING;
+
+ ktxtUserInput.CueHint.CueHintText =
+ _data.ToastNotificationCueText ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+
+ ktxtUserInput.CueHint.Color1 = _data.ToastNotificationCueColor ?? Color.Gray;
+ }
+
+ private void SetIcon(Bitmap? image) => pbxNotificationIcon.Image = image;
+
+ private void UpdateLocation()
+ {
+ //Once loaded, position the form, or position it to the bottom left of the screen with added padding
+ Location = _data.NotificationLocation ?? new Point(Screen.PrimaryScreen!.WorkingArea.Width - Width - 5,
+ Screen.PrimaryScreen.WorkingArea.Height - Height - 5);
+ }
+
+ private void UpdateIcon()
+ {
+ switch (_data.NotificationIcon)
+ {
+ case KryptonToastNotificationIcon.None:
+ SetIcon(null);
+ break;
+ case KryptonToastNotificationIcon.Hand:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Hand_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemHand:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Hand.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Question:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Question_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemQuestion:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Question.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Exclamation:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.SystemExclamation:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Exclamation.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Asterisk:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Asterisk_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemAsterisk:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Stop:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Stop_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Error:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Critical_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Warning:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.Information:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Shield:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
+ }
+ else if (OSUtilities.IsWindowsTen)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_10_128_x_128);
+ }
+ else
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128);
+ }
+ break;
+ case KryptonToastNotificationIcon.WindowsLogo:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_11_128_128);
+ }
+ else if (OSUtilities.IsWindowsEight || OSUtilities.IsWindowsEightPointOne || OSUtilities.IsWindowsTen)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_8_81_10_128_128);
+ }
+ else
+ {
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.WinLogo.ToBitmap(), new Size(128, 128)));
+ }
+ break;
+ case KryptonToastNotificationIcon.Application:
+ SetIcon(GraphicsExtensions.ScaleImage(_data.ApplicationIcon.ToBitmap(), new Size(128, 128)));
+ break;
+ case KryptonToastNotificationIcon.SystemApplication:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Ok:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Ok_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Custom:
+ SetIcon(_data.CustomImage != null
+ ? new Bitmap(_data.CustomImage)
+ : null);
+ break;
+ case null:
+ SetIcon(null);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+
+ private void VisualToastNotificationTextBoxUserInputWithProgressBarForm_Resize(object? sender, EventArgs e)
+ {
+ if (WindowState == FormWindowState.Maximized)
+ {
+ WindowState = FormWindowState.Normal;
+ }
+ }
+
+ private void VisualToastNotificationTextBoxUserInputWithProgressBarForm_Load(object sender, EventArgs e)
+ {
+ UpdateIcon();
+
+ UpdateLocation();
+
+ ShowCloseButton();
+
+ kbtnDismiss.Text = KryptonManager.Strings.ToastNotificationStrings.Dismiss;
+
+ _timer.Start();
+ }
+
+ private void ShowCloseButton()
+ {
+ CloseBox = _data.ShowCloseBox ?? false;
+
+ FormBorderStyle = CloseBox ? FormBorderStyle.Fixed3D : FormBorderStyle.FixedSingle;
+
+ ControlBox = _data.ShowCloseBox ?? false;
+ }
+
+ public new DialogResult ShowDialog()
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ UpdateLocation();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kpbCountDown.Maximum = _data.CountDownSeconds ?? 100;
+
+ kpbCountDown.Value = kpbCountDown.Maximum;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kpbCountDown.Value -= 1;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ if (kpbCountDown.Value == kpbCountDown.Minimum)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog();
+ }
+
+ public new DialogResult ShowDialog(IWin32Window owner)
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kpbCountDown.Maximum = _data.CountDownSeconds ?? 100;
+
+ kpbCountDown.Value = kpbCountDown.Maximum;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kpbCountDown.Value -= 1;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ if (kpbCountDown.Value == kpbCountDown.Minimum)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog(owner);
+ }
+
+ internal static string ShowNotification(KryptonUserInputToastNotificationData data)
+ {
+ var owner = data.ToastHost ?? FromHandle(PI.GetActiveWindow());
+
+ using var toast = new VisualToastNotificationTextBoxUserInputWithProgressBarForm(data);
+
+ if (owner != null)
+ {
+ toast.StartPosition = owner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
+
+ return toast.ShowDialog(owner!) == DialogResult.OK ? toast.UserResponse : GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+ else
+ {
+ return toast.ShowDialog() == DialogResult.OK ? toast.UserResponse : GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationTextBoxUserInputWithProgressBarForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationTextBoxUserInputWithProgressBarForm.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/LTR/ProgressBar/VisualToastNotificationTextBoxUserInputWithProgressBarForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationComboBoxUserInputRtlAwareForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationComboBoxUserInputRtlAwareForm.Designer.cs
new file mode 100644
index 000000000..7b5fb8ca6
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationComboBoxUserInputRtlAwareForm.Designer.cs
@@ -0,0 +1,336 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualToastNotificationComboBoxUserInputRtlAwareForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.kpnlButtons = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnDismiss = new Krypton.Toolkit.KryptonButton();
+ this.klblToastLocation = new Krypton.Toolkit.KryptonLabel();
+ this.kchkDoNotShowAgain = new Krypton.Toolkit.KryptonCheckBox();
+ this.itbDismiss = new Krypton.Toolkit.InternalToastButton();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kpnlMain = new Krypton.Toolkit.KryptonPanel();
+ this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
+ this.pbxNotificationIcon = new System.Windows.Forms.PictureBox();
+ this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
+ this.kwlNotificationTitle = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kwlNotificationMessage = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kcmbUserInput = new Krypton.Toolkit.KryptonComboBox();
+ this.tlpMain = new System.Windows.Forms.TableLayoutPanel();
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit();
+ this.kpnlButtons.SuspendLayout();
+ this.tableLayoutPanel2.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).BeginInit();
+ this.kpnlMain.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
+ this.kryptonPanel1.SuspendLayout();
+ this.tableLayoutPanel3.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).BeginInit();
+ this.tableLayoutPanel4.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kcmbUserInput)).BeginInit();
+ this.tlpMain.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // kpnlButtons
+ //
+ this.kpnlButtons.Controls.Add(this.tableLayoutPanel2);
+ this.kpnlButtons.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlButtons.Location = new System.Drawing.Point(0, 327);
+ this.kpnlButtons.Name = "kpnlButtons";
+ this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlButtons.Size = new System.Drawing.Size(614, 50);
+ this.kpnlButtons.TabIndex = 4;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel2.ColumnCount = 4;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.Controls.Add(this.kbtnDismiss, 2, 0);
+ this.tableLayoutPanel2.Controls.Add(this.klblToastLocation, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.kchkDoNotShowAgain, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.itbDismiss, 3, 0);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 1;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(614, 49);
+ this.tableLayoutPanel2.TabIndex = 5;
+ //
+ // kbtnDismiss
+ //
+ this.kbtnDismiss.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnDismiss.AutoSize = true;
+ this.kbtnDismiss.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.kbtnDismiss.Location = new System.Drawing.Point(78, 13);
+ this.kbtnDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnDismiss.Name = "kbtnDismiss";
+ this.kbtnDismiss.Size = new System.Drawing.Size(48, 22);
+ this.kbtnDismiss.TabIndex = 2;
+ this.kbtnDismiss.Values.Text = "{0} ({1})";
+ this.kbtnDismiss.Visible = false;
+ //
+ // klblToastLocation
+ //
+ this.klblToastLocation.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.klblToastLocation.Location = new System.Drawing.Point(533, 23);
+ this.klblToastLocation.Margin = new System.Windows.Forms.Padding(10);
+ this.klblToastLocation.Name = "klblToastLocation";
+ this.klblToastLocation.Size = new System.Drawing.Size(6, 2);
+ this.klblToastLocation.TabIndex = 3;
+ this.klblToastLocation.Values.Text = "";
+ //
+ // kchkDoNotShowAgain
+ //
+ this.kchkDoNotShowAgain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kchkDoNotShowAgain.Location = new System.Drawing.Point(559, 10);
+ this.kchkDoNotShowAgain.Margin = new System.Windows.Forms.Padding(10);
+ this.kchkDoNotShowAgain.Name = "kchkDoNotShowAgain";
+ this.kchkDoNotShowAgain.Size = new System.Drawing.Size(45, 29);
+ this.kchkDoNotShowAgain.TabIndex = 4;
+ this.kchkDoNotShowAgain.Values.Text = "CB1";
+ this.kchkDoNotShowAgain.Visible = false;
+ //
+ // itbDismiss
+ //
+ this.itbDismiss.AutoSize = true;
+ this.itbDismiss.IsActionButton = false;
+ this.itbDismiss.IsDismissButton = true;
+ this.itbDismiss.Location = new System.Drawing.Point(10, 13);
+ this.itbDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.itbDismiss.Name = "itbDismiss";
+ this.itbDismiss.NotificationResult = Krypton.Toolkit.KryptonToastNotificationResult.None;
+ this.itbDismiss.Owner = null;
+ this.itbDismiss.ProcessPath = "";
+ this.itbDismiss.Size = new System.Drawing.Size(48, 22);
+ this.itbDismiss.TabIndex = 5;
+ this.itbDismiss.Values.Text = "{0} ({1})";
+ this.itbDismiss.Click += new System.EventHandler(this.itbDismiss_Click);
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(614, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kpnlMain
+ //
+ this.kpnlMain.Controls.Add(this.kryptonPanel1);
+ this.kpnlMain.Controls.Add(this.tlpMain);
+ this.kpnlMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlMain.Location = new System.Drawing.Point(0, 0);
+ this.kpnlMain.Name = "kpnlMain";
+ this.kpnlMain.Size = new System.Drawing.Size(614, 327);
+ this.kpnlMain.TabIndex = 5;
+ //
+ // kryptonPanel1
+ //
+ this.kryptonPanel1.Controls.Add(this.tableLayoutPanel3);
+ this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonPanel1.Name = "kryptonPanel1";
+ this.kryptonPanel1.Size = new System.Drawing.Size(614, 327);
+ this.kryptonPanel1.TabIndex = 4;
+ //
+ // tableLayoutPanel3
+ //
+ this.tableLayoutPanel3.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel3.ColumnCount = 2;
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel3.Controls.Add(this.pbxNotificationIcon, 0, 0);
+ this.tableLayoutPanel3.Controls.Add(this.tableLayoutPanel4, 1, 0);
+ this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel3.Location = new System.Drawing.Point(0, 0);
+ this.tableLayoutPanel3.Name = "tableLayoutPanel3";
+ this.tableLayoutPanel3.RowCount = 1;
+ this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel3.Size = new System.Drawing.Size(614, 327);
+ this.tableLayoutPanel3.TabIndex = 0;
+ //
+ // pbxNotificationIcon
+ //
+ this.pbxNotificationIcon.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pbxNotificationIcon.Location = new System.Drawing.Point(481, 5);
+ this.pbxNotificationIcon.Margin = new System.Windows.Forms.Padding(5);
+ this.pbxNotificationIcon.Name = "pbxNotificationIcon";
+ this.pbxNotificationIcon.Size = new System.Drawing.Size(128, 317);
+ this.pbxNotificationIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pbxNotificationIcon.TabIndex = 0;
+ this.pbxNotificationIcon.TabStop = false;
+ //
+ // tableLayoutPanel4
+ //
+ this.tableLayoutPanel4.ColumnCount = 1;
+ this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel4.Controls.Add(this.kwlNotificationTitle, 0, 0);
+ this.tableLayoutPanel4.Controls.Add(this.kwlNotificationMessage, 0, 1);
+ this.tableLayoutPanel4.Controls.Add(this.kcmbUserInput, 0, 2);
+ this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel4.Location = new System.Drawing.Point(3, 3);
+ this.tableLayoutPanel4.Name = "tableLayoutPanel4";
+ this.tableLayoutPanel4.RowCount = 3;
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel4.Size = new System.Drawing.Size(470, 321);
+ this.tableLayoutPanel4.TabIndex = 1;
+ //
+ // kwlNotificationTitle
+ //
+ this.kwlNotificationTitle.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationTitle.Font = new System.Drawing.Font("Segoe UI", 13.5F, System.Drawing.FontStyle.Bold);
+ this.kwlNotificationTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationTitle.LabelStyle = Krypton.Toolkit.LabelStyle.TitleControl;
+ this.kwlNotificationTitle.Location = new System.Drawing.Point(3, 0);
+ this.kwlNotificationTitle.Name = "kwlNotificationTitle";
+ this.kwlNotificationTitle.Size = new System.Drawing.Size(464, 25);
+ this.kwlNotificationTitle.Text = "kryptonWrapLabel1";
+ this.kwlNotificationTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // kwlNotificationMessage
+ //
+ this.kwlNotificationMessage.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationMessage.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.kwlNotificationMessage.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationMessage.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.kwlNotificationMessage.Location = new System.Drawing.Point(3, 25);
+ this.kwlNotificationMessage.Name = "kwlNotificationMessage";
+ this.kwlNotificationMessage.Size = new System.Drawing.Size(464, 269);
+ this.kwlNotificationMessage.Text = "kryptonWrapLabel2";
+ this.kwlNotificationMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // kcmbUserInput
+ //
+ this.kcmbUserInput.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kcmbUserInput.DropDownWidth = 464;
+ this.kcmbUserInput.IntegralHeight = false;
+ this.kcmbUserInput.Location = new System.Drawing.Point(3, 297);
+ this.kcmbUserInput.Name = "kcmbUserInput";
+ this.kcmbUserInput.Size = new System.Drawing.Size(464, 21);
+ this.kcmbUserInput.StateCommon.ComboBox.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near;
+ this.kcmbUserInput.TabIndex = 3;
+ //
+ // tlpMain
+ //
+ this.tlpMain.BackColor = System.Drawing.Color.Transparent;
+ this.tlpMain.ColumnCount = 2;
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Controls.Add(this.tableLayoutPanel1, 1, 0);
+ this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpMain.Location = new System.Drawing.Point(0, 0);
+ this.tlpMain.Name = "tlpMain";
+ this.tlpMain.RowCount = 1;
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Size = new System.Drawing.Size(614, 327);
+ this.tlpMain.TabIndex = 0;
+ //
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.ColumnCount = 1;
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 3);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 3;
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(608, 321);
+ this.tableLayoutPanel1.TabIndex = 1;
+ //
+ // VisualToastNotificationComboBoxUserInputRtlAwareForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(614, 377);
+ this.Controls.Add(this.kpnlMain);
+ this.Controls.Add(this.kpnlButtons);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualToastNotificationComboBoxUserInputRtlAwareForm";
+ this.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.Load += new System.EventHandler(this.VisualToastNotificationComboBoxUserInputRtlAwareForm_Load);
+ this.LocationChanged += new System.EventHandler(this.VisualToastNotificationComboBoxUserInputRtlAwareForm_LocationChanged);
+ this.Resize += new System.EventHandler(this.VisualToastNotificationComboBoxUserInputRtlAwareForm_Resize);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit();
+ this.kpnlButtons.ResumeLayout(false);
+ this.kpnlButtons.PerformLayout();
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).EndInit();
+ this.kpnlMain.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
+ this.kryptonPanel1.ResumeLayout(false);
+ this.tableLayoutPanel3.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).EndInit();
+ this.tableLayoutPanel4.ResumeLayout(false);
+ this.tableLayoutPanel4.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kcmbUserInput)).EndInit();
+ this.tlpMain.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kpnlButtons;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private KryptonPanel kpnlMain;
+ private KryptonPanel kryptonPanel1;
+ private TableLayoutPanel tableLayoutPanel3;
+ private PictureBox pbxNotificationIcon;
+ private TableLayoutPanel tableLayoutPanel4;
+ private KryptonWrapLabel kwlNotificationTitle;
+ private KryptonWrapLabel kwlNotificationMessage;
+ private KryptonComboBox kcmbUserInput;
+ private TableLayoutPanel tlpMain;
+ private TableLayoutPanel tableLayoutPanel1;
+ private TableLayoutPanel tableLayoutPanel2;
+ private KryptonButton kbtnDismiss;
+ private KryptonLabel klblToastLocation;
+ private KryptonCheckBox kchkDoNotShowAgain;
+ private InternalToastButton itbDismiss;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationComboBoxUserInputRtlAwareForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationComboBoxUserInputRtlAwareForm.cs
new file mode 100644
index 000000000..923774c8f
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationComboBoxUserInputRtlAwareForm.cs
@@ -0,0 +1,335 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+using Timer = System.Windows.Forms.Timer;
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualToastNotificationComboBoxUserInputRtlAwareForm : VisualToastNotificationBaseForm
+ {
+ #region Instance Fields
+
+ private int _time;
+
+ private Timer _timer;
+
+ private readonly KryptonUserInputToastNotificationData _data;
+
+ #endregion
+
+ #region Internal
+
+ internal string UserResponse => kcmbUserInput.Text ?? string.Empty;
+
+ #endregion
+
+ #region Identity
+
+ public VisualToastNotificationComboBoxUserInputRtlAwareForm(KryptonUserInputToastNotificationData data)
+ {
+ InitializeComponent();
+
+ _data = data;
+
+ GotFocus += (sender, args) => kcmbUserInput.Focus();
+
+ UpdateBorderColors();
+ }
+
+ #endregion
+
+ #region Implementation
+
+ private void UpdateBorderColors()
+ {
+ StateCommon!.Border.Color1 = _data.BorderColor1 ?? GlobalStaticValues.EMPTY_COLOR;
+
+ StateCommon!.Border.Color2 = _data.BorderColor2 ?? GlobalStaticValues.EMPTY_COLOR;
+ }
+
+ private void UpdateText()
+ {
+ kwlNotificationTitle.Text = _data.NotificationTitle ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+
+ kwlNotificationMessage.Text = _data.NotificationContent ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+
+ private void UpdateComboBoxItems()
+ {
+ if (_data.UserInputList.Count > 0)
+ {
+ foreach (var item in _data.UserInputList)
+ {
+ kcmbUserInput.Items.Add(item);
+ }
+
+ kcmbUserInput.SelectedIndex = _data.SelectedIndex ?? 1;
+ }
+
+ kcmbUserInput.DropDownStyle = _data.UserInputComboBoxStyle ?? ComboBoxStyle.DropDown;
+ }
+
+ private void SetIcon(Bitmap? image) => pbxNotificationIcon.Image = image;
+
+ private void UpdateLocation()
+ {
+ //Once loaded, position the form, or position it to the bottom left of the screen with added padding
+ Location = _data.NotificationLocation ?? new Point(Screen.PrimaryScreen!.WorkingArea.Width - Width - 5,
+ Screen.PrimaryScreen.WorkingArea.Height - Height - 5);
+ }
+
+ private void UpdateIcon()
+ {
+ switch (_data.NotificationIcon)
+ {
+ case KryptonToastNotificationIcon.None:
+ SetIcon(null);
+ break;
+ case KryptonToastNotificationIcon.Hand:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Hand_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemHand:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Hand.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Question:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Question_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemQuestion:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Question.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Exclamation:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.SystemExclamation:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Exclamation.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Asterisk:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Asterisk_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemAsterisk:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Stop:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Stop_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Error:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Critical_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Warning:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.Information:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Shield:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
+ }
+ else if (OSUtilities.IsWindowsTen)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_10_128_x_128);
+ }
+ else
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128);
+ }
+ break;
+ case KryptonToastNotificationIcon.WindowsLogo:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_11_128_128);
+ }
+ else if (OSUtilities.IsWindowsEight || OSUtilities.IsWindowsEightPointOne || OSUtilities.IsWindowsTen)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_8_81_10_128_128);
+ }
+ else
+ {
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.WinLogo.ToBitmap(), new Size(128, 128)));
+ }
+ break;
+ case KryptonToastNotificationIcon.Application:
+ SetIcon(GraphicsExtensions.ScaleImage(_data.ApplicationIcon.ToBitmap(), new Size(128, 128)));
+ break;
+ case KryptonToastNotificationIcon.SystemApplication:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Ok:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Ok_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Custom:
+ SetIcon(_data.CustomImage != null
+ ? new Bitmap(_data.CustomImage)
+ : null);
+ break;
+ case null:
+ SetIcon(null);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+
+ private void ShowCloseButton()
+ {
+ CloseBox = _data.ShowCloseBox ?? false;
+
+ FormBorderStyle = CloseBox ? FormBorderStyle.Fixed3D : FormBorderStyle.FixedSingle;
+
+ ControlBox = _data.ShowCloseBox ?? false;
+ }
+
+ private void itbDismiss_Click(object sender, EventArgs e) => Close();
+
+ private void VisualToastNotificationComboBoxUserInputRtlAwareForm_Load(object sender, EventArgs e)
+ {
+ UpdateIcon();
+
+ UpdateLocation();
+
+ ShowCloseButton();
+
+ _timer.Start();
+ }
+
+ private void VisualToastNotificationComboBoxUserInputRtlAwareForm_LocationChanged(object sender, EventArgs e)
+ {
+ if (_data.ReportToastLocation)
+ {
+ ReportToastLocation();
+ }
+ }
+
+ private void VisualToastNotificationComboBoxUserInputRtlAwareForm_Resize(object sender, EventArgs e)
+ {
+ if (WindowState == FormWindowState.Maximized)
+ {
+ WindowState = FormWindowState.Normal;
+ }
+ }
+
+ private void ReportToastLocation() => klblToastLocation.Text =
+ _data.ReportToastLocation ? $"Location: X: {Location.X}, Y: {Location.Y}" : string.Empty;
+
+ public new DialogResult ShowDialog()
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateComboBoxItems();
+
+ UpdateLocation();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ if (_time == _data.CountDownSeconds)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog();
+ }
+
+ public new DialogResult ShowDialog(IWin32Window owner)
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateComboBoxItems();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ if (_time == _data.CountDownSeconds)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog(owner);
+ }
+
+ public new KryptonToastNotificationResult ShowToastNotificationResult()
+ {
+
+ return base.ShowToastNotificationResult();
+ }
+
+ public new KryptonToastNotificationResult ShowToastNotificationResult(IWin32Window owner)
+ {
+
+ return base.ShowToastNotificationResult(owner);
+ }
+
+ internal static string ShowNotification(KryptonUserInputToastNotificationData data)
+ {
+ var owner = data.ToastHost ?? FromHandle(PI.GetActiveWindow());
+
+ using var toast = new VisualToastNotificationComboBoxUserInputRtlAwareForm(data);
+
+ if (owner != null)
+ {
+ toast.StartPosition = owner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
+
+ return toast.ShowDialog(owner!) == DialogResult.OK ? toast.UserResponse : string.Empty;
+ }
+ else
+ {
+ return toast.ShowDialog() == DialogResult.OK ? toast.UserResponse : string.Empty;
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationComboBoxUserInputRtlAwareForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationComboBoxUserInputRtlAwareForm.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationComboBoxUserInputRtlAwareForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationDateTimeUserInputRtlAwareForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationDateTimeUserInputRtlAwareForm.Designer.cs
new file mode 100644
index 000000000..9e8784cf4
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationDateTimeUserInputRtlAwareForm.Designer.cs
@@ -0,0 +1,330 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualToastNotificationDateTimeUserInputRtlAwareForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.kpnlButtons = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnDismiss = new Krypton.Toolkit.KryptonButton();
+ this.klblToastLocation = new Krypton.Toolkit.KryptonLabel();
+ this.kchkDoNotShowAgain = new Krypton.Toolkit.KryptonCheckBox();
+ this.itbDismiss = new Krypton.Toolkit.InternalToastButton();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kpnlMain = new Krypton.Toolkit.KryptonPanel();
+ this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
+ this.pbxNotificationIcon = new System.Windows.Forms.PictureBox();
+ this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
+ this.kwlNotificationTitle = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kwlNotificationMessage = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kdtpUserInput = new Krypton.Toolkit.KryptonDateTimePicker();
+ this.tlpMain = new System.Windows.Forms.TableLayoutPanel();
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit();
+ this.kpnlButtons.SuspendLayout();
+ this.tableLayoutPanel2.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).BeginInit();
+ this.kpnlMain.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
+ this.kryptonPanel1.SuspendLayout();
+ this.tableLayoutPanel3.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).BeginInit();
+ this.tableLayoutPanel4.SuspendLayout();
+ this.tlpMain.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // kpnlButtons
+ //
+ this.kpnlButtons.Controls.Add(this.tableLayoutPanel2);
+ this.kpnlButtons.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlButtons.Location = new System.Drawing.Point(0, 327);
+ this.kpnlButtons.Name = "kpnlButtons";
+ this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlButtons.Size = new System.Drawing.Size(614, 50);
+ this.kpnlButtons.TabIndex = 5;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel2.ColumnCount = 4;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.Controls.Add(this.kbtnDismiss, 2, 0);
+ this.tableLayoutPanel2.Controls.Add(this.klblToastLocation, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.kchkDoNotShowAgain, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.itbDismiss, 3, 0);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 1;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(614, 49);
+ this.tableLayoutPanel2.TabIndex = 5;
+ //
+ // kbtnDismiss
+ //
+ this.kbtnDismiss.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnDismiss.AutoSize = true;
+ this.kbtnDismiss.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.kbtnDismiss.Location = new System.Drawing.Point(78, 13);
+ this.kbtnDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnDismiss.Name = "kbtnDismiss";
+ this.kbtnDismiss.Size = new System.Drawing.Size(48, 22);
+ this.kbtnDismiss.TabIndex = 2;
+ this.kbtnDismiss.Values.Text = "{0} ({1})";
+ this.kbtnDismiss.Visible = false;
+ //
+ // klblToastLocation
+ //
+ this.klblToastLocation.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.klblToastLocation.Location = new System.Drawing.Point(533, 23);
+ this.klblToastLocation.Margin = new System.Windows.Forms.Padding(10);
+ this.klblToastLocation.Name = "klblToastLocation";
+ this.klblToastLocation.Size = new System.Drawing.Size(6, 2);
+ this.klblToastLocation.TabIndex = 3;
+ this.klblToastLocation.Values.Text = "";
+ //
+ // kchkDoNotShowAgain
+ //
+ this.kchkDoNotShowAgain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kchkDoNotShowAgain.Location = new System.Drawing.Point(559, 10);
+ this.kchkDoNotShowAgain.Margin = new System.Windows.Forms.Padding(10);
+ this.kchkDoNotShowAgain.Name = "kchkDoNotShowAgain";
+ this.kchkDoNotShowAgain.Size = new System.Drawing.Size(45, 29);
+ this.kchkDoNotShowAgain.TabIndex = 4;
+ this.kchkDoNotShowAgain.Values.Text = "CB1";
+ this.kchkDoNotShowAgain.Visible = false;
+ //
+ // itbDismiss
+ //
+ this.itbDismiss.AutoSize = true;
+ this.itbDismiss.IsActionButton = false;
+ this.itbDismiss.IsDismissButton = true;
+ this.itbDismiss.Location = new System.Drawing.Point(10, 13);
+ this.itbDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.itbDismiss.Name = "itbDismiss";
+ this.itbDismiss.NotificationResult = Krypton.Toolkit.KryptonToastNotificationResult.None;
+ this.itbDismiss.Owner = null;
+ this.itbDismiss.ProcessPath = "";
+ this.itbDismiss.Size = new System.Drawing.Size(48, 22);
+ this.itbDismiss.TabIndex = 5;
+ this.itbDismiss.Values.Text = "{0} ({1})";
+ this.itbDismiss.Click += new System.EventHandler(this.itbDismiss_Click);
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(614, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kpnlMain
+ //
+ this.kpnlMain.Controls.Add(this.kryptonPanel1);
+ this.kpnlMain.Controls.Add(this.tlpMain);
+ this.kpnlMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlMain.Location = new System.Drawing.Point(0, 0);
+ this.kpnlMain.Name = "kpnlMain";
+ this.kpnlMain.Size = new System.Drawing.Size(614, 327);
+ this.kpnlMain.TabIndex = 6;
+ //
+ // kryptonPanel1
+ //
+ this.kryptonPanel1.Controls.Add(this.tableLayoutPanel3);
+ this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonPanel1.Name = "kryptonPanel1";
+ this.kryptonPanel1.Size = new System.Drawing.Size(614, 327);
+ this.kryptonPanel1.TabIndex = 4;
+ //
+ // tableLayoutPanel3
+ //
+ this.tableLayoutPanel3.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel3.ColumnCount = 2;
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel3.Controls.Add(this.pbxNotificationIcon, 0, 0);
+ this.tableLayoutPanel3.Controls.Add(this.tableLayoutPanel4, 1, 0);
+ this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel3.Location = new System.Drawing.Point(0, 0);
+ this.tableLayoutPanel3.Name = "tableLayoutPanel3";
+ this.tableLayoutPanel3.RowCount = 1;
+ this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel3.Size = new System.Drawing.Size(614, 327);
+ this.tableLayoutPanel3.TabIndex = 0;
+ //
+ // pbxNotificationIcon
+ //
+ this.pbxNotificationIcon.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pbxNotificationIcon.Location = new System.Drawing.Point(481, 5);
+ this.pbxNotificationIcon.Margin = new System.Windows.Forms.Padding(5);
+ this.pbxNotificationIcon.Name = "pbxNotificationIcon";
+ this.pbxNotificationIcon.Size = new System.Drawing.Size(128, 317);
+ this.pbxNotificationIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pbxNotificationIcon.TabIndex = 0;
+ this.pbxNotificationIcon.TabStop = false;
+ //
+ // tableLayoutPanel4
+ //
+ this.tableLayoutPanel4.ColumnCount = 1;
+ this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel4.Controls.Add(this.kwlNotificationTitle, 0, 0);
+ this.tableLayoutPanel4.Controls.Add(this.kwlNotificationMessage, 0, 1);
+ this.tableLayoutPanel4.Controls.Add(this.kdtpUserInput, 0, 2);
+ this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel4.Location = new System.Drawing.Point(3, 3);
+ this.tableLayoutPanel4.Name = "tableLayoutPanel4";
+ this.tableLayoutPanel4.RowCount = 3;
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel4.Size = new System.Drawing.Size(470, 321);
+ this.tableLayoutPanel4.TabIndex = 1;
+ //
+ // kwlNotificationTitle
+ //
+ this.kwlNotificationTitle.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationTitle.Font = new System.Drawing.Font("Segoe UI", 13.5F, System.Drawing.FontStyle.Bold);
+ this.kwlNotificationTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationTitle.LabelStyle = Krypton.Toolkit.LabelStyle.TitleControl;
+ this.kwlNotificationTitle.Location = new System.Drawing.Point(3, 0);
+ this.kwlNotificationTitle.Name = "kwlNotificationTitle";
+ this.kwlNotificationTitle.Size = new System.Drawing.Size(464, 25);
+ this.kwlNotificationTitle.Text = "kryptonWrapLabel1";
+ this.kwlNotificationTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // kwlNotificationMessage
+ //
+ this.kwlNotificationMessage.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationMessage.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.kwlNotificationMessage.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationMessage.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.kwlNotificationMessage.Location = new System.Drawing.Point(3, 25);
+ this.kwlNotificationMessage.Name = "kwlNotificationMessage";
+ this.kwlNotificationMessage.Size = new System.Drawing.Size(464, 269);
+ this.kwlNotificationMessage.Text = "kryptonWrapLabel2";
+ this.kwlNotificationMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // kdtpUserInput
+ //
+ this.kdtpUserInput.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kdtpUserInput.Location = new System.Drawing.Point(3, 297);
+ this.kdtpUserInput.Name = "kdtpUserInput";
+ this.kdtpUserInput.Size = new System.Drawing.Size(464, 21);
+ this.kdtpUserInput.TabIndex = 2;
+ //
+ // tlpMain
+ //
+ this.tlpMain.BackColor = System.Drawing.Color.Transparent;
+ this.tlpMain.ColumnCount = 2;
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Controls.Add(this.tableLayoutPanel1, 1, 0);
+ this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpMain.Location = new System.Drawing.Point(0, 0);
+ this.tlpMain.Name = "tlpMain";
+ this.tlpMain.RowCount = 1;
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Size = new System.Drawing.Size(614, 327);
+ this.tlpMain.TabIndex = 0;
+ //
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.ColumnCount = 1;
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 3);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 3;
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(608, 321);
+ this.tableLayoutPanel1.TabIndex = 1;
+ //
+ // VisualToastNotificationDateTimeUserInputRtlAwareForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(614, 377);
+ this.Controls.Add(this.kpnlMain);
+ this.Controls.Add(this.kpnlButtons);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualToastNotificationDateTimeUserInputRtlAwareForm";
+ this.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.Load += new System.EventHandler(this.VisualToastNotificationDateTimeUserInputRtlAwareForm_Load);
+ this.LocationChanged += new System.EventHandler(this.VisualToastNotificationDateTimeUserInputRtlAwareForm_LocationChanged);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit();
+ this.kpnlButtons.ResumeLayout(false);
+ this.kpnlButtons.PerformLayout();
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).EndInit();
+ this.kpnlMain.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
+ this.kryptonPanel1.ResumeLayout(false);
+ this.tableLayoutPanel3.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).EndInit();
+ this.tableLayoutPanel4.ResumeLayout(false);
+ this.tableLayoutPanel4.PerformLayout();
+ this.tlpMain.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kpnlButtons;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private KryptonPanel kpnlMain;
+ private KryptonPanel kryptonPanel1;
+ private TableLayoutPanel tableLayoutPanel3;
+ private PictureBox pbxNotificationIcon;
+ private TableLayoutPanel tableLayoutPanel4;
+ private KryptonWrapLabel kwlNotificationTitle;
+ private KryptonWrapLabel kwlNotificationMessage;
+ private KryptonDateTimePicker kdtpUserInput;
+ private TableLayoutPanel tlpMain;
+ private TableLayoutPanel tableLayoutPanel1;
+ private TableLayoutPanel tableLayoutPanel2;
+ private KryptonButton kbtnDismiss;
+ private KryptonLabel klblToastLocation;
+ private KryptonCheckBox kchkDoNotShowAgain;
+ private InternalToastButton itbDismiss;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationDateTimeUserInputRtlAwareForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationDateTimeUserInputRtlAwareForm.cs
new file mode 100644
index 000000000..022730803
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationDateTimeUserInputRtlAwareForm.cs
@@ -0,0 +1,319 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+using Timer = System.Windows.Forms.Timer;
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualToastNotificationDateTimeUserInputRtlAwareForm : VisualToastNotificationBaseForm
+ {
+ #region Instance Fields
+
+ private int _time;
+
+ private Timer _timer;
+
+ private readonly KryptonUserInputToastNotificationData _data;
+
+ #endregion
+
+ #region Internal
+
+ internal DateTime UserResponse => kdtpUserInput.Value;
+
+ #endregion
+
+ public VisualToastNotificationDateTimeUserInputRtlAwareForm(KryptonUserInputToastNotificationData data)
+ {
+ InitializeComponent();
+
+ _data = data;
+
+ GotFocus += (sender, args) => kdtpUserInput.Focus();
+
+ Resize += VisualToastNotificationDateTimeUserInputRtlAwareForm_Resize;
+
+ UpdateBorderColors();
+ }
+
+ #region Implementation
+
+ private void UpdateBorderColors()
+ {
+ StateCommon!.Border.Color1 = _data.BorderColor1 ?? GlobalStaticValues.EMPTY_COLOR;
+
+ StateCommon!.Border.Color2 = _data.BorderColor2 ?? GlobalStaticValues.EMPTY_COLOR;
+ }
+
+ private void UpdateText()
+ {
+ kwlNotificationTitle.Text = _data.NotificationTitle;
+
+ kwlNotificationMessage.Text = _data.NotificationContent;
+ }
+
+ private void UpdateInitialValues()
+ {
+ // Set initial date and time values
+ kdtpUserInput.Value = _data.InitialDateTimeValue ?? GlobalStaticValues.DEFAULT_DATE_TIME_VALUE;
+
+ kdtpUserInput.Format = _data.DateTimeFormat ?? DateTimePickerFormat.Long;
+
+ kdtpUserInput.CustomFormat = _data.CustomDateTimeFormat ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+
+ kdtpUserInput.MaxDate = _data.MaximumDateTimeValue ?? DateTime.MaxValue;
+
+ kdtpUserInput.MinDate = _data.MinimumDateTimeValue ?? DateTime.MinValue;
+ }
+
+ private void SetIcon(Bitmap? image) => pbxNotificationIcon.Image = image;
+
+ private void UpdateLocation()
+ {
+ //Once loaded, position the form, or position it to the bottom left of the screen with added padding
+ Location = _data.NotificationLocation ?? new Point(Screen.PrimaryScreen!.WorkingArea.Width - Width - 5,
+ Screen.PrimaryScreen.WorkingArea.Height - Height - 5);
+ }
+
+ private void UpdateIcon()
+ {
+ switch (_data.NotificationIcon)
+ {
+ case KryptonToastNotificationIcon.None:
+ SetIcon(null);
+ break;
+ case KryptonToastNotificationIcon.Hand:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Hand_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemHand:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Hand.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Question:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Question_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemQuestion:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Question.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Exclamation:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.SystemExclamation:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Exclamation.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Asterisk:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Asterisk_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemAsterisk:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Stop:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Stop_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Error:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Critical_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Warning:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.Information:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Shield:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
+ }
+ else if (OSUtilities.IsWindowsTen)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_10_128_x_128);
+ }
+ else
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128);
+ }
+ break;
+ case KryptonToastNotificationIcon.WindowsLogo:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_11_128_128);
+ }
+ else if (OSUtilities.IsWindowsEight || OSUtilities.IsWindowsEightPointOne || OSUtilities.IsWindowsTen)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_8_81_10_128_128);
+ }
+ else
+ {
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.WinLogo.ToBitmap(), new Size(128, 128)));
+ }
+ break;
+ case KryptonToastNotificationIcon.Application:
+ SetIcon(GraphicsExtensions.ScaleImage(_data.ApplicationIcon.ToBitmap(), new Size(128, 128)));
+ break;
+ case KryptonToastNotificationIcon.SystemApplication:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Ok:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Ok_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Custom:
+ SetIcon(_data.CustomImage != null
+ ? new Bitmap(_data.CustomImage)
+ : null);
+ break;
+ case null:
+ SetIcon(null);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+
+ private void itbDismiss_Click(object sender, EventArgs e) => Close();
+
+ private void VisualToastNotificationDateTimeUserInputRtlAwareForm_Load(object sender, EventArgs e)
+ {
+ UpdateIcon();
+
+ UpdateLocation();
+
+ ShowCloseButton();
+
+ _timer.Start();
+ }
+
+ private void ShowCloseButton()
+ {
+ CloseBox = _data.ShowCloseBox ?? false;
+
+ FormBorderStyle = CloseBox ? FormBorderStyle.Fixed3D : FormBorderStyle.FixedSingle;
+
+ ControlBox = _data.ShowCloseBox ?? false;
+ }
+
+ private void ReportToastLocation() { }
+
+ private void VisualToastNotificationDateTimeUserInputRtlAwareForm_LocationChanged(object sender, EventArgs e)
+ {
+ if (_data.ReportToastLocation)
+ {
+ ReportToastLocation();
+ }
+ }
+
+ private void VisualToastNotificationDateTimeUserInputRtlAwareForm_Resize(object? sender, EventArgs e)
+ {
+ if (WindowState == FormWindowState.Maximized)
+ {
+ WindowState = FormWindowState.Normal;
+ }
+ }
+
+ public new DialogResult ShowDialog()
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ UpdateLocation();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ if (_time == _data.CountDownSeconds)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog();
+ }
+
+ public new DialogResult ShowDialog(IWin32Window owner)
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ if (_time == _data.CountDownSeconds)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog(owner);
+ }
+
+ internal static DateTime ShowNotification(KryptonUserInputToastNotificationData data)
+ {
+ var owner = data.ToastHost ?? FromHandle(PI.GetActiveWindow());
+
+ using var toast = new VisualToastNotificationDateTimeUserInputRtlAwareForm(data);
+
+ if (owner != null)
+ {
+ toast.StartPosition = owner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
+
+ return toast.ShowDialog(owner!) == DialogResult.OK ? toast.UserResponse : GlobalStaticValues.DEFAULT_DATE_TIME_VALUE;
+ }
+ else
+ {
+ return toast.ShowDialog() == DialogResult.OK ? toast.UserResponse : GlobalStaticValues.DEFAULT_DATE_TIME_VALUE;
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationDateTimeUserInputRtlAwareForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationDateTimeUserInputRtlAwareForm.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationDateTimeUserInputRtlAwareForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationDomainUpDownUserInputRtlAwareForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationDomainUpDownUserInputRtlAwareForm.Designer.cs
new file mode 100644
index 000000000..30b392d61
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationDomainUpDownUserInputRtlAwareForm.Designer.cs
@@ -0,0 +1,330 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualToastNotificationDomainUpDownUserInputRtlAwareForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.kpnlButtons = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnDismiss = new Krypton.Toolkit.KryptonButton();
+ this.klblToastLocation = new Krypton.Toolkit.KryptonLabel();
+ this.kchkDoNotShowAgain = new Krypton.Toolkit.KryptonCheckBox();
+ this.itbDismiss = new Krypton.Toolkit.InternalToastButton();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kpnlMain = new Krypton.Toolkit.KryptonPanel();
+ this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
+ this.pbxNotificationIcon = new System.Windows.Forms.PictureBox();
+ this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
+ this.kwlNotificationTitle = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kwlNotificationMessage = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kdudUserInput = new Krypton.Toolkit.KryptonDomainUpDown();
+ this.tlpMain = new System.Windows.Forms.TableLayoutPanel();
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit();
+ this.kpnlButtons.SuspendLayout();
+ this.tableLayoutPanel2.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).BeginInit();
+ this.kpnlMain.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
+ this.kryptonPanel1.SuspendLayout();
+ this.tableLayoutPanel3.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).BeginInit();
+ this.tableLayoutPanel4.SuspendLayout();
+ this.tlpMain.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // kpnlButtons
+ //
+ this.kpnlButtons.Controls.Add(this.tableLayoutPanel2);
+ this.kpnlButtons.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlButtons.Location = new System.Drawing.Point(0, 327);
+ this.kpnlButtons.Name = "kpnlButtons";
+ this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlButtons.Size = new System.Drawing.Size(614, 50);
+ this.kpnlButtons.TabIndex = 6;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel2.ColumnCount = 4;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.Controls.Add(this.kbtnDismiss, 2, 0);
+ this.tableLayoutPanel2.Controls.Add(this.klblToastLocation, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.kchkDoNotShowAgain, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.itbDismiss, 3, 0);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 1;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(614, 49);
+ this.tableLayoutPanel2.TabIndex = 5;
+ //
+ // kbtnDismiss
+ //
+ this.kbtnDismiss.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnDismiss.AutoSize = true;
+ this.kbtnDismiss.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.kbtnDismiss.Location = new System.Drawing.Point(78, 13);
+ this.kbtnDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnDismiss.Name = "kbtnDismiss";
+ this.kbtnDismiss.Size = new System.Drawing.Size(48, 22);
+ this.kbtnDismiss.TabIndex = 2;
+ this.kbtnDismiss.Values.Text = "{0} ({1})";
+ this.kbtnDismiss.Visible = false;
+ //
+ // klblToastLocation
+ //
+ this.klblToastLocation.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.klblToastLocation.Location = new System.Drawing.Point(533, 23);
+ this.klblToastLocation.Margin = new System.Windows.Forms.Padding(10);
+ this.klblToastLocation.Name = "klblToastLocation";
+ this.klblToastLocation.Size = new System.Drawing.Size(6, 2);
+ this.klblToastLocation.TabIndex = 3;
+ this.klblToastLocation.Values.Text = "";
+ //
+ // kchkDoNotShowAgain
+ //
+ this.kchkDoNotShowAgain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kchkDoNotShowAgain.Location = new System.Drawing.Point(559, 10);
+ this.kchkDoNotShowAgain.Margin = new System.Windows.Forms.Padding(10);
+ this.kchkDoNotShowAgain.Name = "kchkDoNotShowAgain";
+ this.kchkDoNotShowAgain.Size = new System.Drawing.Size(45, 29);
+ this.kchkDoNotShowAgain.TabIndex = 4;
+ this.kchkDoNotShowAgain.Values.Text = "CB1";
+ this.kchkDoNotShowAgain.Visible = false;
+ //
+ // itbDismiss
+ //
+ this.itbDismiss.AutoSize = true;
+ this.itbDismiss.IsActionButton = false;
+ this.itbDismiss.IsDismissButton = true;
+ this.itbDismiss.Location = new System.Drawing.Point(10, 13);
+ this.itbDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.itbDismiss.Name = "itbDismiss";
+ this.itbDismiss.NotificationResult = Krypton.Toolkit.KryptonToastNotificationResult.None;
+ this.itbDismiss.Owner = null;
+ this.itbDismiss.ProcessPath = "";
+ this.itbDismiss.Size = new System.Drawing.Size(48, 22);
+ this.itbDismiss.TabIndex = 5;
+ this.itbDismiss.Values.Text = "{0} ({1})";
+ this.itbDismiss.Click += new System.EventHandler(this.itbDismiss_Click);
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(614, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kpnlMain
+ //
+ this.kpnlMain.Controls.Add(this.kryptonPanel1);
+ this.kpnlMain.Controls.Add(this.tlpMain);
+ this.kpnlMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlMain.Location = new System.Drawing.Point(0, 0);
+ this.kpnlMain.Name = "kpnlMain";
+ this.kpnlMain.Size = new System.Drawing.Size(614, 327);
+ this.kpnlMain.TabIndex = 7;
+ //
+ // kryptonPanel1
+ //
+ this.kryptonPanel1.Controls.Add(this.tableLayoutPanel3);
+ this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonPanel1.Name = "kryptonPanel1";
+ this.kryptonPanel1.Size = new System.Drawing.Size(614, 327);
+ this.kryptonPanel1.TabIndex = 4;
+ //
+ // tableLayoutPanel3
+ //
+ this.tableLayoutPanel3.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel3.ColumnCount = 2;
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel3.Controls.Add(this.pbxNotificationIcon, 0, 0);
+ this.tableLayoutPanel3.Controls.Add(this.tableLayoutPanel4, 1, 0);
+ this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel3.Location = new System.Drawing.Point(0, 0);
+ this.tableLayoutPanel3.Name = "tableLayoutPanel3";
+ this.tableLayoutPanel3.RowCount = 1;
+ this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel3.Size = new System.Drawing.Size(614, 327);
+ this.tableLayoutPanel3.TabIndex = 0;
+ //
+ // pbxNotificationIcon
+ //
+ this.pbxNotificationIcon.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pbxNotificationIcon.Location = new System.Drawing.Point(481, 5);
+ this.pbxNotificationIcon.Margin = new System.Windows.Forms.Padding(5);
+ this.pbxNotificationIcon.Name = "pbxNotificationIcon";
+ this.pbxNotificationIcon.Size = new System.Drawing.Size(128, 317);
+ this.pbxNotificationIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pbxNotificationIcon.TabIndex = 0;
+ this.pbxNotificationIcon.TabStop = false;
+ //
+ // tableLayoutPanel4
+ //
+ this.tableLayoutPanel4.ColumnCount = 1;
+ this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel4.Controls.Add(this.kwlNotificationTitle, 0, 0);
+ this.tableLayoutPanel4.Controls.Add(this.kwlNotificationMessage, 0, 1);
+ this.tableLayoutPanel4.Controls.Add(this.kdudUserInput, 0, 2);
+ this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel4.Location = new System.Drawing.Point(3, 3);
+ this.tableLayoutPanel4.Name = "tableLayoutPanel4";
+ this.tableLayoutPanel4.RowCount = 3;
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel4.Size = new System.Drawing.Size(470, 321);
+ this.tableLayoutPanel4.TabIndex = 1;
+ //
+ // kwlNotificationTitle
+ //
+ this.kwlNotificationTitle.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationTitle.Font = new System.Drawing.Font("Segoe UI", 13.5F, System.Drawing.FontStyle.Bold);
+ this.kwlNotificationTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationTitle.LabelStyle = Krypton.Toolkit.LabelStyle.TitleControl;
+ this.kwlNotificationTitle.Location = new System.Drawing.Point(3, 0);
+ this.kwlNotificationTitle.Name = "kwlNotificationTitle";
+ this.kwlNotificationTitle.Size = new System.Drawing.Size(464, 25);
+ this.kwlNotificationTitle.Text = "kryptonWrapLabel1";
+ this.kwlNotificationTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // kwlNotificationMessage
+ //
+ this.kwlNotificationMessage.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationMessage.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.kwlNotificationMessage.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationMessage.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.kwlNotificationMessage.Location = new System.Drawing.Point(3, 25);
+ this.kwlNotificationMessage.Name = "kwlNotificationMessage";
+ this.kwlNotificationMessage.Size = new System.Drawing.Size(464, 268);
+ this.kwlNotificationMessage.Text = "kryptonWrapLabel2";
+ this.kwlNotificationMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // kdudUserInput
+ //
+ this.kdudUserInput.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kdudUserInput.Location = new System.Drawing.Point(3, 296);
+ this.kdudUserInput.Name = "kdudUserInput";
+ this.kdudUserInput.Size = new System.Drawing.Size(464, 22);
+ this.kdudUserInput.TabIndex = 2;
+ //
+ // tlpMain
+ //
+ this.tlpMain.BackColor = System.Drawing.Color.Transparent;
+ this.tlpMain.ColumnCount = 2;
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Controls.Add(this.tableLayoutPanel1, 1, 0);
+ this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpMain.Location = new System.Drawing.Point(0, 0);
+ this.tlpMain.Name = "tlpMain";
+ this.tlpMain.RowCount = 1;
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Size = new System.Drawing.Size(614, 327);
+ this.tlpMain.TabIndex = 0;
+ //
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.ColumnCount = 1;
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 3);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 3;
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(608, 321);
+ this.tableLayoutPanel1.TabIndex = 1;
+ //
+ // VisualToastNotificationDomainUpDownUserInputRtlAwareForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(614, 377);
+ this.Controls.Add(this.kpnlMain);
+ this.Controls.Add(this.kpnlButtons);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualToastNotificationDomainUpDownUserInputRtlAwareForm";
+ this.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.Load += new System.EventHandler(this.VisualToastNotificationDomainUpDownUserInputRtlAwareForm_Load);
+ this.LocationChanged += new System.EventHandler(this.VisualToastNotificationDomainUpDownUserInputRtlAwareForm_LocationChanged);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit();
+ this.kpnlButtons.ResumeLayout(false);
+ this.kpnlButtons.PerformLayout();
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).EndInit();
+ this.kpnlMain.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
+ this.kryptonPanel1.ResumeLayout(false);
+ this.tableLayoutPanel3.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).EndInit();
+ this.tableLayoutPanel4.ResumeLayout(false);
+ this.tableLayoutPanel4.PerformLayout();
+ this.tlpMain.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kpnlButtons;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private KryptonPanel kpnlMain;
+ private KryptonPanel kryptonPanel1;
+ private TableLayoutPanel tableLayoutPanel3;
+ private PictureBox pbxNotificationIcon;
+ private TableLayoutPanel tableLayoutPanel4;
+ private KryptonWrapLabel kwlNotificationTitle;
+ private KryptonWrapLabel kwlNotificationMessage;
+ private KryptonDomainUpDown kdudUserInput;
+ private TableLayoutPanel tlpMain;
+ private TableLayoutPanel tableLayoutPanel1;
+ private TableLayoutPanel tableLayoutPanel2;
+ private KryptonButton kbtnDismiss;
+ private KryptonLabel klblToastLocation;
+ private KryptonCheckBox kchkDoNotShowAgain;
+ private InternalToastButton itbDismiss;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationDomainUpDownUserInputRtlAwareForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationDomainUpDownUserInputRtlAwareForm.cs
new file mode 100644
index 000000000..fd7d5fef1
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationDomainUpDownUserInputRtlAwareForm.cs
@@ -0,0 +1,318 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+using Timer = System.Windows.Forms.Timer;
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualToastNotificationDomainUpDownUserInputRtlAwareForm : VisualToastNotificationBaseForm
+ {
+ #region Instance Fields
+
+ private int _time;
+
+ private Timer _timer;
+
+ private readonly KryptonUserInputToastNotificationData _data;
+
+ #endregion
+
+ #region Internal
+
+ internal string UserResponse => kdudUserInput.Text;
+
+ #endregion
+
+ #region Identity
+
+ public VisualToastNotificationDomainUpDownUserInputRtlAwareForm(KryptonUserInputToastNotificationData data)
+ {
+ InitializeComponent();
+
+ _data = data;
+
+ GotFocus += (sender, args) => kdudUserInput.Focus();
+
+ Resize += OnResize;
+
+ UpdateBorderColors();
+ }
+
+ #endregion
+
+ #region Implementation
+
+ private void UpdateBorderColors()
+ {
+ StateCommon!.Border.Color1 = _data.BorderColor1 ?? GlobalStaticValues.EMPTY_COLOR;
+
+ StateCommon!.Border.Color2 = _data.BorderColor2 ?? GlobalStaticValues.EMPTY_COLOR;
+ }
+
+ private void UpdateText()
+ {
+ kwlNotificationTitle.Text = _data.NotificationTitle;
+
+ kwlNotificationMessage.Text = _data.NotificationContent;
+ }
+
+ private void UpdateInitialValues()
+ {
+ // Set initial date and time values
+ if (_data.UserInputList.Count > 0)
+ {
+ foreach (var item in _data.UserInputList)
+ {
+ kdudUserInput.Items.Add(item);
+ }
+
+ kdudUserInput.SelectedIndex = _data.SelectedIndex ?? 1;
+ }
+ }
+
+ private void SetIcon(Bitmap? image) => pbxNotificationIcon.Image = image;
+
+ private void UpdateLocation()
+ {
+ //Once loaded, position the form, or position it to the bottom left of the screen with added padding
+ Location = _data.NotificationLocation ?? new Point(Screen.PrimaryScreen!.WorkingArea.Width - Width - 5,
+ Screen.PrimaryScreen.WorkingArea.Height - Height - 5);
+ }
+
+ private void ShowCloseButton()
+ {
+ CloseBox = _data.ShowCloseBox ?? false;
+
+ FormBorderStyle = CloseBox ? FormBorderStyle.Fixed3D : FormBorderStyle.FixedSingle;
+
+ ControlBox = _data.ShowCloseBox ?? false;
+ }
+
+ private void UpdateIcon()
+ {
+ switch (_data.NotificationIcon)
+ {
+ case KryptonToastNotificationIcon.None:
+ SetIcon(null);
+ break;
+ case KryptonToastNotificationIcon.Hand:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Hand_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemHand:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Hand.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Question:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Question_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemQuestion:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Question.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Exclamation:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.SystemExclamation:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Exclamation.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Asterisk:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Asterisk_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemAsterisk:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Stop:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Stop_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Error:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Critical_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Warning:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.Information:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Shield:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
+ }
+ else if (OSUtilities.IsWindowsTen)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_10_128_x_128);
+ }
+ else
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128);
+ }
+ break;
+ case KryptonToastNotificationIcon.WindowsLogo:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_11_128_128);
+ }
+ else if (OSUtilities.IsWindowsEight || OSUtilities.IsWindowsEightPointOne || OSUtilities.IsWindowsTen)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_8_81_10_128_128);
+ }
+ else
+ {
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.WinLogo.ToBitmap(), new Size(128, 128)));
+ }
+ break;
+ case KryptonToastNotificationIcon.Application:
+ SetIcon(GraphicsExtensions.ScaleImage(_data.ApplicationIcon.ToBitmap(), new Size(128, 128)));
+ break;
+ case KryptonToastNotificationIcon.SystemApplication:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Ok:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Ok_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Custom:
+ SetIcon(_data.CustomImage != null
+ ? new Bitmap(_data.CustomImage)
+ : null);
+ break;
+ case null:
+ SetIcon(null);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+
+ private void itbDismiss_Click(object sender, EventArgs e) => Close();
+
+ private void OnResize(object? sender, EventArgs e)
+ {
+ if (WindowState == FormWindowState.Maximized)
+ {
+ WindowState = FormWindowState.Normal;
+ }
+ }
+
+ private void VisualToastNotificationDomainUpDownUserInputRtlAwareForm_Load(object sender, EventArgs e)
+ {
+ UpdateIcon();
+
+ UpdateLocation();
+
+ ShowCloseButton();
+
+ _timer.Start();
+ }
+
+ private void VisualToastNotificationDomainUpDownUserInputRtlAwareForm_LocationChanged(object sender, EventArgs e)
+ {
+
+ }
+
+ public new DialogResult ShowDialog()
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ UpdateLocation();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ if (_time == _data.CountDownSeconds)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog();
+ }
+
+ public new DialogResult ShowDialog(IWin32Window owner)
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ if (_time == _data.CountDownSeconds)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog(owner);
+ }
+
+ internal static string ShowNotification(KryptonUserInputToastNotificationData data)
+ {
+ var owner = data.ToastHost ?? FromHandle(PI.GetActiveWindow());
+
+ using var toast = new VisualToastNotificationDomainUpDownUserInputRtlAwareForm(data);
+
+ if (owner != null)
+ {
+ toast.StartPosition = owner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
+
+ return toast.ShowDialog(owner!) == DialogResult.OK ? toast.UserResponse : string.Empty;
+ }
+ else
+ {
+ return toast.ShowDialog() == DialogResult.OK ? toast.UserResponse : string.Empty;
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationDomainUpDownUserInputRtlAwareForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationDomainUpDownUserInputRtlAwareForm.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationDomainUpDownUserInputRtlAwareForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationMaskedTextBoxUserInputRtlAwareForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationMaskedTextBoxUserInputRtlAwareForm.Designer.cs
new file mode 100644
index 000000000..e866e6300
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationMaskedTextBoxUserInputRtlAwareForm.Designer.cs
@@ -0,0 +1,331 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualToastNotificationMaskedTextBoxUserInputRtlAwareForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.kpnlButtons = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnDismiss = new Krypton.Toolkit.KryptonButton();
+ this.klblToastLocation = new Krypton.Toolkit.KryptonLabel();
+ this.kchkDoNotShowAgain = new Krypton.Toolkit.KryptonCheckBox();
+ this.itbDismiss = new Krypton.Toolkit.InternalToastButton();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kpnlMain = new Krypton.Toolkit.KryptonPanel();
+ this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
+ this.pbxNotificationIcon = new System.Windows.Forms.PictureBox();
+ this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
+ this.kwlNotificationTitle = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kwlNotificationMessage = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kmtxtUserInput = new Krypton.Toolkit.KryptonMaskedTextBox();
+ this.tlpMain = new System.Windows.Forms.TableLayoutPanel();
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit();
+ this.kpnlButtons.SuspendLayout();
+ this.tableLayoutPanel2.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).BeginInit();
+ this.kpnlMain.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
+ this.kryptonPanel1.SuspendLayout();
+ this.tableLayoutPanel3.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).BeginInit();
+ this.tableLayoutPanel4.SuspendLayout();
+ this.tlpMain.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // kpnlButtons
+ //
+ this.kpnlButtons.Controls.Add(this.tableLayoutPanel2);
+ this.kpnlButtons.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlButtons.Location = new System.Drawing.Point(0, 327);
+ this.kpnlButtons.Name = "kpnlButtons";
+ this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlButtons.Size = new System.Drawing.Size(614, 50);
+ this.kpnlButtons.TabIndex = 6;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel2.ColumnCount = 4;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.Controls.Add(this.kbtnDismiss, 2, 0);
+ this.tableLayoutPanel2.Controls.Add(this.klblToastLocation, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.kchkDoNotShowAgain, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.itbDismiss, 3, 0);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 1;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(614, 49);
+ this.tableLayoutPanel2.TabIndex = 5;
+ //
+ // kbtnDismiss
+ //
+ this.kbtnDismiss.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnDismiss.AutoSize = true;
+ this.kbtnDismiss.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.kbtnDismiss.Location = new System.Drawing.Point(78, 13);
+ this.kbtnDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnDismiss.Name = "kbtnDismiss";
+ this.kbtnDismiss.Size = new System.Drawing.Size(48, 22);
+ this.kbtnDismiss.TabIndex = 2;
+ this.kbtnDismiss.Values.Text = "{0} ({1})";
+ this.kbtnDismiss.Visible = false;
+ //
+ // klblToastLocation
+ //
+ this.klblToastLocation.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.klblToastLocation.Location = new System.Drawing.Point(533, 23);
+ this.klblToastLocation.Margin = new System.Windows.Forms.Padding(10);
+ this.klblToastLocation.Name = "klblToastLocation";
+ this.klblToastLocation.Size = new System.Drawing.Size(6, 2);
+ this.klblToastLocation.TabIndex = 3;
+ this.klblToastLocation.Values.Text = "";
+ //
+ // kchkDoNotShowAgain
+ //
+ this.kchkDoNotShowAgain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kchkDoNotShowAgain.Location = new System.Drawing.Point(559, 10);
+ this.kchkDoNotShowAgain.Margin = new System.Windows.Forms.Padding(10);
+ this.kchkDoNotShowAgain.Name = "kchkDoNotShowAgain";
+ this.kchkDoNotShowAgain.Size = new System.Drawing.Size(45, 29);
+ this.kchkDoNotShowAgain.TabIndex = 4;
+ this.kchkDoNotShowAgain.Values.Text = "CB1";
+ this.kchkDoNotShowAgain.Visible = false;
+ //
+ // itbDismiss
+ //
+ this.itbDismiss.AutoSize = true;
+ this.itbDismiss.IsActionButton = false;
+ this.itbDismiss.IsDismissButton = true;
+ this.itbDismiss.Location = new System.Drawing.Point(10, 13);
+ this.itbDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.itbDismiss.Name = "itbDismiss";
+ this.itbDismiss.NotificationResult = Krypton.Toolkit.KryptonToastNotificationResult.None;
+ this.itbDismiss.Owner = null;
+ this.itbDismiss.ProcessPath = "";
+ this.itbDismiss.Size = new System.Drawing.Size(48, 22);
+ this.itbDismiss.TabIndex = 5;
+ this.itbDismiss.Values.Text = "{0} ({1})";
+ this.itbDismiss.Click += new System.EventHandler(this.itbDismiss_Click);
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(614, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kpnlMain
+ //
+ this.kpnlMain.Controls.Add(this.kryptonPanel1);
+ this.kpnlMain.Controls.Add(this.tlpMain);
+ this.kpnlMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlMain.Location = new System.Drawing.Point(0, 0);
+ this.kpnlMain.Name = "kpnlMain";
+ this.kpnlMain.Size = new System.Drawing.Size(614, 327);
+ this.kpnlMain.TabIndex = 7;
+ //
+ // kryptonPanel1
+ //
+ this.kryptonPanel1.Controls.Add(this.tableLayoutPanel3);
+ this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonPanel1.Name = "kryptonPanel1";
+ this.kryptonPanel1.Size = new System.Drawing.Size(614, 327);
+ this.kryptonPanel1.TabIndex = 4;
+ //
+ // tableLayoutPanel3
+ //
+ this.tableLayoutPanel3.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel3.ColumnCount = 2;
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel3.Controls.Add(this.pbxNotificationIcon, 0, 0);
+ this.tableLayoutPanel3.Controls.Add(this.tableLayoutPanel4, 1, 0);
+ this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel3.Location = new System.Drawing.Point(0, 0);
+ this.tableLayoutPanel3.Name = "tableLayoutPanel3";
+ this.tableLayoutPanel3.RowCount = 1;
+ this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel3.Size = new System.Drawing.Size(614, 327);
+ this.tableLayoutPanel3.TabIndex = 0;
+ //
+ // pbxNotificationIcon
+ //
+ this.pbxNotificationIcon.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pbxNotificationIcon.Location = new System.Drawing.Point(481, 5);
+ this.pbxNotificationIcon.Margin = new System.Windows.Forms.Padding(5);
+ this.pbxNotificationIcon.Name = "pbxNotificationIcon";
+ this.pbxNotificationIcon.Size = new System.Drawing.Size(128, 317);
+ this.pbxNotificationIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pbxNotificationIcon.TabIndex = 0;
+ this.pbxNotificationIcon.TabStop = false;
+ //
+ // tableLayoutPanel4
+ //
+ this.tableLayoutPanel4.ColumnCount = 1;
+ this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel4.Controls.Add(this.kwlNotificationTitle, 0, 0);
+ this.tableLayoutPanel4.Controls.Add(this.kwlNotificationMessage, 0, 1);
+ this.tableLayoutPanel4.Controls.Add(this.kmtxtUserInput, 0, 2);
+ this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel4.Location = new System.Drawing.Point(3, 3);
+ this.tableLayoutPanel4.Name = "tableLayoutPanel4";
+ this.tableLayoutPanel4.RowCount = 3;
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel4.Size = new System.Drawing.Size(470, 321);
+ this.tableLayoutPanel4.TabIndex = 1;
+ //
+ // kwlNotificationTitle
+ //
+ this.kwlNotificationTitle.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationTitle.Font = new System.Drawing.Font("Segoe UI", 13.5F, System.Drawing.FontStyle.Bold);
+ this.kwlNotificationTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationTitle.LabelStyle = Krypton.Toolkit.LabelStyle.TitleControl;
+ this.kwlNotificationTitle.Location = new System.Drawing.Point(3, 0);
+ this.kwlNotificationTitle.Name = "kwlNotificationTitle";
+ this.kwlNotificationTitle.Size = new System.Drawing.Size(464, 25);
+ this.kwlNotificationTitle.Text = "kryptonWrapLabel1";
+ this.kwlNotificationTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // kwlNotificationMessage
+ //
+ this.kwlNotificationMessage.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationMessage.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.kwlNotificationMessage.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationMessage.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.kwlNotificationMessage.Location = new System.Drawing.Point(3, 25);
+ this.kwlNotificationMessage.Name = "kwlNotificationMessage";
+ this.kwlNotificationMessage.Size = new System.Drawing.Size(464, 267);
+ this.kwlNotificationMessage.Text = "kryptonWrapLabel2";
+ this.kwlNotificationMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // kmtxtUserInput
+ //
+ this.kmtxtUserInput.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kmtxtUserInput.Location = new System.Drawing.Point(3, 295);
+ this.kmtxtUserInput.Name = "kmtxtUserInput";
+ this.kmtxtUserInput.Size = new System.Drawing.Size(464, 23);
+ this.kmtxtUserInput.TabIndex = 2;
+ this.kmtxtUserInput.Text = "kryptonMaskedTextBox1";
+ //
+ // tlpMain
+ //
+ this.tlpMain.BackColor = System.Drawing.Color.Transparent;
+ this.tlpMain.ColumnCount = 2;
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Controls.Add(this.tableLayoutPanel1, 1, 0);
+ this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpMain.Location = new System.Drawing.Point(0, 0);
+ this.tlpMain.Name = "tlpMain";
+ this.tlpMain.RowCount = 1;
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Size = new System.Drawing.Size(614, 327);
+ this.tlpMain.TabIndex = 0;
+ //
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.ColumnCount = 1;
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 3);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 3;
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(608, 321);
+ this.tableLayoutPanel1.TabIndex = 1;
+ //
+ // VisualToastNotificationMaskedTextBoxUserInputRtlAwareForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(614, 377);
+ this.Controls.Add(this.kpnlMain);
+ this.Controls.Add(this.kpnlButtons);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualToastNotificationMaskedTextBoxUserInputRtlAwareForm";
+ this.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.Load += new System.EventHandler(this.VisualToastNotificationMaskedTextBoxUserInputRtlAwareForm_Load);
+ this.LocationChanged += new System.EventHandler(this.VisualToastNotificationMaskedTextBoxUserInputRtlAwareForm_LocationChanged);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit();
+ this.kpnlButtons.ResumeLayout(false);
+ this.kpnlButtons.PerformLayout();
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).EndInit();
+ this.kpnlMain.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
+ this.kryptonPanel1.ResumeLayout(false);
+ this.tableLayoutPanel3.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).EndInit();
+ this.tableLayoutPanel4.ResumeLayout(false);
+ this.tableLayoutPanel4.PerformLayout();
+ this.tlpMain.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kpnlButtons;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private KryptonPanel kpnlMain;
+ private KryptonPanel kryptonPanel1;
+ private TableLayoutPanel tableLayoutPanel3;
+ private PictureBox pbxNotificationIcon;
+ private TableLayoutPanel tableLayoutPanel4;
+ private KryptonWrapLabel kwlNotificationTitle;
+ private KryptonWrapLabel kwlNotificationMessage;
+ private KryptonMaskedTextBox kmtxtUserInput;
+ private TableLayoutPanel tlpMain;
+ private TableLayoutPanel tableLayoutPanel1;
+ private TableLayoutPanel tableLayoutPanel2;
+ private KryptonButton kbtnDismiss;
+ private KryptonLabel klblToastLocation;
+ private KryptonCheckBox kchkDoNotShowAgain;
+ private InternalToastButton itbDismiss;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationMaskedTextBoxUserInputRtlAwareForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationMaskedTextBoxUserInputRtlAwareForm.cs
new file mode 100644
index 000000000..a13d23370
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationMaskedTextBoxUserInputRtlAwareForm.cs
@@ -0,0 +1,310 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+using Timer = System.Windows.Forms.Timer;
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualToastNotificationMaskedTextBoxUserInputRtlAwareForm : VisualToastNotificationBaseForm
+ {
+ #region Instance Fields
+
+ private int _time;
+
+ private Timer _timer;
+
+ private readonly KryptonUserInputToastNotificationData _data;
+
+ #endregion
+
+ #region Internal
+
+ internal string UserResponse => kmtxtUserInput.Text;
+
+ #endregion
+
+ #region Identity
+
+ public VisualToastNotificationMaskedTextBoxUserInputRtlAwareForm(KryptonUserInputToastNotificationData data)
+ {
+ InitializeComponent();
+
+ _data = data;
+
+ GotFocus += (sender, args) => kmtxtUserInput.Focus();
+
+ Resize += OnResize;
+
+ UpdateBorderColors();
+ }
+
+ #endregion
+
+ #region Implementation
+
+ private void UpdateBorderColors()
+ {
+ StateCommon!.Border.Color1 = _data.BorderColor1 ?? GlobalStaticValues.EMPTY_COLOR;
+
+ StateCommon!.Border.Color2 = _data.BorderColor2 ?? GlobalStaticValues.EMPTY_COLOR;
+ }
+
+ private void UpdateText()
+ {
+ kwlNotificationTitle.Text = _data.NotificationTitle;
+
+ kwlNotificationMessage.Text = _data.NotificationContent;
+ }
+
+ private void UpdateInitialValues()
+ {
+ // Set initial date and time values
+ kmtxtUserInput.Text = GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+
+ private void SetIcon(Bitmap? image) => pbxNotificationIcon.Image = image;
+
+ private void UpdateLocation()
+ {
+ //Once loaded, position the form, or position it to the bottom left of the screen with added padding
+ Location = _data.NotificationLocation ?? new Point(Screen.PrimaryScreen!.WorkingArea.Width - Width - 5,
+ Screen.PrimaryScreen.WorkingArea.Height - Height - 5);
+ }
+
+ private void UpdateIcon()
+ {
+ switch (_data.NotificationIcon)
+ {
+ case KryptonToastNotificationIcon.None:
+ SetIcon(null);
+ break;
+ case KryptonToastNotificationIcon.Hand:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Hand_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemHand:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Hand.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Question:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Question_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemQuestion:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Question.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Exclamation:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.SystemExclamation:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Exclamation.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Asterisk:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Asterisk_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemAsterisk:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Stop:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Stop_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Error:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Critical_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Warning:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.Information:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Shield:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
+ }
+ else if (OSUtilities.IsWindowsTen)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_10_128_x_128);
+ }
+ else
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128);
+ }
+ break;
+ case KryptonToastNotificationIcon.WindowsLogo:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_11_128_128);
+ }
+ else if (OSUtilities.IsWindowsEight || OSUtilities.IsWindowsEightPointOne || OSUtilities.IsWindowsTen)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_8_81_10_128_128);
+ }
+ else
+ {
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.WinLogo.ToBitmap(), new Size(128, 128)));
+ }
+ break;
+ case KryptonToastNotificationIcon.Application:
+ SetIcon(GraphicsExtensions.ScaleImage(_data.ApplicationIcon.ToBitmap(), new Size(128, 128)));
+ break;
+ case KryptonToastNotificationIcon.SystemApplication:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Ok:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Ok_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Custom:
+ SetIcon(_data.CustomImage != null
+ ? new Bitmap(_data.CustomImage)
+ : null);
+ break;
+ case null:
+ SetIcon(null);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+
+ private void ShowCloseButton()
+ {
+ CloseBox = _data.ShowCloseBox ?? false;
+
+ FormBorderStyle = CloseBox ? FormBorderStyle.Fixed3D : FormBorderStyle.FixedSingle;
+
+ ControlBox = _data.ShowCloseBox ?? false;
+ }
+
+ private void itbDismiss_Click(object sender, EventArgs e) => Close();
+
+ private void VisualToastNotificationMaskedTextBoxUserInputRtlAwareForm_Load(object sender, EventArgs e)
+ {
+ UpdateIcon();
+
+ UpdateLocation();
+
+ ShowCloseButton();
+
+ _timer.Start();
+ }
+
+ private void VisualToastNotificationMaskedTextBoxUserInputRtlAwareForm_LocationChanged(object sender, EventArgs e)
+ {
+
+ }
+
+ private void OnResize(object? sender, EventArgs e)
+ {
+ if (WindowState == FormWindowState.Maximized)
+ {
+ WindowState = FormWindowState.Normal;
+ }
+ }
+
+ public new DialogResult ShowDialog()
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ UpdateLocation();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ if (_time == _data.CountDownSeconds)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog();
+ }
+
+ public new DialogResult ShowDialog(IWin32Window owner)
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ if (_time == _data.CountDownSeconds)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog(owner);
+ }
+
+ internal static string ShowNotification(KryptonUserInputToastNotificationData data)
+ {
+ var owner = data.ToastHost ?? FromHandle(PI.GetActiveWindow());
+
+ using var toast = new VisualToastNotificationMaskedTextBoxUserInputRtlAwareForm(data);
+
+ if (owner != null)
+ {
+ toast.StartPosition = owner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
+
+ return toast.ShowDialog(owner!) == DialogResult.OK ? toast.UserResponse : GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+ else
+ {
+ return toast.ShowDialog() == DialogResult.OK ? toast.UserResponse : GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationMaskedTextBoxUserInputRtlAwareForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationMaskedTextBoxUserInputRtlAwareForm.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationMaskedTextBoxUserInputRtlAwareForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationNUDUserInputRtlAwareForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationNUDUserInputRtlAwareForm.Designer.cs
new file mode 100644
index 000000000..0116f4d37
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationNUDUserInputRtlAwareForm.Designer.cs
@@ -0,0 +1,350 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualToastNotificationNUDUserInputRtlAwareForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.kpnlButtons = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnDismiss = new Krypton.Toolkit.KryptonButton();
+ this.klblToastLocation = new Krypton.Toolkit.KryptonLabel();
+ this.kchkDoNotShowAgain = new Krypton.Toolkit.KryptonCheckBox();
+ this.itbDismiss = new Krypton.Toolkit.InternalToastButton();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kpnlMain = new Krypton.Toolkit.KryptonPanel();
+ this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
+ this.pbxNotificationIcon = new System.Windows.Forms.PictureBox();
+ this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
+ this.kwlNotificationTitle = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kwlNotificationMessage = new Krypton.Toolkit.KryptonWrapLabel();
+ this.knudUserInput = new Krypton.Toolkit.KryptonNumericUpDown();
+ this.tlpMain = new System.Windows.Forms.TableLayoutPanel();
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit();
+ this.kpnlButtons.SuspendLayout();
+ this.tableLayoutPanel2.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).BeginInit();
+ this.kpnlMain.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
+ this.kryptonPanel1.SuspendLayout();
+ this.tableLayoutPanel3.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).BeginInit();
+ this.tableLayoutPanel4.SuspendLayout();
+ this.tlpMain.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // kpnlButtons
+ //
+ this.kpnlButtons.Controls.Add(this.tableLayoutPanel2);
+ this.kpnlButtons.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlButtons.Location = new System.Drawing.Point(0, 327);
+ this.kpnlButtons.Name = "kpnlButtons";
+ this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlButtons.Size = new System.Drawing.Size(614, 50);
+ this.kpnlButtons.TabIndex = 6;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel2.ColumnCount = 4;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.Controls.Add(this.kbtnDismiss, 2, 0);
+ this.tableLayoutPanel2.Controls.Add(this.klblToastLocation, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.kchkDoNotShowAgain, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.itbDismiss, 3, 0);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 1;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(614, 49);
+ this.tableLayoutPanel2.TabIndex = 5;
+ //
+ // kbtnDismiss
+ //
+ this.kbtnDismiss.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnDismiss.AutoSize = true;
+ this.kbtnDismiss.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.kbtnDismiss.Location = new System.Drawing.Point(78, 13);
+ this.kbtnDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnDismiss.Name = "kbtnDismiss";
+ this.kbtnDismiss.Size = new System.Drawing.Size(48, 22);
+ this.kbtnDismiss.TabIndex = 2;
+ this.kbtnDismiss.Values.Text = "{0} ({1})";
+ this.kbtnDismiss.Visible = false;
+ //
+ // klblToastLocation
+ //
+ this.klblToastLocation.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.klblToastLocation.Location = new System.Drawing.Point(533, 23);
+ this.klblToastLocation.Margin = new System.Windows.Forms.Padding(10);
+ this.klblToastLocation.Name = "klblToastLocation";
+ this.klblToastLocation.Size = new System.Drawing.Size(6, 2);
+ this.klblToastLocation.TabIndex = 3;
+ this.klblToastLocation.Values.Text = "";
+ //
+ // kchkDoNotShowAgain
+ //
+ this.kchkDoNotShowAgain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kchkDoNotShowAgain.Location = new System.Drawing.Point(559, 10);
+ this.kchkDoNotShowAgain.Margin = new System.Windows.Forms.Padding(10);
+ this.kchkDoNotShowAgain.Name = "kchkDoNotShowAgain";
+ this.kchkDoNotShowAgain.Size = new System.Drawing.Size(45, 29);
+ this.kchkDoNotShowAgain.TabIndex = 4;
+ this.kchkDoNotShowAgain.Values.Text = "CB1";
+ this.kchkDoNotShowAgain.Visible = false;
+ //
+ // itbDismiss
+ //
+ this.itbDismiss.AutoSize = true;
+ this.itbDismiss.IsActionButton = false;
+ this.itbDismiss.IsDismissButton = true;
+ this.itbDismiss.Location = new System.Drawing.Point(10, 13);
+ this.itbDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.itbDismiss.Name = "itbDismiss";
+ this.itbDismiss.NotificationResult = Krypton.Toolkit.KryptonToastNotificationResult.None;
+ this.itbDismiss.Owner = null;
+ this.itbDismiss.ProcessPath = "";
+ this.itbDismiss.Size = new System.Drawing.Size(48, 22);
+ this.itbDismiss.TabIndex = 5;
+ this.itbDismiss.Values.Text = "{0} ({1})";
+ this.itbDismiss.Click += new System.EventHandler(this.itbDismiss_Click);
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(614, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kpnlMain
+ //
+ this.kpnlMain.Controls.Add(this.kryptonPanel1);
+ this.kpnlMain.Controls.Add(this.tlpMain);
+ this.kpnlMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlMain.Location = new System.Drawing.Point(0, 0);
+ this.kpnlMain.Name = "kpnlMain";
+ this.kpnlMain.Size = new System.Drawing.Size(614, 327);
+ this.kpnlMain.TabIndex = 8;
+ //
+ // kryptonPanel1
+ //
+ this.kryptonPanel1.Controls.Add(this.tableLayoutPanel3);
+ this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonPanel1.Name = "kryptonPanel1";
+ this.kryptonPanel1.Size = new System.Drawing.Size(614, 327);
+ this.kryptonPanel1.TabIndex = 4;
+ //
+ // tableLayoutPanel3
+ //
+ this.tableLayoutPanel3.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel3.ColumnCount = 2;
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel3.Controls.Add(this.pbxNotificationIcon, 0, 0);
+ this.tableLayoutPanel3.Controls.Add(this.tableLayoutPanel4, 1, 0);
+ this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel3.Location = new System.Drawing.Point(0, 0);
+ this.tableLayoutPanel3.Name = "tableLayoutPanel3";
+ this.tableLayoutPanel3.RowCount = 1;
+ this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel3.Size = new System.Drawing.Size(614, 327);
+ this.tableLayoutPanel3.TabIndex = 0;
+ //
+ // pbxNotificationIcon
+ //
+ this.pbxNotificationIcon.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pbxNotificationIcon.Location = new System.Drawing.Point(481, 5);
+ this.pbxNotificationIcon.Margin = new System.Windows.Forms.Padding(5);
+ this.pbxNotificationIcon.Name = "pbxNotificationIcon";
+ this.pbxNotificationIcon.Size = new System.Drawing.Size(128, 317);
+ this.pbxNotificationIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pbxNotificationIcon.TabIndex = 0;
+ this.pbxNotificationIcon.TabStop = false;
+ //
+ // tableLayoutPanel4
+ //
+ this.tableLayoutPanel4.ColumnCount = 1;
+ this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel4.Controls.Add(this.kwlNotificationTitle, 0, 0);
+ this.tableLayoutPanel4.Controls.Add(this.kwlNotificationMessage, 0, 1);
+ this.tableLayoutPanel4.Controls.Add(this.knudUserInput, 0, 2);
+ this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel4.Location = new System.Drawing.Point(3, 3);
+ this.tableLayoutPanel4.Name = "tableLayoutPanel4";
+ this.tableLayoutPanel4.RowCount = 3;
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel4.Size = new System.Drawing.Size(470, 321);
+ this.tableLayoutPanel4.TabIndex = 1;
+ //
+ // kwlNotificationTitle
+ //
+ this.kwlNotificationTitle.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationTitle.Font = new System.Drawing.Font("Segoe UI", 13.5F, System.Drawing.FontStyle.Bold);
+ this.kwlNotificationTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationTitle.LabelStyle = Krypton.Toolkit.LabelStyle.TitleControl;
+ this.kwlNotificationTitle.Location = new System.Drawing.Point(3, 0);
+ this.kwlNotificationTitle.Name = "kwlNotificationTitle";
+ this.kwlNotificationTitle.Size = new System.Drawing.Size(464, 25);
+ this.kwlNotificationTitle.Text = "kryptonWrapLabel1";
+ this.kwlNotificationTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // kwlNotificationMessage
+ //
+ this.kwlNotificationMessage.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationMessage.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.kwlNotificationMessage.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationMessage.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.kwlNotificationMessage.Location = new System.Drawing.Point(3, 25);
+ this.kwlNotificationMessage.Name = "kwlNotificationMessage";
+ this.kwlNotificationMessage.Size = new System.Drawing.Size(464, 268);
+ this.kwlNotificationMessage.Text = "kryptonWrapLabel2";
+ this.kwlNotificationMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // knudUserInput
+ //
+ this.knudUserInput.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.knudUserInput.Increment = new decimal(new int[] {
+ 1,
+ 0,
+ 0,
+ 0});
+ this.knudUserInput.Location = new System.Drawing.Point(3, 296);
+ this.knudUserInput.Maximum = new decimal(new int[] {
+ 100,
+ 0,
+ 0,
+ 0});
+ this.knudUserInput.Minimum = new decimal(new int[] {
+ 0,
+ 0,
+ 0,
+ 0});
+ this.knudUserInput.Name = "knudUserInput";
+ this.knudUserInput.Size = new System.Drawing.Size(464, 22);
+ this.knudUserInput.TabIndex = 2;
+ this.knudUserInput.Value = new decimal(new int[] {
+ 0,
+ 0,
+ 0,
+ 0});
+ //
+ // tlpMain
+ //
+ this.tlpMain.BackColor = System.Drawing.Color.Transparent;
+ this.tlpMain.ColumnCount = 2;
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Controls.Add(this.tableLayoutPanel1, 1, 0);
+ this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpMain.Location = new System.Drawing.Point(0, 0);
+ this.tlpMain.Name = "tlpMain";
+ this.tlpMain.RowCount = 1;
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Size = new System.Drawing.Size(614, 327);
+ this.tlpMain.TabIndex = 0;
+ //
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.ColumnCount = 1;
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 3);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 3;
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(608, 321);
+ this.tableLayoutPanel1.TabIndex = 1;
+ //
+ // VisualToastNotificationNUDUserInputRtlAwareForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(614, 377);
+ this.Controls.Add(this.kpnlMain);
+ this.Controls.Add(this.kpnlButtons);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualToastNotificationNUDUserInputRtlAwareForm";
+ this.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.Load += new System.EventHandler(this.VisualToastNotificationNumericUpDownUserInputRtlAwareForm_Load);
+ this.LocationChanged += new System.EventHandler(this.VisualToastNotificationNumericUpDownUserInputRtlAwareForm_LocationChanged);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit();
+ this.kpnlButtons.ResumeLayout(false);
+ this.kpnlButtons.PerformLayout();
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).EndInit();
+ this.kpnlMain.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
+ this.kryptonPanel1.ResumeLayout(false);
+ this.tableLayoutPanel3.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).EndInit();
+ this.tableLayoutPanel4.ResumeLayout(false);
+ this.tableLayoutPanel4.PerformLayout();
+ this.tlpMain.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kpnlButtons;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private KryptonPanel kpnlMain;
+ private KryptonPanel kryptonPanel1;
+ private TableLayoutPanel tableLayoutPanel3;
+ private PictureBox pbxNotificationIcon;
+ private TableLayoutPanel tableLayoutPanel4;
+ private KryptonWrapLabel kwlNotificationTitle;
+ private KryptonWrapLabel kwlNotificationMessage;
+ private KryptonNumericUpDown knudUserInput;
+ private TableLayoutPanel tlpMain;
+ private TableLayoutPanel tableLayoutPanel1;
+ private TableLayoutPanel tableLayoutPanel2;
+ private KryptonButton kbtnDismiss;
+ private KryptonLabel klblToastLocation;
+ private KryptonCheckBox kchkDoNotShowAgain;
+ private InternalToastButton itbDismiss;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationNUDUserInputRtlAwareForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationNUDUserInputRtlAwareForm.cs
new file mode 100644
index 000000000..bb52c445b
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationNUDUserInputRtlAwareForm.cs
@@ -0,0 +1,314 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+using Timer = System.Windows.Forms.Timer;
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualToastNotificationNUDUserInputRtlAwareForm : VisualToastNotificationBaseForm
+ {
+ #region Instance Fields
+
+ private int _time;
+
+ private Timer _timer;
+
+ private readonly KryptonUserInputToastNotificationData _data;
+
+ #endregion
+
+ #region Internal
+
+ internal int UserResponse => Convert.ToInt32(knudUserInput.Value);
+
+ #endregion
+
+ #region Identity
+
+ public VisualToastNotificationNUDUserInputRtlAwareForm(KryptonUserInputToastNotificationData data)
+ {
+ InitializeComponent();
+
+ _data = data;
+
+ GotFocus += (sender, args) => knudUserInput.Focus();
+
+ Resize += OnResize;
+
+ UpdateBorderColors();
+ }
+
+ #endregion
+
+ #region Implementation
+
+ private void UpdateBorderColors()
+ {
+ StateCommon!.Border.Color1 = _data.BorderColor1 ?? GlobalStaticValues.EMPTY_COLOR;
+
+ StateCommon!.Border.Color2 = _data.BorderColor2 ?? GlobalStaticValues.EMPTY_COLOR;
+ }
+
+ private void UpdateText()
+ {
+ kwlNotificationTitle.Text = _data.NotificationTitle;
+
+ kwlNotificationMessage.Text = _data.NotificationContent;
+ }
+
+ private void UpdateInitialValues()
+ {
+ // Set initial date and time values
+ knudUserInput.Value = _data.InitialNumericUpDownValue ?? 0;
+
+ knudUserInput.Maximum = _data.MaximumNumericUpDownValue ?? 100;
+
+ knudUserInput.Minimum = _data.MinimumNumericUpDownValue ?? 0;
+ }
+
+ private void SetIcon(Bitmap? image) => pbxNotificationIcon.Image = image;
+
+ private void UpdateLocation()
+ {
+ //Once loaded, position the form, or position it to the bottom left of the screen with added padding
+ Location = _data.NotificationLocation ?? new Point(Screen.PrimaryScreen!.WorkingArea.Width - Width - 5,
+ Screen.PrimaryScreen.WorkingArea.Height - Height - 5);
+ }
+
+ private void UpdateIcon()
+ {
+ switch (_data.NotificationIcon)
+ {
+ case KryptonToastNotificationIcon.None:
+ SetIcon(null);
+ break;
+ case KryptonToastNotificationIcon.Hand:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Hand_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemHand:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Hand.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Question:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Question_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemQuestion:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Question.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Exclamation:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.SystemExclamation:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Exclamation.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Asterisk:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Asterisk_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemAsterisk:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Stop:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Stop_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Error:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Critical_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Warning:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.Information:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Shield:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
+ }
+ else if (OSUtilities.IsWindowsTen)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_10_128_x_128);
+ }
+ else
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128);
+ }
+ break;
+ case KryptonToastNotificationIcon.WindowsLogo:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_11_128_128);
+ }
+ else if (OSUtilities.IsWindowsEight || OSUtilities.IsWindowsEightPointOne || OSUtilities.IsWindowsTen)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_8_81_10_128_128);
+ }
+ else
+ {
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.WinLogo.ToBitmap(), new Size(128, 128)));
+ }
+ break;
+ case KryptonToastNotificationIcon.Application:
+ SetIcon(GraphicsExtensions.ScaleImage(_data.ApplicationIcon.ToBitmap(), new Size(128, 128)));
+ break;
+ case KryptonToastNotificationIcon.SystemApplication:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Ok:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Ok_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Custom:
+ SetIcon(_data.CustomImage != null
+ ? new Bitmap(_data.CustomImage)
+ : null);
+ break;
+ case null:
+ SetIcon(null);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+
+ private void ShowCloseButton()
+ {
+ CloseBox = _data.ShowCloseBox ?? false;
+
+ FormBorderStyle = CloseBox ? FormBorderStyle.Fixed3D : FormBorderStyle.FixedSingle;
+
+ ControlBox = _data.ShowCloseBox ?? false;
+ }
+
+ private void itbDismiss_Click(object sender, EventArgs e) => Close();
+
+ private void VisualToastNotificationNumericUpDownUserInputRtlAwareForm_Load(object sender, EventArgs e)
+ {
+ UpdateIcon();
+
+ UpdateLocation();
+
+ ShowCloseButton();
+
+ _timer.Start();
+ }
+
+ private void VisualToastNotificationNumericUpDownUserInputRtlAwareForm_LocationChanged(object sender, EventArgs e)
+ {
+
+ }
+
+ private void OnResize(object? sender, EventArgs e)
+ {
+ if (WindowState == FormWindowState.Maximized)
+ {
+ WindowState = FormWindowState.Normal;
+ }
+ }
+
+ public new DialogResult ShowDialog()
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ UpdateLocation();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ if (_time == _data.CountDownSeconds)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog();
+ }
+
+ public new DialogResult ShowDialog(IWin32Window owner)
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ if (_time == _data.CountDownSeconds)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog(owner);
+ }
+
+ internal static decimal ShowNotification(KryptonUserInputToastNotificationData data)
+ {
+ var owner = data.ToastHost ?? FromHandle(PI.GetActiveWindow());
+
+ using var toast = new VisualToastNotificationNUDUserInputRtlAwareForm(data);
+
+ if (owner != null)
+ {
+ toast.StartPosition = owner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
+
+ return toast.ShowDialog(owner!) == DialogResult.OK ? toast.UserResponse : 0;
+ }
+ else
+ {
+ return toast.ShowDialog() == DialogResult.OK ? toast.UserResponse : 0;
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationNUDUserInputRtlAwareForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationNUDUserInputRtlAwareForm.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationNUDUserInputRtlAwareForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationTextBoxUserInputRtlAwareForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationTextBoxUserInputRtlAwareForm.Designer.cs
new file mode 100644
index 000000000..19e5bcfa8
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationTextBoxUserInputRtlAwareForm.Designer.cs
@@ -0,0 +1,330 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualToastNotificationTextBoxUserInputRtlAwareForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.kpnlButtons = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnDismiss = new Krypton.Toolkit.KryptonButton();
+ this.klblToastLocation = new Krypton.Toolkit.KryptonLabel();
+ this.kchkDoNotShowAgain = new Krypton.Toolkit.KryptonCheckBox();
+ this.itbDismiss = new Krypton.Toolkit.InternalToastButton();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kpnlMain = new Krypton.Toolkit.KryptonPanel();
+ this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
+ this.pbxNotificationIcon = new System.Windows.Forms.PictureBox();
+ this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
+ this.kwlNotificationTitle = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kwlNotificationMessage = new Krypton.Toolkit.KryptonWrapLabel();
+ this.ktxtUserInput = new Krypton.Toolkit.KryptonTextBox();
+ this.tlpMain = new System.Windows.Forms.TableLayoutPanel();
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit();
+ this.kpnlButtons.SuspendLayout();
+ this.tableLayoutPanel2.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).BeginInit();
+ this.kpnlMain.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
+ this.kryptonPanel1.SuspendLayout();
+ this.tableLayoutPanel3.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).BeginInit();
+ this.tableLayoutPanel4.SuspendLayout();
+ this.tlpMain.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // kpnlButtons
+ //
+ this.kpnlButtons.Controls.Add(this.tableLayoutPanel2);
+ this.kpnlButtons.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlButtons.Location = new System.Drawing.Point(0, 327);
+ this.kpnlButtons.Name = "kpnlButtons";
+ this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlButtons.Size = new System.Drawing.Size(614, 50);
+ this.kpnlButtons.TabIndex = 6;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel2.ColumnCount = 4;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.Controls.Add(this.kbtnDismiss, 2, 0);
+ this.tableLayoutPanel2.Controls.Add(this.klblToastLocation, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.kchkDoNotShowAgain, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.itbDismiss, 3, 0);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 1;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(614, 49);
+ this.tableLayoutPanel2.TabIndex = 5;
+ //
+ // kbtnDismiss
+ //
+ this.kbtnDismiss.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnDismiss.AutoSize = true;
+ this.kbtnDismiss.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.kbtnDismiss.Location = new System.Drawing.Point(78, 13);
+ this.kbtnDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnDismiss.Name = "kbtnDismiss";
+ this.kbtnDismiss.Size = new System.Drawing.Size(48, 22);
+ this.kbtnDismiss.TabIndex = 2;
+ this.kbtnDismiss.Values.Text = "{0} ({1})";
+ this.kbtnDismiss.Visible = false;
+ //
+ // klblToastLocation
+ //
+ this.klblToastLocation.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.klblToastLocation.Location = new System.Drawing.Point(533, 23);
+ this.klblToastLocation.Margin = new System.Windows.Forms.Padding(10);
+ this.klblToastLocation.Name = "klblToastLocation";
+ this.klblToastLocation.Size = new System.Drawing.Size(6, 2);
+ this.klblToastLocation.TabIndex = 3;
+ this.klblToastLocation.Values.Text = "";
+ //
+ // kchkDoNotShowAgain
+ //
+ this.kchkDoNotShowAgain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kchkDoNotShowAgain.Location = new System.Drawing.Point(559, 10);
+ this.kchkDoNotShowAgain.Margin = new System.Windows.Forms.Padding(10);
+ this.kchkDoNotShowAgain.Name = "kchkDoNotShowAgain";
+ this.kchkDoNotShowAgain.Size = new System.Drawing.Size(45, 29);
+ this.kchkDoNotShowAgain.TabIndex = 4;
+ this.kchkDoNotShowAgain.Values.Text = "CB1";
+ this.kchkDoNotShowAgain.Visible = false;
+ //
+ // itbDismiss
+ //
+ this.itbDismiss.AutoSize = true;
+ this.itbDismiss.IsActionButton = false;
+ this.itbDismiss.IsDismissButton = true;
+ this.itbDismiss.Location = new System.Drawing.Point(10, 13);
+ this.itbDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.itbDismiss.Name = "itbDismiss";
+ this.itbDismiss.NotificationResult = Krypton.Toolkit.KryptonToastNotificationResult.None;
+ this.itbDismiss.Owner = null;
+ this.itbDismiss.ProcessPath = "";
+ this.itbDismiss.Size = new System.Drawing.Size(48, 22);
+ this.itbDismiss.TabIndex = 5;
+ this.itbDismiss.Values.Text = "{0} ({1})";
+ this.itbDismiss.Click += new System.EventHandler(this.itbDismiss_Click);
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(614, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kpnlMain
+ //
+ this.kpnlMain.Controls.Add(this.kryptonPanel1);
+ this.kpnlMain.Controls.Add(this.tlpMain);
+ this.kpnlMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlMain.Location = new System.Drawing.Point(0, 0);
+ this.kpnlMain.Name = "kpnlMain";
+ this.kpnlMain.Size = new System.Drawing.Size(614, 327);
+ this.kpnlMain.TabIndex = 9;
+ //
+ // kryptonPanel1
+ //
+ this.kryptonPanel1.Controls.Add(this.tableLayoutPanel3);
+ this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonPanel1.Name = "kryptonPanel1";
+ this.kryptonPanel1.Size = new System.Drawing.Size(614, 327);
+ this.kryptonPanel1.TabIndex = 4;
+ //
+ // tableLayoutPanel3
+ //
+ this.tableLayoutPanel3.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel3.ColumnCount = 2;
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel3.Controls.Add(this.pbxNotificationIcon, 0, 0);
+ this.tableLayoutPanel3.Controls.Add(this.tableLayoutPanel4, 1, 0);
+ this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel3.Location = new System.Drawing.Point(0, 0);
+ this.tableLayoutPanel3.Name = "tableLayoutPanel3";
+ this.tableLayoutPanel3.RowCount = 1;
+ this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel3.Size = new System.Drawing.Size(614, 327);
+ this.tableLayoutPanel3.TabIndex = 0;
+ //
+ // pbxNotificationIcon
+ //
+ this.pbxNotificationIcon.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pbxNotificationIcon.Location = new System.Drawing.Point(481, 5);
+ this.pbxNotificationIcon.Margin = new System.Windows.Forms.Padding(5);
+ this.pbxNotificationIcon.Name = "pbxNotificationIcon";
+ this.pbxNotificationIcon.Size = new System.Drawing.Size(128, 317);
+ this.pbxNotificationIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pbxNotificationIcon.TabIndex = 0;
+ this.pbxNotificationIcon.TabStop = false;
+ //
+ // tableLayoutPanel4
+ //
+ this.tableLayoutPanel4.ColumnCount = 1;
+ this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel4.Controls.Add(this.kwlNotificationTitle, 0, 0);
+ this.tableLayoutPanel4.Controls.Add(this.kwlNotificationMessage, 0, 1);
+ this.tableLayoutPanel4.Controls.Add(this.ktxtUserInput, 0, 2);
+ this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel4.Location = new System.Drawing.Point(3, 3);
+ this.tableLayoutPanel4.Name = "tableLayoutPanel4";
+ this.tableLayoutPanel4.RowCount = 3;
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel4.Size = new System.Drawing.Size(470, 321);
+ this.tableLayoutPanel4.TabIndex = 1;
+ //
+ // kwlNotificationTitle
+ //
+ this.kwlNotificationTitle.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationTitle.Font = new System.Drawing.Font("Segoe UI", 13.5F, System.Drawing.FontStyle.Bold);
+ this.kwlNotificationTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationTitle.LabelStyle = Krypton.Toolkit.LabelStyle.TitleControl;
+ this.kwlNotificationTitle.Location = new System.Drawing.Point(3, 0);
+ this.kwlNotificationTitle.Name = "kwlNotificationTitle";
+ this.kwlNotificationTitle.Size = new System.Drawing.Size(464, 25);
+ this.kwlNotificationTitle.Text = "kryptonWrapLabel1";
+ this.kwlNotificationTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // kwlNotificationMessage
+ //
+ this.kwlNotificationMessage.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationMessage.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.kwlNotificationMessage.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationMessage.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.kwlNotificationMessage.Location = new System.Drawing.Point(3, 25);
+ this.kwlNotificationMessage.Name = "kwlNotificationMessage";
+ this.kwlNotificationMessage.Size = new System.Drawing.Size(464, 267);
+ this.kwlNotificationMessage.Text = "kryptonWrapLabel2";
+ this.kwlNotificationMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // ktxtUserInput
+ //
+ this.ktxtUserInput.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.ktxtUserInput.Location = new System.Drawing.Point(3, 295);
+ this.ktxtUserInput.Name = "ktxtUserInput";
+ this.ktxtUserInput.Size = new System.Drawing.Size(464, 23);
+ this.ktxtUserInput.TabIndex = 2;
+ //
+ // tlpMain
+ //
+ this.tlpMain.BackColor = System.Drawing.Color.Transparent;
+ this.tlpMain.ColumnCount = 2;
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Controls.Add(this.tableLayoutPanel1, 1, 0);
+ this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpMain.Location = new System.Drawing.Point(0, 0);
+ this.tlpMain.Name = "tlpMain";
+ this.tlpMain.RowCount = 1;
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Size = new System.Drawing.Size(614, 327);
+ this.tlpMain.TabIndex = 0;
+ //
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.ColumnCount = 1;
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 3);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 3;
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(608, 321);
+ this.tableLayoutPanel1.TabIndex = 1;
+ //
+ // VisualToastNotificationTextBoxUserInputRtlAwareForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(614, 377);
+ this.Controls.Add(this.kpnlMain);
+ this.Controls.Add(this.kpnlButtons);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualToastNotificationTextBoxUserInputRtlAwareForm";
+ this.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.Load += new System.EventHandler(this.VisualToastNotificationTextBoxUserInputRtlAwareForm_Load);
+ this.LocationChanged += new System.EventHandler(this.VisualToastNotificationTextBoxUserInputRtlAwareForm_LocationChanged);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit();
+ this.kpnlButtons.ResumeLayout(false);
+ this.kpnlButtons.PerformLayout();
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).EndInit();
+ this.kpnlMain.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
+ this.kryptonPanel1.ResumeLayout(false);
+ this.tableLayoutPanel3.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).EndInit();
+ this.tableLayoutPanel4.ResumeLayout(false);
+ this.tableLayoutPanel4.PerformLayout();
+ this.tlpMain.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kpnlButtons;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private KryptonPanel kpnlMain;
+ private KryptonPanel kryptonPanel1;
+ private TableLayoutPanel tableLayoutPanel3;
+ private PictureBox pbxNotificationIcon;
+ private TableLayoutPanel tableLayoutPanel4;
+ private KryptonWrapLabel kwlNotificationTitle;
+ private KryptonWrapLabel kwlNotificationMessage;
+ private KryptonTextBox ktxtUserInput;
+ private TableLayoutPanel tlpMain;
+ private TableLayoutPanel tableLayoutPanel1;
+ private TableLayoutPanel tableLayoutPanel2;
+ private KryptonButton kbtnDismiss;
+ private KryptonLabel klblToastLocation;
+ private KryptonCheckBox kchkDoNotShowAgain;
+ private InternalToastButton itbDismiss;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationTextBoxUserInputRtlAwareForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationTextBoxUserInputRtlAwareForm.cs
new file mode 100644
index 000000000..498192ae0
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationTextBoxUserInputRtlAwareForm.cs
@@ -0,0 +1,329 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+using Timer = System.Windows.Forms.Timer;
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualToastNotificationTextBoxUserInputRtlAwareForm : VisualToastNotificationBaseForm
+ {
+ #region Instance Fields
+
+ private int _time;
+
+ private Timer _timer;
+
+ private readonly KryptonUserInputToastNotificationData _data;
+
+ #region Local Data
+
+ private string _notificationContentText;
+
+ private string _notificationTitleText;
+
+ private KryptonToastNotificationIcon _toastNotificationIcon;
+
+ #endregion
+
+ #endregion
+
+ #region Internal
+
+ internal string UserResponse => ktxtUserInput.Text;
+
+ #endregion
+
+ #region Identity
+
+ public VisualToastNotificationTextBoxUserInputRtlAwareForm(KryptonUserInputToastNotificationData data)
+ {
+ InitializeComponent();
+
+ _data = data;
+
+ GotFocus += (sender, args) => ktxtUserInput.Focus();
+
+ Resize += OnResize;
+
+ UpdateBorderColors();
+ }
+
+ #endregion
+
+ #region Implementation
+
+ private void UpdateBorderColors()
+ {
+ StateCommon!.Border.Color1 = _data.BorderColor1 ?? GlobalStaticValues.EMPTY_COLOR;
+
+ StateCommon!.Border.Color2 = _data.BorderColor2 ?? GlobalStaticValues.EMPTY_COLOR;
+ }
+
+ private void LoadData()
+ {
+ _notificationContentText = _data.NotificationContent ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+
+ _notificationTitleText = _data.NotificationTitle ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+
+ _toastNotificationIcon = _data.NotificationIcon ?? KryptonToastNotificationIcon.None;
+ }
+
+ private void UpdateText()
+ {
+ kwlNotificationTitle.Text = _notificationTitleText;
+
+ kwlNotificationMessage.Text = _notificationContentText;
+ }
+
+ private void UpdateCueValues()
+ {
+ // Set cue values
+ ktxtUserInput.CueHint.CueHintText =
+ _data.ToastNotificationCueText ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+
+ ktxtUserInput.CueHint.Color1 = _data.ToastNotificationCueColor ?? Color.Gray;
+ }
+
+ private void SetIcon(Bitmap? image) => pbxNotificationIcon.Image = image;
+
+ private void UpdateLocation()
+ {
+ //Once loaded, position the form, or position it to the bottom left of the screen with added padding
+ Location = _data.NotificationLocation ?? new Point(Screen.PrimaryScreen!.WorkingArea.Width - Width - 5,
+ Screen.PrimaryScreen.WorkingArea.Height - Height - 5);
+ }
+
+ private void UpdateIcon()
+ {
+ switch (_toastNotificationIcon)
+ {
+ case KryptonToastNotificationIcon.None:
+ SetIcon(null);
+ break;
+ case KryptonToastNotificationIcon.Hand:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Hand_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemHand:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Hand.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Question:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Question_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemQuestion:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Question.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Exclamation:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.SystemExclamation:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Exclamation.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Asterisk:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Asterisk_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemAsterisk:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Stop:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Stop_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Error:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Critical_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Warning:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.Information:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Shield:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
+ }
+ else if (OSUtilities.IsWindowsTen)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_10_128_x_128);
+ }
+ else
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128);
+ }
+ break;
+ case KryptonToastNotificationIcon.WindowsLogo:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_11_128_128);
+ }
+ else if (OSUtilities.IsWindowsEight || OSUtilities.IsWindowsEightPointOne || OSUtilities.IsWindowsTen)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_8_81_10_128_128);
+ }
+ else
+ {
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.WinLogo.ToBitmap(), new Size(128, 128)));
+ }
+ break;
+ case KryptonToastNotificationIcon.Application:
+ SetIcon(GraphicsExtensions.ScaleImage(_data.ApplicationIcon.ToBitmap(), new Size(128, 128)));
+ break;
+ case KryptonToastNotificationIcon.SystemApplication:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Ok:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Ok_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Custom:
+ SetIcon(_data.CustomImage != null
+ ? new Bitmap(_data.CustomImage)
+ : null);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+
+ private void ShowCloseButton()
+ {
+ CloseBox = _data.ShowCloseBox ?? false;
+
+ FormBorderStyle = CloseBox ? FormBorderStyle.Fixed3D : FormBorderStyle.FixedSingle;
+
+ ControlBox = _data.ShowCloseBox ?? false;
+ }
+
+ private void itbDismiss_Click(object sender, EventArgs e) => Close();
+
+ private void VisualToastNotificationTextBoxUserInputRtlAwareForm_Load(object sender, EventArgs e)
+ {
+ UpdateIcon();
+
+ UpdateLocation();
+
+ ShowCloseButton();
+
+ _timer.Start();
+ }
+
+ private void VisualToastNotificationTextBoxUserInputRtlAwareForm_LocationChanged(object sender, EventArgs e)
+ {
+
+ }
+
+ private void OnResize(object? sender, EventArgs e)
+ {
+ if (WindowState == FormWindowState.Maximized)
+ {
+ WindowState = FormWindowState.Normal;
+ }
+ }
+
+ public new DialogResult ShowDialog()
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateCueValues();
+
+ UpdateLocation();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ if (_time == _data.CountDownSeconds)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog();
+ }
+
+ public new DialogResult ShowDialog(IWin32Window owner)
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateCueValues();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ itbDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_data.CountDownSeconds - _time})";
+
+ if (_time == _data.CountDownSeconds)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog(owner);
+ }
+
+ internal static string ShowNotification(KryptonUserInputToastNotificationData data)
+ {
+ var owner = data.ToastHost ?? FromHandle(PI.GetActiveWindow());
+
+ using var toast = new VisualToastNotificationTextBoxUserInputRtlAwareForm(data);
+
+ if (owner != null)
+ {
+ toast.StartPosition = owner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
+
+ return toast.ShowDialog(owner!) == DialogResult.OK ? toast.UserResponse : GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+ else
+ {
+ return toast.ShowDialog() == DialogResult.OK ? toast.UserResponse : GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationTextBoxUserInputRtlAwareForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationTextBoxUserInputRtlAwareForm.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/Normal/VisualToastNotificationTextBoxUserInputRtlAwareForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationComboBoxUserInputWithProgressBarRtlAwareForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationComboBoxUserInputWithProgressBarRtlAwareForm.Designer.cs
new file mode 100644
index 000000000..08f8f1496
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationComboBoxUserInputWithProgressBarRtlAwareForm.Designer.cs
@@ -0,0 +1,303 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualToastNotificationComboBoxUserInputWithProgressBarRtlAwareForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.kpnlButtons = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnDismiss = new Krypton.Toolkit.KryptonButton();
+ this.klblToastLocation = new Krypton.Toolkit.KryptonLabel();
+ this.kchkDoNotShowAgain = new Krypton.Toolkit.KryptonCheckBox();
+ this.itbDismiss = new Krypton.Toolkit.InternalToastButton();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kpnlMain = new Krypton.Toolkit.KryptonPanel();
+ this.tlpMain = new System.Windows.Forms.TableLayoutPanel();
+ this.tlpContent = new System.Windows.Forms.TableLayoutPanel();
+ this.kwlNotificationTitle = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kwlNotificationMessage = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kcmbUserInput = new Krypton.Toolkit.KryptonComboBox();
+ this.kpbCountDown = new Krypton.Toolkit.KryptonProgressBar();
+ this.pbxNotificationIcon = new System.Windows.Forms.PictureBox();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit();
+ this.kpnlButtons.SuspendLayout();
+ this.tableLayoutPanel2.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).BeginInit();
+ this.kpnlMain.SuspendLayout();
+ this.tlpMain.SuspendLayout();
+ this.tlpContent.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kcmbUserInput)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).BeginInit();
+ this.SuspendLayout();
+ //
+ // kpnlButtons
+ //
+ this.kpnlButtons.Controls.Add(this.tableLayoutPanel2);
+ this.kpnlButtons.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlButtons.Location = new System.Drawing.Point(0, 373);
+ this.kpnlButtons.Name = "kpnlButtons";
+ this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlButtons.Size = new System.Drawing.Size(634, 50);
+ this.kpnlButtons.TabIndex = 5;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel2.ColumnCount = 4;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.Controls.Add(this.kbtnDismiss, 2, 0);
+ this.tableLayoutPanel2.Controls.Add(this.klblToastLocation, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.kchkDoNotShowAgain, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.itbDismiss, 3, 0);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 1;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(634, 49);
+ this.tableLayoutPanel2.TabIndex = 6;
+ //
+ // kbtnDismiss
+ //
+ this.kbtnDismiss.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnDismiss.AutoSize = true;
+ this.kbtnDismiss.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.kbtnDismiss.Location = new System.Drawing.Point(53, 13);
+ this.kbtnDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnDismiss.Name = "kbtnDismiss";
+ this.kbtnDismiss.Size = new System.Drawing.Size(23, 22);
+ this.kbtnDismiss.TabIndex = 2;
+ this.kbtnDismiss.Values.Text = "{0}";
+ this.kbtnDismiss.Visible = false;
+ //
+ // klblToastLocation
+ //
+ this.klblToastLocation.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.klblToastLocation.Location = new System.Drawing.Point(553, 23);
+ this.klblToastLocation.Margin = new System.Windows.Forms.Padding(10);
+ this.klblToastLocation.Name = "klblToastLocation";
+ this.klblToastLocation.Size = new System.Drawing.Size(6, 2);
+ this.klblToastLocation.TabIndex = 3;
+ this.klblToastLocation.Values.Text = "";
+ //
+ // kchkDoNotShowAgain
+ //
+ this.kchkDoNotShowAgain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kchkDoNotShowAgain.Location = new System.Drawing.Point(579, 10);
+ this.kchkDoNotShowAgain.Margin = new System.Windows.Forms.Padding(10);
+ this.kchkDoNotShowAgain.Name = "kchkDoNotShowAgain";
+ this.kchkDoNotShowAgain.Size = new System.Drawing.Size(45, 29);
+ this.kchkDoNotShowAgain.TabIndex = 4;
+ this.kchkDoNotShowAgain.Values.Text = "CB1";
+ this.kchkDoNotShowAgain.Visible = false;
+ //
+ // itbDismiss
+ //
+ this.itbDismiss.AutoSize = true;
+ this.itbDismiss.IsActionButton = false;
+ this.itbDismiss.IsDismissButton = true;
+ this.itbDismiss.Location = new System.Drawing.Point(10, 13);
+ this.itbDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.itbDismiss.Name = "itbDismiss";
+ this.itbDismiss.NotificationResult = Krypton.Toolkit.KryptonToastNotificationResult.None;
+ this.itbDismiss.Owner = null;
+ this.itbDismiss.ProcessPath = "";
+ this.itbDismiss.Size = new System.Drawing.Size(23, 22);
+ this.itbDismiss.TabIndex = 5;
+ this.itbDismiss.Values.Text = "{0}";
+ this.itbDismiss.Click += new System.EventHandler(this.itbDismiss_Click);
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(634, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kpnlMain
+ //
+ this.kpnlMain.Controls.Add(this.tlpMain);
+ this.kpnlMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlMain.Location = new System.Drawing.Point(0, 0);
+ this.kpnlMain.Name = "kpnlMain";
+ this.kpnlMain.Size = new System.Drawing.Size(634, 373);
+ this.kpnlMain.TabIndex = 6;
+ //
+ // tlpMain
+ //
+ this.tlpMain.BackColor = System.Drawing.Color.Transparent;
+ this.tlpMain.ColumnCount = 2;
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Controls.Add(this.tlpContent, 1, 0);
+ this.tlpMain.Controls.Add(this.kpbCountDown, 0, 1);
+ this.tlpMain.Controls.Add(this.pbxNotificationIcon, 0, 0);
+ this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpMain.Location = new System.Drawing.Point(0, 0);
+ this.tlpMain.Name = "tlpMain";
+ this.tlpMain.RowCount = 2;
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpMain.Size = new System.Drawing.Size(634, 373);
+ this.tlpMain.TabIndex = 0;
+ //
+ // tlpContent
+ //
+ this.tlpContent.ColumnCount = 1;
+ this.tlpContent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpContent.Controls.Add(this.kwlNotificationTitle, 0, 0);
+ this.tlpContent.Controls.Add(this.kwlNotificationMessage, 0, 1);
+ this.tlpContent.Controls.Add(this.kcmbUserInput, 0, 2);
+ this.tlpContent.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpContent.Location = new System.Drawing.Point(3, 3);
+ this.tlpContent.Name = "tlpContent";
+ this.tlpContent.RowCount = 3;
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpContent.Size = new System.Drawing.Size(490, 335);
+ this.tlpContent.TabIndex = 6;
+ //
+ // kwlNotificationTitle
+ //
+ this.kwlNotificationTitle.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationTitle.Font = new System.Drawing.Font("Segoe UI", 13.5F, System.Drawing.FontStyle.Bold);
+ this.kwlNotificationTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationTitle.LabelStyle = Krypton.Toolkit.LabelStyle.TitleControl;
+ this.kwlNotificationTitle.Location = new System.Drawing.Point(3, 0);
+ this.kwlNotificationTitle.Name = "kwlNotificationTitle";
+ this.kwlNotificationTitle.Size = new System.Drawing.Size(484, 25);
+ this.kwlNotificationTitle.Text = "kryptonWrapLabel1";
+ this.kwlNotificationTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // kwlNotificationMessage
+ //
+ this.kwlNotificationMessage.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationMessage.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.kwlNotificationMessage.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationMessage.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.kwlNotificationMessage.Location = new System.Drawing.Point(3, 25);
+ this.kwlNotificationMessage.Name = "kwlNotificationMessage";
+ this.kwlNotificationMessage.Size = new System.Drawing.Size(484, 283);
+ this.kwlNotificationMessage.Text = "kryptonWrapLabel2";
+ this.kwlNotificationMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // kcmbUserInput
+ //
+ this.kcmbUserInput.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kcmbUserInput.DropDownWidth = 484;
+ this.kcmbUserInput.IntegralHeight = false;
+ this.kcmbUserInput.Location = new System.Drawing.Point(3, 311);
+ this.kcmbUserInput.Name = "kcmbUserInput";
+ this.kcmbUserInput.Size = new System.Drawing.Size(484, 21);
+ this.kcmbUserInput.StateCommon.ComboBox.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near;
+ this.kcmbUserInput.TabIndex = 3;
+ this.kcmbUserInput.Text = "kryptonComboBox1";
+ //
+ // kpbCountDown
+ //
+ this.tlpMain.SetColumnSpan(this.kpbCountDown, 2);
+ this.kpbCountDown.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpbCountDown.Location = new System.Drawing.Point(3, 344);
+ this.kpbCountDown.Name = "kpbCountDown";
+ this.kpbCountDown.Size = new System.Drawing.Size(628, 26);
+ this.kpbCountDown.StateCommon.Back.Color1 = System.Drawing.Color.Green;
+ this.kpbCountDown.StateDisabled.Back.ColorStyle = Krypton.Toolkit.PaletteColorStyle.OneNote;
+ this.kpbCountDown.StateNormal.Back.ColorStyle = Krypton.Toolkit.PaletteColorStyle.OneNote;
+ this.kpbCountDown.TabIndex = 5;
+ this.kpbCountDown.Text = "kryptonProgressBar1";
+ this.kpbCountDown.Values.Text = "kryptonProgressBar1";
+ //
+ // pbxNotificationIcon
+ //
+ this.pbxNotificationIcon.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pbxNotificationIcon.Location = new System.Drawing.Point(501, 5);
+ this.pbxNotificationIcon.Margin = new System.Windows.Forms.Padding(5);
+ this.pbxNotificationIcon.Name = "pbxNotificationIcon";
+ this.pbxNotificationIcon.Size = new System.Drawing.Size(128, 331);
+ this.pbxNotificationIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pbxNotificationIcon.TabIndex = 0;
+ this.pbxNotificationIcon.TabStop = false;
+ //
+ // VisualToastNotificationComboBoxUserInputWithProgressBarRtlAwareForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(634, 423);
+ this.Controls.Add(this.kpnlMain);
+ this.Controls.Add(this.kpnlButtons);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualToastNotificationComboBoxUserInputWithProgressBarRtlAwareForm";
+ this.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.Load += new System.EventHandler(this.VisualToastNotificationComboBoxUserInputWithProgressBarRtlAwareForm_Load);
+ this.LocationChanged += new System.EventHandler(this.VisualToastNotificationComboBoxUserInputWithProgressBarRtlAwareForm_LocationChanged);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit();
+ this.kpnlButtons.ResumeLayout(false);
+ this.kpnlButtons.PerformLayout();
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).EndInit();
+ this.kpnlMain.ResumeLayout(false);
+ this.tlpMain.ResumeLayout(false);
+ this.tlpContent.ResumeLayout(false);
+ this.tlpContent.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kcmbUserInput)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kpnlButtons;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private KryptonPanel kpnlMain;
+ private TableLayoutPanel tlpMain;
+ private TableLayoutPanel tlpContent;
+ private KryptonWrapLabel kwlNotificationTitle;
+ private KryptonWrapLabel kwlNotificationMessage;
+ private KryptonComboBox kcmbUserInput;
+ private KryptonProgressBar kpbCountDown;
+ private PictureBox pbxNotificationIcon;
+ private TableLayoutPanel tableLayoutPanel2;
+ private KryptonButton kbtnDismiss;
+ private KryptonLabel klblToastLocation;
+ private KryptonCheckBox kchkDoNotShowAgain;
+ private InternalToastButton itbDismiss;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationComboBoxUserInputWithProgressBarRtlAwareForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationComboBoxUserInputWithProgressBarRtlAwareForm.cs
new file mode 100644
index 000000000..91e2af080
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationComboBoxUserInputWithProgressBarRtlAwareForm.cs
@@ -0,0 +1,329 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+using Timer = System.Windows.Forms.Timer;
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualToastNotificationComboBoxUserInputWithProgressBarRtlAwareForm : VisualToastNotificationBaseForm
+ {
+ #region Instance Fields
+
+ private int _time;
+
+ private Timer _timer;
+
+ private readonly KryptonUserInputToastNotificationData _data;
+
+ #endregion
+
+ #region Internal
+
+ internal string UserResponse => kcmbUserInput.Text ?? string.Empty;
+
+ #endregion
+
+ #region Identity
+
+ public VisualToastNotificationComboBoxUserInputWithProgressBarRtlAwareForm(KryptonUserInputToastNotificationData data)
+ {
+ InitializeComponent();
+
+ _data = data;
+
+ GotFocus += (sender, args) => kcmbUserInput.Focus();
+
+ Resize += VisualToastNotificationComboBoxUserInputWithProgressBarRtlAwareForm_Resize;
+
+ UpdateBorderColors();
+ }
+
+ #endregion
+
+ #region Implementation
+
+ private void UpdateBorderColors()
+ {
+ StateCommon!.Border.Color1 = _data.BorderColor1 ?? GlobalStaticValues.EMPTY_COLOR;
+
+ StateCommon!.Border.Color2 = _data.BorderColor2 ?? GlobalStaticValues.EMPTY_COLOR;
+ }
+
+ private void UpdateText()
+ {
+ kwlNotificationTitle.Text = _data.NotificationTitle ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+
+ kwlNotificationMessage.Text = _data.NotificationContent ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+
+ private void UpdateComboBoxItems()
+ {
+ if (_data.UserInputList.Count > 0)
+ {
+ foreach (var item in _data.UserInputList)
+ {
+ kcmbUserInput.Items.Add(item);
+ }
+
+ kcmbUserInput.SelectedIndex = _data.SelectedIndex ?? 1;
+ }
+
+ kcmbUserInput.DropDownStyle = _data.UserInputComboBoxStyle ?? ComboBoxStyle.DropDown;
+ }
+
+ private void SetIcon(Bitmap? image) => pbxNotificationIcon.Image = image;
+
+ private void UpdateLocation()
+ {
+ //Once loaded, position the form, or position it to the bottom left of the screen with added padding
+ Location = _data.NotificationLocation ?? new Point(Screen.PrimaryScreen!.WorkingArea.Width - Width - 5,
+ Screen.PrimaryScreen.WorkingArea.Height - Height - 5);
+ }
+
+ private void UpdateIcon()
+ {
+ switch (_data.NotificationIcon)
+ {
+ case KryptonToastNotificationIcon.None:
+ SetIcon(null);
+ break;
+ case KryptonToastNotificationIcon.Hand:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Hand_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemHand:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Hand.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Question:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Question_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemQuestion:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Question.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Exclamation:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.SystemExclamation:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Exclamation.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Asterisk:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Asterisk_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemAsterisk:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Stop:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Stop_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Error:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Critical_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Warning:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.Information:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Shield:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
+ }
+ else if (OSUtilities.IsWindowsTen)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_10_128_x_128);
+ }
+ else
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128);
+ }
+ break;
+ case KryptonToastNotificationIcon.WindowsLogo:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_11_128_128);
+ }
+ else if (OSUtilities.IsWindowsEight || OSUtilities.IsWindowsEightPointOne || OSUtilities.IsWindowsTen)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_8_81_10_128_128);
+ }
+ else
+ {
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.WinLogo.ToBitmap(), new Size(128, 128)));
+ }
+ break;
+ case KryptonToastNotificationIcon.Application:
+ SetIcon(GraphicsExtensions.ScaleImage(_data.ApplicationIcon.ToBitmap(), new Size(128, 128)));
+ break;
+ case KryptonToastNotificationIcon.SystemApplication:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Ok:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Ok_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Custom:
+ SetIcon(_data.CustomImage != null
+ ? new Bitmap(_data.CustomImage)
+ : null);
+ break;
+ case null:
+ SetIcon(null);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+
+ private void ShowCloseButton()
+ {
+ CloseBox = _data.ShowCloseBox ?? false;
+
+ FormBorderStyle = CloseBox ? FormBorderStyle.Fixed3D : FormBorderStyle.FixedSingle;
+
+ ControlBox = _data.ShowCloseBox ?? false;
+ }
+
+ private void itbDismiss_Click(object sender, EventArgs e) => Close();
+
+ private void VisualToastNotificationComboBoxUserInputWithProgressBarRtlAwareForm_Load(object sender, EventArgs e)
+ {
+ UpdateIcon();
+
+ UpdateLocation();
+
+ ShowCloseButton();
+
+ kbtnDismiss.Text = KryptonManager.Strings.ToastNotificationStrings.Dismiss;
+
+ itbDismiss.Text = KryptonManager.Strings.ToastNotificationStrings.Dismiss;
+
+ _timer.Start();
+
+ _data.DisplayDebugData(_data);
+ }
+
+ private void VisualToastNotificationComboBoxUserInputWithProgressBarRtlAwareForm_LocationChanged(object sender, EventArgs e)
+ {
+
+ }
+
+ private void VisualToastNotificationComboBoxUserInputWithProgressBarRtlAwareForm_Resize(object? sender, EventArgs e)
+ {
+ if (WindowState == FormWindowState.Maximized)
+ {
+ WindowState = FormWindowState.Normal;
+ }
+ }
+
+ public new DialogResult ShowDialog()
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateComboBoxItems();
+
+ UpdateLocation();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kpbCountDown.Maximum = _data.CountDownSeconds ?? 100;
+
+ kpbCountDown.Value = kpbCountDown.Maximum;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kpbCountDown.Value -= 1;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ if (kpbCountDown.Value == kpbCountDown.Minimum)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog();
+ }
+
+ public new DialogResult ShowDialog(IWin32Window owner)
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateComboBoxItems();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kpbCountDown.Maximum = _data.CountDownSeconds ?? 100;
+
+ kpbCountDown.Value = kpbCountDown.Maximum;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kpbCountDown.Value -= 1;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ if (kpbCountDown.Value == kpbCountDown.Minimum)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog(owner);
+ }
+
+ internal static string ShowNotification(KryptonUserInputToastNotificationData data)
+ {
+ var owner = data.ToastHost ?? FromHandle(PI.GetActiveWindow());
+
+ using var toast = new VisualToastNotificationComboBoxUserInputWithProgressBarRtlAwareForm(data);
+
+ if (owner != null)
+ {
+ toast.StartPosition = owner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
+
+ return toast.ShowDialog(owner!) == DialogResult.OK ? toast.UserResponse : string.Empty;
+ }
+ else
+ {
+ return toast.ShowDialog() == DialogResult.OK ? toast.UserResponse : string.Empty;
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationComboBoxUserInputWithProgressBarRtlAwareForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationComboBoxUserInputWithProgressBarRtlAwareForm.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationComboBoxUserInputWithProgressBarRtlAwareForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationDateTimeUserInputWithProgressBarRtlAwareForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationDateTimeUserInputWithProgressBarRtlAwareForm.Designer.cs
new file mode 100644
index 000000000..38a174bab
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationDateTimeUserInputWithProgressBarRtlAwareForm.Designer.cs
@@ -0,0 +1,297 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualToastNotificationDateTimeUserInputWithProgressBarRtlAwareForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.kpnlButtons = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnDismiss = new Krypton.Toolkit.KryptonButton();
+ this.klblToastLocation = new Krypton.Toolkit.KryptonLabel();
+ this.kchkDoNotShowAgain = new Krypton.Toolkit.KryptonCheckBox();
+ this.itbDismiss = new Krypton.Toolkit.InternalToastButton();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kpnlMain = new Krypton.Toolkit.KryptonPanel();
+ this.tlpMain = new System.Windows.Forms.TableLayoutPanel();
+ this.tlpContent = new System.Windows.Forms.TableLayoutPanel();
+ this.kwlNotificationTitle = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kwlNotificationMessage = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kdtpUserInput = new Krypton.Toolkit.KryptonDateTimePicker();
+ this.kpbCountDown = new Krypton.Toolkit.KryptonProgressBar();
+ this.pbxNotificationIcon = new System.Windows.Forms.PictureBox();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit();
+ this.kpnlButtons.SuspendLayout();
+ this.tableLayoutPanel2.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).BeginInit();
+ this.kpnlMain.SuspendLayout();
+ this.tlpMain.SuspendLayout();
+ this.tlpContent.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).BeginInit();
+ this.SuspendLayout();
+ //
+ // kpnlButtons
+ //
+ this.kpnlButtons.Controls.Add(this.tableLayoutPanel2);
+ this.kpnlButtons.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlButtons.Location = new System.Drawing.Point(0, 369);
+ this.kpnlButtons.Name = "kpnlButtons";
+ this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlButtons.Size = new System.Drawing.Size(630, 50);
+ this.kpnlButtons.TabIndex = 6;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel2.ColumnCount = 4;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.Controls.Add(this.kbtnDismiss, 2, 0);
+ this.tableLayoutPanel2.Controls.Add(this.klblToastLocation, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.kchkDoNotShowAgain, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.itbDismiss, 3, 0);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 1;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(630, 49);
+ this.tableLayoutPanel2.TabIndex = 6;
+ //
+ // kbtnDismiss
+ //
+ this.kbtnDismiss.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnDismiss.AutoSize = true;
+ this.kbtnDismiss.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.kbtnDismiss.Location = new System.Drawing.Point(53, 13);
+ this.kbtnDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnDismiss.Name = "kbtnDismiss";
+ this.kbtnDismiss.Size = new System.Drawing.Size(23, 22);
+ this.kbtnDismiss.TabIndex = 2;
+ this.kbtnDismiss.Values.Text = "{0}";
+ this.kbtnDismiss.Visible = false;
+ //
+ // klblToastLocation
+ //
+ this.klblToastLocation.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.klblToastLocation.Location = new System.Drawing.Point(549, 23);
+ this.klblToastLocation.Margin = new System.Windows.Forms.Padding(10);
+ this.klblToastLocation.Name = "klblToastLocation";
+ this.klblToastLocation.Size = new System.Drawing.Size(6, 2);
+ this.klblToastLocation.TabIndex = 3;
+ this.klblToastLocation.Values.Text = "";
+ //
+ // kchkDoNotShowAgain
+ //
+ this.kchkDoNotShowAgain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kchkDoNotShowAgain.Location = new System.Drawing.Point(575, 10);
+ this.kchkDoNotShowAgain.Margin = new System.Windows.Forms.Padding(10);
+ this.kchkDoNotShowAgain.Name = "kchkDoNotShowAgain";
+ this.kchkDoNotShowAgain.Size = new System.Drawing.Size(45, 29);
+ this.kchkDoNotShowAgain.TabIndex = 4;
+ this.kchkDoNotShowAgain.Values.Text = "CB1";
+ this.kchkDoNotShowAgain.Visible = false;
+ //
+ // itbDismiss
+ //
+ this.itbDismiss.AutoSize = true;
+ this.itbDismiss.IsActionButton = false;
+ this.itbDismiss.IsDismissButton = true;
+ this.itbDismiss.Location = new System.Drawing.Point(10, 13);
+ this.itbDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.itbDismiss.Name = "itbDismiss";
+ this.itbDismiss.NotificationResult = Krypton.Toolkit.KryptonToastNotificationResult.None;
+ this.itbDismiss.Owner = null;
+ this.itbDismiss.ProcessPath = "";
+ this.itbDismiss.Size = new System.Drawing.Size(23, 22);
+ this.itbDismiss.TabIndex = 5;
+ this.itbDismiss.Values.Text = "{0}";
+ this.itbDismiss.Click += new System.EventHandler(this.itbDismiss_Click);
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(630, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kpnlMain
+ //
+ this.kpnlMain.Controls.Add(this.tlpMain);
+ this.kpnlMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlMain.Location = new System.Drawing.Point(0, 0);
+ this.kpnlMain.Name = "kpnlMain";
+ this.kpnlMain.Size = new System.Drawing.Size(630, 369);
+ this.kpnlMain.TabIndex = 7;
+ //
+ // tlpMain
+ //
+ this.tlpMain.BackColor = System.Drawing.Color.Transparent;
+ this.tlpMain.ColumnCount = 2;
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Controls.Add(this.tlpContent, 1, 0);
+ this.tlpMain.Controls.Add(this.kpbCountDown, 0, 1);
+ this.tlpMain.Controls.Add(this.pbxNotificationIcon, 0, 0);
+ this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpMain.Location = new System.Drawing.Point(0, 0);
+ this.tlpMain.Name = "tlpMain";
+ this.tlpMain.RowCount = 2;
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpMain.Size = new System.Drawing.Size(630, 369);
+ this.tlpMain.TabIndex = 0;
+ //
+ // tlpContent
+ //
+ this.tlpContent.ColumnCount = 1;
+ this.tlpContent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpContent.Controls.Add(this.kwlNotificationTitle, 0, 0);
+ this.tlpContent.Controls.Add(this.kwlNotificationMessage, 0, 1);
+ this.tlpContent.Controls.Add(this.kdtpUserInput, 0, 2);
+ this.tlpContent.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpContent.Location = new System.Drawing.Point(3, 3);
+ this.tlpContent.Name = "tlpContent";
+ this.tlpContent.RowCount = 3;
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpContent.Size = new System.Drawing.Size(486, 331);
+ this.tlpContent.TabIndex = 6;
+ //
+ // kwlNotificationTitle
+ //
+ this.kwlNotificationTitle.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationTitle.Font = new System.Drawing.Font("Segoe UI", 13.5F, System.Drawing.FontStyle.Bold);
+ this.kwlNotificationTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationTitle.LabelStyle = Krypton.Toolkit.LabelStyle.TitleControl;
+ this.kwlNotificationTitle.Location = new System.Drawing.Point(3, 0);
+ this.kwlNotificationTitle.Name = "kwlNotificationTitle";
+ this.kwlNotificationTitle.Size = new System.Drawing.Size(480, 25);
+ this.kwlNotificationTitle.Text = "kryptonWrapLabel1";
+ this.kwlNotificationTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // kwlNotificationMessage
+ //
+ this.kwlNotificationMessage.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationMessage.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.kwlNotificationMessage.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationMessage.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.kwlNotificationMessage.Location = new System.Drawing.Point(3, 25);
+ this.kwlNotificationMessage.Name = "kwlNotificationMessage";
+ this.kwlNotificationMessage.Size = new System.Drawing.Size(480, 279);
+ this.kwlNotificationMessage.Text = "kryptonWrapLabel2";
+ this.kwlNotificationMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // kdtpUserInput
+ //
+ this.kdtpUserInput.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kdtpUserInput.Location = new System.Drawing.Point(3, 307);
+ this.kdtpUserInput.Name = "kdtpUserInput";
+ this.kdtpUserInput.Size = new System.Drawing.Size(480, 21);
+ this.kdtpUserInput.TabIndex = 2;
+ //
+ // kpbCountDown
+ //
+ this.tlpMain.SetColumnSpan(this.kpbCountDown, 2);
+ this.kpbCountDown.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpbCountDown.Location = new System.Drawing.Point(3, 340);
+ this.kpbCountDown.Name = "kpbCountDown";
+ this.kpbCountDown.Size = new System.Drawing.Size(624, 26);
+ this.kpbCountDown.StateCommon.Back.Color1 = System.Drawing.Color.Green;
+ this.kpbCountDown.StateDisabled.Back.ColorStyle = Krypton.Toolkit.PaletteColorStyle.OneNote;
+ this.kpbCountDown.StateNormal.Back.ColorStyle = Krypton.Toolkit.PaletteColorStyle.OneNote;
+ this.kpbCountDown.TabIndex = 5;
+ this.kpbCountDown.Text = "kryptonProgressBar1";
+ this.kpbCountDown.Values.Text = "kryptonProgressBar1";
+ //
+ // pbxNotificationIcon
+ //
+ this.pbxNotificationIcon.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pbxNotificationIcon.Location = new System.Drawing.Point(497, 5);
+ this.pbxNotificationIcon.Margin = new System.Windows.Forms.Padding(5);
+ this.pbxNotificationIcon.Name = "pbxNotificationIcon";
+ this.pbxNotificationIcon.Size = new System.Drawing.Size(128, 327);
+ this.pbxNotificationIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pbxNotificationIcon.TabIndex = 0;
+ this.pbxNotificationIcon.TabStop = false;
+ //
+ // VisualToastNotificationDateTimeUserInputWithProgressBarRtlAwareForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(630, 419);
+ this.Controls.Add(this.kpnlMain);
+ this.Controls.Add(this.kpnlButtons);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualToastNotificationDateTimeUserInputWithProgressBarRtlAwareForm";
+ this.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.Load += new System.EventHandler(this.VisualToastNotificationDateTimeUserInputWithProgressBarRtlAwareForm_Load);
+ this.LocationChanged += new System.EventHandler(this.VisualToastNotificationDateTimeUserInputWithProgressBarRtlAwareForm_LocationChanged);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit();
+ this.kpnlButtons.ResumeLayout(false);
+ this.kpnlButtons.PerformLayout();
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).EndInit();
+ this.kpnlMain.ResumeLayout(false);
+ this.tlpMain.ResumeLayout(false);
+ this.tlpContent.ResumeLayout(false);
+ this.tlpContent.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kpnlButtons;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private KryptonPanel kpnlMain;
+ private TableLayoutPanel tlpMain;
+ private TableLayoutPanel tlpContent;
+ private KryptonWrapLabel kwlNotificationTitle;
+ private KryptonWrapLabel kwlNotificationMessage;
+ private KryptonDateTimePicker kdtpUserInput;
+ private KryptonProgressBar kpbCountDown;
+ private PictureBox pbxNotificationIcon;
+ private TableLayoutPanel tableLayoutPanel2;
+ private KryptonButton kbtnDismiss;
+ private KryptonLabel klblToastLocation;
+ private KryptonCheckBox kchkDoNotShowAgain;
+ private InternalToastButton itbDismiss;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationDateTimeUserInputWithProgressBarRtlAwareForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationDateTimeUserInputWithProgressBarRtlAwareForm.cs
new file mode 100644
index 000000000..5243e19ff
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationDateTimeUserInputWithProgressBarRtlAwareForm.cs
@@ -0,0 +1,323 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+using Timer = System.Windows.Forms.Timer;
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualToastNotificationDateTimeUserInputWithProgressBarRtlAwareForm : VisualToastNotificationBaseForm
+ {
+ #region Instance Fields
+
+ private int _time;
+
+ private Timer _timer;
+
+ private readonly KryptonUserInputToastNotificationData _data;
+
+ #endregion
+
+ #region Internal
+
+ internal DateTime UserResponse => kdtpUserInput.Value;
+
+ #endregion
+
+ #region Identity
+
+ public VisualToastNotificationDateTimeUserInputWithProgressBarRtlAwareForm(KryptonUserInputToastNotificationData data)
+ {
+ InitializeComponent();
+
+ _data = data;
+
+ GotFocus += (sender, args) => kdtpUserInput.Focus();
+
+ Resize += VisualToastNotificationDateTimeUserInputWithProgressBarRtlAwareForm_Resize;
+
+ UpdateBorderColors();
+ }
+
+ #endregion
+
+ #region Implementation
+
+ private void UpdateBorderColors()
+ {
+ StateCommon!.Border.Color1 = _data.BorderColor1 ?? GlobalStaticValues.EMPTY_COLOR;
+
+ StateCommon!.Border.Color2 = _data.BorderColor2 ?? GlobalStaticValues.EMPTY_COLOR;
+ }
+
+ private void UpdateText()
+ {
+ kwlNotificationTitle.Text = _data.NotificationTitle ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+
+ kwlNotificationMessage.Text = _data.NotificationContent ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+
+ private void UpdateInitialValues()
+ {
+ // Set initial date and time values
+ kdtpUserInput.Value = _data.InitialDateTimeValue ?? GlobalStaticValues.DEFAULT_DATE_TIME_VALUE;
+
+ kdtpUserInput.Format = _data.DateTimeFormat ?? DateTimePickerFormat.Long;
+
+ kdtpUserInput.CustomFormat = _data.CustomDateTimeFormat ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+
+ kdtpUserInput.MaxDate = _data.MaximumDateTimeValue ?? DateTime.MaxValue;
+
+ kdtpUserInput.MinDate = _data.MinimumDateTimeValue ?? DateTime.MinValue;
+ }
+
+ private void SetIcon(Bitmap? image) => pbxNotificationIcon.Image = image;
+
+ private void UpdateLocation()
+ {
+ //Once loaded, position the form, or position it to the bottom left of the screen with added padding
+ Location = _data.NotificationLocation ?? new Point(Screen.PrimaryScreen!.WorkingArea.Width - Width - 5,
+ Screen.PrimaryScreen.WorkingArea.Height - Height - 5);
+ }
+
+ private void UpdateIcon()
+ {
+ switch (_data.NotificationIcon)
+ {
+ case KryptonToastNotificationIcon.None:
+ SetIcon(null);
+ break;
+ case KryptonToastNotificationIcon.Hand:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Hand_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemHand:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Hand.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Question:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Question_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemQuestion:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Question.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Exclamation:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.SystemExclamation:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Exclamation.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Asterisk:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Asterisk_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemAsterisk:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Stop:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Stop_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Error:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Critical_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Warning:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.Information:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Shield:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
+ }
+ else if (OSUtilities.IsWindowsTen)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_10_128_x_128);
+ }
+ else
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128);
+ }
+ break;
+ case KryptonToastNotificationIcon.WindowsLogo:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_11_128_128);
+ }
+ else if (OSUtilities.IsWindowsEight || OSUtilities.IsWindowsEightPointOne || OSUtilities.IsWindowsTen)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_8_81_10_128_128);
+ }
+ else
+ {
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.WinLogo.ToBitmap(), new Size(128, 128)));
+ }
+ break;
+ case KryptonToastNotificationIcon.Application:
+ SetIcon(GraphicsExtensions.ScaleImage(_data.ApplicationIcon.ToBitmap(), new Size(128, 128)));
+ break;
+ case KryptonToastNotificationIcon.SystemApplication:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Ok:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Ok_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Custom:
+ SetIcon(_data.CustomImage != null
+ ? new Bitmap(_data.CustomImage)
+ : null);
+ break;
+ case null:
+ SetIcon(null);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+
+ private void ShowCloseButton()
+ {
+ CloseBox = _data.ShowCloseBox ?? false;
+
+ FormBorderStyle = CloseBox ? FormBorderStyle.Fixed3D : FormBorderStyle.FixedSingle;
+
+ ControlBox = _data.ShowCloseBox ?? false;
+ }
+
+ private void itbDismiss_Click(object sender, EventArgs e) => Close();
+
+ private void VisualToastNotificationDateTimeUserInputWithProgressBarRtlAwareForm_Resize(object? sender, EventArgs e)
+ {
+ if (WindowState == FormWindowState.Maximized)
+ {
+ WindowState = FormWindowState.Normal;
+ }
+ }
+
+ private void VisualToastNotificationDateTimeUserInputWithProgressBarRtlAwareForm_Load(object sender, EventArgs e)
+ {
+ UpdateIcon();
+
+ UpdateLocation();
+
+ ShowCloseButton();
+
+ kbtnDismiss.Text = KryptonManager.Strings.ToastNotificationStrings.Dismiss;
+
+ itbDismiss.Text = KryptonManager.Strings.ToastNotificationStrings.Dismiss;
+
+ _timer.Start();
+ }
+
+ private void VisualToastNotificationDateTimeUserInputWithProgressBarRtlAwareForm_LocationChanged(object sender, EventArgs e) => UpdateLocation();
+
+ public new DialogResult ShowDialog()
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ UpdateLocation();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kpbCountDown.Maximum = _data.CountDownSeconds ?? 100;
+
+ kpbCountDown.Value = kpbCountDown.Maximum;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kpbCountDown.Value -= 1;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ if (kpbCountDown.Value == kpbCountDown.Minimum)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog();
+ }
+
+ public new DialogResult ShowDialog(IWin32Window owner)
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kpbCountDown.Maximum = _data.CountDownSeconds ?? 100;
+
+ kpbCountDown.Value = kpbCountDown.Maximum;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kpbCountDown.Value -= 1;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ if (kpbCountDown.Value == kpbCountDown.Minimum)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog(owner);
+ }
+
+ internal static DateTime ShowNotification(KryptonUserInputToastNotificationData data)
+ {
+ var owner = data.ToastHost ?? FromHandle(PI.GetActiveWindow());
+
+ using var toast = new VisualToastNotificationDateTimeUserInputWithProgressBarRtlAwareForm(data);
+
+ if (owner != null)
+ {
+ toast.StartPosition = owner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
+
+ return toast.ShowDialog(owner!) == DialogResult.OK ? toast.UserResponse : GlobalStaticValues.DEFAULT_DATE_TIME_VALUE;
+ }
+ else
+ {
+ return toast.ShowDialog() == DialogResult.OK ? toast.UserResponse : GlobalStaticValues.DEFAULT_DATE_TIME_VALUE;
+ }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationDateTimeUserInputWithProgressBarRtlAwareForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationDateTimeUserInputWithProgressBarRtlAwareForm.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationDateTimeUserInputWithProgressBarRtlAwareForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationDomainUpDownInputWithProgressBarRtlAwareForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationDomainUpDownInputWithProgressBarRtlAwareForm.Designer.cs
new file mode 100644
index 000000000..e57b1e301
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationDomainUpDownInputWithProgressBarRtlAwareForm.Designer.cs
@@ -0,0 +1,297 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualToastNotificationDomainUpDownInputWithProgressBarRtlAwareForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.kpnlButtons = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnDismiss = new Krypton.Toolkit.KryptonButton();
+ this.klblToastLocation = new Krypton.Toolkit.KryptonLabel();
+ this.kchkDoNotShowAgain = new Krypton.Toolkit.KryptonCheckBox();
+ this.itbDismiss = new Krypton.Toolkit.InternalToastButton();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kpnlMain = new Krypton.Toolkit.KryptonPanel();
+ this.tlpMain = new System.Windows.Forms.TableLayoutPanel();
+ this.tlpContent = new System.Windows.Forms.TableLayoutPanel();
+ this.kwlNotificationTitle = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kwlNotificationMessage = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kdudUserInput = new Krypton.Toolkit.KryptonDomainUpDown();
+ this.kpbCountDown = new Krypton.Toolkit.KryptonProgressBar();
+ this.pbxNotificationIcon = new System.Windows.Forms.PictureBox();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit();
+ this.kpnlButtons.SuspendLayout();
+ this.tableLayoutPanel2.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).BeginInit();
+ this.kpnlMain.SuspendLayout();
+ this.tlpMain.SuspendLayout();
+ this.tlpContent.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).BeginInit();
+ this.SuspendLayout();
+ //
+ // kpnlButtons
+ //
+ this.kpnlButtons.Controls.Add(this.tableLayoutPanel2);
+ this.kpnlButtons.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlButtons.Location = new System.Drawing.Point(0, 369);
+ this.kpnlButtons.Name = "kpnlButtons";
+ this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlButtons.Size = new System.Drawing.Size(630, 50);
+ this.kpnlButtons.TabIndex = 7;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel2.ColumnCount = 4;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.Controls.Add(this.kbtnDismiss, 2, 0);
+ this.tableLayoutPanel2.Controls.Add(this.klblToastLocation, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.kchkDoNotShowAgain, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.itbDismiss, 3, 0);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 1;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(630, 49);
+ this.tableLayoutPanel2.TabIndex = 6;
+ //
+ // kbtnDismiss
+ //
+ this.kbtnDismiss.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnDismiss.AutoSize = true;
+ this.kbtnDismiss.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.kbtnDismiss.Location = new System.Drawing.Point(53, 13);
+ this.kbtnDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnDismiss.Name = "kbtnDismiss";
+ this.kbtnDismiss.Size = new System.Drawing.Size(23, 22);
+ this.kbtnDismiss.TabIndex = 2;
+ this.kbtnDismiss.Values.Text = "{0}";
+ this.kbtnDismiss.Visible = false;
+ //
+ // klblToastLocation
+ //
+ this.klblToastLocation.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.klblToastLocation.Location = new System.Drawing.Point(549, 23);
+ this.klblToastLocation.Margin = new System.Windows.Forms.Padding(10);
+ this.klblToastLocation.Name = "klblToastLocation";
+ this.klblToastLocation.Size = new System.Drawing.Size(6, 2);
+ this.klblToastLocation.TabIndex = 3;
+ this.klblToastLocation.Values.Text = "";
+ //
+ // kchkDoNotShowAgain
+ //
+ this.kchkDoNotShowAgain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kchkDoNotShowAgain.Location = new System.Drawing.Point(575, 10);
+ this.kchkDoNotShowAgain.Margin = new System.Windows.Forms.Padding(10);
+ this.kchkDoNotShowAgain.Name = "kchkDoNotShowAgain";
+ this.kchkDoNotShowAgain.Size = new System.Drawing.Size(45, 29);
+ this.kchkDoNotShowAgain.TabIndex = 4;
+ this.kchkDoNotShowAgain.Values.Text = "CB1";
+ this.kchkDoNotShowAgain.Visible = false;
+ //
+ // itbDismiss
+ //
+ this.itbDismiss.AutoSize = true;
+ this.itbDismiss.IsActionButton = false;
+ this.itbDismiss.IsDismissButton = true;
+ this.itbDismiss.Location = new System.Drawing.Point(10, 13);
+ this.itbDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.itbDismiss.Name = "itbDismiss";
+ this.itbDismiss.NotificationResult = Krypton.Toolkit.KryptonToastNotificationResult.None;
+ this.itbDismiss.Owner = null;
+ this.itbDismiss.ProcessPath = "";
+ this.itbDismiss.Size = new System.Drawing.Size(23, 22);
+ this.itbDismiss.TabIndex = 5;
+ this.itbDismiss.Values.Text = "{0}";
+ this.itbDismiss.Click += new System.EventHandler(this.itbDismiss_Click);
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(630, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kpnlMain
+ //
+ this.kpnlMain.Controls.Add(this.tlpMain);
+ this.kpnlMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlMain.Location = new System.Drawing.Point(0, 0);
+ this.kpnlMain.Name = "kpnlMain";
+ this.kpnlMain.Size = new System.Drawing.Size(630, 369);
+ this.kpnlMain.TabIndex = 8;
+ //
+ // tlpMain
+ //
+ this.tlpMain.BackColor = System.Drawing.Color.Transparent;
+ this.tlpMain.ColumnCount = 2;
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Controls.Add(this.tlpContent, 1, 0);
+ this.tlpMain.Controls.Add(this.kpbCountDown, 0, 1);
+ this.tlpMain.Controls.Add(this.pbxNotificationIcon, 0, 0);
+ this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpMain.Location = new System.Drawing.Point(0, 0);
+ this.tlpMain.Name = "tlpMain";
+ this.tlpMain.RowCount = 2;
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpMain.Size = new System.Drawing.Size(630, 369);
+ this.tlpMain.TabIndex = 0;
+ //
+ // tlpContent
+ //
+ this.tlpContent.ColumnCount = 1;
+ this.tlpContent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpContent.Controls.Add(this.kwlNotificationTitle, 0, 0);
+ this.tlpContent.Controls.Add(this.kwlNotificationMessage, 0, 1);
+ this.tlpContent.Controls.Add(this.kdudUserInput, 0, 2);
+ this.tlpContent.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpContent.Location = new System.Drawing.Point(3, 3);
+ this.tlpContent.Name = "tlpContent";
+ this.tlpContent.RowCount = 3;
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpContent.Size = new System.Drawing.Size(486, 331);
+ this.tlpContent.TabIndex = 6;
+ //
+ // kwlNotificationTitle
+ //
+ this.kwlNotificationTitle.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationTitle.Font = new System.Drawing.Font("Segoe UI", 13.5F, System.Drawing.FontStyle.Bold);
+ this.kwlNotificationTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationTitle.LabelStyle = Krypton.Toolkit.LabelStyle.TitleControl;
+ this.kwlNotificationTitle.Location = new System.Drawing.Point(3, 0);
+ this.kwlNotificationTitle.Name = "kwlNotificationTitle";
+ this.kwlNotificationTitle.Size = new System.Drawing.Size(480, 25);
+ this.kwlNotificationTitle.Text = "kryptonWrapLabel1";
+ this.kwlNotificationTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // kwlNotificationMessage
+ //
+ this.kwlNotificationMessage.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationMessage.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.kwlNotificationMessage.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationMessage.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.kwlNotificationMessage.Location = new System.Drawing.Point(3, 25);
+ this.kwlNotificationMessage.Name = "kwlNotificationMessage";
+ this.kwlNotificationMessage.Size = new System.Drawing.Size(480, 278);
+ this.kwlNotificationMessage.Text = "kryptonWrapLabel2";
+ this.kwlNotificationMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // kdudUserInput
+ //
+ this.kdudUserInput.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kdudUserInput.Location = new System.Drawing.Point(3, 306);
+ this.kdudUserInput.Name = "kdudUserInput";
+ this.kdudUserInput.Size = new System.Drawing.Size(480, 22);
+ this.kdudUserInput.TabIndex = 2;
+ //
+ // kpbCountDown
+ //
+ this.tlpMain.SetColumnSpan(this.kpbCountDown, 2);
+ this.kpbCountDown.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpbCountDown.Location = new System.Drawing.Point(3, 340);
+ this.kpbCountDown.Name = "kpbCountDown";
+ this.kpbCountDown.Size = new System.Drawing.Size(624, 26);
+ this.kpbCountDown.StateCommon.Back.Color1 = System.Drawing.Color.Green;
+ this.kpbCountDown.StateDisabled.Back.ColorStyle = Krypton.Toolkit.PaletteColorStyle.OneNote;
+ this.kpbCountDown.StateNormal.Back.ColorStyle = Krypton.Toolkit.PaletteColorStyle.OneNote;
+ this.kpbCountDown.TabIndex = 5;
+ this.kpbCountDown.Text = "kryptonProgressBar1";
+ this.kpbCountDown.Values.Text = "kryptonProgressBar1";
+ //
+ // pbxNotificationIcon
+ //
+ this.pbxNotificationIcon.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pbxNotificationIcon.Location = new System.Drawing.Point(497, 5);
+ this.pbxNotificationIcon.Margin = new System.Windows.Forms.Padding(5);
+ this.pbxNotificationIcon.Name = "pbxNotificationIcon";
+ this.pbxNotificationIcon.Size = new System.Drawing.Size(128, 327);
+ this.pbxNotificationIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pbxNotificationIcon.TabIndex = 0;
+ this.pbxNotificationIcon.TabStop = false;
+ //
+ // VisualToastNotificationDomainUpDownInputWithProgressBarRtlAwareForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(630, 419);
+ this.Controls.Add(this.kpnlMain);
+ this.Controls.Add(this.kpnlButtons);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualToastNotificationDomainUpDownInputWithProgressBarRtlAwareForm";
+ this.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.Load += new System.EventHandler(this.VisualToastNotificationDomainUpDownInputWithProgressBarRtlAwareForm_Load);
+ this.LocationChanged += new System.EventHandler(this.VisualToastNotificationDomainUpDownInputWithProgressBarRtlAwareForm_LocationChanged);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit();
+ this.kpnlButtons.ResumeLayout(false);
+ this.kpnlButtons.PerformLayout();
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).EndInit();
+ this.kpnlMain.ResumeLayout(false);
+ this.tlpMain.ResumeLayout(false);
+ this.tlpContent.ResumeLayout(false);
+ this.tlpContent.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kpnlButtons;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private KryptonPanel kpnlMain;
+ private TableLayoutPanel tlpMain;
+ private TableLayoutPanel tlpContent;
+ private KryptonWrapLabel kwlNotificationTitle;
+ private KryptonWrapLabel kwlNotificationMessage;
+ private KryptonDomainUpDown kdudUserInput;
+ private KryptonProgressBar kpbCountDown;
+ private PictureBox pbxNotificationIcon;
+ private TableLayoutPanel tableLayoutPanel2;
+ private KryptonButton kbtnDismiss;
+ private KryptonLabel klblToastLocation;
+ private KryptonCheckBox kchkDoNotShowAgain;
+ private InternalToastButton itbDismiss;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationDomainUpDownInputWithProgressBarRtlAwareForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationDomainUpDownInputWithProgressBarRtlAwareForm.cs
new file mode 100644
index 000000000..127fd5185
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationDomainUpDownInputWithProgressBarRtlAwareForm.cs
@@ -0,0 +1,323 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+using Timer = System.Windows.Forms.Timer;
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualToastNotificationDomainUpDownInputWithProgressBarRtlAwareForm : VisualToastNotificationBaseForm
+ {
+ #region Instance Fields
+
+ private int _time;
+
+ private Timer _timer;
+
+ private readonly KryptonUserInputToastNotificationData _data;
+
+ #endregion
+
+ #region Internal
+
+ internal string UserResponse => kdudUserInput.Text;
+
+ #endregion
+
+ #region Identity
+
+ public VisualToastNotificationDomainUpDownInputWithProgressBarRtlAwareForm(KryptonUserInputToastNotificationData data)
+ {
+ InitializeComponent();
+
+ _data = data;
+
+ GotFocus += (sender, args) => kdudUserInput.Focus();
+
+ Resize += VisualToastNotificationDomainUpDownInputWithProgressBarRtlAwareForm_Resize;
+
+ UpdateBorderColors();
+ }
+
+ #endregion
+
+ #region Implementation
+
+ private void UpdateBorderColors()
+ {
+ StateCommon!.Border.Color1 = _data.BorderColor1 ?? GlobalStaticValues.EMPTY_COLOR;
+
+ StateCommon!.Border.Color2 = _data.BorderColor2 ?? GlobalStaticValues.EMPTY_COLOR;
+ }
+
+ private void UpdateText()
+ {
+ kwlNotificationTitle.Text = _data.NotificationTitle ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+
+ kwlNotificationMessage.Text = _data.NotificationContent ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+
+ private void UpdateInitialValues()
+ {
+ // Set initial date and time values
+ if (_data.UserInputList.Count > 0)
+ {
+ foreach (var item in _data.UserInputList)
+ {
+ kdudUserInput.Items.Add(item);
+ }
+
+ kdudUserInput.SelectedIndex = _data.SelectedIndex ?? 0;
+ }
+ }
+
+ private void SetIcon(Bitmap? image) => pbxNotificationIcon.Image = image;
+
+ private void UpdateLocation()
+ {
+ //Once loaded, position the form, or position it to the bottom left of the screen with added padding
+ Location = _data.NotificationLocation ?? new Point(Screen.PrimaryScreen!.WorkingArea.Width - Width - 5,
+ Screen.PrimaryScreen.WorkingArea.Height - Height - 5);
+ }
+
+ private void UpdateIcon()
+ {
+ switch (_data.NotificationIcon)
+ {
+ case KryptonToastNotificationIcon.None:
+ SetIcon(null);
+ break;
+ case KryptonToastNotificationIcon.Hand:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Hand_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemHand:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Hand.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Question:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Question_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemQuestion:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Question.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Exclamation:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.SystemExclamation:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Exclamation.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Asterisk:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Asterisk_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemAsterisk:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Stop:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Stop_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Error:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Critical_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Warning:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.Information:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Shield:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
+ }
+ else if (OSUtilities.IsWindowsTen)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_10_128_x_128);
+ }
+ else
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128);
+ }
+ break;
+ case KryptonToastNotificationIcon.WindowsLogo:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_11_128_128);
+ }
+ else if (OSUtilities.IsWindowsEight || OSUtilities.IsWindowsEightPointOne || OSUtilities.IsWindowsTen)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_8_81_10_128_128);
+ }
+ else
+ {
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.WinLogo.ToBitmap(), new Size(128, 128)));
+ }
+ break;
+ case KryptonToastNotificationIcon.Application:
+ SetIcon(GraphicsExtensions.ScaleImage(_data.ApplicationIcon.ToBitmap(), new Size(128, 128)));
+ break;
+ case KryptonToastNotificationIcon.SystemApplication:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Ok:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Ok_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Custom:
+ SetIcon(_data.CustomImage != null
+ ? new Bitmap(_data.CustomImage)
+ : null);
+ break;
+ case null:
+ SetIcon(null);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+
+ private void ShowCloseButton()
+ {
+ CloseBox = _data.ShowCloseBox ?? false;
+
+ FormBorderStyle = CloseBox ? FormBorderStyle.Fixed3D : FormBorderStyle.FixedSingle;
+
+ ControlBox = _data.ShowCloseBox ?? false;
+ }
+
+ private void itbDismiss_Click(object sender, EventArgs e) => Close();
+
+ private void VisualToastNotificationDomainUpDownInputWithProgressBarRtlAwareForm_Resize(object? sender, EventArgs e)
+ {
+ if (WindowState == FormWindowState.Maximized)
+ {
+ WindowState = FormWindowState.Normal;
+ }
+ }
+
+ private void VisualToastNotificationDomainUpDownInputWithProgressBarRtlAwareForm_Load(object sender, EventArgs e)
+ {
+ UpdateIcon();
+
+ UpdateLocation();
+
+ ShowCloseButton();
+
+ kbtnDismiss.Text = KryptonManager.Strings.ToastNotificationStrings.Dismiss;
+
+ itbDismiss.Text = KryptonManager.Strings.ToastNotificationStrings.Dismiss;
+
+ _timer.Start();
+ }
+
+ private void VisualToastNotificationDomainUpDownInputWithProgressBarRtlAwareForm_LocationChanged(object sender, EventArgs e) => UpdateLocation();
+
+ public new DialogResult ShowDialog()
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ UpdateLocation();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kpbCountDown.Maximum = _data.CountDownSeconds ?? 100;
+
+ kpbCountDown.Value = kpbCountDown.Maximum;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kpbCountDown.Value -= 1;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ if (kpbCountDown.Value == kpbCountDown.Minimum)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog();
+ }
+
+ public new DialogResult ShowDialog(IWin32Window owner)
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kpbCountDown.Maximum = _data.CountDownSeconds ?? 100;
+
+ kpbCountDown.Value = kpbCountDown.Maximum;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kpbCountDown.Value -= 1;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ if (kpbCountDown.Value == kpbCountDown.Minimum)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog(owner);
+ }
+
+ internal static string ShowNotification(KryptonUserInputToastNotificationData data)
+ {
+ var owner = data.ToastHost ?? FromHandle(PI.GetActiveWindow());
+
+ using var toast = new VisualToastNotificationDomainUpDownInputWithProgressBarRtlAwareForm(data);
+
+ if (owner != null)
+ {
+ toast.StartPosition = owner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
+
+ return toast.ShowDialog(owner!) == DialogResult.OK ? toast.UserResponse : GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+ else
+ {
+ return toast.ShowDialog() == DialogResult.OK ? toast.UserResponse : GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationDomainUpDownInputWithProgressBarRtlAwareForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationDomainUpDownInputWithProgressBarRtlAwareForm.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationDomainUpDownInputWithProgressBarRtlAwareForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationMaskedTextBoxInputWithProgressBarRtlAwareForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationMaskedTextBoxInputWithProgressBarRtlAwareForm.Designer.cs
new file mode 100644
index 000000000..c79efa2ba
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationMaskedTextBoxInputWithProgressBarRtlAwareForm.Designer.cs
@@ -0,0 +1,297 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualToastNotificationMaskedTextBoxInputWithProgressBarRtlAwareForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.kpnlButtons = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnDismiss = new Krypton.Toolkit.KryptonButton();
+ this.klblToastLocation = new Krypton.Toolkit.KryptonLabel();
+ this.kchkDoNotShowAgain = new Krypton.Toolkit.KryptonCheckBox();
+ this.itbDismiss = new Krypton.Toolkit.InternalToastButton();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kpnlMain = new Krypton.Toolkit.KryptonPanel();
+ this.tlpMain = new System.Windows.Forms.TableLayoutPanel();
+ this.tlpContent = new System.Windows.Forms.TableLayoutPanel();
+ this.kwlNotificationTitle = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kwlNotificationMessage = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kmtxtUserInput = new Krypton.Toolkit.KryptonMaskedTextBox();
+ this.kpbCountDown = new Krypton.Toolkit.KryptonProgressBar();
+ this.pbxNotificationIcon = new System.Windows.Forms.PictureBox();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit();
+ this.kpnlButtons.SuspendLayout();
+ this.tableLayoutPanel2.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).BeginInit();
+ this.kpnlMain.SuspendLayout();
+ this.tlpMain.SuspendLayout();
+ this.tlpContent.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).BeginInit();
+ this.SuspendLayout();
+ //
+ // kpnlButtons
+ //
+ this.kpnlButtons.Controls.Add(this.tableLayoutPanel2);
+ this.kpnlButtons.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlButtons.Location = new System.Drawing.Point(0, 373);
+ this.kpnlButtons.Name = "kpnlButtons";
+ this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlButtons.Size = new System.Drawing.Size(634, 50);
+ this.kpnlButtons.TabIndex = 7;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel2.ColumnCount = 4;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.Controls.Add(this.kbtnDismiss, 2, 0);
+ this.tableLayoutPanel2.Controls.Add(this.klblToastLocation, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.kchkDoNotShowAgain, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.itbDismiss, 3, 0);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 1;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(634, 49);
+ this.tableLayoutPanel2.TabIndex = 6;
+ //
+ // kbtnDismiss
+ //
+ this.kbtnDismiss.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnDismiss.AutoSize = true;
+ this.kbtnDismiss.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.kbtnDismiss.Location = new System.Drawing.Point(53, 13);
+ this.kbtnDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnDismiss.Name = "kbtnDismiss";
+ this.kbtnDismiss.Size = new System.Drawing.Size(23, 22);
+ this.kbtnDismiss.TabIndex = 2;
+ this.kbtnDismiss.Values.Text = "{0}";
+ this.kbtnDismiss.Visible = false;
+ //
+ // klblToastLocation
+ //
+ this.klblToastLocation.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.klblToastLocation.Location = new System.Drawing.Point(553, 23);
+ this.klblToastLocation.Margin = new System.Windows.Forms.Padding(10);
+ this.klblToastLocation.Name = "klblToastLocation";
+ this.klblToastLocation.Size = new System.Drawing.Size(6, 2);
+ this.klblToastLocation.TabIndex = 3;
+ this.klblToastLocation.Values.Text = "";
+ //
+ // kchkDoNotShowAgain
+ //
+ this.kchkDoNotShowAgain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kchkDoNotShowAgain.Location = new System.Drawing.Point(579, 10);
+ this.kchkDoNotShowAgain.Margin = new System.Windows.Forms.Padding(10);
+ this.kchkDoNotShowAgain.Name = "kchkDoNotShowAgain";
+ this.kchkDoNotShowAgain.Size = new System.Drawing.Size(45, 29);
+ this.kchkDoNotShowAgain.TabIndex = 4;
+ this.kchkDoNotShowAgain.Values.Text = "CB1";
+ this.kchkDoNotShowAgain.Visible = false;
+ //
+ // itbDismiss
+ //
+ this.itbDismiss.AutoSize = true;
+ this.itbDismiss.IsActionButton = false;
+ this.itbDismiss.IsDismissButton = true;
+ this.itbDismiss.Location = new System.Drawing.Point(10, 13);
+ this.itbDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.itbDismiss.Name = "itbDismiss";
+ this.itbDismiss.NotificationResult = Krypton.Toolkit.KryptonToastNotificationResult.None;
+ this.itbDismiss.Owner = null;
+ this.itbDismiss.ProcessPath = "";
+ this.itbDismiss.Size = new System.Drawing.Size(23, 22);
+ this.itbDismiss.TabIndex = 5;
+ this.itbDismiss.Values.Text = "{0}";
+ this.itbDismiss.Click += new System.EventHandler(this.itbDismiss_Click);
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(634, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kpnlMain
+ //
+ this.kpnlMain.Controls.Add(this.tlpMain);
+ this.kpnlMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlMain.Location = new System.Drawing.Point(0, 0);
+ this.kpnlMain.Name = "kpnlMain";
+ this.kpnlMain.Size = new System.Drawing.Size(634, 373);
+ this.kpnlMain.TabIndex = 8;
+ //
+ // tlpMain
+ //
+ this.tlpMain.BackColor = System.Drawing.Color.Transparent;
+ this.tlpMain.ColumnCount = 2;
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Controls.Add(this.tlpContent, 1, 0);
+ this.tlpMain.Controls.Add(this.kpbCountDown, 0, 1);
+ this.tlpMain.Controls.Add(this.pbxNotificationIcon, 0, 0);
+ this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpMain.Location = new System.Drawing.Point(0, 0);
+ this.tlpMain.Name = "tlpMain";
+ this.tlpMain.RowCount = 2;
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpMain.Size = new System.Drawing.Size(634, 373);
+ this.tlpMain.TabIndex = 0;
+ //
+ // tlpContent
+ //
+ this.tlpContent.ColumnCount = 1;
+ this.tlpContent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpContent.Controls.Add(this.kwlNotificationTitle, 0, 0);
+ this.tlpContent.Controls.Add(this.kwlNotificationMessage, 0, 1);
+ this.tlpContent.Controls.Add(this.kmtxtUserInput, 0, 2);
+ this.tlpContent.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpContent.Location = new System.Drawing.Point(3, 3);
+ this.tlpContent.Name = "tlpContent";
+ this.tlpContent.RowCount = 3;
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpContent.Size = new System.Drawing.Size(490, 335);
+ this.tlpContent.TabIndex = 6;
+ //
+ // kwlNotificationTitle
+ //
+ this.kwlNotificationTitle.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationTitle.Font = new System.Drawing.Font("Segoe UI", 13.5F, System.Drawing.FontStyle.Bold);
+ this.kwlNotificationTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationTitle.LabelStyle = Krypton.Toolkit.LabelStyle.TitleControl;
+ this.kwlNotificationTitle.Location = new System.Drawing.Point(3, 0);
+ this.kwlNotificationTitle.Name = "kwlNotificationTitle";
+ this.kwlNotificationTitle.Size = new System.Drawing.Size(484, 25);
+ this.kwlNotificationTitle.Text = "kryptonWrapLabel1";
+ this.kwlNotificationTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // kwlNotificationMessage
+ //
+ this.kwlNotificationMessage.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationMessage.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.kwlNotificationMessage.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationMessage.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.kwlNotificationMessage.Location = new System.Drawing.Point(3, 25);
+ this.kwlNotificationMessage.Name = "kwlNotificationMessage";
+ this.kwlNotificationMessage.Size = new System.Drawing.Size(484, 281);
+ this.kwlNotificationMessage.Text = "kryptonWrapLabel2";
+ this.kwlNotificationMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // kmtxtUserInput
+ //
+ this.kmtxtUserInput.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kmtxtUserInput.Location = new System.Drawing.Point(3, 309);
+ this.kmtxtUserInput.Name = "kmtxtUserInput";
+ this.kmtxtUserInput.Size = new System.Drawing.Size(484, 23);
+ this.kmtxtUserInput.TabIndex = 2;
+ //
+ // kpbCountDown
+ //
+ this.tlpMain.SetColumnSpan(this.kpbCountDown, 2);
+ this.kpbCountDown.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpbCountDown.Location = new System.Drawing.Point(3, 344);
+ this.kpbCountDown.Name = "kpbCountDown";
+ this.kpbCountDown.Size = new System.Drawing.Size(628, 26);
+ this.kpbCountDown.StateCommon.Back.Color1 = System.Drawing.Color.Green;
+ this.kpbCountDown.StateDisabled.Back.ColorStyle = Krypton.Toolkit.PaletteColorStyle.OneNote;
+ this.kpbCountDown.StateNormal.Back.ColorStyle = Krypton.Toolkit.PaletteColorStyle.OneNote;
+ this.kpbCountDown.TabIndex = 5;
+ this.kpbCountDown.Text = "kryptonProgressBar1";
+ this.kpbCountDown.Values.Text = "kryptonProgressBar1";
+ //
+ // pbxNotificationIcon
+ //
+ this.pbxNotificationIcon.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pbxNotificationIcon.Location = new System.Drawing.Point(501, 5);
+ this.pbxNotificationIcon.Margin = new System.Windows.Forms.Padding(5);
+ this.pbxNotificationIcon.Name = "pbxNotificationIcon";
+ this.pbxNotificationIcon.Size = new System.Drawing.Size(128, 331);
+ this.pbxNotificationIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pbxNotificationIcon.TabIndex = 0;
+ this.pbxNotificationIcon.TabStop = false;
+ //
+ // VisualToastNotificationMaskedTextBoxInputWithProgressBarRtlAwareForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(634, 423);
+ this.Controls.Add(this.kpnlMain);
+ this.Controls.Add(this.kpnlButtons);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualToastNotificationMaskedTextBoxInputWithProgressBarRtlAwareForm";
+ this.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.Load += new System.EventHandler(this.VisualToastNotificationMaskedTextBoxInputWithProgressBarRtlAwareForm_Load);
+ this.LocationChanged += new System.EventHandler(this.VisualToastNotificationMaskedTextBoxInputWithProgressBarRtlAwareForm_LocationChanged);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit();
+ this.kpnlButtons.ResumeLayout(false);
+ this.kpnlButtons.PerformLayout();
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).EndInit();
+ this.kpnlMain.ResumeLayout(false);
+ this.tlpMain.ResumeLayout(false);
+ this.tlpContent.ResumeLayout(false);
+ this.tlpContent.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kpnlButtons;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private KryptonPanel kpnlMain;
+ private TableLayoutPanel tlpMain;
+ private TableLayoutPanel tlpContent;
+ private KryptonWrapLabel kwlNotificationTitle;
+ private KryptonWrapLabel kwlNotificationMessage;
+ private KryptonMaskedTextBox kmtxtUserInput;
+ private KryptonProgressBar kpbCountDown;
+ private PictureBox pbxNotificationIcon;
+ private TableLayoutPanel tableLayoutPanel2;
+ private KryptonButton kbtnDismiss;
+ private KryptonLabel klblToastLocation;
+ private KryptonCheckBox kchkDoNotShowAgain;
+ private InternalToastButton itbDismiss;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationMaskedTextBoxInputWithProgressBarRtlAwareForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationMaskedTextBoxInputWithProgressBarRtlAwareForm.cs
new file mode 100644
index 000000000..8e2a37dfe
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationMaskedTextBoxInputWithProgressBarRtlAwareForm.cs
@@ -0,0 +1,315 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+using Timer = System.Windows.Forms.Timer;
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualToastNotificationMaskedTextBoxInputWithProgressBarRtlAwareForm : VisualToastNotificationBaseForm
+ {
+ #region Instance Fields
+
+ private int _time;
+
+ private Timer _timer;
+
+ private readonly KryptonUserInputToastNotificationData _data;
+
+ #endregion
+
+ #region Internal
+
+ internal string UserResponse => kmtxtUserInput.Text;
+
+ #endregion
+
+ #region Identity
+
+ public VisualToastNotificationMaskedTextBoxInputWithProgressBarRtlAwareForm(KryptonUserInputToastNotificationData data)
+ {
+ InitializeComponent();
+
+ _data = data;
+
+ GotFocus += (sender, args) => kmtxtUserInput.Focus();
+
+ Resize += VisualToastNotificationMaskedTextBoxInputWithProgressBarRtlAwareForm_Resize;
+
+ UpdateBorderColors();
+ }
+
+ #endregion
+
+ #region Implementation
+
+ private void UpdateBorderColors()
+ {
+ StateCommon!.Border.Color1 = _data.BorderColor1 ?? GlobalStaticValues.EMPTY_COLOR;
+
+ StateCommon!.Border.Color2 = _data.BorderColor2 ?? GlobalStaticValues.EMPTY_COLOR;
+ }
+
+ private void UpdateText()
+ {
+ kwlNotificationTitle.Text = _data.NotificationTitle ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+
+ kwlNotificationMessage.Text = _data.NotificationContent ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+
+ private void UpdateInitialValues()
+ {
+ // Set initial date and time values
+ kmtxtUserInput.Text = GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+
+ private void SetIcon(Bitmap? image) => pbxNotificationIcon.Image = image;
+
+ private void UpdateLocation()
+ {
+ //Once loaded, position the form, or position it to the bottom left of the screen with added padding
+ Location = _data.NotificationLocation ?? new Point(Screen.PrimaryScreen!.WorkingArea.Width - Width - 5,
+ Screen.PrimaryScreen.WorkingArea.Height - Height - 5);
+ }
+
+ private void UpdateIcon()
+ {
+ switch (_data.NotificationIcon)
+ {
+ case KryptonToastNotificationIcon.None:
+ SetIcon(null);
+ break;
+ case KryptonToastNotificationIcon.Hand:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Hand_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemHand:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Hand.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Question:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Question_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemQuestion:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Question.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Exclamation:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.SystemExclamation:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Exclamation.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Asterisk:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Asterisk_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemAsterisk:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Stop:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Stop_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Error:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Critical_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Warning:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.Information:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Shield:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
+ }
+ else if (OSUtilities.IsWindowsTen)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_10_128_x_128);
+ }
+ else
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128);
+ }
+ break;
+ case KryptonToastNotificationIcon.WindowsLogo:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_11_128_128);
+ }
+ else if (OSUtilities.IsWindowsEight || OSUtilities.IsWindowsEightPointOne || OSUtilities.IsWindowsTen)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_8_81_10_128_128);
+ }
+ else
+ {
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.WinLogo.ToBitmap(), new Size(128, 128)));
+ }
+ break;
+ case KryptonToastNotificationIcon.Application:
+ SetIcon(GraphicsExtensions.ScaleImage(_data.ApplicationIcon.ToBitmap(), new Size(128, 128)));
+ break;
+ case KryptonToastNotificationIcon.SystemApplication:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Ok:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Ok_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Custom:
+ SetIcon(_data.CustomImage != null
+ ? new Bitmap(_data.CustomImage)
+ : null);
+ break;
+ case null:
+ SetIcon(null);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+
+ private void ShowCloseButton()
+ {
+ CloseBox = _data.ShowCloseBox ?? false;
+
+ FormBorderStyle = CloseBox ? FormBorderStyle.Fixed3D : FormBorderStyle.FixedSingle;
+
+ ControlBox = _data.ShowCloseBox ?? false;
+ }
+
+ private void itbDismiss_Click(object sender, EventArgs e) => Close();
+
+ private void VisualToastNotificationMaskedTextBoxInputWithProgressBarRtlAwareForm_Resize(object? sender, EventArgs e)
+ {
+ if (WindowState == FormWindowState.Maximized)
+ {
+ WindowState = FormWindowState.Normal;
+ }
+ }
+
+ private void VisualToastNotificationMaskedTextBoxInputWithProgressBarRtlAwareForm_Load(object sender, EventArgs e)
+ {
+ UpdateIcon();
+
+ UpdateLocation();
+
+ ShowCloseButton();
+
+ kbtnDismiss.Text = KryptonManager.Strings.ToastNotificationStrings.Dismiss;
+
+ itbDismiss.Text = KryptonManager.Strings.ToastNotificationStrings.Dismiss;
+
+ _timer.Start();
+ }
+
+ private void VisualToastNotificationMaskedTextBoxInputWithProgressBarRtlAwareForm_LocationChanged(object sender, EventArgs e) => UpdateLocation();
+
+ public new DialogResult ShowDialog()
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ UpdateLocation();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kpbCountDown.Maximum = _data.CountDownSeconds ?? 100;
+
+ kpbCountDown.Value = kpbCountDown.Maximum;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kpbCountDown.Value -= 1;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ if (kpbCountDown.Value == kpbCountDown.Minimum)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog();
+ }
+
+ public new DialogResult ShowDialog(IWin32Window owner)
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kpbCountDown.Maximum = _data.CountDownSeconds ?? 100;
+
+ kpbCountDown.Value = kpbCountDown.Maximum;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kpbCountDown.Value -= 1;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ if (kpbCountDown.Value == kpbCountDown.Minimum)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog(owner);
+ }
+
+ internal static string ShowNotification(KryptonUserInputToastNotificationData data)
+ {
+ var owner = data.ToastHost ?? FromHandle(PI.GetActiveWindow());
+
+ using var toast = new VisualToastNotificationMaskedTextBoxInputWithProgressBarRtlAwareForm(data);
+
+ if (owner != null)
+ {
+ toast.StartPosition = owner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
+
+ return toast.ShowDialog(owner!) == DialogResult.OK ? toast.UserResponse : GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+ else
+ {
+ return toast.ShowDialog() == DialogResult.OK ? toast.UserResponse : GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationMaskedTextBoxInputWithProgressBarRtlAwareForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationMaskedTextBoxInputWithProgressBarRtlAwareForm.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationMaskedTextBoxInputWithProgressBarRtlAwareForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationNUDUserInputWithProgressBarRtlAwareForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationNUDUserInputWithProgressBarRtlAwareForm.Designer.cs
new file mode 100644
index 000000000..06e2e758d
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationNUDUserInputWithProgressBarRtlAwareForm.Designer.cs
@@ -0,0 +1,317 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualToastNotificationNUDUserInputWithProgressBarRtlAwareForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.kpnlButtons = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnDismiss = new Krypton.Toolkit.KryptonButton();
+ this.klblToastLocation = new Krypton.Toolkit.KryptonLabel();
+ this.kchkDoNotShowAgain = new Krypton.Toolkit.KryptonCheckBox();
+ this.itbDismiss = new Krypton.Toolkit.InternalToastButton();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kpnlMain = new Krypton.Toolkit.KryptonPanel();
+ this.tlpMain = new System.Windows.Forms.TableLayoutPanel();
+ this.tlpContent = new System.Windows.Forms.TableLayoutPanel();
+ this.kwlNotificationTitle = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kwlNotificationMessage = new Krypton.Toolkit.KryptonWrapLabel();
+ this.knudUserInput = new Krypton.Toolkit.KryptonNumericUpDown();
+ this.kpbCountDown = new Krypton.Toolkit.KryptonProgressBar();
+ this.pbxNotificationIcon = new System.Windows.Forms.PictureBox();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit();
+ this.kpnlButtons.SuspendLayout();
+ this.tableLayoutPanel2.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).BeginInit();
+ this.kpnlMain.SuspendLayout();
+ this.tlpMain.SuspendLayout();
+ this.tlpContent.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).BeginInit();
+ this.SuspendLayout();
+ //
+ // kpnlButtons
+ //
+ this.kpnlButtons.Controls.Add(this.tableLayoutPanel2);
+ this.kpnlButtons.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlButtons.Location = new System.Drawing.Point(0, 369);
+ this.kpnlButtons.Name = "kpnlButtons";
+ this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlButtons.Size = new System.Drawing.Size(630, 50);
+ this.kpnlButtons.TabIndex = 8;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel2.ColumnCount = 4;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.Controls.Add(this.kbtnDismiss, 2, 0);
+ this.tableLayoutPanel2.Controls.Add(this.klblToastLocation, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.kchkDoNotShowAgain, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.itbDismiss, 3, 0);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 1;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(630, 49);
+ this.tableLayoutPanel2.TabIndex = 6;
+ //
+ // kbtnDismiss
+ //
+ this.kbtnDismiss.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnDismiss.AutoSize = true;
+ this.kbtnDismiss.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.kbtnDismiss.Location = new System.Drawing.Point(53, 13);
+ this.kbtnDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnDismiss.Name = "kbtnDismiss";
+ this.kbtnDismiss.Size = new System.Drawing.Size(23, 22);
+ this.kbtnDismiss.TabIndex = 2;
+ this.kbtnDismiss.Values.Text = "{0}";
+ this.kbtnDismiss.Visible = false;
+ //
+ // klblToastLocation
+ //
+ this.klblToastLocation.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.klblToastLocation.Location = new System.Drawing.Point(549, 23);
+ this.klblToastLocation.Margin = new System.Windows.Forms.Padding(10);
+ this.klblToastLocation.Name = "klblToastLocation";
+ this.klblToastLocation.Size = new System.Drawing.Size(6, 2);
+ this.klblToastLocation.TabIndex = 3;
+ this.klblToastLocation.Values.Text = "";
+ //
+ // kchkDoNotShowAgain
+ //
+ this.kchkDoNotShowAgain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kchkDoNotShowAgain.Location = new System.Drawing.Point(575, 10);
+ this.kchkDoNotShowAgain.Margin = new System.Windows.Forms.Padding(10);
+ this.kchkDoNotShowAgain.Name = "kchkDoNotShowAgain";
+ this.kchkDoNotShowAgain.Size = new System.Drawing.Size(45, 29);
+ this.kchkDoNotShowAgain.TabIndex = 4;
+ this.kchkDoNotShowAgain.Values.Text = "CB1";
+ this.kchkDoNotShowAgain.Visible = false;
+ //
+ // itbDismiss
+ //
+ this.itbDismiss.AutoSize = true;
+ this.itbDismiss.IsActionButton = false;
+ this.itbDismiss.IsDismissButton = true;
+ this.itbDismiss.Location = new System.Drawing.Point(10, 13);
+ this.itbDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.itbDismiss.Name = "itbDismiss";
+ this.itbDismiss.NotificationResult = Krypton.Toolkit.KryptonToastNotificationResult.None;
+ this.itbDismiss.Owner = null;
+ this.itbDismiss.ProcessPath = "";
+ this.itbDismiss.Size = new System.Drawing.Size(23, 22);
+ this.itbDismiss.TabIndex = 5;
+ this.itbDismiss.Values.Text = "{0}";
+ this.itbDismiss.Click += new System.EventHandler(this.itbDismiss_Click);
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(630, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kpnlMain
+ //
+ this.kpnlMain.Controls.Add(this.tlpMain);
+ this.kpnlMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlMain.Location = new System.Drawing.Point(0, 0);
+ this.kpnlMain.Name = "kpnlMain";
+ this.kpnlMain.Size = new System.Drawing.Size(630, 369);
+ this.kpnlMain.TabIndex = 9;
+ //
+ // tlpMain
+ //
+ this.tlpMain.BackColor = System.Drawing.Color.Transparent;
+ this.tlpMain.ColumnCount = 2;
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Controls.Add(this.tlpContent, 1, 0);
+ this.tlpMain.Controls.Add(this.kpbCountDown, 0, 1);
+ this.tlpMain.Controls.Add(this.pbxNotificationIcon, 0, 0);
+ this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpMain.Location = new System.Drawing.Point(0, 0);
+ this.tlpMain.Name = "tlpMain";
+ this.tlpMain.RowCount = 2;
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpMain.Size = new System.Drawing.Size(630, 369);
+ this.tlpMain.TabIndex = 0;
+ //
+ // tlpContent
+ //
+ this.tlpContent.ColumnCount = 1;
+ this.tlpContent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpContent.Controls.Add(this.kwlNotificationTitle, 0, 0);
+ this.tlpContent.Controls.Add(this.kwlNotificationMessage, 0, 1);
+ this.tlpContent.Controls.Add(this.knudUserInput, 0, 2);
+ this.tlpContent.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpContent.Location = new System.Drawing.Point(3, 3);
+ this.tlpContent.Name = "tlpContent";
+ this.tlpContent.RowCount = 3;
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpContent.Size = new System.Drawing.Size(486, 331);
+ this.tlpContent.TabIndex = 6;
+ //
+ // kwlNotificationTitle
+ //
+ this.kwlNotificationTitle.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationTitle.Font = new System.Drawing.Font("Segoe UI", 13.5F, System.Drawing.FontStyle.Bold);
+ this.kwlNotificationTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationTitle.LabelStyle = Krypton.Toolkit.LabelStyle.TitleControl;
+ this.kwlNotificationTitle.Location = new System.Drawing.Point(3, 0);
+ this.kwlNotificationTitle.Name = "kwlNotificationTitle";
+ this.kwlNotificationTitle.Size = new System.Drawing.Size(480, 25);
+ this.kwlNotificationTitle.Text = "kryptonWrapLabel1";
+ this.kwlNotificationTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // kwlNotificationMessage
+ //
+ this.kwlNotificationMessage.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationMessage.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.kwlNotificationMessage.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationMessage.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.kwlNotificationMessage.Location = new System.Drawing.Point(3, 25);
+ this.kwlNotificationMessage.Name = "kwlNotificationMessage";
+ this.kwlNotificationMessage.Size = new System.Drawing.Size(480, 278);
+ this.kwlNotificationMessage.Text = "kryptonWrapLabel2";
+ this.kwlNotificationMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // knudUserInput
+ //
+ this.knudUserInput.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.knudUserInput.Increment = new decimal(new int[] {
+ 1,
+ 0,
+ 0,
+ 0});
+ this.knudUserInput.Location = new System.Drawing.Point(3, 306);
+ this.knudUserInput.Maximum = new decimal(new int[] {
+ 100,
+ 0,
+ 0,
+ 0});
+ this.knudUserInput.Minimum = new decimal(new int[] {
+ 0,
+ 0,
+ 0,
+ 0});
+ this.knudUserInput.Name = "knudUserInput";
+ this.knudUserInput.Size = new System.Drawing.Size(480, 22);
+ this.knudUserInput.TabIndex = 2;
+ this.knudUserInput.Value = new decimal(new int[] {
+ 0,
+ 0,
+ 0,
+ 0});
+ //
+ // kpbCountDown
+ //
+ this.tlpMain.SetColumnSpan(this.kpbCountDown, 2);
+ this.kpbCountDown.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpbCountDown.Location = new System.Drawing.Point(3, 340);
+ this.kpbCountDown.Name = "kpbCountDown";
+ this.kpbCountDown.Size = new System.Drawing.Size(624, 26);
+ this.kpbCountDown.StateCommon.Back.Color1 = System.Drawing.Color.Green;
+ this.kpbCountDown.StateDisabled.Back.ColorStyle = Krypton.Toolkit.PaletteColorStyle.OneNote;
+ this.kpbCountDown.StateNormal.Back.ColorStyle = Krypton.Toolkit.PaletteColorStyle.OneNote;
+ this.kpbCountDown.TabIndex = 5;
+ this.kpbCountDown.Text = "kryptonProgressBar1";
+ this.kpbCountDown.Values.Text = "kryptonProgressBar1";
+ //
+ // pbxNotificationIcon
+ //
+ this.pbxNotificationIcon.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pbxNotificationIcon.Location = new System.Drawing.Point(497, 5);
+ this.pbxNotificationIcon.Margin = new System.Windows.Forms.Padding(5);
+ this.pbxNotificationIcon.Name = "pbxNotificationIcon";
+ this.pbxNotificationIcon.Size = new System.Drawing.Size(128, 327);
+ this.pbxNotificationIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pbxNotificationIcon.TabIndex = 0;
+ this.pbxNotificationIcon.TabStop = false;
+ //
+ // VisualToastNotificationNUDUserInputWithProgressBarRtlAwareForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(630, 419);
+ this.Controls.Add(this.kpnlMain);
+ this.Controls.Add(this.kpnlButtons);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualToastNotificationNUDUserInputWithProgressBarRtlAwareForm";
+ this.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.Load += new System.EventHandler(this.VisualToastNotificationNumericUpDownUserInputWithProgressBarRtlAwareForm_Load);
+ this.LocationChanged += new System.EventHandler(this.VisualToastNotificationNumericUpDownUserInputWithProgressBarRtlAwareForm_LocationChanged);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit();
+ this.kpnlButtons.ResumeLayout(false);
+ this.kpnlButtons.PerformLayout();
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).EndInit();
+ this.kpnlMain.ResumeLayout(false);
+ this.tlpMain.ResumeLayout(false);
+ this.tlpContent.ResumeLayout(false);
+ this.tlpContent.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kpnlButtons;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private KryptonPanel kpnlMain;
+ private TableLayoutPanel tlpMain;
+ private TableLayoutPanel tlpContent;
+ private KryptonWrapLabel kwlNotificationTitle;
+ private KryptonWrapLabel kwlNotificationMessage;
+ private KryptonNumericUpDown knudUserInput;
+ private KryptonProgressBar kpbCountDown;
+ private PictureBox pbxNotificationIcon;
+ private TableLayoutPanel tableLayoutPanel2;
+ private KryptonButton kbtnDismiss;
+ private KryptonLabel klblToastLocation;
+ private KryptonCheckBox kchkDoNotShowAgain;
+ private InternalToastButton itbDismiss;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationNUDUserInputWithProgressBarRtlAwareForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationNUDUserInputWithProgressBarRtlAwareForm.cs
new file mode 100644
index 000000000..dbf40d5e3
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationNUDUserInputWithProgressBarRtlAwareForm.cs
@@ -0,0 +1,320 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+using Timer = System.Windows.Forms.Timer;
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualToastNotificationNUDUserInputWithProgressBarRtlAwareForm : VisualToastNotificationBaseForm
+ {
+ #region Instance Fields
+
+ private int _time;
+
+ private Timer _timer;
+
+ private readonly KryptonUserInputToastNotificationData _data;
+
+ #endregion
+
+ #region Internal
+
+ internal int UserResponse => Convert.ToInt32(knudUserInput.Value);
+
+ #endregion
+
+ #region Identity
+
+ public VisualToastNotificationNUDUserInputWithProgressBarRtlAwareForm(KryptonUserInputToastNotificationData data)
+ {
+ InitializeComponent();
+
+ _data = data;
+
+ GotFocus += (sender, args) => knudUserInput.Focus();
+
+ Resize += VisualToastNotificationNumericUpDownUserInputWithProgressBarRtlAwareForm_Resize;
+
+ UpdateBorderColors();
+ }
+
+ #endregion
+
+ #region Implementation
+
+ private void UpdateBorderColors()
+ {
+ StateCommon!.Border.Color1 = _data.BorderColor1 ?? GlobalStaticValues.EMPTY_COLOR;
+
+ StateCommon!.Border.Color2 = _data.BorderColor2 ?? GlobalStaticValues.EMPTY_COLOR;
+ }
+
+ private void UpdateText()
+ {
+ kwlNotificationTitle.Text = _data.NotificationTitle ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+
+ kwlNotificationMessage.Text = _data.NotificationContent ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+
+ private void UpdateInitialValues()
+ {
+ // Set initial date and time values
+ knudUserInput.Maximum = _data.MaximumNumericUpDownValue ?? 100;
+
+ knudUserInput.Minimum = _data.MinimumNumericUpDownValue ?? 0;
+
+ knudUserInput.Value = _data.InitialNumericUpDownValue ?? 0;
+ }
+
+ private void SetIcon(Bitmap? image) => pbxNotificationIcon.Image = image;
+
+ private void UpdateLocation()
+ {
+ //Once loaded, position the form, or position it to the bottom left of the screen with added padding
+ Location = _data.NotificationLocation ?? new Point(Screen.PrimaryScreen!.WorkingArea.Width - Width - 5,
+ Screen.PrimaryScreen.WorkingArea.Height - Height - 5);
+ }
+
+ private void UpdateIcon()
+ {
+ switch (_data.NotificationIcon)
+ {
+ case KryptonToastNotificationIcon.None:
+ SetIcon(null);
+ break;
+ case KryptonToastNotificationIcon.Hand:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Hand_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemHand:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Hand.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Question:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Question_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemQuestion:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Question.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Exclamation:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.SystemExclamation:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Exclamation.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Asterisk:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Asterisk_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemAsterisk:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Stop:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Stop_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Error:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Critical_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Warning:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.Information:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Shield:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
+ }
+ else if (OSUtilities.IsWindowsTen)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_10_128_x_128);
+ }
+ else
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128);
+ }
+ break;
+ case KryptonToastNotificationIcon.WindowsLogo:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_11_128_128);
+ }
+ else if (OSUtilities.IsWindowsEight || OSUtilities.IsWindowsEightPointOne || OSUtilities.IsWindowsTen)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_8_81_10_128_128);
+ }
+ else
+ {
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.WinLogo.ToBitmap(), new Size(128, 128)));
+ }
+ break;
+ case KryptonToastNotificationIcon.Application:
+ SetIcon(GraphicsExtensions.ScaleImage(_data.ApplicationIcon.ToBitmap(), new Size(128, 128)));
+ break;
+ case KryptonToastNotificationIcon.SystemApplication:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Ok:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Ok_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Custom:
+ SetIcon(_data.CustomImage != null
+ ? new Bitmap(_data.CustomImage)
+ : null);
+ break;
+ case null:
+ SetIcon(null);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+
+ private void ShowCloseButton()
+ {
+ CloseBox = _data.ShowCloseBox ?? false;
+
+ FormBorderStyle = CloseBox ? FormBorderStyle.Fixed3D : FormBorderStyle.FixedSingle;
+
+ ControlBox = _data.ShowCloseBox ?? false;
+ }
+
+ private void itbDismiss_Click(object sender, EventArgs e) => Close();
+
+ private void VisualToastNotificationNumericUpDownUserInputWithProgressBarRtlAwareForm_Resize(object? sender, EventArgs e)
+ {
+ if (WindowState == FormWindowState.Maximized)
+ {
+ WindowState = FormWindowState.Normal;
+ }
+ }
+
+ private void VisualToastNotificationNumericUpDownUserInputWithProgressBarRtlAwareForm_Load(object sender, EventArgs e)
+ {
+ UpdateIcon();
+
+ UpdateLocation();
+
+ ShowCloseButton();
+
+ kbtnDismiss.Text = KryptonManager.Strings.ToastNotificationStrings.Dismiss;
+
+ itbDismiss.Text = KryptonManager.Strings.ToastNotificationStrings.Dismiss;
+
+ _timer.Start();
+ }
+
+ private void VisualToastNotificationNumericUpDownUserInputWithProgressBarRtlAwareForm_LocationChanged(object sender, EventArgs e) => UpdateLocation();
+
+ public new DialogResult ShowDialog()
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ UpdateLocation();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kpbCountDown.Maximum = _data.CountDownSeconds ?? 100;
+
+ kpbCountDown.Value = kpbCountDown.Maximum;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kpbCountDown.Value -= 1;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ if (kpbCountDown.Value == kpbCountDown.Minimum)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog();
+ }
+
+ public new DialogResult ShowDialog(IWin32Window owner)
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kpbCountDown.Maximum = _data.CountDownSeconds ?? 100;
+
+ kpbCountDown.Value = kpbCountDown.Maximum;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kpbCountDown.Value -= 1;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ if (kpbCountDown.Value == kpbCountDown.Minimum)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog(owner);
+ }
+
+
+ public static decimal ShowToastNotification(KryptonUserInputToastNotificationData data)
+ {
+ var owner = data.ToastHost ?? FromHandle(PI.GetActiveWindow());
+
+ using var toast = new VisualToastNotificationNUDUserInputWithProgressBarRtlAwareForm(data);
+
+ if (owner != null)
+ {
+ toast.StartPosition = owner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
+
+ return toast.ShowDialog(owner!) == DialogResult.OK ? toast.UserResponse : 0;
+ }
+ else
+ {
+ return toast.ShowDialog() == DialogResult.OK ? toast.UserResponse : 0;
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationNUDUserInputWithProgressBarRtlAwareForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationNUDUserInputWithProgressBarRtlAwareForm.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationNUDUserInputWithProgressBarRtlAwareForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationTextBoxUserInputWithProgressBarRtlAwareForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationTextBoxUserInputWithProgressBarRtlAwareForm.Designer.cs
new file mode 100644
index 000000000..e797c4d07
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationTextBoxUserInputWithProgressBarRtlAwareForm.Designer.cs
@@ -0,0 +1,297 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualToastNotificationTextBoxUserInputWithProgressBarRtlAwareForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.kpnlButtons = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnDismiss = new Krypton.Toolkit.KryptonButton();
+ this.klblToastLocation = new Krypton.Toolkit.KryptonLabel();
+ this.kchkDoNotShowAgain = new Krypton.Toolkit.KryptonCheckBox();
+ this.itbDismiss = new Krypton.Toolkit.InternalToastButton();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kpnlMain = new Krypton.Toolkit.KryptonPanel();
+ this.tlpMain = new System.Windows.Forms.TableLayoutPanel();
+ this.tlpContent = new System.Windows.Forms.TableLayoutPanel();
+ this.kwlNotificationTitle = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kwlNotificationMessage = new Krypton.Toolkit.KryptonWrapLabel();
+ this.ktxtUserInput = new Krypton.Toolkit.KryptonTextBox();
+ this.kpbCountDown = new Krypton.Toolkit.KryptonProgressBar();
+ this.pbxNotificationIcon = new System.Windows.Forms.PictureBox();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit();
+ this.kpnlButtons.SuspendLayout();
+ this.tableLayoutPanel2.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).BeginInit();
+ this.kpnlMain.SuspendLayout();
+ this.tlpMain.SuspendLayout();
+ this.tlpContent.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).BeginInit();
+ this.SuspendLayout();
+ //
+ // kpnlButtons
+ //
+ this.kpnlButtons.Controls.Add(this.tableLayoutPanel2);
+ this.kpnlButtons.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlButtons.Location = new System.Drawing.Point(0, 369);
+ this.kpnlButtons.Name = "kpnlButtons";
+ this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlButtons.Size = new System.Drawing.Size(630, 50);
+ this.kpnlButtons.TabIndex = 8;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel2.ColumnCount = 4;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.Controls.Add(this.kbtnDismiss, 2, 0);
+ this.tableLayoutPanel2.Controls.Add(this.klblToastLocation, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.kchkDoNotShowAgain, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.itbDismiss, 3, 0);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 1;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(630, 49);
+ this.tableLayoutPanel2.TabIndex = 6;
+ //
+ // kbtnDismiss
+ //
+ this.kbtnDismiss.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnDismiss.AutoSize = true;
+ this.kbtnDismiss.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.kbtnDismiss.Location = new System.Drawing.Point(53, 13);
+ this.kbtnDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnDismiss.Name = "kbtnDismiss";
+ this.kbtnDismiss.Size = new System.Drawing.Size(23, 22);
+ this.kbtnDismiss.TabIndex = 2;
+ this.kbtnDismiss.Values.Text = "{0}";
+ this.kbtnDismiss.Visible = false;
+ //
+ // klblToastLocation
+ //
+ this.klblToastLocation.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.klblToastLocation.Location = new System.Drawing.Point(549, 23);
+ this.klblToastLocation.Margin = new System.Windows.Forms.Padding(10);
+ this.klblToastLocation.Name = "klblToastLocation";
+ this.klblToastLocation.Size = new System.Drawing.Size(6, 2);
+ this.klblToastLocation.TabIndex = 3;
+ this.klblToastLocation.Values.Text = "";
+ //
+ // kchkDoNotShowAgain
+ //
+ this.kchkDoNotShowAgain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kchkDoNotShowAgain.Location = new System.Drawing.Point(575, 10);
+ this.kchkDoNotShowAgain.Margin = new System.Windows.Forms.Padding(10);
+ this.kchkDoNotShowAgain.Name = "kchkDoNotShowAgain";
+ this.kchkDoNotShowAgain.Size = new System.Drawing.Size(45, 29);
+ this.kchkDoNotShowAgain.TabIndex = 4;
+ this.kchkDoNotShowAgain.Values.Text = "CB1";
+ this.kchkDoNotShowAgain.Visible = false;
+ //
+ // itbDismiss
+ //
+ this.itbDismiss.AutoSize = true;
+ this.itbDismiss.IsActionButton = false;
+ this.itbDismiss.IsDismissButton = true;
+ this.itbDismiss.Location = new System.Drawing.Point(10, 13);
+ this.itbDismiss.Margin = new System.Windows.Forms.Padding(10);
+ this.itbDismiss.Name = "itbDismiss";
+ this.itbDismiss.NotificationResult = Krypton.Toolkit.KryptonToastNotificationResult.None;
+ this.itbDismiss.Owner = null;
+ this.itbDismiss.ProcessPath = "";
+ this.itbDismiss.Size = new System.Drawing.Size(23, 22);
+ this.itbDismiss.TabIndex = 5;
+ this.itbDismiss.Values.Text = "{0}";
+ this.itbDismiss.Click += new System.EventHandler(this.itbDismiss_Click);
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(630, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kpnlMain
+ //
+ this.kpnlMain.Controls.Add(this.tlpMain);
+ this.kpnlMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlMain.Location = new System.Drawing.Point(0, 0);
+ this.kpnlMain.Name = "kpnlMain";
+ this.kpnlMain.Size = new System.Drawing.Size(630, 369);
+ this.kpnlMain.TabIndex = 9;
+ //
+ // tlpMain
+ //
+ this.tlpMain.BackColor = System.Drawing.Color.Transparent;
+ this.tlpMain.ColumnCount = 2;
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.Controls.Add(this.tlpContent, 1, 0);
+ this.tlpMain.Controls.Add(this.kpbCountDown, 0, 1);
+ this.tlpMain.Controls.Add(this.pbxNotificationIcon, 0, 0);
+ this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpMain.Location = new System.Drawing.Point(0, 0);
+ this.tlpMain.Name = "tlpMain";
+ this.tlpMain.RowCount = 2;
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpMain.Size = new System.Drawing.Size(630, 369);
+ this.tlpMain.TabIndex = 0;
+ //
+ // tlpContent
+ //
+ this.tlpContent.ColumnCount = 1;
+ this.tlpContent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpContent.Controls.Add(this.kwlNotificationTitle, 0, 0);
+ this.tlpContent.Controls.Add(this.kwlNotificationMessage, 0, 1);
+ this.tlpContent.Controls.Add(this.ktxtUserInput, 0, 2);
+ this.tlpContent.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpContent.Location = new System.Drawing.Point(3, 3);
+ this.tlpContent.Name = "tlpContent";
+ this.tlpContent.RowCount = 3;
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpContent.Size = new System.Drawing.Size(486, 331);
+ this.tlpContent.TabIndex = 6;
+ //
+ // kwlNotificationTitle
+ //
+ this.kwlNotificationTitle.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationTitle.Font = new System.Drawing.Font("Segoe UI", 13.5F, System.Drawing.FontStyle.Bold);
+ this.kwlNotificationTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationTitle.LabelStyle = Krypton.Toolkit.LabelStyle.TitleControl;
+ this.kwlNotificationTitle.Location = new System.Drawing.Point(3, 0);
+ this.kwlNotificationTitle.Name = "kwlNotificationTitle";
+ this.kwlNotificationTitle.Size = new System.Drawing.Size(480, 25);
+ this.kwlNotificationTitle.Text = "kryptonWrapLabel1";
+ this.kwlNotificationTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // kwlNotificationMessage
+ //
+ this.kwlNotificationMessage.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlNotificationMessage.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.kwlNotificationMessage.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlNotificationMessage.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.kwlNotificationMessage.Location = new System.Drawing.Point(3, 25);
+ this.kwlNotificationMessage.Name = "kwlNotificationMessage";
+ this.kwlNotificationMessage.Size = new System.Drawing.Size(480, 277);
+ this.kwlNotificationMessage.Text = "kryptonWrapLabel2";
+ this.kwlNotificationMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // ktxtUserInput
+ //
+ this.ktxtUserInput.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.ktxtUserInput.Location = new System.Drawing.Point(3, 305);
+ this.ktxtUserInput.Name = "ktxtUserInput";
+ this.ktxtUserInput.Size = new System.Drawing.Size(480, 23);
+ this.ktxtUserInput.TabIndex = 2;
+ //
+ // kpbCountDown
+ //
+ this.tlpMain.SetColumnSpan(this.kpbCountDown, 2);
+ this.kpbCountDown.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpbCountDown.Location = new System.Drawing.Point(3, 340);
+ this.kpbCountDown.Name = "kpbCountDown";
+ this.kpbCountDown.Size = new System.Drawing.Size(624, 26);
+ this.kpbCountDown.StateCommon.Back.Color1 = System.Drawing.Color.Green;
+ this.kpbCountDown.StateDisabled.Back.ColorStyle = Krypton.Toolkit.PaletteColorStyle.OneNote;
+ this.kpbCountDown.StateNormal.Back.ColorStyle = Krypton.Toolkit.PaletteColorStyle.OneNote;
+ this.kpbCountDown.TabIndex = 5;
+ this.kpbCountDown.Text = "kryptonProgressBar1";
+ this.kpbCountDown.Values.Text = "kryptonProgressBar1";
+ //
+ // pbxNotificationIcon
+ //
+ this.pbxNotificationIcon.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pbxNotificationIcon.Location = new System.Drawing.Point(497, 5);
+ this.pbxNotificationIcon.Margin = new System.Windows.Forms.Padding(5);
+ this.pbxNotificationIcon.Name = "pbxNotificationIcon";
+ this.pbxNotificationIcon.Size = new System.Drawing.Size(128, 327);
+ this.pbxNotificationIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pbxNotificationIcon.TabIndex = 0;
+ this.pbxNotificationIcon.TabStop = false;
+ //
+ // VisualToastNotificationTextBoxUserInputWithProgressBarRtlAwareForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(630, 419);
+ this.Controls.Add(this.kpnlMain);
+ this.Controls.Add(this.kpnlButtons);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualToastNotificationTextBoxUserInputWithProgressBarRtlAwareForm";
+ this.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.Load += new System.EventHandler(this.VisualToastNotificationTextBoxUserInputWithProgressBarRtlAwareForm_Load);
+ this.LocationChanged += new System.EventHandler(this.VisualToastNotificationTextBoxUserInputWithProgressBarRtlAwareForm_LocationChanged);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit();
+ this.kpnlButtons.ResumeLayout(false);
+ this.kpnlButtons.PerformLayout();
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).EndInit();
+ this.kpnlMain.ResumeLayout(false);
+ this.tlpMain.ResumeLayout(false);
+ this.tlpContent.ResumeLayout(false);
+ this.tlpContent.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kpnlButtons;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private KryptonPanel kpnlMain;
+ private TableLayoutPanel tlpMain;
+ private TableLayoutPanel tlpContent;
+ private KryptonWrapLabel kwlNotificationTitle;
+ private KryptonWrapLabel kwlNotificationMessage;
+ private KryptonTextBox ktxtUserInput;
+ private KryptonProgressBar kpbCountDown;
+ private PictureBox pbxNotificationIcon;
+ private TableLayoutPanel tableLayoutPanel2;
+ private KryptonButton kbtnDismiss;
+ private KryptonLabel klblToastLocation;
+ private KryptonCheckBox kchkDoNotShowAgain;
+ private InternalToastButton itbDismiss;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationTextBoxUserInputWithProgressBarRtlAwareForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationTextBoxUserInputWithProgressBarRtlAwareForm.cs
new file mode 100644
index 000000000..dfb197337
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationTextBoxUserInputWithProgressBarRtlAwareForm.cs
@@ -0,0 +1,320 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+using Timer = System.Windows.Forms.Timer;
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualToastNotificationTextBoxUserInputWithProgressBarRtlAwareForm : VisualToastNotificationBaseForm
+ {
+ #region Instance Fields
+
+ private int _time;
+
+ private Timer _timer;
+
+ private readonly KryptonUserInputToastNotificationData _data;
+
+ #endregion
+
+ #region Internal
+
+ internal string UserResponse => ktxtUserInput.Text;
+
+ #endregion
+
+ #region Identity
+
+ public VisualToastNotificationTextBoxUserInputWithProgressBarRtlAwareForm(KryptonUserInputToastNotificationData data)
+ {
+ InitializeComponent();
+
+ _data = data;
+
+ GotFocus += (sender, args) => ktxtUserInput.Focus();
+
+ Resize += VisualToastNotificationTextBoxUserInputWithProgressBarRtlAwareForm_Resize;
+
+ UpdateBorderColors();
+ }
+
+ #endregion
+
+ #region Implementation
+
+ private void UpdateBorderColors()
+ {
+ StateCommon!.Border.Color1 = _data.BorderColor1 ?? GlobalStaticValues.EMPTY_COLOR;
+
+ StateCommon!.Border.Color2 = _data.BorderColor2 ?? GlobalStaticValues.EMPTY_COLOR;
+ }
+
+ private void UpdateText()
+ {
+ kwlNotificationTitle.Text = _data.NotificationTitle ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+
+ kwlNotificationMessage.Text = _data.NotificationContent ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+
+ private void UpdateInitialValues()
+ {
+ // Set initial date and time values
+ ktxtUserInput.Text = GlobalStaticValues.DEFAULT_EMPTY_STRING;
+
+ ktxtUserInput.CueHint.CueHintText =
+ _data.ToastNotificationCueText ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
+
+ ktxtUserInput.CueHint.Color1 = _data.ToastNotificationCueColor ?? Color.Gray;
+ }
+
+ private void SetIcon(Bitmap? image) => pbxNotificationIcon.Image = image;
+
+ private void UpdateLocation()
+ {
+ //Once loaded, position the form, or position it to the bottom left of the screen with added padding
+ Location = _data.NotificationLocation ?? new Point(Screen.PrimaryScreen!.WorkingArea.Width - Width - 5,
+ Screen.PrimaryScreen.WorkingArea.Height - Height - 5);
+ }
+
+ private void UpdateIcon()
+ {
+ switch (_data.NotificationIcon)
+ {
+ case KryptonToastNotificationIcon.None:
+ SetIcon(null);
+ break;
+ case KryptonToastNotificationIcon.Hand:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Hand_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemHand:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Hand.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Question:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Question_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemQuestion:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Question.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Exclamation:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.SystemExclamation:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Exclamation.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Asterisk:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Asterisk_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.SystemAsterisk:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Stop:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Stop_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Error:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Critical_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Warning:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Warning_128_x_115);
+ break;
+ case KryptonToastNotificationIcon.Information:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Information_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Shield:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_11_128_x_128);
+ }
+ else if (OSUtilities.IsWindowsTen)
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_10_128_x_128);
+ }
+ else
+ {
+ SetIcon(ToastNotificationImageResources.Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128);
+ }
+ break;
+ case KryptonToastNotificationIcon.WindowsLogo:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_11_128_128);
+ }
+ else if (OSUtilities.IsWindowsEight || OSUtilities.IsWindowsEightPointOne || OSUtilities.IsWindowsTen)
+ {
+ SetIcon(WindowsLogoImageResources.Windows_8_81_10_128_128);
+ }
+ else
+ {
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.WinLogo.ToBitmap(), new Size(128, 128)));
+ }
+ break;
+ case KryptonToastNotificationIcon.Application:
+ SetIcon(GraphicsExtensions.ScaleImage(_data.ApplicationIcon.ToBitmap(), new Size(128, 128)));
+ break;
+ case KryptonToastNotificationIcon.SystemApplication:
+ SetIcon(GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), 128, 128));
+ break;
+ case KryptonToastNotificationIcon.Ok:
+ SetIcon(ToastNotificationImageResources.Toast_Notification_Ok_128_x_128);
+ break;
+ case KryptonToastNotificationIcon.Custom:
+ SetIcon(_data.CustomImage != null
+ ? new Bitmap(_data.CustomImage)
+ : null);
+ break;
+ case null:
+ SetIcon(null);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+
+ private void ShowCloseButton()
+ {
+ CloseBox = _data.ShowCloseBox ?? false;
+
+ FormBorderStyle = CloseBox ? FormBorderStyle.Fixed3D : FormBorderStyle.FixedSingle;
+
+ ControlBox = _data.ShowCloseBox ?? false;
+ }
+
+ private void itbDismiss_Click(object sender, EventArgs e) => Close();
+
+ private void VisualToastNotificationTextBoxUserInputWithProgressBarRtlAwareForm_Resize(object? sender, EventArgs e)
+ {
+ if (WindowState == FormWindowState.Maximized)
+ {
+ WindowState = FormWindowState.Normal;
+ }
+ }
+
+ private void VisualToastNotificationTextBoxUserInputWithProgressBarRtlAwareForm_Load(object sender, EventArgs e)
+ {
+ UpdateIcon();
+
+ UpdateLocation();
+
+ ShowCloseButton();
+
+ kbtnDismiss.Text = KryptonManager.Strings.ToastNotificationStrings.Dismiss;
+
+ itbDismiss.Text = KryptonManager.Strings.ToastNotificationStrings.Dismiss;
+
+ _timer.Start();
+ }
+
+ private void VisualToastNotificationTextBoxUserInputWithProgressBarRtlAwareForm_LocationChanged(object sender, EventArgs e) => UpdateLocation();
+
+ public new DialogResult ShowDialog()
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ UpdateLocation();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kpbCountDown.Maximum = _data.CountDownSeconds ?? 100;
+
+ kpbCountDown.Value = kpbCountDown.Maximum;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kpbCountDown.Value -= 1;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ if (kpbCountDown.Value == kpbCountDown.Minimum)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog();
+ }
+
+ public new DialogResult ShowDialog(IWin32Window owner)
+ {
+ TopMost = _data.TopMost ?? true;
+
+ UpdateText();
+
+ UpdateIcon();
+
+ UpdateInitialValues();
+
+ if (_data.CountDownSeconds != 0)
+ {
+ kpbCountDown.Maximum = _data.CountDownSeconds ?? 100;
+
+ kpbCountDown.Value = kpbCountDown.Maximum;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ _timer = new Timer();
+
+ _timer.Interval = _data.CountDownTimerInterval ?? 1000;
+
+ _timer.Tick += (sender, args) =>
+ {
+ _time++;
+
+ kpbCountDown.Value -= 1;
+
+ kpbCountDown.Text = $@"{_data.CountDownSeconds - _time}";
+
+ if (kpbCountDown.Value == kpbCountDown.Minimum)
+ {
+ _timer.Stop();
+
+ Close();
+ }
+ };
+ }
+
+ return base.ShowDialog(owner);
+ }
+
+ internal static string ShowNotification(KryptonUserInputToastNotificationData data)
+ {
+ var owner = data.ToastHost ?? FromHandle(PI.GetActiveWindow());
+
+ using var toast = new VisualToastNotificationTextBoxUserInputWithProgressBarRtlAwareForm(data);
+
+ if (owner != null)
+ {
+ toast.StartPosition = owner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
+
+ return toast.ShowDialog(owner!) == DialogResult.OK ? toast.UserResponse : GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+ else
+ {
+ return toast.ShowDialog() == DialogResult.OK ? toast.UserResponse : GlobalStaticValues.DEFAULT_EMPTY_STRING;
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationTextBoxUserInputWithProgressBarRtlAwareForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationTextBoxUserInputWithProgressBarRtlAwareForm.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Notification Toast/User Input/RTL/ProgressBar/VisualToastNotificationTextBoxUserInputWithProgressBarRtlAwareForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Outlook Grid/VisualCustomFormatRuleForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Outlook Grid/VisualCustomFormatRuleForm.Designer.cs
new file mode 100644
index 000000000..82403668e
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Outlook Grid/VisualCustomFormatRuleForm.Designer.cs
@@ -0,0 +1,368 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualCustomFormatRuleForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(VisualCustomFormatRuleForm));
+ this.kpnlButtons = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnCancel = new Krypton.Toolkit.KryptonButton();
+ this.kbtnOk = new Krypton.Toolkit.KryptonButton();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.klblFormat = new Krypton.Toolkit.KryptonLabel();
+ this.klblPreview = new Krypton.Toolkit.KryptonLabel();
+ this.klblFill = new Krypton.Toolkit.KryptonLabel();
+ this.kryptonGroup1 = new Krypton.Toolkit.KryptonGroup();
+ this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
+ this.kcolbtnMinimumColor = new Krypton.Toolkit.KryptonColorButton();
+ this.kcolbtnIntermediateColor = new Krypton.Toolkit.KryptonColorButton();
+ this.kcolbtnMaximumColor = new Krypton.Toolkit.KryptonColorButton();
+ this.kcmbFormatStyle = new Krypton.Toolkit.KryptonComboBox();
+ this.kpbxPreview = new Krypton.Toolkit.KryptonPictureBox();
+ this.kcmbFillMode = new Krypton.Toolkit.KryptonComboBox();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit();
+ this.kpnlButtons.SuspendLayout();
+ this.tableLayoutPanel1.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
+ this.kryptonPanel1.SuspendLayout();
+ this.tableLayoutPanel2.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonGroup1)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonGroup1.Panel)).BeginInit();
+ this.kryptonGroup1.Panel.SuspendLayout();
+ this.kryptonGroup1.SuspendLayout();
+ this.tableLayoutPanel3.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kcmbFormatStyle)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kpbxPreview)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kcmbFillMode)).BeginInit();
+ this.SuspendLayout();
+ //
+ // kpnlButtons
+ //
+ this.kpnlButtons.Controls.Add(this.tableLayoutPanel1);
+ this.kpnlButtons.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlButtons.Location = new System.Drawing.Point(0, 194);
+ this.kpnlButtons.Name = "kpnlButtons";
+ this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlButtons.Size = new System.Drawing.Size(692, 50);
+ this.kpnlButtons.TabIndex = 0;
+ //
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel1.ColumnCount = 2;
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel1.Controls.Add(this.kbtnCancel, 1, 0);
+ this.tableLayoutPanel1.Controls.Add(this.kbtnOk, 0, 0);
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 1;
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(692, 49);
+ this.tableLayoutPanel1.TabIndex = 1;
+ //
+ // kbtnCancel
+ //
+ this.kbtnCancel.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnCancel.AutoSize = true;
+ this.kbtnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this.kbtnCancel.Location = new System.Drawing.Point(588, 13);
+ this.kbtnCancel.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnCancel.Name = "kbtnCancel";
+ this.kbtnCancel.Size = new System.Drawing.Size(94, 22);
+ this.kbtnCancel.TabIndex = 0;
+ this.kbtnCancel.Values.Text = "kryptonButton1";
+ this.kbtnCancel.Click += new System.EventHandler(this.kbtnCancel_Click);
+ //
+ // kbtnOk
+ //
+ this.kbtnOk.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnOk.AutoSize = true;
+ this.kbtnOk.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.kbtnOk.Enabled = false;
+ this.kbtnOk.Location = new System.Drawing.Point(474, 13);
+ this.kbtnOk.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnOk.Name = "kbtnOk";
+ this.kbtnOk.Size = new System.Drawing.Size(94, 22);
+ this.kbtnOk.TabIndex = 1;
+ this.kbtnOk.Values.Text = "kryptonButton2";
+ this.kbtnOk.Click += new System.EventHandler(this.kbtnOk_Click);
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderSecondary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(692, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kryptonPanel1
+ //
+ this.kryptonPanel1.Controls.Add(this.tableLayoutPanel2);
+ this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonPanel1.Name = "kryptonPanel1";
+ this.kryptonPanel1.Size = new System.Drawing.Size(692, 194);
+ this.kryptonPanel1.TabIndex = 1;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel2.ColumnCount = 2;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Controls.Add(this.klblFormat, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.klblPreview, 0, 1);
+ this.tableLayoutPanel2.Controls.Add(this.klblFill, 0, 3);
+ this.tableLayoutPanel2.Controls.Add(this.kryptonGroup1, 0, 2);
+ this.tableLayoutPanel2.Controls.Add(this.kcmbFormatStyle, 1, 0);
+ this.tableLayoutPanel2.Controls.Add(this.kpbxPreview, 1, 1);
+ this.tableLayoutPanel2.Controls.Add(this.kcmbFillMode, 1, 3);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 0);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 4;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(692, 194);
+ this.tableLayoutPanel2.TabIndex = 0;
+ //
+ // klblFormat
+ //
+ this.klblFormat.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.klblFormat.LabelStyle = Krypton.Toolkit.LabelStyle.BoldPanel;
+ this.klblFormat.Location = new System.Drawing.Point(10, 10);
+ this.klblFormat.Margin = new System.Windows.Forms.Padding(10);
+ this.klblFormat.Name = "klblFormat";
+ this.klblFormat.Size = new System.Drawing.Size(94, 21);
+ this.klblFormat.TabIndex = 0;
+ this.klblFormat.Values.Text = "kryptonLabel1";
+ //
+ // klblPreview
+ //
+ this.klblPreview.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.klblPreview.LabelStyle = Krypton.Toolkit.LabelStyle.BoldPanel;
+ this.klblPreview.Location = new System.Drawing.Point(10, 51);
+ this.klblPreview.Margin = new System.Windows.Forms.Padding(10);
+ this.klblPreview.Name = "klblPreview";
+ this.klblPreview.Size = new System.Drawing.Size(94, 22);
+ this.klblPreview.TabIndex = 1;
+ this.klblPreview.Values.Text = "kryptonLabel2";
+ //
+ // klblFill
+ //
+ this.klblFill.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.klblFill.Location = new System.Drawing.Point(10, 149);
+ this.klblFill.Margin = new System.Windows.Forms.Padding(10);
+ this.klblFill.Name = "klblFill";
+ this.klblFill.Size = new System.Drawing.Size(94, 35);
+ this.klblFill.TabIndex = 2;
+ this.klblFill.Values.Text = "kryptonLabel3";
+ //
+ // kryptonGroup1
+ //
+ this.tableLayoutPanel2.SetColumnSpan(this.kryptonGroup1, 2);
+ this.kryptonGroup1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kryptonGroup1.GroupBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kryptonGroup1.Location = new System.Drawing.Point(10, 93);
+ this.kryptonGroup1.Margin = new System.Windows.Forms.Padding(10);
+ this.kryptonGroup1.Name = "kryptonGroup1";
+ //
+ // kryptonGroup1.Panel
+ //
+ this.kryptonGroup1.Panel.Controls.Add(this.tableLayoutPanel3);
+ this.kryptonGroup1.Size = new System.Drawing.Size(672, 36);
+ this.kryptonGroup1.TabIndex = 3;
+ //
+ // tableLayoutPanel3
+ //
+ this.tableLayoutPanel3.ColumnCount = 3;
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel3.Controls.Add(this.kcolbtnMinimumColor, 0, 0);
+ this.tableLayoutPanel3.Controls.Add(this.kcolbtnIntermediateColor, 1, 0);
+ this.tableLayoutPanel3.Controls.Add(this.kcolbtnMaximumColor, 2, 0);
+ this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel3.Location = new System.Drawing.Point(0, 0);
+ this.tableLayoutPanel3.Name = "tableLayoutPanel3";
+ this.tableLayoutPanel3.RowCount = 1;
+ this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel3.Size = new System.Drawing.Size(670, 34);
+ this.tableLayoutPanel3.TabIndex = 0;
+ //
+ // kcolbtnMinimumColor
+ //
+ this.kcolbtnMinimumColor.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.kcolbtnMinimumColor.AutoSize = true;
+ this.kcolbtnMinimumColor.CustomColorPreviewShape = Krypton.Toolkit.KryptonColorButtonCustomColorPreviewShape.Circle;
+ this.kcolbtnMinimumColor.Location = new System.Drawing.Point(5, 6);
+ this.kcolbtnMinimumColor.Margin = new System.Windows.Forms.Padding(5);
+ this.kcolbtnMinimumColor.Name = "kcolbtnMinimumColor";
+ this.kcolbtnMinimumColor.SelectedColor = System.Drawing.Color.Transparent;
+ this.kcolbtnMinimumColor.Size = new System.Drawing.Size(152, 22);
+ this.kcolbtnMinimumColor.TabIndex = 0;
+ this.kcolbtnMinimumColor.Values.Image = ((System.Drawing.Image)(resources.GetObject("kcolbtnMinimumColor.Values.Image")));
+ this.kcolbtnMinimumColor.Values.RoundedCorners = 8;
+ this.kcolbtnMinimumColor.Values.Text = "kryptonColorButton1";
+ this.kcolbtnMinimumColor.SelectedColorChanged += new System.EventHandler(this.kcolbtnMinimumColor_SelectedColorChanged);
+ //
+ // kcolbtnIntermediateColor
+ //
+ this.kcolbtnIntermediateColor.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.kcolbtnIntermediateColor.AutoSize = true;
+ this.kcolbtnIntermediateColor.CustomColorPreviewShape = Krypton.Toolkit.KryptonColorButtonCustomColorPreviewShape.Circle;
+ this.kcolbtnIntermediateColor.Location = new System.Drawing.Point(167, 6);
+ this.kcolbtnIntermediateColor.Margin = new System.Windows.Forms.Padding(5);
+ this.kcolbtnIntermediateColor.Name = "kcolbtnIntermediateColor";
+ this.kcolbtnIntermediateColor.SelectedColor = System.Drawing.Color.Transparent;
+ this.kcolbtnIntermediateColor.Size = new System.Drawing.Size(152, 22);
+ this.kcolbtnIntermediateColor.TabIndex = 1;
+ this.kcolbtnIntermediateColor.Values.Image = ((System.Drawing.Image)(resources.GetObject("kcolbtnIntermediateColor.Values.Image")));
+ this.kcolbtnIntermediateColor.Values.RoundedCorners = 8;
+ this.kcolbtnIntermediateColor.Values.Text = "kryptonColorButton2";
+ this.kcolbtnIntermediateColor.SelectedColorChanged += new System.EventHandler(this.kcolbtnIntermediateColor_SelectedColorChanged);
+ //
+ // kcolbtnMaximumColor
+ //
+ this.kcolbtnMaximumColor.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.kcolbtnMaximumColor.AutoSize = true;
+ this.kcolbtnMaximumColor.CustomColorPreviewShape = Krypton.Toolkit.KryptonColorButtonCustomColorPreviewShape.Circle;
+ this.kcolbtnMaximumColor.Location = new System.Drawing.Point(329, 6);
+ this.kcolbtnMaximumColor.Margin = new System.Windows.Forms.Padding(5);
+ this.kcolbtnMaximumColor.Name = "kcolbtnMaximumColor";
+ this.kcolbtnMaximumColor.SelectedColor = System.Drawing.Color.Transparent;
+ this.kcolbtnMaximumColor.Size = new System.Drawing.Size(152, 22);
+ this.kcolbtnMaximumColor.TabIndex = 2;
+ this.kcolbtnMaximumColor.Values.Image = ((System.Drawing.Image)(resources.GetObject("kcolbtnMaximumColor.Values.Image")));
+ this.kcolbtnMaximumColor.Values.RoundedCorners = 8;
+ this.kcolbtnMaximumColor.Values.Text = "kryptonColorButton3";
+ this.kcolbtnMaximumColor.SelectedColorChanged += new System.EventHandler(this.kcolbtnMaximumColor_SelectedColorChanged);
+ //
+ // kcmbFormatStyle
+ //
+ this.kcmbFormatStyle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.kcmbFormatStyle.DropDownWidth = 318;
+ this.kcmbFormatStyle.IntegralHeight = false;
+ this.kcmbFormatStyle.Location = new System.Drawing.Point(124, 10);
+ this.kcmbFormatStyle.Margin = new System.Windows.Forms.Padding(10);
+ this.kcmbFormatStyle.Name = "kcmbFormatStyle";
+ this.kcmbFormatStyle.Size = new System.Drawing.Size(318, 21);
+ this.kcmbFormatStyle.StateCommon.ComboBox.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near;
+ this.kcmbFormatStyle.TabIndex = 4;
+ this.kcmbFormatStyle.SelectedIndexChanged += new System.EventHandler(this.kcmbFormatStyle_SelectedIndexChanged);
+ //
+ // kpbxPreview
+ //
+ this.kpbxPreview.Location = new System.Drawing.Point(124, 51);
+ this.kpbxPreview.Margin = new System.Windows.Forms.Padding(10);
+ this.kpbxPreview.Name = "kpbxPreview";
+ this.kpbxPreview.Size = new System.Drawing.Size(318, 22);
+ this.kpbxPreview.TabIndex = 5;
+ this.kpbxPreview.TabStop = false;
+ this.kpbxPreview.Paint += new System.Windows.Forms.PaintEventHandler(this.kpbxPreview_Paint);
+ //
+ // kcmbFillMode
+ //
+ this.kcmbFillMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.kcmbFillMode.DropDownWidth = 208;
+ this.kcmbFillMode.IntegralHeight = false;
+ this.kcmbFillMode.Location = new System.Drawing.Point(124, 149);
+ this.kcmbFillMode.Margin = new System.Windows.Forms.Padding(10);
+ this.kcmbFillMode.Name = "kcmbFillMode";
+ this.kcmbFillMode.Size = new System.Drawing.Size(208, 21);
+ this.kcmbFillMode.StateCommon.ComboBox.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near;
+ this.kcmbFillMode.TabIndex = 6;
+ this.kcmbFillMode.SelectedIndexChanged += new System.EventHandler(this.kcmbFillMode_SelectedIndexChanged);
+ //
+ // VisualCustomFormatRuleForm
+ //
+ this.AcceptButton = this.kbtnOk;
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.CancelButton = this.kbtnCancel;
+ this.ClientSize = new System.Drawing.Size(692, 244);
+ this.Controls.Add(this.kryptonPanel1);
+ this.Controls.Add(this.kpnlButtons);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
+ this.Name = "VisualCustomFormatRuleForm";
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+ this.Load += new System.EventHandler(this.VisualCustomFormatRuleForm_Load);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit();
+ this.kpnlButtons.ResumeLayout(false);
+ this.kpnlButtons.PerformLayout();
+ this.tableLayoutPanel1.ResumeLayout(false);
+ this.tableLayoutPanel1.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
+ this.kryptonPanel1.ResumeLayout(false);
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonGroup1.Panel)).EndInit();
+ this.kryptonGroup1.Panel.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonGroup1)).EndInit();
+ this.kryptonGroup1.ResumeLayout(false);
+ this.tableLayoutPanel3.ResumeLayout(false);
+ this.tableLayoutPanel3.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kcmbFormatStyle)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kpbxPreview)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kcmbFillMode)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kpnlButtons;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private KryptonPanel kryptonPanel1;
+ private TableLayoutPanel tableLayoutPanel1;
+ private TableLayoutPanel tableLayoutPanel2;
+ private KryptonLabel klblFormat;
+ private KryptonLabel klblPreview;
+ private KryptonLabel klblFill;
+ private KryptonGroup kryptonGroup1;
+ private TableLayoutPanel tableLayoutPanel3;
+ private KryptonColorButton kcolbtnMinimumColor;
+ private KryptonColorButton kcolbtnIntermediateColor;
+ private KryptonColorButton kcolbtnMaximumColor;
+ private KryptonComboBox kcmbFormatStyle;
+ private KryptonPictureBox kpbxPreview;
+ private KryptonComboBox kcmbFillMode;
+ private KryptonButton kbtnCancel;
+ private KryptonButton kbtnOk;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Outlook Grid/VisualCustomFormatRuleForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Outlook Grid/VisualCustomFormatRuleForm.cs
new file mode 100644
index 000000000..a08470e45
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Outlook Grid/VisualCustomFormatRuleForm.cs
@@ -0,0 +1,269 @@
+#region Licences
+
+/*
+ *
+ * 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. 2024 - 2024. All rights reserved.
+ *
+ */
+
+//--------------------------------------------------------------------------------
+// Copyright (C) 2013-2021 JDH Software -
+//
+// This program is provided to you under the terms of the Microsoft Public
+// License (Ms-PL) as published at https://github.com/Cocotteseb/Krypton-OutlookGrid/blob/master/LICENSE.md
+//
+// Visit https://www.jdhsoftware.com and follow @jdhsoftware on Twitter
+//
+//--------------------------------------------------------------------------------
+
+#endregion
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualCustomFormatRuleForm : KryptonForm
+ {
+ #region Instance Fields
+
+ private bool _gradient;
+
+ private Color _minimumColor;
+
+ private Color _maximumColor;
+
+ private Color _intermediateColor;
+
+ private EnumConditionalFormatType _conditionalFormatType;
+
+ #endregion
+
+ #region Public
+
+ public bool Gradient => _gradient;
+
+ public Color MaximumColor => _maximumColor;
+
+ public Color MinimumColor => _minimumColor;
+
+ public Color IntermediateColor => _intermediateColor;
+
+ #endregion
+
+ #region Identity
+
+ /// Initializes a new instance of the class.
+ /// Type of the conditional format.
+ public VisualCustomFormatRuleForm(EnumConditionalFormatType conditionalFormatType)
+ {
+ InitializeComponent();
+
+ _conditionalFormatType = conditionalFormatType;
+
+ Initialize();
+ }
+
+ #endregion
+
+ #region Implementation
+
+ private void Initialize()
+ {
+ // Set up text
+ Text = KryptonManager.Strings.OutlookGridStrings.CustomFormatWindowTitle;
+
+ klblFill.Text = KryptonManager.Strings.OutlookGridStrings.CustomFormatFillLabelText;
+
+ klblFormat.Text = KryptonManager.Strings.OutlookGridStrings.CustomFormatLabelText;
+
+ klblPreview.Text = KryptonManager.Strings.OutlookGridStrings.CustomFormatPreviewLabelText;
+
+ kcolbtnIntermediateColor.Text = KryptonManager.Strings.OutlookGridStrings
+ .CustomFormatIntermediateColorButtonText;
+
+ kcolbtnMaximumColor.Text =
+ KryptonManager.Strings.OutlookGridStrings.CustomFormatMaximumColorButtonText;
+
+ kcolbtnMinimumColor.Text =
+ KryptonManager.Strings.OutlookGridStrings.CustomFormatMinimumColorButtonText;
+
+ kbtnCancel.Text = KryptonManager.Strings.GeneralStrings.Cancel;
+
+ kbtnOk.Text = KryptonManager.Strings.GeneralStrings.OK;
+
+ kcmbFillMode.SelectedIndex = 0;
+
+ kcmbFormatStyle.SelectedIndex = -1;
+
+ _maximumColor = Color.FromArgb(243, 120, 97);
+
+ _intermediateColor = Color.FromArgb(252, 229, 130);
+
+ _minimumColor = Color.FromArgb(84, 179, 122);
+ }
+
+ private void VisualCustomFormatRuleForm_Load(object sender, EventArgs e)
+ {
+ kcolbtnMinimumColor.SelectedColor = _minimumColor;
+
+ kcolbtnIntermediateColor.SelectedColor = _intermediateColor;
+
+ kcolbtnMaximumColor.SelectedColor = _maximumColor;
+
+ int selected = -1;
+
+ string[] names = Enum.GetNames(typeof(EnumConditionalFormatType));
+
+ for (int i = 0; i < names.Length; i++)
+ {
+ if (_conditionalFormatType.ToString().Equals(names[i]))
+ {
+ selected = i;
+ }
+
+ kcmbFormatStyle.Items.Add(new KryptonListItem(OutlookGridLanguageManager.Instance.GetString(names[i])));
+ }
+
+ kcmbFormatStyle.SelectedIndex = selected;
+ }
+
+ private void UpdateFormatType(EnumConditionalFormatType conditionalFormatType)
+ {
+ switch (conditionalFormatType)
+ {
+ case EnumConditionalFormatType.TwoColorsRange:
+ klblFill.Visible = false;
+ kcmbFillMode.Visible = false;
+ kcolbtnMinimumColor.Visible = true;
+ kcolbtnIntermediateColor.Visible = false;
+ kcolbtnMaximumColor.Visible = true;
+ break;
+ case EnumConditionalFormatType.ThreeColorsRange:
+ klblFill.Visible = false;
+ kcmbFillMode.Visible = false;
+ kcolbtnMinimumColor.Visible = true;
+ kcolbtnIntermediateColor.Visible = true;
+ kcolbtnMaximumColor.Visible = true;
+ break;
+ case EnumConditionalFormatType.Bar:
+ klblFill.Visible = true;
+ kcmbFillMode.Visible = true;
+ kcolbtnMinimumColor.Visible = true;
+ kcolbtnIntermediateColor.Visible = false;
+ kcolbtnMaximumColor.Visible = false;
+ break;
+ }
+
+ kpbxPreview.Invalidate();
+ }
+
+ private void kpbxPreview_Paint(object sender, PaintEventArgs e)
+ {
+ e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
+ switch (_conditionalFormatType)
+ {
+ case EnumConditionalFormatType.Bar:
+ if (_gradient)
+ {
+ using (LinearGradientBrush br = new LinearGradientBrush(e.ClipRectangle, _minimumColor, Color.White, LinearGradientMode.Horizontal))
+ {
+ e.Graphics.FillRectangle(br, e.ClipRectangle);
+ }
+ }
+ else
+ {
+ using (SolidBrush br = new SolidBrush(_minimumColor))
+ {
+ e.Graphics.FillRectangle(br, e.ClipRectangle);
+ }
+ }
+ using (Pen pen = new Pen(_minimumColor)) //Color.FromArgb(255, 140, 197, 66)))
+ {
+ Rectangle rect = e.ClipRectangle;
+ rect.Inflate(-1, -1);
+ e.Graphics.DrawRectangle(pen, rect);
+ }
+ break;
+ case EnumConditionalFormatType.TwoColorsRange:
+ // Draw the background gradient.
+ using (LinearGradientBrush br = new LinearGradientBrush(e.ClipRectangle, _minimumColor, _maximumColor, LinearGradientMode.Horizontal))
+ {
+ e.Graphics.FillRectangle(br, e.ClipRectangle);
+ }
+ break;
+ case EnumConditionalFormatType.ThreeColorsRange:
+ // Draw the background gradient.
+ using (LinearGradientBrush br = new LinearGradientBrush(e.ClipRectangle, _minimumColor, _maximumColor, LinearGradientMode.Horizontal))
+ {
+ ColorBlend blend = new ColorBlend();
+ blend.Colors = new[] { _minimumColor, _intermediateColor, _maximumColor };
+ blend.Positions = new[] { 0f, 0.5f, 1.0f };
+ br.InterpolationColors = blend;
+ e.Graphics.FillRectangle(br, e.ClipRectangle);
+ }
+ break;
+ }
+ }
+
+ private ArrayList GetEnumConditionalFormatTypeList()
+ {
+ ArrayList values = new ArrayList();
+
+ foreach (var value in Enum.GetValues(typeof(EnumConditionalFormatType)))
+ {
+ values.Add(value);
+ }
+
+ return values;
+ }
+
+ private void kbtnOk_Click(object sender, EventArgs e)
+ {
+ DialogResult = DialogResult.OK;
+ }
+
+ private void kbtnCancel_Click(object sender, EventArgs e)
+ {
+ DialogResult = DialogResult.Cancel;
+ }
+
+ private void kcolbtnMinimumColor_SelectedColorChanged(object sender, ColorEventArgs e)
+ {
+ _minimumColor = e.Color;
+
+ kpbxPreview.Invalidate();
+ }
+
+ private void kcolbtnIntermediateColor_SelectedColorChanged(object sender, ColorEventArgs e)
+ {
+ _intermediateColor = e.Color;
+
+ kpbxPreview.Invalidate();
+ }
+
+ private void kcolbtnMaximumColor_SelectedColorChanged(object sender, ColorEventArgs e)
+ {
+ _maximumColor = e.Color;
+
+ kpbxPreview.Invalidate();
+ }
+
+ private void kcmbFillMode_SelectedIndexChanged(object sender, EventArgs e)
+ {
+
+ }
+
+ private void kcmbFormatStyle_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ var tag = (kcmbFormatStyle.Items[kcmbFormatStyle.SelectedIndex] as KryptonListItem)?.Tag;
+
+ if (tag is not null)
+ {
+ _conditionalFormatType = (EnumConditionalFormatType)Enum.Parse(typeof(EnumConditionalFormatType), tag.ToString()!);
+ }
+
+ UpdateFormatType(_conditionalFormatType);
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Outlook Grid/VisualCustomFormatRuleForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Outlook Grid/VisualCustomFormatRuleForm.resx
new file mode 100644
index 000000000..ab0af0372
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Outlook Grid/VisualCustomFormatRuleForm.resx
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
+ DAAACwwBP0AiyAAAAAd0SU1FB9gBEgI0L+a2mIYAAAATSURBVDhPYxgFo2AUjAIwYGAAAAQQAAGnRHxj
+ AAAAAElFTkSuQmCC
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
+ DAAACwwBP0AiyAAAAAd0SU1FB9gBEgI0L+a2mIYAAAATSURBVDhPYxgFo2AUjAIwYGAAAAQQAAGnRHxj
+ AAAAAElFTkSuQmCC
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
+ DAAACwwBP0AiyAAAAAd0SU1FB9gBEgI0L+a2mIYAAAATSURBVDhPYxgFo2AUjAIwYGAAAAQQAAGnRHxj
+ AAAAAElFTkSuQmCC
+
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Outlook Grid/VisualCustomFormatRuleRtlAwareForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Outlook Grid/VisualCustomFormatRuleRtlAwareForm.Designer.cs
new file mode 100644
index 000000000..b47c5a058
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Outlook Grid/VisualCustomFormatRuleRtlAwareForm.Designer.cs
@@ -0,0 +1,368 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualCustomFormatRuleRtlAwareForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(VisualCustomFormatRuleRtlAwareForm));
+ this.kpnlButtons = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnCancel = new Krypton.Toolkit.KryptonButton();
+ this.kbtnOk = new Krypton.Toolkit.KryptonButton();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.klblFormat = new Krypton.Toolkit.KryptonLabel();
+ this.klblPreview = new Krypton.Toolkit.KryptonLabel();
+ this.klblFill = new Krypton.Toolkit.KryptonLabel();
+ this.kryptonGroup1 = new Krypton.Toolkit.KryptonGroup();
+ this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
+ this.kcolbtnMinimumColor = new Krypton.Toolkit.KryptonColorButton();
+ this.kcolbtnIntermediateColor = new Krypton.Toolkit.KryptonColorButton();
+ this.kcolbtnMaximumColor = new Krypton.Toolkit.KryptonColorButton();
+ this.kcmbFormatStyle = new Krypton.Toolkit.KryptonComboBox();
+ this.kpbxPreview = new Krypton.Toolkit.KryptonPictureBox();
+ this.kcmbFillMode = new Krypton.Toolkit.KryptonComboBox();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit();
+ this.kpnlButtons.SuspendLayout();
+ this.tableLayoutPanel1.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
+ this.kryptonPanel1.SuspendLayout();
+ this.tableLayoutPanel2.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonGroup1)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonGroup1.Panel)).BeginInit();
+ this.kryptonGroup1.Panel.SuspendLayout();
+ this.kryptonGroup1.SuspendLayout();
+ this.tableLayoutPanel3.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kcmbFormatStyle)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kpbxPreview)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kcmbFillMode)).BeginInit();
+ this.SuspendLayout();
+ //
+ // kpnlButtons
+ //
+ this.kpnlButtons.Controls.Add(this.tableLayoutPanel1);
+ this.kpnlButtons.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlButtons.Location = new System.Drawing.Point(0, 222);
+ this.kpnlButtons.Name = "kpnlButtons";
+ this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlButtons.Size = new System.Drawing.Size(720, 50);
+ this.kpnlButtons.TabIndex = 1;
+ //
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel1.ColumnCount = 2;
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel1.Controls.Add(this.kbtnCancel, 1, 0);
+ this.tableLayoutPanel1.Controls.Add(this.kbtnOk, 0, 0);
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 1;
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(720, 49);
+ this.tableLayoutPanel1.TabIndex = 1;
+ //
+ // kbtnCancel
+ //
+ this.kbtnCancel.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnCancel.AutoSize = true;
+ this.kbtnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this.kbtnCancel.Location = new System.Drawing.Point(10, 13);
+ this.kbtnCancel.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnCancel.Name = "kbtnCancel";
+ this.kbtnCancel.Size = new System.Drawing.Size(94, 22);
+ this.kbtnCancel.TabIndex = 0;
+ this.kbtnCancel.Values.Text = "kryptonButton1";
+ this.kbtnCancel.Click += new System.EventHandler(this.kbtnCancel_Click);
+ //
+ // kbtnOk
+ //
+ this.kbtnOk.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnOk.AutoSize = true;
+ this.kbtnOk.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.kbtnOk.Enabled = false;
+ this.kbtnOk.Location = new System.Drawing.Point(124, 13);
+ this.kbtnOk.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnOk.Name = "kbtnOk";
+ this.kbtnOk.Size = new System.Drawing.Size(94, 22);
+ this.kbtnOk.TabIndex = 1;
+ this.kbtnOk.Values.Text = "kryptonButton2";
+ this.kbtnOk.Click += new System.EventHandler(this.kbtnOk_Click);
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderSecondary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(720, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kryptonPanel1
+ //
+ this.kryptonPanel1.Controls.Add(this.tableLayoutPanel2);
+ this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonPanel1.Name = "kryptonPanel1";
+ this.kryptonPanel1.Size = new System.Drawing.Size(720, 222);
+ this.kryptonPanel1.TabIndex = 2;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel2.ColumnCount = 2;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Controls.Add(this.klblFormat, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.klblPreview, 0, 1);
+ this.tableLayoutPanel2.Controls.Add(this.klblFill, 0, 3);
+ this.tableLayoutPanel2.Controls.Add(this.kryptonGroup1, 0, 2);
+ this.tableLayoutPanel2.Controls.Add(this.kcmbFormatStyle, 1, 0);
+ this.tableLayoutPanel2.Controls.Add(this.kpbxPreview, 1, 1);
+ this.tableLayoutPanel2.Controls.Add(this.kcmbFillMode, 1, 3);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 0);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 4;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(720, 222);
+ this.tableLayoutPanel2.TabIndex = 0;
+ //
+ // klblFormat
+ //
+ this.klblFormat.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.klblFormat.LabelStyle = Krypton.Toolkit.LabelStyle.BoldPanel;
+ this.klblFormat.Location = new System.Drawing.Point(615, 10);
+ this.klblFormat.Margin = new System.Windows.Forms.Padding(10);
+ this.klblFormat.Name = "klblFormat";
+ this.klblFormat.Size = new System.Drawing.Size(95, 21);
+ this.klblFormat.TabIndex = 0;
+ this.klblFormat.Values.Text = "kryptonLabel1";
+ //
+ // klblPreview
+ //
+ this.klblPreview.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.klblPreview.LabelStyle = Krypton.Toolkit.LabelStyle.BoldPanel;
+ this.klblPreview.Location = new System.Drawing.Point(615, 51);
+ this.klblPreview.Margin = new System.Windows.Forms.Padding(10);
+ this.klblPreview.Name = "klblPreview";
+ this.klblPreview.Size = new System.Drawing.Size(95, 22);
+ this.klblPreview.TabIndex = 1;
+ this.klblPreview.Values.Text = "kryptonLabel2";
+ //
+ // klblFill
+ //
+ this.klblFill.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.klblFill.Location = new System.Drawing.Point(615, 149);
+ this.klblFill.Margin = new System.Windows.Forms.Padding(10);
+ this.klblFill.Name = "klblFill";
+ this.klblFill.Size = new System.Drawing.Size(95, 63);
+ this.klblFill.TabIndex = 2;
+ this.klblFill.Values.Text = "kryptonLabel3";
+ //
+ // kryptonGroup1
+ //
+ this.tableLayoutPanel2.SetColumnSpan(this.kryptonGroup1, 2);
+ this.kryptonGroup1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kryptonGroup1.GroupBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kryptonGroup1.Location = new System.Drawing.Point(10, 93);
+ this.kryptonGroup1.Margin = new System.Windows.Forms.Padding(10);
+ this.kryptonGroup1.Name = "kryptonGroup1";
+ //
+ // kryptonGroup1.Panel
+ //
+ this.kryptonGroup1.Panel.Controls.Add(this.tableLayoutPanel3);
+ this.kryptonGroup1.Size = new System.Drawing.Size(700, 36);
+ this.kryptonGroup1.TabIndex = 3;
+ //
+ // tableLayoutPanel3
+ //
+ this.tableLayoutPanel3.ColumnCount = 3;
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel3.Controls.Add(this.kcolbtnMinimumColor, 0, 0);
+ this.tableLayoutPanel3.Controls.Add(this.kcolbtnIntermediateColor, 1, 0);
+ this.tableLayoutPanel3.Controls.Add(this.kcolbtnMaximumColor, 2, 0);
+ this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel3.Location = new System.Drawing.Point(0, 0);
+ this.tableLayoutPanel3.Name = "tableLayoutPanel3";
+ this.tableLayoutPanel3.RowCount = 1;
+ this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel3.Size = new System.Drawing.Size(698, 34);
+ this.tableLayoutPanel3.TabIndex = 0;
+ //
+ // kcolbtnMinimumColor
+ //
+ this.kcolbtnMinimumColor.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.kcolbtnMinimumColor.AutoSize = true;
+ this.kcolbtnMinimumColor.CustomColorPreviewShape = Krypton.Toolkit.KryptonColorButtonCustomColorPreviewShape.Circle;
+ this.kcolbtnMinimumColor.Location = new System.Drawing.Point(541, 6);
+ this.kcolbtnMinimumColor.Margin = new System.Windows.Forms.Padding(5);
+ this.kcolbtnMinimumColor.Name = "kcolbtnMinimumColor";
+ this.kcolbtnMinimumColor.SelectedColor = System.Drawing.Color.Transparent;
+ this.kcolbtnMinimumColor.Size = new System.Drawing.Size(152, 22);
+ this.kcolbtnMinimumColor.TabIndex = 0;
+ this.kcolbtnMinimumColor.Values.Image = ((System.Drawing.Image)(resources.GetObject("kcolbtnMinimumColor.Values.Image")));
+ this.kcolbtnMinimumColor.Values.RoundedCorners = 8;
+ this.kcolbtnMinimumColor.Values.Text = "kryptonColorButton1";
+ this.kcolbtnMinimumColor.SelectedColorChanged += new System.EventHandler(this.kcolbtnMinimumColor_SelectedColorChanged);
+ //
+ // kcolbtnIntermediateColor
+ //
+ this.kcolbtnIntermediateColor.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.kcolbtnIntermediateColor.AutoSize = true;
+ this.kcolbtnIntermediateColor.CustomColorPreviewShape = Krypton.Toolkit.KryptonColorButtonCustomColorPreviewShape.Circle;
+ this.kcolbtnIntermediateColor.Location = new System.Drawing.Point(379, 6);
+ this.kcolbtnIntermediateColor.Margin = new System.Windows.Forms.Padding(5);
+ this.kcolbtnIntermediateColor.Name = "kcolbtnIntermediateColor";
+ this.kcolbtnIntermediateColor.SelectedColor = System.Drawing.Color.Transparent;
+ this.kcolbtnIntermediateColor.Size = new System.Drawing.Size(152, 22);
+ this.kcolbtnIntermediateColor.TabIndex = 1;
+ this.kcolbtnIntermediateColor.Values.Image = ((System.Drawing.Image)(resources.GetObject("kcolbtnIntermediateColor.Values.Image")));
+ this.kcolbtnIntermediateColor.Values.RoundedCorners = 8;
+ this.kcolbtnIntermediateColor.Values.Text = "kryptonColorButton2";
+ this.kcolbtnIntermediateColor.SelectedColorChanged += new System.EventHandler(this.kcolbtnIntermediateColor_SelectedColorChanged);
+ //
+ // kcolbtnMaximumColor
+ //
+ this.kcolbtnMaximumColor.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.kcolbtnMaximumColor.AutoSize = true;
+ this.kcolbtnMaximumColor.CustomColorPreviewShape = Krypton.Toolkit.KryptonColorButtonCustomColorPreviewShape.Circle;
+ this.kcolbtnMaximumColor.Location = new System.Drawing.Point(217, 6);
+ this.kcolbtnMaximumColor.Margin = new System.Windows.Forms.Padding(5);
+ this.kcolbtnMaximumColor.Name = "kcolbtnMaximumColor";
+ this.kcolbtnMaximumColor.SelectedColor = System.Drawing.Color.Transparent;
+ this.kcolbtnMaximumColor.Size = new System.Drawing.Size(152, 22);
+ this.kcolbtnMaximumColor.TabIndex = 2;
+ this.kcolbtnMaximumColor.Values.Image = ((System.Drawing.Image)(resources.GetObject("kcolbtnMaximumColor.Values.Image")));
+ this.kcolbtnMaximumColor.Values.RoundedCorners = 8;
+ this.kcolbtnMaximumColor.Values.Text = "kryptonColorButton3";
+ this.kcolbtnMaximumColor.SelectedColorChanged += new System.EventHandler(this.kcolbtnMaximumColor_SelectedColorChanged);
+ //
+ // kcmbFormatStyle
+ //
+ this.kcmbFormatStyle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.kcmbFormatStyle.DropDownWidth = 318;
+ this.kcmbFormatStyle.IntegralHeight = false;
+ this.kcmbFormatStyle.Location = new System.Drawing.Point(277, 10);
+ this.kcmbFormatStyle.Margin = new System.Windows.Forms.Padding(10);
+ this.kcmbFormatStyle.Name = "kcmbFormatStyle";
+ this.kcmbFormatStyle.Size = new System.Drawing.Size(318, 21);
+ this.kcmbFormatStyle.StateCommon.ComboBox.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near;
+ this.kcmbFormatStyle.TabIndex = 4;
+ this.kcmbFormatStyle.SelectedIndexChanged += new System.EventHandler(this.kcmbFormatStyle_SelectedIndexChanged);
+ //
+ // kpbxPreview
+ //
+ this.kpbxPreview.Location = new System.Drawing.Point(277, 51);
+ this.kpbxPreview.Margin = new System.Windows.Forms.Padding(10);
+ this.kpbxPreview.Name = "kpbxPreview";
+ this.kpbxPreview.Size = new System.Drawing.Size(318, 22);
+ this.kpbxPreview.TabIndex = 5;
+ this.kpbxPreview.TabStop = false;
+ this.kpbxPreview.Paint += new System.Windows.Forms.PaintEventHandler(this.kpbxPreview_Paint);
+ //
+ // kcmbFillMode
+ //
+ this.kcmbFillMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.kcmbFillMode.DropDownWidth = 208;
+ this.kcmbFillMode.IntegralHeight = false;
+ this.kcmbFillMode.Location = new System.Drawing.Point(387, 149);
+ this.kcmbFillMode.Margin = new System.Windows.Forms.Padding(10);
+ this.kcmbFillMode.Name = "kcmbFillMode";
+ this.kcmbFillMode.Size = new System.Drawing.Size(208, 21);
+ this.kcmbFillMode.StateCommon.ComboBox.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near;
+ this.kcmbFillMode.TabIndex = 6;
+ //
+ // VisualCustomFormatRuleRtlAwareForm
+ //
+ this.AcceptButton = this.kbtnOk;
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.CancelButton = this.kbtnCancel;
+ this.ClientSize = new System.Drawing.Size(720, 272);
+ this.Controls.Add(this.kryptonPanel1);
+ this.Controls.Add(this.kpnlButtons);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
+ this.Name = "VisualCustomFormatRuleRtlAwareForm";
+ this.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+ this.Load += new System.EventHandler(this.VisualCustomFormatRuleRtlAwareForm_Load);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit();
+ this.kpnlButtons.ResumeLayout(false);
+ this.kpnlButtons.PerformLayout();
+ this.tableLayoutPanel1.ResumeLayout(false);
+ this.tableLayoutPanel1.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
+ this.kryptonPanel1.ResumeLayout(false);
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonGroup1.Panel)).EndInit();
+ this.kryptonGroup1.Panel.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonGroup1)).EndInit();
+ this.kryptonGroup1.ResumeLayout(false);
+ this.tableLayoutPanel3.ResumeLayout(false);
+ this.tableLayoutPanel3.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kcmbFormatStyle)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kpbxPreview)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kcmbFillMode)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kpnlButtons;
+ private TableLayoutPanel tableLayoutPanel1;
+ private KryptonButton kbtnCancel;
+ private KryptonButton kbtnOk;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private KryptonPanel kryptonPanel1;
+ private TableLayoutPanel tableLayoutPanel2;
+ private KryptonLabel klblFormat;
+ private KryptonLabel klblPreview;
+ private KryptonLabel klblFill;
+ private KryptonGroup kryptonGroup1;
+ private TableLayoutPanel tableLayoutPanel3;
+ private KryptonColorButton kcolbtnMinimumColor;
+ private KryptonColorButton kcolbtnIntermediateColor;
+ private KryptonColorButton kcolbtnMaximumColor;
+ private KryptonComboBox kcmbFormatStyle;
+ private KryptonPictureBox kpbxPreview;
+ private KryptonComboBox kcmbFillMode;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Outlook Grid/VisualCustomFormatRuleRtlAwareForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Outlook Grid/VisualCustomFormatRuleRtlAwareForm.cs
new file mode 100644
index 000000000..b9b98c99d
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Outlook Grid/VisualCustomFormatRuleRtlAwareForm.cs
@@ -0,0 +1,251 @@
+#region Licences
+/*
+ *
+ * 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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualCustomFormatRuleRtlAwareForm : KryptonForm
+ {
+ #region Instance Fields
+
+ private bool _gradient;
+
+ private Color _minimumColor;
+
+ private Color _maximumColor;
+
+ private Color _intermediateColor;
+
+ private EnumConditionalFormatType _conditionalFormatType;
+
+ #endregion
+
+ #region Public
+
+ public bool Gradient => _gradient;
+
+ public Color MaximumColor => _maximumColor;
+
+ public Color MinimumColor => _minimumColor;
+
+ public Color IntermediateColor => _intermediateColor;
+
+ #endregion
+
+ #region Identity
+
+ public VisualCustomFormatRuleRtlAwareForm(EnumConditionalFormatType conditionalFormatType)
+ {
+ InitializeComponent();
+
+ _conditionalFormatType = conditionalFormatType;
+
+ Initialize();
+ }
+
+ #endregion
+
+ #region Implementation
+
+ private void Initialize()
+ {
+ // Set up text
+ Text = KryptonManager.Strings.OutlookGridStrings.CustomFormatWindowTitle;
+
+ klblFill.Text = KryptonManager.Strings.OutlookGridStrings.CustomFormatFillLabelText;
+
+ klblFormat.Text = KryptonManager.Strings.OutlookGridStrings.CustomFormatLabelText;
+
+ klblPreview.Text = KryptonManager.Strings.OutlookGridStrings.CustomFormatPreviewLabelText;
+
+ kcolbtnIntermediateColor.Text = KryptonManager.Strings.OutlookGridStrings
+ .CustomFormatIntermediateColorButtonText;
+
+ kcolbtnMaximumColor.Text =
+ KryptonManager.Strings.OutlookGridStrings.CustomFormatMaximumColorButtonText;
+
+ kcolbtnMinimumColor.Text =
+ KryptonManager.Strings.OutlookGridStrings.CustomFormatMinimumColorButtonText;
+
+ kbtnCancel.Text = KryptonManager.Strings.GeneralStrings.Cancel;
+
+ kbtnOk.Text = KryptonManager.Strings.GeneralStrings.OK;
+
+ kcmbFillMode.SelectedIndex = 0;
+
+ kcmbFormatStyle.SelectedIndex = -1;
+
+ _maximumColor = Color.FromArgb(243, 120, 97);
+
+ _intermediateColor = Color.FromArgb(252, 229, 130);
+
+ _minimumColor = Color.FromArgb(84, 179, 122);
+ }
+
+ private void VisualCustomFormatRuleRtlAwareForm_Load(object sender, EventArgs e)
+ {
+ kcolbtnMinimumColor.SelectedColor = _minimumColor;
+
+ kcolbtnIntermediateColor.SelectedColor = _intermediateColor;
+
+ kcolbtnMaximumColor.SelectedColor = _maximumColor;
+
+ int selected = -1;
+
+ string[] names = Enum.GetNames(typeof(EnumConditionalFormatType));
+
+ for (int i = 0; i < names.Length; i++)
+ {
+ if (_conditionalFormatType.ToString().Equals(names[i]))
+ {
+ selected = i;
+ }
+
+ kcmbFormatStyle.Items.Add(new KryptonListItem(OutlookGridLanguageManager.Instance.GetString(names[i])));
+ }
+
+ kcmbFormatStyle.SelectedIndex = selected;
+ }
+
+ private void UpdateFormatType(EnumConditionalFormatType conditionalFormatType)
+ {
+ switch (conditionalFormatType)
+ {
+ case EnumConditionalFormatType.TwoColorsRange:
+ klblFill.Visible = false;
+ kcmbFillMode.Visible = false;
+ kcolbtnMinimumColor.Visible = true;
+ kcolbtnIntermediateColor.Visible = false;
+ kcolbtnMaximumColor.Visible = true;
+ break;
+ case EnumConditionalFormatType.ThreeColorsRange:
+ klblFill.Visible = false;
+ kcmbFillMode.Visible = false;
+ kcolbtnMinimumColor.Visible = true;
+ kcolbtnIntermediateColor.Visible = true;
+ kcolbtnMaximumColor.Visible = true;
+ break;
+ case EnumConditionalFormatType.Bar:
+ klblFill.Visible = true;
+ kcmbFillMode.Visible = true;
+ kcolbtnMinimumColor.Visible = true;
+ kcolbtnIntermediateColor.Visible = false;
+ kcolbtnMaximumColor.Visible = false;
+ break;
+ }
+
+ kpbxPreview.Invalidate();
+ }
+
+ private void kpbxPreview_Paint(object sender, PaintEventArgs e)
+ {
+ e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
+ switch (_conditionalFormatType)
+ {
+ case EnumConditionalFormatType.Bar:
+ if (_gradient)
+ {
+ using (LinearGradientBrush br = new LinearGradientBrush(e.ClipRectangle, _minimumColor, Color.White, LinearGradientMode.Horizontal))
+ {
+ e.Graphics.FillRectangle(br, e.ClipRectangle);
+ }
+ }
+ else
+ {
+ using (SolidBrush br = new SolidBrush(_minimumColor))
+ {
+ e.Graphics.FillRectangle(br, e.ClipRectangle);
+ }
+ }
+ using (Pen pen = new Pen(_minimumColor)) //Color.FromArgb(255, 140, 197, 66)))
+ {
+ Rectangle rect = e.ClipRectangle;
+ rect.Inflate(-1, -1);
+ e.Graphics.DrawRectangle(pen, rect);
+ }
+ break;
+ case EnumConditionalFormatType.TwoColorsRange:
+ // Draw the background gradient.
+ using (LinearGradientBrush br = new LinearGradientBrush(e.ClipRectangle, _minimumColor, _maximumColor, LinearGradientMode.Horizontal))
+ {
+ e.Graphics.FillRectangle(br, e.ClipRectangle);
+ }
+ break;
+ case EnumConditionalFormatType.ThreeColorsRange:
+ // Draw the background gradient.
+ using (LinearGradientBrush br = new LinearGradientBrush(e.ClipRectangle, _minimumColor, _maximumColor, LinearGradientMode.Horizontal))
+ {
+ ColorBlend blend = new ColorBlend();
+ blend.Colors = new[] { _minimumColor, _intermediateColor, _maximumColor };
+ blend.Positions = new[] { 0f, 0.5f, 1.0f };
+ br.InterpolationColors = blend;
+ e.Graphics.FillRectangle(br, e.ClipRectangle);
+ }
+ break;
+ }
+ }
+
+ private ArrayList GetEnumConditionalFormatTypeList()
+ {
+ ArrayList values = new ArrayList();
+
+ foreach (var value in Enum.GetValues(typeof(EnumConditionalFormatType)))
+ {
+ values.Add(value);
+ }
+
+ return values;
+ }
+
+ private void kbtnOk_Click(object sender, EventArgs e)
+ {
+ DialogResult = DialogResult.OK;
+ }
+
+ private void kbtnCancel_Click(object sender, EventArgs e)
+ {
+ DialogResult = DialogResult.Cancel;
+ }
+
+ private void kcolbtnMinimumColor_SelectedColorChanged(object sender, ColorEventArgs e)
+ {
+ _minimumColor = e.Color;
+
+ kpbxPreview.Invalidate();
+ }
+
+ private void kcolbtnIntermediateColor_SelectedColorChanged(object sender, ColorEventArgs e)
+ {
+ _intermediateColor = e.Color;
+
+ kpbxPreview.Invalidate();
+ }
+
+ private void kcolbtnMaximumColor_SelectedColorChanged(object sender, ColorEventArgs e)
+ {
+ _maximumColor = e.Color;
+
+ kpbxPreview.Invalidate();
+ }
+
+ private void kcmbFormatStyle_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ var tag = (kcmbFormatStyle.Items[kcmbFormatStyle.SelectedIndex] as KryptonListItem)?.Tag;
+
+ if (tag is not null)
+ {
+ _conditionalFormatType =
+ (EnumConditionalFormatType)Enum.Parse(typeof(EnumConditionalFormatType), tag.ToString()!);
+ }
+
+ UpdateFormatType(_conditionalFormatType);
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Outlook Grid/VisualCustomFormatRuleRtlAwareForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Outlook Grid/VisualCustomFormatRuleRtlAwareForm.resx
new file mode 100644
index 000000000..ab0af0372
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/Outlook Grid/VisualCustomFormatRuleRtlAwareForm.resx
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
+ DAAACwwBP0AiyAAAAAd0SU1FB9gBEgI0L+a2mIYAAAATSURBVDhPYxgFo2AUjAIwYGAAAAQQAAGnRHxj
+ AAAAAElFTkSuQmCC
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
+ DAAACwwBP0AiyAAAAAd0SU1FB9gBEgI0L+a2mIYAAAATSURBVDhPYxgFo2AUjAIwYGAAAAQQAAGnRHxj
+ AAAAAElFTkSuQmCC
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
+ DAAACwwBP0AiyAAAAAd0SU1FB9gBEgI0L+a2mIYAAAATSURBVDhPYxgFo2AUjAIwYGAAAAQQAAGnRHxj
+ AAAAAElFTkSuQmCC
+
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualAboutBoxRtlAwareForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualAboutBoxRtlAwareForm.Designer.cs
new file mode 100644
index 000000000..72fc561df
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualAboutBoxRtlAwareForm.Designer.cs
@@ -0,0 +1,1130 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualAboutBoxRtlAwareForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ this.kpnlButtons = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnOk = new Krypton.Toolkit.KryptonButton();
+ this.kbtnSystemInformation = new Krypton.Toolkit.KryptonButton();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel();
+ this.khgMain = new Krypton.Toolkit.KryptonHeaderGroup();
+ this.tscMain = new System.Windows.Forms.ToolStripContainer();
+ this.kpnlGeneralInformation = new Krypton.Toolkit.KryptonPanel();
+ this.tlpnlGeneralInformation = new System.Windows.Forms.TableLayoutPanel();
+ this.pbxImage = new System.Windows.Forms.PictureBox();
+ this.kwlVersionLabel = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kwlBuiltOn = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kwlCopyright = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kryptonWrapLabel5 = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kpnlDescription = new Krypton.Toolkit.KryptonPanel();
+ this.krtbDescription = new Krypton.Toolkit.KryptonRichTextBox();
+ this.kpnlFileInformation = new Krypton.Toolkit.KryptonPanel();
+ this.tscFileInformation = new System.Windows.Forms.ToolStripContainer();
+ this.kpnlApplication = new Krypton.Toolkit.KryptonPanel();
+ this.kdgvApplication = new Krypton.Toolkit.KryptonDataGridView();
+ this.kpnlAssemblies = new Krypton.Toolkit.KryptonPanel();
+ this.kdgvAssemblies = new Krypton.Toolkit.KryptonDataGridView();
+ this.kpnlAssemblyDetails = new Krypton.Toolkit.KryptonPanel();
+ this.kiadAssemblyDetails = new Krypton.Toolkit.InternalAssemblyDetails();
+ this.tsFileInformation = new System.Windows.Forms.ToolStrip();
+ this.tsbtnApplicationDetails = new System.Windows.Forms.ToolStripButton();
+ this.tssAssembliesDetails = new System.Windows.Forms.ToolStripSeparator();
+ this.tsbtnAssembliesDetails = new System.Windows.Forms.ToolStripButton();
+ this.tssAssemblyDetails = new System.Windows.Forms.ToolStripSeparator();
+ this.tsbtnAssemblyDetails = new System.Windows.Forms.ToolStripButton();
+ this.kpnlTheme = new Krypton.Toolkit.KryptonPanel();
+ this.tlpTheme = new System.Windows.Forms.TableLayoutPanel();
+ this.kryptonThemeComboBox1 = new Krypton.Toolkit.KryptonThemeComboBox();
+ this.kwlCurrentTheme = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kpnlToolkitInformation = new Krypton.Toolkit.KryptonPanel();
+ this.tscToolkitInformation = new System.Windows.Forms.ToolStripContainer();
+ this.kpnlToolkitGeneralInformation = new Krypton.Toolkit.KryptonPanel();
+ this.tlpGeneralInformation = new System.Windows.Forms.TableLayoutPanel();
+ this.pbxLogo = new System.Windows.Forms.PictureBox();
+ this.klwlblGeneralInformation = new Krypton.Toolkit.KryptonLinkWrapLabel();
+ this.klblCurrentTheme = new Krypton.Toolkit.KryptonLabel();
+ this.ktcmbCurrentTheme = new Krypton.Toolkit.KryptonThemeComboBox();
+ this.klblBuiltOn = new Krypton.Toolkit.KryptonLabel();
+ this.kpnlDiscord = new Krypton.Toolkit.KryptonPanel();
+ this.klwlblDiscord = new Krypton.Toolkit.KryptonLinkWrapLabel();
+ this.kpnlDeveloperInformation = new Krypton.Toolkit.KryptonPanel();
+ this.tlpDeveloperInformation = new System.Windows.Forms.TableLayoutPanel();
+ this.klwlblRepositories = new Krypton.Toolkit.KryptonLinkWrapLabel();
+ this.klwlblDocumentation = new Krypton.Toolkit.KryptonLinkWrapLabel();
+ this.klwlblDemos = new Krypton.Toolkit.KryptonLinkWrapLabel();
+ this.kpnlVersions = new Krypton.Toolkit.KryptonPanel();
+ this.kdgvVersions = new Krypton.Toolkit.KryptonDataGridView();
+ this.tsToolkitInformation = new System.Windows.Forms.ToolStrip();
+ this.tsbtnToolkitGeneralInformation = new System.Windows.Forms.ToolStripButton();
+ this.tssDiscord = new System.Windows.Forms.ToolStripSeparator();
+ this.tsbtnDiscord = new System.Windows.Forms.ToolStripButton();
+ this.tssDeveloperInformation = new System.Windows.Forms.ToolStripSeparator();
+ this.tsbtnDeveloperInformation = new System.Windows.Forms.ToolStripButton();
+ this.tssVersions = new System.Windows.Forms.ToolStripSeparator();
+ this.tsbtnVersions = new System.Windows.Forms.ToolStripButton();
+ this.tsMain = new System.Windows.Forms.ToolStrip();
+ this.tsbtnGeneralInformation = new System.Windows.Forms.ToolStripButton();
+ this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
+ this.tsbtnDescription = new System.Windows.Forms.ToolStripButton();
+ this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
+ this.tsbtnFileInformation = new System.Windows.Forms.ToolStripButton();
+ this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
+ this.tsbtnTheme = new System.Windows.Forms.ToolStripButton();
+ this.tssToolkitInformation = new System.Windows.Forms.ToolStripSeparator();
+ this.tsbtnToolkitInformation = new System.Windows.Forms.ToolStripButton();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit();
+ this.kpnlButtons.SuspendLayout();
+ this.tableLayoutPanel1.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
+ this.kryptonPanel1.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.khgMain)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.khgMain.Panel)).BeginInit();
+ this.khgMain.Panel.SuspendLayout();
+ this.khgMain.SuspendLayout();
+ this.tscMain.ContentPanel.SuspendLayout();
+ this.tscMain.TopToolStripPanel.SuspendLayout();
+ this.tscMain.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlGeneralInformation)).BeginInit();
+ this.kpnlGeneralInformation.SuspendLayout();
+ this.tlpnlGeneralInformation.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxImage)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlDescription)).BeginInit();
+ this.kpnlDescription.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlFileInformation)).BeginInit();
+ this.kpnlFileInformation.SuspendLayout();
+ this.tscFileInformation.ContentPanel.SuspendLayout();
+ this.tscFileInformation.TopToolStripPanel.SuspendLayout();
+ this.tscFileInformation.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlApplication)).BeginInit();
+ this.kpnlApplication.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kdgvApplication)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlAssemblies)).BeginInit();
+ this.kpnlAssemblies.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kdgvAssemblies)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlAssemblyDetails)).BeginInit();
+ this.kpnlAssemblyDetails.SuspendLayout();
+ this.tsFileInformation.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlTheme)).BeginInit();
+ this.kpnlTheme.SuspendLayout();
+ this.tlpTheme.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonThemeComboBox1)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlToolkitInformation)).BeginInit();
+ this.kpnlToolkitInformation.SuspendLayout();
+ this.tscToolkitInformation.ContentPanel.SuspendLayout();
+ this.tscToolkitInformation.TopToolStripPanel.SuspendLayout();
+ this.tscToolkitInformation.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlToolkitGeneralInformation)).BeginInit();
+ this.kpnlToolkitGeneralInformation.SuspendLayout();
+ this.tlpGeneralInformation.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxLogo)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.ktcmbCurrentTheme)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlDiscord)).BeginInit();
+ this.kpnlDiscord.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlDeveloperInformation)).BeginInit();
+ this.kpnlDeveloperInformation.SuspendLayout();
+ this.tlpDeveloperInformation.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlVersions)).BeginInit();
+ this.kpnlVersions.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kdgvVersions)).BeginInit();
+ this.tsToolkitInformation.SuspendLayout();
+ this.tsMain.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // kpnlButtons
+ //
+ this.kpnlButtons.Controls.Add(this.tableLayoutPanel1);
+ this.kpnlButtons.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlButtons.Location = new System.Drawing.Point(0, 363);
+ this.kpnlButtons.Name = "kpnlButtons";
+ this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlButtons.Size = new System.Drawing.Size(786, 50);
+ this.kpnlButtons.TabIndex = 1;
+ //
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel1.ColumnCount = 2;
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel1.Controls.Add(this.kbtnOk, 1, 0);
+ this.tableLayoutPanel1.Controls.Add(this.kbtnSystemInformation, 0, 0);
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 1;
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 49F));
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(786, 49);
+ this.tableLayoutPanel1.TabIndex = 3;
+ //
+ // kbtnOk
+ //
+ this.kbtnOk.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnOk.AutoSize = true;
+ this.kbtnOk.Location = new System.Drawing.Point(10, 12);
+ this.kbtnOk.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnOk.Name = "kbtnOk";
+ this.kbtnOk.Size = new System.Drawing.Size(96, 24);
+ this.kbtnOk.TabIndex = 0;
+ this.kbtnOk.Values.Text = "kryptonButton1";
+ //
+ // kbtnSystemInformation
+ //
+ this.kbtnSystemInformation.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnSystemInformation.AutoSize = true;
+ this.kbtnSystemInformation.Location = new System.Drawing.Point(126, 12);
+ this.kbtnSystemInformation.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnSystemInformation.Name = "kbtnSystemInformation";
+ this.kbtnSystemInformation.Size = new System.Drawing.Size(96, 24);
+ this.kbtnSystemInformation.TabIndex = 1;
+ this.kbtnSystemInformation.Values.Text = "kryptonButton2";
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(786, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kryptonPanel1
+ //
+ this.kryptonPanel1.Controls.Add(this.khgMain);
+ this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonPanel1.Name = "kryptonPanel1";
+ this.kryptonPanel1.Size = new System.Drawing.Size(786, 363);
+ this.kryptonPanel1.TabIndex = 2;
+ //
+ // khgMain
+ //
+ this.khgMain.HeaderVisibleSecondary = false;
+ this.khgMain.Location = new System.Drawing.Point(12, 12);
+ this.khgMain.Name = "khgMain";
+ //
+ // khgMain.Panel
+ //
+ this.khgMain.Panel.Controls.Add(this.tscMain);
+ this.khgMain.Size = new System.Drawing.Size(758, 341);
+ this.khgMain.TabIndex = 3;
+ this.khgMain.ValuesPrimary.Image = null;
+ //
+ // tscMain
+ //
+ //
+ // tscMain.ContentPanel
+ //
+ this.tscMain.ContentPanel.Controls.Add(this.kpnlGeneralInformation);
+ this.tscMain.ContentPanel.Controls.Add(this.kpnlDescription);
+ this.tscMain.ContentPanel.Controls.Add(this.kpnlFileInformation);
+ this.tscMain.ContentPanel.Controls.Add(this.kpnlTheme);
+ this.tscMain.ContentPanel.Controls.Add(this.kpnlToolkitInformation);
+ this.tscMain.ContentPanel.Size = new System.Drawing.Size(756, 282);
+ this.tscMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tscMain.Location = new System.Drawing.Point(0, 0);
+ this.tscMain.Name = "tscMain";
+ this.tscMain.Size = new System.Drawing.Size(756, 307);
+ this.tscMain.TabIndex = 0;
+ this.tscMain.Text = "toolStripContainer1";
+ //
+ // tscMain.TopToolStripPanel
+ //
+ this.tscMain.TopToolStripPanel.Controls.Add(this.tsMain);
+ //
+ // kpnlGeneralInformation
+ //
+ this.kpnlGeneralInformation.Controls.Add(this.tlpnlGeneralInformation);
+ this.kpnlGeneralInformation.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlGeneralInformation.Location = new System.Drawing.Point(0, 0);
+ this.kpnlGeneralInformation.Name = "kpnlGeneralInformation";
+ this.kpnlGeneralInformation.Size = new System.Drawing.Size(756, 282);
+ this.kpnlGeneralInformation.TabIndex = 3;
+ //
+ // tlpnlGeneralInformation
+ //
+ this.tlpnlGeneralInformation.BackColor = System.Drawing.Color.Transparent;
+ this.tlpnlGeneralInformation.ColumnCount = 2;
+ this.tlpnlGeneralInformation.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tlpnlGeneralInformation.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpnlGeneralInformation.Controls.Add(this.pbxImage, 0, 0);
+ this.tlpnlGeneralInformation.Controls.Add(this.kwlVersionLabel, 1, 0);
+ this.tlpnlGeneralInformation.Controls.Add(this.kwlBuiltOn, 1, 1);
+ this.tlpnlGeneralInformation.Controls.Add(this.kwlCopyright, 1, 2);
+ this.tlpnlGeneralInformation.Controls.Add(this.kryptonWrapLabel5, 1, 3);
+ this.tlpnlGeneralInformation.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpnlGeneralInformation.Location = new System.Drawing.Point(0, 0);
+ this.tlpnlGeneralInformation.Name = "tlpnlGeneralInformation";
+ this.tlpnlGeneralInformation.RowCount = 4;
+ this.tlpnlGeneralInformation.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
+ this.tlpnlGeneralInformation.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
+ this.tlpnlGeneralInformation.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
+ this.tlpnlGeneralInformation.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
+ this.tlpnlGeneralInformation.Size = new System.Drawing.Size(756, 282);
+ this.tlpnlGeneralInformation.TabIndex = 1;
+ //
+ // pbxImage
+ //
+ this.pbxImage.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pbxImage.Location = new System.Drawing.Point(687, 5);
+ this.pbxImage.Margin = new System.Windows.Forms.Padding(5);
+ this.pbxImage.Name = "pbxImage";
+ this.tlpnlGeneralInformation.SetRowSpan(this.pbxImage, 4);
+ this.pbxImage.Size = new System.Drawing.Size(64, 272);
+ this.pbxImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pbxImage.TabIndex = 0;
+ this.pbxImage.TabStop = false;
+ //
+ // kwlVersionLabel
+ //
+ this.kwlVersionLabel.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlVersionLabel.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
+ this.kwlVersionLabel.ForeColor = System.Drawing.Color.Black;
+ this.kwlVersionLabel.LabelStyle = Krypton.Toolkit.LabelStyle.BoldControl;
+ this.kwlVersionLabel.Location = new System.Drawing.Point(3, 0);
+ this.kwlVersionLabel.Name = "kwlVersionLabel";
+ this.kwlVersionLabel.Size = new System.Drawing.Size(676, 70);
+ this.kwlVersionLabel.Text = "kryptonWrapLabel2";
+ this.kwlVersionLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // kwlBuiltOn
+ //
+ this.kwlBuiltOn.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlBuiltOn.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
+ this.kwlBuiltOn.ForeColor = System.Drawing.Color.Black;
+ this.kwlBuiltOn.LabelStyle = Krypton.Toolkit.LabelStyle.BoldControl;
+ this.kwlBuiltOn.Location = new System.Drawing.Point(3, 70);
+ this.kwlBuiltOn.Name = "kwlBuiltOn";
+ this.kwlBuiltOn.Size = new System.Drawing.Size(676, 70);
+ this.kwlBuiltOn.Text = "kryptonWrapLabel3";
+ this.kwlBuiltOn.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // kwlCopyright
+ //
+ this.kwlCopyright.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlCopyright.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
+ this.kwlCopyright.ForeColor = System.Drawing.Color.Black;
+ this.kwlCopyright.LabelStyle = Krypton.Toolkit.LabelStyle.BoldControl;
+ this.kwlCopyright.Location = new System.Drawing.Point(3, 140);
+ this.kwlCopyright.Name = "kwlCopyright";
+ this.kwlCopyright.Size = new System.Drawing.Size(676, 70);
+ this.kwlCopyright.Text = "kryptonWrapLabel4";
+ this.kwlCopyright.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // kryptonWrapLabel5
+ //
+ this.kryptonWrapLabel5.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kryptonWrapLabel5.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
+ this.kryptonWrapLabel5.ForeColor = System.Drawing.Color.Black;
+ this.kryptonWrapLabel5.LabelStyle = Krypton.Toolkit.LabelStyle.BoldControl;
+ this.kryptonWrapLabel5.Location = new System.Drawing.Point(3, 210);
+ this.kryptonWrapLabel5.Name = "kryptonWrapLabel5";
+ this.kryptonWrapLabel5.Size = new System.Drawing.Size(676, 72);
+ this.kryptonWrapLabel5.Text = "kryptonWrapLabel5";
+ this.kryptonWrapLabel5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // kpnlDescription
+ //
+ this.kpnlDescription.Controls.Add(this.krtbDescription);
+ this.kpnlDescription.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlDescription.Location = new System.Drawing.Point(0, 0);
+ this.kpnlDescription.Name = "kpnlDescription";
+ this.kpnlDescription.Size = new System.Drawing.Size(756, 282);
+ this.kpnlDescription.TabIndex = 2;
+ //
+ // krtbDescription
+ //
+ this.krtbDescription.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.krtbDescription.InputControlStyle = Krypton.Toolkit.InputControlStyle.PanelClient;
+ this.krtbDescription.Location = new System.Drawing.Point(0, 0);
+ this.krtbDescription.Name = "krtbDescription";
+ this.krtbDescription.Size = new System.Drawing.Size(756, 282);
+ this.krtbDescription.TabIndex = 0;
+ this.krtbDescription.Text = "";
+ //
+ // kpnlFileInformation
+ //
+ this.kpnlFileInformation.Controls.Add(this.tscFileInformation);
+ this.kpnlFileInformation.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlFileInformation.Location = new System.Drawing.Point(0, 0);
+ this.kpnlFileInformation.Name = "kpnlFileInformation";
+ this.kpnlFileInformation.Size = new System.Drawing.Size(756, 282);
+ this.kpnlFileInformation.TabIndex = 1;
+ //
+ // tscFileInformation
+ //
+ //
+ // tscFileInformation.ContentPanel
+ //
+ this.tscFileInformation.ContentPanel.Controls.Add(this.kpnlApplication);
+ this.tscFileInformation.ContentPanel.Controls.Add(this.kpnlAssemblies);
+ this.tscFileInformation.ContentPanel.Controls.Add(this.kpnlAssemblyDetails);
+ this.tscFileInformation.ContentPanel.Size = new System.Drawing.Size(756, 257);
+ this.tscFileInformation.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tscFileInformation.Location = new System.Drawing.Point(0, 0);
+ this.tscFileInformation.Name = "tscFileInformation";
+ this.tscFileInformation.Size = new System.Drawing.Size(756, 282);
+ this.tscFileInformation.TabIndex = 1;
+ this.tscFileInformation.Text = "toolStripContainer2";
+ //
+ // tscFileInformation.TopToolStripPanel
+ //
+ this.tscFileInformation.TopToolStripPanel.Controls.Add(this.tsFileInformation);
+ //
+ // kpnlApplication
+ //
+ this.kpnlApplication.Controls.Add(this.kdgvApplication);
+ this.kpnlApplication.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlApplication.Location = new System.Drawing.Point(0, 0);
+ this.kpnlApplication.Name = "kpnlApplication";
+ this.kpnlApplication.Size = new System.Drawing.Size(756, 257);
+ this.kpnlApplication.TabIndex = 1;
+ //
+ // kdgvApplication
+ //
+ this.kdgvApplication.AllowUserToAddRows = false;
+ this.kdgvApplication.AllowUserToDeleteRows = false;
+ this.kdgvApplication.AllowUserToResizeColumns = false;
+ this.kdgvApplication.AllowUserToResizeRows = false;
+ this.kdgvApplication.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
+ this.kdgvApplication.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
+ this.kdgvApplication.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.kdgvApplication.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kdgvApplication.Location = new System.Drawing.Point(0, 0);
+ this.kdgvApplication.Name = "kdgvApplication";
+ this.kdgvApplication.Size = new System.Drawing.Size(756, 257);
+ this.kdgvApplication.TabIndex = 0;
+ //
+ // kpnlAssemblies
+ //
+ this.kpnlAssemblies.Controls.Add(this.kdgvAssemblies);
+ this.kpnlAssemblies.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlAssemblies.Location = new System.Drawing.Point(0, 0);
+ this.kpnlAssemblies.Name = "kpnlAssemblies";
+ this.kpnlAssemblies.Size = new System.Drawing.Size(756, 257);
+ this.kpnlAssemblies.TabIndex = 1;
+ //
+ // kdgvAssemblies
+ //
+ this.kdgvAssemblies.AllowUserToAddRows = false;
+ this.kdgvAssemblies.AllowUserToDeleteRows = false;
+ this.kdgvAssemblies.AllowUserToResizeColumns = false;
+ this.kdgvAssemblies.AllowUserToResizeRows = false;
+ this.kdgvAssemblies.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
+ this.kdgvAssemblies.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
+ this.kdgvAssemblies.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.kdgvAssemblies.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kdgvAssemblies.Location = new System.Drawing.Point(0, 0);
+ this.kdgvAssemblies.Name = "kdgvAssemblies";
+ this.kdgvAssemblies.Size = new System.Drawing.Size(756, 257);
+ this.kdgvAssemblies.TabIndex = 0;
+ //
+ // kpnlAssemblyDetails
+ //
+ this.kpnlAssemblyDetails.Controls.Add(this.kiadAssemblyDetails);
+ this.kpnlAssemblyDetails.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlAssemblyDetails.Location = new System.Drawing.Point(0, 0);
+ this.kpnlAssemblyDetails.Name = "kpnlAssemblyDetails";
+ this.kpnlAssemblyDetails.Size = new System.Drawing.Size(756, 257);
+ this.kpnlAssemblyDetails.TabIndex = 0;
+ //
+ // kiadAssemblyDetails
+ //
+ this.kiadAssemblyDetails.BackColor = System.Drawing.Color.Transparent;
+ this.kiadAssemblyDetails.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kiadAssemblyDetails.Location = new System.Drawing.Point(0, 0);
+ this.kiadAssemblyDetails.Name = "kiadAssemblyDetails";
+ this.kiadAssemblyDetails.Size = new System.Drawing.Size(756, 257);
+ this.kiadAssemblyDetails.TabIndex = 0;
+ //
+ // tsFileInformation
+ //
+ this.tsFileInformation.Dock = System.Windows.Forms.DockStyle.None;
+ this.tsFileInformation.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.tsFileInformation.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
+ this.tsFileInformation.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.tsbtnApplicationDetails,
+ this.tssAssembliesDetails,
+ this.tsbtnAssembliesDetails,
+ this.tssAssemblyDetails,
+ this.tsbtnAssemblyDetails});
+ this.tsFileInformation.Location = new System.Drawing.Point(465, 0);
+ this.tsFileInformation.Name = "tsFileInformation";
+ this.tsFileInformation.Size = new System.Drawing.Size(257, 25);
+ this.tsFileInformation.TabIndex = 0;
+ //
+ // tsbtnApplicationDetails
+ //
+ this.tsbtnApplicationDetails.CheckOnClick = true;
+ this.tsbtnApplicationDetails.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.tsbtnApplicationDetails.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tsbtnApplicationDetails.Name = "tsbtnApplicationDetails";
+ this.tsbtnApplicationDetails.Size = new System.Drawing.Size(72, 22);
+ this.tsbtnApplicationDetails.Text = "Application";
+ //
+ // tssAssembliesDetails
+ //
+ this.tssAssembliesDetails.Name = "tssAssembliesDetails";
+ this.tssAssembliesDetails.Size = new System.Drawing.Size(6, 25);
+ //
+ // tsbtnAssembliesDetails
+ //
+ this.tsbtnAssembliesDetails.CheckOnClick = true;
+ this.tsbtnAssembliesDetails.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.tsbtnAssembliesDetails.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tsbtnAssembliesDetails.Name = "tsbtnAssembliesDetails";
+ this.tsbtnAssembliesDetails.Size = new System.Drawing.Size(70, 22);
+ this.tsbtnAssembliesDetails.Text = "Assemblies";
+ //
+ // tssAssemblyDetails
+ //
+ this.tssAssemblyDetails.Name = "tssAssemblyDetails";
+ this.tssAssemblyDetails.Size = new System.Drawing.Size(6, 25);
+ //
+ // tsbtnAssemblyDetails
+ //
+ this.tsbtnAssemblyDetails.CheckOnClick = true;
+ this.tsbtnAssemblyDetails.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.tsbtnAssemblyDetails.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tsbtnAssemblyDetails.Name = "tsbtnAssemblyDetails";
+ this.tsbtnAssemblyDetails.Size = new System.Drawing.Size(100, 22);
+ this.tsbtnAssemblyDetails.Text = "Assembly Details";
+ //
+ // kpnlTheme
+ //
+ this.kpnlTheme.Controls.Add(this.tlpTheme);
+ this.kpnlTheme.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlTheme.Location = new System.Drawing.Point(0, 0);
+ this.kpnlTheme.Name = "kpnlTheme";
+ this.kpnlTheme.Size = new System.Drawing.Size(756, 282);
+ this.kpnlTheme.TabIndex = 0;
+ //
+ // tlpTheme
+ //
+ this.tlpTheme.BackColor = System.Drawing.Color.Transparent;
+ this.tlpTheme.ColumnCount = 1;
+ this.tlpTheme.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpTheme.Controls.Add(this.kryptonThemeComboBox1, 0, 1);
+ this.tlpTheme.Controls.Add(this.kwlCurrentTheme, 0, 0);
+ this.tlpTheme.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpTheme.Location = new System.Drawing.Point(0, 0);
+ this.tlpTheme.Name = "tlpTheme";
+ this.tlpTheme.RowCount = 2;
+ this.tlpTheme.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpTheme.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpTheme.Size = new System.Drawing.Size(756, 282);
+ this.tlpTheme.TabIndex = 0;
+ //
+ // kryptonThemeComboBox1
+ //
+ this.kryptonThemeComboBox1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kryptonThemeComboBox1.DropDownWidth = 746;
+ this.kryptonThemeComboBox1.IntegralHeight = false;
+ this.kryptonThemeComboBox1.Location = new System.Drawing.Point(5, 256);
+ this.kryptonThemeComboBox1.Margin = new System.Windows.Forms.Padding(5);
+ this.kryptonThemeComboBox1.Name = "kryptonThemeComboBox1";
+ this.kryptonThemeComboBox1.Size = new System.Drawing.Size(746, 21);
+ this.kryptonThemeComboBox1.StateCommon.ComboBox.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near;
+ this.kryptonThemeComboBox1.TabIndex = 0;
+ //
+ // kwlCurrentTheme
+ //
+ this.kwlCurrentTheme.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlCurrentTheme.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
+ this.kwlCurrentTheme.ForeColor = System.Drawing.Color.Black;
+ this.kwlCurrentTheme.LabelStyle = Krypton.Toolkit.LabelStyle.BoldControl;
+ this.kwlCurrentTheme.Location = new System.Drawing.Point(3, 0);
+ this.kwlCurrentTheme.Name = "kwlCurrentTheme";
+ this.kwlCurrentTheme.Padding = new System.Windows.Forms.Padding(5);
+ this.kwlCurrentTheme.Size = new System.Drawing.Size(750, 251);
+ this.kwlCurrentTheme.Text = "kryptonWrapLabel1";
+ this.kwlCurrentTheme.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
+ //
+ // kpnlToolkitInformation
+ //
+ this.kpnlToolkitInformation.Controls.Add(this.tscToolkitInformation);
+ this.kpnlToolkitInformation.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlToolkitInformation.Location = new System.Drawing.Point(0, 0);
+ this.kpnlToolkitInformation.Name = "kpnlToolkitInformation";
+ this.kpnlToolkitInformation.Size = new System.Drawing.Size(756, 282);
+ this.kpnlToolkitInformation.TabIndex = 4;
+ //
+ // tscToolkitInformation
+ //
+ //
+ // tscToolkitInformation.ContentPanel
+ //
+ this.tscToolkitInformation.ContentPanel.Controls.Add(this.kpnlToolkitGeneralInformation);
+ this.tscToolkitInformation.ContentPanel.Controls.Add(this.kpnlDiscord);
+ this.tscToolkitInformation.ContentPanel.Controls.Add(this.kpnlDeveloperInformation);
+ this.tscToolkitInformation.ContentPanel.Controls.Add(this.kpnlVersions);
+ this.tscToolkitInformation.ContentPanel.Size = new System.Drawing.Size(756, 257);
+ this.tscToolkitInformation.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tscToolkitInformation.Location = new System.Drawing.Point(0, 0);
+ this.tscToolkitInformation.Name = "tscToolkitInformation";
+ this.tscToolkitInformation.Size = new System.Drawing.Size(756, 282);
+ this.tscToolkitInformation.TabIndex = 2;
+ this.tscToolkitInformation.Text = "toolStripContainer1";
+ //
+ // tscToolkitInformation.TopToolStripPanel
+ //
+ this.tscToolkitInformation.TopToolStripPanel.Controls.Add(this.tsToolkitInformation);
+ //
+ // kpnlToolkitGeneralInformation
+ //
+ this.kpnlToolkitGeneralInformation.Controls.Add(this.tlpGeneralInformation);
+ this.kpnlToolkitGeneralInformation.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlToolkitGeneralInformation.Location = new System.Drawing.Point(0, 0);
+ this.kpnlToolkitGeneralInformation.Name = "kpnlToolkitGeneralInformation";
+ this.kpnlToolkitGeneralInformation.Size = new System.Drawing.Size(756, 257);
+ this.kpnlToolkitGeneralInformation.TabIndex = 3;
+ //
+ // tlpGeneralInformation
+ //
+ this.tlpGeneralInformation.BackColor = System.Drawing.Color.Transparent;
+ this.tlpGeneralInformation.ColumnCount = 2;
+ this.tlpGeneralInformation.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tlpGeneralInformation.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpGeneralInformation.Controls.Add(this.pbxLogo, 0, 0);
+ this.tlpGeneralInformation.Controls.Add(this.klwlblGeneralInformation, 1, 0);
+ this.tlpGeneralInformation.Controls.Add(this.klblCurrentTheme, 1, 2);
+ this.tlpGeneralInformation.Controls.Add(this.ktcmbCurrentTheme, 1, 3);
+ this.tlpGeneralInformation.Controls.Add(this.klblBuiltOn, 1, 1);
+ this.tlpGeneralInformation.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpGeneralInformation.Location = new System.Drawing.Point(0, 0);
+ this.tlpGeneralInformation.Name = "tlpGeneralInformation";
+ this.tlpGeneralInformation.RowCount = 3;
+ this.tlpGeneralInformation.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpGeneralInformation.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpGeneralInformation.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpGeneralInformation.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpGeneralInformation.Size = new System.Drawing.Size(756, 257);
+ this.tlpGeneralInformation.TabIndex = 0;
+ //
+ // pbxLogo
+ //
+ this.pbxLogo.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pbxLogo.Location = new System.Drawing.Point(687, 5);
+ this.pbxLogo.Margin = new System.Windows.Forms.Padding(5);
+ this.pbxLogo.Name = "pbxLogo";
+ this.pbxLogo.Padding = new System.Windows.Forms.Padding(4, 4, 0, 0);
+ this.pbxLogo.Size = new System.Drawing.Size(64, 156);
+ this.pbxLogo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pbxLogo.TabIndex = 0;
+ this.pbxLogo.TabStop = false;
+ //
+ // klwlblGeneralInformation
+ //
+ this.klwlblGeneralInformation.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.klwlblGeneralInformation.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.klwlblGeneralInformation.ForeColor = System.Drawing.Color.White;
+ this.klwlblGeneralInformation.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.klwlblGeneralInformation.LinkArea = new System.Windows.Forms.LinkArea(133, 143);
+ this.klwlblGeneralInformation.Location = new System.Drawing.Point(5, 5);
+ this.klwlblGeneralInformation.Margin = new System.Windows.Forms.Padding(5);
+ this.klwlblGeneralInformation.Name = "klwlblGeneralInformation";
+ this.klwlblGeneralInformation.Size = new System.Drawing.Size(672, 156);
+ this.klwlblGeneralInformation.Text = "Some of the components used in this application are part of the Krypton Standard " +
+ "Toolkit.\r\n\r\nLicense: BSD-3-Clause\r\n\r\nTo learn more, click here.";
+ this.klwlblGeneralInformation.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ this.klwlblGeneralInformation.UseCompatibleTextRendering = true;
+ //
+ // klblCurrentTheme
+ //
+ this.klblCurrentTheme.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.klblCurrentTheme.LabelStyle = Krypton.Toolkit.LabelStyle.BoldPanel;
+ this.klblCurrentTheme.Location = new System.Drawing.Point(5, 201);
+ this.klblCurrentTheme.Margin = new System.Windows.Forms.Padding(5);
+ this.klblCurrentTheme.Name = "klblCurrentTheme";
+ this.klblCurrentTheme.Size = new System.Drawing.Size(672, 20);
+ this.klblCurrentTheme.TabIndex = 2;
+ this.klblCurrentTheme.Values.Text = "Current Theme:";
+ //
+ // ktcmbCurrentTheme
+ //
+ this.ktcmbCurrentTheme.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.ktcmbCurrentTheme.DropDownWidth = 672;
+ this.ktcmbCurrentTheme.IntegralHeight = false;
+ this.ktcmbCurrentTheme.Location = new System.Drawing.Point(5, 231);
+ this.ktcmbCurrentTheme.Margin = new System.Windows.Forms.Padding(5);
+ this.ktcmbCurrentTheme.Name = "ktcmbCurrentTheme";
+ this.ktcmbCurrentTheme.Size = new System.Drawing.Size(672, 21);
+ this.ktcmbCurrentTheme.StateCommon.ComboBox.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near;
+ this.ktcmbCurrentTheme.TabIndex = 3;
+ //
+ // klblBuiltOn
+ //
+ this.klblBuiltOn.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.klblBuiltOn.LabelStyle = Krypton.Toolkit.LabelStyle.BoldControl;
+ this.klblBuiltOn.Location = new System.Drawing.Point(5, 171);
+ this.klblBuiltOn.Margin = new System.Windows.Forms.Padding(5);
+ this.klblBuiltOn.Name = "klblBuiltOn";
+ this.klblBuiltOn.Size = new System.Drawing.Size(672, 20);
+ this.klblBuiltOn.TabIndex = 4;
+ this.klblBuiltOn.Values.Text = "Built On: {0}";
+ //
+ // kpnlDiscord
+ //
+ this.kpnlDiscord.Controls.Add(this.klwlblDiscord);
+ this.kpnlDiscord.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlDiscord.Location = new System.Drawing.Point(0, 0);
+ this.kpnlDiscord.Name = "kpnlDiscord";
+ this.kpnlDiscord.Size = new System.Drawing.Size(756, 257);
+ this.kpnlDiscord.TabIndex = 2;
+ //
+ // klwlblDiscord
+ //
+ this.klwlblDiscord.AutoSize = false;
+ this.klwlblDiscord.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.klwlblDiscord.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.klwlblDiscord.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.klwlblDiscord.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.klwlblDiscord.Location = new System.Drawing.Point(0, 0);
+ this.klwlblDiscord.Name = "klwlblDiscord";
+ this.klwlblDiscord.Size = new System.Drawing.Size(756, 257);
+ this.klwlblDiscord.Text = "kryptonLinkWrapLabel1";
+ this.klwlblDiscord.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // kpnlDeveloperInformation
+ //
+ this.kpnlDeveloperInformation.Controls.Add(this.tlpDeveloperInformation);
+ this.kpnlDeveloperInformation.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlDeveloperInformation.Location = new System.Drawing.Point(0, 0);
+ this.kpnlDeveloperInformation.Name = "kpnlDeveloperInformation";
+ this.kpnlDeveloperInformation.Size = new System.Drawing.Size(756, 257);
+ this.kpnlDeveloperInformation.TabIndex = 1;
+ //
+ // tlpDeveloperInformation
+ //
+ this.tlpDeveloperInformation.BackColor = System.Drawing.Color.Transparent;
+ this.tlpDeveloperInformation.ColumnCount = 1;
+ this.tlpDeveloperInformation.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpDeveloperInformation.Controls.Add(this.klwlblRepositories, 0, 0);
+ this.tlpDeveloperInformation.Controls.Add(this.klwlblDocumentation, 0, 1);
+ this.tlpDeveloperInformation.Controls.Add(this.klwlblDemos, 0, 2);
+ this.tlpDeveloperInformation.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpDeveloperInformation.Location = new System.Drawing.Point(0, 0);
+ this.tlpDeveloperInformation.Name = "tlpDeveloperInformation";
+ this.tlpDeveloperInformation.RowCount = 3;
+ this.tlpDeveloperInformation.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
+ this.tlpDeveloperInformation.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
+ this.tlpDeveloperInformation.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
+ this.tlpDeveloperInformation.Size = new System.Drawing.Size(756, 257);
+ this.tlpDeveloperInformation.TabIndex = 0;
+ //
+ // klwlblRepositories
+ //
+ this.klwlblRepositories.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.klwlblRepositories.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.klwlblRepositories.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.klwlblRepositories.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.klwlblRepositories.Location = new System.Drawing.Point(5, 5);
+ this.klwlblRepositories.Margin = new System.Windows.Forms.Padding(5);
+ this.klwlblRepositories.Name = "klwlblRepositories";
+ this.klwlblRepositories.Size = new System.Drawing.Size(746, 75);
+ this.klwlblRepositories.Text = "kryptonLinkWrapLabel1";
+ this.klwlblRepositories.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // klwlblDocumentation
+ //
+ this.klwlblDocumentation.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.klwlblDocumentation.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.klwlblDocumentation.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.klwlblDocumentation.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.klwlblDocumentation.Location = new System.Drawing.Point(5, 90);
+ this.klwlblDocumentation.Margin = new System.Windows.Forms.Padding(5);
+ this.klwlblDocumentation.Name = "klwlblDocumentation";
+ this.klwlblDocumentation.Size = new System.Drawing.Size(746, 75);
+ this.klwlblDocumentation.Text = "kryptonLinkWrapLabel1";
+ this.klwlblDocumentation.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // klwlblDemos
+ //
+ this.klwlblDemos.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.klwlblDemos.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.klwlblDemos.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.klwlblDemos.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.klwlblDemos.Location = new System.Drawing.Point(5, 175);
+ this.klwlblDemos.Margin = new System.Windows.Forms.Padding(5);
+ this.klwlblDemos.Name = "klwlblDemos";
+ this.klwlblDemos.Size = new System.Drawing.Size(746, 77);
+ this.klwlblDemos.Text = "kryptonLinkWrapLabel1";
+ this.klwlblDemos.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // kpnlVersions
+ //
+ this.kpnlVersions.Controls.Add(this.kdgvVersions);
+ this.kpnlVersions.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlVersions.Location = new System.Drawing.Point(0, 0);
+ this.kpnlVersions.Name = "kpnlVersions";
+ this.kpnlVersions.Size = new System.Drawing.Size(756, 257);
+ this.kpnlVersions.TabIndex = 0;
+ //
+ // kdgvVersions
+ //
+ this.kdgvVersions.AllowUserToAddRows = false;
+ this.kdgvVersions.AllowUserToDeleteRows = false;
+ this.kdgvVersions.AllowUserToOrderColumns = true;
+ this.kdgvVersions.AllowUserToResizeColumns = false;
+ this.kdgvVersions.AllowUserToResizeRows = false;
+ this.kdgvVersions.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
+ this.kdgvVersions.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
+ this.kdgvVersions.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.kdgvVersions.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kdgvVersions.Location = new System.Drawing.Point(0, 0);
+ this.kdgvVersions.Name = "kdgvVersions";
+ this.kdgvVersions.Size = new System.Drawing.Size(756, 257);
+ this.kdgvVersions.TabIndex = 0;
+ //
+ // tsToolkitInformation
+ //
+ this.tsToolkitInformation.Dock = System.Windows.Forms.DockStyle.None;
+ this.tsToolkitInformation.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.tsToolkitInformation.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
+ this.tsToolkitInformation.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.tsbtnToolkitGeneralInformation,
+ this.tssDiscord,
+ this.tsbtnDiscord,
+ this.tssDeveloperInformation,
+ this.tsbtnDeveloperInformation,
+ this.tssVersions,
+ this.tsbtnVersions});
+ this.tsToolkitInformation.Location = new System.Drawing.Point(288, 0);
+ this.tsToolkitInformation.Name = "tsToolkitInformation";
+ this.tsToolkitInformation.Size = new System.Drawing.Size(434, 25);
+ this.tsToolkitInformation.TabIndex = 0;
+ //
+ // tsbtnToolkitGeneralInformation
+ //
+ this.tsbtnToolkitGeneralInformation.Checked = true;
+ this.tsbtnToolkitGeneralInformation.CheckOnClick = true;
+ this.tsbtnToolkitGeneralInformation.CheckState = System.Windows.Forms.CheckState.Checked;
+ this.tsbtnToolkitGeneralInformation.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.tsbtnToolkitGeneralInformation.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tsbtnToolkitGeneralInformation.Name = "tsbtnToolkitGeneralInformation";
+ this.tsbtnToolkitGeneralInformation.Size = new System.Drawing.Size(117, 22);
+ this.tsbtnToolkitGeneralInformation.Text = "General Information";
+ this.tsbtnToolkitGeneralInformation.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
+ //
+ // tssDiscord
+ //
+ this.tssDiscord.Name = "tssDiscord";
+ this.tssDiscord.Size = new System.Drawing.Size(6, 25);
+ //
+ // tsbtnDiscord
+ //
+ this.tsbtnDiscord.CheckOnClick = true;
+ this.tsbtnDiscord.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.tsbtnDiscord.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tsbtnDiscord.Name = "tsbtnDiscord";
+ this.tsbtnDiscord.Size = new System.Drawing.Size(51, 22);
+ this.tsbtnDiscord.Text = "Discord";
+ //
+ // tssDeveloperInformation
+ //
+ this.tssDeveloperInformation.Name = "tssDeveloperInformation";
+ this.tssDeveloperInformation.Size = new System.Drawing.Size(6, 25);
+ //
+ // tsbtnDeveloperInformation
+ //
+ this.tsbtnDeveloperInformation.CheckOnClick = true;
+ this.tsbtnDeveloperInformation.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.tsbtnDeveloperInformation.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tsbtnDeveloperInformation.Name = "tsbtnDeveloperInformation";
+ this.tsbtnDeveloperInformation.Size = new System.Drawing.Size(130, 22);
+ this.tsbtnDeveloperInformation.Text = "Developer Information";
+ //
+ // tssVersions
+ //
+ this.tssVersions.Name = "tssVersions";
+ this.tssVersions.Size = new System.Drawing.Size(6, 25);
+ //
+ // tsbtnVersions
+ //
+ this.tsbtnVersions.CheckOnClick = true;
+ this.tsbtnVersions.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.tsbtnVersions.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tsbtnVersions.Name = "tsbtnVersions";
+ this.tsbtnVersions.Size = new System.Drawing.Size(115, 22);
+ this.tsbtnVersions.Text = "Version Information";
+ //
+ // tsMain
+ //
+ this.tsMain.Dock = System.Windows.Forms.DockStyle.None;
+ this.tsMain.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.tsMain.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
+ this.tsMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.tsbtnGeneralInformation,
+ this.toolStripSeparator1,
+ this.tsbtnDescription,
+ this.toolStripSeparator2,
+ this.tsbtnFileInformation,
+ this.toolStripSeparator3,
+ this.tsbtnTheme,
+ this.tssToolkitInformation,
+ this.tsbtnToolkitInformation});
+ this.tsMain.Location = new System.Drawing.Point(253, 0);
+ this.tsMain.Name = "tsMain";
+ this.tsMain.Size = new System.Drawing.Size(500, 25);
+ this.tsMain.TabIndex = 0;
+ //
+ // tsbtnGeneralInformation
+ //
+ this.tsbtnGeneralInformation.CheckOnClick = true;
+ this.tsbtnGeneralInformation.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.tsbtnGeneralInformation.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tsbtnGeneralInformation.Name = "tsbtnGeneralInformation";
+ this.tsbtnGeneralInformation.Size = new System.Drawing.Size(117, 22);
+ this.tsbtnGeneralInformation.Text = "General Information";
+ //
+ // toolStripSeparator1
+ //
+ this.toolStripSeparator1.Name = "toolStripSeparator1";
+ this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
+ //
+ // tsbtnDescription
+ //
+ this.tsbtnDescription.CheckOnClick = true;
+ this.tsbtnDescription.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.tsbtnDescription.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tsbtnDescription.Name = "tsbtnDescription";
+ this.tsbtnDescription.Size = new System.Drawing.Size(71, 22);
+ this.tsbtnDescription.Text = "Description";
+ //
+ // toolStripSeparator2
+ //
+ this.toolStripSeparator2.Name = "toolStripSeparator2";
+ this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25);
+ //
+ // tsbtnFileInformation
+ //
+ this.tsbtnFileInformation.CheckOnClick = true;
+ this.tsbtnFileInformation.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.tsbtnFileInformation.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tsbtnFileInformation.Name = "tsbtnFileInformation";
+ this.tsbtnFileInformation.Size = new System.Drawing.Size(95, 22);
+ this.tsbtnFileInformation.Text = "File Information";
+ //
+ // toolStripSeparator3
+ //
+ this.toolStripSeparator3.Name = "toolStripSeparator3";
+ this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25);
+ //
+ // tsbtnTheme
+ //
+ this.tsbtnTheme.CheckOnClick = true;
+ this.tsbtnTheme.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.tsbtnTheme.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tsbtnTheme.Name = "tsbtnTheme";
+ this.tsbtnTheme.Size = new System.Drawing.Size(47, 22);
+ this.tsbtnTheme.Text = "Theme";
+ //
+ // tssToolkitInformation
+ //
+ this.tssToolkitInformation.Name = "tssToolkitInformation";
+ this.tssToolkitInformation.Size = new System.Drawing.Size(6, 25);
+ this.tssToolkitInformation.Visible = false;
+ //
+ // tsbtnToolkitInformation
+ //
+ this.tsbtnToolkitInformation.CheckOnClick = true;
+ this.tsbtnToolkitInformation.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.tsbtnToolkitInformation.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tsbtnToolkitInformation.Name = "tsbtnToolkitInformation";
+ this.tsbtnToolkitInformation.Size = new System.Drawing.Size(112, 22);
+ this.tsbtnToolkitInformation.Text = "Toolkit Information";
+ this.tsbtnToolkitInformation.Visible = false;
+ //
+ // VisualAboutBoxRtlAwareForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(786, 413);
+ this.Controls.Add(this.kryptonPanel1);
+ this.Controls.Add(this.kpnlButtons);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualAboutBoxRtlAwareForm";
+ this.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit();
+ this.kpnlButtons.ResumeLayout(false);
+ this.kpnlButtons.PerformLayout();
+ this.tableLayoutPanel1.ResumeLayout(false);
+ this.tableLayoutPanel1.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
+ this.kryptonPanel1.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.khgMain.Panel)).EndInit();
+ this.khgMain.Panel.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.khgMain)).EndInit();
+ this.khgMain.ResumeLayout(false);
+ this.tscMain.ContentPanel.ResumeLayout(false);
+ this.tscMain.TopToolStripPanel.ResumeLayout(false);
+ this.tscMain.TopToolStripPanel.PerformLayout();
+ this.tscMain.ResumeLayout(false);
+ this.tscMain.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlGeneralInformation)).EndInit();
+ this.kpnlGeneralInformation.ResumeLayout(false);
+ this.tlpnlGeneralInformation.ResumeLayout(false);
+ this.tlpnlGeneralInformation.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxImage)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlDescription)).EndInit();
+ this.kpnlDescription.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlFileInformation)).EndInit();
+ this.kpnlFileInformation.ResumeLayout(false);
+ this.tscFileInformation.ContentPanel.ResumeLayout(false);
+ this.tscFileInformation.TopToolStripPanel.ResumeLayout(false);
+ this.tscFileInformation.TopToolStripPanel.PerformLayout();
+ this.tscFileInformation.ResumeLayout(false);
+ this.tscFileInformation.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlApplication)).EndInit();
+ this.kpnlApplication.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.kdgvApplication)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlAssemblies)).EndInit();
+ this.kpnlAssemblies.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.kdgvAssemblies)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlAssemblyDetails)).EndInit();
+ this.kpnlAssemblyDetails.ResumeLayout(false);
+ this.tsFileInformation.ResumeLayout(false);
+ this.tsFileInformation.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlTheme)).EndInit();
+ this.kpnlTheme.ResumeLayout(false);
+ this.tlpTheme.ResumeLayout(false);
+ this.tlpTheme.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonThemeComboBox1)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlToolkitInformation)).EndInit();
+ this.kpnlToolkitInformation.ResumeLayout(false);
+ this.tscToolkitInformation.ContentPanel.ResumeLayout(false);
+ this.tscToolkitInformation.TopToolStripPanel.ResumeLayout(false);
+ this.tscToolkitInformation.TopToolStripPanel.PerformLayout();
+ this.tscToolkitInformation.ResumeLayout(false);
+ this.tscToolkitInformation.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlToolkitGeneralInformation)).EndInit();
+ this.kpnlToolkitGeneralInformation.ResumeLayout(false);
+ this.tlpGeneralInformation.ResumeLayout(false);
+ this.tlpGeneralInformation.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxLogo)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.ktcmbCurrentTheme)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlDiscord)).EndInit();
+ this.kpnlDiscord.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlDeveloperInformation)).EndInit();
+ this.kpnlDeveloperInformation.ResumeLayout(false);
+ this.tlpDeveloperInformation.ResumeLayout(false);
+ this.tlpDeveloperInformation.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlVersions)).EndInit();
+ this.kpnlVersions.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.kdgvVersions)).EndInit();
+ this.tsToolkitInformation.ResumeLayout(false);
+ this.tsToolkitInformation.PerformLayout();
+ this.tsMain.ResumeLayout(false);
+ this.tsMain.PerformLayout();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kpnlButtons;
+ private TableLayoutPanel tableLayoutPanel1;
+ private KryptonButton kbtnOk;
+ private KryptonButton kbtnSystemInformation;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private KryptonPanel kryptonPanel1;
+ private KryptonHeaderGroup khgMain;
+ private ToolStripContainer tscMain;
+ private KryptonPanel kpnlGeneralInformation;
+ private TableLayoutPanel tlpnlGeneralInformation;
+ private PictureBox pbxImage;
+ private KryptonWrapLabel kwlVersionLabel;
+ private KryptonWrapLabel kwlBuiltOn;
+ private KryptonWrapLabel kwlCopyright;
+ private KryptonWrapLabel kryptonWrapLabel5;
+ private KryptonPanel kpnlDescription;
+ private KryptonRichTextBox krtbDescription;
+ private KryptonPanel kpnlFileInformation;
+ private ToolStripContainer tscFileInformation;
+ private KryptonPanel kpnlApplication;
+ private KryptonDataGridView kdgvApplication;
+ private KryptonPanel kpnlAssemblies;
+ private KryptonDataGridView kdgvAssemblies;
+ private KryptonPanel kpnlAssemblyDetails;
+ private InternalAssemblyDetails kiadAssemblyDetails;
+ private ToolStrip tsFileInformation;
+ private ToolStripButton tsbtnApplicationDetails;
+ private ToolStripSeparator tssAssembliesDetails;
+ private ToolStripButton tsbtnAssembliesDetails;
+ private ToolStripSeparator tssAssemblyDetails;
+ private ToolStripButton tsbtnAssemblyDetails;
+ private KryptonPanel kpnlTheme;
+ private TableLayoutPanel tlpTheme;
+ private KryptonThemeComboBox kryptonThemeComboBox1;
+ private KryptonWrapLabel kwlCurrentTheme;
+ private KryptonPanel kpnlToolkitInformation;
+ private ToolStripContainer tscToolkitInformation;
+ private KryptonPanel kpnlToolkitGeneralInformation;
+ private TableLayoutPanel tlpGeneralInformation;
+ private PictureBox pbxLogo;
+ private KryptonLinkWrapLabel klwlblGeneralInformation;
+ private KryptonLabel klblCurrentTheme;
+ private KryptonThemeComboBox ktcmbCurrentTheme;
+ private KryptonLabel klblBuiltOn;
+ private KryptonPanel kpnlDiscord;
+ private KryptonLinkWrapLabel klwlblDiscord;
+ private KryptonPanel kpnlDeveloperInformation;
+ private TableLayoutPanel tlpDeveloperInformation;
+ private KryptonLinkWrapLabel klwlblRepositories;
+ private KryptonLinkWrapLabel klwlblDocumentation;
+ private KryptonLinkWrapLabel klwlblDemos;
+ private KryptonPanel kpnlVersions;
+ private KryptonDataGridView kdgvVersions;
+ private ToolStrip tsToolkitInformation;
+ private ToolStripButton tsbtnToolkitGeneralInformation;
+ private ToolStripSeparator tssDiscord;
+ private ToolStripButton tsbtnDiscord;
+ private ToolStripSeparator tssDeveloperInformation;
+ private ToolStripButton tsbtnDeveloperInformation;
+ private ToolStripSeparator tssVersions;
+ private ToolStripButton tsbtnVersions;
+ private ToolStrip tsMain;
+ private ToolStripButton tsbtnGeneralInformation;
+ private ToolStripSeparator toolStripSeparator1;
+ private ToolStripButton tsbtnDescription;
+ private ToolStripSeparator toolStripSeparator2;
+ private ToolStripButton tsbtnFileInformation;
+ private ToolStripSeparator toolStripSeparator3;
+ private ToolStripButton tsbtnTheme;
+ private ToolStripSeparator tssToolkitInformation;
+ private ToolStripButton tsbtnToolkitInformation;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualAboutBoxRtlAwareForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualAboutBoxRtlAwareForm.cs
new file mode 100644
index 000000000..a0bcc51c0
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualAboutBoxRtlAwareForm.cs
@@ -0,0 +1,19 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualAboutBoxRtlAwareForm : KryptonForm
+ {
+ public VisualAboutBoxRtlAwareForm()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualAboutBoxRtlAwareForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualAboutBoxRtlAwareForm.resx
new file mode 100644
index 000000000..26d7e7339
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualAboutBoxRtlAwareForm.resx
@@ -0,0 +1,129 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 17, 17
+
+
+ 161, 17
+
+
+ 322, 17
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualInputBoxRtlAwareForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualInputBoxRtlAwareForm.Designer.cs
new file mode 100644
index 000000000..f20bfb227
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualInputBoxRtlAwareForm.Designer.cs
@@ -0,0 +1,196 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualInputBoxRtlAwareForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel();
+ this.tlpButtons = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnCancel = new Krypton.Toolkit.KryptonButton();
+ this.kbtnOk = new Krypton.Toolkit.KryptonButton();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kryptonPanel2 = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.ktxtUserResponse = new Krypton.Toolkit.KryptonTextBox();
+ this.kwlblPrompt = new Krypton.Toolkit.KryptonWrapLabel();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
+ this.kryptonPanel1.SuspendLayout();
+ this.tlpButtons.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit();
+ this.kryptonPanel2.SuspendLayout();
+ this.tableLayoutPanel2.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // kryptonPanel1
+ //
+ this.kryptonPanel1.Controls.Add(this.tlpButtons);
+ this.kryptonPanel1.Controls.Add(this.kryptonBorderEdge1);
+ this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kryptonPanel1.Location = new System.Drawing.Point(0, 129);
+ this.kryptonPanel1.Name = "kryptonPanel1";
+ this.kryptonPanel1.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kryptonPanel1.Size = new System.Drawing.Size(378, 50);
+ this.kryptonPanel1.TabIndex = 0;
+ //
+ // tlpButtons
+ //
+ this.tlpButtons.BackColor = System.Drawing.Color.Transparent;
+ this.tlpButtons.ColumnCount = 2;
+ this.tlpButtons.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpButtons.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tlpButtons.Controls.Add(this.kbtnCancel, 1, 0);
+ this.tlpButtons.Controls.Add(this.kbtnOk, 0, 0);
+ this.tlpButtons.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpButtons.Location = new System.Drawing.Point(0, 1);
+ this.tlpButtons.Name = "tlpButtons";
+ this.tlpButtons.RowCount = 1;
+ this.tlpButtons.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpButtons.Size = new System.Drawing.Size(378, 49);
+ this.tlpButtons.TabIndex = 1;
+ //
+ // kbtnCancel
+ //
+ this.kbtnCancel.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnCancel.AutoSize = true;
+ this.kbtnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this.kbtnCancel.Location = new System.Drawing.Point(10, 13);
+ this.kbtnCancel.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnCancel.Name = "kbtnCancel";
+ this.kbtnCancel.Size = new System.Drawing.Size(94, 22);
+ this.kbtnCancel.TabIndex = 0;
+ this.kbtnCancel.Values.Text = "kryptonButton1";
+ //
+ // kbtnOk
+ //
+ this.kbtnOk.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnOk.AutoSize = true;
+ this.kbtnOk.Location = new System.Drawing.Point(124, 13);
+ this.kbtnOk.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnOk.Name = "kbtnOk";
+ this.kbtnOk.Size = new System.Drawing.Size(94, 22);
+ this.kbtnOk.TabIndex = 1;
+ this.kbtnOk.Values.Text = "kryptonButton1";
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(378, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kryptonPanel2
+ //
+ this.kryptonPanel2.Controls.Add(this.tableLayoutPanel2);
+ this.kryptonPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kryptonPanel2.Location = new System.Drawing.Point(0, 0);
+ this.kryptonPanel2.Name = "kryptonPanel2";
+ this.kryptonPanel2.Size = new System.Drawing.Size(378, 129);
+ this.kryptonPanel2.TabIndex = 1;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel2.ColumnCount = 1;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Controls.Add(this.ktxtUserResponse, 0, 1);
+ this.tableLayoutPanel2.Controls.Add(this.kwlblPrompt, 0, 0);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 0);
+ this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(5);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 2;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(378, 129);
+ this.tableLayoutPanel2.TabIndex = 0;
+ //
+ // ktxtUserResponse
+ //
+ this.ktxtUserResponse.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.ktxtUserResponse.Location = new System.Drawing.Point(3, 103);
+ this.ktxtUserResponse.Name = "ktxtUserResponse";
+ this.ktxtUserResponse.Size = new System.Drawing.Size(372, 23);
+ this.ktxtUserResponse.TabIndex = 0;
+ this.ktxtUserResponse.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ktxtUserResponse_KeyDown);
+ //
+ // kwlblPrompt
+ //
+ this.kwlblPrompt.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlblPrompt.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.kwlblPrompt.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlblPrompt.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.kwlblPrompt.Location = new System.Drawing.Point(3, 0);
+ this.kwlblPrompt.Name = "kwlblPrompt";
+ this.kwlblPrompt.Size = new System.Drawing.Size(372, 100);
+ this.kwlblPrompt.Text = "kryptonWrapLabel1";
+ this.kwlblPrompt.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // VisualInputBoxRtlAwareForm
+ //
+ this.AcceptButton = this.kbtnOk;
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.CancelButton = this.kbtnCancel;
+ this.ClientSize = new System.Drawing.Size(378, 179);
+ this.Controls.Add(this.kryptonPanel2);
+ this.Controls.Add(this.kryptonPanel1);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualInputBoxRtlAwareForm";
+ this.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
+ this.kryptonPanel1.ResumeLayout(false);
+ this.kryptonPanel1.PerformLayout();
+ this.tlpButtons.ResumeLayout(false);
+ this.tlpButtons.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit();
+ this.kryptonPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kryptonPanel1;
+ private KryptonPanel kryptonPanel2;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private TableLayoutPanel tlpButtons;
+ private TableLayoutPanel tableLayoutPanel2;
+ private KryptonTextBox ktxtUserResponse;
+ private KryptonWrapLabel kwlblPrompt;
+ private KryptonButton kbtnCancel;
+ private KryptonButton kbtnOk;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualInputBoxRtlAwareForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualInputBoxRtlAwareForm.cs
new file mode 100644
index 000000000..e648cf75d
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualInputBoxRtlAwareForm.cs
@@ -0,0 +1,105 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualInputBoxRtlAwareForm : KryptonForm
+ {
+ #region Instance Fields
+
+ private readonly KryptonInputBoxData _inputBoxData;
+
+ #endregion
+
+ #region Identity
+
+ public VisualInputBoxRtlAwareForm()
+ {
+ InitializeComponent();
+ }
+
+ public VisualInputBoxRtlAwareForm(KryptonInputBoxData inputBoxData)
+ {
+ _inputBoxData = inputBoxData;
+
+ InitializeComponent();
+
+ // Update contents to match requirements
+ UpdateText();
+
+ UpdateCue();
+
+ UpdateButtons();
+ }
+
+ #endregion
+
+ #region Implementation
+
+ internal static string InternalShow(KryptonInputBoxData inputBoxData)
+ {
+ // If do not have an owner passed in then get the active window and use that instead
+ IWin32Window? showOwner = inputBoxData.Owner ?? FromHandle(PI.GetActiveWindow());
+
+ // Show input box window as a modal dialog and then dispose of it afterwards
+ using var ib = new VisualInputBoxRtlAwareForm(inputBoxData);
+ ib.StartPosition = showOwner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
+
+ return ib.ShowDialog(showOwner) == DialogResult.OK
+ ? ib.InputResponse
+ : string.Empty;
+ }
+
+ internal string InputResponse => ktxtUserResponse.Text;
+
+ private void UpdateText()
+ {
+ Text = _inputBoxData.Caption;
+ kwlblPrompt.Text = _inputBoxData.Prompt;
+ ktxtUserResponse.Text = _inputBoxData.DefaultResponse;
+ ktxtUserResponse.UseSystemPasswordChar = _inputBoxData.UsePasswordOption ?? false;
+ }
+
+ private void UpdateCue()
+ {
+ ktxtUserResponse.CueHint.CueHintText = _inputBoxData.CueText;
+
+ if (_inputBoxData.CueColor != null || _inputBoxData.CueColor != Color.Transparent || _inputBoxData.CueColor != GlobalStaticValues.EMPTY_COLOR)
+ {
+ ktxtUserResponse.CueHint.Color1 = _inputBoxData.CueColor ?? Color.Gray;
+ }
+
+ if (_inputBoxData.CueTypeface != null)
+ {
+ ktxtUserResponse.CueHint.Font = _inputBoxData.CueTypeface ?? KryptonManager.CurrentGlobalPalette.BaseFont;
+ }
+ }
+
+ private void UpdateButtons()
+ {
+ kbtnOk.Text = KryptonManager.Strings.GeneralStrings.OK;
+ kbtnCancel.Text = KryptonManager.Strings.GeneralStrings.Cancel;
+ }
+
+ private void ktxtUserResponse_KeyDown(object sender, KeyEventArgs e)
+ {
+ switch (e.KeyCode)
+ {
+ case Keys.Enter:
+ kbtnOk.PerformClick();
+ break;
+ case Keys.Escape:
+ kbtnCancel.PerformClick();
+ break;
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualInputBoxRtlAwareForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualInputBoxRtlAwareForm.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualInputBoxRtlAwareForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualMessageBoxRtlAwareForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualMessageBoxRtlAwareForm.Designer.cs
new file mode 100644
index 000000000..69d76c97e
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualMessageBoxRtlAwareForm.Designer.cs
@@ -0,0 +1,255 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualMessageBoxRtlAwareForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ this._panelButtons = new Krypton.Toolkit.KryptonPanel();
+ this._borderEdge = new Krypton.Toolkit.KryptonBorderEdge();
+ this._button4 = new Krypton.Toolkit.MessageButton();
+ this._button3 = new Krypton.Toolkit.MessageButton();
+ this._button1 = new Krypton.Toolkit.MessageButton();
+ this._button2 = new Krypton.Toolkit.MessageButton();
+ this._messageIcon = new System.Windows.Forms.PictureBox();
+ this.kpnlContentArea = new Krypton.Toolkit.KryptonPanel();
+ this.krtbMessageText = new Krypton.Toolkit.KryptonRichTextBox();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
+ this.kryptonPanel1.SuspendLayout();
+ this.tableLayoutPanel1.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this._panelButtons)).BeginInit();
+ this._panelButtons.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this._messageIcon)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlContentArea)).BeginInit();
+ this.kpnlContentArea.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // kryptonPanel1
+ //
+ this.kryptonPanel1.Controls.Add(this.tableLayoutPanel1);
+ this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonPanel1.Margin = new System.Windows.Forms.Padding(2);
+ this.kryptonPanel1.Name = "kryptonPanel1";
+ this.kryptonPanel1.Size = new System.Drawing.Size(219, 64);
+ this.kryptonPanel1.TabIndex = 2;
+ //
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel1.ColumnCount = 2;
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.Controls.Add(this._panelButtons, 0, 1);
+ this.tableLayoutPanel1.Controls.Add(this._messageIcon, 0, 0);
+ this.tableLayoutPanel1.Controls.Add(this.kpnlContentArea, 1, 0);
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
+ this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(2);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 2;
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(219, 64);
+ this.tableLayoutPanel1.TabIndex = 0;
+ //
+ // _panelButtons
+ //
+ this.tableLayoutPanel1.SetColumnSpan(this._panelButtons, 2);
+ this._panelButtons.Controls.Add(this._borderEdge);
+ this._panelButtons.Controls.Add(this._button4);
+ this._panelButtons.Controls.Add(this._button3);
+ this._panelButtons.Controls.Add(this._button1);
+ this._panelButtons.Controls.Add(this._button2);
+ this._panelButtons.Dock = System.Windows.Forms.DockStyle.Fill;
+ this._panelButtons.Location = new System.Drawing.Point(0, 43);
+ this._panelButtons.Margin = new System.Windows.Forms.Padding(0);
+ this._panelButtons.Name = "_panelButtons";
+ this._panelButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this._panelButtons.Size = new System.Drawing.Size(219, 21);
+ this._panelButtons.TabIndex = 0;
+ //
+ // _borderEdge
+ //
+ this._borderEdge.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this._borderEdge.Dock = System.Windows.Forms.DockStyle.Top;
+ this._borderEdge.Location = new System.Drawing.Point(0, 0);
+ this._borderEdge.Margin = new System.Windows.Forms.Padding(2);
+ this._borderEdge.Name = "_borderEdge";
+ this._borderEdge.Size = new System.Drawing.Size(219, 1);
+ this._borderEdge.Text = "kryptonBorderEdge1";
+ //
+ // _button4
+ //
+ this._button4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this._button4.AutoSize = true;
+ this._button4.Enabled = false;
+ this._button4.IgnoreAltF4 = false;
+ this._button4.Location = new System.Drawing.Point(219, 0);
+ this._button4.Margin = new System.Windows.Forms.Padding(0);
+ this._button4.MinimumSize = new System.Drawing.Size(38, 21);
+ this._button4.Name = "_button4";
+ this._button4.Size = new System.Drawing.Size(38, 23);
+ this._button4.TabIndex = 2;
+ this._button4.Values.DropDownArrowColor = System.Drawing.Color.Empty;
+ this._button4.Values.Text = "B4";
+ this._button4.Visible = false;
+ //
+ // _button3
+ //
+ this._button3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this._button3.AutoSize = true;
+ this._button3.Enabled = false;
+ this._button3.IgnoreAltF4 = false;
+ this._button3.Location = new System.Drawing.Point(182, 0);
+ this._button3.Margin = new System.Windows.Forms.Padding(0);
+ this._button3.MinimumSize = new System.Drawing.Size(38, 21);
+ this._button3.Name = "_button3";
+ this._button3.Size = new System.Drawing.Size(38, 23);
+ this._button3.TabIndex = 2;
+ this._button3.Values.DropDownArrowColor = System.Drawing.Color.Empty;
+ this._button3.Values.Text = "B3";
+ this._button3.Visible = false;
+ //
+ // _button1
+ //
+ this._button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this._button1.AutoSize = true;
+ this._button1.Enabled = false;
+ this._button1.IgnoreAltF4 = false;
+ this._button1.Location = new System.Drawing.Point(106, 0);
+ this._button1.Margin = new System.Windows.Forms.Padding(0);
+ this._button1.MinimumSize = new System.Drawing.Size(38, 21);
+ this._button1.Name = "_button1";
+ this._button1.Size = new System.Drawing.Size(38, 23);
+ this._button1.TabIndex = 0;
+ this._button1.Values.DropDownArrowColor = System.Drawing.Color.Empty;
+ this._button1.Values.Text = "B1";
+ this._button1.Visible = false;
+ //
+ // _button2
+ //
+ this._button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this._button2.AutoSize = true;
+ this._button2.Enabled = false;
+ this._button2.IgnoreAltF4 = false;
+ this._button2.Location = new System.Drawing.Point(144, 0);
+ this._button2.Margin = new System.Windows.Forms.Padding(0);
+ this._button2.MinimumSize = new System.Drawing.Size(38, 21);
+ this._button2.Name = "_button2";
+ this._button2.Size = new System.Drawing.Size(38, 23);
+ this._button2.TabIndex = 1;
+ this._button2.Values.DropDownArrowColor = System.Drawing.Color.Empty;
+ this._button2.Values.Text = "B2";
+ this._button2.Visible = false;
+ //
+ // _messageIcon
+ //
+ this._messageIcon.BackColor = System.Drawing.Color.Transparent;
+ this._messageIcon.Dock = System.Windows.Forms.DockStyle.Fill;
+ this._messageIcon.Location = new System.Drawing.Point(178, 4);
+ this._messageIcon.Margin = new System.Windows.Forms.Padding(8, 4, 4, 4);
+ this._messageIcon.Name = "_messageIcon";
+ this._messageIcon.Size = new System.Drawing.Size(33, 35);
+ this._messageIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this._messageIcon.TabIndex = 0;
+ this._messageIcon.TabStop = false;
+ //
+ // kpnlContentArea
+ //
+ this.kpnlContentArea.Controls.Add(this.krtbMessageText);
+ this.kpnlContentArea.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlContentArea.Location = new System.Drawing.Point(4, 12);
+ this.kpnlContentArea.Margin = new System.Windows.Forms.Padding(4, 12, 4, 12);
+ this.kpnlContentArea.Name = "kpnlContentArea";
+ this.kpnlContentArea.Size = new System.Drawing.Size(166, 19);
+ this.kpnlContentArea.TabIndex = 1;
+ //
+ // krtbMessageText
+ //
+ this.krtbMessageText.DetectUrls = false;
+ this.krtbMessageText.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.krtbMessageText.InputControlStyle = Krypton.Toolkit.InputControlStyle.PanelClient;
+ this.krtbMessageText.Location = new System.Drawing.Point(0, 0);
+ this.krtbMessageText.Margin = new System.Windows.Forms.Padding(0);
+ this.krtbMessageText.Name = "krtbMessageText";
+ this.krtbMessageText.ReadOnly = true;
+ this.krtbMessageText.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None;
+ this.krtbMessageText.Size = new System.Drawing.Size(150, 19);
+ this.krtbMessageText.StateCommon.Border.DrawBorders = Krypton.Toolkit.PaletteDrawBorders.None;
+ this.krtbMessageText.TabIndex = 0;
+ this.krtbMessageText.TabStop = false;
+ this.krtbMessageText.Text = "Message Text\n.\ttabbed";
+ this.krtbMessageText.WordWrap = false;
+ //
+ // VisualMessageBoxRtlAwareForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(219, 64);
+ this.Controls.Add(this.kryptonPanel1);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+ this.KeyPreview = true;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualMessageBoxRtlAwareForm";
+ this.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+ this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.OnFormClosed);
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
+ this.kryptonPanel1.ResumeLayout(false);
+ this.tableLayoutPanel1.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this._panelButtons)).EndInit();
+ this._panelButtons.ResumeLayout(false);
+ this._panelButtons.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this._messageIcon)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlContentArea)).EndInit();
+ this.kpnlContentArea.ResumeLayout(false);
+ this.kpnlContentArea.PerformLayout();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kryptonPanel1;
+ private TableLayoutPanel tableLayoutPanel1;
+ private KryptonPanel _panelButtons;
+ private KryptonBorderEdge _borderEdge;
+ private MessageButton _button4;
+ private MessageButton _button3;
+ private MessageButton _button1;
+ private MessageButton _button2;
+ private PictureBox _messageIcon;
+ private KryptonPanel kpnlContentArea;
+ private KryptonRichTextBox krtbMessageText;
+ }
+}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualMessageBoxRtlAwareForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualMessageBoxRtlAwareForm.cs
new file mode 100644
index 000000000..f4469acd2
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualMessageBoxRtlAwareForm.cs
@@ -0,0 +1,616 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualMessageBoxRtlAwareForm : KryptonForm
+ {
+ #region Instance Fields
+
+ private readonly bool _showHelpButton;
+ private readonly string? _text;
+ private readonly string? _caption;
+ private readonly KryptonMessageBoxButtons _buttons;
+ private readonly KryptonMessageBoxIcon _kryptonMessageBoxIcon;
+ private readonly KryptonMessageBoxDefaultButton _defaultButton;
+ //private readonly MessageBoxOptions _options; // https://github.com/Krypton-Suite/Standard-Toolkit/issues/313
+
+ // If help information provided, or we are not a service/default desktop application then grab an owner for showing the message box
+ private readonly IWin32Window? _showOwner;
+ private readonly HelpInfo? _helpInfo;
+ private readonly KryptonMessageBoxNativeWindow _krtbNativeWindow;
+ #endregion
+
+ #region Public
+
+ public KryptonMessageBoxResult MessageBoxResult { get; set; }
+
+ #endregion
+
+ #region Identity
+
+ public VisualMessageBoxRtlAwareForm()
+ {
+ InitializeComponent();
+ }
+
+ public VisualMessageBoxRtlAwareForm(IWin32Window? showOwner, string? text, string? caption,
+ KryptonMessageBoxButtons buttons,
+ KryptonMessageBoxIcon icon,
+ KryptonMessageBoxDefaultButton defaultButton,
+ HelpInfo? helpInfo, bool? showCtrlCopy,
+ bool? showHelpButton,
+ bool? showCloseButton)
+ {
+ // Store incoming values
+ _text = CommonHelper.NormalizeLineBreaks(text ?? string.Empty);
+ _caption = caption;
+ _buttons = buttons;
+ _kryptonMessageBoxIcon = icon;
+ _defaultButton = defaultButton;
+ _helpInfo = helpInfo;
+ _showOwner = showOwner;
+ _showHelpButton = showHelpButton ?? (helpInfo != null);
+ _krtbNativeWindow = new();
+
+ // Create the form contents
+ InitializeComponent();
+
+ // Hookup the native window on the KRTB, only after IntializeComponent().
+ _krtbNativeWindow.AssignHandle(krtbMessageText.RichTextBox.Handle);
+
+ // Default Cursor for the KRTB when the cursors hovers over it
+ krtbMessageText.RichTextBox.Cursor = Cursors.Arrow;
+
+ // #1692 text font colour for input controls does not work correct on KMBees when using dark themes.
+ // Set the text colour to the one a control uses.
+ krtbMessageText.StateCommon.Content.Color1 = GlobalStaticValues.KryptonMessageBoxRichTextBoxTextColor;
+
+ // Update contents to match requirements
+ UpdateText();
+ UpdateIcon();
+ UpdateButtons();
+ UpdateDefault();
+ UpdateHelp();
+ UpdateTextExtra(showCtrlCopy);
+ // Finally calculate and set form sizing
+ UpdateSizing(showOwner);
+
+ ShowCloseButton(showCloseButton);
+ }
+ #endregion
+
+ #region Implementation
+
+ private void UpdateText()
+ {
+ Text = string.IsNullOrEmpty(_caption)
+ ? string.Empty
+ : _caption!.Split(Environment.NewLine.ToCharArray())[0];
+ krtbMessageText.Text = _text;
+ }
+
+ private void UpdateTextExtra(bool? showCtrlCopy)
+ {
+ if (!showCtrlCopy.HasValue)
+ {
+ switch (_kryptonMessageBoxIcon)
+ {
+ case KryptonMessageBoxIcon.Error:
+ case KryptonMessageBoxIcon.Exclamation:
+ showCtrlCopy = true;
+ break;
+ }
+ }
+
+ if (showCtrlCopy == true)
+ {
+ TextExtra = @"Ctrl+c to copy";
+ }
+ }
+
+ private void UpdateIcon()
+ {
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ switch (_kryptonMessageBoxIcon)
+ {
+ case KryptonMessageBoxIcon.None:
+ // Windows XP and before will Beep, Vista and above do not!
+ break;
+ case KryptonMessageBoxIcon.Hand:
+ _messageIcon.Image = MessageBoxImageResources.GenericHand;
+ SystemSounds.Hand.Play();
+ break;
+ case KryptonMessageBoxIcon.SystemHand:
+ //case KryptonMessageBoxIcon.SystemStop:
+ //case KryptonMessageBoxIcon.SystemError:
+ _messageIcon.Image = SystemIcons.Hand.ToBitmap();
+ SystemSounds.Hand.Play();
+ break;
+ case KryptonMessageBoxIcon.Question:
+ _messageIcon.Image = MessageBoxImageResources.Question_Windows_11;
+ SystemSounds.Question.Play();
+ break;
+ case KryptonMessageBoxIcon.SystemQuestion:
+ _messageIcon.Image = SystemIcons.Question.ToBitmap();
+ SystemSounds.Question.Play();
+ break;
+ case KryptonMessageBoxIcon.Exclamation:
+ _messageIcon.Image = MessageBoxImageResources.Warning_Windows_11;
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.SystemExclamation:
+ _messageIcon.Image = SystemIcons.Warning.ToBitmap();
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.Asterisk:
+ _messageIcon.Image = MessageBoxImageResources.Asterisk_Windows_11;
+ SystemSounds.Asterisk.Play();
+ break;
+ case KryptonMessageBoxIcon.SystemAsterisk:
+ _messageIcon.Image = SystemIcons.Asterisk.ToBitmap();
+ SystemSounds.Asterisk.Play();
+ break;
+ case KryptonMessageBoxIcon.Stop:
+ _messageIcon.Image = MessageBoxImageResources.GenericStop;
+ SystemSounds.Hand.Play();
+ break;
+ case KryptonMessageBoxIcon.Error:
+ _messageIcon.Image = MessageBoxImageResources.Critical_Windows_11;
+ SystemSounds.Hand.Play();
+ break;
+ case KryptonMessageBoxIcon.Warning:
+ _messageIcon.Image = MessageBoxImageResources.Warning_Windows_11;
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.Information:
+ _messageIcon.Image = MessageBoxImageResources.Information_Windows_11;
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.Shield:
+ _messageIcon.Image = UACShieldIconResources.UAC_Shield_Windows_11;
+ break;
+ case KryptonMessageBoxIcon.WindowsLogo:
+ // Because Windows 11 displays a generic application icon,
+ // we need to rely on an image instead
+ _messageIcon.Image = MessageBoxImageResources.Windows11;
+ break;
+ case KryptonMessageBoxIcon.Application:
+ {
+ var applicationPath = Application.ExecutablePath;
+ Image? sourceImage = GraphicsExtensions.ExtractIconFromFilePath(applicationPath)?.ToBitmap();
+ Image? scaledImage = GraphicsExtensions.ScaleImage(sourceImage, new Size(32, 32));
+ _messageIcon.Image = scaledImage ??
+ // Fall back to defaults
+ SystemIcons.Application.ToBitmap();
+ }
+ break;
+ case KryptonMessageBoxIcon.SystemApplication:
+ _messageIcon.Image = SystemIcons.Application.ToBitmap();
+ break;
+ }
+ }
+ else
+ {
+ switch (_kryptonMessageBoxIcon)
+ {
+ case KryptonMessageBoxIcon.None:
+ // Windows XP and before will Beep, Vista and above do not!
+ break;
+ case KryptonMessageBoxIcon.Hand:
+ _messageIcon.Image = MessageBoxImageResources.GenericHand;
+ SystemSounds.Hand.Play();
+ break;
+ case KryptonMessageBoxIcon.SystemHand:
+ //case KryptonMessageBoxIcon.SystemStop:
+ //case KryptonMessageBoxIcon.SystemError:
+ _messageIcon.Image = SystemIcons.Hand.ToBitmap();
+ SystemSounds.Hand.Play();
+ break;
+ case KryptonMessageBoxIcon.Question:
+ _messageIcon.Image = MessageBoxImageResources.GenericQuestion;
+ SystemSounds.Question.Play();
+ break;
+ case KryptonMessageBoxIcon.SystemQuestion:
+ _messageIcon.Image = SystemIcons.Question.ToBitmap();
+ SystemSounds.Question.Play();
+ break;
+ case KryptonMessageBoxIcon.Exclamation:
+ _messageIcon.Image = MessageBoxImageResources.GenericWarning;
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.SystemExclamation:
+ _messageIcon.Image = SystemIcons.Warning.ToBitmap();
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.Asterisk:
+ _messageIcon.Image = MessageBoxImageResources.GenericAsterisk;
+ SystemSounds.Asterisk.Play();
+ break;
+ case KryptonMessageBoxIcon.SystemAsterisk:
+ _messageIcon.Image = SystemIcons.Asterisk.ToBitmap();
+ SystemSounds.Asterisk.Play();
+ break;
+ case KryptonMessageBoxIcon.Stop:
+ _messageIcon.Image = MessageBoxImageResources.GenericStop;
+ SystemSounds.Hand.Play();
+ break;
+ case KryptonMessageBoxIcon.Error:
+ _messageIcon.Image = MessageBoxImageResources.GenericCritical;
+ SystemSounds.Hand.Play();
+ break;
+ case KryptonMessageBoxIcon.Warning:
+ _messageIcon.Image = MessageBoxImageResources.GenericWarning;
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.Information:
+ _messageIcon.Image = MessageBoxImageResources.GenericInformation;
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.Shield:
+ _messageIcon.Image = OSUtilities.IsWindowsTen
+ ? UACShieldIconResources.UAC_Shield_Windows_10
+ : UACShieldIconResources.UAC_Shield_Windows_7;
+ break;
+ case KryptonMessageBoxIcon.WindowsLogo:
+ _messageIcon.Image = OSUtilities.IsWindowsTen
+ ? MessageBoxImageResources.Windows_8_and_10_Logo
+ : SystemIcons.WinLogo.ToBitmap();
+ break;
+ case KryptonMessageBoxIcon.Application:
+ {
+ var applicationPath = Application.ExecutablePath;
+ Image? sourceImage = GraphicsExtensions.ExtractIconFromFilePath(applicationPath)?.ToBitmap();
+ Image? scaledImage = GraphicsExtensions.ScaleImage(sourceImage, new Size(32, 32));
+ _messageIcon.Image = scaledImage ??
+ // Fall back to defaults
+ SystemIcons.Application.ToBitmap();
+ }
+ break;
+ case KryptonMessageBoxIcon.SystemApplication:
+ _messageIcon.Image = SystemIcons.Application.ToBitmap();
+ break;
+ }
+ }
+ _messageIcon.Visible = (_kryptonMessageBoxIcon != KryptonMessageBoxIcon.None);
+ }
+
+ private void UpdateButtons()
+ {
+ switch (_buttons)
+ {
+ case KryptonMessageBoxButtons.OK:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.OK;
+ _button1.DialogResult = DialogResult.OK;
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ break;
+
+ case KryptonMessageBoxButtons.OKCancel:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.OK;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.Cancel;
+ _button1.DialogResult = DialogResult.OK;
+ _button2.DialogResult = DialogResult.Cancel;
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ _button2.Visible = true;
+ _button2.Enabled = true;
+ break;
+
+ case KryptonMessageBoxButtons.YesNo:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.Yes;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.No;
+ _button1.DialogResult = DialogResult.Yes;
+ _button2.DialogResult = DialogResult.No;
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ _button2.Visible = true;
+ _button2.Enabled = true;
+ ControlBox = false;
+ break;
+
+ case KryptonMessageBoxButtons.YesNoCancel:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.Yes;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.No;
+ _button3.Text = KryptonManager.Strings.GeneralStrings.Cancel;
+ _button1.DialogResult = DialogResult.Yes;
+ _button2.DialogResult = DialogResult.No;
+ _button3.DialogResult = DialogResult.Cancel;
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ _button2.Visible = true;
+ _button2.Enabled = true;
+ _button3.Visible = true;
+ _button3.Enabled = true;
+ break;
+
+ case KryptonMessageBoxButtons.RetryCancel:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.Retry;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.Cancel;
+ _button1.DialogResult = DialogResult.Retry;
+ _button2.DialogResult = DialogResult.Cancel;
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ _button2.Visible = true;
+ _button2.Enabled = true;
+ break;
+
+ case KryptonMessageBoxButtons.AbortRetryIgnore:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.Abort;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.Retry;
+ _button3.Text = KryptonManager.Strings.GeneralStrings.Ignore;
+ _button1.DialogResult = DialogResult.Abort;
+ _button2.DialogResult = DialogResult.Retry;
+ _button3.DialogResult = DialogResult.Ignore;
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ _button2.Visible = true;
+ _button2.Enabled = true;
+ _button3.Visible = true;
+ _button3.Enabled = true;
+ ControlBox = false;
+ break;
+
+ case KryptonMessageBoxButtons.CancelTryContinue:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.Cancel;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.TryAgain;
+ _button3.Text = KryptonManager.Strings.GeneralStrings.Continue;
+ _button1.DialogResult = DialogResult.Cancel;
+#if NET6_0_OR_GREATER
+ _button2.DialogResult = DialogResult.TryAgain;
+ _button3.DialogResult = DialogResult.Continue;
+#else
+ _button2.DialogResult = (DialogResult)10;
+ _button3.DialogResult = (DialogResult)11;
+#endif
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ _button2.Visible = true;
+ _button2.Enabled = true;
+ _button3.Visible = true;
+ _button3.Enabled = true;
+ break;
+ }
+
+ // Do we ignore the Alt+F4 on the buttons?
+ if (!ControlBox)
+ {
+ _button1.IgnoreAltF4 = true;
+ _button2.IgnoreAltF4 = true;
+ _button3.IgnoreAltF4 = true;
+ _button4.IgnoreAltF4 = true;
+ }
+ }
+
+ private void UpdateDefault()
+ {
+ AcceptButton = _defaultButton switch
+ {
+ KryptonMessageBoxDefaultButton.Button1 =>
+ //_button1.Select();
+ _button1,
+ KryptonMessageBoxDefaultButton.Button2 =>
+ //_button2.Select();
+ _button2,
+ KryptonMessageBoxDefaultButton.Button3 =>
+ //_button3.Select();
+ _button3,
+ KryptonMessageBoxDefaultButton.Button4 => _showHelpButton ? _button4 : _button1,
+ _ => _showHelpButton ? _button4 : _button1
+ };
+ }
+
+ private void UpdateHelp()
+ {
+ if (!_showHelpButton)
+ {
+ return;
+ }
+
+ MessageButton helpButton = _buttons switch
+ {
+ KryptonMessageBoxButtons.OK => _button2,
+ KryptonMessageBoxButtons.OKCancel
+ or KryptonMessageBoxButtons.YesNo
+ or KryptonMessageBoxButtons.RetryCancel => _button3,
+ KryptonMessageBoxButtons.AbortRetryIgnore
+ or KryptonMessageBoxButtons.YesNoCancel
+ or KryptonMessageBoxButtons.CancelTryContinue => _button4,
+ _ => throw new ArgumentOutOfRangeException()
+ };
+ if (helpButton != null)
+ {
+ helpButton.Visible = true;
+ helpButton.Enabled = true;
+ helpButton.Text = KryptonManager.Strings.GeneralStrings.Help;
+ helpButton.KeyPress += (_, _) => LaunchHelp();
+ helpButton.Click += (_, _) => LaunchHelp();
+ }
+ }
+
+ ///
+ /// When the user clicks the Help button, the Help file specified in the helpFilePath parameter
+ /// is opened and the Help keyword topic identified by the keyword parameter is Displayed.
+ /// The form that owns the message box (or the active form) also receives the HelpRequested event.
+ ///
+ private void LaunchHelp()
+ {
+ try
+ {
+ if (_showOwner != null)
+ {
+ Control? control = FromHandle(_showOwner.Handle);
+
+ var mInfoMethod = control!.GetType().GetMethod(nameof(OnHelpRequested), BindingFlags.Instance | BindingFlags.NonPublic,
+ Type.DefaultBinder, [typeof(HelpEventArgs)], null);
+ mInfoMethod?.Invoke(control, [new HelpEventArgs(MousePosition)]);
+ if (_helpInfo != null)
+ {
+ if (string.IsNullOrWhiteSpace(_helpInfo.HelpFilePath))
+ {
+ return;
+ }
+
+ if (!string.IsNullOrWhiteSpace(_helpInfo.Keyword))
+ {
+ Help.ShowHelp(control, _helpInfo.HelpFilePath, _helpInfo.Keyword);
+ }
+ else
+ {
+ Help.ShowHelp(control, _helpInfo.HelpFilePath, _helpInfo.Navigator, _helpInfo.Param);
+ }
+ }
+ }
+ }
+ catch
+ {
+ // Do nothing
+ }
+ }
+
+ private void UpdateSizing(IWin32Window? showOwner)
+ {
+ Size messageSizing = UpdateMessageSizing(showOwner);
+ Size buttonsSizing = UpdateButtonsSizing();
+
+ // Size of window is calculated from the client area
+ ClientSize = new Size(Math.Max(messageSizing.Width, buttonsSizing.Width),
+ messageSizing.Height + buttonsSizing.Height);
+ }
+
+ private Size UpdateMessageSizing(IWin32Window? showOwner)
+ {
+ // Update size of the message label but with a maximum width
+ Size textSize;
+ using (Graphics g = CreateGraphics())
+ {
+ // Find size of the label, with a max of 2/3 screen width
+ Screen screen = showOwner is IWin32Window window
+ ? Screen.FromHandle(window.Handle)
+ : Screen.PrimaryScreen ?? throw new NullReferenceException("Screen.PrimaryScreen returned null");
+
+ Size scaledMonitorSize = screen.WorkingArea.Size;
+ scaledMonitorSize.Width = (int)(scaledMonitorSize.Width * 2 / 3.0f);
+ scaledMonitorSize.Height = (int)(scaledMonitorSize.Height * 0.95f);
+
+ Font textFont = krtbMessageText.StateCommon.Content.GetContentShortTextFont(PaletteState.Normal) ?? KryptonManager.CurrentGlobalPalette!.BaseFont;
+ Font captionFont = KryptonManager.CurrentGlobalPalette.BaseFont;
+
+ // Measure the string
+ SizeF messageSize = g.MeasureString(_text, textFont, new SizeF(scaledMonitorSize.Width, scaledMonitorSize.Height));
+
+ // SKC: Don't forget to add the TextExtra into the calculation
+ SizeF captionSize = TextRenderer.MeasureText($"{_caption} {TextExtra}", captionFont, scaledMonitorSize);
+
+ var messageXSize = Math.Max(messageSize.Width, captionSize.Width);
+ // Work out DPI adjustment factor
+ var factorX = g.DpiX > 96 ? (1.0f * g.DpiX / 96) : 1.0f;
+ var factorY = g.DpiY > 96 ? (1.0f * g.DpiY / 96) : 1.0f;
+
+ messageSize.Width = messageXSize * factorX;
+ messageSize.Height *= factorY;
+
+ textSize = Size.Ceiling(messageSize);
+ }
+
+ // Calculate the size of the icon area and text area including margins
+ Padding textPadding = krtbMessageText.StateCommon.Content.GetContentPadding(PaletteState.Normal);
+ Padding textAreaAllMargin = Padding.Add(textPadding, kpnlContentArea.Margin);
+ Size iconArea = new Size(_messageIcon.Width + _messageIcon.Margin.Left + _messageIcon.Margin.Right,
+ _messageIcon.Height + _messageIcon.Margin.Top + _messageIcon.Margin.Bottom);
+ Size textArea = new Size(textSize.Width + textAreaAllMargin.Left + textAreaAllMargin.Right,
+ textSize.Height + textAreaAllMargin.Top + textAreaAllMargin.Bottom);
+ return new Size(textArea.Width + iconArea.Width,
+ Math.Max(iconArea.Height, textArea.Height));
+ }
+
+ private Size UpdateButtonsSizing()
+ {
+ var numButtons = 1;
+
+ // Button1 is always visible
+ Size button1Size = _button1.GetPreferredSize(Size.Empty);
+ var maxButtonSize = button1Size with { Width = button1Size.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING };
+
+ // If Button2 is visible
+ if (_button2.Enabled)
+ {
+ numButtons++;
+ Size button2Size = _button2.GetPreferredSize(Size.Empty);
+ maxButtonSize.Width = Math.Max(maxButtonSize.Width, button2Size.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING);
+ maxButtonSize.Height = Math.Max(maxButtonSize.Height, button2Size.Height);
+ }
+
+ // If Button3 is visible
+ if (_button3.Enabled)
+ {
+ numButtons++;
+ Size button3Size = _button3.GetPreferredSize(Size.Empty);
+ maxButtonSize.Width = Math.Max(maxButtonSize.Width, button3Size.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING);
+ maxButtonSize.Height = Math.Max(maxButtonSize.Height, button3Size.Height);
+ }
+ // If Button4 is visible
+ if (_button4.Enabled)
+ {
+ numButtons++;
+ Size button4Size = _button4.GetPreferredSize(Size.Empty);
+ maxButtonSize.Width = Math.Max(maxButtonSize.Width, button4Size.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING);
+ maxButtonSize.Height = Math.Max(maxButtonSize.Height, button4Size.Height);
+ }
+
+ // Start positioning buttons 10 pixels from right edge
+ var right = _panelButtons.Right - GlobalStaticValues.GLOBAL_BUTTON_PADDING;
+
+ //var left = _panelButtons.Left - GlobalStaticValues.GLOBAL_BUTTON_PADDING;
+
+ // If Button4 is visible
+ if (_button4.Enabled)
+ {
+ _button4.Location = new Point(right - maxButtonSize.Width, GlobalStaticValues.GLOBAL_BUTTON_PADDING);
+ _button4.Size = maxButtonSize;
+ right -= maxButtonSize.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING;
+ }
+
+ // If Button3 is visible
+ if (_button3.Enabled)
+ {
+ _button3.Location = new Point(right - maxButtonSize.Width, GlobalStaticValues.GLOBAL_BUTTON_PADDING);
+ _button3.Size = maxButtonSize;
+ right -= maxButtonSize.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING;
+ }
+
+ // If Button2 is visible
+ if (_button2.Enabled)
+ {
+ _button2.Location = new Point(right - maxButtonSize.Width, GlobalStaticValues.GLOBAL_BUTTON_PADDING);
+ _button2.Size = maxButtonSize;
+ right -= maxButtonSize.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING;
+ }
+
+ // Button1 is always visible
+ _button1.Location = new Point(right - maxButtonSize.Width, GlobalStaticValues.GLOBAL_BUTTON_PADDING);
+ _button1.Size = maxButtonSize;
+
+ // Size the panel for the buttons
+ _panelButtons.Size = new Size((maxButtonSize.Width * numButtons) + (GlobalStaticValues.GLOBAL_BUTTON_PADDING * (numButtons + 1)), maxButtonSize.Height + (GlobalStaticValues.GLOBAL_BUTTON_PADDING * 2));
+
+ // Button area is the number of buttons with gaps between them and 10 pixels around all edges
+ return new Size((maxButtonSize.Width * numButtons) + (GlobalStaticValues.GLOBAL_BUTTON_PADDING * (numButtons + 1)), maxButtonSize.Height + (GlobalStaticValues.GLOBAL_BUTTON_PADDING * 2));
+ }
+
+ private void ShowCloseButton(bool? showCloseButton) => CloseBox = showCloseButton ?? true;
+
+ private void OnFormClosed(object sender, FormClosedEventArgs e)
+ {
+ _krtbNativeWindow.ReleaseHandle();
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualMessageBoxRtlAwareForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualMessageBoxRtlAwareForm.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualMessageBoxRtlAwareForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualMessageBoxRtlAwareFormDep.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualMessageBoxRtlAwareFormDep.Designer.cs
new file mode 100644
index 000000000..b8d58920b
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualMessageBoxRtlAwareFormDep.Designer.cs
@@ -0,0 +1,271 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualMessageBoxRtlAwareFormDep
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ this._panelButtons = new Krypton.Toolkit.KryptonPanel();
+ this._borderEdge = new Krypton.Toolkit.KryptonBorderEdge();
+ this._button4 = new Krypton.Toolkit.MessageButton();
+ this._button3 = new Krypton.Toolkit.MessageButton();
+ this._button1 = new Krypton.Toolkit.MessageButton();
+ this._button2 = new Krypton.Toolkit.MessageButton();
+ this._messageIcon = new System.Windows.Forms.PictureBox();
+ this.kpnlContentArea = new Krypton.Toolkit.KryptonPanel();
+ this.krtbMessageText = new Krypton.Toolkit.KryptonRichTextBox();
+ this.klwlblMessageText = new Krypton.Toolkit.KryptonLinkWrapLabel();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
+ this.kryptonPanel1.SuspendLayout();
+ this.tableLayoutPanel1.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this._panelButtons)).BeginInit();
+ this._panelButtons.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this._messageIcon)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlContentArea)).BeginInit();
+ this.kpnlContentArea.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // kryptonPanel1
+ //
+ this.kryptonPanel1.Controls.Add(this.tableLayoutPanel1);
+ this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonPanel1.Margin = new System.Windows.Forms.Padding(2);
+ this.kryptonPanel1.Name = "kryptonPanel1";
+ this.kryptonPanel1.Size = new System.Drawing.Size(219, 64);
+ this.kryptonPanel1.TabIndex = 2;
+ //
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel1.ColumnCount = 2;
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.Controls.Add(this._panelButtons, 0, 1);
+ this.tableLayoutPanel1.Controls.Add(this._messageIcon, 0, 0);
+ this.tableLayoutPanel1.Controls.Add(this.kpnlContentArea, 1, 0);
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
+ this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(2);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 2;
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(219, 64);
+ this.tableLayoutPanel1.TabIndex = 0;
+ //
+ // _panelButtons
+ //
+ this.tableLayoutPanel1.SetColumnSpan(this._panelButtons, 2);
+ this._panelButtons.Controls.Add(this._borderEdge);
+ this._panelButtons.Controls.Add(this._button4);
+ this._panelButtons.Controls.Add(this._button3);
+ this._panelButtons.Controls.Add(this._button1);
+ this._panelButtons.Controls.Add(this._button2);
+ this._panelButtons.Dock = System.Windows.Forms.DockStyle.Fill;
+ this._panelButtons.Location = new System.Drawing.Point(0, 43);
+ this._panelButtons.Margin = new System.Windows.Forms.Padding(0);
+ this._panelButtons.Name = "_panelButtons";
+ this._panelButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this._panelButtons.Size = new System.Drawing.Size(219, 21);
+ this._panelButtons.TabIndex = 0;
+ //
+ // _borderEdge
+ //
+ this._borderEdge.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this._borderEdge.Dock = System.Windows.Forms.DockStyle.Top;
+ this._borderEdge.Location = new System.Drawing.Point(0, 0);
+ this._borderEdge.Margin = new System.Windows.Forms.Padding(2);
+ this._borderEdge.Name = "_borderEdge";
+ this._borderEdge.Size = new System.Drawing.Size(219, 1);
+ this._borderEdge.Text = "kryptonBorderEdge1";
+ //
+ // _button4
+ //
+ this._button4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this._button4.AutoSize = true;
+ this._button4.Enabled = false;
+ this._button4.IgnoreAltF4 = false;
+ this._button4.Location = new System.Drawing.Point(219, 0);
+ this._button4.Margin = new System.Windows.Forms.Padding(0);
+ this._button4.MinimumSize = new System.Drawing.Size(38, 21);
+ this._button4.Name = "_button4";
+ this._button4.Size = new System.Drawing.Size(38, 23);
+ this._button4.TabIndex = 2;
+ this._button4.Values.DropDownArrowColor = System.Drawing.Color.Empty;
+ this._button4.Values.Text = "B4";
+ this._button4.Visible = false;
+ //
+ // _button3
+ //
+ this._button3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this._button3.AutoSize = true;
+ this._button3.Enabled = false;
+ this._button3.IgnoreAltF4 = false;
+ this._button3.Location = new System.Drawing.Point(182, 0);
+ this._button3.Margin = new System.Windows.Forms.Padding(0);
+ this._button3.MinimumSize = new System.Drawing.Size(38, 21);
+ this._button3.Name = "_button3";
+ this._button3.Size = new System.Drawing.Size(38, 23);
+ this._button3.TabIndex = 2;
+ this._button3.Values.DropDownArrowColor = System.Drawing.Color.Empty;
+ this._button3.Values.Text = "B3";
+ this._button3.Visible = false;
+ //
+ // _button1
+ //
+ this._button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this._button1.AutoSize = true;
+ this._button1.Enabled = false;
+ this._button1.IgnoreAltF4 = false;
+ this._button1.Location = new System.Drawing.Point(106, 0);
+ this._button1.Margin = new System.Windows.Forms.Padding(0);
+ this._button1.MinimumSize = new System.Drawing.Size(38, 21);
+ this._button1.Name = "_button1";
+ this._button1.Size = new System.Drawing.Size(38, 23);
+ this._button1.TabIndex = 0;
+ this._button1.Values.DropDownArrowColor = System.Drawing.Color.Empty;
+ this._button1.Values.Text = "B1";
+ this._button1.Visible = false;
+ //
+ // _button2
+ //
+ this._button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this._button2.AutoSize = true;
+ this._button2.Enabled = false;
+ this._button2.IgnoreAltF4 = false;
+ this._button2.Location = new System.Drawing.Point(144, 0);
+ this._button2.Margin = new System.Windows.Forms.Padding(0);
+ this._button2.MinimumSize = new System.Drawing.Size(38, 21);
+ this._button2.Name = "_button2";
+ this._button2.Size = new System.Drawing.Size(38, 23);
+ this._button2.TabIndex = 1;
+ this._button2.Values.DropDownArrowColor = System.Drawing.Color.Empty;
+ this._button2.Values.Text = "B2";
+ this._button2.Visible = false;
+ //
+ // _messageIcon
+ //
+ this._messageIcon.BackColor = System.Drawing.Color.Transparent;
+ this._messageIcon.Dock = System.Windows.Forms.DockStyle.Fill;
+ this._messageIcon.Location = new System.Drawing.Point(178, 4);
+ this._messageIcon.Margin = new System.Windows.Forms.Padding(8, 4, 4, 4);
+ this._messageIcon.Name = "_messageIcon";
+ this._messageIcon.Size = new System.Drawing.Size(33, 35);
+ this._messageIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this._messageIcon.TabIndex = 0;
+ this._messageIcon.TabStop = false;
+ //
+ // kpnlContentArea
+ //
+ this.kpnlContentArea.Controls.Add(this.krtbMessageText);
+ this.kpnlContentArea.Controls.Add(this.klwlblMessageText);
+ this.kpnlContentArea.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlContentArea.Location = new System.Drawing.Point(4, 12);
+ this.kpnlContentArea.Margin = new System.Windows.Forms.Padding(4, 12, 4, 12);
+ this.kpnlContentArea.Name = "kpnlContentArea";
+ this.kpnlContentArea.Size = new System.Drawing.Size(166, 19);
+ this.kpnlContentArea.TabIndex = 1;
+ //
+ // krtbMessageText
+ //
+ this.krtbMessageText.DetectUrls = false;
+ this.krtbMessageText.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.krtbMessageText.InputControlStyle = Krypton.Toolkit.InputControlStyle.PanelClient;
+ this.krtbMessageText.Location = new System.Drawing.Point(0, 0);
+ this.krtbMessageText.Margin = new System.Windows.Forms.Padding(0);
+ this.krtbMessageText.Name = "krtbMessageText";
+ this.krtbMessageText.ReadOnly = true;
+ this.krtbMessageText.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None;
+ this.krtbMessageText.Size = new System.Drawing.Size(150, 19);
+ this.krtbMessageText.StateCommon.Border.DrawBorders = Krypton.Toolkit.PaletteDrawBorders.None;
+ this.krtbMessageText.TabIndex = 0;
+ this.krtbMessageText.TabStop = false;
+ this.krtbMessageText.Text = "Message Text\n.\ttabbed";
+ this.krtbMessageText.WordWrap = false;
+ //
+ // klwlblMessageText
+ //
+ this.klwlblMessageText.AutoSize = false;
+ this.klwlblMessageText.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.klwlblMessageText.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.klwlblMessageText.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.klwlblMessageText.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.klwlblMessageText.Location = new System.Drawing.Point(0, 0);
+ this.klwlblMessageText.Name = "klwlblMessageText";
+ this.klwlblMessageText.Size = new System.Drawing.Size(166, 19);
+ this.klwlblMessageText.Text = "Message Text";
+ this.klwlblMessageText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // VisualMessageBoxRtlAwareFormDep
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(219, 64);
+ this.Controls.Add(this.kryptonPanel1);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+ this.KeyPreview = true;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualMessageBoxRtlAwareFormDep";
+ this.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+ this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.OnFormClosed);
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
+ this.kryptonPanel1.ResumeLayout(false);
+ this.tableLayoutPanel1.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this._panelButtons)).EndInit();
+ this._panelButtons.ResumeLayout(false);
+ this._panelButtons.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this._messageIcon)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlContentArea)).EndInit();
+ this.kpnlContentArea.ResumeLayout(false);
+ this.kpnlContentArea.PerformLayout();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kryptonPanel1;
+ private TableLayoutPanel tableLayoutPanel1;
+ private KryptonPanel _panelButtons;
+ private KryptonBorderEdge _borderEdge;
+ private MessageButton _button4;
+ private MessageButton _button3;
+ private MessageButton _button1;
+ private MessageButton _button2;
+ private PictureBox _messageIcon;
+ private KryptonPanel kpnlContentArea;
+ private KryptonLinkWrapLabel klwlblMessageText;
+ private KryptonRichTextBox krtbMessageText;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualMessageBoxRtlAwareFormDep.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualMessageBoxRtlAwareFormDep.cs
new file mode 100644
index 000000000..131a0dc67
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualMessageBoxRtlAwareFormDep.cs
@@ -0,0 +1,1258 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+using System.Data;
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualMessageBoxRtlAwareFormDep : KryptonForm
+ {
+ #region Instance Fields
+
+ private readonly bool _showHelpButton;
+ private readonly string? _text;
+ private readonly string? _caption;
+ private readonly string _applicationPath;
+ private readonly KryptonMessageBoxButtons _buttons;
+ private readonly KryptonMessageBoxIcon _kryptonMessageBoxIcon;
+ private readonly Image? _applicationImage;
+ private readonly bool? _forceUseOfOperatingSystemIcons;
+ private readonly KryptonMessageBoxDataDep _messageBoxData;
+ private readonly bool? _showCloseButton;
+
+ private readonly KryptonMessageBoxDefaultButton _defaultButton;
+ //private readonly MessageBoxOptions _options; // https://github.com/Krypton-Suite/Standard-Toolkit/issues/313
+
+ // If help information provided, or we are not a service/default desktop application then grab an owner for showing the message box
+ private readonly IWin32Window? _showOwner;
+ private readonly HelpInfo? _helpInfo;
+ private readonly KryptonMessageBoxNativeWindow _krtbNativeWindow;
+
+ // For the LinkLabel option
+ private readonly MessageBoxContentAreaType? _contentAreaType;
+ private readonly KryptonCommand? _linkLabelCommand;
+ private readonly ProcessStartInfo? _linkLaunchArgument;
+ private readonly LinkArea _contentLinkArea;
+
+ private KryptonMessageBoxResult _messageBoxResult;
+
+ #endregion
+
+ #region Public
+
+ public KryptonMessageBoxResult MessageBoxResult
+ {
+ get => _messageBoxResult;
+ set => _messageBoxResult = value;
+ }
+
+ #endregion
+
+ #region Identity
+
+ public VisualMessageBoxRtlAwareFormDep()
+ {
+ InitializeComponent();
+ }
+
+ public VisualMessageBoxRtlAwareFormDep(IWin32Window? showOwner, string? text, string? caption,
+ KryptonMessageBoxButtons buttons,
+ KryptonMessageBoxIcon icon,
+ KryptonMessageBoxDefaultButton defaultButton,
+ HelpInfo? helpInfo, bool? showCtrlCopy,
+ bool? showHelpButton,
+ Image? applicationImage,
+ string? applicationPath,
+ MessageBoxContentAreaType? contentAreaType,
+ KryptonCommand? linkLabelCommand,
+ ProcessStartInfo? linkLaunchArgument,
+ LinkArea? contentLinkArea,
+ bool? forceUseOfOperatingSystemIcons,
+ bool? showCloseButton)
+ {
+ // Store incoming values
+ _text = CommonHelper.NormalizeLineBreaks(text ?? string.Empty);
+ _caption = caption;
+ _buttons = buttons;
+ _kryptonMessageBoxIcon = icon;
+ _defaultButton = defaultButton;
+ _helpInfo = helpInfo;
+ _showOwner = showOwner;
+ _showHelpButton = showHelpButton ?? (helpInfo != null);
+ _applicationImage = applicationImage;
+ _applicationPath = applicationPath ?? string.Empty;
+ _contentAreaType = contentAreaType ?? MessageBoxContentAreaType.Normal;
+ _linkLabelCommand = linkLabelCommand ?? new KryptonCommand();
+ _contentLinkArea = string.IsNullOrEmpty(text)
+ ? new LinkArea(0, 0)
+ : contentLinkArea ?? new LinkArea(0, text!.Length);
+ _linkLaunchArgument = linkLaunchArgument ?? new ProcessStartInfo();
+ _forceUseOfOperatingSystemIcons = forceUseOfOperatingSystemIcons ?? false;
+ _showCloseButton = showCloseButton ?? true;
+ _krtbNativeWindow = new();
+
+ // Create the form contents
+ InitializeComponent();
+
+ // Hookup the native window on the KRTB, only after IntializeComponent().
+ _krtbNativeWindow.AssignHandle(krtbMessageText.RichTextBox.Handle);
+
+ // Default Cursor for the KRTB when the cursors hovers over it
+ krtbMessageText.RichTextBox.Cursor = Cursors.Arrow;
+
+ // #1692 text font colour for input controls does not work correct on KMBees when using dark themes.
+ // Set the text colour to the one a control uses.
+ krtbMessageText.StateCommon.Content.Color1 = GlobalStaticValues.KryptonMessageBoxRichTextBoxTextColor;
+
+ // Update contents to match requirements
+ UpdateText();
+ UpdateIcon();
+ UpdateButtons();
+ UpdateDefault();
+ UpdateHelp();
+ UpdateTextExtra(showCtrlCopy);
+ UpdateContentAreaType(contentAreaType);
+ UpdateContentLinkArea(contentLinkArea);
+
+ // Finally calculate and set form sizing
+ UpdateSizing(showOwner);
+
+ ShowCloseButton(showCloseButton);
+ }
+
+ public VisualMessageBoxRtlAwareFormDep(KryptonMessageBoxDataDep messageBoxData)
+ {
+ _messageBoxData = messageBoxData;
+
+ InitializeComponent();
+
+ // Update contents to match requirements
+ UpdateText(_messageBoxData.Caption!, _messageBoxData.MessageText, _messageBoxData.MessageContentAreaType);
+ UpdateIcon(_messageBoxData.Icon);
+ UpdateButtons(_messageBoxData.Buttons);
+ UpdateDefault(_messageBoxData.DefaultButton);
+ UpdateHelp(_messageBoxData.ShowHelpButton);
+ UpdateTextExtra(_messageBoxData.ShowCtrlCopy);
+ UpdateContentAreaType(_messageBoxData.MessageContentAreaType);
+ UpdateContentLinkArea(_messageBoxData.ContentLinkArea);
+
+ ShowCloseButton(_messageBoxData.ShowCloseButton);
+
+ // Finally calculate and set form sizing
+ UpdateSizing(_messageBoxData.Owner);
+ }
+
+ #endregion
+
+ #region Implementation
+
+ private void UpdateText(string? caption, string? text, MessageBoxContentAreaType? contentAreaType)
+ {
+ // Set the text of the form
+ Text = string.IsNullOrEmpty(caption) ? string.Empty : caption!.Split(Environment.NewLine.ToCharArray())[0];
+
+ switch (contentAreaType)
+ {
+ case MessageBoxContentAreaType.Normal:
+ krtbMessageText.Text = text;
+ break;
+ case MessageBoxContentAreaType.LinkLabel:
+ klwlblMessageText.Text = text;
+ break;
+ case null:
+ krtbMessageText.Text = text;
+ break;
+ default:
+ throw new ArgumentOutOfRangeException(nameof(contentAreaType), contentAreaType, null);
+ }
+ }
+
+ private void UpdateText()
+ {
+ Text = string.IsNullOrEmpty(_caption) ? string.Empty : _caption!.Split(Environment.NewLine.ToCharArray())[0];
+
+ if (_contentAreaType == MessageBoxContentAreaType.Normal)
+ {
+ krtbMessageText.Text = _text;
+ }
+ else
+ {
+ klwlblMessageText.Text = _text;
+ }
+ }
+
+ private void UpdateTextExtra(bool? showCtrlCopy)
+ {
+ if (!showCtrlCopy.HasValue)
+ {
+ switch (_kryptonMessageBoxIcon)
+ {
+ case KryptonMessageBoxIcon.Error:
+ case KryptonMessageBoxIcon.Exclamation:
+ showCtrlCopy = true;
+ break;
+ }
+ }
+
+ if (showCtrlCopy == true)
+ {
+ TextExtra = @"Ctrl+c to copy";
+ }
+ }
+
+ private void UpdateIcon(KryptonMessageBoxIcon icon)
+ {
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ switch (icon)
+ {
+ case KryptonMessageBoxIcon.None:
+ // Windows XP and before will Beep, Vista and above do not!
+ if (GlobalStaticValues.OS_MAJOR_VERSION < 6)
+ {
+ SystemSounds.Beep.Play();
+ }
+ break;
+ case KryptonMessageBoxIcon.Hand:
+ _messageIcon.Image = MessageBoxImageResources.GenericHand;
+ SystemSounds.Hand.Play();
+ break;
+ case KryptonMessageBoxIcon.Question:
+ _messageIcon.Image = MessageBoxImageResources.Question_Windows_11;
+ SystemSounds.Question.Play();
+ break;
+ case KryptonMessageBoxIcon.Exclamation:
+ _messageIcon.Image = MessageBoxImageResources.Warning_Windows_11;
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.Asterisk:
+ _messageIcon.Image = MessageBoxImageResources.Asterisk_Windows_11;
+ SystemSounds.Asterisk.Play();
+ break;
+ case KryptonMessageBoxIcon.Stop:
+ _messageIcon.Image = MessageBoxImageResources.GenericStop;
+ SystemSounds.Hand.Play();
+ break;
+ case KryptonMessageBoxIcon.Error:
+ _messageIcon.Image = MessageBoxImageResources.Critical_Windows_11;
+ SystemSounds.Hand.Play();
+ break;
+ case KryptonMessageBoxIcon.Warning:
+ _messageIcon.Image = MessageBoxImageResources.Warning_Windows_11;
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.Information:
+ _messageIcon.Image = MessageBoxImageResources.Information_Windows_11;
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.Shield:
+ _messageIcon.Image = UACShieldIconResources.UAC_Shield_Windows_11;
+ break;
+ case KryptonMessageBoxIcon.WindowsLogo:
+ _messageIcon.Image = MessageBoxImageResources.Windows11;
+ break;
+ case KryptonMessageBoxIcon.Application:
+ if (_applicationImage != null)
+ {
+ _messageIcon.Image = _applicationImage;
+ }
+ else if (!string.IsNullOrEmpty(_applicationPath))
+ {
+ Image? sourceImage = GraphicsExtensions.ExtractIconFromFilePath(_applicationPath)?.ToBitmap();
+ Image? scaledImage = GraphicsExtensions.ScaleImage(sourceImage, new Size(32, 32));
+
+ _messageIcon.Image = scaledImage;
+ }
+ else
+ {
+ // Fall back to defaults
+ _messageIcon.Image = SystemIcons.Application.ToBitmap();
+ }
+ break;
+ case KryptonMessageBoxIcon.SystemApplication:
+ _messageIcon.Image = SystemIcons.Application.ToBitmap();
+ break;
+ }
+ }
+ else
+ {
+ switch (icon)
+ {
+ case KryptonMessageBoxIcon.None:
+ // Windows XP and before will Beep, Vista and above do not!
+ if (GlobalStaticValues.OS_MAJOR_VERSION < 6)
+ {
+ SystemSounds.Beep.Play();
+ }
+
+ break;
+ case KryptonMessageBoxIcon.Hand:
+ _messageIcon.Image = MessageBoxImageResources.GenericHand;
+ SystemSounds.Hand.Play();
+ break;
+ case KryptonMessageBoxIcon.SystemHand:
+ _messageIcon.Image = SystemIcons.Hand.ToBitmap();
+ SystemSounds.Hand.Play();
+ break;
+ case KryptonMessageBoxIcon.Question:
+ _messageIcon.Image = MessageBoxImageResources.GenericQuestion;
+ SystemSounds.Question.Play();
+ break;
+ case KryptonMessageBoxIcon.SystemQuestion:
+ _messageIcon.Image = SystemIcons.Question.ToBitmap();
+ SystemSounds.Question.Play();
+ break;
+ case KryptonMessageBoxIcon.Exclamation:
+ _messageIcon.Image = MessageBoxImageResources.GenericWarning;
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.SystemExclamation:
+ _messageIcon.Image = SystemIcons.Warning.ToBitmap();
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.Asterisk:
+ _messageIcon.Image = OSUtilities.IsAtLeastWindowsEleven
+ ? MessageBoxImageResources.Asterisk_Windows_11
+ : MessageBoxImageResources.GenericAsterisk;
+ SystemSounds.Asterisk.Play();
+ break;
+ case KryptonMessageBoxIcon.SystemAsterisk:
+ _messageIcon.Image = SystemIcons.Asterisk.ToBitmap();
+ SystemSounds.Asterisk.Play();
+ break;
+ case KryptonMessageBoxIcon.Stop:
+ _messageIcon.Image = MessageBoxImageResources.GenericStop;
+ SystemSounds.Hand.Play();
+ break;
+ case KryptonMessageBoxIcon.Error:
+ _messageIcon.Image = MessageBoxImageResources.GenericCritical;
+ SystemSounds.Hand.Play();
+ break;
+ case KryptonMessageBoxIcon.Warning:
+ _messageIcon.Image = MessageBoxImageResources.GenericWarning;
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.Information:
+ _messageIcon.Image = MessageBoxImageResources.GenericInformation;
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.Shield:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ _messageIcon.Image = UACShieldIconResources.UAC_Shield_Windows_11;
+ }
+ else if (OSUtilities.IsWindowsTen)
+ {
+ _messageIcon.Image = UACShieldIconResources.UAC_Shield_Windows_10;
+ }
+ else
+ {
+ _messageIcon.Image = UACShieldIconResources.UAC_Shield_Windows_7;
+ }
+
+ break;
+ case KryptonMessageBoxIcon.WindowsLogo:
+ // Because Windows 11 displays a generic application icon,
+ // we need to rely on an image instead
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ _messageIcon.Image = MessageBoxImageResources.Windows11;
+ }
+ // Windows 10
+ else if (OSUtilities.IsWindowsTen)
+ {
+ _messageIcon.Image = MessageBoxImageResources.Windows_8_and_10_Logo;
+ }
+ else
+ {
+ _messageIcon.Image = SystemIcons.WinLogo.ToBitmap();
+ }
+
+ break;
+ case KryptonMessageBoxIcon.Application:
+ if (_applicationImage != null)
+ {
+ _messageIcon.Image = _applicationImage;
+ }
+ else if (!string.IsNullOrEmpty(_applicationPath))
+ {
+ Image? sourceImage = GraphicsExtensions.ExtractIconFromFilePath(_applicationPath)
+ ?.ToBitmap();
+ Image? scaledImage = GraphicsExtensions.ScaleImage(sourceImage, new Size(32, 32));
+
+ _messageIcon.Image = scaledImage;
+ }
+ else
+ {
+ // Fall back to defaults
+ _messageIcon.Image = SystemIcons.Application.ToBitmap();
+ }
+
+ break;
+ case KryptonMessageBoxIcon.SystemApplication:
+ _messageIcon.Image = SystemIcons.Application.ToBitmap();
+ break;
+ }
+ }
+
+ _messageIcon.Visible = (_kryptonMessageBoxIcon != KryptonMessageBoxIcon.None);
+ }
+
+ private void UpdateIcon()
+ {
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ switch (_kryptonMessageBoxIcon)
+ {
+ case KryptonMessageBoxIcon.None:
+ // Windows XP and before will Beep, Vista and above do not!
+ if (GlobalStaticValues.OS_MAJOR_VERSION < 6)
+ {
+ SystemSounds.Beep.Play();
+ }
+ break;
+ case KryptonMessageBoxIcon.Hand:
+ _messageIcon.Image = MessageBoxImageResources.GenericHand;
+ SystemSounds.Hand.Play();
+ break;
+ case KryptonMessageBoxIcon.Question:
+ _messageIcon.Image = MessageBoxImageResources.Question_Windows_11;
+ SystemSounds.Question.Play();
+ break;
+ case KryptonMessageBoxIcon.Exclamation:
+ _messageIcon.Image = MessageBoxImageResources.Warning_Windows_11;
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.Asterisk:
+ _messageIcon.Image = MessageBoxImageResources.Asterisk_Windows_11;
+ SystemSounds.Asterisk.Play();
+ break;
+ case KryptonMessageBoxIcon.Stop:
+ _messageIcon.Image = MessageBoxImageResources.GenericStop;
+ SystemSounds.Hand.Play();
+ break;
+ case KryptonMessageBoxIcon.Error:
+ _messageIcon.Image = MessageBoxImageResources.Critical_Windows_11;
+ SystemSounds.Hand.Play();
+ break;
+ case KryptonMessageBoxIcon.Warning:
+ _messageIcon.Image = MessageBoxImageResources.Warning_Windows_11;
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.Information:
+ _messageIcon.Image = MessageBoxImageResources.Information_Windows_11;
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.Shield:
+ _messageIcon.Image = UACShieldIconResources.UAC_Shield_Windows_11;
+ break;
+ case KryptonMessageBoxIcon.WindowsLogo:
+ _messageIcon.Image = MessageBoxImageResources.Windows11;
+ break;
+ case KryptonMessageBoxIcon.Application:
+ if (_applicationImage != null)
+ {
+ _messageIcon.Image = _applicationImage;
+ }
+ else if (!string.IsNullOrEmpty(_applicationPath))
+ {
+ Image? sourceImage = GraphicsExtensions.ExtractIconFromFilePath(_applicationPath)?.ToBitmap();
+ Image? scaledImage = GraphicsExtensions.ScaleImage(sourceImage, new Size(32, 32));
+
+ _messageIcon.Image = scaledImage;
+ }
+ else
+ {
+ // Fall back to defaults
+ _messageIcon.Image = SystemIcons.Application.ToBitmap();
+ }
+ break;
+ case KryptonMessageBoxIcon.SystemApplication:
+ _messageIcon.Image = SystemIcons.Application.ToBitmap();
+ break;
+ }
+ }
+ else
+ {
+ switch (_kryptonMessageBoxIcon)
+ {
+ case KryptonMessageBoxIcon.None:
+ // Windows XP and before will Beep, Vista and above do not!
+ if (GlobalStaticValues.OS_MAJOR_VERSION < 6)
+ {
+ SystemSounds.Beep.Play();
+ }
+ break;
+ case KryptonMessageBoxIcon.Hand:
+ _messageIcon.Image = MessageBoxImageResources.GenericHand;
+ SystemSounds.Hand.Play();
+ break;
+ case KryptonMessageBoxIcon.SystemHand:
+ _messageIcon.Image = SystemIcons.Hand.ToBitmap();
+ SystemSounds.Hand.Play();
+ break;
+ case KryptonMessageBoxIcon.Question:
+ _messageIcon.Image = MessageBoxImageResources.GenericQuestion;
+ SystemSounds.Question.Play();
+ break;
+ case KryptonMessageBoxIcon.SystemQuestion:
+ _messageIcon.Image = SystemIcons.Question.ToBitmap();
+ SystemSounds.Question.Play();
+ break;
+ case KryptonMessageBoxIcon.Exclamation:
+ _messageIcon.Image = MessageBoxImageResources.GenericWarning;
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.SystemExclamation:
+ _messageIcon.Image = SystemIcons.Warning.ToBitmap();
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.Asterisk:
+ _messageIcon.Image = OSUtilities.IsAtLeastWindowsEleven
+ ? MessageBoxImageResources.Asterisk_Windows_11
+ : MessageBoxImageResources.GenericAsterisk;
+ SystemSounds.Asterisk.Play();
+ break;
+ case KryptonMessageBoxIcon.SystemAsterisk:
+ _messageIcon.Image = SystemIcons.Asterisk.ToBitmap();
+ SystemSounds.Asterisk.Play();
+ break;
+ case KryptonMessageBoxIcon.Stop:
+ _messageIcon.Image = MessageBoxImageResources.GenericStop;
+ SystemSounds.Hand.Play();
+ break;
+ case KryptonMessageBoxIcon.Error:
+ _messageIcon.Image = MessageBoxImageResources.GenericCritical;
+ SystemSounds.Hand.Play();
+ break;
+ case KryptonMessageBoxIcon.Warning:
+ _messageIcon.Image = MessageBoxImageResources.GenericWarning;
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.Information:
+ _messageIcon.Image = MessageBoxImageResources.GenericInformation;
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.Shield:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ _messageIcon.Image = UACShieldIconResources.UAC_Shield_Windows_11;
+ }
+ else if (OSUtilities.IsWindowsTen)
+ {
+ _messageIcon.Image = UACShieldIconResources.UAC_Shield_Windows_10;
+ }
+ else
+ {
+ _messageIcon.Image = UACShieldIconResources.UAC_Shield_Windows_7;
+ }
+ break;
+ case KryptonMessageBoxIcon.WindowsLogo:
+ // Because Windows 11 displays a generic application icon,
+ // we need to rely on an image instead
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ _messageIcon.Image = MessageBoxImageResources.Windows11;
+ }
+ // Windows 10
+ else if (OSUtilities.IsWindowsTen)
+ {
+ _messageIcon.Image = MessageBoxImageResources.Windows_8_and_10_Logo;
+ }
+ else
+ {
+ _messageIcon.Image = SystemIcons.WinLogo.ToBitmap();
+ }
+ break;
+ case KryptonMessageBoxIcon.Application:
+ if (_applicationImage != null)
+ {
+ _messageIcon.Image = _applicationImage;
+ }
+ else if (!string.IsNullOrEmpty(_applicationPath))
+ {
+ Image? sourceImage = GraphicsExtensions.ExtractIconFromFilePath(_applicationPath)?.ToBitmap();
+ Image? scaledImage = GraphicsExtensions.ScaleImage(sourceImage, new Size(32, 32));
+
+ _messageIcon.Image = scaledImage;
+ }
+ else
+ {
+ // Fall back to defaults
+ _messageIcon.Image = SystemIcons.Application.ToBitmap();
+ }
+ break;
+ case KryptonMessageBoxIcon.SystemApplication:
+ _messageIcon.Image = SystemIcons.Application.ToBitmap();
+ break;
+ }
+ }
+
+ _messageIcon.Visible = (_kryptonMessageBoxIcon != KryptonMessageBoxIcon.None);
+
+ }
+
+ private void UpdateButtons()
+ {
+ switch (_buttons)
+ {
+ case KryptonMessageBoxButtons.OK:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.OK;
+ _button1.DialogResult = DialogResult.OK;
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ break;
+ case KryptonMessageBoxButtons.OKCancel:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.OK;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.Cancel;
+ _button1.DialogResult = DialogResult.OK;
+ _button2.DialogResult = DialogResult.Cancel;
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ _button2.Visible = true;
+ _button2.Enabled = true;
+ break;
+ case KryptonMessageBoxButtons.YesNo:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.Yes;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.No;
+ _button1.DialogResult = DialogResult.Yes;
+ _button2.DialogResult = DialogResult.No;
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ _button2.Visible = true;
+ _button2.Enabled = true;
+ ControlBox = false;
+ break;
+ case KryptonMessageBoxButtons.YesNoCancel:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.Yes;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.No;
+ _button3.Text = KryptonManager.Strings.GeneralStrings.Cancel;
+ _button1.DialogResult = DialogResult.Yes;
+ _button2.DialogResult = DialogResult.No;
+ _button3.DialogResult = DialogResult.Cancel;
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ _button2.Visible = true;
+ _button2.Enabled = true;
+ _button3.Visible = true;
+ _button3.Enabled = true;
+ break;
+ case KryptonMessageBoxButtons.RetryCancel:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.Retry;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.Cancel;
+ _button1.DialogResult = DialogResult.Retry;
+ _button2.DialogResult = DialogResult.Cancel;
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ _button2.Visible = true;
+ _button2.Enabled = true;
+ break;
+ case KryptonMessageBoxButtons.AbortRetryIgnore:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.Abort;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.Retry;
+ _button3.Text = KryptonManager.Strings.GeneralStrings.Ignore;
+ _button1.DialogResult = DialogResult.Abort;
+ _button2.DialogResult = DialogResult.Retry;
+ _button3.DialogResult = DialogResult.Ignore;
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ _button2.Visible = true;
+ _button2.Enabled = true;
+ _button3.Visible = true;
+ _button3.Enabled = true;
+ ControlBox = false;
+ break;
+ case KryptonMessageBoxButtons.CancelTryContinue:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.Cancel;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.TryAgain;
+ _button3.Text = KryptonManager.Strings.GeneralStrings.Continue;
+ _button1.DialogResult = DialogResult.Cancel;
+#if NET6_0_OR_GREATER
+ _button2.DialogResult = DialogResult.TryAgain;
+ _button3.DialogResult = DialogResult.Continue;
+#else
+ _button2.DialogResult = (DialogResult)10;
+ _button3.DialogResult = (DialogResult)11;
+#endif
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ _button2.Visible = true;
+ _button2.Enabled = true;
+ _button3.Visible = true;
+ _button3.Enabled = true;
+ break;
+ }
+
+ // Do we ignore the Alt+F4 on the buttons?
+ if (!ControlBox)
+ {
+ _button1.IgnoreAltF4 = true;
+ _button2.IgnoreAltF4 = true;
+ _button3.IgnoreAltF4 = true;
+ _button4.IgnoreAltF4 = true;
+ }
+ }
+
+ private void UpdateButtons(KryptonMessageBoxButtons buttons)
+ {
+ switch (buttons)
+ {
+ case KryptonMessageBoxButtons.OK:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.OK;
+ _button1.DialogResult = DialogResult.OK;
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ break;
+ case KryptonMessageBoxButtons.OKCancel:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.OK;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.Cancel;
+ _button1.DialogResult = DialogResult.OK;
+ _button2.DialogResult = DialogResult.Cancel;
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ _button2.Visible = true;
+ _button2.Enabled = true;
+ break;
+ case KryptonMessageBoxButtons.YesNo:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.Yes;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.No;
+ _button1.DialogResult = DialogResult.Yes;
+ _button2.DialogResult = DialogResult.No;
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ _button2.Visible = true;
+ _button2.Enabled = true;
+ ControlBox = false;
+ break;
+ case KryptonMessageBoxButtons.YesNoCancel:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.Yes;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.No;
+ _button3.Text = KryptonManager.Strings.GeneralStrings.Cancel;
+ _button1.DialogResult = DialogResult.Yes;
+ _button2.DialogResult = DialogResult.No;
+ _button3.DialogResult = DialogResult.Cancel;
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ _button2.Visible = true;
+ _button2.Enabled = true;
+ _button3.Visible = true;
+ _button3.Enabled = true;
+ break;
+ case KryptonMessageBoxButtons.RetryCancel:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.Retry;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.Cancel;
+ _button1.DialogResult = DialogResult.Retry;
+ _button2.DialogResult = DialogResult.Cancel;
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ _button2.Visible = true;
+ _button2.Enabled = true;
+ break;
+ case KryptonMessageBoxButtons.AbortRetryIgnore:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.Abort;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.Retry;
+ _button3.Text = KryptonManager.Strings.GeneralStrings.Ignore;
+ _button1.DialogResult = DialogResult.Abort;
+ _button2.DialogResult = DialogResult.Retry;
+ _button3.DialogResult = DialogResult.Ignore;
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ _button2.Visible = true;
+ _button2.Enabled = true;
+ _button3.Visible = true;
+ _button3.Enabled = true;
+ ControlBox = false;
+ break;
+ case KryptonMessageBoxButtons.CancelTryContinue:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.Cancel;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.TryAgain;
+ _button3.Text = KryptonManager.Strings.GeneralStrings.Continue;
+ _button1.DialogResult = DialogResult.Cancel;
+#if NET6_0_OR_GREATER
+ _button2.DialogResult = DialogResult.TryAgain;
+ _button3.DialogResult = DialogResult.Continue;
+#else
+ _button2.DialogResult = (DialogResult)10;
+ _button3.DialogResult = (DialogResult)11;
+#endif
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ _button2.Visible = true;
+ _button2.Enabled = true;
+ _button3.Visible = true;
+ _button3.Enabled = true;
+ break;
+ }
+
+ // Do we ignore the Alt+F4 on the buttons?
+ if (!ControlBox)
+ {
+ _button1.IgnoreAltF4 = true;
+ _button2.IgnoreAltF4 = true;
+ _button3.IgnoreAltF4 = true;
+ _button4.IgnoreAltF4 = true;
+ }
+ }
+
+ private void UpdateDefault(KryptonMessageBoxDefaultButton? defaultButton)
+ {
+ AcceptButton = defaultButton switch
+ {
+ KryptonMessageBoxDefaultButton.Button1 =>
+ //_button1.Select();
+ _button1,
+ KryptonMessageBoxDefaultButton.Button2 =>
+ //_button2.Select();
+ _button2,
+ KryptonMessageBoxDefaultButton.Button3 =>
+ //_button3.Select();
+ _button3,
+ KryptonMessageBoxDefaultButton.Button4 => _showHelpButton ? _button4 : _button1,
+ null => _button1,
+ _ => _showHelpButton ? _button4 : _button1
+ };
+ }
+
+ private void UpdateDefault()
+ {
+ AcceptButton = _defaultButton switch
+ {
+ KryptonMessageBoxDefaultButton.Button1 =>
+ //_button1.Select();
+ _button1,
+ KryptonMessageBoxDefaultButton.Button2 =>
+ //_button2.Select();
+ _button2,
+ KryptonMessageBoxDefaultButton.Button3 =>
+ //_button3.Select();
+ _button3,
+ KryptonMessageBoxDefaultButton.Button4 => _showHelpButton ? _button4 : _button1,
+ _ => _showHelpButton ? _button4 : _button1
+ };
+ }
+
+ private void UpdateHelp(bool? showHelpButton)
+ {
+ if (showHelpButton != null)
+ {
+ return;
+ }
+
+ MessageButton helpButton = _buttons switch
+ {
+ KryptonMessageBoxButtons.OK => _button2,
+ KryptonMessageBoxButtons.OKCancel
+ or KryptonMessageBoxButtons.YesNo
+ or KryptonMessageBoxButtons.RetryCancel => _button3,
+ KryptonMessageBoxButtons.AbortRetryIgnore
+ or KryptonMessageBoxButtons.YesNoCancel
+ or KryptonMessageBoxButtons.CancelTryContinue => _button4,
+ _ => throw new EvaluateException("_buttons out of range")
+ };
+ if (helpButton != null)
+ {
+ helpButton.Visible = true;
+ helpButton.Enabled = true;
+ helpButton.Text = KryptonManager.Strings.GeneralStrings.Help;
+
+ helpButton.KeyPress += (_, _) => LaunchHelp(_messageBoxData.Owner);
+
+ helpButton.Click += (_, _) => LaunchHelp(_messageBoxData.Owner);
+ }
+ }
+
+ private void UpdateHelp()
+ {
+ if (!_showHelpButton)
+ {
+ return;
+ }
+
+ MessageButton helpButton = _buttons switch
+ {
+ KryptonMessageBoxButtons.OK => _button2,
+ KryptonMessageBoxButtons.OKCancel or KryptonMessageBoxButtons.YesNo or KryptonMessageBoxButtons.RetryCancel => _button3,
+ KryptonMessageBoxButtons.AbortRetryIgnore or KryptonMessageBoxButtons.YesNoCancel => _button4,
+ _ => throw new ArgumentOutOfRangeException()
+ };
+ if (helpButton != null)
+ {
+ helpButton.Visible = true;
+ helpButton.Enabled = true;
+ helpButton.Text = KryptonManager.Strings.GeneralStrings.Help;
+ helpButton.KeyPress += (_, _) => LaunchHelp();
+ helpButton.Click += (_, _) => LaunchHelp();
+ }
+ }
+
+ ///
+ /// When the user clicks the Help button, the Help file specified in the helpFilePath parameter
+ /// is opened and the Help keyword topic identified by the keyword parameter is Displayed.
+ /// The form that owns the message box (or the active form) also receives the HelpRequested event.
+ ///
+ private void LaunchHelp(IWin32Window? owner)
+ {
+ try
+ {
+ if (owner != null)
+ {
+ Control? control = FromHandle(owner.Handle);
+
+ var mInfoMethod = control!.GetType().GetMethod(nameof(OnHelpRequested), BindingFlags.Instance | BindingFlags.NonPublic,
+ Type.DefaultBinder, [typeof(HelpEventArgs)], null);
+ mInfoMethod?.Invoke(control, [new HelpEventArgs(MousePosition)]);
+ if (_helpInfo != null)
+ {
+ if (string.IsNullOrWhiteSpace(_helpInfo.HelpFilePath))
+ {
+ return;
+ }
+
+ if (!string.IsNullOrWhiteSpace(_helpInfo.Keyword))
+ {
+ Help.ShowHelp(control, _helpInfo.HelpFilePath, _helpInfo.Keyword);
+ }
+ else
+ {
+ Help.ShowHelp(control, _helpInfo.HelpFilePath, _helpInfo.Navigator, _helpInfo.Param);
+ }
+ }
+ }
+ }
+ catch
+ {
+ // Do nothing
+ }
+ }
+
+ ///
+ /// When the user clicks the Help button, the Help file specified in the helpFilePath parameter
+ /// is opened and the Help keyword topic identified by the keyword parameter is Displayed.
+ /// The form that owns the message box (or the active form) also receives the HelpRequested event.
+ ///
+ private void LaunchHelp()
+ {
+ try
+ {
+ if (_showOwner != null)
+ {
+ Control? control = FromHandle(_showOwner.Handle);
+
+ var mInfoMethod = control!.GetType().GetMethod(nameof(OnHelpRequested), BindingFlags.Instance | BindingFlags.NonPublic,
+ Type.DefaultBinder, [typeof(HelpEventArgs)], null);
+ mInfoMethod?.Invoke(control, [new HelpEventArgs(MousePosition)]);
+ if (_helpInfo != null)
+ {
+ if (string.IsNullOrWhiteSpace(_helpInfo.HelpFilePath))
+ {
+ return;
+ }
+
+ if (!string.IsNullOrWhiteSpace(_helpInfo.Keyword))
+ {
+ Help.ShowHelp(control, _helpInfo.HelpFilePath, _helpInfo.Keyword);
+ }
+ else
+ {
+ Help.ShowHelp(control, _helpInfo.HelpFilePath, _helpInfo.Navigator, _helpInfo.Param);
+ }
+ }
+ }
+ }
+ catch
+ {
+ // Do nothing
+ }
+ }
+
+ private void UpdateSizing(IWin32Window? showOwner)
+ {
+ Size messageSizing = UpdateMessageSizing(showOwner);
+ Size buttonsSizing = UpdateButtonsSizing();
+
+ // Size of window is calculated from the client area
+ ClientSize = new Size(Math.Max(messageSizing.Width, buttonsSizing.Width),
+ messageSizing.Height + buttonsSizing.Height);
+ }
+
+ private Size UpdateMessageSizing(IWin32Window? showOwner)
+ {
+ // Update size of the message label but with a maximum width
+ Size textSize;
+ using (Graphics g = CreateGraphics())
+ {
+ // Find size of the label, with a max of 2/3 screen width
+ Screen screen = showOwner is IWin32Window window
+ ? Screen.FromHandle(window.Handle)
+ : Screen.PrimaryScreen ?? throw new NullReferenceException("Screen.PrimaryScreen returned null");
+
+ Size scaledMonitorSize = screen.WorkingArea.Size;
+ scaledMonitorSize.Width = (int)(scaledMonitorSize.Width * 2 / 3.0f);
+ scaledMonitorSize.Height = (int)(scaledMonitorSize.Height * 0.95f);
+
+ Font textFont = GetMessageTextFont(_contentAreaType);
+ Font captionFont = KryptonManager.CurrentGlobalPalette.BaseFont;
+
+ // Measure the string
+ SizeF messageSize = g.MeasureString(_text, textFont, new SizeF(scaledMonitorSize.Width, scaledMonitorSize.Height));
+
+ // SKC: Don't forget to add the TextExtra into the calculation
+ SizeF captionSize = TextRenderer.MeasureText($"{_caption} {TextExtra}", captionFont, scaledMonitorSize);
+
+ var messageXSize = Math.Max(messageSize.Width, captionSize.Width);
+ // Work out DPI adjustment factor
+ var factorX = g.DpiX > 96 ? (1.0f * g.DpiX / 96) : 1.0f;
+ var factorY = g.DpiY > 96 ? (1.0f * g.DpiY / 96) : 1.0f;
+
+ messageSize.Width = messageXSize * factorX;
+ messageSize.Height *= factorY;
+
+ textSize = Size.Ceiling(messageSize);
+ }
+
+ // Calculate the size of the icon area and text area including margins
+ Padding textPadding = GetMessageTextPadding(_contentAreaType);
+ Padding textAreaAllMargin = Padding.Add(textPadding, kpnlContentArea.Margin);
+
+ Size iconArea = new Size(_messageIcon.Width + _messageIcon.Margin.Left + _messageIcon.Margin.Right,
+ _messageIcon.Height + _messageIcon.Margin.Top + _messageIcon.Margin.Bottom);
+
+ Size textArea = new Size(textSize.Width + textAreaAllMargin.Left + textAreaAllMargin.Right,
+ textSize.Height + textAreaAllMargin.Top + textAreaAllMargin.Bottom);
+
+ return new Size(textArea.Width + iconArea.Width,
+ Math.Max(iconArea.Height, textArea.Height));
+ }
+
+ private Font GetMessageTextFont(MessageBoxContentAreaType? contentAreaType)
+ {
+ switch (contentAreaType)
+ {
+ case MessageBoxContentAreaType.Normal:
+ return krtbMessageText.StateCommon.Content.GetContentShortTextFont(PaletteState.Normal)
+ ?? KryptonManager.CurrentGlobalPalette.BaseFont;
+ case MessageBoxContentAreaType.LinkLabel:
+ klwlblMessageText.UpdateFont();
+ return klwlblMessageText.Font
+ ?? KryptonManager.CurrentGlobalPalette.BaseFont;
+ case null:
+ return KryptonManager.CurrentGlobalPalette.BaseFont;
+ default:
+ throw new ArgumentOutOfRangeException(nameof(contentAreaType), contentAreaType, null);
+ }
+ }
+
+ private Padding GetMessageTextPadding(MessageBoxContentAreaType? contentAreaType)
+ {
+ switch (contentAreaType)
+ {
+ case MessageBoxContentAreaType.Normal:
+ return krtbMessageText.StateCommon.Content.GetContentPadding(PaletteState.Normal);
+ case MessageBoxContentAreaType.LinkLabel:
+ return klwlblMessageText.Padding;
+ case null:
+ return new Padding(0);
+ default:
+ throw new ArgumentOutOfRangeException(nameof(contentAreaType), contentAreaType, null);
+ }
+ }
+
+ private Size UpdateButtonsSizing()
+ {
+ var numButtons = 1;
+
+ // Button1 is always visible
+ Size button1Size = _button1.GetPreferredSize(Size.Empty);
+ var maxButtonSize = button1Size with { Width = button1Size.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING };
+
+ // If Button2 is visible
+ if (_button2.Enabled)
+ {
+ numButtons++;
+ Size button2Size = _button2.GetPreferredSize(Size.Empty);
+ maxButtonSize.Width = Math.Max(maxButtonSize.Width, button2Size.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING);
+ maxButtonSize.Height = Math.Max(maxButtonSize.Height, button2Size.Height);
+ }
+
+ // If Button3 is visible
+ if (_button3.Enabled)
+ {
+ numButtons++;
+ Size button3Size = _button3.GetPreferredSize(Size.Empty);
+ maxButtonSize.Width = Math.Max(maxButtonSize.Width, button3Size.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING);
+ maxButtonSize.Height = Math.Max(maxButtonSize.Height, button3Size.Height);
+ }
+ // If Button4 is visible
+ if (_button4.Enabled)
+ {
+ numButtons++;
+ Size button4Size = _button4.GetPreferredSize(Size.Empty);
+ maxButtonSize.Width = Math.Max(maxButtonSize.Width, button4Size.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING);
+ maxButtonSize.Height = Math.Max(maxButtonSize.Height, button4Size.Height);
+ }
+
+ // Start positioning buttons 10 pixels from right edge
+ var right = _panelButtons.Right - GlobalStaticValues.GLOBAL_BUTTON_PADDING;
+
+ //var left = _panelButtons.Left - GlobalStaticValues.GLOBAL_BUTTON_PADDING;
+
+ // If Button4 is visible
+ if (_button4.Enabled)
+ {
+ _button4.Location = new Point(right - maxButtonSize.Width, GlobalStaticValues.GLOBAL_BUTTON_PADDING);
+ _button4.Size = maxButtonSize;
+ right -= maxButtonSize.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING;
+ }
+
+ // If Button3 is visible
+ if (_button3.Enabled)
+ {
+ _button3.Location = new Point(right - maxButtonSize.Width, GlobalStaticValues.GLOBAL_BUTTON_PADDING);
+ _button3.Size = maxButtonSize;
+ right -= maxButtonSize.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING;
+ }
+
+ // If Button2 is visible
+ if (_button2.Enabled)
+ {
+ _button2.Location = new Point(right - maxButtonSize.Width, GlobalStaticValues.GLOBAL_BUTTON_PADDING);
+ _button2.Size = maxButtonSize;
+ right -= maxButtonSize.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING;
+ }
+
+ // Button1 is always visible
+ _button1.Location = new Point(right - maxButtonSize.Width, GlobalStaticValues.GLOBAL_BUTTON_PADDING);
+ _button1.Size = maxButtonSize;
+
+ // Size the panel for the buttons
+ _panelButtons.Size = new Size((maxButtonSize.Width * numButtons) + (GlobalStaticValues.GLOBAL_BUTTON_PADDING * (numButtons + 1)), maxButtonSize.Height + (GlobalStaticValues.GLOBAL_BUTTON_PADDING * 2));
+
+ // Button area is the number of buttons with gaps between them and 10 pixels around all edges
+ return new Size((maxButtonSize.Width * numButtons) + (GlobalStaticValues.GLOBAL_BUTTON_PADDING * (numButtons + 1)), maxButtonSize.Height + (GlobalStaticValues.GLOBAL_BUTTON_PADDING * 2));
+ }
+
+ private void AnyKeyDown(object sender, KeyEventArgs e)
+ {
+ // Escape key kills the dialog if we allow it to be closed
+ if (ControlBox
+ && (e.KeyCode == Keys.Escape)
+ )
+ {
+ Close();
+ }
+ else if (e.KeyData == (Keys.Control | Keys.C))
+ {
+ const string DIVIDER = @"---------------------------";
+ const string BUTTON_TEXT_SPACER = @" ";
+ // Pressing Ctrl+C should copy message text into the clipboard
+ var sb = new StringBuilder();
+
+ sb.AppendLine(DIVIDER);
+ sb.AppendLine(Text);
+ sb.AppendLine(DIVIDER);
+ sb.AppendLine(klwlblMessageText.Text);
+ sb.AppendLine(DIVIDER);
+ sb.Append(_button1.Text).Append(BUTTON_TEXT_SPACER);
+ if (_button2.Enabled)
+ {
+ sb.Append(_button2.Text).Append(BUTTON_TEXT_SPACER);
+ if (_button3.Enabled)
+ {
+ sb.Append(_button3.Text).Append(BUTTON_TEXT_SPACER);
+ }
+
+ if (_button4.Enabled)
+ {
+ sb.Append(_button4.Text).Append(BUTTON_TEXT_SPACER);
+ }
+ }
+
+ sb.AppendLine(string.Empty);
+ sb.AppendLine(DIVIDER);
+
+ Clipboard.SetText(sb.ToString(), TextDataFormat.Text);
+ Clipboard.SetText(sb.ToString(), TextDataFormat.UnicodeText);
+ }
+ }
+
+ private void LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
+ {
+ try
+ {
+ if (_linkLabelCommand != null)
+ {
+ _linkLabelCommand.PerformExecute();
+ }
+ else if (_linkLaunchArgument != null)
+ {
+ Process.Start(_linkLaunchArgument);
+ }
+ }
+ catch (Exception exception)
+ {
+ ExceptionHandler.CaptureException(exception, showStackTrace: GlobalStaticValues.DEFAULT_USE_STACK_TRACE);
+ }
+ }
+
+ /// Updates the type of the content area.
+ /// Type of the content area.
+ private void UpdateContentAreaType(MessageBoxContentAreaType? contentAreaType)
+ {
+ switch (contentAreaType)
+ {
+ case MessageBoxContentAreaType.Normal:
+ klwlblMessageText.Visible = false;
+
+ krtbMessageText.Visible = true;
+ break;
+ case MessageBoxContentAreaType.LinkLabel:
+ klwlblMessageText.Visible = true;
+
+ krtbMessageText.Visible = false;
+ break;
+ case null:
+ klwlblMessageText.Visible = false;
+
+ krtbMessageText.Visible = true;
+ break;
+ default:
+ throw new ArgumentOutOfRangeException(nameof(contentAreaType), contentAreaType, null);
+ }
+ }
+
+ private void UpdateContentLinkArea(LinkArea? contentLinkArea)
+ {
+ if (contentLinkArea != null)
+ {
+ klwlblMessageText.LinkArea = (LinkArea)contentLinkArea;
+ }
+ }
+
+ private void ShowCloseButton(bool? showCloseButton) => CloseBox = showCloseButton ?? true;
+
+ private void OnFormClosed(object sender, FormClosedEventArgs e)
+ {
+ _krtbNativeWindow.ReleaseHandle();
+ }
+
+ #region KryptonMessageBoxResult Methods
+
+ public KryptonMessageBoxResult ShowMessageBox() => ShowMessageBox(null);
+
+ // ToDo: Expand this method
+ public KryptonMessageBoxResult ShowMessageBox(IWin32Window? owner)
+ {
+ return KryptonMessageBoxResult.Ignore;
+ }
+
+ #endregion
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualMessageBoxRtlAwareFormDep.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualMessageBoxRtlAwareFormDep.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualMessageBoxRtlAwareFormDep.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualThemeBrowserFormRtlAware.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualThemeBrowserFormRtlAware.Designer.cs
new file mode 100644
index 000000000..4755179e4
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualThemeBrowserFormRtlAware.Designer.cs
@@ -0,0 +1,393 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualThemeBrowserFormRtlAware
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnImport = new Krypton.Toolkit.KryptonButton();
+ this.kchkSilent = new Krypton.Toolkit.KryptonCheckBox();
+ this.kbtnCancel = new Krypton.Toolkit.KryptonButton();
+ this.kbtnOk = new Krypton.Toolkit.KryptonButton();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kryptonPanel2 = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.klblHeader = new Krypton.Toolkit.KryptonLabel();
+ this.klbThemeList = new Krypton.Toolkit.KryptonListBox();
+ this.kcpbCustom = new Krypton.Toolkit.KryptonCustomPaletteBase(this.components);
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
+ this.kryptonPanel1.SuspendLayout();
+ this.tableLayoutPanel1.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit();
+ this.kryptonPanel2.SuspendLayout();
+ this.tableLayoutPanel2.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // kryptonPanel1
+ //
+ this.kryptonPanel1.Controls.Add(this.tableLayoutPanel1);
+ this.kryptonPanel1.Controls.Add(this.kryptonBorderEdge1);
+ this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kryptonPanel1.Location = new System.Drawing.Point(0, 481);
+ this.kryptonPanel1.Name = "kryptonPanel1";
+ this.kryptonPanel1.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kryptonPanel1.Size = new System.Drawing.Size(836, 50);
+ this.kryptonPanel1.TabIndex = 0;
+ //
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel1.ColumnCount = 4;
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel1.Controls.Add(this.kbtnImport, 0, 0);
+ this.tableLayoutPanel1.Controls.Add(this.kchkSilent, 1, 0);
+ this.tableLayoutPanel1.Controls.Add(this.kbtnCancel, 3, 0);
+ this.tableLayoutPanel1.Controls.Add(this.kbtnOk, 2, 0);
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 1;
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(836, 49);
+ this.tableLayoutPanel1.TabIndex = 1;
+ //
+ // kbtnImport
+ //
+ this.kbtnImport.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.kbtnImport.Location = new System.Drawing.Point(736, 12);
+ this.kbtnImport.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnImport.Name = "kbtnImport";
+ this.kbtnImport.Size = new System.Drawing.Size(90, 25);
+ this.kbtnImport.TabIndex = 0;
+ this.kbtnImport.Values.Text = "kryptonButton1";
+ this.kbtnImport.Click += new System.EventHandler(this.kbtnImport_Click);
+ //
+ // kchkSilent
+ //
+ this.kchkSilent.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.kchkSilent.Location = new System.Drawing.Point(591, 14);
+ this.kchkSilent.Margin = new System.Windows.Forms.Padding(10);
+ this.kchkSilent.Name = "kchkSilent";
+ this.kchkSilent.Size = new System.Drawing.Size(125, 20);
+ this.kchkSilent.TabIndex = 1;
+ this.kchkSilent.Values.Text = "kryptonCheckBox1";
+ //
+ // kbtnCancel
+ //
+ this.kbtnCancel.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this.kbtnCancel.Location = new System.Drawing.Point(10, 12);
+ this.kbtnCancel.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnCancel.Name = "kbtnCancel";
+ this.kbtnCancel.Size = new System.Drawing.Size(90, 25);
+ this.kbtnCancel.TabIndex = 2;
+ this.kbtnCancel.Values.Text = "kryptonButton1";
+ this.kbtnCancel.Click += new System.EventHandler(this.kbtnCancel_Click);
+ //
+ // kbtnOk
+ //
+ this.kbtnOk.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnOk.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.kbtnOk.Location = new System.Drawing.Point(120, 12);
+ this.kbtnOk.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnOk.Name = "kbtnOk";
+ this.kbtnOk.Size = new System.Drawing.Size(90, 25);
+ this.kbtnOk.TabIndex = 3;
+ this.kbtnOk.Values.Text = "kryptonButton2";
+ this.kbtnOk.Click += new System.EventHandler(this.kbtnOk_Click);
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderSecondary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(836, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kryptonPanel2
+ //
+ this.kryptonPanel2.Controls.Add(this.tableLayoutPanel2);
+ this.kryptonPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kryptonPanel2.Location = new System.Drawing.Point(0, 0);
+ this.kryptonPanel2.Name = "kryptonPanel2";
+ this.kryptonPanel2.Size = new System.Drawing.Size(836, 481);
+ this.kryptonPanel2.TabIndex = 1;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel2.ColumnCount = 1;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Controls.Add(this.klblHeader, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.klbThemeList, 0, 1);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 0);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 2;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(836, 481);
+ this.tableLayoutPanel2.TabIndex = 0;
+ //
+ // klblHeader
+ //
+ this.klblHeader.LabelStyle = Krypton.Toolkit.LabelStyle.BoldPanel;
+ this.klblHeader.Location = new System.Drawing.Point(731, 10);
+ this.klblHeader.Margin = new System.Windows.Forms.Padding(10);
+ this.klblHeader.Name = "klblHeader";
+ this.klblHeader.Size = new System.Drawing.Size(95, 20);
+ this.klblHeader.TabIndex = 0;
+ this.klblHeader.Values.Text = "kryptonLabel1";
+ //
+ // klbThemeList
+ //
+ this.klbThemeList.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.klbThemeList.Location = new System.Drawing.Point(10, 50);
+ this.klbThemeList.Margin = new System.Windows.Forms.Padding(10);
+ this.klbThemeList.Name = "klbThemeList";
+ this.klbThemeList.Size = new System.Drawing.Size(816, 421);
+ this.klbThemeList.TabIndex = 1;
+ this.klbThemeList.SelectedIndexChanged += new System.EventHandler(this.klbThemeList_SelectedIndexChanged);
+ //
+ // kcpbCustom
+ //
+ this.kcpbCustom.BasePaletteType = Krypton.Toolkit.BasePaletteType.Custom;
+ this.kcpbCustom.Ribbon.RibbonAppButton.StateNormal.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(245)))), ((int)(((byte)(248)))));
+ this.kcpbCustom.Ribbon.RibbonAppButton.StateNormal.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonAppButton.StateNormal.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonAppButton.StateNormal.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonAppButton.StateNormal.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(206)))), ((int)(((byte)(213)))), ((int)(((byte)(225)))));
+ this.kcpbCustom.Ribbon.RibbonAppButton.StatePressed.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(227)))), ((int)(((byte)(196)))));
+ this.kcpbCustom.Ribbon.RibbonAppButton.StatePressed.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonAppButton.StatePressed.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonAppButton.StatePressed.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonAppButton.StatePressed.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(136)))), ((int)(((byte)(9)))));
+ this.kcpbCustom.Ribbon.RibbonAppButton.StateTracking.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(251)))), ((int)(((byte)(230)))));
+ this.kcpbCustom.Ribbon.RibbonAppButton.StateTracking.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonAppButton.StateTracking.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonAppButton.StateTracking.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonAppButton.StateTracking.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(201)))), ((int)(((byte)(41)))));
+ this.kcpbCustom.Ribbon.RibbonAppMenuDocs.BackColor1 = System.Drawing.Color.White;
+ this.kcpbCustom.Ribbon.RibbonAppMenuDocs.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonAppMenuDocs.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonAppMenuDocs.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonAppMenuDocs.BackColor5 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonAppMenuOuter.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(195)))), ((int)(((byte)(212)))), ((int)(((byte)(235)))));
+ this.kcpbCustom.Ribbon.RibbonAppMenuOuter.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonAppMenuOuter.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonAppMenuOuter.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonAppMenuOuter.BackColor5 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGalleryBack.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(237)))), ((int)(((byte)(245)))), ((int)(((byte)(253)))));
+ this.kcpbCustom.Ribbon.RibbonGalleryBack.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGalleryBack.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGalleryBack.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGalleryBack.BackColor5 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGalleryBorder.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(177)))), ((int)(((byte)(192)))), ((int)(((byte)(214)))));
+ this.kcpbCustom.Ribbon.RibbonGalleryBorder.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGalleryBorder.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGalleryBorder.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGalleryBorder.BackColor5 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateCheckedNormal.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(159)))), ((int)(((byte)(178)))), ((int)(((byte)(199)))));
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateCheckedNormal.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateCheckedNormal.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateCheckedNormal.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateCheckedNormal.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(228)))), ((int)(((byte)(242)))));
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateContextCheckedNormal.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateContextCheckedNormal.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateContextCheckedNormal.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateContextCheckedNormal.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(228)))), ((int)(((byte)(242)))));
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateContextPressed.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(159)))), ((int)(((byte)(178)))), ((int)(((byte)(199)))));
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateContextPressed.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateContextPressed.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateContextPressed.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateContextPressed.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(228)))), ((int)(((byte)(242)))));
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateContextTracking.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(159)))), ((int)(((byte)(178)))), ((int)(((byte)(199)))));
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateContextTracking.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateContextTracking.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateContextTracking.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateContextTracking.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(228)))), ((int)(((byte)(242)))));
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateTracking.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(159)))), ((int)(((byte)(178)))), ((int)(((byte)(199)))));
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateTracking.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateTracking.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateTracking.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateTracking.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(228)))), ((int)(((byte)(242)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateContextNormal.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(240)))), ((int)(((byte)(246)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateContextNormal.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateContextNormal.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateContextNormal.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateContextNormal.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(251)))), ((int)(((byte)(251)))), ((int)(((byte)(252)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateContextTracking.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(240)))), ((int)(((byte)(246)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateContextTracking.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateContextTracking.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateContextTracking.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateContextTracking.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(251)))), ((int)(((byte)(251)))), ((int)(((byte)(252)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateNormal.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(240)))), ((int)(((byte)(246)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateNormal.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateNormal.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateNormal.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateNormal.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(251)))), ((int)(((byte)(251)))), ((int)(((byte)(252)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateTracking.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(240)))), ((int)(((byte)(246)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateTracking.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateTracking.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateTracking.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateTracking.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(251)))), ((int)(((byte)(251)))), ((int)(((byte)(252)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateContextNormal.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(233)))), ((int)(((byte)(241)))), ((int)(((byte)(250)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateContextNormal.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateContextNormal.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateContextNormal.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateContextNormal.BackColor5 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateContextTracking.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(233)))), ((int)(((byte)(241)))), ((int)(((byte)(250)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateContextTracking.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateContextTracking.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateContextTracking.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateContextTracking.BackColor5 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateNormal.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(233)))), ((int)(((byte)(241)))), ((int)(((byte)(250)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateNormal.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateNormal.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateNormal.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateNormal.BackColor5 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateTracking.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(233)))), ((int)(((byte)(241)))), ((int)(((byte)(250)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateTracking.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateTracking.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateTracking.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateTracking.BackColor5 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateContextNormal.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(189)))), ((int)(((byte)(203)))), ((int)(((byte)(218)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateContextNormal.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateContextNormal.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateContextNormal.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateContextNormal.BackColor5 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateContextTracking.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(189)))), ((int)(((byte)(203)))), ((int)(((byte)(218)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateContextTracking.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateContextTracking.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateContextTracking.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateContextTracking.BackColor5 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateNormal.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(189)))), ((int)(((byte)(203)))), ((int)(((byte)(218)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateNormal.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateNormal.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateNormal.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateNormal.BackColor5 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateTracking.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(189)))), ((int)(((byte)(203)))), ((int)(((byte)(218)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateTracking.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateTracking.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateTracking.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateTracking.BackColor5 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateContextNormal.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(240)))), ((int)(((byte)(246)))));
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateContextNormal.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateContextNormal.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateContextNormal.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateContextNormal.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(251)))), ((int)(((byte)(251)))), ((int)(((byte)(252)))));
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateContextTracking.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(240)))), ((int)(((byte)(246)))));
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateContextTracking.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateContextTracking.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateContextTracking.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateContextTracking.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(251)))), ((int)(((byte)(251)))), ((int)(((byte)(252)))));
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateNormal.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(240)))), ((int)(((byte)(246)))));
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateNormal.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateNormal.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateNormal.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateNormal.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(251)))), ((int)(((byte)(251)))), ((int)(((byte)(252)))));
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateTracking.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(240)))), ((int)(((byte)(246)))));
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateTracking.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateTracking.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateTracking.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateTracking.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(251)))), ((int)(((byte)(251)))), ((int)(((byte)(252)))));
+ this.kcpbCustom.Ribbon.RibbonQATFullbar.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(213)))), ((int)(((byte)(232)))), ((int)(((byte)(254)))));
+ this.kcpbCustom.Ribbon.RibbonQATFullbar.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonQATFullbar.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonQATFullbar.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonQATFullbar.BackColor5 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonQATMinibar.StateActive.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(154)))), ((int)(((byte)(179)))), ((int)(((byte)(213)))));
+ this.kcpbCustom.Ribbon.RibbonQATMinibar.StateActive.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonQATMinibar.StateActive.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonQATMinibar.StateActive.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonQATMinibar.StateActive.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(72)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
+ this.kcpbCustom.Ribbon.RibbonQATMinibar.StateInactive.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(153)))), ((int)(((byte)(176)))), ((int)(((byte)(206)))));
+ this.kcpbCustom.Ribbon.RibbonQATMinibar.StateInactive.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonQATMinibar.StateInactive.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonQATMinibar.StateInactive.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonQATMinibar.StateInactive.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(72)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
+ this.kcpbCustom.Ribbon.RibbonQATOverflow.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(236)))), ((int)(((byte)(252)))));
+ this.kcpbCustom.Ribbon.RibbonQATOverflow.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonQATOverflow.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonQATOverflow.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonQATOverflow.BackColor5 = System.Drawing.Color.Empty;
+ this.kcpbCustom.ThemeName = null;
+ //
+ // VisualThemeBrowserFormRtlAware
+ //
+ this.AcceptButton = this.kbtnOk;
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.CancelButton = this.kbtnCancel;
+ this.ClientSize = new System.Drawing.Size(836, 531);
+ this.Controls.Add(this.kryptonPanel2);
+ this.Controls.Add(this.kryptonPanel1);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualThemeBrowserFormRtlAware";
+ this.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.Text = "Select a Theme";
+ this.Load += new System.EventHandler(this.VisualThemeBrowserFormRtlAware_Load);
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
+ this.kryptonPanel1.ResumeLayout(false);
+ this.kryptonPanel1.PerformLayout();
+ this.tableLayoutPanel1.ResumeLayout(false);
+ this.tableLayoutPanel1.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit();
+ this.kryptonPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kryptonPanel1;
+ private TableLayoutPanel tableLayoutPanel1;
+ private KryptonButton kbtnImport;
+ private KryptonCheckBox kchkSilent;
+ private KryptonButton kbtnCancel;
+ private KryptonButton kbtnOk;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private KryptonPanel kryptonPanel2;
+ private TableLayoutPanel tableLayoutPanel2;
+ private KryptonLabel klblHeader;
+ private KryptonListBox klbThemeList;
+ private KryptonCustomPaletteBase kcpbCustom;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualThemeBrowserFormRtlAware.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualThemeBrowserFormRtlAware.cs
new file mode 100644
index 000000000..5e1a8efb7
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualThemeBrowserFormRtlAware.cs
@@ -0,0 +1,89 @@
+#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. 2023 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualThemeBrowserFormRtlAware : KryptonForm
+ {
+ #region Instance Fields
+
+ private readonly KryptonThemeBrowserData _themeBrowserData;
+
+ #endregion
+
+ #region Identity
+
+ /// Initializes a new instance of the class.
+ /// The data to create the UI.
+ public VisualThemeBrowserFormRtlAware(KryptonThemeBrowserData themeBrowserData)
+ {
+ InitializeComponent();
+
+ _themeBrowserData = themeBrowserData;
+
+ AdjustUI();
+ }
+
+ #endregion
+
+ #region Implementation
+
+ private void AdjustUI()
+ {
+ Text = _themeBrowserData.WindowTitle ?? KryptonManager.Strings.MiscellaneousThemeStrings.ThemeBrowserWindowTitle;
+
+ kbtnImport.Visible = _themeBrowserData.ShowImportButton ?? false;
+
+ kchkSilent.Visible = _themeBrowserData.ShowSilentOption ?? false;
+
+ StartPosition = _themeBrowserData.StartPosition ?? FormStartPosition.CenterScreen;
+
+ klbThemeList.SelectedIndex = _themeBrowserData.StartIndex ?? GlobalStaticValues.GLOBAL_DEFAULT_THEME_INDEX;
+
+ klblHeader.Text = KryptonManager.Strings.MiscellaneousThemeStrings.ThemeBrowserDescription;
+
+ kbtnImport.Text = KryptonManager.Strings.MiscellaneousThemeStrings.Import;
+
+ kchkSilent.Text = KryptonManager.Strings.MiscellaneousThemeStrings.Silent;
+
+ kbtnCancel.Text = KryptonManager.Strings.GeneralStrings.Cancel;
+
+ kbtnOk.Text = KryptonManager.Strings.GeneralStrings.OK;
+ }
+
+ private void kbtnImport_Click(object sender, EventArgs e) => kcpbCustom.Import(kchkSilent.Checked);
+
+ private void VisualThemeBrowserFormRtlAware_Load(object sender, EventArgs e)
+ {
+ foreach (var themeName in ThemeManager.SupportedInternalThemeNames)
+ {
+ if (themeName != null)
+ {
+ klbThemeList.Items.Add(themeName);
+ }
+ }
+
+ klbThemeList.SelectedItem = _themeBrowserData.StartIndex;
+ }
+
+ private void klbThemeList_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ ThemeManager.ApplyTheme(klbThemeList.GetItemText(klbThemeList.SelectedItem)!, new KryptonManager());
+
+ SetIndexText($@"{klbThemeList.GetItemText(klbThemeList.SelectedItem)} - Index: {klbThemeList.SelectedIndex}");
+ }
+
+ private void SetIndexText(string value) => klblHeader.Text = value;
+
+ private void kbtnCancel_Click(object sender, EventArgs e) => DialogResult = DialogResult.Cancel;
+
+ private void kbtnOk_Click(object sender, EventArgs e) => DialogResult = DialogResult.OK;
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonThemeBrowserForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualThemeBrowserFormRtlAware.resx
similarity index 100%
rename from Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonThemeBrowserForm.resx
rename to Source/Krypton Components/Krypton.Toolkit/Controls Visuals/RTL Aware/VisualThemeBrowserFormRtlAware.resx
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualAboutBoxForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualAboutBoxForm.Designer.cs
new file mode 100644
index 000000000..c51f78e39
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualAboutBoxForm.Designer.cs
@@ -0,0 +1,1221 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualAboutBoxForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ this.kpnlButtons = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnOk = new Krypton.Toolkit.KryptonButton();
+ this.kbtnSystemInformation = new Krypton.Toolkit.KryptonButton();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kpnlMain = new Krypton.Toolkit.KryptonPanel();
+ this.khgMain = new Krypton.Toolkit.KryptonHeaderGroup();
+ this.tscMain = new System.Windows.Forms.ToolStripContainer();
+ this.kpnlGeneralInformation = new Krypton.Toolkit.KryptonPanel();
+ this.tlpnlGeneralInformation = new System.Windows.Forms.TableLayoutPanel();
+ this.pbxImage = new System.Windows.Forms.PictureBox();
+ this.kwlVersionLabel = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kwlBuiltOn = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kwlCopyright = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kryptonWrapLabel5 = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kpnlDescription = new Krypton.Toolkit.KryptonPanel();
+ this.krtbDescription = new Krypton.Toolkit.KryptonRichTextBox();
+ this.kpnlFileInformation = new Krypton.Toolkit.KryptonPanel();
+ this.tscFileInformation = new System.Windows.Forms.ToolStripContainer();
+ this.kpnlApplication = new Krypton.Toolkit.KryptonPanel();
+ this.kdgvApplication = new Krypton.Toolkit.KryptonDataGridView();
+ this.clmnApplicationKey = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.clmnValue = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.kpnlAssemblies = new Krypton.Toolkit.KryptonPanel();
+ this.kdgvAssemblies = new Krypton.Toolkit.KryptonDataGridView();
+ this.clmnAssembly = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.clmnVersion = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.clmnBuiltOn = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.clmnCodeBase = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.kpnlAssemblyDetails = new Krypton.Toolkit.KryptonPanel();
+ this.kiadAssemblyDetails = new Krypton.Toolkit.InternalAssemblyDetails();
+ this.tsFileInformation = new System.Windows.Forms.ToolStrip();
+ this.tsbtnApplicationDetails = new System.Windows.Forms.ToolStripButton();
+ this.tssAssembliesDetails = new System.Windows.Forms.ToolStripSeparator();
+ this.tsbtnAssembliesDetails = new System.Windows.Forms.ToolStripButton();
+ this.tssAssemblyDetails = new System.Windows.Forms.ToolStripSeparator();
+ this.tsbtnAssemblyDetails = new System.Windows.Forms.ToolStripButton();
+ this.kpnlTheme = new Krypton.Toolkit.KryptonPanel();
+ this.tlpTheme = new System.Windows.Forms.TableLayoutPanel();
+ this.kryptonThemeComboBox1 = new Krypton.Toolkit.KryptonThemeComboBox();
+ this.kwlCurrentTheme = new Krypton.Toolkit.KryptonWrapLabel();
+ this.kpnlToolkitInformation = new Krypton.Toolkit.KryptonPanel();
+ this.tscToolkitInformation = new System.Windows.Forms.ToolStripContainer();
+ this.kpnlToolkitGeneralInformation = new Krypton.Toolkit.KryptonPanel();
+ this.tlpGeneralInformation = new System.Windows.Forms.TableLayoutPanel();
+ this.pbxLogo = new System.Windows.Forms.PictureBox();
+ this.klwlblGeneralInformation = new Krypton.Toolkit.KryptonLinkWrapLabel();
+ this.klblCurrentTheme = new Krypton.Toolkit.KryptonLabel();
+ this.ktcmbCurrentTheme = new Krypton.Toolkit.KryptonThemeComboBox();
+ this.klblBuiltOn = new Krypton.Toolkit.KryptonLabel();
+ this.kpnlDiscord = new Krypton.Toolkit.KryptonPanel();
+ this.klwlblDiscord = new Krypton.Toolkit.KryptonLinkWrapLabel();
+ this.kpnlDeveloperInformation = new Krypton.Toolkit.KryptonPanel();
+ this.tlpDeveloperInformation = new System.Windows.Forms.TableLayoutPanel();
+ this.klwlblRepositories = new Krypton.Toolkit.KryptonLinkWrapLabel();
+ this.klwlblDocumentation = new Krypton.Toolkit.KryptonLinkWrapLabel();
+ this.klwlblDemos = new Krypton.Toolkit.KryptonLinkWrapLabel();
+ this.kpnlVersions = new Krypton.Toolkit.KryptonPanel();
+ this.kdgvVersions = new Krypton.Toolkit.KryptonDataGridView();
+ this.clmnFileName = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.clmnFileVersion = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.tsToolkitInformation = new System.Windows.Forms.ToolStrip();
+ this.tsbtnToolkitGeneralInformation = new System.Windows.Forms.ToolStripButton();
+ this.tssDiscord = new System.Windows.Forms.ToolStripSeparator();
+ this.tsbtnDiscord = new System.Windows.Forms.ToolStripButton();
+ this.tssDeveloperInformation = new System.Windows.Forms.ToolStripSeparator();
+ this.tsbtnDeveloperInformation = new System.Windows.Forms.ToolStripButton();
+ this.tssVersions = new System.Windows.Forms.ToolStripSeparator();
+ this.tsbtnVersions = new System.Windows.Forms.ToolStripButton();
+ this.tsMain = new System.Windows.Forms.ToolStrip();
+ this.tsbtnGeneralInformation = new System.Windows.Forms.ToolStripButton();
+ this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
+ this.tsbtnDescription = new System.Windows.Forms.ToolStripButton();
+ this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
+ this.tsbtnFileInformation = new System.Windows.Forms.ToolStripButton();
+ this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
+ this.tsbtnTheme = new System.Windows.Forms.ToolStripButton();
+ this.tssToolkitInformation = new System.Windows.Forms.ToolStripSeparator();
+ this.tsbtnToolkitInformation = new System.Windows.Forms.ToolStripButton();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit();
+ this.kpnlButtons.SuspendLayout();
+ this.tableLayoutPanel1.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).BeginInit();
+ this.kpnlMain.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.khgMain)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.khgMain.Panel)).BeginInit();
+ this.khgMain.Panel.SuspendLayout();
+ this.khgMain.SuspendLayout();
+ this.tscMain.ContentPanel.SuspendLayout();
+ this.tscMain.TopToolStripPanel.SuspendLayout();
+ this.tscMain.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlGeneralInformation)).BeginInit();
+ this.kpnlGeneralInformation.SuspendLayout();
+ this.tlpnlGeneralInformation.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxImage)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlDescription)).BeginInit();
+ this.kpnlDescription.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlFileInformation)).BeginInit();
+ this.kpnlFileInformation.SuspendLayout();
+ this.tscFileInformation.ContentPanel.SuspendLayout();
+ this.tscFileInformation.TopToolStripPanel.SuspendLayout();
+ this.tscFileInformation.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlApplication)).BeginInit();
+ this.kpnlApplication.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kdgvApplication)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlAssemblies)).BeginInit();
+ this.kpnlAssemblies.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kdgvAssemblies)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlAssemblyDetails)).BeginInit();
+ this.kpnlAssemblyDetails.SuspendLayout();
+ this.tsFileInformation.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlTheme)).BeginInit();
+ this.kpnlTheme.SuspendLayout();
+ this.tlpTheme.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonThemeComboBox1)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlToolkitInformation)).BeginInit();
+ this.kpnlToolkitInformation.SuspendLayout();
+ this.tscToolkitInformation.ContentPanel.SuspendLayout();
+ this.tscToolkitInformation.TopToolStripPanel.SuspendLayout();
+ this.tscToolkitInformation.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlToolkitGeneralInformation)).BeginInit();
+ this.kpnlToolkitGeneralInformation.SuspendLayout();
+ this.tlpGeneralInformation.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxLogo)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.ktcmbCurrentTheme)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlDiscord)).BeginInit();
+ this.kpnlDiscord.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlDeveloperInformation)).BeginInit();
+ this.kpnlDeveloperInformation.SuspendLayout();
+ this.tlpDeveloperInformation.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlVersions)).BeginInit();
+ this.kpnlVersions.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kdgvVersions)).BeginInit();
+ this.tsToolkitInformation.SuspendLayout();
+ this.tsMain.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // kpnlButtons
+ //
+ this.kpnlButtons.Controls.Add(this.tableLayoutPanel1);
+ this.kpnlButtons.Controls.Add(this.kryptonBorderEdge1);
+ this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kpnlButtons.Location = new System.Drawing.Point(0, 404);
+ this.kpnlButtons.Name = "kpnlButtons";
+ this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kpnlButtons.Size = new System.Drawing.Size(804, 50);
+ this.kpnlButtons.TabIndex = 0;
+ //
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel1.ColumnCount = 2;
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel1.Controls.Add(this.kbtnOk, 1, 0);
+ this.tableLayoutPanel1.Controls.Add(this.kbtnSystemInformation, 0, 0);
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 1;
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 49F));
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(804, 49);
+ this.tableLayoutPanel1.TabIndex = 3;
+ //
+ // kbtnOk
+ //
+ this.kbtnOk.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnOk.Location = new System.Drawing.Point(704, 12);
+ this.kbtnOk.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnOk.Name = "kbtnOk";
+ this.kbtnOk.Size = new System.Drawing.Size(90, 25);
+ this.kbtnOk.TabIndex = 0;
+ this.kbtnOk.Values.Text = "kryptonButton1";
+ this.kbtnOk.Click += new System.EventHandler(this.kbtnOk_Click);
+ //
+ // kbtnSystemInformation
+ //
+ this.kbtnSystemInformation.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnSystemInformation.Location = new System.Drawing.Point(523, 12);
+ this.kbtnSystemInformation.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnSystemInformation.Name = "kbtnSystemInformation";
+ this.kbtnSystemInformation.Size = new System.Drawing.Size(161, 25);
+ this.kbtnSystemInformation.TabIndex = 1;
+ this.kbtnSystemInformation.Values.Text = "kryptonButton2";
+ this.kbtnSystemInformation.Click += new System.EventHandler(this.kbtnSystemInformation_Click);
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(804, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kpnlMain
+ //
+ this.kpnlMain.Controls.Add(this.khgMain);
+ this.kpnlMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlMain.Location = new System.Drawing.Point(0, 0);
+ this.kpnlMain.Name = "kpnlMain";
+ this.kpnlMain.Size = new System.Drawing.Size(804, 404);
+ this.kpnlMain.TabIndex = 1;
+ //
+ // khgMain
+ //
+ this.khgMain.HeaderVisibleSecondary = false;
+ this.khgMain.Location = new System.Drawing.Point(11, 8);
+ this.khgMain.Name = "khgMain";
+ //
+ // khgMain.Panel
+ //
+ this.khgMain.Panel.Controls.Add(this.tscMain);
+ this.khgMain.Size = new System.Drawing.Size(779, 385);
+ this.khgMain.TabIndex = 2;
+ this.khgMain.ValuesPrimary.Image = null;
+ //
+ // tscMain
+ //
+ //
+ // tscMain.ContentPanel
+ //
+ this.tscMain.ContentPanel.Controls.Add(this.kpnlGeneralInformation);
+ this.tscMain.ContentPanel.Controls.Add(this.kpnlDescription);
+ this.tscMain.ContentPanel.Controls.Add(this.kpnlFileInformation);
+ this.tscMain.ContentPanel.Controls.Add(this.kpnlTheme);
+ this.tscMain.ContentPanel.Controls.Add(this.kpnlToolkitInformation);
+ this.tscMain.ContentPanel.Size = new System.Drawing.Size(777, 326);
+ this.tscMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tscMain.Location = new System.Drawing.Point(0, 0);
+ this.tscMain.Name = "tscMain";
+ this.tscMain.Size = new System.Drawing.Size(777, 351);
+ this.tscMain.TabIndex = 0;
+ this.tscMain.Text = "toolStripContainer1";
+ //
+ // tscMain.TopToolStripPanel
+ //
+ this.tscMain.TopToolStripPanel.Controls.Add(this.tsMain);
+ //
+ // kpnlGeneralInformation
+ //
+ this.kpnlGeneralInformation.Controls.Add(this.tlpnlGeneralInformation);
+ this.kpnlGeneralInformation.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlGeneralInformation.Location = new System.Drawing.Point(0, 0);
+ this.kpnlGeneralInformation.Name = "kpnlGeneralInformation";
+ this.kpnlGeneralInformation.Size = new System.Drawing.Size(777, 326);
+ this.kpnlGeneralInformation.TabIndex = 3;
+ //
+ // tlpnlGeneralInformation
+ //
+ this.tlpnlGeneralInformation.BackColor = System.Drawing.Color.Transparent;
+ this.tlpnlGeneralInformation.ColumnCount = 2;
+ this.tlpnlGeneralInformation.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tlpnlGeneralInformation.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpnlGeneralInformation.Controls.Add(this.pbxImage, 0, 0);
+ this.tlpnlGeneralInformation.Controls.Add(this.kwlVersionLabel, 1, 0);
+ this.tlpnlGeneralInformation.Controls.Add(this.kwlBuiltOn, 1, 1);
+ this.tlpnlGeneralInformation.Controls.Add(this.kwlCopyright, 1, 2);
+ this.tlpnlGeneralInformation.Controls.Add(this.kryptonWrapLabel5, 1, 3);
+ this.tlpnlGeneralInformation.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpnlGeneralInformation.Location = new System.Drawing.Point(0, 0);
+ this.tlpnlGeneralInformation.Name = "tlpnlGeneralInformation";
+ this.tlpnlGeneralInformation.RowCount = 4;
+ this.tlpnlGeneralInformation.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
+ this.tlpnlGeneralInformation.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
+ this.tlpnlGeneralInformation.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
+ this.tlpnlGeneralInformation.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
+ this.tlpnlGeneralInformation.Size = new System.Drawing.Size(777, 326);
+ this.tlpnlGeneralInformation.TabIndex = 1;
+ //
+ // pbxImage
+ //
+ this.pbxImage.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pbxImage.Location = new System.Drawing.Point(5, 5);
+ this.pbxImage.Margin = new System.Windows.Forms.Padding(5);
+ this.pbxImage.Name = "pbxImage";
+ this.tlpnlGeneralInformation.SetRowSpan(this.pbxImage, 4);
+ this.pbxImage.Size = new System.Drawing.Size(64, 316);
+ this.pbxImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pbxImage.TabIndex = 0;
+ this.pbxImage.TabStop = false;
+ //
+ // kwlVersionLabel
+ //
+ this.kwlVersionLabel.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlVersionLabel.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
+ this.kwlVersionLabel.ForeColor = System.Drawing.Color.Black;
+ this.kwlVersionLabel.LabelStyle = Krypton.Toolkit.LabelStyle.BoldControl;
+ this.kwlVersionLabel.Location = new System.Drawing.Point(77, 0);
+ this.kwlVersionLabel.Name = "kwlVersionLabel";
+ this.kwlVersionLabel.Size = new System.Drawing.Size(697, 81);
+ this.kwlVersionLabel.Text = "kryptonWrapLabel2";
+ this.kwlVersionLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // kwlBuiltOn
+ //
+ this.kwlBuiltOn.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlBuiltOn.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
+ this.kwlBuiltOn.ForeColor = System.Drawing.Color.Black;
+ this.kwlBuiltOn.LabelStyle = Krypton.Toolkit.LabelStyle.BoldControl;
+ this.kwlBuiltOn.Location = new System.Drawing.Point(77, 81);
+ this.kwlBuiltOn.Name = "kwlBuiltOn";
+ this.kwlBuiltOn.Size = new System.Drawing.Size(697, 81);
+ this.kwlBuiltOn.Text = "kryptonWrapLabel3";
+ this.kwlBuiltOn.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // kwlCopyright
+ //
+ this.kwlCopyright.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlCopyright.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
+ this.kwlCopyright.ForeColor = System.Drawing.Color.Black;
+ this.kwlCopyright.LabelStyle = Krypton.Toolkit.LabelStyle.BoldControl;
+ this.kwlCopyright.Location = new System.Drawing.Point(77, 162);
+ this.kwlCopyright.Name = "kwlCopyright";
+ this.kwlCopyright.Size = new System.Drawing.Size(697, 81);
+ this.kwlCopyright.Text = "kryptonWrapLabel4";
+ this.kwlCopyright.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // kryptonWrapLabel5
+ //
+ this.kryptonWrapLabel5.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kryptonWrapLabel5.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
+ this.kryptonWrapLabel5.ForeColor = System.Drawing.Color.Black;
+ this.kryptonWrapLabel5.LabelStyle = Krypton.Toolkit.LabelStyle.BoldControl;
+ this.kryptonWrapLabel5.Location = new System.Drawing.Point(77, 243);
+ this.kryptonWrapLabel5.Name = "kryptonWrapLabel5";
+ this.kryptonWrapLabel5.Size = new System.Drawing.Size(697, 83);
+ this.kryptonWrapLabel5.Text = "kryptonWrapLabel5";
+ this.kryptonWrapLabel5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // kpnlDescription
+ //
+ this.kpnlDescription.Controls.Add(this.krtbDescription);
+ this.kpnlDescription.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlDescription.Location = new System.Drawing.Point(0, 0);
+ this.kpnlDescription.Name = "kpnlDescription";
+ this.kpnlDescription.Size = new System.Drawing.Size(777, 326);
+ this.kpnlDescription.TabIndex = 2;
+ //
+ // krtbDescription
+ //
+ this.krtbDescription.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.krtbDescription.InputControlStyle = Krypton.Toolkit.InputControlStyle.PanelClient;
+ this.krtbDescription.Location = new System.Drawing.Point(0, 0);
+ this.krtbDescription.Name = "krtbDescription";
+ this.krtbDescription.Size = new System.Drawing.Size(777, 326);
+ this.krtbDescription.TabIndex = 0;
+ this.krtbDescription.Text = "";
+ //
+ // kpnlFileInformation
+ //
+ this.kpnlFileInformation.Controls.Add(this.tscFileInformation);
+ this.kpnlFileInformation.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlFileInformation.Location = new System.Drawing.Point(0, 0);
+ this.kpnlFileInformation.Name = "kpnlFileInformation";
+ this.kpnlFileInformation.Size = new System.Drawing.Size(777, 326);
+ this.kpnlFileInformation.TabIndex = 1;
+ //
+ // tscFileInformation
+ //
+ //
+ // tscFileInformation.ContentPanel
+ //
+ this.tscFileInformation.ContentPanel.Controls.Add(this.kpnlApplication);
+ this.tscFileInformation.ContentPanel.Controls.Add(this.kpnlAssemblies);
+ this.tscFileInformation.ContentPanel.Controls.Add(this.kpnlAssemblyDetails);
+ this.tscFileInformation.ContentPanel.Size = new System.Drawing.Size(777, 301);
+ this.tscFileInformation.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tscFileInformation.Location = new System.Drawing.Point(0, 0);
+ this.tscFileInformation.Name = "tscFileInformation";
+ this.tscFileInformation.Size = new System.Drawing.Size(777, 326);
+ this.tscFileInformation.TabIndex = 1;
+ this.tscFileInformation.Text = "toolStripContainer2";
+ //
+ // tscFileInformation.TopToolStripPanel
+ //
+ this.tscFileInformation.TopToolStripPanel.Controls.Add(this.tsFileInformation);
+ //
+ // kpnlApplication
+ //
+ this.kpnlApplication.Controls.Add(this.kdgvApplication);
+ this.kpnlApplication.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlApplication.Location = new System.Drawing.Point(0, 0);
+ this.kpnlApplication.Name = "kpnlApplication";
+ this.kpnlApplication.Size = new System.Drawing.Size(777, 301);
+ this.kpnlApplication.TabIndex = 1;
+ //
+ // kdgvApplication
+ //
+ this.kdgvApplication.AllowUserToAddRows = false;
+ this.kdgvApplication.AllowUserToDeleteRows = false;
+ this.kdgvApplication.AllowUserToResizeColumns = false;
+ this.kdgvApplication.AllowUserToResizeRows = false;
+ this.kdgvApplication.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
+ this.kdgvApplication.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
+ this.kdgvApplication.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.kdgvApplication.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+ this.clmnApplicationKey,
+ this.clmnValue});
+ this.kdgvApplication.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kdgvApplication.Location = new System.Drawing.Point(0, 0);
+ this.kdgvApplication.Name = "kdgvApplication";
+ this.kdgvApplication.Size = new System.Drawing.Size(777, 301);
+ this.kdgvApplication.TabIndex = 0;
+ //
+ // clmnApplicationKey
+ //
+ this.clmnApplicationKey.HeaderText = "Application Key";
+ this.clmnApplicationKey.Name = "clmnApplicationKey";
+ this.clmnApplicationKey.Width = 119;
+ //
+ // clmnValue
+ //
+ this.clmnValue.HeaderText = "Value";
+ this.clmnValue.Name = "clmnValue";
+ this.clmnValue.Width = 64;
+ //
+ // kpnlAssemblies
+ //
+ this.kpnlAssemblies.Controls.Add(this.kdgvAssemblies);
+ this.kpnlAssemblies.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlAssemblies.Location = new System.Drawing.Point(0, 0);
+ this.kpnlAssemblies.Name = "kpnlAssemblies";
+ this.kpnlAssemblies.Size = new System.Drawing.Size(777, 301);
+ this.kpnlAssemblies.TabIndex = 1;
+ //
+ // kdgvAssemblies
+ //
+ this.kdgvAssemblies.AllowUserToAddRows = false;
+ this.kdgvAssemblies.AllowUserToDeleteRows = false;
+ this.kdgvAssemblies.AllowUserToResizeColumns = false;
+ this.kdgvAssemblies.AllowUserToResizeRows = false;
+ this.kdgvAssemblies.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
+ this.kdgvAssemblies.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
+ this.kdgvAssemblies.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.kdgvAssemblies.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+ this.clmnAssembly,
+ this.clmnVersion,
+ this.clmnBuiltOn,
+ this.clmnCodeBase});
+ this.kdgvAssemblies.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kdgvAssemblies.Location = new System.Drawing.Point(0, 0);
+ this.kdgvAssemblies.Name = "kdgvAssemblies";
+ this.kdgvAssemblies.Size = new System.Drawing.Size(777, 301);
+ this.kdgvAssemblies.TabIndex = 0;
+ //
+ // clmnAssembly
+ //
+ this.clmnAssembly.HeaderText = "Assembly";
+ this.clmnAssembly.Name = "clmnAssembly";
+ this.clmnAssembly.Width = 87;
+ //
+ // clmnVersion
+ //
+ this.clmnVersion.HeaderText = "Version";
+ this.clmnVersion.Name = "clmnVersion";
+ this.clmnVersion.Width = 74;
+ //
+ // clmnBuiltOn
+ //
+ this.clmnBuiltOn.HeaderText = "Built On";
+ this.clmnBuiltOn.Name = "clmnBuiltOn";
+ this.clmnBuiltOn.Width = 79;
+ //
+ // clmnCodeBase
+ //
+ this.clmnCodeBase.HeaderText = "Code Base";
+ this.clmnCodeBase.Name = "clmnCodeBase";
+ this.clmnCodeBase.Width = 91;
+ //
+ // kpnlAssemblyDetails
+ //
+ this.kpnlAssemblyDetails.Controls.Add(this.kiadAssemblyDetails);
+ this.kpnlAssemblyDetails.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlAssemblyDetails.Location = new System.Drawing.Point(0, 0);
+ this.kpnlAssemblyDetails.Name = "kpnlAssemblyDetails";
+ this.kpnlAssemblyDetails.Size = new System.Drawing.Size(777, 301);
+ this.kpnlAssemblyDetails.TabIndex = 0;
+ //
+ // kiadAssemblyDetails
+ //
+ this.kiadAssemblyDetails.BackColor = System.Drawing.Color.Transparent;
+ this.kiadAssemblyDetails.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kiadAssemblyDetails.Location = new System.Drawing.Point(0, 0);
+ this.kiadAssemblyDetails.Name = "kiadAssemblyDetails";
+ this.kiadAssemblyDetails.Size = new System.Drawing.Size(777, 301);
+ this.kiadAssemblyDetails.TabIndex = 0;
+ //
+ // tsFileInformation
+ //
+ this.tsFileInformation.Dock = System.Windows.Forms.DockStyle.None;
+ this.tsFileInformation.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.tsFileInformation.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
+ this.tsFileInformation.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.tsbtnApplicationDetails,
+ this.tssAssembliesDetails,
+ this.tsbtnAssembliesDetails,
+ this.tssAssemblyDetails,
+ this.tsbtnAssemblyDetails});
+ this.tsFileInformation.Location = new System.Drawing.Point(3, 0);
+ this.tsFileInformation.Name = "tsFileInformation";
+ this.tsFileInformation.Size = new System.Drawing.Size(257, 25);
+ this.tsFileInformation.TabIndex = 0;
+ //
+ // tsbtnApplicationDetails
+ //
+ this.tsbtnApplicationDetails.CheckOnClick = true;
+ this.tsbtnApplicationDetails.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.tsbtnApplicationDetails.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tsbtnApplicationDetails.Name = "tsbtnApplicationDetails";
+ this.tsbtnApplicationDetails.Size = new System.Drawing.Size(72, 22);
+ this.tsbtnApplicationDetails.Text = "Application";
+ this.tsbtnApplicationDetails.Click += new System.EventHandler(this.tsbtnApplicationDetails_Click);
+ //
+ // tssAssembliesDetails
+ //
+ this.tssAssembliesDetails.Name = "tssAssembliesDetails";
+ this.tssAssembliesDetails.Size = new System.Drawing.Size(6, 25);
+ //
+ // tsbtnAssembliesDetails
+ //
+ this.tsbtnAssembliesDetails.CheckOnClick = true;
+ this.tsbtnAssembliesDetails.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.tsbtnAssembliesDetails.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tsbtnAssembliesDetails.Name = "tsbtnAssembliesDetails";
+ this.tsbtnAssembliesDetails.Size = new System.Drawing.Size(70, 22);
+ this.tsbtnAssembliesDetails.Text = "Assemblies";
+ this.tsbtnAssembliesDetails.Click += new System.EventHandler(this.tsbtnAssembliesDetails_Click);
+ //
+ // tssAssemblyDetails
+ //
+ this.tssAssemblyDetails.Name = "tssAssemblyDetails";
+ this.tssAssemblyDetails.Size = new System.Drawing.Size(6, 25);
+ //
+ // tsbtnAssemblyDetails
+ //
+ this.tsbtnAssemblyDetails.CheckOnClick = true;
+ this.tsbtnAssemblyDetails.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.tsbtnAssemblyDetails.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tsbtnAssemblyDetails.Name = "tsbtnAssemblyDetails";
+ this.tsbtnAssemblyDetails.Size = new System.Drawing.Size(100, 22);
+ this.tsbtnAssemblyDetails.Text = "Assembly Details";
+ this.tsbtnAssemblyDetails.Click += new System.EventHandler(this.tsbtnAssemblyDetails_Click);
+ //
+ // kpnlTheme
+ //
+ this.kpnlTheme.Controls.Add(this.tlpTheme);
+ this.kpnlTheme.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlTheme.Location = new System.Drawing.Point(0, 0);
+ this.kpnlTheme.Name = "kpnlTheme";
+ this.kpnlTheme.Size = new System.Drawing.Size(777, 326);
+ this.kpnlTheme.TabIndex = 0;
+ //
+ // tlpTheme
+ //
+ this.tlpTheme.BackColor = System.Drawing.Color.Transparent;
+ this.tlpTheme.ColumnCount = 1;
+ this.tlpTheme.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpTheme.Controls.Add(this.kryptonThemeComboBox1, 0, 1);
+ this.tlpTheme.Controls.Add(this.kwlCurrentTheme, 0, 0);
+ this.tlpTheme.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpTheme.Location = new System.Drawing.Point(0, 0);
+ this.tlpTheme.Name = "tlpTheme";
+ this.tlpTheme.RowCount = 2;
+ this.tlpTheme.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpTheme.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpTheme.Size = new System.Drawing.Size(777, 326);
+ this.tlpTheme.TabIndex = 0;
+ //
+ // kryptonThemeComboBox1
+ //
+ this.kryptonThemeComboBox1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kryptonThemeComboBox1.DropDownWidth = 767;
+ this.kryptonThemeComboBox1.IntegralHeight = false;
+ this.kryptonThemeComboBox1.Location = new System.Drawing.Point(5, 300);
+ this.kryptonThemeComboBox1.Margin = new System.Windows.Forms.Padding(5);
+ this.kryptonThemeComboBox1.Name = "kryptonThemeComboBox1";
+ this.kryptonThemeComboBox1.Size = new System.Drawing.Size(767, 21);
+ this.kryptonThemeComboBox1.StateCommon.ComboBox.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near;
+ this.kryptonThemeComboBox1.TabIndex = 0;
+ //
+ // kwlCurrentTheme
+ //
+ this.kwlCurrentTheme.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlCurrentTheme.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
+ this.kwlCurrentTheme.ForeColor = System.Drawing.Color.Black;
+ this.kwlCurrentTheme.LabelStyle = Krypton.Toolkit.LabelStyle.BoldControl;
+ this.kwlCurrentTheme.Location = new System.Drawing.Point(3, 0);
+ this.kwlCurrentTheme.Name = "kwlCurrentTheme";
+ this.kwlCurrentTheme.Padding = new System.Windows.Forms.Padding(5);
+ this.kwlCurrentTheme.Size = new System.Drawing.Size(771, 295);
+ this.kwlCurrentTheme.Text = "kryptonWrapLabel1";
+ this.kwlCurrentTheme.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
+ //
+ // kpnlToolkitInformation
+ //
+ this.kpnlToolkitInformation.Controls.Add(this.tscToolkitInformation);
+ this.kpnlToolkitInformation.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlToolkitInformation.Location = new System.Drawing.Point(0, 0);
+ this.kpnlToolkitInformation.Name = "kpnlToolkitInformation";
+ this.kpnlToolkitInformation.Size = new System.Drawing.Size(777, 326);
+ this.kpnlToolkitInformation.TabIndex = 4;
+ //
+ // tscToolkitInformation
+ //
+ //
+ // tscToolkitInformation.ContentPanel
+ //
+ this.tscToolkitInformation.ContentPanel.Controls.Add(this.kpnlToolkitGeneralInformation);
+ this.tscToolkitInformation.ContentPanel.Controls.Add(this.kpnlDiscord);
+ this.tscToolkitInformation.ContentPanel.Controls.Add(this.kpnlDeveloperInformation);
+ this.tscToolkitInformation.ContentPanel.Controls.Add(this.kpnlVersions);
+ this.tscToolkitInformation.ContentPanel.Size = new System.Drawing.Size(777, 301);
+ this.tscToolkitInformation.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tscToolkitInformation.Location = new System.Drawing.Point(0, 0);
+ this.tscToolkitInformation.Name = "tscToolkitInformation";
+ this.tscToolkitInformation.Size = new System.Drawing.Size(777, 326);
+ this.tscToolkitInformation.TabIndex = 2;
+ this.tscToolkitInformation.Text = "toolStripContainer1";
+ //
+ // tscToolkitInformation.TopToolStripPanel
+ //
+ this.tscToolkitInformation.TopToolStripPanel.Controls.Add(this.tsToolkitInformation);
+ //
+ // kpnlToolkitGeneralInformation
+ //
+ this.kpnlToolkitGeneralInformation.Controls.Add(this.tlpGeneralInformation);
+ this.kpnlToolkitGeneralInformation.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlToolkitGeneralInformation.Location = new System.Drawing.Point(0, 0);
+ this.kpnlToolkitGeneralInformation.Name = "kpnlToolkitGeneralInformation";
+ this.kpnlToolkitGeneralInformation.Size = new System.Drawing.Size(777, 301);
+ this.kpnlToolkitGeneralInformation.TabIndex = 3;
+ //
+ // tlpGeneralInformation
+ //
+ this.tlpGeneralInformation.BackColor = System.Drawing.Color.Transparent;
+ this.tlpGeneralInformation.ColumnCount = 2;
+ this.tlpGeneralInformation.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tlpGeneralInformation.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpGeneralInformation.Controls.Add(this.pbxLogo, 0, 0);
+ this.tlpGeneralInformation.Controls.Add(this.klwlblGeneralInformation, 1, 0);
+ this.tlpGeneralInformation.Controls.Add(this.klblCurrentTheme, 1, 2);
+ this.tlpGeneralInformation.Controls.Add(this.ktcmbCurrentTheme, 1, 3);
+ this.tlpGeneralInformation.Controls.Add(this.klblBuiltOn, 1, 1);
+ this.tlpGeneralInformation.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpGeneralInformation.Location = new System.Drawing.Point(0, 0);
+ this.tlpGeneralInformation.Name = "tlpGeneralInformation";
+ this.tlpGeneralInformation.RowCount = 3;
+ this.tlpGeneralInformation.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpGeneralInformation.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpGeneralInformation.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpGeneralInformation.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpGeneralInformation.Size = new System.Drawing.Size(777, 301);
+ this.tlpGeneralInformation.TabIndex = 0;
+ //
+ // pbxLogo
+ //
+ this.pbxLogo.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pbxLogo.Location = new System.Drawing.Point(5, 5);
+ this.pbxLogo.Margin = new System.Windows.Forms.Padding(5);
+ this.pbxLogo.Name = "pbxLogo";
+ this.pbxLogo.Padding = new System.Windows.Forms.Padding(4, 4, 0, 0);
+ this.pbxLogo.Size = new System.Drawing.Size(64, 200);
+ this.pbxLogo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pbxLogo.TabIndex = 0;
+ this.pbxLogo.TabStop = false;
+ //
+ // klwlblGeneralInformation
+ //
+ this.klwlblGeneralInformation.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.klwlblGeneralInformation.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.klwlblGeneralInformation.ForeColor = System.Drawing.Color.White;
+ this.klwlblGeneralInformation.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.klwlblGeneralInformation.LinkArea = new System.Windows.Forms.LinkArea(133, 143);
+ this.klwlblGeneralInformation.Location = new System.Drawing.Point(79, 5);
+ this.klwlblGeneralInformation.Margin = new System.Windows.Forms.Padding(5);
+ this.klwlblGeneralInformation.Name = "klwlblGeneralInformation";
+ this.klwlblGeneralInformation.Size = new System.Drawing.Size(693, 200);
+ this.klwlblGeneralInformation.Text = "Some of the components used in this application are part of the Krypton Standard " +
+ "Toolkit.\r\n\r\nLicense: BSD-3-Clause\r\n\r\nTo learn more, click here.";
+ this.klwlblGeneralInformation.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ this.klwlblGeneralInformation.UseCompatibleTextRendering = true;
+ this.klwlblGeneralInformation.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.klwlblGeneralInformation_LinkClicked);
+ //
+ // klblCurrentTheme
+ //
+ this.klblCurrentTheme.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.klblCurrentTheme.LabelStyle = Krypton.Toolkit.LabelStyle.BoldPanel;
+ this.klblCurrentTheme.Location = new System.Drawing.Point(79, 245);
+ this.klblCurrentTheme.Margin = new System.Windows.Forms.Padding(5);
+ this.klblCurrentTheme.Name = "klblCurrentTheme";
+ this.klblCurrentTheme.Size = new System.Drawing.Size(693, 20);
+ this.klblCurrentTheme.TabIndex = 2;
+ this.klblCurrentTheme.Values.Text = "Current Theme:";
+ //
+ // ktcmbCurrentTheme
+ //
+ this.ktcmbCurrentTheme.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.ktcmbCurrentTheme.DropDownWidth = 693;
+ this.ktcmbCurrentTheme.IntegralHeight = false;
+ this.ktcmbCurrentTheme.Location = new System.Drawing.Point(79, 275);
+ this.ktcmbCurrentTheme.Margin = new System.Windows.Forms.Padding(5);
+ this.ktcmbCurrentTheme.Name = "ktcmbCurrentTheme";
+ this.ktcmbCurrentTheme.Size = new System.Drawing.Size(693, 21);
+ this.ktcmbCurrentTheme.StateCommon.ComboBox.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near;
+ this.ktcmbCurrentTheme.TabIndex = 3;
+ //
+ // klblBuiltOn
+ //
+ this.klblBuiltOn.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.klblBuiltOn.LabelStyle = Krypton.Toolkit.LabelStyle.BoldControl;
+ this.klblBuiltOn.Location = new System.Drawing.Point(79, 215);
+ this.klblBuiltOn.Margin = new System.Windows.Forms.Padding(5);
+ this.klblBuiltOn.Name = "klblBuiltOn";
+ this.klblBuiltOn.Size = new System.Drawing.Size(693, 20);
+ this.klblBuiltOn.TabIndex = 4;
+ this.klblBuiltOn.Values.Text = "Built On: {0}";
+ //
+ // kpnlDiscord
+ //
+ this.kpnlDiscord.Controls.Add(this.klwlblDiscord);
+ this.kpnlDiscord.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlDiscord.Location = new System.Drawing.Point(0, 0);
+ this.kpnlDiscord.Name = "kpnlDiscord";
+ this.kpnlDiscord.Size = new System.Drawing.Size(777, 301);
+ this.kpnlDiscord.TabIndex = 2;
+ //
+ // klwlblDiscord
+ //
+ this.klwlblDiscord.AutoSize = false;
+ this.klwlblDiscord.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.klwlblDiscord.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.klwlblDiscord.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.klwlblDiscord.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.klwlblDiscord.Location = new System.Drawing.Point(0, 0);
+ this.klwlblDiscord.Name = "klwlblDiscord";
+ this.klwlblDiscord.Size = new System.Drawing.Size(777, 301);
+ this.klwlblDiscord.Text = "kryptonLinkWrapLabel1";
+ this.klwlblDiscord.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ this.klwlblDiscord.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.klwlblDiscord_LinkClicked);
+ //
+ // kpnlDeveloperInformation
+ //
+ this.kpnlDeveloperInformation.Controls.Add(this.tlpDeveloperInformation);
+ this.kpnlDeveloperInformation.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlDeveloperInformation.Location = new System.Drawing.Point(0, 0);
+ this.kpnlDeveloperInformation.Name = "kpnlDeveloperInformation";
+ this.kpnlDeveloperInformation.Size = new System.Drawing.Size(777, 301);
+ this.kpnlDeveloperInformation.TabIndex = 1;
+ //
+ // tlpDeveloperInformation
+ //
+ this.tlpDeveloperInformation.BackColor = System.Drawing.Color.Transparent;
+ this.tlpDeveloperInformation.ColumnCount = 1;
+ this.tlpDeveloperInformation.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpDeveloperInformation.Controls.Add(this.klwlblRepositories, 0, 0);
+ this.tlpDeveloperInformation.Controls.Add(this.klwlblDocumentation, 0, 1);
+ this.tlpDeveloperInformation.Controls.Add(this.klwlblDemos, 0, 2);
+ this.tlpDeveloperInformation.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpDeveloperInformation.Location = new System.Drawing.Point(0, 0);
+ this.tlpDeveloperInformation.Name = "tlpDeveloperInformation";
+ this.tlpDeveloperInformation.RowCount = 3;
+ this.tlpDeveloperInformation.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
+ this.tlpDeveloperInformation.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
+ this.tlpDeveloperInformation.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
+ this.tlpDeveloperInformation.Size = new System.Drawing.Size(777, 301);
+ this.tlpDeveloperInformation.TabIndex = 0;
+ //
+ // klwlblRepositories
+ //
+ this.klwlblRepositories.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.klwlblRepositories.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.klwlblRepositories.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.klwlblRepositories.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.klwlblRepositories.Location = new System.Drawing.Point(5, 5);
+ this.klwlblRepositories.Margin = new System.Windows.Forms.Padding(5);
+ this.klwlblRepositories.Name = "klwlblRepositories";
+ this.klwlblRepositories.Size = new System.Drawing.Size(767, 90);
+ this.klwlblRepositories.Text = "kryptonLinkWrapLabel1";
+ this.klwlblRepositories.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ this.klwlblRepositories.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.klwlblRepositories_LinkClicked);
+ //
+ // klwlblDocumentation
+ //
+ this.klwlblDocumentation.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.klwlblDocumentation.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.klwlblDocumentation.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.klwlblDocumentation.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.klwlblDocumentation.Location = new System.Drawing.Point(5, 105);
+ this.klwlblDocumentation.Margin = new System.Windows.Forms.Padding(5);
+ this.klwlblDocumentation.Name = "klwlblDocumentation";
+ this.klwlblDocumentation.Size = new System.Drawing.Size(767, 90);
+ this.klwlblDocumentation.Text = "kryptonLinkWrapLabel1";
+ this.klwlblDocumentation.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ this.klwlblDocumentation.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.klwlblDocumentation_LinkClicked);
+ //
+ // klwlblDemos
+ //
+ this.klwlblDemos.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.klwlblDemos.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.klwlblDemos.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.klwlblDemos.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.klwlblDemos.Location = new System.Drawing.Point(5, 205);
+ this.klwlblDemos.Margin = new System.Windows.Forms.Padding(5);
+ this.klwlblDemos.Name = "klwlblDemos";
+ this.klwlblDemos.Size = new System.Drawing.Size(767, 91);
+ this.klwlblDemos.Text = "kryptonLinkWrapLabel1";
+ this.klwlblDemos.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ this.klwlblDemos.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.klwlblDemos_LinkClicked);
+ //
+ // kpnlVersions
+ //
+ this.kpnlVersions.Controls.Add(this.kdgvVersions);
+ this.kpnlVersions.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlVersions.Location = new System.Drawing.Point(0, 0);
+ this.kpnlVersions.Name = "kpnlVersions";
+ this.kpnlVersions.Size = new System.Drawing.Size(777, 301);
+ this.kpnlVersions.TabIndex = 0;
+ //
+ // kdgvVersions
+ //
+ this.kdgvVersions.AllowUserToAddRows = false;
+ this.kdgvVersions.AllowUserToDeleteRows = false;
+ this.kdgvVersions.AllowUserToOrderColumns = true;
+ this.kdgvVersions.AllowUserToResizeColumns = false;
+ this.kdgvVersions.AllowUserToResizeRows = false;
+ this.kdgvVersions.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
+ this.kdgvVersions.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
+ this.kdgvVersions.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.kdgvVersions.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+ this.clmnFileName,
+ this.clmnFileVersion});
+ this.kdgvVersions.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kdgvVersions.Location = new System.Drawing.Point(0, 0);
+ this.kdgvVersions.Name = "kdgvVersions";
+ this.kdgvVersions.Size = new System.Drawing.Size(777, 301);
+ this.kdgvVersions.TabIndex = 0;
+ //
+ // clmnFileName
+ //
+ this.clmnFileName.HeaderText = "File Name";
+ this.clmnFileName.Name = "clmnFileName";
+ this.clmnFileName.Width = 89;
+ //
+ // clmnFileVersion
+ //
+ this.clmnFileVersion.HeaderText = "Version";
+ this.clmnFileVersion.Name = "clmnFileVersion";
+ this.clmnFileVersion.Width = 74;
+ //
+ // tsToolkitInformation
+ //
+ this.tsToolkitInformation.Dock = System.Windows.Forms.DockStyle.None;
+ this.tsToolkitInformation.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.tsToolkitInformation.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
+ this.tsToolkitInformation.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.tsbtnToolkitGeneralInformation,
+ this.tssDiscord,
+ this.tsbtnDiscord,
+ this.tssDeveloperInformation,
+ this.tsbtnDeveloperInformation,
+ this.tssVersions,
+ this.tsbtnVersions});
+ this.tsToolkitInformation.Location = new System.Drawing.Point(3, 0);
+ this.tsToolkitInformation.Name = "tsToolkitInformation";
+ this.tsToolkitInformation.Size = new System.Drawing.Size(434, 25);
+ this.tsToolkitInformation.TabIndex = 0;
+ //
+ // tsbtnToolkitGeneralInformation
+ //
+ this.tsbtnToolkitGeneralInformation.Checked = true;
+ this.tsbtnToolkitGeneralInformation.CheckOnClick = true;
+ this.tsbtnToolkitGeneralInformation.CheckState = System.Windows.Forms.CheckState.Checked;
+ this.tsbtnToolkitGeneralInformation.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.tsbtnToolkitGeneralInformation.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tsbtnToolkitGeneralInformation.Name = "tsbtnToolkitGeneralInformation";
+ this.tsbtnToolkitGeneralInformation.Size = new System.Drawing.Size(117, 22);
+ this.tsbtnToolkitGeneralInformation.Text = "General Information";
+ this.tsbtnToolkitGeneralInformation.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
+ this.tsbtnToolkitGeneralInformation.Click += new System.EventHandler(this.tsbtnToolkitGeneralInformation_Click);
+ //
+ // tssDiscord
+ //
+ this.tssDiscord.Name = "tssDiscord";
+ this.tssDiscord.Size = new System.Drawing.Size(6, 25);
+ //
+ // tsbtnDiscord
+ //
+ this.tsbtnDiscord.CheckOnClick = true;
+ this.tsbtnDiscord.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.tsbtnDiscord.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tsbtnDiscord.Name = "tsbtnDiscord";
+ this.tsbtnDiscord.Size = new System.Drawing.Size(51, 22);
+ this.tsbtnDiscord.Text = "Discord";
+ this.tsbtnDiscord.Click += new System.EventHandler(this.tsbtnDiscord_Click);
+ //
+ // tssDeveloperInformation
+ //
+ this.tssDeveloperInformation.Name = "tssDeveloperInformation";
+ this.tssDeveloperInformation.Size = new System.Drawing.Size(6, 25);
+ //
+ // tsbtnDeveloperInformation
+ //
+ this.tsbtnDeveloperInformation.CheckOnClick = true;
+ this.tsbtnDeveloperInformation.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.tsbtnDeveloperInformation.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tsbtnDeveloperInformation.Name = "tsbtnDeveloperInformation";
+ this.tsbtnDeveloperInformation.Size = new System.Drawing.Size(130, 22);
+ this.tsbtnDeveloperInformation.Text = "Developer Information";
+ this.tsbtnDeveloperInformation.Click += new System.EventHandler(this.tsbtnDeveloperInformation_Click);
+ //
+ // tssVersions
+ //
+ this.tssVersions.Name = "tssVersions";
+ this.tssVersions.Size = new System.Drawing.Size(6, 25);
+ //
+ // tsbtnVersions
+ //
+ this.tsbtnVersions.CheckOnClick = true;
+ this.tsbtnVersions.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.tsbtnVersions.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tsbtnVersions.Name = "tsbtnVersions";
+ this.tsbtnVersions.Size = new System.Drawing.Size(115, 22);
+ this.tsbtnVersions.Text = "Version Information";
+ this.tsbtnVersions.Click += new System.EventHandler(this.tsbtnVersions_Click);
+ //
+ // tsMain
+ //
+ this.tsMain.Dock = System.Windows.Forms.DockStyle.None;
+ this.tsMain.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.tsMain.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
+ this.tsMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.tsbtnGeneralInformation,
+ this.toolStripSeparator1,
+ this.tsbtnDescription,
+ this.toolStripSeparator2,
+ this.tsbtnFileInformation,
+ this.toolStripSeparator3,
+ this.tsbtnTheme,
+ this.tssToolkitInformation,
+ this.tsbtnToolkitInformation});
+ this.tsMain.Location = new System.Drawing.Point(3, 0);
+ this.tsMain.Name = "tsMain";
+ this.tsMain.Size = new System.Drawing.Size(351, 25);
+ this.tsMain.TabIndex = 0;
+ //
+ // tsbtnGeneralInformation
+ //
+ this.tsbtnGeneralInformation.CheckOnClick = true;
+ this.tsbtnGeneralInformation.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.tsbtnGeneralInformation.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tsbtnGeneralInformation.Name = "tsbtnGeneralInformation";
+ this.tsbtnGeneralInformation.Size = new System.Drawing.Size(117, 22);
+ this.tsbtnGeneralInformation.Text = "General Information";
+ this.tsbtnGeneralInformation.Click += new System.EventHandler(this.tsbtnGeneralInformation_Click);
+ //
+ // toolStripSeparator1
+ //
+ this.toolStripSeparator1.Name = "toolStripSeparator1";
+ this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
+ //
+ // tsbtnDescription
+ //
+ this.tsbtnDescription.CheckOnClick = true;
+ this.tsbtnDescription.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.tsbtnDescription.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tsbtnDescription.Name = "tsbtnDescription";
+ this.tsbtnDescription.Size = new System.Drawing.Size(71, 22);
+ this.tsbtnDescription.Text = "Description";
+ this.tsbtnDescription.Click += new System.EventHandler(this.tsbtnDescription_Click);
+ //
+ // toolStripSeparator2
+ //
+ this.toolStripSeparator2.Name = "toolStripSeparator2";
+ this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25);
+ //
+ // tsbtnFileInformation
+ //
+ this.tsbtnFileInformation.CheckOnClick = true;
+ this.tsbtnFileInformation.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.tsbtnFileInformation.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tsbtnFileInformation.Name = "tsbtnFileInformation";
+ this.tsbtnFileInformation.Size = new System.Drawing.Size(95, 22);
+ this.tsbtnFileInformation.Text = "File Information";
+ this.tsbtnFileInformation.Click += new System.EventHandler(this.tsbtnFileInformation_Click);
+ //
+ // toolStripSeparator3
+ //
+ this.toolStripSeparator3.Name = "toolStripSeparator3";
+ this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25);
+ //
+ // tsbtnTheme
+ //
+ this.tsbtnTheme.CheckOnClick = true;
+ this.tsbtnTheme.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.tsbtnTheme.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tsbtnTheme.Name = "tsbtnTheme";
+ this.tsbtnTheme.Size = new System.Drawing.Size(47, 22);
+ this.tsbtnTheme.Text = "Theme";
+ this.tsbtnTheme.Click += new System.EventHandler(this.tsbtnTheme_Click);
+ //
+ // tssToolkitInformation
+ //
+ this.tssToolkitInformation.Name = "tssToolkitInformation";
+ this.tssToolkitInformation.Size = new System.Drawing.Size(6, 25);
+ this.tssToolkitInformation.Visible = false;
+ //
+ // tsbtnToolkitInformation
+ //
+ this.tsbtnToolkitInformation.CheckOnClick = true;
+ this.tsbtnToolkitInformation.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.tsbtnToolkitInformation.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tsbtnToolkitInformation.Name = "tsbtnToolkitInformation";
+ this.tsbtnToolkitInformation.Size = new System.Drawing.Size(112, 22);
+ this.tsbtnToolkitInformation.Text = "Toolkit Information";
+ this.tsbtnToolkitInformation.Visible = false;
+ this.tsbtnToolkitInformation.Click += new System.EventHandler(this.tsbtnToolkitInformation_Click);
+ //
+ // VisualAboutBoxForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(804, 454);
+ this.Controls.Add(this.kpnlMain);
+ this.Controls.Add(this.kpnlButtons);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+ this.FormTitleAlign = Krypton.Toolkit.PaletteRelativeAlign.Inherit;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualAboutBoxForm";
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit();
+ this.kpnlButtons.ResumeLayout(false);
+ this.kpnlButtons.PerformLayout();
+ this.tableLayoutPanel1.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).EndInit();
+ this.kpnlMain.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.khgMain.Panel)).EndInit();
+ this.khgMain.Panel.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.khgMain)).EndInit();
+ this.khgMain.ResumeLayout(false);
+ this.tscMain.ContentPanel.ResumeLayout(false);
+ this.tscMain.TopToolStripPanel.ResumeLayout(false);
+ this.tscMain.TopToolStripPanel.PerformLayout();
+ this.tscMain.ResumeLayout(false);
+ this.tscMain.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlGeneralInformation)).EndInit();
+ this.kpnlGeneralInformation.ResumeLayout(false);
+ this.tlpnlGeneralInformation.ResumeLayout(false);
+ this.tlpnlGeneralInformation.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxImage)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlDescription)).EndInit();
+ this.kpnlDescription.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlFileInformation)).EndInit();
+ this.kpnlFileInformation.ResumeLayout(false);
+ this.tscFileInformation.ContentPanel.ResumeLayout(false);
+ this.tscFileInformation.TopToolStripPanel.ResumeLayout(false);
+ this.tscFileInformation.TopToolStripPanel.PerformLayout();
+ this.tscFileInformation.ResumeLayout(false);
+ this.tscFileInformation.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlApplication)).EndInit();
+ this.kpnlApplication.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.kdgvApplication)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlAssemblies)).EndInit();
+ this.kpnlAssemblies.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.kdgvAssemblies)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlAssemblyDetails)).EndInit();
+ this.kpnlAssemblyDetails.ResumeLayout(false);
+ this.tsFileInformation.ResumeLayout(false);
+ this.tsFileInformation.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlTheme)).EndInit();
+ this.kpnlTheme.ResumeLayout(false);
+ this.tlpTheme.ResumeLayout(false);
+ this.tlpTheme.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonThemeComboBox1)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlToolkitInformation)).EndInit();
+ this.kpnlToolkitInformation.ResumeLayout(false);
+ this.tscToolkitInformation.ContentPanel.ResumeLayout(false);
+ this.tscToolkitInformation.TopToolStripPanel.ResumeLayout(false);
+ this.tscToolkitInformation.TopToolStripPanel.PerformLayout();
+ this.tscToolkitInformation.ResumeLayout(false);
+ this.tscToolkitInformation.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlToolkitGeneralInformation)).EndInit();
+ this.kpnlToolkitGeneralInformation.ResumeLayout(false);
+ this.tlpGeneralInformation.ResumeLayout(false);
+ this.tlpGeneralInformation.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pbxLogo)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.ktcmbCurrentTheme)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlDiscord)).EndInit();
+ this.kpnlDiscord.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlDeveloperInformation)).EndInit();
+ this.kpnlDeveloperInformation.ResumeLayout(false);
+ this.tlpDeveloperInformation.ResumeLayout(false);
+ this.tlpDeveloperInformation.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlVersions)).EndInit();
+ this.kpnlVersions.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.kdgvVersions)).EndInit();
+ this.tsToolkitInformation.ResumeLayout(false);
+ this.tsToolkitInformation.PerformLayout();
+ this.tsMain.ResumeLayout(false);
+ this.tsMain.PerformLayout();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonPanel kpnlButtons;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private TableLayoutPanel tableLayoutPanel1;
+ private KryptonButton kbtnOk;
+ private KryptonButton kbtnSystemInformation;
+ private KryptonPanel kpnlMain;
+ private KryptonHeaderGroup khgMain;
+ private ToolStripContainer tscMain;
+ private ToolStrip tsMain;
+ private ToolStripButton tsbtnGeneralInformation;
+ private ToolStripSeparator toolStripSeparator1;
+ private ToolStripButton tsbtnDescription;
+ private ToolStripSeparator toolStripSeparator2;
+ private ToolStripButton tsbtnFileInformation;
+ private ToolStripSeparator toolStripSeparator3;
+ private ToolStripButton tsbtnTheme;
+ private KryptonPanel kpnlTheme;
+ private TableLayoutPanel tlpTheme;
+ private KryptonThemeComboBox kryptonThemeComboBox1;
+ private KryptonWrapLabel kwlCurrentTheme;
+ private KryptonPanel kpnlFileInformation;
+ private ToolStripContainer tscFileInformation;
+ private ToolStrip tsFileInformation;
+ private ToolStripButton tsbtnApplicationDetails;
+ private ToolStripSeparator tssAssembliesDetails;
+ private ToolStripButton tsbtnAssembliesDetails;
+ private ToolStripSeparator tssAssemblyDetails;
+ private ToolStripButton tsbtnAssemblyDetails;
+ private KryptonPanel kpnlAssemblyDetails;
+ private InternalAssemblyDetails kiadAssemblyDetails;
+ private KryptonPanel kpnlAssemblies;
+ private KryptonDataGridView kdgvAssemblies;
+ private KryptonPanel kpnlApplication;
+ private KryptonDataGridView kdgvApplication;
+ private KryptonPanel kpnlDescription;
+ private KryptonRichTextBox krtbDescription;
+ private KryptonPanel kpnlGeneralInformation;
+ private TableLayoutPanel tlpnlGeneralInformation;
+ private PictureBox pbxImage;
+ private KryptonWrapLabel kwlVersionLabel;
+ private KryptonWrapLabel kwlBuiltOn;
+ private KryptonWrapLabel kwlCopyright;
+ private KryptonWrapLabel kryptonWrapLabel5;
+ private DataGridViewTextBoxColumn clmnApplicationKey;
+ private DataGridViewTextBoxColumn clmnValue;
+ private DataGridViewTextBoxColumn clmnAssembly;
+ private DataGridViewTextBoxColumn clmnVersion;
+ private DataGridViewTextBoxColumn clmnBuiltOn;
+ private DataGridViewTextBoxColumn clmnCodeBase;
+ private ToolStripSeparator tssToolkitInformation;
+ private ToolStripButton tsbtnToolkitInformation;
+ private KryptonPanel kpnlToolkitInformation;
+ private ToolStripContainer tscToolkitInformation;
+ private KryptonPanel kpnlToolkitGeneralInformation;
+ private TableLayoutPanel tlpGeneralInformation;
+ private PictureBox pbxLogo;
+ private KryptonLinkWrapLabel klwlblGeneralInformation;
+ private KryptonLabel klblCurrentTheme;
+ private KryptonThemeComboBox ktcmbCurrentTheme;
+ private KryptonLabel klblBuiltOn;
+ private KryptonPanel kpnlDiscord;
+ private KryptonLinkWrapLabel klwlblDiscord;
+ private KryptonPanel kpnlDeveloperInformation;
+ private TableLayoutPanel tlpDeveloperInformation;
+ private KryptonLinkWrapLabel klwlblRepositories;
+ private KryptonLinkWrapLabel klwlblDocumentation;
+ private KryptonLinkWrapLabel klwlblDemos;
+ private KryptonPanel kpnlVersions;
+ private KryptonDataGridView kdgvVersions;
+ private ToolStrip tsToolkitInformation;
+ private ToolStripButton tsbtnToolkitGeneralInformation;
+ private ToolStripSeparator tssDiscord;
+ private ToolStripButton tsbtnDiscord;
+ private ToolStripSeparator tssDeveloperInformation;
+ private ToolStripButton tsbtnDeveloperInformation;
+ private ToolStripSeparator tssVersions;
+ private ToolStripButton tsbtnVersions;
+ private DataGridViewTextBoxColumn clmnFileName;
+ private DataGridViewTextBoxColumn clmnFileVersion;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualAboutBoxForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualAboutBoxForm.cs
new file mode 100644
index 000000000..db2c85a11
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualAboutBoxForm.cs
@@ -0,0 +1,625 @@
+#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. 2023 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualAboutBoxForm : KryptonForm
+ {
+ #region Instance Fields
+
+ private readonly bool _showToolkitButton;
+
+ private readonly KryptonAboutBoxData _aboutBoxData;
+
+ private readonly KryptonAboutToolkitData _aboutToolkitData;
+
+ #endregion
+
+ #region Identity
+
+ public VisualAboutBoxForm(KryptonAboutBoxData aboutBoxData)
+ {
+ InitializeComponent();
+
+ _aboutBoxData = aboutBoxData;
+
+ Startup(_aboutBoxData);
+
+ kbtnOk.Text = KryptonManager.Strings.GeneralStrings.OK;
+
+ kbtnSystemInformation.Text = KryptonManager.Strings.CustomStrings.SystemInformation;
+ }
+
+ public VisualAboutBoxForm(KryptonAboutBoxData aboutBoxData, KryptonAboutToolkitData aboutToolkitData)
+ {
+ InitializeComponent();
+
+ _showToolkitButton = aboutBoxData.ShowToolkitInformation ?? false;
+
+ _aboutBoxData = aboutBoxData;
+
+ _aboutToolkitData = aboutToolkitData;
+
+ Startup(_showToolkitButton, _aboutBoxData, _aboutToolkitData);
+
+ kbtnOk.Text = KryptonManager.Strings.GeneralStrings.OK;
+
+ kbtnSystemInformation.Text = KryptonManager.Strings.CustomStrings.SystemInformation;
+ }
+
+ #endregion
+
+ #region Implementation
+
+ #region Basic Functionallity
+
+ private void Startup(KryptonAboutBoxData aboutBoxData)
+ {
+ khgMain.ValuesPrimary.Image =
+ aboutBoxData.HeaderImage ?? GenericImageResources.InformationSmall;
+
+ khgMain.ValuesPrimary.Heading =
+ $@"{KryptonManager.Strings.AboutBoxStrings.About} {aboutBoxData.ApplicationName}";
+
+ pbxImage.Image = aboutBoxData.MainImage ?? GenericImageResources.InformationMedium;
+
+ kwlCurrentTheme.Text = $@"{KryptonManager.Strings.CustomStrings.CurrentTheme}:";
+
+ // ToDo: Review
+ UpdateVersionLabel($"{KryptonManager.Strings.AboutBoxStrings.Version}: {KryptonAboutBoxUtilities.GetFileVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion}");
+
+ if (aboutBoxData.UseFullBuiltOnDate != null || aboutBoxData.UseFullBuiltOnDate == false)
+ {
+ UpdateBuiltOnLabel($"{KryptonManager.Strings.AboutBoxStrings.BuildDate}: {KryptonAboutBoxUtilities.AssemblyBuildDate(Assembly.GetExecutingAssembly(), true).ToString("F")}");
+ }
+ else
+ {
+ UpdateBuiltOnLabel($"{KryptonManager.Strings.AboutBoxStrings.BuildDate}: {KryptonAboutBoxUtilities.AssemblyBuildDate(Assembly.GetExecutingAssembly(), true)}");
+ }
+
+ UpdateCopyrightLabel($"{KryptonManager.Strings.AboutBoxStrings.Copyright}: {KryptonAboutBoxUtilities.GetFileVersionInfo(Assembly.GetExecutingAssembly().Location).LegalCopyright}");
+
+ UpdateDescription(KryptonAboutBoxUtilities.GetFileVersionInfo(Assembly.GetEntryAssembly()!.Location!).FileDescription!);
+
+ kryptonWrapLabel5.Text = null;
+ }
+
+ private void UpdateDescription(string fileDescription) => krtbDescription.Text = fileDescription;
+
+ private void UpdateCopyrightLabel(string value) => kwlCopyright.Text = value;
+
+ private void UpdateBuiltOnLabel(string value) => kwlBuiltOn.Text = value;
+
+ private void UpdateVersionLabel(string value) => kwlVersionLabel.Text = value;
+
+ private void kbtnOk_Click(object sender, EventArgs e) => Hide();
+
+ private void kbtnSystemInformation_Click(object sender, EventArgs e) => KryptonAboutBoxUtilities.LaunchSystemInformation();
+
+ private void tsbtnGeneralInformation_Click(object sender, EventArgs e) => SwitchAboutBoxPage(AboutBoxPage.GeneralInformation);
+
+ private void tsbtnDescription_Click(object sender, EventArgs e) => SwitchAboutBoxPage(AboutBoxPage.Description);
+
+ private void tsbtnFileInformation_Click(object sender, EventArgs e) => SwitchAboutBoxPage(AboutBoxPage.FileInformation);
+
+ private void tsbtnTheme_Click(object sender, EventArgs e) => SwitchAboutBoxPage(AboutBoxPage.Theme);
+
+ private void tsbtnApplicationDetails_Click(object sender, EventArgs e) => SwitchFileInformationPage(AboutBoxFileInformationPage.Application);
+
+ private void tsbtnAssembliesDetails_Click(object sender, EventArgs e) => SwitchFileInformationPage(AboutBoxFileInformationPage.Assemblies);
+
+ private void tsbtnAssemblyDetails_Click(object sender, EventArgs e) => SwitchFileInformationPage(AboutBoxFileInformationPage.AssemblyDetails);
+
+ private void SwitchFileInformationPage(AboutBoxFileInformationPage page)
+ {
+ switch (page)
+ {
+ case AboutBoxFileInformationPage.Application:
+ tsbtnFileInformation.Checked = true;
+
+ kpnlApplication.Visible = true;
+
+ tsbtnAssembliesDetails.Checked = false;
+
+ kpnlAssemblies.Visible = false;
+
+ tsbtnAssemblyDetails.Checked = false;
+
+ kpnlAssemblyDetails.Visible = false;
+ break;
+ case AboutBoxFileInformationPage.Assemblies:
+ tsbtnFileInformation.Checked = false;
+
+ kpnlApplication.Visible = false;
+
+ tsbtnAssembliesDetails.Checked = true;
+
+ kpnlAssemblies.Visible = true;
+
+ tsbtnAssemblyDetails.Checked = false;
+
+ kpnlAssemblyDetails.Visible = false;
+ break;
+ case AboutBoxFileInformationPage.AssemblyDetails:
+ tsbtnFileInformation.Checked = false;
+
+ kpnlApplication.Visible = false;
+
+ tsbtnAssembliesDetails.Checked = false;
+
+ kpnlAssemblies.Visible = false;
+
+ tsbtnAssemblyDetails.Checked = true;
+
+ kpnlAssemblyDetails.Visible = true;
+ break;
+ default:
+ throw new ArgumentOutOfRangeException(nameof(page), page, null);
+ }
+ }
+
+ private void SwitchAboutBoxPage(AboutBoxPage page)
+ {
+ switch (page)
+ {
+ case AboutBoxPage.GeneralInformation:
+ tsbtnGeneralInformation.Checked = true;
+
+ kpnlGeneralInformation.Visible = true;
+
+ tsbtnDescription.Checked = false;
+
+ kpnlDescription.Visible = false;
+
+ tsbtnFileInformation.Checked = false;
+
+ kpnlFileInformation.Visible = false;
+
+ tsbtnTheme.Checked = false;
+
+ kpnlTheme.Visible = false;
+
+ tsbtnToolkitInformation.Checked = false;
+
+ kpnlToolkitInformation.Visible = false;
+ break;
+ case AboutBoxPage.Description:
+ tsbtnGeneralInformation.Checked = false;
+
+ kpnlGeneralInformation.Visible = false;
+
+ tsbtnDescription.Checked = true;
+
+ kpnlDescription.Visible = true;
+
+ tsbtnFileInformation.Checked = false;
+
+ kpnlFileInformation.Visible = false;
+
+ tsbtnTheme.Checked = false;
+
+ kpnlTheme.Visible = false;
+
+ tsbtnToolkitInformation.Checked = false;
+
+ kpnlToolkitInformation.Visible = false;
+ break;
+ case AboutBoxPage.FileInformation:
+ tsbtnGeneralInformation.Checked = false;
+
+ kpnlGeneralInformation.Visible = false;
+
+ tsbtnDescription.Checked = false;
+
+ kpnlDescription.Visible = false;
+
+ tsbtnFileInformation.Checked = true;
+
+ kpnlFileInformation.Visible = true;
+
+ tsbtnTheme.Checked = false;
+
+ kpnlTheme.Visible = false;
+
+ tsbtnToolkitInformation.Checked = false;
+
+ kpnlToolkitInformation.Visible = false;
+ break;
+ case AboutBoxPage.Theme:
+ tsbtnGeneralInformation.Checked = false;
+
+ kpnlGeneralInformation.Visible = false;
+
+ tsbtnDescription.Checked = false;
+
+ kpnlDescription.Visible = false;
+
+ tsbtnFileInformation.Checked = false;
+
+ kpnlFileInformation.Visible = false;
+
+ tsbtnTheme.Checked = true;
+
+ kpnlTheme.Visible = true;
+
+ tsbtnToolkitInformation.Checked = false;
+
+ kpnlToolkitInformation.Visible = false;
+ break;
+ case AboutBoxPage.ToolkitInformation:
+ tsbtnGeneralInformation.Checked = false;
+
+ kpnlGeneralInformation.Visible = false;
+
+ tsbtnDescription.Checked = false;
+
+ kpnlDescription.Visible = false;
+
+ tsbtnFileInformation.Checked = false;
+
+ kpnlFileInformation.Visible = false;
+
+ tsbtnTheme.Checked = false;
+
+ kpnlTheme.Visible = false;
+
+ tsbtnToolkitInformation.Checked = true;
+
+ kpnlToolkitInformation.Visible = true;
+ break;
+ default:
+ throw new ArgumentOutOfRangeException(nameof(page), page, null);
+ }
+ }
+
+
+ #endregion
+
+ #region Toolkit Information
+
+ private void Startup(bool showToolkitButton, KryptonAboutBoxData aboutBoxData, KryptonAboutToolkitData aboutToolkitData)
+ {
+ UpdateShowToolkitButtonUI(showToolkitButton);
+
+ #region Basic Details
+
+ khgMain.ValuesPrimary.Image =
+ aboutBoxData.HeaderImage ?? GenericImageResources.InformationSmall;
+
+ khgMain.ValuesPrimary.Heading =
+ $@"{KryptonManager.Strings.AboutBoxStrings.About} {aboutBoxData.ApplicationName}";
+
+ pbxImage.Image = aboutBoxData.MainImage ?? GenericImageResources.InformationMedium;
+
+ kwlCurrentTheme.Text = $@"{KryptonManager.Strings.CustomStrings.CurrentTheme}:";
+
+ // ToDo: Review
+ UpdateVersionLabel($"{KryptonManager.Strings.AboutBoxStrings.Version}: {KryptonAboutBoxUtilities.GetFileVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion}");
+
+ if (aboutBoxData.UseFullBuiltOnDate != null || aboutBoxData.UseFullBuiltOnDate == false)
+ {
+ UpdateBuiltOnLabel($"{KryptonManager.Strings.AboutBoxStrings.BuildDate}: {KryptonAboutBoxUtilities.AssemblyBuildDate(Assembly.GetExecutingAssembly(), true).ToString("F")}");
+ }
+ else
+ {
+ UpdateBuiltOnLabel($"{KryptonManager.Strings.AboutBoxStrings.BuildDate}: {KryptonAboutBoxUtilities.AssemblyBuildDate(Assembly.GetExecutingAssembly(), true)}");
+ }
+
+ UpdateCopyrightLabel($"{KryptonManager.Strings.AboutBoxStrings.Copyright}: {KryptonAboutBoxUtilities.GetFileVersionInfo(Assembly.GetExecutingAssembly().Location).LegalCopyright}");
+
+ UpdateDescription(KryptonAboutBoxUtilities.GetFileVersionInfo(Assembly.GetEntryAssembly()!.Location).FileDescription!);
+
+ kryptonWrapLabel5.Text = null;
+
+ #endregion
+
+ #region Toolkit Details
+
+ // Adjust UI elements
+ ShowDeveloperControls(aboutToolkitData.ShowDeveloperInformationButton);
+
+ ShowDiscordControls(aboutToolkitData.ShowDiscordButton);
+
+ ShowVersionControls(aboutToolkitData.ShowVersionInformationButton);
+
+ ShowThemeControls(aboutToolkitData.ShowThemeOptions);
+
+ ShowBuildDateLabel(aboutToolkitData.ShowBuildDate);
+
+ UpdateBuiltOnText(string.Empty);
+
+ // ToDo: Figure out why this does not work
+ // UpdateBuiltOnText($@"{aboutToolkitData.BuildOnText}: {KryptonAboutBoxUtilities.AssemblyBuildDate(Assembly.LoadFile($@"{Application.ExecutablePath}\Krypton.Toolkit.dll"), false)}");
+
+ UpdateCurrentThemeText($@"{aboutToolkitData.CurrentThemeText}:");
+
+ ShowSystemInformationButton(aboutToolkitData.ShowSystemInformationButton);
+
+ SwitchIcon(aboutToolkitData.ToolkitType);
+
+ ConcatanateGeneralInformationText(aboutToolkitData.GeneralInformationWelcomeText, aboutToolkitData.GeneralInformationLicenseText, aboutToolkitData.GeneralInformationLearnMoreText);
+
+ UpdateDiscordText(aboutToolkitData.DiscordText);
+
+ UpdateRepositoriesText(aboutToolkitData.RepositoryInformationText);
+
+ UpdateDemosText(aboutToolkitData.DownloadDemosText);
+
+ UpdateDocumentationText(aboutToolkitData.DownloadDocumentationText);
+
+ UpdateColumnHeadings(aboutToolkitData.FileNameColumnHeaderText, aboutToolkitData.VersionColumnHeaderText);
+
+ UpdateToolBarText(aboutToolkitData.ToolBarGeneralInformationText, aboutToolkitData.ToolBarDiscordText, aboutToolkitData.ToolBarDeveloperInformationText, aboutToolkitData.ToolBarVersionInformationText);
+
+ UpdateGeneralInformationLinkArea(aboutToolkitData.LearnMoreLinkArea);
+
+ UpdateDocumentationLinkArea(aboutToolkitData.DocumentationLinkArea);
+
+ UpdateDiscordLinkArea(aboutToolkitData.DiscordLinkArea);
+
+ UpdateDemosLinkArea(aboutToolkitData.DownloadDemosLinkArea);
+
+ UpdateRepositoriesLinkArea(aboutToolkitData.RepositoryInformationLinkArea);
+
+ GetReferenceAssemblyInformation();
+
+ #endregion
+ }
+
+ private void UpdateShowToolkitButtonUI(bool showToolkitButton)
+ {
+ tssToolkitInformation.Visible = showToolkitButton;
+
+ tsbtnToolkitInformation.Visible = showToolkitButton;
+ }
+
+ private void UpdateCurrentThemeText(string value) => klblCurrentTheme.Text = value;
+
+ private void UpdateToolBarText(string toolBarGeneralInformationText, string toolBarDiscordText, string toolBarDeveloperInformationText, string toolBarVersionInformationText)
+ {
+ tsbtnGeneralInformation.Text = toolBarGeneralInformationText;
+
+ tsbtnDiscord.Text = toolBarDiscordText;
+
+ tsbtnDeveloperInformation.Text = toolBarDeveloperInformationText;
+
+ tsbtnVersions.Text = toolBarVersionInformationText;
+ }
+
+ private void ShowBuildDateLabel(bool value)
+ {
+ klblBuiltOn.Visible = value;
+
+ if (!value)
+ {
+ klblBuiltOn.Text = null;
+ }
+ }
+
+ private void ShowDeveloperControls(bool value)
+ {
+ tssDeveloperInformation.Visible = value;
+
+ tsbtnDeveloperInformation.Visible = value;
+ }
+
+ private void ShowDiscordControls(bool value)
+ {
+ tssDiscord.Visible = value;
+
+ tsbtnDiscord.Visible = value;
+ }
+
+ private void ShowVersionControls(bool value)
+ {
+ tsbtnVersions.Visible = value;
+
+ tssVersions.Visible = value;
+ }
+
+ private void ShowThemeControls(bool value)
+ {
+ klblCurrentTheme.Visible = value;
+
+ ktcmbCurrentTheme.Visible = value;
+
+ SetLogoSpan(value);
+ }
+
+ private void SwitchIcon(ToolkitType value)
+ {
+ switch (value)
+ {
+ case ToolkitType.Canary:
+ pbxLogo.Image = ToolkitLogoImageResources.Krypton_Canary;
+ break;
+ case ToolkitType.Nightly:
+ pbxLogo.Image = ToolkitLogoImageResources.Krypton_Nightly;
+ break;
+ case ToolkitType.Stable:
+ pbxLogo.Image = ToolkitLogoImageResources.Krypton_Stable;
+ break;
+ default:
+ throw new ArgumentOutOfRangeException(nameof(value), value, null);
+ }
+ }
+
+ private void UpdateBuiltOnText(string value) => klblBuiltOn.Text = value;
+
+ private void ConcatanateGeneralInformationText(string welcomeText, string licenseText, string learnMoreText)
+ {
+ // Note: Do not use verbatim string!
+ string output = $"{welcomeText}\r\n\r\n{licenseText}: BSD-3-Clause\r\n\r\n{learnMoreText}";
+
+ klwlblGeneralInformation.Text = output;
+ }
+
+ private void UpdateDiscordText(string value) => klwlblDiscord.Text = value;
+
+ private void UpdateRepositoriesText(string value) => klwlblRepositories.Text = value;
+
+ private void UpdateDocumentationText(string value) => klwlblDocumentation.Text = value;
+
+ private void UpdateDemosText(string value) => klwlblDemos.Text = value;
+
+ private void UpdateColumnHeadings(string fileName, string version)
+ {
+ kdgvVersions.Columns[0].HeaderText = fileName;
+
+ kdgvVersions.Columns[1].HeaderText = version;
+ }
+
+ private void UpdateGeneralInformationLinkArea(LinkArea linkArea) => klwlblGeneralInformation.LinkArea = linkArea;
+
+ private void UpdateDiscordLinkArea(LinkArea linkArea) => klwlblDiscord.LinkArea = linkArea;
+
+ private void UpdateRepositoriesLinkArea(LinkArea linkArea) => klwlblRepositories.LinkArea = linkArea;
+
+ private void UpdateDemosLinkArea(LinkArea linkArea) => klwlblDemos.LinkArea = linkArea;
+
+ private void UpdateDocumentationLinkArea(LinkArea linkArea) => klwlblDocumentation.LinkArea = linkArea;
+
+ private void SetLogoSpan(bool value)
+ {
+ if (value)
+ {
+ tlpGeneralInformation.SetRowSpan(pbxLogo, 3);
+ }
+ else
+ {
+ klblCurrentTheme.Text = null;
+
+ ktcmbCurrentTheme.Visible = false;
+
+ tlpGeneralInformation.SetRowSpan(pbxLogo, 1);
+ }
+ }
+
+ private void SwitchToolkitInformationPage(AboutToolkitPage page)
+ {
+ switch (page)
+ {
+ case AboutToolkitPage.GeneralInformation:
+ kpnlToolkitGeneralInformation.Visible = true;
+
+ kpnlDiscord.Visible = false;
+
+ kpnlDeveloperInformation.Visible = false;
+
+ kpnlVersions.Visible = false;
+
+ tsbtnToolkitGeneralInformation.Checked = true;
+
+ tsbtnDiscord.Checked = false;
+
+ tsbtnDeveloperInformation.Checked = false;
+
+ tsbtnVersions.Checked = false;
+ break;
+ case AboutToolkitPage.Discord:
+ kpnlToolkitGeneralInformation.Visible = false;
+
+ kpnlDiscord.Visible = true;
+
+ kpnlDeveloperInformation.Visible = false;
+
+ kpnlVersions.Visible = false;
+
+ tsbtnToolkitGeneralInformation.Checked = false;
+
+ tsbtnDiscord.Checked = true;
+
+ tsbtnDeveloperInformation.Checked = false;
+
+ tsbtnVersions.Checked = false;
+ break;
+ case AboutToolkitPage.DeveloperInformation:
+ kpnlToolkitGeneralInformation.Visible = false;
+
+ kpnlDiscord.Visible = false;
+
+ kpnlDeveloperInformation.Visible = true;
+
+ kpnlVersions.Visible = false;
+
+ tsbtnToolkitGeneralInformation.Checked = false;
+
+ tsbtnDiscord.Checked = false;
+
+ tsbtnDeveloperInformation.Checked = true;
+
+ tsbtnVersions.Checked = false;
+ break;
+ case AboutToolkitPage.Versions:
+ kpnlToolkitGeneralInformation.Visible = false;
+
+ kpnlDiscord.Visible = false;
+
+ kpnlDeveloperInformation.Visible = false;
+
+ kpnlVersions.Visible = true;
+
+ tsbtnToolkitGeneralInformation.Checked = false;
+
+ tsbtnDiscord.Checked = false;
+
+ tsbtnDeveloperInformation.Checked = false;
+
+ tsbtnVersions.Checked = true;
+ break;
+ default:
+ throw new ArgumentOutOfRangeException(nameof(page), page, null);
+ }
+ }
+
+ private void GetReferenceAssemblyInformation()
+ {
+ // Get the current assembly
+ Assembly currentAssembly = Assembly.GetExecutingAssembly();
+
+ // Place reference assemblies into an array
+ // Note: Can we use `FileVersionInfo`?
+ AssemblyName[] satelliteAssemblies = currentAssembly.GetReferencedAssemblies();
+
+ foreach (AssemblyName assembly in satelliteAssemblies)
+ {
+ //FileVersionInfo fileInfo = FileVersionInfo.GetVersionInfo(file);
+
+ // Fill data grid view
+ kdgvVersions.Rows.Add(assembly.Name!, assembly.Version!.ToString());
+ }
+ }
+
+ private void ShowSystemInformationButton(bool? value) => kbtnSystemInformation.Visible = value ?? true;
+
+ private void tsbtnToolkitInformation_Click(object sender, EventArgs e) => SwitchAboutBoxPage(AboutBoxPage.ToolkitInformation);
+
+ private void tsbtnToolkitGeneralInformation_Click(object sender, EventArgs e) => SwitchToolkitInformationPage(AboutToolkitPage.GeneralInformation);
+
+ private void tsbtnDiscord_Click(object sender, EventArgs e) => SwitchToolkitInformationPage(AboutToolkitPage.Discord);
+
+ private void tsbtnDeveloperInformation_Click(object sender, EventArgs e) => SwitchToolkitInformationPage(AboutToolkitPage.DeveloperInformation);
+
+ private void tsbtnVersions_Click(object sender, EventArgs e) => SwitchToolkitInformationPage(AboutToolkitPage.Versions);
+
+ private void klwlblGeneralInformation_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) => GlobalToolkitUtilities.LaunchProcess(@"https://github.com/Krypton-Suite/Standard-Toolkit");
+
+ private void klwlblDiscord_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) => GlobalToolkitUtilities.LaunchProcess(@"https://discord.gg/CRjF6fY");
+
+ private void klwlblRepositories_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) => GlobalToolkitUtilities.LaunchProcess(@"https://github.com/orgs/Krypton-Suite/repositories");
+
+ private void klwlblDocumentation_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) => GlobalToolkitUtilities.LaunchProcess(@"https://github.com/Krypton-Suite/Help-Files/releases");
+
+ private void klwlblDemos_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) => GlobalToolkitUtilities.LaunchProcess(@"https://github.com/Krypton-Suite/Standard-Toolkit-Demos/releases");
+
+ #endregion
+
+ #endregion
+ }
+}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualAboutBoxForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualAboutBoxForm.resx
new file mode 100644
index 000000000..0d38a1f39
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualAboutBoxForm.resx
@@ -0,0 +1,153 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ True
+
+
+ True
+
+
+ True
+
+
+ True
+
+
+ True
+
+
+ True
+
+
+ 107, 17
+
+
+ True
+
+
+ True
+
+
+ 251, 17
+
+
+ 17, 17
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualBlur.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualBlur.cs
index 8d0c88796..4d7b1c8ac 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualBlur.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualBlur.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualContainerControl.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualContainerControl.cs
index bac04ffe0..7377d14cf 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualContainerControl.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualContainerControl.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -17,7 +17,7 @@ namespace Krypton.Toolkit
///
[ToolboxItem(false)]
[DesignerCategory(@"code")]
- public abstract class VisualContainerControl : VisualContainerControlBase,
+ public abstract class VisualContainerControl : VisualContainerControlBase,
ISupportInitializeNotification
{
#region Events
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualContainerControlBase.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualContainerControlBase.cs
index e06ea6b51..1b59e4edd 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualContainerControlBase.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualContainerControlBase.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -149,12 +149,12 @@ protected override void Dispose(bool disposing)
SystemEvents.UserPreferenceChanged -= OnUserPreferenceChanged;
// Dispose of view manager related resources
- ViewManager.Dispose();
+ ViewManager?.Dispose();
_palette = null;
- Renderer = null;
+ Renderer = null!;
_localPalette = null;
- Redirector.Target = null;
+ Redirector.Target = null!;
}
base.Dispose(disposing);
@@ -255,7 +255,7 @@ public void CheckPerformLayout(bool viewLayout)
_layoutDirty = false;
// Ask the view to perform a layout
- ViewManager.Layout(Renderer);
+ ViewManager?.Layout(Renderer);
} while (_layoutDirty && (max-- > 0));
}
@@ -326,7 +326,7 @@ public PaletteBase? Palette
if (_localPalette != value)
{
// Remember the starting palette
- PaletteBase old = _localPalette;
+ PaletteBase? old = _localPalette;
// Use the provided palette value
SetPalette(value);
@@ -372,7 +372,7 @@ public PaletteBase? Palette
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Advanced)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public IRenderer? Renderer
+ public IRenderer Renderer
{
[DebuggerStepThrough]
get;
@@ -384,7 +384,7 @@ public IRenderer? Renderer
///
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Advanced)]
- public ToolStripRenderer CreateToolStripRenderer() => Renderer.RenderToolStrip(GetResolvedPalette());
+ public ToolStripRenderer? CreateToolStripRenderer() => Renderer.RenderToolStrip(GetResolvedPalette());
///
/// Gets or sets the background image displayed in the control.
@@ -420,7 +420,7 @@ public override ImageLayout BackgroundImageLayout
///
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
- public PaletteBase? GetResolvedPalette() => _palette;
+ public PaletteBase GetResolvedPalette() => _palette!;
///
/// Gets and sets the dirty palette counter.
@@ -437,7 +437,7 @@ public override ImageLayout BackgroundImageLayout
/// Reset the internal counters.
///
[EditorBrowsable(EditorBrowsableState.Never)]
- public void KryptonResetCounters() => ViewManager.ResetCounters();
+ public void KryptonResetCounters() => ViewManager?.ResetCounters();
///
/// Gets the number of layout cycles performed since last reset.
@@ -445,7 +445,7 @@ public override ImageLayout BackgroundImageLayout
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public int KryptonLayoutCounter => ViewManager.LayoutCounter;
+ public int KryptonLayoutCounter => ViewManager!.LayoutCounter;
///
/// Gets the number of paint cycles performed since last reset.
@@ -453,7 +453,7 @@ public override ImageLayout BackgroundImageLayout
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public int KryptonPaintCounter => ViewManager.PaintCounter;
+ public int KryptonPaintCounter => ViewManager!.PaintCounter;
#endregion
@@ -471,7 +471,7 @@ protected ViewManager? ViewManager
///
/// Gets access to the palette redirector.
///
- protected PaletteRedirect? Redirector
+ protected PaletteRedirect Redirector
{
[DebuggerStepThrough]
get;
@@ -500,7 +500,7 @@ protected bool ForceViewLayout()
if (ViewManager != null)
{
// Ask the view to perform a layout
- ViewManager.Layout(Renderer);
+ ViewManager?.Layout(Renderer);
return true;
}
@@ -575,7 +575,7 @@ protected bool CanProcessMnemonic()
}
// Move up one level
- c = c.Parent;
+ c = c.Parent!;
}
// Evert control in chain is visible and enabled, so allow mnemonics
@@ -609,7 +609,7 @@ protected virtual bool EvalTransparentPaint() =>
/// Source of notification.
/// An EventArgs containing event data.
///
- protected virtual void OnButtonSpecChanged(object sender, [DisallowNull] EventArgs e)
+ protected virtual void OnButtonSpecChanged(object? sender, [DisallowNull] EventArgs e)
{
Debug.Assert(e != null);
@@ -627,7 +627,10 @@ protected virtual void OnButtonSpecChanged(object sender, [DisallowNull] EventAr
protected virtual void OnPaletteChanged(EventArgs e)
{
// Update the redirector with latest palette
- Redirector.Target = _palette;
+ if (Redirector != null)
+ {
+ Redirector.Target = _palette!;
+ }
// Need to recalculate anything relying on the palette
DirtyPaletteCounter++;
@@ -643,7 +646,7 @@ protected virtual void OnPaletteChanged(EventArgs e)
///
/// Source of notification.
/// An NeedLayoutEventArgs containing event data.
- protected virtual void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e)
+ protected virtual void OnPaletteNeedPaint(object? sender, NeedLayoutEventArgs e)
{
// Need to recalculate anything relying on the palette
DirtyPaletteCounter++;
@@ -707,7 +710,7 @@ protected virtual void OnNeedPaint(object? sender, [DisallowNull] NeedLayoutEven
/// Create the redirector instance.
///
/// PaletteRedirect derived class.
- protected virtual PaletteRedirect? CreateRedirector() => new PaletteRedirect(_palette);
+ protected virtual PaletteRedirect CreateRedirector() => new PaletteRedirect(_palette!);
// ReSharper restore VirtualMemberNeverOverridden.Global
#endregion
@@ -721,7 +724,7 @@ protected override void OnRightToLeftChanged(EventArgs e)
// Need to recalculate anything relying on the palette
DirtyPaletteCounter++;
- // Need relayout to reflect change of layout
+ // Need re-layout to reflect change of layout
OnNeedPaint(null, new NeedLayoutEventArgs(true));
base.OnRightToLeftChanged(e);
@@ -748,7 +751,7 @@ protected override void OnLayout(LayoutEventArgs levent)
_layoutDirty = false;
// Ask the view to perform a layout
- ViewManager.Layout(Renderer);
+ ViewManager?.Layout(Renderer);
} while (_layoutDirty && (max-- > 0));
}
@@ -762,7 +765,7 @@ protected override void OnLayout(LayoutEventArgs levent)
/// Raises the Paint event.
///
/// A PaintEventArgs that contains the event data.
- protected override void OnPaint(PaintEventArgs e)
+ protected override void OnPaint(PaintEventArgs? e)
{
// Cannot process a message for a disposed control
if (!IsDisposed && !Disposing)
@@ -795,7 +798,7 @@ protected override void OnPaint(PaintEventArgs e)
// Ask the view to repaint the visual structure
if (!IsDisposed && !Disposing)
{
- ViewManager.Paint(Renderer, e);
+ ViewManager?.Paint(Renderer, e);
}
// Request for a refresh has been serviced
@@ -980,7 +983,7 @@ protected override void OnLostFocus(EventArgs e)
///
/// Source of the event.
/// An EventArgs that contains the event data.
- protected virtual void OnGlobalPaletteChanged(object sender, EventArgs e)
+ protected virtual void OnGlobalPaletteChanged(object? sender, EventArgs e)
{
// We only care if we are using the global palette
if (PaletteMode == PaletteMode.Global)
@@ -988,7 +991,7 @@ protected virtual void OnGlobalPaletteChanged(object sender, EventArgs e)
// Update ourself with the new global palette
_localPalette = null;
SetPalette(KryptonManager.CurrentGlobalPalette);
- Redirector.Target = _palette;
+ Redirector.Target = _palette!;
// Need to recalculate anything relying on the palette
DirtyPaletteCounter++;
@@ -1049,7 +1052,7 @@ protected override void WndProc(ref Message m)
if (ClientRectangle.Contains(mousePt))
{
// Show the context menu
- KryptonContextMenu.Show(this, PointToScreen(mousePt));
+ KryptonContextMenu?.Show(this, PointToScreen(mousePt));
// We eat the message!
return;
@@ -1089,7 +1092,7 @@ private void SetPalette(PaletteBase? palette)
_palette = palette;
// Get the renderer associated with the palette
- Renderer = _palette.GetRenderer();
+ Renderer = _palette?.GetRenderer()!;
// Hook to new palette events
if (_palette != null)
@@ -1102,14 +1105,14 @@ private void SetPalette(PaletteBase? palette)
}
}
- private void OnBaseChanged(object sender, EventArgs e) =>
+ private void OnBaseChanged(object? sender, EventArgs e) =>
// Change in base renderer or base palette require we fetch the latest renderer
- Renderer = _palette.GetRenderer();
+ Renderer = _palette?.GetRenderer()!;
- private void PaintTransparentBackground(PaintEventArgs e)
+ private void PaintTransparentBackground(PaintEventArgs? e)
{
// Get the parent control for transparent drawing purposes
- Control parent = TransparentParent;
+ Control? parent = TransparentParent;
// Do we have a parent control and we need to paint background?
if ((parent != null) && NeedTransparentPaint)
@@ -1121,16 +1124,16 @@ private void PaintTransparentBackground(PaintEventArgs e)
_miPTB = typeof(Control).GetMethod(nameof(PaintTransparentBackground),
BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.InvokeMethod,
null, CallingConventions.HasThis,
- new[] { typeof(PaintEventArgs), typeof(Rectangle), typeof(Region) },
- null);
+ [typeof(PaintEventArgs), typeof(Rectangle), typeof(Region)],
+ null)!;
}
- _miPTB.Invoke(this, new object[] { e, ClientRectangle, null });
+ _miPTB.Invoke(this, [e!, ClientRectangle, null!]);
}
else
{
// Request the background be painted in the system colors
- PaintBackground(e.Graphics, SystemBrushes.Control, ClientRectangle);
+ PaintBackground(e?.Graphics!, SystemBrushes.Control, ClientRectangle);
}
}
@@ -1169,22 +1172,22 @@ private void OnPerformLayout()
BeginInvoke(_refreshCall);
}
- private void OnContextMenuStripOpening(object sender, CancelEventArgs e)
+ private void OnContextMenuStripOpening(object? sender, CancelEventArgs e)
{
// Get the actual strip instance
- ContextMenuStrip cms = base.ContextMenuStrip;
+ ContextMenuStrip? cms = base.ContextMenuStrip;
// Make sure it has the correct renderer
- cms.Renderer = CreateToolStripRenderer();
+ cms!.Renderer = CreateToolStripRenderer();
}
- private void OnKryptonContextMenuDisposed(object sender, EventArgs e) =>
+ private void OnKryptonContextMenuDisposed(object? sender, EventArgs e) =>
// When the current krypton context menu is disposed, we should remove
// it to prevent it being used again, as that would just throw an exception
// because it has been disposed.
KryptonContextMenu = null;
- private void OnContextMenuClosed(object sender, ToolStripDropDownClosedEventArgs e) => ContextMenuClosed();
+ private void OnContextMenuClosed(object? sender, ToolStripDropDownClosedEventArgs e) => ContextMenuClosed();
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualContextMenu.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualContextMenu.cs
index 229f5f1f0..009f66598 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualContextMenu.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualContextMenu.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -72,7 +72,7 @@ public VisualContextMenu(IContextMenuProvider provider,
public VisualContextMenu(KryptonContextMenu contextMenu,
PaletteBase? palette,
PaletteMode paletteMode,
- PaletteRedirect? redirector,
+ PaletteRedirect redirector,
PaletteRedirectContextMenu redirectorImages,
KryptonContextMenuCollection items,
bool enabled,
@@ -92,8 +92,8 @@ public VisualContextMenu(KryptonContextMenu contextMenu,
_viewColumns = new ViewLayoutStack(true);
// Create provider instance
- _provider = new ContextMenuProvider(contextMenu, (ViewContextMenuManager)ViewManager, _viewColumns,
- palette, paletteMode, redirector, redirectorImages,
+ _provider = new ContextMenuProvider(contextMenu, (ViewContextMenuManager)ViewManager, _viewColumns,
+ palette!, paletteMode, redirector, redirectorImages,
NeedPaintDelegate, enabled);
_provider.Closing += OnProviderClosing;
@@ -227,7 +227,7 @@ public void Show(Rectangle screenRect,
{
// Then switch to positioning before
horz = KryptonContextMenuPositionH.Before;
- screenPt.X = screenRect.Left - preferredSize.Width;
+ screenPt.X = screenRect.Left - preferredSize.Width;
}
}
@@ -332,7 +332,7 @@ public KryptonContextMenuPositionV ShowVert
///
/// Gets access to the view manager for the context menu.
///
- public ViewContextMenuManager ViewContextMenuManager => (ViewContextMenuManager)ViewManager;
+ public ViewContextMenuManager? ViewContextMenuManager => ViewManager as ViewContextMenuManager;
///
/// Should a mouse down at the provided point cause it to become the current tracking popup.
@@ -342,7 +342,7 @@ public KryptonContextMenuPositionV ShowVert
/// True to become current; otherwise false.
public override bool DoesStackedClientMouseDownBecomeCurrent(Message m, Point pt) =>
// Ask the manager if the mouse down should make the stacked menu the current one
- ViewContextMenuManager.DoesStackedClientMouseDownBecomeCurrent(m, pt);
+ ViewContextMenuManager!.DoesStackedClientMouseDownBecomeCurrent(m, pt);
#endregion
@@ -350,7 +350,7 @@ public override bool DoesStackedClientMouseDownBecomeCurrent(Message m, Point pt
///
/// Gets access to the palette redirector.
///
- protected PaletteRedirect? Redirector
+ protected PaletteRedirect Redirector
{
[DebuggerStepThrough]
get;
@@ -369,7 +369,7 @@ protected override void OnKeyDown(KeyEventArgs e)
if (e.KeyData == Keys.Escape)
{
// Using the escape key should give a close reason of keyboard
- _provider.ProviderCloseReason = ToolStripDropDownCloseReason.Keyboard;
+ _provider.ProviderCloseReason = ToolStripDropDownCloseReason.Keyboard;
}
}
@@ -388,6 +388,8 @@ protected override void OnLayout(LayoutEventArgs levent)
// Need a render context for accessing the renderer
using var context = new RenderContext(this, null, ClientRectangle, Renderer);
+ using var gh = new GraphicsHint(context.Graphics,
+ _provider.ProviderStateCommon.ControlOuter.Border.GetBorderGraphicsHint(PaletteState.Normal));
// Grab a path that is the outside edge of the border
Rectangle borderRect = ClientRectangle;
GraphicsPath borderPath1 = Renderer.RenderStandardBorder.GetOutsideBorderPath(context, borderRect, _provider.ProviderStateCommon.ControlOuter.Border, VisualOrientation.Top, PaletteState.Normal);
@@ -408,7 +410,7 @@ protected override void OnLayout(LayoutEventArgs levent)
///
/// Source of notification.
/// An NeedLayoutEventArgs containing event data.
- protected virtual void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e) =>
+ protected virtual void OnPaletteNeedPaint(object? sender, NeedLayoutEventArgs e) =>
// Need to recalculate anything relying on the palette
OnNeedPaint(sender, e);
@@ -441,8 +443,8 @@ private void Construct(KryptonContextMenuCollection items,
{
{ layoutDocker, ViewDockStyle.Fill }
};
- _drawDocker.KeyController = new ContextMenuController((ViewContextMenuManager)ViewManager);
- ViewManager.Root = _drawDocker;
+ _drawDocker.KeyController = new ContextMenuController(ViewManager as ViewContextMenuManager);
+ ViewManager!.Root = _drawDocker;
// With keyboard activate we select the first valid item
if (keyboardActivated)
@@ -460,7 +462,7 @@ private Size CalculatePreferredSize()
{
// Find the preferred size which fits exactly the calculated contents size
using var context = new ViewLayoutContext(this, Renderer);
- return ViewManager.Root.GetPreferredSize(context);
+ return ViewManager!.Root.GetPreferredSize(context);
}
finally
{
@@ -469,12 +471,12 @@ private Size CalculatePreferredSize()
}
}
- private void SetPalette(PaletteBase? palette)
+ private void SetPalette(PaletteBase palette)
{
if (palette != _palette)
{
// Unhook from current palette events
- if (_palette != null)
+ if (_palette is not null)
{
_palette.PalettePaint -= OnPaletteNeedPaint;
_palette.BasePaletteChanged -= OnBaseChanged;
@@ -500,21 +502,21 @@ private void SetPalette(PaletteBase? palette)
}
}
- private void OnBaseChanged(object sender, EventArgs e) =>
+ private void OnBaseChanged(object? sender, EventArgs e) =>
// Change in base renderer or base palette require we fetch the latest renderer
- Renderer = _palette.GetRenderer();
+ Renderer = _palette!.GetRenderer();
- private void OnProviderClosing(object sender, CancelEventArgs e) => _contextMenu?.OnClosing(e);
+ private void OnProviderClosing(object? sender, CancelEventArgs e) => _contextMenu?.OnClosing(e);
- private void OnProviderClose(object sender, CloseReasonEventArgs e) => _contextMenu?.Close(e.CloseReason);
+ private void OnProviderClose(object? sender, CloseReasonEventArgs e) => _contextMenu?.Close(e.CloseReason);
- private void OnProviderClose(object sender, EventArgs e)
+ private void OnProviderClose(object? sender, EventArgs e)
{
// Unhook from event source
- var provider = (ContextMenuProvider)sender;
+ var provider = sender as ContextMenuProvider;
_provider.Dispose -= OnProviderClose;
- // Kill this poup window
+ // Kill this pop-up window
Dispose();
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualContextMenuDTP.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualContextMenuDTP.cs
index 8c33d2870..175db85ff 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualContextMenuDTP.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualContextMenuDTP.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -37,13 +37,13 @@ public class VisualContextMenuDTP : VisualContextMenu
public VisualContextMenuDTP(KryptonContextMenu contextMenu,
PaletteBase? palette,
PaletteMode paletteMode,
- PaletteRedirect? redirector,
+ PaletteRedirect redirector,
PaletteRedirectContextMenu redirectorImages,
KryptonContextMenuCollection items,
bool enabled,
bool keyboardActivated,
Rectangle dropScreenRect)
- : base(contextMenu, palette, paletteMode, redirector, redirectorImages,
+ : base(contextMenu, palette, paletteMode, redirector, redirectorImages,
items, enabled, keyboardActivated) =>
_dropScreenRect = dropScreenRect;
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualControl.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualControl.cs
index 693f06e82..7231f4849 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualControl.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualControl.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -17,7 +17,7 @@ namespace Krypton.Toolkit
///
[ToolboxItem(false)]
[DesignerCategory(@"code")]
- public abstract class VisualControl : VisualControlBase,
+ public abstract class VisualControl : VisualControlBase,
ISupportInitializeNotification
{
#region Events
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualControlBase.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualControlBase.cs
index a765e4d93..67624e183 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualControlBase.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualControlBase.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -31,7 +31,7 @@ public abstract class VisualControlBase : Control,
private bool _paintTransparent;
private bool _evalTransparent;
private bool _globalEvents;
- private PaletteBase? _localPalette;
+ private KryptonCustomPaletteBase? _localCustomPalette;
private PaletteBase? _palette;
private PaletteMode _paletteMode;
private readonly SimpleCall _refreshCall;
@@ -108,7 +108,7 @@ protected VisualControlBase()
DirtyPaletteCounter = 1;
// Set the palette and renderer to the defaults as specified by the manager
- _localPalette = null;
+ _localCustomPalette = null;
SetPalette(KryptonManager.CurrentGlobalPalette);
_paletteMode = PaletteMode.Global;
@@ -158,8 +158,8 @@ protected override void Dispose(bool disposing)
ViewManager?.Dispose();
_palette = null;
- Renderer = null;
- _localPalette = null;
+ Renderer = null!;
+ _localCustomPalette = null;
Redirector.Target = null;
}
@@ -200,7 +200,7 @@ public override ContextMenuStrip? ContextMenuStrip
}
///
- /// Gets and sets the KryptonContextMenu to show when right clicked.
+ /// Gets and sets the KryptonContextMenu to show when right-clicked.
///
[Category(@"Behavior")]
[Description(@"The KryptonContextMenu to show when the user right-clicks the Control.")]
@@ -295,7 +295,7 @@ public PaletteMode PaletteMode
_paletteMode = value;
// Get a reference to the standard palette from its name
- _localPalette = null;
+ _localCustomPalette = null;
SetPalette(KryptonManager.GetPaletteForMode(_paletteMode));
// Must raise event to change palette in redirector
@@ -310,11 +310,7 @@ public PaletteMode PaletteMode
}
private bool ShouldSerializePaletteMode() => PaletteMode != PaletteMode.Global;
-
- ///
- /// Resets the PaletteMode property to its default value.
- ///
- public void ResetPaletteMode() => PaletteMode = PaletteMode.Global;
+ private void ResetPaletteMode() => PaletteMode = PaletteMode.Global;
///
/// Gets and sets the custom palette implementation.
@@ -322,18 +318,18 @@ public PaletteMode PaletteMode
[Category(@"Visuals")]
[Description(@"Custom palette applied to drawing.")]
[DefaultValue(null)]
- public PaletteBase? Palette
+ public KryptonCustomPaletteBase? LocalCustomPalette
{
[DebuggerStepThrough]
- get => _localPalette;
+ get => _localCustomPalette!;
set
{
// Only interested in changes of value
- if (_localPalette != value)
+ if (_localCustomPalette != value)
{
// Remember the starting palette
- PaletteBase? old = _localPalette;
+ PaletteBase? old = _localCustomPalette;
// Use the provided palette value
SetPalette(value);
@@ -345,18 +341,18 @@ public PaletteBase? Palette
_paletteMode = PaletteMode.Global;
// Get the appropriate palette for the global mode
- _localPalette = null;
+ _localCustomPalette = null;
SetPalette(KryptonManager.GetPaletteForMode(_paletteMode));
}
else
{
// No longer using a standard palette
- _localPalette = value;
+ _localCustomPalette = value;
_paletteMode = PaletteMode.Custom;
}
// If real change has occurred
- if (old != _localPalette)
+ if (old != _localCustomPalette)
{
// Raise the change event
OnPaletteChanged(EventArgs.Empty);
@@ -371,7 +367,7 @@ public PaletteBase? Palette
///
/// Resets the Palette property to its default value.
///
- public void ResetPalette() => PaletteMode = PaletteMode.Global;
+ private void ResetLocalCustomPalette() => PaletteMode = PaletteMode.Global;
///
/// Gets access to the current renderer.
@@ -427,7 +423,7 @@ public override ImageLayout BackgroundImageLayout
///
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
- public PaletteBase? GetResolvedPalette() => _palette;
+ public PaletteBase GetResolvedPalette() => _palette!;
///
/// Gets and sets the dirty palette counter.
@@ -487,7 +483,7 @@ public void UnattachGlobalEvents()
/// Reset the internal counters.
///
[EditorBrowsable(EditorBrowsableState.Never)]
- public void KryptonResetCounters() => ViewManager.ResetCounters();
+ public void KryptonResetCounters() => ViewManager?.ResetCounters();
///
/// Gets the number of layout cycles performed since last reset.
@@ -495,7 +491,7 @@ public void UnattachGlobalEvents()
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public int KryptonLayoutCounter => ViewManager.LayoutCounter;
+ public int KryptonLayoutCounter => ViewManager!.LayoutCounter;
///
/// Gets the number of paint cycles performed since last reset.
@@ -503,14 +499,14 @@ public void UnattachGlobalEvents()
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public int KryptonPaintCounter => ViewManager.PaintCounter;
+ public int KryptonPaintCounter => ViewManager!.PaintCounter;
///
/// Gets the view associated with the provided client location.
///
/// Point to lookup.
/// ViewBase associated with the point.
- public ViewBase? ViewFromPoint(Point pt) => ViewManager?.Root?.ViewFromPoint(pt);
+ public ViewBase? ViewFromPoint(Point pt) => ViewManager?.Root.ViewFromPoint(pt);
#endregion
@@ -518,8 +514,9 @@ public void UnattachGlobalEvents()
///
/// Gets and sets the ViewManager instance.
///
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- [EditorBrowsable(EditorBrowsableState.Never)]
+ [Browsable(false)] // Hides the property from the Property Grid in the Visual Studio designer
+ [EditorBrowsable(EditorBrowsableState.Never)] // Hides the property from IntelliSense and code completion.
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] // Prevents the property from being serialized into the designer code.
public ViewManager? ViewManager
{
[DebuggerStepThrough]
@@ -617,7 +614,7 @@ protected bool NeedTransparentPaint
/// True to allow; otherwise false.
protected bool CanProcessMnemonic()
{
- Control c = this;
+ Control? c = this;
// Test each control in parent chain
while (c != null)
@@ -663,7 +660,7 @@ protected virtual bool EvalTransparentPaint() =>
/// Source of notification.
/// An EventArgs containing event data.
///
- protected virtual void OnButtonSpecChanged(object sender, [DisallowNull] EventArgs e)
+ protected virtual void OnButtonSpecChanged(object? sender, [DisallowNull] EventArgs e)
{
Debug.Assert(e != null);
@@ -687,7 +684,7 @@ protected virtual void OnPaletteChanged(EventArgs e)
DirtyPaletteCounter++;
// A new palette source means we need to layout and redraw
- OnNeedPaint(Palette, new NeedLayoutEventArgs(true));
+ OnNeedPaint(LocalCustomPalette, new NeedLayoutEventArgs(true));
PaletteChanged?.Invoke(this, e);
}
@@ -697,7 +694,7 @@ protected virtual void OnPaletteChanged(EventArgs e)
///
/// Source of notification.
/// An NeedLayoutEventArgs containing event data.
- protected virtual void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e)
+ protected virtual void OnPaletteNeedPaint(object? sender, NeedLayoutEventArgs e)
{
// Need to recalculate anything relying on the palette
DirtyPaletteCounter++;
@@ -834,7 +831,7 @@ protected override void OnLayout(LayoutEventArgs levent)
/// Raises the Paint event.
///
/// A PaintEventArgs that contains the event data.
- protected override void OnPaint(PaintEventArgs e)
+ protected override void OnPaint(PaintEventArgs? e)
{
// Cannot process a message for a disposed control
if (!IsDisposed && !Disposing)
@@ -883,7 +880,7 @@ protected override void OnMouseEnter(EventArgs e)
// Cannot process a message for a disposed control
if (!IsDisposed && !Disposing)
{
- _toolTipManager.MouseEnter(ViewManager?.ActiveView ?? ViewManager?.Root, this);
+ _toolTipManager.MouseEnter(ViewManager?.ActiveView ?? ViewManager?.Root!, this);
}
// Let base class fire events
@@ -899,7 +896,7 @@ protected override void OnMouseMove(MouseEventArgs e)
// Cannot process a message for a disposed control
if (!IsDisposed && !Disposing)
{
- _toolTipManager.MouseMove(ViewManager?.ActiveView ?? ViewManager?.Root, this, e.Location);
+ _toolTipManager.MouseMove(ViewManager?.ActiveView ?? ViewManager?.Root!, this, e.Location);
// Do we have a manager for processing mouse messages?
ViewManager?.MouseMove(e, e.Location);
}
@@ -917,7 +914,7 @@ protected override void OnMouseDown(MouseEventArgs e)
// Cannot process a message for a disposed control
if (!IsDisposed && !Disposing)
{
- _toolTipManager.MouseDown(ViewManager?.ActiveView ?? ViewManager?.Root, this, e.Location, e.Button);
+ _toolTipManager.MouseDown(ViewManager?.ActiveView ?? ViewManager?.Root!, this, e.Location, e.Button);
// Do we have a manager for processing mouse messages?
ViewManager?.MouseDown(e, e.Location);
}
@@ -935,7 +932,7 @@ protected override void OnMouseUp(MouseEventArgs e)
// Cannot process a message for a disposed control
if (!IsDisposed && !Disposing)
{
- _toolTipManager.MouseUp(ViewManager?.ActiveView ?? ViewManager?.Root, this, e.Location, e.Button);
+ _toolTipManager.MouseUp(ViewManager?.ActiveView ?? ViewManager?.Root!, this, e.Location, e.Button);
// Do we have a manager for processing mouse messages?
ViewManager?.MouseUp(e, e.Location);
}
@@ -1052,13 +1049,13 @@ protected override void OnLostFocus(EventArgs e)
///
/// Source of the event.
/// An EventArgs that contains the event data.
- protected virtual void OnGlobalPaletteChanged(object sender, EventArgs e)
+ protected virtual void OnGlobalPaletteChanged(object? sender, EventArgs e)
{
// We only care if we are using the global palette
if (PaletteMode == PaletteMode.Global)
{
// Update self with the new global palette
- _localPalette = null;
+ _localCustomPalette = null;
SetPalette(KryptonManager.CurrentGlobalPalette);
Redirector.Target = _palette;
@@ -1066,7 +1063,7 @@ protected virtual void OnGlobalPaletteChanged(object sender, EventArgs e)
DirtyPaletteCounter++;
// A new palette source means we need to layout and redraw
- OnNeedPaint(Palette, new NeedLayoutEventArgs(true));
+ OnNeedPaint(LocalCustomPalette, new NeedLayoutEventArgs(true));
// Must raise event to change palette in redirector
OnPaletteChanged(EventArgs.Empty);
@@ -1191,11 +1188,11 @@ private void SetPalette(PaletteBase? palette)
}
}
- private void OnBaseChanged(object sender, EventArgs e) =>
+ private void OnBaseChanged(object? sender, EventArgs e) =>
// Change in base renderer or base palette require we fetch the latest renderer
- Renderer = _palette.GetRenderer();
+ Renderer = _palette?.GetRenderer()!;
- private void PaintTransparentBackground(PaintEventArgs e)
+ private void PaintTransparentBackground(PaintEventArgs? e)
{
// Get the parent control for transparent drawing purposes
Control? parent = TransparentParent;
@@ -1204,22 +1201,22 @@ private void PaintTransparentBackground(PaintEventArgs e)
if ((parent != null) && NeedTransparentPaint)
{
// Only grab the required reference once
- if (_miPTB == null)
+ if (_miPTB == null!)
{
// Use reflection so we can call the Windows Forms internal method for painting parent background
_miPTB = typeof(Control).GetMethod(nameof(PaintTransparentBackground),
BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.InvokeMethod,
null, CallingConventions.HasThis,
- new[] { typeof(PaintEventArgs), typeof(Rectangle), typeof(Region) },
- null);
+ [typeof(PaintEventArgs), typeof(Rectangle), typeof(Region)],
+ null)!;
}
- _miPTB.Invoke(this, new object[] { e, ClientRectangle, null });
+ _miPTB.Invoke(this, [e!, ClientRectangle, null!]);
}
else
{
// Request the background be painted in the system colors
- PaintBackground(e.Graphics, SystemBrushes.Control, ClientRectangle);
+ PaintBackground(e!.Graphics, SystemBrushes.Control, ClientRectangle);
}
}
@@ -1234,7 +1231,7 @@ private void OnPerformRefresh()
// If the layout is still dirty after the refresh
if (_layoutDirty)
{
- // Then non of the control is visible, so perform manual request
+ // Then none of the control is visible, so perform manual request
// for a layout to ensure that child controls can be resized
PerformLayout();
@@ -1250,7 +1247,7 @@ private void OnPerformRefresh()
private void OnPerformLayout()
{
- // Then non of the control is visible, so perform manual request
+ // Then none of the control is visible, so perform manual request
// for a layout to ensure that child controls can be resized
PerformLayout();
@@ -1258,24 +1255,24 @@ private void OnPerformLayout()
BeginInvoke(_refreshCall);
}
- private void OnContextMenuStripOpening(object sender, CancelEventArgs e)
+ private void OnContextMenuStripOpening(object? sender, CancelEventArgs e)
{
// Get the actual strip instance
- ContextMenuStrip cms = base.ContextMenuStrip;
+ ContextMenuStrip? cms = base.ContextMenuStrip;
// Make sure it has the correct renderer
- cms.Renderer = CreateToolStripRenderer();
+ cms!.Renderer = CreateToolStripRenderer();
}
- private void OnKryptonContextMenuDisposed(object sender, EventArgs e) =>
+ private void OnKryptonContextMenuDisposed(object? sender, EventArgs e) =>
// When the current krypton context menu is disposed, we should remove
// it to prevent it being used again, as that would just throw an exception
// because it has been disposed.
KryptonContextMenu = null;
- private void OnContextMenuClosed(object sender, ToolStripDropDownClosedEventArgs e) => ContextMenuClosed();
+ private void OnContextMenuClosed(object? sender, ToolStripDropDownClosedEventArgs e) => ContextMenuClosed();
- private void OnShowToolTip(object sender, ToolTipEventArgs e)
+ private void OnShowToolTip(object? sender, ToolTipEventArgs e)
{
if (!IsDisposed)
{
@@ -1310,20 +1307,21 @@ private void OnShowToolTip(object sender, ToolTipEventArgs e)
}
}
- private void OnCancelToolTip(object sender, EventArgs e) =>
+ private void OnCancelToolTip(object? sender, EventArgs e) =>
// Remove any currently showing tooltip
visualBasePopupToolTip?.Dispose();
- private void OnVisualPopupToolTipDisposed(object sender, EventArgs e)
+ private void OnVisualPopupToolTipDisposed(object? sender, EventArgs e)
{
// Unhook events from the specific instance that generated event
- var popupToolTip = (VisualPopupToolTip)sender;
+ var popupToolTip = sender as VisualPopupToolTip ?? throw new ArgumentNullException(nameof(sender));
popupToolTip.Disposed -= OnVisualPopupToolTipDisposed;
- // Not showing a popup page any more
+ // Not showing a popup page anymore
visualBasePopupToolTip = null;
}
+ ///
protected override void OnHandleCreated(EventArgs e)
{
PI.SetWindowTheme(Handle, @"DarkMode_Explorer", null);
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualControlContainment.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualControlContainment.cs
index 25b318cbf..c818dd96d 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualControlContainment.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualControlContainment.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualForm.cs
index 8a0a1797b..6b52f4f00 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualForm.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualForm.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -24,10 +24,10 @@ public abstract class VisualForm : Form,
IKryptonDebug
{
#region Static Fields
-
- private const int DEFAULT_COMPOSITION_HEIGHT = 30;
private static readonly bool _themedApp;
- private readonly PaletteDoubleRedirect _stateCommon;
+
+ // To avoid lag when Acrylic is in use
+ public const int WS_EX_NOREDIRECTIONBITMAP = 0x00200000;
#endregion
@@ -35,23 +35,19 @@ public abstract class VisualForm : Form,
private bool _activated;
private bool _windowActive;
private bool _trackingMouse;
- private bool _applyCustomChrome;
- private bool _allowComposition;
- private bool _insideUpdateComposition;
+ private bool _useThemeFormChromeBorderWidth;
private bool _captured;
private bool _disposing;
- private int _compositionHeight;
private int _ignoreCount;
- private ViewBase? _capturedElement;
- private PaletteBase? _localPalette;
- private PaletteBase? _palette;
+ private KryptonCustomPaletteBase? _localCustomPalette;
+ private PaletteBase _palette;
private PaletteMode _paletteMode;
private readonly IntPtr _screenDC;
private ShadowValues _shadowValues;
private ShadowManager _shadowManager;
private BlurValues _blurValues;
private BlurManager _blurManager;
- private readonly object lockObject = new object();
+ private readonly object lockObject = new();
#endregion
#region Events
@@ -67,7 +63,7 @@ public abstract class VisualForm : Form,
///
[Browsable(false)] // SKC: Probably a special case for not exposing this event in the designer....
[EditorBrowsable(EditorBrowsableState.Never)]
- public event EventHandler? ApplyCustomChromeChanged;
+ public event EventHandler? ApplyUseThemeFormChromeBorderWidthChanged;
///
/// Occurs when the active window setting changes.
@@ -101,7 +97,7 @@ static VisualForm()
///
/// Initialize a new instance of the VisualForm class.
///
- public VisualForm()
+ protected VisualForm()
{
InitializeComponent();
@@ -115,23 +111,16 @@ public VisualForm()
NeedPaintDelegate = OnNeedPaint;
// Set the palette and renderer to the defaults as specified by the manager
- _localPalette = null;
+ _localCustomPalette = null;
SetPalette(KryptonManager.CurrentGlobalPalette);
_paletteMode = PaletteMode.Global;
// We need to layout the view
NeedLayout = true;
- // Default the composition height
- _compositionHeight = DEFAULT_COMPOSITION_HEIGHT;
- CloseBox = true;
-
// Create constant target for resolving palette delegates
Redirector = CreateRedirector();
- _stateCommon = new PaletteDoubleRedirect(Redirector, PaletteBackStyle.ButtonCustom1,
- PaletteBorderStyle.ButtonCustom1, NeedPaintDelegate);
-
// Hook into global static events
KryptonManager.GlobalPaletteChanged += OnGlobalPaletteChanged;
SystemEvents.UserPreferenceChanged += OnUserPreferenceChanged;
@@ -146,7 +135,6 @@ public VisualForm()
UpdateDpiFactors();
}
-
///
/// Releases all resources used by the Control.
///
@@ -158,13 +146,14 @@ protected override void Dispose(bool disposing)
if (disposing)
{
// Must unhook from the palette paint events
- if (_palette != null)
+ if (_palette != null!)
{
_palette.PalettePaint -= OnNeedPaint;
_palette.ButtonSpecChanged -= OnButtonSpecChanged;
- _palette.AllowFormChromeChanged -= OnAllowFormChromeChanged;
+ _palette.UseThemeFormChromeBorderWidthChanged -= OnUseThemeFormChromeBorderWidthChanged;
_palette.BasePaletteChanged -= OnBaseChanged;
_palette.BaseRendererChanged -= OnBaseChanged;
+ _palette = null!;
}
// Unhook from global static events
@@ -185,6 +174,12 @@ protected override void Dispose(bool disposing)
#region Public
+ /*public AcrylicValues AcrylicValues { get; } = new AcrylicValues();
+
+ private void ResetAcrylicValues() => AcrylicValues.Reset();
+
+ private bool ShouldSerializeAcrylicValues() => !AcrylicValues.IsDefault;*/
+
///
/// Gets the DpiX of the view.
///
@@ -217,51 +212,39 @@ public float FactorDpiY
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public bool ApplyCustomChrome
+ internal bool UseThemeFormChromeBorderWidth
{
[DebuggerStepThrough]
- get => _applyCustomChrome;
+ get => _useThemeFormChromeBorderWidth;
- internal set
+ set
{
// Only interested in changed values
- if (_applyCustomChrome != value)
+ if (_useThemeFormChromeBorderWidth != value)
{
// Cache old setting
- var oldApplyCustomChrome = _applyCustomChrome;
+ var oldUseThemeFormChromeBorderWidth = _useThemeFormChromeBorderWidth;
// Store the new setting
- _applyCustomChrome = value;
+ _useThemeFormChromeBorderWidth = value;
// If we need custom chrome drawing...
- if (_applyCustomChrome)
+ if (_useThemeFormChromeBorderWidth)
{
try
{
// Set back to false in case we decide that the operating system
// is not capable of supporting our custom chrome implementation
- _applyCustomChrome = false;
+ _useThemeFormChromeBorderWidth = false;
// Only need to remove the window theme, if there is one
if (PI.IsAppThemed() && PI.IsThemeActive())
{
// Assume that we can apply custom chrome
- _applyCustomChrome = true;
+ _useThemeFormChromeBorderWidth = true;
- // Retest if composition should be applied
- UpdateComposition();
-
- // When using composition we do not remove the theme
- if (!ApplyComposition)
- {
- // Remove any theme that is currently drawing chrome
- PI.SetWindowTheme(Handle, string.Empty, string.Empty);
- }
- else
- {
- // Force a WM_NCCALCSIZE to update for composition
- PI.SetWindowTheme(Handle, null, null);
- }
+ // Remove any theme that is currently drawing chrome
+ PI.SetWindowTheme(Handle, string.Empty, string.Empty);
// Call virtual method for initializing own chrome
WindowChromeStart();
@@ -270,16 +253,13 @@ internal set
catch
{
// Failed and so cannot provide custom chrome
- _applyCustomChrome = false;
+ _useThemeFormChromeBorderWidth = false;
}
}
else
{
try
{
- // Retest if composition should be applied
- UpdateComposition();
-
// Restore the application to previous theme setting
PI.SetWindowTheme(Handle, null, null);
@@ -293,10 +273,10 @@ internal set
}
// Raise event to notify a change in setting
- if (_applyCustomChrome != oldApplyCustomChrome)
+ if (_useThemeFormChromeBorderWidth != oldUseThemeFormChromeBorderWidth)
{
// Generate change event
- OnApplyCustomChromeChanged(EventArgs.Empty);
+ OnApplyUseThemeFormChromeBorderWidthChanged(EventArgs.Empty);
}
}
}
@@ -307,56 +287,9 @@ internal set
/// to display a Close button for the form; otherwise, . The default is .
[Category("Window Style")]
[DefaultValue(true)]
- [Description("Form Close Button Visiblity: This will also Hide the System Menu `Close` and disable the `Alt+F4` action")]
- public bool CloseBox { [DebuggerStepThrough] get; set; }
-
- ///
- /// Gets a value indicating if composition is being applied.
- ///
- [Browsable(false)]
- [EditorBrowsable(EditorBrowsableState.Never)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public bool ApplyComposition { get; private set; }
-
- ///
- /// Gets a value indicating if composition is allowed to be applied to custom chrome.
- ///
- [Browsable(false)]
- [EditorBrowsable(EditorBrowsableState.Never)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public bool AllowComposition
- {
- get => _allowComposition;
-
- set
- {
- if (_allowComposition != value)
- {
- _allowComposition = value;
-
- // If custom chrome is not enabled, then no need to make changes
- if (ApplyCustomChrome)
- {
- UpdateComposition();
- }
- }
- }
- }
-
- ///
- /// used to update the size of the composition area.
- ///
- [Browsable(false)]
- [EditorBrowsable(EditorBrowsableState.Never)]
- public void RecalculateComposition() => UpdateComposition();
-
- ///
- /// Gets and sets the interface to the composition interface cooperating with the form.
- ///
- [Browsable(false)]
- [EditorBrowsable(EditorBrowsableState.Never)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public IKryptonComposition? Composition { get; set; }
+ [Description(
+ "Form Close Button Visiblity: This will also Hide the System Menu `Close` and disable the `Alt+F4` action")]
+ public bool CloseBox { [DebuggerStepThrough] get; set; } = true;
///
/// Gets or sets the palette to be applied.
@@ -384,7 +317,7 @@ public PaletteMode PaletteMode
_paletteMode = value;
// Get a reference to the standard palette from its name
- _localPalette = null;
+ _localCustomPalette = null;
SetPalette(KryptonManager.GetPaletteForMode(_paletteMode));
// Must raise event to change palette in redirector
@@ -398,12 +331,22 @@ public PaletteMode PaletteMode
}
}
+ private void ResetPaletteMode() => PaletteMode = PaletteMode.Global;
+
private bool ShouldSerializePaletteMode() => PaletteMode != PaletteMode.Global;
- ///
- /// Resets the PaletteMode property to its default value.
- ///
- public void ResetPaletteMode() => PaletteMode = PaletteMode.Global;
+ /* FadeValues disabled and moved to extended until proven stable. Further development in V100
+ /// Gets access to the fade values.
+ [Category(@"Visuals")]
+ [Description(@"Form fading.")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ public FadeValues FadeValues { get; } = new FadeValues();
+
+ private bool ShouldSerializeFadeValues() => !FadeValues.IsDefault;
+
+ /// Resets the fade values.
+ private void ResetFadeValues() => FadeValues.Reset();
+ */
///
/// Gets access to the button content.
@@ -459,21 +402,18 @@ public BlurValues BlurValues
[Category(@"Visuals")]
[Description(@"Custom palette applied to drawing.")]
[DefaultValue(null)]
- public PaletteBase? Palette
+ public KryptonCustomPaletteBase? LocalCustomPalette
{
[DebuggerStepThrough]
- get => _localPalette;
+ get => _localCustomPalette;
set
{
// Only interested in changes of value
- if (_localPalette != value)
+ if (_localCustomPalette != value)
{
// Remember the starting palette
- PaletteBase? old = _localPalette;
-
- // Use the provided palette value
- SetPalette(value);
+ PaletteBase? old = _localCustomPalette;
// If no custom palette is required
if (value == null)
@@ -482,18 +422,20 @@ public PaletteBase? Palette
_paletteMode = PaletteMode.Global;
// Get the appropriate palette for the global mode
- _localPalette = null;
+ _localCustomPalette = null;
SetPalette(KryptonManager.GetPaletteForMode(_paletteMode));
}
else
{
// No longer using a standard palette
- _localPalette = value;
+ _localCustomPalette = value;
_paletteMode = PaletteMode.Custom;
+ // Use the provided palette value
+ SetPalette(value);
}
// If real change has occurred
- if (old != _localPalette)
+ if (old != _localCustomPalette)
{
// Raise the change event
OnPaletteChanged(EventArgs.Empty);
@@ -508,7 +450,7 @@ public PaletteBase? Palette
///
/// Resets the Palette property to its default value.
///
- public void ResetPalette() => _localPalette = null;
+ public void ResetPalette() => _localCustomPalette = null;
///
/// Gets access to the current renderer.
@@ -516,7 +458,7 @@ public PaletteBase? Palette
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Advanced)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public IRenderer? Renderer
+ public IRenderer Renderer
{
[DebuggerStepThrough]
get;
@@ -536,7 +478,7 @@ public IRenderer? Renderer
///
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
- public PaletteBase? GetResolvedPalette() => _palette;
+ public PaletteBase GetResolvedPalette() => _palette;
///
/// Create a tool strip renderer appropriate for the current renderer/palette pair.
@@ -569,7 +511,7 @@ internal void SendSysCommand(PI.SC_ sysCommand, IntPtr lParam) =>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public Padding RealWindowBorders => CommonHelper.GetWindowBorders(CreateParams);
+ public Padding RealWindowBorders => CommonHelper.GetWindowBorders(CreateParams, this as KryptonForm);
///
/// Gets a count of the number of paints that have occurred.
@@ -620,7 +562,6 @@ public bool WindowActive
}
}
-
///
/// Request the non-client area be repainted.
///
@@ -658,33 +599,13 @@ public void RecalcNonClient()
}
#endif
- /// Gets or sets the tool bar manager.
- /// The tool bar manager.
- [AllowNull, DefaultValue(null), Category(@"Visuals"), Description(@"Gets or sets the tool bar manager.")]
+ /// Gets or sets the toolbar manager.
+ /// The toolbar manager.
+ [DefaultValue(null), Category(@"Visuals"), Description(@"Gets or sets the tool bar manager.")]
public KryptonIntegratedToolBarManager? ToolBarManager { get; set; }
#endregion
- #region Public Chrome
- ///
- /// Perform layout on behalf of the composition element using our root element.
- ///
- /// Layout context.
- /// Rectangle for composition element.
- public virtual void WindowChromeCompositionLayout(ViewLayoutContext context,
- Rectangle compRect)
- {
- }
-
- ///
- /// Perform painting on behalf of the composition element using our root element.
- ///
- /// Rendering context.
- public virtual void WindowChromeCompositionPaint(RenderContext context)
- {
- }
- #endregion
-
#region Public IKryptonDebug
///
/// Reset the internal counters.
@@ -724,7 +645,7 @@ protected ViewManager? ViewManager
///
/// Gets access to the palette redirector.
///
- protected PaletteRedirect? Redirector
+ protected PaletteRedirect Redirector
{
[DebuggerStepThrough]
get;
@@ -751,7 +672,7 @@ protected Point ScreenToWindow(Point screenPt)
// Now adjust to take into account the top and left borders
Padding borders = RealWindowBorders;
- clientPt.Offset(borders.Left, ApplyComposition ? 0 : borders.Top);
+ clientPt.Offset(borders.Left, borders.Top);
return clientPt;
}
@@ -845,6 +766,19 @@ protected Rectangle RealWindowRectangle
#endregion
#region Protected Override
+
+ //protected override CreateParams CreateParams
+ //{
+ // get
+ // {
+ // CreateParams cp = base.CreateParams;
+
+ // cp.ExStyle |= WS_EX_NOREDIRECTIONBITMAP;
+
+ // return cp;
+ // }
+ //}
+
///
/// Raises the HandleCreated event.
///
@@ -863,6 +797,11 @@ protected override void OnHandleCreated(EventArgs e)
//
}
+ //if (AcrylicValues.EnableAcrylic)
+ //{
+ // WindowUtilities.EnableAcrylic(this, AcrylicValues.AcrylicColor);
+ //}
+
base.OnHandleCreated(e);
}
@@ -872,12 +811,9 @@ protected override void OnHandleCreated(EventArgs e)
/// Target element for the capture events.
protected void StartCapture(ViewBase element)
{
- // Capture mouse input so we notice the WM_LBUTTONUP when the mouse is released
+ // Capture mouse input, so we notice the WM_LBUTTONUP when the mouse is released
Capture = true;
_captured = true;
-
- // Remember the view element that wants the mouse input during capture
- _capturedElement = element;
}
///
@@ -891,8 +827,7 @@ protected override void OnResize(EventArgs e)
base.OnResize(e);
- if (ApplyCustomChrome
- && !((MdiParent != null)
+ if (!((MdiParent != null)
&& CommonHelper.IsFormMaximized(this))
)
{
@@ -903,28 +838,6 @@ protected override void OnResize(EventArgs e)
SuspendPaint();
}
- ///
- /// Performs the work of setting the specified bounds of this control.
- ///
- /// The new Left property value of the control.
- /// The new Top property value of the control.
- /// The new Width property value of the control.
- /// The new Height property value of the control.
- /// A bitwise combination of the BoundsSpecified values.
- protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
- {
- var updatedHeight = height;
-
- // With the Aero glass appearance we need to reduce height by the top border,
- // otherwise each time the window is maximized and restored it grows in size
- if (ApplyComposition && (FormBorderStyle != FormBorderStyle.None))
- {
- updatedHeight = height - RealWindowBorders.Top;
- }
-
- base.SetBoundsCore(x, y, width, updatedHeight, specified);
- }
-
///
/// Raises the Activated event.
///
@@ -945,28 +858,6 @@ protected override void OnDeactivate(EventArgs e)
base.OnDeactivate(e);
}
- ///
- /// Raises the PaintBackground event.
- ///
- /// A PaintEventArgs containing event data.
- protected override void OnPaintBackground(PaintEventArgs e)
- {
- // If drawing with custom chrome and composition
- if (ApplyCustomChrome && ApplyComposition)
- {
- var compositionRect = new Rectangle(0, 0, Width, _compositionHeight);
-
- // Draw the extended area inside the client in black, this ensures
- // it is treated as transparent by the desktop window manager
- e.Graphics.FillRectangle(Brushes.Black, compositionRect);
-
- // Exclude the composition area from the rest of the background painting
- e.Graphics.SetClip(compositionRect, CombineMode.Exclude);
- }
-
- base.OnPaintBackground(e);
- }
-
///
/// Raises the Shown event.
///
@@ -983,11 +874,51 @@ protected override void OnShown(EventArgs e)
base.OnShown(e);
}
- protected override void OnPaint(PaintEventArgs e)
- {
- base.OnPaint(e);
- }
-
+ //protected override void OnPaint(PaintEventArgs e)
+ //{
+ // base.OnPaint(e);
+ //}
+
+ /////
+ //protected override void OnPaintBackground(PaintEventArgs e)
+ //{
+ // if (AcrylicValues.EnableAcrylic)
+ // {
+ // e.Graphics.Clear(Color.Transparent);
+ // }
+ //}
+
+ /////
+ //protected override void OnLoad(EventArgs e)
+ //{
+ // /* FadeValues disabled and moved to extended until proven stable. Further development in V100
+ // if (FadeValues.FadingEnabled)
+ // {
+ // #if NETCOREAPP3_0_OR_GREATER
+ // KryptonFormFadeController.ModernFadeFormIn(FadeValues.Owner ?? this, FadeValues.FadeDuration);
+ // #else
+ // KryptonFormFadeController.FadeIn(FadeValues.Owner ?? this, FadeValues.FadeSpeed);
+ // #endif
+ // }
+ // */
+ // base.OnLoad(e);
+ //}
+
+ /////
+ //protected override void OnClosing(CancelEventArgs e)
+ //{
+ // /* FadeValues disabled and moved to extended until proven stable. Further development in V100
+ // if (FadeValues is { FadingEnabled: true, ShouldCloseOnFadeOut: true })
+ // {
+ // #if NETCOREAPP3_0_OR_GREATER
+ // KryptonFormFadeController.ModernFadeFormOut(FadeValues.Owner ?? this, FadeValues.FadeDuration);
+ // #else
+ // KryptonFormFadeController.FadeOut(FadeValues.Owner ?? this, FadeValues.FadeSpeed);
+ // #endif
+ // }
+ // */
+ // base.OnClosing(e);
+ //}
#endregion
#region Protected Virtual
@@ -1013,7 +944,7 @@ protected override void OnPaint(PaintEventArgs e)
///
/// Source of notification.
/// An EventArgs containing event data.
- protected virtual void OnButtonSpecChanged(object sender, EventArgs e)
+ protected virtual void OnButtonSpecChanged(object? sender, EventArgs e)
{
}
@@ -1027,23 +958,23 @@ protected virtual void OnPaletteChanged(EventArgs e)
Redirector.Target = _palette;
// A new palette source means we need to layout and redraw
- OnNeedPaint(Palette, new NeedLayoutEventArgs(true));
+ OnNeedPaint(LocalCustomPalette!, new NeedLayoutEventArgs(true));
PaletteChanged?.Invoke(this, e);
}
///
- /// Raises the ApplyCustomChrome event.
+ /// Raises the ApplyUseThemeFormChromeBorderWidth event.
///
/// An EventArgs containing the event data.
- protected virtual void OnApplyCustomChromeChanged(EventArgs e) => ApplyCustomChromeChanged?.Invoke(this, e);
+ protected virtual void OnApplyUseThemeFormChromeBorderWidthChanged(EventArgs e) => ApplyUseThemeFormChromeBorderWidthChanged?.Invoke(this, e);
///
- /// Occurs when the AllowFormChromeChanged event is fired for the current palette.
+ /// Occurs when the UseThemeFormChromeBorderWidthChanged event is fired for the current palette.
///
/// Source of the event.
/// An EventArgs containing the event data.
- protected virtual void OnAllowFormChromeChanged(object sender, EventArgs e)
+ protected virtual void OnUseThemeFormChromeBorderWidthChanged(object? sender, EventArgs e)
{
}
@@ -1063,27 +994,13 @@ protected virtual void OnNeedPaint(object? sender, [DisallowNull] NeedLayoutEven
throw new ArgumentNullException(nameof(e));
}
- // Do nothing unless we are applying custom chrome
- if (ApplyCustomChrome)
+ // Do we need to recalc the border size as well as invalidate?
+ if (e.NeedLayout)
{
- // If using composition drawing
- if (ApplyComposition
- && Composition != null)
- {
- // Ask the composition element top handle need paint event
- Composition.CompNeedPaint(e.NeedLayout);
- }
- else
- {
- // Do we need to recalc the border size as well as invalidate?
- if (e.NeedLayout)
- {
- NeedLayout = true;
- }
-
- InvalidateNonClient();
- }
+ NeedLayout = true;
}
+
+ InvalidateNonClient();
}
///
@@ -1094,13 +1011,8 @@ protected override void WndProc(ref Message m)
{
var processed = false;
- // We do not process the message if on an MDI child, because doing so prevents the
- // LayoutMdi call on the parent from working and cascading/tiling the children
- //if ((m.Msg == (int)PI.WM_NCCALCSIZE) && _themedApp &&
- // ((MdiParent == null) || ApplyCustomChrome))
if (!CommonHelper.IsFormMaximized(this)
&& _themedApp
- && ((MdiParent == null) || ApplyCustomChrome)
)
{
switch (m.Msg)
@@ -1110,42 +1022,44 @@ protected override void WndProc(ref Message m)
break;
case PI.WM_.GETMINMAXINFO:
OnWM_GETMINMAXINFO(ref m);
- /* Setting handled to false enables the application to process it's own Min/Max requirements,
- * as mentioned by jason.bullard (comment from September 22, 2011) on http://gallery.expression.microsoft.com/ZuneWindowBehavior/ */
+ /* Setting handled to false enables the application to process its own Min/Max requirements,
+ * as mentioned by jason.bullard (comment from September 22, 2011) on http://gallery.expression.microsoft.com/ZuneWindowBehavior/ */
// https://github.com/Krypton-Suite/Standard-Toolkit/issues/459
- // Still got to call - base - to allow the "application to process it's own Min/Max requirements" !!
+ // Still got to call - base - to allow the "application to process its own Min/Max requirements" !!
base.WndProc(ref m);
return;
}
}
// Do we need to override message processing?
- if (ApplyCustomChrome && !IsDisposed && !Disposing)
+ if (!IsDisposed && !Disposing)
{
switch (m.Msg)
{
case PI.WM_.NCPAINT:
- if (!ApplyComposition)
- {
- processed = _ignoreCount > 0 || OnWM_NCPAINT(ref m);
- }
+ processed = _ignoreCount > 0 || OnWM_NCPAINT(ref m);
break;
- case PI.WM_.NCHITTEST:
- processed = ApplyComposition ? OnCompWM_NCHITTEST(ref m) : OnWM_NCHITTEST(ref m);
+ case PI.WM_.NCHITTEST:
+ processed = OnWM_NCHITTEST(ref m);
break;
+
case PI.WM_.NCACTIVATE:
processed = OnWM_NCACTIVATE(ref m);
break;
+
case PI.WM_.NCMOUSEMOVE:
processed = OnWM_NCMOUSEMOVE(ref m);
break;
+
case PI.WM_.NCLBUTTONDOWN:
processed = OnWM_NCLBUTTONDOWN(ref m);
break;
+
case PI.WM_.NCLBUTTONUP:
processed = OnWM_NCLBUTTONUP(ref m);
break;
+
case PI.WM_.MOUSEMOVE:
if (_captured)
{
@@ -1158,21 +1072,15 @@ protected override void WndProc(ref Message m)
{
processed = OnWM_LBUTTONUP(ref m);
}
-
break;
+
case PI.WM_.NCMOUSELEAVE:
if (!_captured)
{
processed = OnWM_NCMOUSELEAVE(ref m);
}
-
- if (ApplyComposition
- && Composition != null)
- {
- // Must repaint the composition area not that mouse has left
- Composition.CompNeedPaint(true);
- }
break;
+
case PI.WM_.NCLBUTTONDBLCLK:
processed = OnWM_NCLBUTTONDBLCLK(ref m);
break;
@@ -1239,7 +1147,7 @@ protected override void WndProc(ref Message m)
/// A Windows-based message.
protected virtual void OnWM_GETMINMAXINFO(ref Message m)
{
- PI.MINMAXINFO mmi = (PI.MINMAXINFO)Marshal.PtrToStructure(m.LParam, typeof(PI.MINMAXINFO));
+ PI.MINMAXINFO mmi = (PI.MINMAXINFO)Marshal.PtrToStructure(m.LParam, typeof(PI.MINMAXINFO))!;
// Adjust the maximized size and position to fit the work area of the correct monitor
const int MONITOR_DEFAULT_TO_NEAREST = 0x00000002;
@@ -1285,19 +1193,10 @@ protected virtual bool OnWM_NCCALCSIZE(ref Message m)
if (m.WParam != IntPtr.Zero)
{
// Get the border sizing needed around the client area
- Padding borders = FormBorderStyle == FormBorderStyle.None ? Padding.Empty : RealWindowBorders;
+ Padding borders = RealWindowBorders;
// Extract the Win32 NCCALCSIZE_PARAMS structure from LPARAM
- PI.NCCALCSIZE_PARAMS calcsize = (PI.NCCALCSIZE_PARAMS)m.GetLParam(typeof(PI.NCCALCSIZE_PARAMS));
-
- // If using composition in the custom chrome
- if (ApplyComposition)
- {
- // Do not provide any border at the top, instead we extend the glass
- // at the top into the client area so that we can custom draw onto the
- // extended glass area.
- borders.Top = 0;
- }
+ PI.NCCALCSIZE_PARAMS calcsize = (PI.NCCALCSIZE_PARAMS)m.GetLParam(typeof(PI.NCCALCSIZE_PARAMS))!;
// Reduce provided RECT by the borders
calcsize.rectProposed.left += borders.Left;
@@ -1347,48 +1246,12 @@ protected virtual bool OnWM_NCHITTEST(ref Message m)
Point windowPoint = ScreenToWindow(screenPoint);
// Perform hit testing
- m.Result = WindowChromeHitTest(windowPoint, false);
+ m.Result = WindowChromeHitTest(windowPoint);
// Message processed, do not pass onto base class for processing
return true;
}
- ///
- /// Process the WM_NCHITTEST message when overriding window chrome.
- ///
- /// A Windows-based message.
- /// True if the message was processed; otherwise false.
- protected virtual bool OnCompWM_NCHITTEST(ref Message m)
- {
- // Let the desktop window manager process it first
- PI.Dwm.DwmDefWindowProc(m.HWnd, m.Msg, m.WParam, m.LParam, out var result);
- m.Result = result;
-
- // If no result returned then let the base window routine process it
- if (m.Result == (IntPtr)PI.HT.NOWHERE)
- {
- DefWndProc(ref m);
- }
-
- // If the window proc has decided it is in the CAPTION or CLIENT areas
- // then we might have something of our own in that area that we want to
- // override the return value for. So process it ourself.
- if (m.Result == (IntPtr)PI.HT.CAPTION
- || m.Result == (IntPtr)PI.HT.CLIENT)
- {
- // Extract the point in screen coordinates
- var screenPoint = new Point((int)m.LParam.ToInt64());
-
- // Convert to window coordinates
- Point windowPoint = ScreenToWindow(screenPoint);
-
- // Perform hit testing
- m.Result = WindowChromeHitTest(windowPoint, true);
- }
-
- // Message processed, do not pass onto base class for processing
- return true;
- }
///
/// Process the WM_NCACTIVATE message when overriding window chrome.
@@ -1400,21 +1263,18 @@ protected virtual bool OnWM_NCACTIVATE(ref Message m)
// Cache the new active state
WindowActive = m.WParam == (IntPtr)1;
- if (!ApplyComposition)
+ // The first time an MDI child gets an WM_NCACTIVATE, let it process as normal
+ if ((MdiParent != null) && !_activated)
{
- // The first time an MDI child gets an WM_NCACTIVATE, let it process as normal
- if ((MdiParent != null) && !_activated)
- {
- _activated = true;
- }
- else
- {
- // Allow default processing of activation change
- m.Result = (IntPtr)1;
+ _activated = true;
+ }
+ else
+ {
+ // Allow default processing of activation change
+ m.Result = (IntPtr)1;
- // Message processed, do not pass onto base class for processing
- return true;
- }
+ // Message processed, do not pass onto base class for processing
+ return true;
}
return false;
@@ -1450,12 +1310,6 @@ protected virtual bool OnWM_NCMOUSEMOVE(ref Message m)
// Convert to window coordinates
Point windowPoint = ScreenToWindow(screenPoint);
- // In composition we need to adjust for the left window border
- if (ApplyComposition)
- {
- windowPoint.X -= RealWindowBorders.Left;
- }
-
// Perform actual mouse movement actions
WindowChromeNonClientMouseMove(windowPoint);
@@ -1502,12 +1356,6 @@ protected virtual bool OnWM_NCLBUTTONDOWN(ref Message m)
// Convert to window coordinates
Point windowPoint = ScreenToWindow(screenPoint);
- // In composition we need to adjust for the left window border
- if (ApplyComposition)
- {
- windowPoint.X -= RealWindowBorders.Left;
- }
-
// Perform actual mouse down processing
return WindowChromeLeftMouseDown(windowPoint);
}
@@ -1525,12 +1373,6 @@ protected virtual bool OnWM_NCLBUTTONUP(ref Message m)
// Convert to window coordinates
Point windowPoint = ScreenToWindow(screenPoint);
- // In composition we need to adjust for the left window border
- if (ApplyComposition)
- {
- windowPoint.X -= RealWindowBorders.Left;
- }
-
// Perform actual mouse up processing
return WindowChromeLeftMouseUp(windowPoint);
}
@@ -1592,9 +1434,6 @@ protected virtual bool OnWM_LBUTTONUP(ref Message m)
_captured = false;
Capture = false;
- // No longer have a target element for events
- _capturedElement = null;
-
// Next time the mouse enters the window we need to track it leaving
_trackingMouse = false;
@@ -1633,7 +1472,7 @@ protected virtual bool OnWM_NCLBUTTONDBLCLK(ref Message m)
Point windowPoint = ScreenToWindow(screenPoint);
// Find the view element under the mouse
- ViewBase? pointView = ViewManager?.Root?.ViewFromPoint(windowPoint);
+ ViewBase? pointView = ViewManager?.Root.ViewFromPoint(windowPoint);
// Try and find a mouse controller for the active view
IMouseController? controller = pointView?.FindMouseController();
@@ -1664,6 +1503,7 @@ protected virtual void OnNonClientPaint(IntPtr hWnd)
{
// Find the rectangle that covers the client area of the form
Padding borders = RealWindowBorders;
+
var clipClientRect = new Rectangle(borders.Left, borders.Top,
windowBounds.Width - borders.Horizontal, windowBounds.Height - borders.Vertical);
@@ -1758,9 +1598,8 @@ protected virtual void WindowChromeEnd()
/// Perform hit testing.
///
/// Point in window coordinates.
- /// Are we performing composition.
///
- protected virtual IntPtr WindowChromeHitTest(Point pt, bool composition) => (IntPtr)PI.HT.CLIENT;
+ protected virtual IntPtr WindowChromeHitTest(Point pt) => (IntPtr)PI.HT.CLIENT;
///
/// Perform painting of the window chrome.
@@ -1786,7 +1625,7 @@ protected virtual bool WindowChromeLeftMouseDown(Point windowPoint)
{
ViewManager?.MouseDown(new MouseEventArgs(MouseButtons.Left, 1, windowPoint.X, windowPoint.Y, 0), windowPoint);
- // If we moused down on a active view element
+ // If we moused down on an active view element
// Ask the controller if the mouse down should be ignored by wnd proc processing
IMouseController? controller = ViewManager?.ActiveView?.FindMouseController();
return controller is { IgnoreVisualFormLeftButtonDown: true };
@@ -1815,81 +1654,18 @@ protected virtual void WindowChromeMouseLeave() =>
#endregion
#region Implementation
- private void UpdateComposition()
- {
- if (!_insideUpdateComposition)
- {
- // Prevent reentrancy
- _insideUpdateComposition = true;
-
- // Are we allowed to apply composition to the window
- var applyComposition = !DesignMode &&
- TopLevel &&
- ApplyCustomChrome &&
- AllowComposition &&
- DWM.IsCompositionEnabled;
-
- // Only need to process changes in value
- if (ApplyComposition != applyComposition)
- {
- ApplyComposition = applyComposition;
-
- // If we are compositing then show the composition interface
- if (Composition != null)
- {
- Composition.CompVisible = ApplyComposition;
- Composition.CompOwnerForm = this;
- _compositionHeight = Composition.CompHeight;
- }
- else
- {
- _compositionHeight = DEFAULT_COMPOSITION_HEIGHT;
- }
-
- // With composition we extend the top into the client area
- DWM.ExtendFrameIntoClientArea(Handle, new Padding(0, ApplyComposition ? _compositionHeight : 0, 0, 0));
-
- // A change in composition when using custom chrome must turn custom chrome
- // off and on again to have it reprocess correctly to the new composition state
- if (ApplyCustomChrome)
- {
- ApplyCustomChrome = false;
- ApplyCustomChrome = true;
- }
- }
- else if (ApplyComposition)
- {
- var newCompHeight = DEFAULT_COMPOSITION_HEIGHT;
- if (Composition != null)
- {
- newCompHeight = Composition.CompHeight;
- }
-
- // Check if there is a change in the composition height
- if (newCompHeight != _compositionHeight)
- {
- // Apply the new height requirement
- _compositionHeight = newCompHeight;
- DWM.ExtendFrameIntoClientArea(Handle, new Padding(0, ApplyComposition ? _compositionHeight : 0, 0, 0));
- }
- }
-
- _insideUpdateComposition = false;
- }
- }
-
- private void OnGlobalPaletteChanged(object sender, EventArgs e)
+ private void OnGlobalPaletteChanged(object? sender, EventArgs e)
{
// We only care if we are using the global palette
if (PaletteMode == PaletteMode.Global)
{
// Update ourself with the new global palette
- _localPalette = null;
+ _localCustomPalette = null;
SetPalette(KryptonManager.CurrentGlobalPalette);
Redirector.Target = _palette;
// A new palette source means we need to layout and redraw
- OnNeedPaint(Palette, new NeedLayoutEventArgs(true));
+ OnNeedPaint(LocalCustomPalette!, new NeedLayoutEventArgs(true));
GlobalPaletteChanged?.Invoke(sender, e);
}
@@ -1897,7 +1673,7 @@ private void OnGlobalPaletteChanged(object sender, EventArgs e)
private void OnUserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
{
- // If a change has occurred that could effect the color table then it needs regenerating
+ // If a change has occurred that could affect the color table then it needs regenerating
switch (e.Category)
{
case UserPreferenceCategory.Icon:
@@ -1907,22 +1683,21 @@ private void OnUserPreferenceChanged(object sender, UserPreferenceChangedEventAr
case UserPreferenceCategory.General:
case UserPreferenceCategory.Window:
case UserPreferenceCategory.Desktop:
- UpdateComposition();
PerformNeedPaint(true);
break;
}
}
- private void SetPalette(PaletteBase? palette)
+ private void SetPalette([DisallowNull] PaletteBase palette)
{
if (palette != _palette)
{
// Unhook from current palette events
- if (_palette != null)
+ if (_palette != null!) // Will be null on first set !
{
_palette.PalettePaint -= OnNeedPaint;
_palette.ButtonSpecChanged -= OnButtonSpecChanged;
- _palette.AllowFormChromeChanged -= OnAllowFormChromeChanged;
+ _palette.UseThemeFormChromeBorderWidthChanged -= OnUseThemeFormChromeBorderWidthChanged;
_palette.BasePaletteChanged -= OnBaseChanged;
_palette.BaseRendererChanged -= OnBaseChanged;
}
@@ -1931,27 +1706,24 @@ private void SetPalette(PaletteBase? palette)
_palette = palette;
// Get the renderer associated with the palette
- Renderer = _palette?.GetRenderer();
+ Renderer = _palette.GetRenderer();
// Hook to new palette events
- if (_palette != null)
- {
- _palette.PalettePaint += OnNeedPaint;
- _palette.ButtonSpecChanged += OnButtonSpecChanged;
- _palette.AllowFormChromeChanged += OnAllowFormChromeChanged;
- _palette.BasePaletteChanged += OnBaseChanged;
- _palette.BaseRendererChanged += OnBaseChanged;
- // PaletteImageScaler.ScalePalette(FactorDpiX, FactorDpiY, _palette);
- }
+ _palette.PalettePaint += OnNeedPaint;
+ _palette.ButtonSpecChanged += OnButtonSpecChanged;
+ _palette.UseThemeFormChromeBorderWidthChanged += OnUseThemeFormChromeBorderWidthChanged;
+ _palette.BasePaletteChanged += OnBaseChanged;
+ _palette.BaseRendererChanged += OnBaseChanged;
+ // PaletteImageScaler.ScalePalette(FactorDpiX, FactorDpiY, _palette);
}
}
- private void OnBaseChanged(object sender, EventArgs e) =>
+ private void OnBaseChanged(object? sender, EventArgs e) =>
// Change in base renderer or base palette require we fetch the latest renderer
- Renderer = _palette?.GetRenderer();// PaletteImageScaler.ScalePalette(FactorDpiX, FactorDpiY, _palette);
+ Renderer = _palette.GetRenderer();// PaletteImageScaler.ScalePalette(FactorDpiX, FactorDpiY, _palette);
#if !NET462
- private void OnDpiChanged(object sender, DpiChangedEventArgs e) => UpdateDpiFactors();
+ private void OnDpiChanged(object? sender, DpiChangedEventArgs e) => UpdateDpiFactors();
#endif
#endregion
@@ -1985,7 +1757,6 @@ private void InitializeComponent()
ClientSize = new Size(284, 261);
Name = "VisualForm";
ResumeLayout(false);
-
}
}
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualInformationBoxForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualInformationBoxForm.Designer.cs
new file mode 100644
index 000000000..6a3175f0f
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualInformationBoxForm.Designer.cs
@@ -0,0 +1,251 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualInformationBoxForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ this.tmrAutoClose = new System.Windows.Forms.Timer(this.components);
+ this.tlpBase = new System.Windows.Forms.TableLayoutPanel();
+ this._panelContent = new Krypton.Toolkit.KryptonPanel();
+ this._panelFooter = new Krypton.Toolkit.KryptonPanel();
+ this.tlpContent = new System.Windows.Forms.TableLayoutPanel();
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ this._checkBox = new Krypton.Toolkit.KryptonCheckBox();
+ this.pictureBox1 = new System.Windows.Forms.PictureBox();
+ this._panelButtons = new Krypton.Toolkit.KryptonPanel();
+ this._borderEdge = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kpnlContentArea = new Krypton.Toolkit.KryptonPanel();
+ this.kwlblMessageText = new Krypton.Toolkit.KryptonWrapLabel();
+ this.klwlblMessageText = new Krypton.Toolkit.KryptonLinkWrapLabel();
+ this.tlpBase.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this._panelContent)).BeginInit();
+ this._panelContent.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this._panelFooter)).BeginInit();
+ this._panelFooter.SuspendLayout();
+ this.tlpContent.SuspendLayout();
+ this.tableLayoutPanel1.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this._panelButtons)).BeginInit();
+ this._panelButtons.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlContentArea)).BeginInit();
+ this.kpnlContentArea.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // tlpBase
+ //
+ this.tlpBase.BackColor = System.Drawing.Color.Transparent;
+ this.tlpBase.ColumnCount = 1;
+ this.tlpBase.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpBase.Controls.Add(this._panelContent, 0, 0);
+ this.tlpBase.Controls.Add(this._panelFooter, 0, 1);
+ this.tlpBase.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpBase.Location = new System.Drawing.Point(0, 0);
+ this.tlpBase.Name = "tlpBase";
+ this.tlpBase.RowCount = 2;
+ this.tlpBase.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpBase.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tlpBase.Size = new System.Drawing.Size(267, 163);
+ this.tlpBase.TabIndex = 0;
+ //
+ // _panelContent
+ //
+ this._panelContent.Controls.Add(this.tlpContent);
+ this._panelContent.Dock = System.Windows.Forms.DockStyle.Fill;
+ this._panelContent.Location = new System.Drawing.Point(0, 0);
+ this._panelContent.Margin = new System.Windows.Forms.Padding(0);
+ this._panelContent.Name = "_panelContent";
+ this._panelContent.Size = new System.Drawing.Size(267, 98);
+ this._panelContent.TabIndex = 3;
+ //
+ // _panelFooter
+ //
+ this._panelFooter.Controls.Add(this.tableLayoutPanel1);
+ this._panelFooter.Dock = System.Windows.Forms.DockStyle.Fill;
+ this._panelFooter.Location = new System.Drawing.Point(0, 98);
+ this._panelFooter.Margin = new System.Windows.Forms.Padding(0);
+ this._panelFooter.Name = "_panelFooter";
+ this._panelFooter.Size = new System.Drawing.Size(267, 65);
+ this._panelFooter.TabIndex = 4;
+ //
+ // tlpContent
+ //
+ this.tlpContent.ColumnCount = 2;
+ this.tlpContent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tlpContent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpContent.Controls.Add(this.kpnlContentArea, 1, 0);
+ this.tlpContent.Controls.Add(this.pictureBox1, 0, 0);
+ this.tlpContent.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tlpContent.Location = new System.Drawing.Point(0, 0);
+ this.tlpContent.Name = "tlpContent";
+ this.tlpContent.RowCount = 1;
+ this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tlpContent.Size = new System.Drawing.Size(267, 98);
+ this.tlpContent.TabIndex = 0;
+ //
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.ColumnCount = 1;
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.Controls.Add(this._panelButtons, 0, 1);
+ this.tableLayoutPanel1.Controls.Add(this._checkBox, 0, 0);
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 2;
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(267, 65);
+ this.tableLayoutPanel1.TabIndex = 0;
+ //
+ // _checkBox
+ //
+ this._checkBox.Dock = System.Windows.Forms.DockStyle.Fill;
+ this._checkBox.Location = new System.Drawing.Point(3, 3);
+ this._checkBox.Name = "_checkBox";
+ this._checkBox.Size = new System.Drawing.Size(261, 20);
+ this._checkBox.TabIndex = 1;
+ this._checkBox.Values.Text = "checkBox";
+ //
+ // pictureBox1
+ //
+ this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pictureBox1.Location = new System.Drawing.Point(5, 5);
+ this.pictureBox1.Margin = new System.Windows.Forms.Padding(5);
+ this.pictureBox1.Name = "pictureBox1";
+ this.pictureBox1.Size = new System.Drawing.Size(48, 88);
+ this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.pictureBox1.TabIndex = 0;
+ this.pictureBox1.TabStop = false;
+ //
+ // _panelButtons
+ //
+ this.tableLayoutPanel1.SetColumnSpan(this._panelButtons, 2);
+ this._panelButtons.Controls.Add(this._borderEdge);
+ this._panelButtons.Dock = System.Windows.Forms.DockStyle.Fill;
+ this._panelButtons.Location = new System.Drawing.Point(0, 26);
+ this._panelButtons.Margin = new System.Windows.Forms.Padding(0);
+ this._panelButtons.Name = "_panelButtons";
+ this._panelButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this._panelButtons.Size = new System.Drawing.Size(267, 39);
+ this._panelButtons.TabIndex = 2;
+ //
+ // _borderEdge
+ //
+ this._borderEdge.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this._borderEdge.Dock = System.Windows.Forms.DockStyle.Top;
+ this._borderEdge.Location = new System.Drawing.Point(0, 0);
+ this._borderEdge.Margin = new System.Windows.Forms.Padding(2);
+ this._borderEdge.Name = "_borderEdge";
+ this._borderEdge.Size = new System.Drawing.Size(267, 1);
+ this._borderEdge.Text = "kryptonBorderEdge1";
+ //
+ // kpnlContentArea
+ //
+ this.kpnlContentArea.Controls.Add(this.kwlblMessageText);
+ this.kpnlContentArea.Controls.Add(this.klwlblMessageText);
+ this.kpnlContentArea.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlContentArea.Location = new System.Drawing.Point(61, 3);
+ this.kpnlContentArea.Name = "kpnlContentArea";
+ this.kpnlContentArea.Size = new System.Drawing.Size(203, 92);
+ this.kpnlContentArea.TabIndex = 2;
+ //
+ // kwlblMessageText
+ //
+ this.kwlblMessageText.AutoSize = false;
+ this.kwlblMessageText.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kwlblMessageText.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.kwlblMessageText.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.kwlblMessageText.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.kwlblMessageText.Location = new System.Drawing.Point(0, 0);
+ this.kwlblMessageText.Name = "kwlblMessageText";
+ this.kwlblMessageText.Size = new System.Drawing.Size(203, 92);
+ this.kwlblMessageText.Text = "Message Text";
+ this.kwlblMessageText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // klwlblMessageText
+ //
+ this.klwlblMessageText.AutoSize = false;
+ this.klwlblMessageText.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.klwlblMessageText.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this.klwlblMessageText.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this.klwlblMessageText.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this.klwlblMessageText.Location = new System.Drawing.Point(0, 0);
+ this.klwlblMessageText.Name = "klwlblMessageText";
+ this.klwlblMessageText.Size = new System.Drawing.Size(203, 92);
+ this.klwlblMessageText.Text = "Message Text";
+ this.klwlblMessageText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // VisualInformationBoxForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(267, 163);
+ this.Controls.Add(this.tlpBase);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+ this.FormTitleAlign = Krypton.Toolkit.PaletteRelativeAlign.Inherit;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualInformationBoxForm";
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.tlpBase.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this._panelContent)).EndInit();
+ this._panelContent.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this._panelFooter)).EndInit();
+ this._panelFooter.ResumeLayout(false);
+ this.tlpContent.ResumeLayout(false);
+ this.tableLayoutPanel1.ResumeLayout(false);
+ this.tableLayoutPanel1.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this._panelButtons)).EndInit();
+ this._panelButtons.ResumeLayout(false);
+ this._panelButtons.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlContentArea)).EndInit();
+ this.kpnlContentArea.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Timer tmrAutoClose;
+ private TableLayoutPanel tlpBase;
+ private KryptonPanel _panelContent;
+ private KryptonPanel _panelFooter;
+ private TableLayoutPanel tlpContent;
+ private TableLayoutPanel tableLayoutPanel1;
+ private KryptonCheckBox _checkBox;
+ private PictureBox pictureBox1;
+ private KryptonPanel _panelButtons;
+ private KryptonBorderEdge _borderEdge;
+ private KryptonPanel kpnlContentArea;
+ private KryptonWrapLabel kwlblMessageText;
+ private KryptonLinkWrapLabel klwlblMessageText;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualInformationBoxForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualInformationBoxForm.cs
new file mode 100644
index 000000000..6cdea3049
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualInformationBoxForm.cs
@@ -0,0 +1,19 @@
+#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. 2024 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualInformationBoxForm : KryptonForm
+ {
+ public VisualInformationBoxForm()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualInformationBoxForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualInformationBoxForm.resx
new file mode 100644
index 000000000..4bcf66dfc
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualInformationBoxForm.resx
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 17, 17
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonInputBoxForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualInputBoxForm.Designer.cs
similarity index 96%
rename from Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonInputBoxForm.Designer.cs
rename to Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualInputBoxForm.Designer.cs
index 72dc179d3..42efca714 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonInputBoxForm.Designer.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualInputBoxForm.Designer.cs
@@ -1,6 +1,6 @@
namespace Krypton.Toolkit
{
- partial class KryptonInputBoxForm
+ partial class VisualInputBoxForm
{
///
/// Required designer variable.
@@ -49,7 +49,7 @@ private void InitializeComponent()
this._panelMessage.Dock = System.Windows.Forms.DockStyle.Fill;
this._panelMessage.Location = new System.Drawing.Point(0, 0);
this._panelMessage.Name = "_panelMessage";
- this._panelMessage.Size = new System.Drawing.Size(350, 106);
+ this._panelMessage.Size = new System.Drawing.Size(362, 118);
this._panelMessage.TabIndex = 1;
//
// _tableLayoutPanel1
@@ -122,7 +122,6 @@ private void InitializeComponent()
//
this._buttonOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this._buttonOk.AutoSize = true;
- this._buttonOk.CornerRoundingRadius = -1F;
this._buttonOk.DialogResult = System.Windows.Forms.DialogResult.OK;
this._buttonOk.Location = new System.Drawing.Point(213, 0);
this._buttonOk.Margin = new System.Windows.Forms.Padding(0, 0, 0, 8);
@@ -136,7 +135,6 @@ private void InitializeComponent()
//
this._buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this._buttonCancel.AutoSize = true;
- this._buttonCancel.CornerRoundingRadius = -1F;
this._buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this._buttonCancel.Location = new System.Drawing.Point(285, 0);
this._buttonCancel.Margin = new System.Windows.Forms.Padding(0);
@@ -146,18 +144,18 @@ private void InitializeComponent()
this._buttonCancel.TabIndex = 2;
this._buttonCancel.Values.Text = "Cance&l";
//
- // KryptonInputBoxForm
+ // VisualInputBoxForm
//
this.AcceptButton = this._buttonOk;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this._buttonCancel;
- this.ClientSize = new System.Drawing.Size(350, 106);
+ this.ClientSize = new System.Drawing.Size(362, 118);
this.Controls.Add(this._panelMessage);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.MaximizeBox = false;
this.MinimizeBox = false;
- this.Name = "KryptonInputBoxForm";
+ this.Name = "VisualInputBoxForm";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualInputBoxForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualInputBoxForm.cs
new file mode 100644
index 000000000..aa4af6dc9
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualInputBoxForm.cs
@@ -0,0 +1,116 @@
+#region BSD License
+/*
+ *
+ * Original BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE)
+ * © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
+ *
+ * New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+namespace Krypton.Toolkit
+{
+ ///
+ ///
+ ///
+ public partial class VisualInputBoxForm : KryptonForm
+ {
+ #region Instance Fields
+
+ private readonly KryptonInputBoxData _inputBoxData;
+
+ #endregion
+
+ #region Identity
+
+ ///
+ ///
+ ///
+ public VisualInputBoxForm()
+ {
+ InitializeComponent();
+ }
+
+ /// Initializes a new instance of the class.
+ /// The input box data.
+ public VisualInputBoxForm(KryptonInputBoxData inputBoxData)
+ {
+ InitializeComponent();
+
+ _inputBoxData = inputBoxData;
+
+ // Update contents to match requirements
+ UpdateText();
+
+ UpdateCue();
+
+ UpdateButtons();
+ }
+
+ #endregion
+
+ #region Implementation
+
+ internal static string InternalShow(KryptonInputBoxData inputBoxData)
+ {
+ // If do not have an owner passed in then get the active window and use that instead
+ IWin32Window? showOwner = inputBoxData.Owner ?? FromHandle(PI.GetActiveWindow());
+
+ // Show input box window as a modal dialog and then dispose of it afterwards
+ using var ib = new VisualInputBoxForm(inputBoxData);
+ ib.StartPosition = showOwner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;
+
+ return ib.ShowDialog(showOwner) == DialogResult.OK
+ ? ib.InputResponse
+ : string.Empty;
+ }
+
+ internal string InputResponse => _textBoxResponse.Text;
+
+ private void UpdateText()
+ {
+ Text = _inputBoxData.Caption;
+ _labelPrompt.Text = _inputBoxData.Prompt;
+ _textBoxResponse.Text = _inputBoxData.DefaultResponse;
+ _textBoxResponse.UseSystemPasswordChar = _inputBoxData.UsePasswordOption ?? false;
+ }
+
+ private void UpdateCue()
+ {
+ _textBoxResponse.CueHint.CueHintText = _inputBoxData.CueText;
+
+ if (_inputBoxData.CueColor != null || _inputBoxData.CueColor != Color.Transparent || _inputBoxData.CueColor != GlobalStaticValues.EMPTY_COLOR)
+ {
+ _textBoxResponse.CueHint.Color1 = _inputBoxData.CueColor ?? Color.Gray;
+ }
+
+ if (_inputBoxData.CueTypeface != null)
+ {
+ _textBoxResponse.CueHint.Font = _inputBoxData.CueTypeface ?? KryptonManager.CurrentGlobalPalette.BaseFont;
+ }
+ }
+
+ private void UpdateButtons()
+ {
+ _buttonOk.Text = KryptonManager.Strings.GeneralStrings.OK;
+ _buttonCancel.Text = KryptonManager.Strings.GeneralStrings.Cancel;
+ }
+
+ private void Response_KeyDown(object sender, KeyEventArgs e)
+ {
+ switch (e.KeyCode)
+ {
+ case Keys.Enter:
+ _buttonOk.PerformClick();
+ break;
+ case Keys.Escape:
+ _buttonCancel.PerformClick();
+ break;
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualInputBoxForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualInputBoxForm.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualInputBoxForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualMessageBoxForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualMessageBoxForm.Designer.cs
new file mode 100644
index 000000000..967fdd3df
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualMessageBoxForm.Designer.cs
@@ -0,0 +1,267 @@
+#region BSD License
+/*
+ *
+ * Original BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE)
+ * © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
+ *
+ * New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+
+namespace Krypton.Toolkit
+{
+ partial class VisualMessageBoxForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this._messageIcon = new System.Windows.Forms.PictureBox();
+ this._panelButtons = new Krypton.Toolkit.KryptonPanel();
+ this._borderEdge = new Krypton.Toolkit.KryptonBorderEdge();
+ this._button4 = new Krypton.Toolkit.MessageButton();
+ this._button3 = new Krypton.Toolkit.MessageButton();
+ this._button1 = new Krypton.Toolkit.MessageButton();
+ this._button2 = new Krypton.Toolkit.MessageButton();
+ this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ this.kpnlContentArea = new Krypton.Toolkit.KryptonPanel();
+ this.krtbMessageText = new Krypton.Toolkit.KryptonRichTextBox();
+ ((System.ComponentModel.ISupportInitialize)(this._messageIcon)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this._panelButtons)).BeginInit();
+ this._panelButtons.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
+ this.kryptonPanel1.SuspendLayout();
+ this.tableLayoutPanel1.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlContentArea)).BeginInit();
+ this.kpnlContentArea.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // _messageIcon
+ //
+ this._messageIcon.BackColor = System.Drawing.Color.Transparent;
+ this._messageIcon.Dock = System.Windows.Forms.DockStyle.Fill;
+ this._messageIcon.Location = new System.Drawing.Point(8, 4);
+ this._messageIcon.Margin = new System.Windows.Forms.Padding(8, 4, 4, 4);
+ this._messageIcon.Name = "_messageIcon";
+ this._messageIcon.Size = new System.Drawing.Size(33, 35);
+ this._messageIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this._messageIcon.TabIndex = 0;
+ this._messageIcon.TabStop = false;
+ //
+ // _panelButtons
+ //
+ this.tableLayoutPanel1.SetColumnSpan(this._panelButtons, 2);
+ this._panelButtons.Controls.Add(this._borderEdge);
+ this._panelButtons.Controls.Add(this._button4);
+ this._panelButtons.Controls.Add(this._button3);
+ this._panelButtons.Controls.Add(this._button1);
+ this._panelButtons.Controls.Add(this._button2);
+ this._panelButtons.Dock = System.Windows.Forms.DockStyle.Fill;
+ this._panelButtons.Location = new System.Drawing.Point(0, 43);
+ this._panelButtons.Margin = new System.Windows.Forms.Padding(0);
+ this._panelButtons.Name = "_panelButtons";
+ this._panelButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this._panelButtons.Size = new System.Drawing.Size(203, 21);
+ this._panelButtons.TabIndex = 0;
+ //
+ // _borderEdge
+ //
+ this._borderEdge.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this._borderEdge.Dock = System.Windows.Forms.DockStyle.Top;
+ this._borderEdge.Location = new System.Drawing.Point(0, 0);
+ this._borderEdge.Margin = new System.Windows.Forms.Padding(2);
+ this._borderEdge.Name = "_borderEdge";
+ this._borderEdge.Size = new System.Drawing.Size(203, 1);
+ this._borderEdge.Text = "kryptonBorderEdge1";
+ //
+ // _button4
+ //
+ this._button4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this._button4.AutoSize = true;
+ this._button4.Enabled = false;
+ this._button4.IgnoreAltF4 = false;
+ this._button4.Location = new System.Drawing.Point(203, 0);
+ this._button4.Margin = new System.Windows.Forms.Padding(0);
+ this._button4.MinimumSize = new System.Drawing.Size(38, 21);
+ this._button4.Name = "_button4";
+ this._button4.Size = new System.Drawing.Size(38, 26);
+ this._button4.TabIndex = 2;
+ this._button4.Values.DropDownArrowColor = System.Drawing.Color.Empty;
+ this._button4.Values.Text = "B4";
+ this._button4.Visible = false;
+ //
+ // _button3
+ //
+ this._button3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this._button3.AutoSize = true;
+ this._button3.Enabled = false;
+ this._button3.IgnoreAltF4 = false;
+ this._button3.Location = new System.Drawing.Point(166, 0);
+ this._button3.Margin = new System.Windows.Forms.Padding(0);
+ this._button3.MinimumSize = new System.Drawing.Size(38, 21);
+ this._button3.Name = "_button3";
+ this._button3.Size = new System.Drawing.Size(38, 26);
+ this._button3.TabIndex = 2;
+ this._button3.Values.DropDownArrowColor = System.Drawing.Color.Empty;
+ this._button3.Values.Text = "B3";
+ this._button3.Visible = false;
+ //
+ // _button1
+ //
+ this._button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this._button1.AutoSize = true;
+ this._button1.Enabled = false;
+ this._button1.IgnoreAltF4 = false;
+ this._button1.Location = new System.Drawing.Point(90, 0);
+ this._button1.Margin = new System.Windows.Forms.Padding(0);
+ this._button1.MinimumSize = new System.Drawing.Size(38, 21);
+ this._button1.Name = "_button1";
+ this._button1.Size = new System.Drawing.Size(38, 26);
+ this._button1.TabIndex = 0;
+ this._button1.Values.DropDownArrowColor = System.Drawing.Color.Empty;
+ this._button1.Values.Text = "B1";
+ this._button1.Visible = false;
+ //
+ // _button2
+ //
+ this._button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this._button2.AutoSize = true;
+ this._button2.Enabled = false;
+ this._button2.IgnoreAltF4 = false;
+ this._button2.Location = new System.Drawing.Point(128, 0);
+ this._button2.Margin = new System.Windows.Forms.Padding(0);
+ this._button2.MinimumSize = new System.Drawing.Size(38, 21);
+ this._button2.Name = "_button2";
+ this._button2.Size = new System.Drawing.Size(38, 26);
+ this._button2.TabIndex = 1;
+ this._button2.Values.DropDownArrowColor = System.Drawing.Color.Empty;
+ this._button2.Values.Text = "B2";
+ this._button2.Visible = false;
+ //
+ // kryptonPanel1
+ //
+ this.kryptonPanel1.Controls.Add(this.tableLayoutPanel1);
+ this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonPanel1.Margin = new System.Windows.Forms.Padding(2);
+ this.kryptonPanel1.Name = "kryptonPanel1";
+ this.kryptonPanel1.Size = new System.Drawing.Size(203, 64);
+ this.kryptonPanel1.TabIndex = 1;
+ //
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel1.ColumnCount = 2;
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.Controls.Add(this._panelButtons, 0, 1);
+ this.tableLayoutPanel1.Controls.Add(this._messageIcon, 0, 0);
+ this.tableLayoutPanel1.Controls.Add(this.kpnlContentArea, 1, 0);
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
+ this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(2);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 2;
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(203, 64);
+ this.tableLayoutPanel1.TabIndex = 0;
+ //
+ // kpnlContentArea
+ //
+ this.kpnlContentArea.Controls.Add(this.krtbMessageText);
+ this.kpnlContentArea.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlContentArea.Location = new System.Drawing.Point(49, 12);
+ this.kpnlContentArea.Margin = new System.Windows.Forms.Padding(4, 12, 4, 12);
+ this.kpnlContentArea.Name = "kpnlContentArea";
+ this.kpnlContentArea.Size = new System.Drawing.Size(150, 19);
+ this.kpnlContentArea.TabIndex = 1;
+ //
+ // krtbMessageText
+ //
+ this.krtbMessageText.DetectUrls = false;
+ this.krtbMessageText.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.krtbMessageText.InputControlStyle = Krypton.Toolkit.InputControlStyle.PanelClient;
+ this.krtbMessageText.Location = new System.Drawing.Point(0, 0);
+ this.krtbMessageText.Margin = new System.Windows.Forms.Padding(0);
+ this.krtbMessageText.Name = "krtbMessageText";
+ this.krtbMessageText.ReadOnly = true;
+ this.krtbMessageText.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None;
+ this.krtbMessageText.Size = new System.Drawing.Size(150, 19);
+ this.krtbMessageText.StateCommon.Border.DrawBorders = Krypton.Toolkit.PaletteDrawBorders.None;
+ this.krtbMessageText.TabIndex = 0;
+ this.krtbMessageText.TabStop = false;
+ this.krtbMessageText.Text = "Message Text\n.\ttabbed";
+ this.krtbMessageText.WordWrap = false;
+ //
+ // VisualMessageBoxForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(203, 64);
+ this.Controls.Add(this.kryptonPanel1);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+ this.KeyPreview = true;
+ this.Margin = new System.Windows.Forms.Padding(2);
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualMessageBoxForm";
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+ this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.AnyKeyDown);
+ this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.OnFormClosed);
+ ((System.ComponentModel.ISupportInitialize)(this._messageIcon)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this._panelButtons)).EndInit();
+ this._panelButtons.ResumeLayout(false);
+ this._panelButtons.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
+ this.kryptonPanel1.ResumeLayout(false);
+ this.tableLayoutPanel1.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlContentArea)).EndInit();
+ this.kpnlContentArea.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+ private PictureBox _messageIcon;
+ private KryptonPanel _panelButtons;
+ private MessageButton _button1;
+ private MessageButton _button2;
+ private MessageButton _button3;
+ private MessageButton _button4;
+ private KryptonBorderEdge _borderEdge;
+ private KryptonPanel kryptonPanel1;
+ private TableLayoutPanel tableLayoutPanel1;
+ private KryptonPanel kpnlContentArea;
+ private KryptonRichTextBox krtbMessageText;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonMessageBoxForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualMessageBoxForm.cs
similarity index 56%
rename from Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonMessageBoxForm.cs
rename to Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualMessageBoxForm.cs
index 110fd7c2a..0c8f8ffe6 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonMessageBoxForm.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualMessageBoxForm.cs
@@ -5,106 +5,79 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
// ReSharper disable InconsistentNaming
// ReSharper disable UnusedParameter.Local
-using ContentAlignment = System.Drawing.ContentAlignment;
namespace Krypton.Toolkit
{
- internal partial class KryptonMessageBoxForm : KryptonForm
+ internal partial class VisualMessageBoxForm : KryptonForm
{
- #region Static Fields
- private const int GAP = 10;
- private static readonly int OS_MAJOR_VERSION;
- #endregion
#region Instance Fields
private readonly bool _showHelpButton;
- private readonly string _text;
- private readonly string _caption;
- private readonly string _applicationPath;
+ private readonly string? _text;
+ private readonly string? _caption;
private readonly KryptonMessageBoxButtons _buttons;
private readonly KryptonMessageBoxIcon _kryptonMessageBoxIcon;
- private readonly Image? _applicationImage;
-
private readonly KryptonMessageBoxDefaultButton _defaultButton;
- private readonly MessageBoxOptions _options; // https://github.com/Krypton-Suite/Standard-Toolkit/issues/313
- // If help information provided or we are not a service/default desktop application then grab an owner for showing the message box
+ // If help information provided, or we are not a service/default desktop application then grab an owner for showing the message box
private readonly IWin32Window? _showOwner;
private readonly HelpInfo? _helpInfo;
+ private readonly KryptonMessageBoxNativeWindow _krtbNativeWindow;
+
+ #endregion
- // Action button features (aka _button5)
- private readonly bool _showActionButton;
- private readonly string _actionButtonText;
- private readonly KryptonCommand? _actionButtonCommand;
+ #region Public
- // For the LinkLabel option
- private readonly MessageBoxContentAreaType? _contentAreaType;
- private readonly KryptonCommand? _linkLabelCommand;
- private readonly ProcessStartInfo? _linkLaunchArgument;
- private readonly ContentAlignment? _messageTextAlignment;
- private readonly LinkArea _contentLinkArea;
+ public KryptonMessageBoxResult MessageBoxResult { get; set; }
#endregion
#region Identity
- static KryptonMessageBoxForm() => OS_MAJOR_VERSION = Environment.OSVersion.Version.Major;
- public KryptonMessageBoxForm()
+ public VisualMessageBoxForm()
{
InitializeComponent();
}
-
- internal KryptonMessageBoxForm(IWin32Window? showOwner, string text, string caption,
+ internal VisualMessageBoxForm(IWin32Window? showOwner, string? text, string? caption,
KryptonMessageBoxButtons buttons,
KryptonMessageBoxIcon icon,
KryptonMessageBoxDefaultButton defaultButton,
- MessageBoxOptions options,
HelpInfo? helpInfo, bool? showCtrlCopy,
bool? showHelpButton,
- bool? showActionButton, string? actionButtonText,
- KryptonCommand? actionButtonCommand,
- Image? applicationImage,
- string? applicationPath,
- MessageBoxContentAreaType? contentAreaType,
- KryptonCommand? linkLabelCommand,
- ProcessStartInfo? linkLaunchArgument,
- LinkArea? contentLinkArea,
- ContentAlignment? messageTextAlignment)
+ bool? showCloseButton)
{
// Store incoming values
- _text = text;
+ _text = CommonHelper.NormalizeLineBreaks(text ?? string.Empty);
_caption = caption;
_buttons = buttons;
_kryptonMessageBoxIcon = icon;
_defaultButton = defaultButton;
- _options = options;
_helpInfo = helpInfo;
_showOwner = showOwner;
_showHelpButton = showHelpButton ?? (helpInfo != null);
- _showActionButton = showActionButton ?? false;
- _actionButtonText = actionButtonText ?? string.Empty;
- _actionButtonCommand = actionButtonCommand;
- _applicationImage = applicationImage;
- _applicationPath = applicationPath ?? string.Empty;
- _contentAreaType = contentAreaType ?? MessageBoxContentAreaType.Normal;
- _linkLabelCommand = linkLabelCommand ?? new KryptonCommand();
- _contentLinkArea = contentLinkArea ?? new LinkArea(0, text.Length);
- _linkLaunchArgument = linkLaunchArgument ?? new ProcessStartInfo();
- _messageTextAlignment = messageTextAlignment ?? ContentAlignment.MiddleLeft;
+ _krtbNativeWindow = new();
// Create the form contents
InitializeComponent();
- RightToLeftLayout = _options.HasFlag(MessageBoxOptions.RtlReading);
+ // Hookup the native window on the KRTB, only after IntializeComponent().
+ _krtbNativeWindow.AssignHandle(krtbMessageText.RichTextBox.Handle);
+
+ // Default Cursor for the KRTB when the cursors hovers over it
+ krtbMessageText.RichTextBox.Cursor = Cursors.Arrow;
+
+ // #1692 text font colour for input controls does not work correct on KMBees when using dark themes.
+ // Set the text colour to the one a control uses.
+ krtbMessageText.StateCommon.Content.Color1 = GlobalStaticValues.KryptonMessageBoxRichTextBoxTextColor;
// Update contents to match requirements
UpdateText();
@@ -113,14 +86,10 @@ internal KryptonMessageBoxForm(IWin32Window? showOwner, string text, string capt
UpdateDefault();
UpdateHelp();
UpdateTextExtra(showCtrlCopy);
- UpdateContentAreaType(contentAreaType);
- UpdateContentAreaTextAlignment(contentAreaType, messageTextAlignment);
- UpdateContentLinkArea(contentLinkArea);
-
- SetupActionButtonUI(_showActionButton);
-
// Finally calculate and set form sizing
UpdateSizing(showOwner);
+
+ ShowCloseButton(showCloseButton);
}
#endregion Identity
@@ -129,25 +98,11 @@ internal KryptonMessageBoxForm(IWin32Window? showOwner, string text, string capt
private void UpdateText()
{
- Text = string.IsNullOrEmpty(_caption) ? string.Empty : _caption.Split(Environment.NewLine.ToCharArray())[0];
-
- if (_contentAreaType == MessageBoxContentAreaType.Normal)
- {
- _messageText.Text = _text;
-
- _messageText.RightToLeft = _options.HasFlag(MessageBoxOptions.RightAlign)
- ? RightToLeft.Yes
- : _options.HasFlag(MessageBoxOptions.RtlReading)
- ? RightToLeft.Inherit
- : RightToLeft.No;
- }
- else
- {
- _linkLabelMessageText.Text = _text;
+ Text = string.IsNullOrEmpty(_caption)
+ ? string.Empty
+ : _caption!.Split(Environment.NewLine.ToCharArray())[0];
- _linkLabelMessageText.RightToLeft = _options.HasFlag(MessageBoxOptions.RightAlign) ? RightToLeft.Yes :
- _options.HasFlag(MessageBoxOptions.RtlReading) ? RightToLeft.Inherit : RightToLeft.No;
- }
+ krtbMessageText.Text = _text;
}
private void UpdateTextExtra(bool? showCtrlCopy)
@@ -171,40 +126,54 @@ private void UpdateTextExtra(bool? showCtrlCopy)
private void UpdateIcon()
{
- if (OSUtilities.IsWindowsEleven)
+ if (OSUtilities.IsAtLeastWindowsEleven)
{
switch (_kryptonMessageBoxIcon)
{
case KryptonMessageBoxIcon.None:
// Windows XP and before will Beep, Vista and above do not!
- if (OS_MAJOR_VERSION < 6)
- {
- SystemSounds.Beep.Play();
- }
break;
case KryptonMessageBoxIcon.Hand:
_messageIcon.Image = MessageBoxImageResources.GenericHand;
SystemSounds.Hand.Play();
break;
+ case KryptonMessageBoxIcon.SystemHand:
+ //case KryptonMessageBoxIcon.SystemStop:
+ //case KryptonMessageBoxIcon.SystemError:
+ _messageIcon.Image = SystemIcons.Hand.ToBitmap();
+ SystemSounds.Hand.Play();
+ break;
case KryptonMessageBoxIcon.Question:
_messageIcon.Image = MessageBoxImageResources.Question_Windows_11;
SystemSounds.Question.Play();
break;
+ case KryptonMessageBoxIcon.SystemQuestion:
+ _messageIcon.Image = SystemIcons.Question.ToBitmap();
+ SystemSounds.Question.Play();
+ break;
case KryptonMessageBoxIcon.Exclamation:
_messageIcon.Image = MessageBoxImageResources.Warning_Windows_11;
SystemSounds.Exclamation.Play();
break;
+ case KryptonMessageBoxIcon.SystemExclamation:
+ _messageIcon.Image = SystemIcons.Warning.ToBitmap();
+ SystemSounds.Exclamation.Play();
+ break;
case KryptonMessageBoxIcon.Asterisk:
_messageIcon.Image = MessageBoxImageResources.Asterisk_Windows_11;
SystemSounds.Asterisk.Play();
break;
+ case KryptonMessageBoxIcon.SystemAsterisk:
+ _messageIcon.Image = SystemIcons.Asterisk.ToBitmap();
+ SystemSounds.Asterisk.Play();
+ break;
case KryptonMessageBoxIcon.Stop:
_messageIcon.Image = MessageBoxImageResources.GenericStop;
- SystemSounds.Asterisk.Play();
+ SystemSounds.Hand.Play();
break;
case KryptonMessageBoxIcon.Error:
_messageIcon.Image = MessageBoxImageResources.Critical_Windows_11;
- SystemSounds.Asterisk.Play();
+ SystemSounds.Hand.Play();
break;
case KryptonMessageBoxIcon.Warning:
_messageIcon.Image = MessageBoxImageResources.Warning_Windows_11;
@@ -212,30 +181,24 @@ private void UpdateIcon()
break;
case KryptonMessageBoxIcon.Information:
_messageIcon.Image = MessageBoxImageResources.Information_Windows_11;
- SystemSounds.Asterisk.Play();
+ SystemSounds.Exclamation.Play();
break;
case KryptonMessageBoxIcon.Shield:
_messageIcon.Image = UACShieldIconResources.UAC_Shield_Windows_11;
break;
case KryptonMessageBoxIcon.WindowsLogo:
+ // Because Windows 11 displays a generic application icon,
+ // we need to rely on an image instead
_messageIcon.Image = MessageBoxImageResources.Windows11;
break;
case KryptonMessageBoxIcon.Application:
- if (_applicationImage != null)
- {
- _messageIcon.Image = _applicationImage;
- }
- else if (!string.IsNullOrEmpty(_applicationPath))
{
- Image? sourceImage = GraphicsExtensions.ExtractIconFromFilePath(_applicationPath)?.ToBitmap();
+ var applicationPath = Application.ExecutablePath;
+ Image? sourceImage = GraphicsExtensions.ExtractIconFromFilePath(applicationPath)?.ToBitmap();
Image? scaledImage = GraphicsExtensions.ScaleImage(sourceImage, new Size(32, 32));
-
- _messageIcon.Image = scaledImage;
- }
- else
- {
- // Fall back to defaults
- _messageIcon.Image = SystemIcons.Application.ToBitmap();
+ _messageIcon.Image = scaledImage ??
+ // Fall back to defaults
+ SystemIcons.Application.ToBitmap();
}
break;
case KryptonMessageBoxIcon.SystemApplication:
@@ -249,16 +212,14 @@ private void UpdateIcon()
{
case KryptonMessageBoxIcon.None:
// Windows XP and before will Beep, Vista and above do not!
- if (OS_MAJOR_VERSION < 6)
- {
- SystemSounds.Beep.Play();
- }
break;
case KryptonMessageBoxIcon.Hand:
_messageIcon.Image = MessageBoxImageResources.GenericHand;
SystemSounds.Hand.Play();
break;
case KryptonMessageBoxIcon.SystemHand:
+ //case KryptonMessageBoxIcon.SystemStop:
+ //case KryptonMessageBoxIcon.SystemError:
_messageIcon.Image = SystemIcons.Hand.ToBitmap();
SystemSounds.Hand.Play();
break;
@@ -279,9 +240,7 @@ private void UpdateIcon()
SystemSounds.Exclamation.Play();
break;
case KryptonMessageBoxIcon.Asterisk:
- _messageIcon.Image = OSUtilities.IsWindowsEleven
- ? MessageBoxImageResources.Asterisk_Windows_11
- : MessageBoxImageResources.GenericAsterisk;
+ _messageIcon.Image = MessageBoxImageResources.GenericAsterisk;
SystemSounds.Asterisk.Play();
break;
case KryptonMessageBoxIcon.SystemAsterisk:
@@ -290,11 +249,11 @@ private void UpdateIcon()
break;
case KryptonMessageBoxIcon.Stop:
_messageIcon.Image = MessageBoxImageResources.GenericStop;
- SystemSounds.Asterisk.Play();
+ SystemSounds.Hand.Play();
break;
case KryptonMessageBoxIcon.Error:
_messageIcon.Image = MessageBoxImageResources.GenericCritical;
- SystemSounds.Asterisk.Play();
+ SystemSounds.Hand.Play();
break;
case KryptonMessageBoxIcon.Warning:
_messageIcon.Image = MessageBoxImageResources.GenericWarning;
@@ -302,55 +261,26 @@ private void UpdateIcon()
break;
case KryptonMessageBoxIcon.Information:
_messageIcon.Image = MessageBoxImageResources.GenericInformation;
- SystemSounds.Asterisk.Play();
+ SystemSounds.Exclamation.Play();
break;
case KryptonMessageBoxIcon.Shield:
- if (OSUtilities.IsWindowsEleven)
- {
- _messageIcon.Image = UACShieldIconResources.UAC_Shield_Windows_11;
- }
- else if (OSUtilities.IsWindowsTen)
- {
- _messageIcon.Image = UACShieldIconResources.UAC_Shield_Windows_10;
- }
- else
- {
- _messageIcon.Image = UACShieldIconResources.UAC_Shield_Windows_7;
- }
+ _messageIcon.Image = OSUtilities.IsWindowsTen
+ ? UACShieldIconResources.UAC_Shield_Windows_10
+ : UACShieldIconResources.UAC_Shield_Windows_7;
break;
case KryptonMessageBoxIcon.WindowsLogo:
- // Because Windows 11 displays a generic application icon,
- // we need to rely on a image instead
- if (OSUtilities.IsWindowsEleven)
- {
- _messageIcon.Image = MessageBoxImageResources.Windows11;
- }
- // Windows 10
- else if (OSUtilities.IsWindowsTen)
- {
- _messageIcon.Image = MessageBoxImageResources.Windows_8_and_10_Logo;
- }
- else
- {
- _messageIcon.Image = SystemIcons.WinLogo.ToBitmap();
- }
+ _messageIcon.Image = OSUtilities.IsWindowsTen
+ ? MessageBoxImageResources.Windows_8_and_10_Logo
+ : SystemIcons.WinLogo.ToBitmap();
break;
case KryptonMessageBoxIcon.Application:
- if (_applicationImage != null)
{
- _messageIcon.Image = _applicationImage;
- }
- else if (!string.IsNullOrEmpty(_applicationPath))
- {
- Image? sourceImage = GraphicsExtensions.ExtractIconFromFilePath(_applicationPath)?.ToBitmap();
+ var applicationPath = Application.ExecutablePath;
+ Image? sourceImage = GraphicsExtensions.ExtractIconFromFilePath(applicationPath)?.ToBitmap();
Image? scaledImage = GraphicsExtensions.ScaleImage(sourceImage, new Size(32, 32));
-
- _messageIcon.Image = scaledImage;
- }
- else
- {
- // Fall back to defaults
- _messageIcon.Image = SystemIcons.Application.ToBitmap();
+ _messageIcon.Image = scaledImage ??
+ // Fall back to defaults
+ SystemIcons.Application.ToBitmap();
}
break;
case KryptonMessageBoxIcon.SystemApplication:
@@ -358,9 +288,7 @@ private void UpdateIcon()
break;
}
}
-
_messageIcon.Visible = (_kryptonMessageBoxIcon != KryptonMessageBoxIcon.None);
-
}
private void UpdateButtons()
@@ -368,14 +296,15 @@ private void UpdateButtons()
switch (_buttons)
{
case KryptonMessageBoxButtons.OK:
- _button1.Text = KryptonLanguageManager.GeneralToolkitStrings.OK;
+ _button1.Text = KryptonManager.Strings.GeneralStrings.OK;
_button1.DialogResult = DialogResult.OK;
_button1.Visible = true;
_button1.Enabled = true;
break;
+
case KryptonMessageBoxButtons.OKCancel:
- _button1.Text = KryptonLanguageManager.GeneralToolkitStrings.OK;
- _button2.Text = KryptonLanguageManager.GeneralToolkitStrings.Cancel;
+ _button1.Text = KryptonManager.Strings.GeneralStrings.OK;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.Cancel;
_button1.DialogResult = DialogResult.OK;
_button2.DialogResult = DialogResult.Cancel;
_button1.Visible = true;
@@ -383,9 +312,10 @@ private void UpdateButtons()
_button2.Visible = true;
_button2.Enabled = true;
break;
+
case KryptonMessageBoxButtons.YesNo:
- _button1.Text = KryptonLanguageManager.GeneralToolkitStrings.Yes;
- _button2.Text = KryptonLanguageManager.GeneralToolkitStrings.No;
+ _button1.Text = KryptonManager.Strings.GeneralStrings.Yes;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.No;
_button1.DialogResult = DialogResult.Yes;
_button2.DialogResult = DialogResult.No;
_button1.Visible = true;
@@ -394,10 +324,11 @@ private void UpdateButtons()
_button2.Enabled = true;
ControlBox = false;
break;
+
case KryptonMessageBoxButtons.YesNoCancel:
- _button1.Text = KryptonLanguageManager.GeneralToolkitStrings.Yes;
- _button2.Text = KryptonLanguageManager.GeneralToolkitStrings.No;
- _button3.Text = KryptonLanguageManager.GeneralToolkitStrings.Cancel;
+ _button1.Text = KryptonManager.Strings.GeneralStrings.Yes;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.No;
+ _button3.Text = KryptonManager.Strings.GeneralStrings.Cancel;
_button1.DialogResult = DialogResult.Yes;
_button2.DialogResult = DialogResult.No;
_button3.DialogResult = DialogResult.Cancel;
@@ -408,9 +339,10 @@ private void UpdateButtons()
_button3.Visible = true;
_button3.Enabled = true;
break;
+
case KryptonMessageBoxButtons.RetryCancel:
- _button1.Text = KryptonLanguageManager.GeneralToolkitStrings.Retry;
- _button2.Text = KryptonLanguageManager.GeneralToolkitStrings.Cancel;
+ _button1.Text = KryptonManager.Strings.GeneralStrings.Retry;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.Cancel;
_button1.DialogResult = DialogResult.Retry;
_button2.DialogResult = DialogResult.Cancel;
_button1.Visible = true;
@@ -418,10 +350,11 @@ private void UpdateButtons()
_button2.Visible = true;
_button2.Enabled = true;
break;
+
case KryptonMessageBoxButtons.AbortRetryIgnore:
- _button1.Text = KryptonLanguageManager.GeneralToolkitStrings.Abort;
- _button2.Text = KryptonLanguageManager.GeneralToolkitStrings.Retry;
- _button3.Text = KryptonLanguageManager.GeneralToolkitStrings.Ignore;
+ _button1.Text = KryptonManager.Strings.GeneralStrings.Abort;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.Retry;
+ _button3.Text = KryptonManager.Strings.GeneralStrings.Ignore;
_button1.DialogResult = DialogResult.Abort;
_button2.DialogResult = DialogResult.Retry;
_button3.DialogResult = DialogResult.Ignore;
@@ -433,10 +366,11 @@ private void UpdateButtons()
_button3.Enabled = true;
ControlBox = false;
break;
+
case KryptonMessageBoxButtons.CancelTryContinue:
- _button1.Text = KryptonLanguageManager.GeneralToolkitStrings.Cancel;
- _button2.Text = KryptonLanguageManager.GeneralToolkitStrings.TryAgain;
- _button3.Text = KryptonLanguageManager.GeneralToolkitStrings.Continue;
+ _button1.Text = KryptonManager.Strings.GeneralStrings.Cancel;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.TryAgain;
+ _button3.Text = KryptonManager.Strings.GeneralStrings.Continue;
_button1.DialogResult = DialogResult.Cancel;
#if NET6_0_OR_GREATER
_button2.DialogResult = DialogResult.TryAgain;
@@ -454,14 +388,6 @@ private void UpdateButtons()
break;
}
- if (_showActionButton)
- {
- _button5.Text = _actionButtonText;
- _button5.Visible = true;
- _button5.Enabled = true;
- _button5.KryptonCommand = _actionButtonCommand;
- }
-
// Do we ignore the Alt+F4 on the buttons?
if (!ControlBox)
{
@@ -469,37 +395,25 @@ private void UpdateButtons()
_button2.IgnoreAltF4 = true;
_button3.IgnoreAltF4 = true;
_button4.IgnoreAltF4 = true;
- _button5.IgnoreAltF4 = true;
}
}
private void UpdateDefault()
{
- switch (_defaultButton)
+ AcceptButton = _defaultButton switch
{
- case KryptonMessageBoxDefaultButton.Button1:
+ KryptonMessageBoxDefaultButton.Button1 =>
//_button1.Select();
- AcceptButton = _button1;
- break;
- case KryptonMessageBoxDefaultButton.Button2:
+ _button1,
+ KryptonMessageBoxDefaultButton.Button2 =>
//_button2.Select();
- AcceptButton = _button2;
- break;
- case KryptonMessageBoxDefaultButton.Button3:
+ _button2,
+ KryptonMessageBoxDefaultButton.Button3 =>
//_button3.Select();
- AcceptButton = _button3;
- break;
- case KryptonMessageBoxDefaultButton.Button4:
- AcceptButton = _showHelpButton ? _button4 : _button1;
- break;
- case KryptonMessageBoxDefaultButton.Button5:
- AcceptButton = _showActionButton ? _button5 : _button1;
-
- break;
- default:
- AcceptButton = _showHelpButton ? _button4 : _button1;
- break;
- }
+ _button3,
+ KryptonMessageBoxDefaultButton.Button4 => _showHelpButton ? _button4 : _button1,
+ _ => _showHelpButton ? _button4 : _button1
+ };
}
private void UpdateHelp()
@@ -512,15 +426,19 @@ private void UpdateHelp()
MessageButton helpButton = _buttons switch
{
KryptonMessageBoxButtons.OK => _button2,
- KryptonMessageBoxButtons.OKCancel or KryptonMessageBoxButtons.YesNo or KryptonMessageBoxButtons.RetryCancel => _button3,
- KryptonMessageBoxButtons.AbortRetryIgnore or KryptonMessageBoxButtons.YesNoCancel => _button4,
+ KryptonMessageBoxButtons.OKCancel
+ or KryptonMessageBoxButtons.YesNo
+ or KryptonMessageBoxButtons.RetryCancel => _button3,
+ KryptonMessageBoxButtons.AbortRetryIgnore
+ or KryptonMessageBoxButtons.YesNoCancel
+ or KryptonMessageBoxButtons.CancelTryContinue => _button4,
_ => throw new ArgumentOutOfRangeException()
};
if (helpButton != null)
{
helpButton.Visible = true;
helpButton.Enabled = true;
- helpButton.Text = KryptonLanguageManager.GeneralToolkitStrings.Help;
+ helpButton.Text = KryptonManager.Strings.GeneralStrings.Help;
helpButton.KeyPress += (_, _) => LaunchHelp();
helpButton.Click += (_, _) => LaunchHelp();
}
@@ -537,11 +455,11 @@ private void LaunchHelp()
{
if (_showOwner != null)
{
- Control control = FromHandle(_showOwner.Handle);
+ Control? control = FromHandle(_showOwner.Handle);
- MethodInfo? mInfoMethod = control.GetType().GetMethod(nameof(OnHelpRequested), BindingFlags.Instance | BindingFlags.NonPublic,
- Type.DefaultBinder, new[] { typeof(HelpEventArgs) }, null)!;
- mInfoMethod?.Invoke(control, new object[] { new HelpEventArgs(MousePosition) });
+ var mInfoMethod = control!.GetType().GetMethod(nameof(OnHelpRequested), BindingFlags.Instance | BindingFlags.NonPublic,
+ Type.DefaultBinder, [typeof(HelpEventArgs)], null);
+ mInfoMethod?.Invoke(control, [new HelpEventArgs(MousePosition)]);
if (_helpInfo != null)
{
if (string.IsNullOrWhiteSpace(_helpInfo.HelpFilePath))
@@ -562,9 +480,8 @@ private void LaunchHelp()
}
catch
{
- // Do nothing if failure to send to Parent
+ // Do nothing
}
-
}
private void UpdateSizing(IWin32Window? showOwner)
@@ -584,14 +501,22 @@ private Size UpdateMessageSizing(IWin32Window? showOwner)
using (Graphics g = CreateGraphics())
{
// Find size of the label, with a max of 2/3 screen width
- Screen? screen = showOwner != null ? Screen.FromHandle(showOwner.Handle) : Screen.PrimaryScreen;
- SizeF scaledMonitorSize = screen.Bounds.Size;
- scaledMonitorSize.Width *= 2 / 3.0f;
- scaledMonitorSize.Height *= 0.95f;
- _messageText.UpdateFont();
- SizeF messageSize = g.MeasureString(_text, _messageText.Font, scaledMonitorSize);
+ Screen screen = showOwner is IWin32Window window
+ ? Screen.FromHandle(window.Handle)
+ : Screen.PrimaryScreen ?? throw new NullReferenceException("Screen.PrimaryScreen returned null");
+
+ Size scaledMonitorSize = screen.WorkingArea.Size;
+ scaledMonitorSize.Width = (int)(scaledMonitorSize.Width * 2 / 3.0f);
+ scaledMonitorSize.Height = (int)(scaledMonitorSize.Height * 0.95f);
+
+ Font textFont = krtbMessageText.StateCommon.Content.GetContentShortTextFont(PaletteState.Normal) ?? KryptonManager.CurrentGlobalPalette!.BaseFont;
+ Font captionFont = KryptonManager.CurrentGlobalPalette.BaseFont;
+
+ // Measure the string
+ SizeF messageSize = g.MeasureString(_text, textFont, new SizeF(scaledMonitorSize.Width, scaledMonitorSize.Height));
+
// SKC: Don't forget to add the TextExtra into the calculation
- SizeF captionSize = g.MeasureString($@"{_caption} {TextExtra}", _messageText.Font, scaledMonitorSize);
+ SizeF captionSize = TextRenderer.MeasureText($"{_caption} {TextExtra}", captionFont, scaledMonitorSize);
var messageXSize = Math.Max(messageSize.Width, captionSize.Width);
// Work out DPI adjustment factor
@@ -600,15 +525,21 @@ private Size UpdateMessageSizing(IWin32Window? showOwner)
messageSize.Width = messageXSize * factorX;
messageSize.Height *= factorY;
- // Always add on ad extra 5 pixels as sometimes the measure size does not draw the last
- // character it contains, this ensures there is always definitely enough space for it all
- messageSize.Width += 5;
textSize = Size.Ceiling(messageSize);
}
- return new Size(textSize.Width + _messageIcon.Width + _messageIcon.Margin.Left + _messageIcon.Margin.Right +
- _messageText.Margin.Left + _messageText.Margin.Right,
- Math.Max(_messageIcon.Height + 10, textSize.Height));
+ // Calculate the size of the icon area and text area including margins
+ Padding textPadding = krtbMessageText.StateCommon.Content.GetContentPadding(PaletteState.Normal);
+ Padding textAreaAllMargin = Padding.Add(textPadding, kpnlContentArea.Margin);
+
+ Size iconArea = new Size(_messageIcon.Width + _messageIcon.Margin.Left + _messageIcon.Margin.Right,
+ _messageIcon.Height + _messageIcon.Margin.Top + _messageIcon.Margin.Bottom);
+
+ Size textArea = new Size(textSize.Width + textAreaAllMargin.Left + textAreaAllMargin.Right,
+ textSize.Height + textAreaAllMargin.Top + textAreaAllMargin.Bottom);
+
+ return new Size(textArea.Width + iconArea.Width,
+ Math.Max(iconArea.Height, textArea.Height));
}
private Size UpdateButtonsSizing()
@@ -617,14 +548,14 @@ private Size UpdateButtonsSizing()
// Button1 is always visible
Size button1Size = _button1.GetPreferredSize(Size.Empty);
- var maxButtonSize = button1Size with { Width = button1Size.Width + GAP };
+ var maxButtonSize = button1Size with { Width = button1Size.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING };
// If Button2 is visible
if (_button2.Enabled)
{
numButtons++;
Size button2Size = _button2.GetPreferredSize(Size.Empty);
- maxButtonSize.Width = Math.Max(maxButtonSize.Width, button2Size.Width + GAP);
+ maxButtonSize.Width = Math.Max(maxButtonSize.Width, button2Size.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING);
maxButtonSize.Height = Math.Max(maxButtonSize.Height, button2Size.Height);
}
@@ -633,7 +564,7 @@ private Size UpdateButtonsSizing()
{
numButtons++;
Size button3Size = _button3.GetPreferredSize(Size.Empty);
- maxButtonSize.Width = Math.Max(maxButtonSize.Width, button3Size.Width + GAP);
+ maxButtonSize.Width = Math.Max(maxButtonSize.Width, button3Size.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING);
maxButtonSize.Height = Math.Max(maxButtonSize.Height, button3Size.Height);
}
// If Button4 is visible
@@ -641,65 +572,53 @@ private Size UpdateButtonsSizing()
{
numButtons++;
Size button4Size = _button4.GetPreferredSize(Size.Empty);
- maxButtonSize.Width = Math.Max(maxButtonSize.Width, button4Size.Width + GAP);
+ maxButtonSize.Width = Math.Max(maxButtonSize.Width, button4Size.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING);
maxButtonSize.Height = Math.Max(maxButtonSize.Height, button4Size.Height);
}
- // If Action button is visible
- if (_button5.Enabled)
- {
- numButtons++;
- Size actionButtonSize = _button5.GetPreferredSize(Size.Empty);
- maxButtonSize.Width = Math.Max(maxButtonSize.Width, actionButtonSize.Width + GAP);
- maxButtonSize.Height = Math.Max(maxButtonSize.Height, actionButtonSize.Height);
- }
-
// Start positioning buttons 10 pixels from right edge
- var right = _panelButtons.Right - GAP;
+ var right = _panelButtons.Right - GlobalStaticValues.GLOBAL_BUTTON_PADDING;
- var left = _panelButtons.Left - GAP;
-
- // If Action button is visible
- if (_button5.Enabled)
- {
- _button5.Location = new Point(left - maxButtonSize.Width, GAP);
- _button5.Size = maxButtonSize;
- left -= maxButtonSize.Width + GAP;
- }
+ //var left = _panelButtons.Left - GlobalStaticValues.GLOBAL_BUTTON_PADDING;
// If Button4 is visible
if (_button4.Enabled)
{
- _button4.Location = new Point(right - maxButtonSize.Width, GAP);
+ _button4.Location = new Point(right - maxButtonSize.Width, GlobalStaticValues.GLOBAL_BUTTON_PADDING);
_button4.Size = maxButtonSize;
- right -= maxButtonSize.Width + GAP;
+ right -= maxButtonSize.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING;
}
// If Button3 is visible
if (_button3.Enabled)
{
- _button3.Location = new Point(right - maxButtonSize.Width, GAP);
+ _button3.Location = new Point(right - maxButtonSize.Width, GlobalStaticValues.GLOBAL_BUTTON_PADDING);
_button3.Size = maxButtonSize;
- right -= maxButtonSize.Width + GAP;
+ right -= maxButtonSize.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING;
}
// If Button2 is visible
if (_button2.Enabled)
{
- _button2.Location = new Point(right - maxButtonSize.Width, GAP);
+ _button2.Location = new Point(right - maxButtonSize.Width, GlobalStaticValues.GLOBAL_BUTTON_PADDING);
_button2.Size = maxButtonSize;
- right -= maxButtonSize.Width + GAP;
+ right -= maxButtonSize.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING;
}
// Button1 is always visible
- _button1.Location = new Point(right - maxButtonSize.Width, GAP);
+ _button1.Location = new Point(right - maxButtonSize.Width, GlobalStaticValues.GLOBAL_BUTTON_PADDING);
_button1.Size = maxButtonSize;
// Size the panel for the buttons
- _panelButtons.Size = new Size((maxButtonSize.Width * numButtons) + (GAP * (numButtons + 1)), maxButtonSize.Height + (GAP * 2));
+ _panelButtons.Size = new Size((maxButtonSize.Width * numButtons) + (GlobalStaticValues.GLOBAL_BUTTON_PADDING * (numButtons + 1)), maxButtonSize.Height + (GlobalStaticValues.GLOBAL_BUTTON_PADDING * 2));
// Button area is the number of buttons with gaps between them and 10 pixels around all edges
- return new Size((maxButtonSize.Width * numButtons) + (GAP * (numButtons + 1)), maxButtonSize.Height + (GAP * 2));
+ return new Size((maxButtonSize.Width * numButtons) + (GlobalStaticValues.GLOBAL_BUTTON_PADDING * (numButtons + 1)), maxButtonSize.Height + (GlobalStaticValues.GLOBAL_BUTTON_PADDING * 2));
+ }
+
+ private void OnFormClosed(object sender, FormClosedEventArgs e)
+ {
+ _krtbNativeWindow.ReleaseHandle();
}
private void AnyKeyDown(object sender, KeyEventArgs e)
@@ -711,138 +630,51 @@ private void AnyKeyDown(object sender, KeyEventArgs e)
{
Close();
}
- else if (!e.Control
- || (e.KeyCode != Keys.C)
- )
+ else if (e.KeyData == (Keys.Control | Keys.C))
{
- return;
- }
-
- const string DIVIDER = @"---------------------------";
- const string BUTTON_TEXT_SPACER = @" ";
+ const string DIVIDER = @"---------------------------";
+ const string BUTTON_TEXT_SPACER = @" ";
+ // Pressing Ctrl+C should copy message text into the clipboard
+ var sb = new StringBuilder();
- // Pressing Ctrl+C should copy message text into the clipboard
- var sb = new StringBuilder();
-
- sb.AppendLine(DIVIDER);
- sb.AppendLine(Text);
- sb.AppendLine(DIVIDER);
- sb.AppendLine(_messageText.Text);
- sb.AppendLine(DIVIDER);
- sb.Append(_button1.Text).Append(BUTTON_TEXT_SPACER);
- if (_button2.Enabled)
- {
- sb.Append(_button2.Text).Append(BUTTON_TEXT_SPACER);
- if (_button3.Enabled)
+ sb.AppendLine(DIVIDER);
+ sb.AppendLine(Text);
+ sb.AppendLine(DIVIDER);
+ sb.AppendLine(krtbMessageText.Text);
+ sb.AppendLine(DIVIDER);
+ sb.Append(_button1.Text).Append(BUTTON_TEXT_SPACER);
+ if (_button2.Enabled)
{
- sb.Append(_button3.Text).Append(BUTTON_TEXT_SPACER);
- }
-
- if (_button4.Enabled)
- {
- sb.Append(_button4.Text).Append(BUTTON_TEXT_SPACER);
- }
- }
-
- sb.AppendLine(string.Empty);
- sb.AppendLine(DIVIDER);
-
- Clipboard.SetText(sb.ToString(), TextDataFormat.Text);
- Clipboard.SetText(sb.ToString(), TextDataFormat.UnicodeText);
- }
-
- /// Setups the action button UI.
- /// if set to true [visible].
- private void SetupActionButtonUI(bool visible)
- {
- _button5.Visible = visible;
-
- _button5.Enabled = visible;
-
- _button5.Click += (sender, args) =>
- {
- try
- {
- _actionButtonCommand?.PerformExecute();
- }
- catch (Exception e)
- {
- Debug.Assert(true, e.StackTrace);
-
- DialogResult = DialogResult.None;
- }
- };
- }
+ sb.Append(_button2.Text).Append(BUTTON_TEXT_SPACER);
+ if (_button3.Enabled)
+ {
+ sb.Append(_button3.Text).Append(BUTTON_TEXT_SPACER);
+ }
- private void LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
- {
- try
- {
- if (_linkLabelCommand != null)
- {
- _linkLabelCommand.PerformExecute();
- }
- else if (_linkLaunchArgument != null)
- {
- Process.Start(_linkLaunchArgument);
+ if (_button4.Enabled)
+ {
+ sb.Append(_button4.Text).Append(BUTTON_TEXT_SPACER);
+ }
}
- }
- catch (Exception exception)
- {
- ExceptionHandler.CaptureException(exception);
- }
- }
- /// Updates the type of the content area.
- /// Type of the content area.
- private void UpdateContentAreaType(MessageBoxContentAreaType? contentAreaType)
- {
- switch (contentAreaType)
- {
- case MessageBoxContentAreaType.Normal:
- _linkLabelMessageText.Visible = false;
+ sb.AppendLine(string.Empty);
+ sb.AppendLine(DIVIDER);
- _messageText.Visible = true;
- break;
- case MessageBoxContentAreaType.LinkLabel:
- _linkLabelMessageText.Visible = true;
-
- _messageText.Visible = false;
- break;
+ Clipboard.SetText(sb.ToString(), TextDataFormat.Text);
+ Clipboard.SetText(sb.ToString(), TextDataFormat.UnicodeText);
}
}
- private void UpdateContentAreaTextAlignment(MessageBoxContentAreaType? contentAreaType, ContentAlignment? messageTextAlignment)
- {
- switch (contentAreaType)
- {
- case MessageBoxContentAreaType.Normal:
- _messageText.TextAlign = messageTextAlignment ?? ContentAlignment.MiddleLeft;
- break;
- case MessageBoxContentAreaType.LinkLabel:
- _linkLabelMessageText.TextAlign = messageTextAlignment ?? ContentAlignment.MiddleLeft;
- break;
- case null:
- _messageText.TextAlign = messageTextAlignment ?? ContentAlignment.MiddleLeft;
- break;
- default:
- throw new ArgumentOutOfRangeException(nameof(contentAreaType), contentAreaType, null);
- }
- }
-
- private void UpdateContentLinkArea(LinkArea? contentLinkArea)
- {
- if (contentLinkArea != null)
- {
- _linkLabelMessageText.LinkArea = (LinkArea)contentLinkArea;
- }
- }
+ private void ShowCloseButton(bool? showCloseButton) => CloseBox = showCloseButton ?? true;
#endregion
}
#region Types
- internal class HelpInfo
+ ///
+ ///
+ ///
+ public class HelpInfo
{
#region Identity
@@ -958,4 +790,4 @@ protected override void WndProc(ref Message m)
}
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualMessageBoxForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualMessageBoxForm.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualMessageBoxForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonMessageBoxForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualMessageBoxFormDep.Designer.cs
similarity index 69%
rename from Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonMessageBoxForm.Designer.cs
rename to Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualMessageBoxFormDep.Designer.cs
index b123d4350..c05a72cd5 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonMessageBoxForm.Designer.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualMessageBoxFormDep.Designer.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -13,7 +13,7 @@
namespace Krypton.Toolkit
{
- partial class KryptonMessageBoxForm
+ partial class VisualMessageBoxFormDep
{
///
/// Required designer variable.
@@ -48,20 +48,19 @@ private void InitializeComponent()
this._button3 = new Krypton.Toolkit.MessageButton();
this._button1 = new Krypton.Toolkit.MessageButton();
this._button2 = new Krypton.Toolkit.MessageButton();
- this._button5 = new Krypton.Toolkit.MessageButton();
this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
- this._panelContentArea = new Krypton.Toolkit.KryptonPanel();
- this._messageText = new Krypton.Toolkit.KryptonWrapLabel();
- this._linkLabelMessageText = new Krypton.Toolkit.KryptonLinkWrapLabel();
+ this.kpnlContentArea = new Krypton.Toolkit.KryptonPanel();
+ this.krtbMessageText = new Krypton.Toolkit.KryptonRichTextBox();
+ this.klwlblMessageText = new Krypton.Toolkit.KryptonLinkWrapLabel();
((System.ComponentModel.ISupportInitialize)(this._messageIcon)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this._panelButtons)).BeginInit();
this._panelButtons.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
this.kryptonPanel1.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this._panelContentArea)).BeginInit();
- this._panelContentArea.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlContentArea)).BeginInit();
+ this.kpnlContentArea.SuspendLayout();
this.SuspendLayout();
//
// _messageIcon
@@ -71,7 +70,7 @@ private void InitializeComponent()
this._messageIcon.Location = new System.Drawing.Point(8, 4);
this._messageIcon.Margin = new System.Windows.Forms.Padding(8, 4, 4, 4);
this._messageIcon.Name = "_messageIcon";
- this._messageIcon.Size = new System.Drawing.Size(33, 34);
+ this._messageIcon.Size = new System.Drawing.Size(33, 35);
this._messageIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this._messageIcon.TabIndex = 0;
this._messageIcon.TabStop = false;
@@ -84,13 +83,12 @@ private void InitializeComponent()
this._panelButtons.Controls.Add(this._button3);
this._panelButtons.Controls.Add(this._button1);
this._panelButtons.Controls.Add(this._button2);
- this._panelButtons.Controls.Add(this._button5);
this._panelButtons.Dock = System.Windows.Forms.DockStyle.Fill;
- this._panelButtons.Location = new System.Drawing.Point(0, 42);
+ this._panelButtons.Location = new System.Drawing.Point(0, 43);
this._panelButtons.Margin = new System.Windows.Forms.Padding(0);
this._panelButtons.Name = "_panelButtons";
this._panelButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
- this._panelButtons.Size = new System.Drawing.Size(183, 21);
+ this._panelButtons.Size = new System.Drawing.Size(203, 21);
this._panelButtons.TabIndex = 0;
//
// _borderEdge
@@ -100,7 +98,7 @@ private void InitializeComponent()
this._borderEdge.Location = new System.Drawing.Point(0, 0);
this._borderEdge.Margin = new System.Windows.Forms.Padding(2);
this._borderEdge.Name = "_borderEdge";
- this._borderEdge.Size = new System.Drawing.Size(183, 1);
+ this._borderEdge.Size = new System.Drawing.Size(203, 1);
this._borderEdge.Text = "kryptonBorderEdge1";
//
// _button4
@@ -109,12 +107,13 @@ private void InitializeComponent()
this._button4.AutoSize = true;
this._button4.Enabled = false;
this._button4.IgnoreAltF4 = false;
- this._button4.Location = new System.Drawing.Point(183, 0);
+ this._button4.Location = new System.Drawing.Point(203, 0);
this._button4.Margin = new System.Windows.Forms.Padding(0);
this._button4.MinimumSize = new System.Drawing.Size(38, 21);
this._button4.Name = "_button4";
this._button4.Size = new System.Drawing.Size(38, 23);
this._button4.TabIndex = 2;
+ this._button4.Values.DropDownArrowColor = System.Drawing.Color.Empty;
this._button4.Values.Text = "B4";
this._button4.Visible = false;
//
@@ -124,12 +123,13 @@ private void InitializeComponent()
this._button3.AutoSize = true;
this._button3.Enabled = false;
this._button3.IgnoreAltF4 = false;
- this._button3.Location = new System.Drawing.Point(146, 0);
+ this._button3.Location = new System.Drawing.Point(166, 0);
this._button3.Margin = new System.Windows.Forms.Padding(0);
this._button3.MinimumSize = new System.Drawing.Size(38, 21);
this._button3.Name = "_button3";
this._button3.Size = new System.Drawing.Size(38, 23);
this._button3.TabIndex = 2;
+ this._button3.Values.DropDownArrowColor = System.Drawing.Color.Empty;
this._button3.Values.Text = "B3";
this._button3.Visible = false;
//
@@ -139,12 +139,13 @@ private void InitializeComponent()
this._button1.AutoSize = true;
this._button1.Enabled = false;
this._button1.IgnoreAltF4 = false;
- this._button1.Location = new System.Drawing.Point(70, 0);
+ this._button1.Location = new System.Drawing.Point(90, 0);
this._button1.Margin = new System.Windows.Forms.Padding(0);
this._button1.MinimumSize = new System.Drawing.Size(38, 21);
this._button1.Name = "_button1";
this._button1.Size = new System.Drawing.Size(38, 23);
this._button1.TabIndex = 0;
+ this._button1.Values.DropDownArrowColor = System.Drawing.Color.Empty;
this._button1.Values.Text = "B1";
this._button1.Visible = false;
//
@@ -154,29 +155,16 @@ private void InitializeComponent()
this._button2.AutoSize = true;
this._button2.Enabled = false;
this._button2.IgnoreAltF4 = false;
- this._button2.Location = new System.Drawing.Point(108, 0);
+ this._button2.Location = new System.Drawing.Point(128, 0);
this._button2.Margin = new System.Windows.Forms.Padding(0);
this._button2.MinimumSize = new System.Drawing.Size(38, 21);
this._button2.Name = "_button2";
this._button2.Size = new System.Drawing.Size(38, 23);
this._button2.TabIndex = 1;
+ this._button2.Values.DropDownArrowColor = System.Drawing.Color.Empty;
this._button2.Values.Text = "B2";
this._button2.Visible = false;
//
- // _button5
- //
- this._button5.AutoSize = true;
- this._button5.Enabled = false;
- this._button5.IgnoreAltF4 = false;
- this._button5.Location = new System.Drawing.Point(0, 0);
- this._button5.Margin = new System.Windows.Forms.Padding(0);
- this._button5.MinimumSize = new System.Drawing.Size(38, 21);
- this._button5.Name = "_button5";
- this._button5.Size = new System.Drawing.Size(38, 23);
- this._button5.TabIndex = 3;
- this._button5.Values.Text = "B5";
- this._button5.Visible = false;
- //
// kryptonPanel1
//
this.kryptonPanel1.Controls.Add(this.tableLayoutPanel1);
@@ -184,7 +172,7 @@ private void InitializeComponent()
this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
this.kryptonPanel1.Margin = new System.Windows.Forms.Padding(2);
this.kryptonPanel1.Name = "kryptonPanel1";
- this.kryptonPanel1.Size = new System.Drawing.Size(183, 63);
+ this.kryptonPanel1.Size = new System.Drawing.Size(203, 64);
this.kryptonPanel1.TabIndex = 1;
//
// tableLayoutPanel1
@@ -195,7 +183,7 @@ private void InitializeComponent()
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Controls.Add(this._panelButtons, 0, 1);
this.tableLayoutPanel1.Controls.Add(this._messageIcon, 0, 0);
- this.tableLayoutPanel1.Controls.Add(this._panelContentArea, 1, 0);
+ this.tableLayoutPanel1.Controls.Add(this.kpnlContentArea, 1, 0);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(2);
@@ -203,65 +191,66 @@ private void InitializeComponent()
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
- this.tableLayoutPanel1.Size = new System.Drawing.Size(183, 63);
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(203, 64);
this.tableLayoutPanel1.TabIndex = 0;
//
- // _panelContentArea
+ // kpnlContentArea
//
- this._panelContentArea.Controls.Add(this._messageText);
- this._panelContentArea.Controls.Add(this._linkLabelMessageText);
- this._panelContentArea.Dock = System.Windows.Forms.DockStyle.Fill;
- this._panelContentArea.Location = new System.Drawing.Point(48, 3);
- this._panelContentArea.Name = "_panelContentArea";
- this._panelContentArea.Size = new System.Drawing.Size(132, 36);
- this._panelContentArea.TabIndex = 1;
+ this.kpnlContentArea.Controls.Add(this.krtbMessageText);
+ this.kpnlContentArea.Controls.Add(this.klwlblMessageText);
+ this.kpnlContentArea.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kpnlContentArea.Location = new System.Drawing.Point(49, 12);
+ this.kpnlContentArea.Margin = new System.Windows.Forms.Padding(4, 12, 4, 12);
+ this.kpnlContentArea.Name = "kpnlContentArea";
+ this.kpnlContentArea.Size = new System.Drawing.Size(150, 19);
+ this.kpnlContentArea.TabIndex = 1;
//
- // _messageText
+ // krtbMessageText
//
- this._messageText.AutoSize = false;
- this._messageText.Dock = System.Windows.Forms.DockStyle.Fill;
- this._messageText.Font = new System.Drawing.Font("Segoe UI", 9F);
- this._messageText.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
- this._messageText.LabelStyle = Krypton.Toolkit.LabelStyle.NormalControl;
- this._messageText.Location = new System.Drawing.Point(0, 0);
- this._messageText.Margin = new System.Windows.Forms.Padding(4, 0, 0, 0);
- this._messageText.Name = "_messageText";
- this._messageText.Size = new System.Drawing.Size(132, 36);
- this._messageText.Text = "Message Text";
- this._messageText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ this.krtbMessageText.DetectUrls = false;
+ this.krtbMessageText.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.krtbMessageText.InputControlStyle = Krypton.Toolkit.InputControlStyle.PanelClient;
+ this.krtbMessageText.Location = new System.Drawing.Point(0, 0);
+ this.krtbMessageText.Margin = new System.Windows.Forms.Padding(0);
+ this.krtbMessageText.Name = "krtbMessageText";
+ this.krtbMessageText.ReadOnly = true;
+ this.krtbMessageText.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None;
+ this.krtbMessageText.Size = new System.Drawing.Size(150, 19);
+ this.krtbMessageText.StateCommon.Border.DrawBorders = Krypton.Toolkit.PaletteDrawBorders.None;
+ this.krtbMessageText.TabIndex = 0;
+ this.krtbMessageText.TabStop = false;
+ this.krtbMessageText.Text = "Message Text\n.\ttabbed";
+ this.krtbMessageText.WordWrap = false;
//
- // _linkLabelMessageText
+ // klwlblMessageText
//
- this._linkLabelMessageText.AutoSize = false;
- this._linkLabelMessageText.Dock = System.Windows.Forms.DockStyle.Fill;
- this._linkLabelMessageText.Font = new System.Drawing.Font("Segoe UI", 9F);
- this._linkLabelMessageText.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
- this._linkLabelMessageText.LabelStyle = Krypton.Toolkit.LabelStyle.NormalControl;
- this._linkLabelMessageText.Location = new System.Drawing.Point(0, 0);
- this._linkLabelMessageText.Name = "_linkLabelMessageText";
- this._linkLabelMessageText.Size = new System.Drawing.Size(132, 36);
- this._linkLabelMessageText.Text = "Message Text";
- this._linkLabelMessageText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
- this._linkLabelMessageText.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkClicked);
+ this.klwlblMessageText.AutoSize = false;
+ this.klwlblMessageText.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.klwlblMessageText.LabelStyle = Krypton.Toolkit.LabelStyle.NormalControl;
+ this.klwlblMessageText.Location = new System.Drawing.Point(0, 0);
+ this.klwlblMessageText.Name = "klwlblMessageText";
+ this.klwlblMessageText.Size = new System.Drawing.Size(150, 19);
+ this.klwlblMessageText.Text = "Message Text";
+ this.klwlblMessageText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
- // KryptonMessageBoxForm
+ // VisualMessageBoxFormDep
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(183, 63);
+ this.ClientSize = new System.Drawing.Size(203, 64);
this.Controls.Add(this.kryptonPanel1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.KeyPreview = true;
this.Margin = new System.Windows.Forms.Padding(2);
this.MaximizeBox = false;
this.MinimizeBox = false;
- this.Name = "KryptonMessageBoxForm";
+ this.Name = "VisualMessageBoxFormDep";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
- this.TopMost = true;
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.AnyKeyDown);
+ this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.OnFormClosed);
((System.ComponentModel.ISupportInitialize)(this._messageIcon)).EndInit();
((System.ComponentModel.ISupportInitialize)(this._panelButtons)).EndInit();
this._panelButtons.ResumeLayout(false);
@@ -269,8 +258,9 @@ private void InitializeComponent()
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
this.kryptonPanel1.ResumeLayout(false);
this.tableLayoutPanel1.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)(this._panelContentArea)).EndInit();
- this._panelContentArea.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.kpnlContentArea)).EndInit();
+ this.kpnlContentArea.ResumeLayout(false);
+ this.kpnlContentArea.PerformLayout();
this.ResumeLayout(false);
}
@@ -285,9 +275,8 @@ private void InitializeComponent()
private KryptonBorderEdge _borderEdge;
private KryptonPanel kryptonPanel1;
private TableLayoutPanel tableLayoutPanel1;
- private MessageButton _button5;
- private KryptonPanel _panelContentArea;
- private KryptonLinkWrapLabel _linkLabelMessageText;
- private KryptonWrapLabel _messageText;
+ private KryptonPanel kpnlContentArea;
+ private KryptonLinkWrapLabel klwlblMessageText;
+ private KryptonRichTextBox krtbMessageText;
}
}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualMessageBoxFormDep.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualMessageBoxFormDep.cs
new file mode 100644
index 000000000..a9f16fae9
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualMessageBoxFormDep.cs
@@ -0,0 +1,1290 @@
+#region BSD License
+/*
+ *
+ * Original BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE)
+ * © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
+ *
+ * New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+// ReSharper disable InconsistentNaming
+// ReSharper disable UnusedParameter.Local
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualMessageBoxFormDep : KryptonForm
+ {
+ #region Instance Fields
+
+ private readonly bool _showHelpButton;
+ private readonly string? _text;
+ private readonly string? _caption;
+ private readonly string _applicationPath;
+ private readonly KryptonMessageBoxButtons _buttons;
+ private readonly KryptonMessageBoxIcon _kryptonMessageBoxIcon;
+ private readonly Image? _applicationImage;
+ private readonly bool? _forceUseOfOperatingSystemIcons;
+ private readonly KryptonMessageBoxDataDep _messageBoxData;
+ private readonly bool? _showCloseButton;
+
+ private readonly KryptonMessageBoxDefaultButton _defaultButton;
+
+ // If help information provided, or we are not a service/default desktop application then grab an owner for showing the message box
+ private readonly IWin32Window? _showOwner;
+ private readonly HelpInfo? _helpInfo;
+ private readonly KryptonMessageBoxNativeWindow _krtbNativeWindow;
+
+ // For the LinkLabel option
+ private readonly MessageBoxContentAreaType? _contentAreaType;
+ private readonly KryptonCommand? _linkLabelCommand;
+ private readonly ProcessStartInfo? _linkLaunchArgument;
+ private readonly LinkArea _contentLinkArea;
+
+ private KryptonMessageBoxResult _messageBoxResult;
+
+ #endregion
+
+ #region Public
+
+ public KryptonMessageBoxResult MessageBoxResult
+ {
+ get => _messageBoxResult;
+ set => _messageBoxResult = value;
+ }
+
+ #endregion
+
+ #region Identity
+
+ public VisualMessageBoxFormDep()
+ {
+ InitializeComponent();
+ }
+
+ internal VisualMessageBoxFormDep(IWin32Window? showOwner, string? text, string? caption,
+ KryptonMessageBoxButtons buttons,
+ KryptonMessageBoxIcon icon,
+ KryptonMessageBoxDefaultButton defaultButton,
+ HelpInfo? helpInfo, bool? showCtrlCopy,
+ bool? showHelpButton,
+ Image? applicationImage,
+ string? applicationPath,
+ MessageBoxContentAreaType? contentAreaType,
+ KryptonCommand? linkLabelCommand,
+ ProcessStartInfo? linkLaunchArgument,
+ LinkArea? contentLinkArea,
+ bool? forceUseOfOperatingSystemIcons,
+ bool? showCloseButton)
+ {
+ // Store incoming values
+ _text = CommonHelper.NormalizeLineBreaks(text ?? string.Empty);
+ _caption = caption;
+ _buttons = buttons;
+ _kryptonMessageBoxIcon = icon;
+ _defaultButton = defaultButton;
+ _helpInfo = helpInfo;
+ _showOwner = showOwner;
+ _showHelpButton = showHelpButton ?? (helpInfo != null);
+ _applicationImage = applicationImage;
+ _applicationPath = applicationPath ?? string.Empty;
+ _contentAreaType = contentAreaType ?? MessageBoxContentAreaType.Normal;
+ _linkLabelCommand = linkLabelCommand ?? new KryptonCommand();
+ _contentLinkArea = string.IsNullOrEmpty(text)
+ ? new LinkArea(0, 0)
+ : contentLinkArea ?? new LinkArea(0, text!.Length);
+ _linkLaunchArgument = linkLaunchArgument ?? new ProcessStartInfo();
+ _forceUseOfOperatingSystemIcons = forceUseOfOperatingSystemIcons ?? false;
+ _showCloseButton = showCloseButton ?? true;
+ _krtbNativeWindow = new();
+
+ // Create the form contents
+ InitializeComponent();
+
+ // Hookup the native window on the KRTB, only after IntializeComponent().
+ _krtbNativeWindow.AssignHandle(krtbMessageText.RichTextBox.Handle);
+
+ // Default Cursor for the KRTB when the cursors hovers over it
+ krtbMessageText.RichTextBox.Cursor = Cursors.Arrow;
+
+ // #1692 text font colour for input controls does not work correct on KMBees when using dark themes.
+ // Set the text colour to the one a control uses.
+ krtbMessageText.StateCommon.Content.Color1 = GlobalStaticValues.KryptonMessageBoxRichTextBoxTextColor;
+
+ // Update contents to match requirements
+ UpdateText();
+ UpdateIcon();
+ UpdateButtons();
+ UpdateDefault();
+ UpdateHelp();
+ UpdateTextExtra(showCtrlCopy);
+ UpdateContentAreaType(contentAreaType);
+ UpdateContentLinkArea(contentLinkArea);
+
+ // Finally calculate and set form sizing
+ UpdateSizing(showOwner);
+
+ ShowCloseButton(showCloseButton);
+ }
+
+ public VisualMessageBoxFormDep(KryptonMessageBoxDataDep messageBoxData)
+ {
+ // Store incoming values
+ _messageBoxData = messageBoxData;
+
+ // Create the form contents
+ InitializeComponent();
+
+ RightToLeftLayout = _messageBoxData.Options.HasFlag(MessageBoxOptions.RtlReading);
+
+ // Update contents to match requirements
+ UpdateText(_messageBoxData.Caption, _messageBoxData.MessageText, _messageBoxData.Options, _messageBoxData.MessageContentAreaType);
+ UpdateIcon(_messageBoxData.Icon);
+ UpdateButtons(_messageBoxData.Buttons);
+ UpdateDefault(_messageBoxData.DefaultButton);
+ UpdateHelp(_messageBoxData.ShowHelpButton);
+ UpdateTextExtra(_messageBoxData.ShowCtrlCopy);
+ UpdateContentAreaType(_messageBoxData.MessageContentAreaType);
+ UpdateContentLinkArea(_messageBoxData.ContentLinkArea);
+
+ ShowCloseButton(_messageBoxData.ShowCloseButton);
+
+ // Finally calculate and set form sizing
+ UpdateSizing(_messageBoxData.Owner);
+ }
+
+ #endregion Identity
+
+ #region Implementation
+
+ private void UpdateText(string? caption, string? text, MessageBoxOptions options, MessageBoxContentAreaType? contentAreaType)
+ {
+ // Set the text of the form
+ Text = string.IsNullOrEmpty(caption) ? string.Empty : caption?.Split(Environment.NewLine.ToCharArray())[0];
+
+ switch (contentAreaType)
+ {
+ case MessageBoxContentAreaType.Normal:
+ krtbMessageText.Text = text;
+
+ krtbMessageText.RightToLeft = options.HasFlag(MessageBoxOptions.RightAlign) ? RightToLeft.Yes :
+ options.HasFlag(MessageBoxOptions.RtlReading) ? RightToLeft.Inherit : RightToLeft.No;
+ break;
+ case MessageBoxContentAreaType.LinkLabel:
+ klwlblMessageText.Text = text;
+
+ klwlblMessageText.RightToLeft = options.HasFlag(MessageBoxOptions.RightAlign)
+ ?
+ RightToLeft.Yes
+ : options.HasFlag(MessageBoxOptions.RtlReading)
+ ? RightToLeft.Inherit
+ : RightToLeft.No;
+ break;
+ case null:
+ krtbMessageText.Text = text;
+
+ krtbMessageText.RightToLeft = options.HasFlag(MessageBoxOptions.RightAlign) ? RightToLeft.Yes :
+ options.HasFlag(MessageBoxOptions.RtlReading) ? RightToLeft.Inherit : RightToLeft.No;
+ break;
+ default:
+ throw new ArgumentOutOfRangeException(nameof(contentAreaType), contentAreaType, null);
+ }
+ }
+
+ private void UpdateText()
+ {
+ Text = string.IsNullOrEmpty(_caption) ? string.Empty : _caption?.Split(Environment.NewLine.ToCharArray())[0];
+
+ if (_contentAreaType == MessageBoxContentAreaType.Normal)
+ {
+ krtbMessageText.Text = _text;
+ }
+ else
+ {
+ klwlblMessageText.Text = _text;
+ }
+ }
+
+ private void UpdateTextExtra(bool? showCtrlCopy)
+ {
+ if (!showCtrlCopy.HasValue)
+ {
+ switch (_kryptonMessageBoxIcon)
+ {
+ case KryptonMessageBoxIcon.Error:
+ case KryptonMessageBoxIcon.Exclamation:
+ showCtrlCopy = true;
+ break;
+ }
+ }
+
+ if (showCtrlCopy == true)
+ {
+ TextExtra = @"Ctrl+c to copy";
+ }
+ }
+
+ private void UpdateIcon(KryptonMessageBoxIcon icon)
+ {
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ switch (icon)
+ {
+ case KryptonMessageBoxIcon.None:
+ // Windows XP and before will Beep, Vista and above do not!
+ if (GlobalStaticValues.OS_MAJOR_VERSION < 6)
+ {
+ SystemSounds.Beep.Play();
+ }
+ break;
+ case KryptonMessageBoxIcon.Hand:
+ _messageIcon.Image = MessageBoxImageResources.GenericHand;
+ SystemSounds.Hand.Play();
+ break;
+ case KryptonMessageBoxIcon.Question:
+ _messageIcon.Image = MessageBoxImageResources.Question_Windows_11;
+ SystemSounds.Question.Play();
+ break;
+ case KryptonMessageBoxIcon.Exclamation:
+ _messageIcon.Image = MessageBoxImageResources.Warning_Windows_11;
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.Asterisk:
+ _messageIcon.Image = MessageBoxImageResources.Asterisk_Windows_11;
+ SystemSounds.Asterisk.Play();
+ break;
+ case KryptonMessageBoxIcon.Stop:
+ _messageIcon.Image = MessageBoxImageResources.GenericStop;
+ SystemSounds.Asterisk.Play();
+ break;
+ case KryptonMessageBoxIcon.Error:
+ _messageIcon.Image = MessageBoxImageResources.Critical_Windows_11;
+ SystemSounds.Asterisk.Play();
+ break;
+ case KryptonMessageBoxIcon.Warning:
+ _messageIcon.Image = MessageBoxImageResources.Warning_Windows_11;
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.Information:
+ _messageIcon.Image = MessageBoxImageResources.Information_Windows_11;
+ SystemSounds.Asterisk.Play();
+ break;
+ case KryptonMessageBoxIcon.Shield:
+ _messageIcon.Image = UACShieldIconResources.UAC_Shield_Windows_11;
+ break;
+ case KryptonMessageBoxIcon.WindowsLogo:
+ _messageIcon.Image = MessageBoxImageResources.Windows11;
+ break;
+ case KryptonMessageBoxIcon.Application:
+ if (_applicationImage != null)
+ {
+ _messageIcon.Image = _applicationImage;
+ }
+ else if (!string.IsNullOrEmpty(_applicationPath))
+ {
+ Image? sourceImage = GraphicsExtensions.ExtractIconFromFilePath(_applicationPath)?.ToBitmap();
+ Image? scaledImage = GraphicsExtensions.ScaleImage(sourceImage, new Size(32, 32));
+
+ _messageIcon.Image = scaledImage;
+ }
+ else
+ {
+ // Fall back to defaults
+ _messageIcon.Image = SystemIcons.Application.ToBitmap();
+ }
+ break;
+ case KryptonMessageBoxIcon.SystemApplication:
+ _messageIcon.Image = SystemIcons.Application.ToBitmap();
+ break;
+ }
+ }
+ else
+ {
+ switch (icon)
+ {
+ case KryptonMessageBoxIcon.None:
+ // Windows XP and before will Beep, Vista and above do not!
+ if (GlobalStaticValues.OS_MAJOR_VERSION < 6)
+ {
+ SystemSounds.Beep.Play();
+ }
+
+ break;
+ case KryptonMessageBoxIcon.Hand:
+ _messageIcon.Image = MessageBoxImageResources.GenericHand;
+ SystemSounds.Hand.Play();
+ break;
+ case KryptonMessageBoxIcon.SystemHand:
+ _messageIcon.Image = SystemIcons.Hand.ToBitmap();
+ SystemSounds.Hand.Play();
+ break;
+ case KryptonMessageBoxIcon.Question:
+ _messageIcon.Image = MessageBoxImageResources.GenericQuestion;
+ SystemSounds.Question.Play();
+ break;
+ case KryptonMessageBoxIcon.SystemQuestion:
+ _messageIcon.Image = SystemIcons.Question.ToBitmap();
+ SystemSounds.Question.Play();
+ break;
+ case KryptonMessageBoxIcon.Exclamation:
+ _messageIcon.Image = MessageBoxImageResources.GenericWarning;
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.SystemExclamation:
+ _messageIcon.Image = SystemIcons.Warning.ToBitmap();
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.Asterisk:
+ _messageIcon.Image = OSUtilities.IsAtLeastWindowsEleven
+ ? MessageBoxImageResources.Asterisk_Windows_11
+ : MessageBoxImageResources.GenericAsterisk;
+ SystemSounds.Asterisk.Play();
+ break;
+ case KryptonMessageBoxIcon.SystemAsterisk:
+ _messageIcon.Image = SystemIcons.Asterisk.ToBitmap();
+ SystemSounds.Asterisk.Play();
+ break;
+ case KryptonMessageBoxIcon.Stop:
+ _messageIcon.Image = MessageBoxImageResources.GenericStop;
+ SystemSounds.Asterisk.Play();
+ break;
+ case KryptonMessageBoxIcon.Error:
+ _messageIcon.Image = MessageBoxImageResources.GenericCritical;
+ SystemSounds.Asterisk.Play();
+ break;
+ case KryptonMessageBoxIcon.Warning:
+ _messageIcon.Image = MessageBoxImageResources.GenericWarning;
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.Information:
+ _messageIcon.Image = MessageBoxImageResources.GenericInformation;
+ SystemSounds.Asterisk.Play();
+ break;
+ case KryptonMessageBoxIcon.Shield:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ _messageIcon.Image = UACShieldIconResources.UAC_Shield_Windows_11;
+ }
+ else if (OSUtilities.IsWindowsTen)
+ {
+ _messageIcon.Image = UACShieldIconResources.UAC_Shield_Windows_10;
+ }
+ else
+ {
+ _messageIcon.Image = UACShieldIconResources.UAC_Shield_Windows_7;
+ }
+
+ break;
+ case KryptonMessageBoxIcon.WindowsLogo:
+ // Because Windows 11 displays a generic application icon,
+ // we need to rely on an image instead
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ _messageIcon.Image = MessageBoxImageResources.Windows11;
+ }
+ // Windows 10
+ else if (OSUtilities.IsWindowsTen)
+ {
+ _messageIcon.Image = MessageBoxImageResources.Windows_8_and_10_Logo;
+ }
+ else
+ {
+ _messageIcon.Image = SystemIcons.WinLogo.ToBitmap();
+ }
+
+ break;
+ case KryptonMessageBoxIcon.Application:
+ if (_applicationImage != null)
+ {
+ _messageIcon.Image = _applicationImage;
+ }
+ else if (!string.IsNullOrEmpty(_applicationPath))
+ {
+ Image? sourceImage = GraphicsExtensions.ExtractIconFromFilePath(_applicationPath)
+ ?.ToBitmap();
+ Image? scaledImage = GraphicsExtensions.ScaleImage(sourceImage, new Size(32, 32));
+
+ _messageIcon.Image = scaledImage;
+ }
+ else
+ {
+ // Fall back to defaults
+ _messageIcon.Image = SystemIcons.Application.ToBitmap();
+ }
+
+ break;
+ case KryptonMessageBoxIcon.SystemApplication:
+ _messageIcon.Image = SystemIcons.Application.ToBitmap();
+ break;
+ }
+ }
+
+ _messageIcon.Visible = (_kryptonMessageBoxIcon != KryptonMessageBoxIcon.None);
+ }
+
+ private void UpdateIcon()
+ {
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ switch (_kryptonMessageBoxIcon)
+ {
+ case KryptonMessageBoxIcon.None:
+ // Windows XP and before will Beep, Vista and above do not!
+ if (GlobalStaticValues.OS_MAJOR_VERSION < 6)
+ {
+ SystemSounds.Beep.Play();
+ }
+ break;
+ case KryptonMessageBoxIcon.Hand:
+ _messageIcon.Image = MessageBoxImageResources.GenericHand;
+ SystemSounds.Hand.Play();
+ break;
+ case KryptonMessageBoxIcon.Question:
+ _messageIcon.Image = MessageBoxImageResources.Question_Windows_11;
+ SystemSounds.Question.Play();
+ break;
+ case KryptonMessageBoxIcon.Exclamation:
+ _messageIcon.Image = MessageBoxImageResources.Warning_Windows_11;
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.Asterisk:
+ _messageIcon.Image = MessageBoxImageResources.Asterisk_Windows_11;
+ SystemSounds.Asterisk.Play();
+ break;
+ case KryptonMessageBoxIcon.Stop:
+ _messageIcon.Image = MessageBoxImageResources.GenericStop;
+ SystemSounds.Asterisk.Play();
+ break;
+ case KryptonMessageBoxIcon.Error:
+ _messageIcon.Image = MessageBoxImageResources.Critical_Windows_11;
+ SystemSounds.Asterisk.Play();
+ break;
+ case KryptonMessageBoxIcon.Warning:
+ _messageIcon.Image = MessageBoxImageResources.Warning_Windows_11;
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.Information:
+ _messageIcon.Image = MessageBoxImageResources.Information_Windows_11;
+ SystemSounds.Asterisk.Play();
+ break;
+ case KryptonMessageBoxIcon.Shield:
+ _messageIcon.Image = UACShieldIconResources.UAC_Shield_Windows_11;
+ break;
+ case KryptonMessageBoxIcon.WindowsLogo:
+ _messageIcon.Image = MessageBoxImageResources.Windows11;
+ break;
+ case KryptonMessageBoxIcon.Application:
+ if (_applicationImage != null)
+ {
+ _messageIcon.Image = _applicationImage;
+ }
+ else if (!string.IsNullOrEmpty(_applicationPath))
+ {
+ Image? sourceImage = GraphicsExtensions.ExtractIconFromFilePath(_applicationPath)?.ToBitmap();
+ Image? scaledImage = GraphicsExtensions.ScaleImage(sourceImage, new Size(32, 32));
+
+ _messageIcon.Image = scaledImage;
+ }
+ else
+ {
+ // Fall back to defaults
+ _messageIcon.Image = SystemIcons.Application.ToBitmap();
+ }
+ break;
+ case KryptonMessageBoxIcon.SystemApplication:
+ _messageIcon.Image = SystemIcons.Application.ToBitmap();
+ break;
+ }
+ }
+ else
+ {
+ switch (_kryptonMessageBoxIcon)
+ {
+ case KryptonMessageBoxIcon.None:
+ // Windows XP and before will Beep, Vista and above do not!
+ if (GlobalStaticValues.OS_MAJOR_VERSION < 6)
+ {
+ SystemSounds.Beep.Play();
+ }
+ break;
+ case KryptonMessageBoxIcon.Hand:
+ _messageIcon.Image = MessageBoxImageResources.GenericHand;
+ SystemSounds.Hand.Play();
+ break;
+ case KryptonMessageBoxIcon.SystemHand:
+ _messageIcon.Image = SystemIcons.Hand.ToBitmap();
+ SystemSounds.Hand.Play();
+ break;
+ case KryptonMessageBoxIcon.Question:
+ _messageIcon.Image = MessageBoxImageResources.GenericQuestion;
+ SystemSounds.Question.Play();
+ break;
+ case KryptonMessageBoxIcon.SystemQuestion:
+ _messageIcon.Image = SystemIcons.Question.ToBitmap();
+ SystemSounds.Question.Play();
+ break;
+ case KryptonMessageBoxIcon.Exclamation:
+ _messageIcon.Image = MessageBoxImageResources.GenericWarning;
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.SystemExclamation:
+ _messageIcon.Image = SystemIcons.Warning.ToBitmap();
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.Asterisk:
+ _messageIcon.Image = OSUtilities.IsAtLeastWindowsEleven
+ ? MessageBoxImageResources.Asterisk_Windows_11
+ : MessageBoxImageResources.GenericAsterisk;
+ SystemSounds.Asterisk.Play();
+ break;
+ case KryptonMessageBoxIcon.SystemAsterisk:
+ _messageIcon.Image = SystemIcons.Asterisk.ToBitmap();
+ SystemSounds.Asterisk.Play();
+ break;
+ case KryptonMessageBoxIcon.Stop:
+ _messageIcon.Image = MessageBoxImageResources.GenericStop;
+ SystemSounds.Asterisk.Play();
+ break;
+ case KryptonMessageBoxIcon.Error:
+ _messageIcon.Image = MessageBoxImageResources.GenericCritical;
+ SystemSounds.Asterisk.Play();
+ break;
+ case KryptonMessageBoxIcon.Warning:
+ _messageIcon.Image = MessageBoxImageResources.GenericWarning;
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.Information:
+ _messageIcon.Image = MessageBoxImageResources.GenericInformation;
+ SystemSounds.Asterisk.Play();
+ break;
+ case KryptonMessageBoxIcon.Shield:
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ _messageIcon.Image = UACShieldIconResources.UAC_Shield_Windows_11;
+ }
+ else if (OSUtilities.IsWindowsTen)
+ {
+ _messageIcon.Image = UACShieldIconResources.UAC_Shield_Windows_10;
+ }
+ else
+ {
+ _messageIcon.Image = UACShieldIconResources.UAC_Shield_Windows_7;
+ }
+ break;
+ case KryptonMessageBoxIcon.WindowsLogo:
+ // Because Windows 11 displays a generic application icon,
+ // we need to rely on an image instead
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ _messageIcon.Image = MessageBoxImageResources.Windows11;
+ }
+ // Windows 10
+ else if (OSUtilities.IsWindowsTen)
+ {
+ _messageIcon.Image = MessageBoxImageResources.Windows_8_and_10_Logo;
+ }
+ else
+ {
+ _messageIcon.Image = SystemIcons.WinLogo.ToBitmap();
+ }
+ break;
+ case KryptonMessageBoxIcon.Application:
+ if (_applicationImage != null)
+ {
+ _messageIcon.Image = _applicationImage;
+ }
+ else if (!string.IsNullOrEmpty(_applicationPath))
+ {
+ Image? sourceImage = GraphicsExtensions.ExtractIconFromFilePath(_applicationPath)?.ToBitmap();
+ Image? scaledImage = GraphicsExtensions.ScaleImage(sourceImage, new Size(32, 32));
+
+ _messageIcon.Image = scaledImage;
+ }
+ else
+ {
+ // Fall back to defaults
+ _messageIcon.Image = SystemIcons.Application.ToBitmap();
+ }
+ break;
+ case KryptonMessageBoxIcon.SystemApplication:
+ _messageIcon.Image = SystemIcons.Application.ToBitmap();
+ break;
+ }
+ }
+ _messageIcon.Visible = (_kryptonMessageBoxIcon != KryptonMessageBoxIcon.None);
+ }
+
+ private void UpdateButtons()
+ {
+ switch (_buttons)
+ {
+ case KryptonMessageBoxButtons.OK:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.OK;
+ _button1.DialogResult = DialogResult.OK;
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ break;
+ case KryptonMessageBoxButtons.OKCancel:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.OK;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.Cancel;
+ _button1.DialogResult = DialogResult.OK;
+ _button2.DialogResult = DialogResult.Cancel;
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ _button2.Visible = true;
+ _button2.Enabled = true;
+ break;
+ case KryptonMessageBoxButtons.YesNo:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.Yes;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.No;
+ _button1.DialogResult = DialogResult.Yes;
+ _button2.DialogResult = DialogResult.No;
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ _button2.Visible = true;
+ _button2.Enabled = true;
+ ControlBox = false;
+ break;
+ case KryptonMessageBoxButtons.YesNoCancel:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.Yes;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.No;
+ _button3.Text = KryptonManager.Strings.GeneralStrings.Cancel;
+ _button1.DialogResult = DialogResult.Yes;
+ _button2.DialogResult = DialogResult.No;
+ _button3.DialogResult = DialogResult.Cancel;
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ _button2.Visible = true;
+ _button2.Enabled = true;
+ _button3.Visible = true;
+ _button3.Enabled = true;
+ break;
+ case KryptonMessageBoxButtons.RetryCancel:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.Retry;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.Cancel;
+ _button1.DialogResult = DialogResult.Retry;
+ _button2.DialogResult = DialogResult.Cancel;
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ _button2.Visible = true;
+ _button2.Enabled = true;
+ break;
+ case KryptonMessageBoxButtons.AbortRetryIgnore:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.Abort;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.Retry;
+ _button3.Text = KryptonManager.Strings.GeneralStrings.Ignore;
+ _button1.DialogResult = DialogResult.Abort;
+ _button2.DialogResult = DialogResult.Retry;
+ _button3.DialogResult = DialogResult.Ignore;
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ _button2.Visible = true;
+ _button2.Enabled = true;
+ _button3.Visible = true;
+ _button3.Enabled = true;
+ ControlBox = false;
+ break;
+ case KryptonMessageBoxButtons.CancelTryContinue:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.Cancel;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.TryAgain;
+ _button3.Text = KryptonManager.Strings.GeneralStrings.Continue;
+ _button1.DialogResult = DialogResult.Cancel;
+#if NET6_0_OR_GREATER
+ _button2.DialogResult = DialogResult.TryAgain;
+ _button3.DialogResult = DialogResult.Continue;
+#else
+ _button2.DialogResult = (DialogResult)10;
+ _button3.DialogResult = (DialogResult)11;
+#endif
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ _button2.Visible = true;
+ _button2.Enabled = true;
+ _button3.Visible = true;
+ _button3.Enabled = true;
+ break;
+ }
+
+ // Do we ignore the Alt+F4 on the buttons?
+ if (!ControlBox)
+ {
+ _button1.IgnoreAltF4 = true;
+ _button2.IgnoreAltF4 = true;
+ _button3.IgnoreAltF4 = true;
+ _button4.IgnoreAltF4 = true;
+ }
+ }
+
+ private void UpdateButtons(KryptonMessageBoxButtons buttons)
+ {
+ switch (buttons)
+ {
+ case KryptonMessageBoxButtons.OK:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.OK;
+ _button1.DialogResult = DialogResult.OK;
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ break;
+ case KryptonMessageBoxButtons.OKCancel:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.OK;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.Cancel;
+ _button1.DialogResult = DialogResult.OK;
+ _button2.DialogResult = DialogResult.Cancel;
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ _button2.Visible = true;
+ _button2.Enabled = true;
+ break;
+ case KryptonMessageBoxButtons.YesNo:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.Yes;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.No;
+ _button1.DialogResult = DialogResult.Yes;
+ _button2.DialogResult = DialogResult.No;
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ _button2.Visible = true;
+ _button2.Enabled = true;
+ ControlBox = false;
+ break;
+ case KryptonMessageBoxButtons.YesNoCancel:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.Yes;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.No;
+ _button3.Text = KryptonManager.Strings.GeneralStrings.Cancel;
+ _button1.DialogResult = DialogResult.Yes;
+ _button2.DialogResult = DialogResult.No;
+ _button3.DialogResult = DialogResult.Cancel;
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ _button2.Visible = true;
+ _button2.Enabled = true;
+ _button3.Visible = true;
+ _button3.Enabled = true;
+ break;
+ case KryptonMessageBoxButtons.RetryCancel:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.Retry;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.Cancel;
+ _button1.DialogResult = DialogResult.Retry;
+ _button2.DialogResult = DialogResult.Cancel;
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ _button2.Visible = true;
+ _button2.Enabled = true;
+ break;
+ case KryptonMessageBoxButtons.AbortRetryIgnore:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.Abort;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.Retry;
+ _button3.Text = KryptonManager.Strings.GeneralStrings.Ignore;
+ _button1.DialogResult = DialogResult.Abort;
+ _button2.DialogResult = DialogResult.Retry;
+ _button3.DialogResult = DialogResult.Ignore;
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ _button2.Visible = true;
+ _button2.Enabled = true;
+ _button3.Visible = true;
+ _button3.Enabled = true;
+ ControlBox = false;
+ break;
+ case KryptonMessageBoxButtons.CancelTryContinue:
+ _button1.Text = KryptonManager.Strings.GeneralStrings.Cancel;
+ _button2.Text = KryptonManager.Strings.GeneralStrings.TryAgain;
+ _button3.Text = KryptonManager.Strings.GeneralStrings.Continue;
+ _button1.DialogResult = DialogResult.Cancel;
+#if NET6_0_OR_GREATER
+ _button2.DialogResult = DialogResult.TryAgain;
+ _button3.DialogResult = DialogResult.Continue;
+#else
+ _button2.DialogResult = (DialogResult)10;
+ _button3.DialogResult = (DialogResult)11;
+#endif
+ _button1.Visible = true;
+ _button1.Enabled = true;
+ _button2.Visible = true;
+ _button2.Enabled = true;
+ _button3.Visible = true;
+ _button3.Enabled = true;
+ break;
+ }
+
+ // Do we ignore the Alt+F4 on the buttons?
+ if (!ControlBox)
+ {
+ _button1.IgnoreAltF4 = true;
+ _button2.IgnoreAltF4 = true;
+ _button3.IgnoreAltF4 = true;
+ _button4.IgnoreAltF4 = true;
+ }
+ }
+
+ private void UpdateDefault(KryptonMessageBoxDefaultButton? defaultButton)
+ {
+ switch (defaultButton)
+ {
+ case KryptonMessageBoxDefaultButton.Button1:
+ //_button1.Select();
+ AcceptButton = _button1;
+ break;
+ case KryptonMessageBoxDefaultButton.Button2:
+ //_button2.Select();
+ AcceptButton = _button2;
+ break;
+ case KryptonMessageBoxDefaultButton.Button3:
+ //_button3.Select();
+ AcceptButton = _button3;
+ break;
+ case KryptonMessageBoxDefaultButton.Button4:
+ AcceptButton = _showHelpButton ? _button4 : _button1;
+ break;
+ case null:
+ AcceptButton = _button1;
+ break;
+ default:
+ AcceptButton = _showHelpButton ? _button4 : _button1;
+ break;
+ }
+ }
+
+ private void UpdateDefault()
+ {
+ switch (_defaultButton)
+ {
+ case KryptonMessageBoxDefaultButton.Button1:
+ //_button1.Select();
+ AcceptButton = _button1;
+ break;
+ case KryptonMessageBoxDefaultButton.Button2:
+ //_button2.Select();
+ AcceptButton = _button2;
+ break;
+ case KryptonMessageBoxDefaultButton.Button3:
+ //_button3.Select();
+ AcceptButton = _button3;
+ break;
+ case KryptonMessageBoxDefaultButton.Button4:
+ AcceptButton = _showHelpButton ? _button4 : _button1;
+ break;
+ default:
+ AcceptButton = _showHelpButton ? _button4 : _button1;
+ break;
+ }
+ }
+
+ private void UpdateHelp(bool? showHelpButton)
+ {
+ if (showHelpButton != null)
+ {
+ return;
+ }
+
+ MessageButton helpButton = _buttons switch
+ {
+ KryptonMessageBoxButtons.OK => _button2,
+ KryptonMessageBoxButtons.OKCancel or KryptonMessageBoxButtons.YesNo or KryptonMessageBoxButtons.RetryCancel => _button3,
+ KryptonMessageBoxButtons.AbortRetryIgnore or KryptonMessageBoxButtons.YesNoCancel => _button4,
+ _ => throw new ArgumentOutOfRangeException()
+ };
+ if (helpButton != null)
+ {
+ helpButton.Visible = true;
+ helpButton.Enabled = true;
+ helpButton.Text = KryptonManager.Strings.GeneralStrings.Help;
+
+ helpButton.KeyPress += (_, _) => LaunchHelp(_messageBoxData.Owner);
+
+ helpButton.Click += (_, _) => LaunchHelp(_messageBoxData.Owner);
+ }
+ }
+
+ private void UpdateHelp()
+ {
+ if (!_showHelpButton)
+ {
+ return;
+ }
+
+ MessageButton helpButton = _buttons switch
+ {
+ KryptonMessageBoxButtons.OK => _button2,
+ KryptonMessageBoxButtons.OKCancel
+ or KryptonMessageBoxButtons.YesNo
+ or KryptonMessageBoxButtons.RetryCancel => _button3,
+ KryptonMessageBoxButtons.AbortRetryIgnore
+ or KryptonMessageBoxButtons.YesNoCancel
+ or KryptonMessageBoxButtons.CancelTryContinue => _button4,
+ _ => throw new ArgumentOutOfRangeException()
+ };
+ if (helpButton != null)
+ {
+ helpButton.Visible = true;
+ helpButton.Enabled = true;
+ helpButton.Text = KryptonManager.Strings.GeneralStrings.Help;
+ helpButton.KeyPress += (_, _) => LaunchHelp();
+ helpButton.Click += (_, _) => LaunchHelp();
+ }
+ }
+
+ ///
+ /// When the user clicks the Help button, the Help file specified in the helpFilePath parameter
+ /// is opened and the Help keyword topic identified by the keyword parameter is Displayed.
+ /// The form that owns the message box (or the active form) also receives the HelpRequested event.
+ ///
+ private void LaunchHelp(IWin32Window? owner)
+ {
+ try
+ {
+ if (owner != null)
+ {
+ Control? control = FromHandle(owner.Handle);
+
+ var mInfoMethod = control!.GetType().GetMethod(nameof(OnHelpRequested), BindingFlags.Instance | BindingFlags.NonPublic,
+ Type.DefaultBinder, [typeof(HelpEventArgs)], null);
+ mInfoMethod?.Invoke(control, [new HelpEventArgs(MousePosition)]);
+ if (_helpInfo != null)
+ {
+ if (string.IsNullOrWhiteSpace(_helpInfo.HelpFilePath))
+ {
+ return;
+ }
+
+ if (!string.IsNullOrWhiteSpace(_helpInfo.Keyword))
+ {
+ Help.ShowHelp(control, _helpInfo.HelpFilePath, _helpInfo.Keyword);
+ }
+ else
+ {
+ Help.ShowHelp(control, _helpInfo.HelpFilePath, _helpInfo.Navigator, _helpInfo.Param);
+ }
+ }
+ }
+ }
+ catch
+ {
+ // Do nothing
+ }
+ }
+
+ ///
+ /// When the user clicks the Help button, the Help file specified in the helpFilePath parameter
+ /// is opened and the Help keyword topic identified by the keyword parameter is Displayed.
+ /// The form that owns the message box (or the active form) also receives the HelpRequested event.
+ ///
+ private void LaunchHelp()
+ {
+ try
+ {
+ if (_showOwner != null)
+ {
+ Control? control = FromHandle(_showOwner.Handle);
+
+ var mInfoMethod = control!.GetType().GetMethod(nameof(OnHelpRequested), BindingFlags.Instance | BindingFlags.NonPublic,
+ Type.DefaultBinder, [typeof(HelpEventArgs)], null);
+ mInfoMethod?.Invoke(control, [new HelpEventArgs(MousePosition)]);
+ if (_helpInfo != null)
+ {
+ if (string.IsNullOrWhiteSpace(_helpInfo.HelpFilePath))
+ {
+ return;
+ }
+
+ if (!string.IsNullOrWhiteSpace(_helpInfo.Keyword))
+ {
+ Help.ShowHelp(control, _helpInfo.HelpFilePath, _helpInfo.Keyword);
+ }
+ else
+ {
+ Help.ShowHelp(control, _helpInfo.HelpFilePath, _helpInfo.Navigator, _helpInfo.Param);
+ }
+ }
+ }
+ }
+ catch
+ {
+ // Do nothing
+ }
+ }
+
+ private void UpdateSizing(IWin32Window? showOwner)
+ {
+ Size messageSizing = UpdateMessageSizing(showOwner);
+ Size buttonsSizing = UpdateButtonsSizing();
+
+ // Size of window is calculated from the client area
+ ClientSize = new Size(Math.Max(messageSizing.Width, buttonsSizing.Width),
+ messageSizing.Height + buttonsSizing.Height);
+ }
+
+ private Size UpdateMessageSizing(IWin32Window? showOwner)
+ {
+ // Update size of the message label but with a maximum width
+ Size textSize;
+ using (Graphics g = CreateGraphics())
+ {
+ // Find size of the label, with a max of 2/3 screen width
+ Screen screen = showOwner is IWin32Window window
+ ? Screen.FromHandle(window.Handle)
+ : Screen.PrimaryScreen ?? throw new NullReferenceException("Screen.PrimaryScreen returned null");
+
+ Size scaledMonitorSize = screen.WorkingArea.Size;
+ scaledMonitorSize.Width = (int)(scaledMonitorSize.Width * 2 / 3.0f);
+ scaledMonitorSize.Height = (int)(scaledMonitorSize.Height * 0.95f);
+
+ Font textFont = GetMessageTextFont(_contentAreaType);
+ Font captionFont = KryptonManager.CurrentGlobalPalette.BaseFont;
+
+ // Measure the string
+ SizeF messageSize = g.MeasureString(_text, textFont, new SizeF(scaledMonitorSize.Width, scaledMonitorSize.Height));
+
+ // SKC: Don't forget to add the TextExtra into the calculation
+ SizeF captionSize = TextRenderer.MeasureText($"{_caption} {TextExtra}", captionFont, scaledMonitorSize);
+
+ var messageXSize = Math.Max(messageSize.Width, captionSize.Width);
+ // Work out DPI adjustment factor
+ var factorX = g.DpiX > 96 ? (1.0f * g.DpiX / 96) : 1.0f;
+ var factorY = g.DpiY > 96 ? (1.0f * g.DpiY / 96) : 1.0f;
+
+ messageSize.Width = messageXSize * factorX;
+ messageSize.Height *= factorY;
+
+ textSize = Size.Ceiling(messageSize);
+ }
+
+ // Calculate the size of the icon area and text area including margins
+ Padding textPadding = GetMessageTextPadding(_contentAreaType);
+ Padding textAreaAllMargin = Padding.Add(textPadding, kpnlContentArea.Margin);
+ Size iconArea = new Size(_messageIcon.Width + _messageIcon.Margin.Left + _messageIcon.Margin.Right,
+ _messageIcon.Height + _messageIcon.Margin.Top + _messageIcon.Margin.Bottom);
+ Size textArea = new Size(textSize.Width + textAreaAllMargin.Left + textAreaAllMargin.Right,
+ textSize.Height + textAreaAllMargin.Top + textAreaAllMargin.Bottom);
+ return new Size(textArea.Width + iconArea.Width,
+ Math.Max(iconArea.Height, textArea.Height));
+ }
+
+ private Font GetMessageTextFont(MessageBoxContentAreaType? contentAreaType)
+ {
+ switch (contentAreaType)
+ {
+ case MessageBoxContentAreaType.Normal:
+ return krtbMessageText.StateCommon.Content.GetContentShortTextFont(PaletteState.Normal)
+ ?? KryptonManager.CurrentGlobalPalette.BaseFont;
+ case MessageBoxContentAreaType.LinkLabel:
+ klwlblMessageText.UpdateFont();
+ return klwlblMessageText.Font
+ ?? KryptonManager.CurrentGlobalPalette.BaseFont;
+ case null:
+ return KryptonManager.CurrentGlobalPalette.BaseFont;
+ default:
+ throw new ArgumentOutOfRangeException(nameof(contentAreaType), contentAreaType, null);
+ }
+ }
+
+ private Padding GetMessageTextPadding(MessageBoxContentAreaType? contentAreaType)
+ {
+ switch (contentAreaType)
+ {
+ case MessageBoxContentAreaType.Normal:
+ return krtbMessageText.StateCommon.Content.GetContentPadding(PaletteState.Normal);
+ case MessageBoxContentAreaType.LinkLabel:
+ return klwlblMessageText.Padding;
+ case null:
+ return new Padding(0);
+ default:
+ throw new ArgumentOutOfRangeException(nameof(contentAreaType), contentAreaType, null);
+ }
+ }
+
+ private Size UpdateButtonsSizing()
+ {
+ var numButtons = 1;
+
+ // Button1 is always visible
+ Size button1Size = _button1.GetPreferredSize(Size.Empty);
+ var maxButtonSize = button1Size with { Width = button1Size.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING };
+
+ // If Button2 is visible
+ if (_button2.Enabled)
+ {
+ numButtons++;
+ Size button2Size = _button2.GetPreferredSize(Size.Empty);
+ maxButtonSize.Width = Math.Max(maxButtonSize.Width, button2Size.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING);
+ maxButtonSize.Height = Math.Max(maxButtonSize.Height, button2Size.Height);
+ }
+
+ // If Button3 is visible
+ if (_button3.Enabled)
+ {
+ numButtons++;
+ Size button3Size = _button3.GetPreferredSize(Size.Empty);
+ maxButtonSize.Width = Math.Max(maxButtonSize.Width, button3Size.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING);
+ maxButtonSize.Height = Math.Max(maxButtonSize.Height, button3Size.Height);
+ }
+ // If Button4 is visible
+ if (_button4.Enabled)
+ {
+ numButtons++;
+ Size button4Size = _button4.GetPreferredSize(Size.Empty);
+ maxButtonSize.Width = Math.Max(maxButtonSize.Width, button4Size.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING);
+ maxButtonSize.Height = Math.Max(maxButtonSize.Height, button4Size.Height);
+ }
+
+ // Start positioning buttons 10 pixels from right edge
+ var right = _panelButtons.Right - GlobalStaticValues.GLOBAL_BUTTON_PADDING;
+
+ //var left = _panelButtons.Left - GlobalStaticValues.GLOBAL_BUTTON_PADDING;
+
+ // If Button4 is visible
+ if (_button4.Enabled)
+ {
+ _button4.Location = new Point(right - maxButtonSize.Width, GlobalStaticValues.GLOBAL_BUTTON_PADDING);
+ _button4.Size = maxButtonSize;
+ right -= maxButtonSize.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING;
+ }
+
+ // If Button3 is visible
+ if (_button3.Enabled)
+ {
+ _button3.Location = new Point(right - maxButtonSize.Width, GlobalStaticValues.GLOBAL_BUTTON_PADDING);
+ _button3.Size = maxButtonSize;
+ right -= maxButtonSize.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING;
+ }
+
+ // If Button2 is visible
+ if (_button2.Enabled)
+ {
+ _button2.Location = new Point(right - maxButtonSize.Width, GlobalStaticValues.GLOBAL_BUTTON_PADDING);
+ _button2.Size = maxButtonSize;
+ right -= maxButtonSize.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING;
+ }
+
+ // Button1 is always visible
+ _button1.Location = new Point(right - maxButtonSize.Width, GlobalStaticValues.GLOBAL_BUTTON_PADDING);
+ _button1.Size = maxButtonSize;
+
+ // Size the panel for the buttons
+ _panelButtons.Size = new Size((maxButtonSize.Width * numButtons) + (GlobalStaticValues.GLOBAL_BUTTON_PADDING * (numButtons + 1)), maxButtonSize.Height + (GlobalStaticValues.GLOBAL_BUTTON_PADDING * 2));
+
+ // Button area is the number of buttons with gaps between them and 10 pixels around all edges
+ return new Size((maxButtonSize.Width * numButtons) + (GlobalStaticValues.GLOBAL_BUTTON_PADDING * (numButtons + 1)), maxButtonSize.Height + (GlobalStaticValues.GLOBAL_BUTTON_PADDING * 2));
+ }
+
+ private void OnFormClosed(object sender, FormClosedEventArgs e)
+ {
+ _krtbNativeWindow.ReleaseHandle();
+ }
+
+ private void AnyKeyDown(object sender, KeyEventArgs e)
+ {
+ // Escape key kills the dialog if we allow it to be closed
+ if (ControlBox
+ && (e.KeyCode == Keys.Escape)
+ )
+ {
+ Close();
+ }
+ else if (e.KeyData == (Keys.Control | Keys.C))
+ {
+ const string DIVIDER = @"---------------------------";
+ const string BUTTON_TEXT_SPACER = @" ";
+ // Pressing Ctrl+C should copy message text into the clipboard
+ var sb = new StringBuilder();
+
+ sb.AppendLine(DIVIDER);
+ sb.AppendLine(Text);
+ sb.AppendLine(DIVIDER);
+ sb.AppendLine(klwlblMessageText.Text);
+ sb.AppendLine(DIVIDER);
+ sb.Append(_button1.Text).Append(BUTTON_TEXT_SPACER);
+ if (_button2.Enabled)
+ {
+ sb.Append(_button2.Text).Append(BUTTON_TEXT_SPACER);
+ if (_button3.Enabled)
+ {
+ sb.Append(_button3.Text).Append(BUTTON_TEXT_SPACER);
+ }
+
+ if (_button4.Enabled)
+ {
+ sb.Append(_button4.Text).Append(BUTTON_TEXT_SPACER);
+ }
+ }
+
+ sb.AppendLine(string.Empty);
+ sb.AppendLine(DIVIDER);
+
+ Clipboard.SetText(sb.ToString(), TextDataFormat.Text);
+ Clipboard.SetText(sb.ToString(), TextDataFormat.UnicodeText);
+ }
+ }
+
+ private void LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
+ {
+ try
+ {
+ if (_linkLabelCommand != null)
+ {
+ _linkLabelCommand.PerformExecute();
+ }
+ else if (_linkLaunchArgument != null)
+ {
+ Process.Start(_linkLaunchArgument);
+ }
+ }
+ catch (Exception exception)
+ {
+ ExceptionHandler.CaptureException(exception, showStackTrace: GlobalStaticValues.DEFAULT_USE_STACK_TRACE);
+ }
+ }
+
+ /// Updates the type of the content area.
+ /// Type of the content area.
+ private void UpdateContentAreaType(MessageBoxContentAreaType? contentAreaType)
+ {
+ switch (contentAreaType)
+ {
+ case MessageBoxContentAreaType.Normal:
+ klwlblMessageText.Visible = false;
+
+ krtbMessageText.Visible = true;
+ break;
+ case MessageBoxContentAreaType.LinkLabel:
+ klwlblMessageText.Visible = true;
+
+ krtbMessageText.Visible = false;
+ break;
+ case null:
+ klwlblMessageText.Visible = false;
+
+ krtbMessageText.Visible = true;
+ break;
+ default:
+ throw new ArgumentOutOfRangeException(nameof(contentAreaType), contentAreaType, null);
+ }
+ }
+
+ private void UpdateContentLinkArea(LinkArea? contentLinkArea)
+ {
+ if (contentLinkArea != null)
+ {
+ klwlblMessageText.LinkArea = (LinkArea)contentLinkArea;
+ }
+ }
+
+ private void ShowCloseButton(bool? showCloseButton) => CloseBox = showCloseButton ?? true;
+
+ #region KryptonMessageBoxResult Methods
+
+ public KryptonMessageBoxResult ShowMessageBox() => ShowMessageBox(null);
+
+ // ToDo: Expand this method
+ public KryptonMessageBoxResult ShowMessageBox(IWin32Window? owner)
+ {
+ return KryptonMessageBoxResult.Ignore;
+ }
+
+ #endregion
+
+ #endregion
+ }
+
+}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualMessageBoxFormDep.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualMessageBoxFormDep.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualMessageBoxFormDep.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/MultilineStringEditor.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualMultilineStringEditor.cs
similarity index 97%
rename from Source/Krypton Components/Krypton.Toolkit/Controls Visuals/MultilineStringEditor.cs
rename to Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualMultilineStringEditor.cs
index d41f1387f..bd40d9974 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/MultilineStringEditor.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualMultilineStringEditor.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -160,7 +160,7 @@ private void CloseEditor()
///
/// The control.
/// The event arguments.
- private void OnKeyDownTextBox(object sender, KeyEventArgs e)
+ private void OnKeyDownTextBox(object? sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
{
@@ -179,7 +179,7 @@ private void OnKeyDownTextBox(object sender, KeyEventArgs e)
///
private bool OnGetMinMaxInfo(ref Message m)
{
- PI.MINMAXINFO minMax = (PI.MINMAXINFO)Marshal.PtrToStructure(m.LParam, typeof(PI.MINMAXINFO));
+ var minMax = (PI.MINMAXINFO)Marshal.PtrToStructure(m.LParam, typeof(PI.MINMAXINFO))!;
if (!MaximumSize.IsEmpty)
{
minMax.ptMaxTrackSize.X = MaximumSize.Width;
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonMultilineStringEditorForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualMultilineStringEditorForm.Designer.cs
similarity index 99%
rename from Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonMultilineStringEditorForm.Designer.cs
rename to Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualMultilineStringEditorForm.Designer.cs
index b334c6dcc..0cb366199 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonMultilineStringEditorForm.Designer.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualMultilineStringEditorForm.Designer.cs
@@ -1,6 +1,6 @@
namespace Krypton.Toolkit
{
- partial class KryptonMultilineStringEditorForm
+ partial class VisualMultilineStringEditorForm
{
///
/// Required designer variable.
@@ -83,7 +83,6 @@ private void InitializeComponent()
// kbtnOk
//
this.kbtnOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.kbtnOk.CornerRoundingRadius = -1F;
this.kbtnOk.DialogResult = System.Windows.Forms.DialogResult.OK;
this.kbtnOk.Location = new System.Drawing.Point(381, 13);
this.kbtnOk.Name = "kbtnOk";
@@ -95,7 +94,6 @@ private void InitializeComponent()
// kbtnCancel
//
this.kbtnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.kbtnCancel.CornerRoundingRadius = -1F;
this.kbtnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.kbtnCancel.Location = new System.Drawing.Point(477, 13);
this.kbtnCancel.Name = "kbtnCancel";
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonMultilineStringEditorForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualMultilineStringEditorForm.cs
similarity index 63%
rename from Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonMultilineStringEditorForm.cs
rename to Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualMultilineStringEditorForm.cs
index f20329813..d781446e8 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonMultilineStringEditorForm.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualMultilineStringEditorForm.cs
@@ -1,14 +1,14 @@
#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.
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2022 - 2024. All rights reserved.
*
*/
#endregion
namespace Krypton.Toolkit
{
- public partial class KryptonMultilineStringEditorForm : KryptonForm
+ internal partial class VisualMultilineStringEditorForm : KryptonForm
{
#region Instance Fields
@@ -16,40 +16,17 @@ public partial class KryptonMultilineStringEditorForm : KryptonForm
private string _headerText;
+ private string _windowTitle;
+
private string[]? _contents;
private StringCollection? _collection;
#endregion
- #region Public
-
- /// Gets or sets a value indicating whether to use a in place of a multiline .
- /// true if [use rich text box]; otherwise, false .
- [Category(@"Visuals"), DefaultValue(false), Description(@"Use a KryptonRichTextBox in place of a multiline KryptonTextBox.")]
- public bool UseRichTextBox { get => _useRichTextBox; set { _useRichTextBox = value; Invalidate(); } }
-
- /// Gets or sets the header text.
- /// The header text.
- [Category(@"Visuals"), DefaultValue(@"Enter the strings in the collection (one per line):"), Description(@"The text of the header label.")]
- public string HeaderText { get => _headerText; set { _headerText = value; Invalidate(); } }
-
- /// Gets the contents of the text field.
- /// The contents of the text field.
- [Category(@"Data"),
- DefaultValue(null),
- Description(@"The contents of the text field.")]
- public string[]? Contents
- {
- get => _contents;
- private set => _contents = value;
- }
-
- #endregion
-
#region Identity
- public KryptonMultilineStringEditorForm()
+ public VisualMultilineStringEditorForm()
{
InitializeComponent();
@@ -58,15 +35,27 @@ public KryptonMultilineStringEditorForm()
SetupControlsText();
}
- public KryptonMultilineStringEditorForm(string[]? contents, StringCollection? collection = null, bool? useRichTextBox = true, string? headerText = @"Enter the strings in the collection (one per line):", string windowTitle = @"String Collection Editor")
+ public VisualMultilineStringEditorForm(string[]? contents, StringCollection? collection, bool? useRichTextBox, string? headerText, string? windowTitle)
{
InitializeComponent();
- SetupVariables(contents, collection, useRichTextBox, headerText, windowTitle);
+ _contents = contents ?? [string.Empty];
+
+ _collection = collection ?? [];
+
+ _useRichTextBox = useRichTextBox ?? true;
+
+ _headerText = headerText ?? @"Enter the strings in the collection (one per line):";
+
+ _windowTitle = windowTitle ?? @"String Collection Editor";
+
+ klblHeader.Text = _headerText;
+
+ Text = _windowTitle;
SetupControlsText();
- UpdateInput(contents, collection);
+ UpdateInput(_contents, _collection);
}
#endregion
@@ -75,25 +64,25 @@ public KryptonMultilineStringEditorForm(string[]? contents, StringCollection? co
private void SetupControlsText()
{
- kbtnCancel.Text = KryptonLanguageManager.GeneralToolkitStrings.Cancel;
+ kbtnCancel.Text = KryptonManager.Strings.GeneralStrings.Cancel;
- kbtnOk.Text = KryptonLanguageManager.GeneralToolkitStrings.OK;
+ kbtnOk.Text = KryptonManager.Strings.GeneralStrings.OK;
- kcRichTextBoxCopy.Text = KryptonLanguageManager.CustomToolkitStrings.Copy;
+ kcRichTextBoxCopy.Text = KryptonManager.Strings.ToolBarStrings.Copy;
- kcRichTextBoxCut.Text = KryptonLanguageManager.CustomToolkitStrings.Cut;
+ kcRichTextBoxCut.Text = KryptonManager.Strings.ToolBarStrings.Cut;
- kcRichTextBoxPaste.Text = KryptonLanguageManager.CustomToolkitStrings.Paste;
+ kcRichTextBoxPaste.Text = KryptonManager.Strings.ToolBarStrings.Paste;
- kcRichTextBoxSelectAll.Text = KryptonLanguageManager.CustomToolkitStrings.SelectAll;
+ kcRichTextBoxSelectAll.Text = KryptonManager.Strings.CustomStrings.SelectAll;
- kcTextBoxCopy.Text = KryptonLanguageManager.CustomToolkitStrings.Copy;
+ kcTextBoxCopy.Text = KryptonManager.Strings.ToolBarStrings.Copy;
- kcTextBoxCut.Text = KryptonLanguageManager.CustomToolkitStrings.Cut;
+ kcTextBoxCut.Text = KryptonManager.Strings.ToolBarStrings.Cut;
- kcTextBoxPaste.Text = KryptonLanguageManager.CustomToolkitStrings.Paste;
+ kcTextBoxPaste.Text = KryptonManager.Strings.ToolBarStrings.Paste;
- kcTextBoxSelectAll.Text = KryptonLanguageManager.CustomToolkitStrings.SelectAll;
+ kcTextBoxSelectAll.Text = KryptonManager.Strings.CustomStrings.SelectAll;
}
private void SetupVariables(string[]? contents, StringCollection? collection, bool? useRichTextBox, string? headerText, string? windowTitle)
@@ -124,7 +113,7 @@ private void InitialSetup()
_collection = null;
}
- private void SetupIputCanvas()
+ private void SetupInputCanvas()
{
if (_useRichTextBox)
{
@@ -183,10 +172,10 @@ private void kbtnOk_Click(object sender, EventArgs e)
foreach (var line in krtbContents.Lines)
{
// TODO: This is not right.. It will only have the last line it !
- Contents = new string[]
- {
+ _contents =
+ [
line
- };
+ ];
}
}
else
@@ -194,10 +183,10 @@ private void kbtnOk_Click(object sender, EventArgs e)
foreach (var line in ktxtStringCollection.Lines)
{
// TODO: This is not right.. It will only have the last line it !
- Contents = new string[]
- {
+ _contents =
+ [
line
- };
+ ];
}
}
}
@@ -224,7 +213,7 @@ private void kbtnOk_Click(object sender, EventArgs e)
IWin32Window? showOwner = owner ?? FromHandle(PI.GetActiveWindow());
- using var kmse = new KryptonMultilineStringEditorForm(input, null, useRichTextBox, headerText, windowTitle);
+ using var kmse = new VisualMultilineStringEditorForm(input, null, useRichTextBox, headerText, windowTitle);
kmse.StartPosition = showOwner == null ? FormStartPosition.CenterParent : FormStartPosition.CenterScreen;
@@ -237,15 +226,15 @@ private void kbtnOk_Click(object sender, EventArgs e)
{
StringCollection? collection;
- IWin32Window showOwner = owner ?? FromHandle(PI.GetActiveWindow());
+ IWin32Window? showOwner = owner ?? FromHandle(PI.GetActiveWindow());
- using var kmse = new KryptonMultilineStringEditorForm(null, input, useRichTextBox, headerText, windowTitle);
+ using var kmse = new VisualMultilineStringEditorForm(null, input, useRichTextBox, headerText, windowTitle);
kmse.StartPosition = showOwner == null ? FormStartPosition.CenterParent : FormStartPosition.CenterScreen;
if (kmse._useRichTextBox)
{
- collection = new StringCollection();
+ collection = [];
string[] tmp = kmse.krtbContents.Lines;
@@ -253,7 +242,7 @@ private void kbtnOk_Click(object sender, EventArgs e)
}
else
{
- collection = new StringCollection();
+ collection = [];
string[] tmp = kmse.ktxtStringCollection.Lines;
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonMultilineStringEditorForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualMultilineStringEditorForm.resx
similarity index 100%
rename from Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonMultilineStringEditorForm.resx
rename to Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualMultilineStringEditorForm.resx
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualPanel.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualPanel.cs
index a47d9dda3..e1fe9c4fc 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualPanel.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualPanel.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -142,7 +142,7 @@ protected override void Dispose(bool disposing)
if (disposing)
{
// Unhook from any current menu strip
- if (base.ContextMenuStrip != null)
+ if (base.ContextMenuStrip is not null)
{
base.ContextMenuStrip.Opening -= OnContextMenuStripOpening;
base.ContextMenuStrip.Closed -= OnContextMenuClosed;
@@ -150,19 +150,19 @@ protected override void Dispose(bool disposing)
}
// Must unhook from the palette paint event
- if (_palette != null)
+ if (_palette is not null)
{
_palette.PalettePaint -= OnNeedPaint;
_palette.ButtonSpecChanged -= OnButtonSpecChanged;
}
UnattachGlobalEvents();
- ViewManager.Dispose();
+ ViewManager?.Dispose();
_palette = null;
Renderer = null;
_localPalette = null;
- if (Redirector != null)
+ if (Redirector is not null)
{
Redirector.Target = null;
}
@@ -245,7 +245,7 @@ public override ContextMenuStrip? ContextMenuStrip
set
{
// Unhook from any current menu strip
- if (base.ContextMenuStrip != null)
+ if (base.ContextMenuStrip is not null)
{
base.ContextMenuStrip.Opening -= OnContextMenuStripOpening;
base.ContextMenuStrip.Closed -= OnContextMenuClosed;
@@ -255,7 +255,7 @@ public override ContextMenuStrip? ContextMenuStrip
base.ContextMenuStrip = value;
// Hook into the strip being shown (so we can set the correct renderer)
- if (base.ContextMenuStrip != null)
+ if (base.ContextMenuStrip is not null)
{
base.ContextMenuStrip.Opening += OnContextMenuStripOpening;
base.ContextMenuStrip.Closed += OnContextMenuClosed;
@@ -277,7 +277,7 @@ public virtual KryptonContextMenu? KryptonContextMenu
{
if (_kryptonContextMenu != value)
{
- if (_kryptonContextMenu != null)
+ if (_kryptonContextMenu is not null)
{
_kryptonContextMenu.Closed -= OnContextMenuClosed;
_kryptonContextMenu.Disposed -= OnKryptonContextMenuDisposed;
@@ -285,7 +285,7 @@ public virtual KryptonContextMenu? KryptonContextMenu
_kryptonContextMenu = value;
- if (_kryptonContextMenu != null)
+ if (_kryptonContextMenu is not null)
{
_kryptonContextMenu.Closed += OnContextMenuClosed;
_kryptonContextMenu.Disposed += OnKryptonContextMenuDisposed;
@@ -484,7 +484,7 @@ protected override void WndProc(ref Message m)
if (m.Msg == PI.WM_.CONTEXTMENU)
{
// Only interested in overriding the behaviour when we have a krypton context menu...
- if (KryptonContextMenu != null)
+ if (KryptonContextMenu is not null)
{
// Extract the screen mouse position (if might not actually be provided)
var mousePt = new Point(PI.LOWORD(m.LParam), PI.HIWORD(m.LParam));
@@ -508,7 +508,7 @@ protected override void WndProc(ref Message m)
if (ClientRectangle.Contains(mousePt))
{
// Show the context menu
- KryptonContextMenu.Show(this, PointToScreen(mousePt));
+ KryptonContextMenu?.Show(this, PointToScreen(mousePt));
// We eat the message!
return;
@@ -581,7 +581,7 @@ public override Color ForeColor
/// Reset the internal counters.
///
[EditorBrowsable(EditorBrowsableState.Never)]
- public void KryptonResetCounters() => ViewManager.ResetCounters();
+ public void KryptonResetCounters() => ViewManager?.ResetCounters();
///
/// Gets the number of layout cycles performed since last reset.
@@ -589,7 +589,7 @@ public override Color ForeColor
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public int KryptonLayoutCounter => ViewManager.LayoutCounter;
+ public int KryptonLayoutCounter => ViewManager!.LayoutCounter;
///
/// Gets the number of paint cycles performed since last reset.
@@ -597,7 +597,7 @@ public override Color ForeColor
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public int KryptonPaintCounter => ViewManager.PaintCounter;
+ public int KryptonPaintCounter => ViewManager!.PaintCounter;
#endregion
@@ -638,7 +638,7 @@ protected NeedPaintHandler NeedPaintDelegate
///
protected void OnNeedPaint(object? sender, [DisallowNull] NeedLayoutEventArgs e)
{
- Debug.Assert(e != null);
+ Debug.Assert(e is not null);
// Validate incoming reference
if (e == null)
@@ -704,7 +704,7 @@ protected bool NeedTransparentPaint
///
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
- public PaletteBase? GetResolvedPalette() => _palette;
+ public PaletteBase GetResolvedPalette() => _palette!;
#endregion
@@ -723,10 +723,10 @@ protected bool NeedTransparentPaint
protected virtual void OnPaletteChanged(EventArgs e)
{
// Update the redirector with latest palette
- Redirector.Target = _palette;
+ Redirector!.Target = _palette;
// A new palette source means we need to layout and redraw
- OnNeedPaint(Palette, new NeedLayoutEventArgs(true));
+ OnNeedPaint(Palette!, new NeedLayoutEventArgs(true));
PaletteChanged?.Invoke(this, e);
}
@@ -737,7 +737,7 @@ protected virtual void OnPaletteChanged(EventArgs e)
/// True if paint required; otherwise false.
protected virtual bool EvalTransparentPaint() =>
// Do we have a manager to use for asking about painting?
- ViewManager != null && ViewManager.EvalTransparentPaint(Renderer);
+ ViewManager is not null && ViewManager.EvalTransparentPaint(Renderer!);
///
/// Work out if this control needs to use Invoke to force a repaint.
@@ -755,9 +755,9 @@ protected virtual bool EvalTransparentPaint() =>
/// Source of notification.
/// An EventArgs containing event data.
///
- protected virtual void OnButtonSpecChanged(object sender, [DisallowNull] EventArgs e)
+ protected virtual void OnButtonSpecChanged(object? sender, [DisallowNull] EventArgs e)
{
- Debug.Assert(e != null);
+ Debug.Assert(e is not null);
// Validate incoming reference
if (e == null)
@@ -811,7 +811,7 @@ protected override void OnRightToLeftChanged(EventArgs e)
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
// If we have a defined context menu then need to check for matching shortcut
- if (KryptonContextMenu != null)
+ if (KryptonContextMenu is not null)
{
if (KryptonContextMenu.ProcessShortcut(keyData))
{
@@ -832,7 +832,7 @@ protected override void OnLayout(LayoutEventArgs levent)
if (!IsDisposed)
{
// Do we have a manager to use for laying out?
- if (ViewManager != null)
+ if (ViewManager is not null)
{
// Prevent infinite loop by looping a maximum number of times
var max = 5;
@@ -843,7 +843,7 @@ protected override void OnLayout(LayoutEventArgs levent)
_layoutDirty = false;
// Ask the view to perform a layout
- ViewManager.Layout(Renderer);
+ ViewManager?.Layout(Renderer!);
} while (_layoutDirty && (max-- > 0));
@@ -860,13 +860,13 @@ protected override void OnLayout(LayoutEventArgs levent)
/// Raises the Paint event.
///
/// A PaintEventArgs that contains the event data.
- protected override void OnPaint(PaintEventArgs e)
+ protected override void OnPaint(PaintEventArgs? e)
{
// Cannot process a message for a disposed control
if (!IsDisposed)
{
// Do we have a manager to use for painting?
- if (ViewManager != null)
+ if (ViewManager is not null)
{
// If the layout is dirty, or the size of the control has changed
// without a layout being performed, then perform a layout now
@@ -879,7 +879,7 @@ protected override void OnPaint(PaintEventArgs e)
PaintTransparentBackground(e);
// Ask the view to repaint the visual structure
- ViewManager.Paint(Renderer, e);
+ ViewManager?.Paint(Renderer!, e);
// Request for a refresh has been serviced
_refresh = false;
@@ -1065,7 +1065,7 @@ private void SetPalette(PaletteBase? palette)
if (palette != _palette)
{
// Unhook from current palette events
- if (_palette != null)
+ if (_palette is not null)
{
_palette.PalettePaint -= OnNeedPaint;
_palette.ButtonSpecChanged -= OnButtonSpecChanged;
@@ -1075,10 +1075,10 @@ private void SetPalette(PaletteBase? palette)
_palette = palette;
// Get the renderer associated with the palette
- Renderer = _palette.GetRenderer();
+ Renderer = _palette?.GetRenderer();
// Hook to new palette events
- if (_palette != null)
+ if (_palette is not null)
{
_palette.PalettePaint += OnNeedPaint;
_palette.ButtonSpecChanged += OnButtonSpecChanged;
@@ -1086,31 +1086,31 @@ private void SetPalette(PaletteBase? palette)
}
}
- private void PaintTransparentBackground(PaintEventArgs e)
+ private void PaintTransparentBackground(PaintEventArgs? e)
{
// Get the parent control for transparent drawing purposes
- Control parent = TransparentParent;
+ Control? parent = TransparentParent;
// Do we have a parent control and we need to paint background?
- if ((parent != null) && NeedTransparentPaint)
+ if ((parent is not null) && NeedTransparentPaint)
{
// Only grab the required reference once
- if (_miPTB == null)
+ if (_miPTB.Equals(null) /*== null*/)
{
// Use reflection so we can call the Windows Forms internal method for painting parent background
_miPTB = typeof(Control).GetMethod(nameof(PaintTransparentBackground),
BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.InvokeMethod,
null, CallingConventions.HasThis,
- new[] { typeof(PaintEventArgs), typeof(Rectangle), typeof(Region) },
- null);
+ [typeof(PaintEventArgs), typeof(Rectangle), typeof(Region)],
+ null)!;
}
- _miPTB.Invoke(this, new object[] { e, ClientRectangle, null });
+ _miPTB.Invoke(this, [e!, ClientRectangle, null!]);
}
else
{
// No parent information available, so just use a standard brush
- e.Graphics.FillRectangle(SystemBrushes.Control, ClientRectangle);
+ e?.Graphics.FillRectangle(SystemBrushes.Control, ClientRectangle);
}
}
@@ -1139,7 +1139,7 @@ private void OnPerformRefresh()
}
}
- private void OnGlobalPaletteChanged(object sender, EventArgs e)
+ private void OnGlobalPaletteChanged(object? sender, EventArgs e)
{
// We only care if we are using the global palette
if (PaletteMode == PaletteMode.Global)
@@ -1147,7 +1147,7 @@ private void OnGlobalPaletteChanged(object sender, EventArgs e)
// Update ourself with the new global palette
_localPalette = null;
SetPalette(KryptonManager.CurrentGlobalPalette);
- Redirector.Target = _palette;
+ Redirector!.Target = _palette;
// A new palette source means we need to layout and redraw
OnNeedPaint(Palette, new NeedLayoutEventArgs(true));
@@ -1158,25 +1158,25 @@ private void OnGlobalPaletteChanged(object sender, EventArgs e)
private void OnUserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e) => PerformNeedPaint(true);
- private void OnContextMenuStripOpening(object sender, CancelEventArgs e)
+ private void OnContextMenuStripOpening(object? sender, CancelEventArgs e)
{
// Get the actual strip instance
ContextMenuStrip? cms = base.ContextMenuStrip;
// Make sure it has the correct renderer
- if (cms != null)
+ if (cms is not null)
{
cms.Renderer = CreateToolStripRenderer();
}
}
- private void OnKryptonContextMenuDisposed(object sender, EventArgs e) =>
+ private void OnKryptonContextMenuDisposed(object? sender, EventArgs e) =>
// When the current krypton context menu is disposed, we should remove
// it to prevent it being used again, as that would just throw an exception
// because it has been disposed.
KryptonContextMenu = null;
- private void OnContextMenuClosed(object sender, ToolStripDropDownClosedEventArgs e) => ContextMenuClosed();
+ private void OnContextMenuClosed(object? sender, ToolStripDropDownClosedEventArgs e) => ContextMenuClosed();
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualPopup.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualPopup.cs
index b6c2f017a..18661418a 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualPopup.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualPopup.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -42,7 +42,7 @@ public VisualPopup(bool shadow)
///
/// Drawing renderer.
/// Does the popup need a shadow effect.
- public VisualPopup(IRenderer? renderer,
+ public VisualPopup(IRenderer renderer,
bool shadow)
: this(new ViewManager(), renderer, shadow)
{
@@ -90,7 +90,7 @@ public VisualPopup(ViewManager viewManager,
SetStyle(ControlStyles.Selectable, false);
// Cache incoming references
- Renderer = renderer;
+ Renderer = renderer!;
ViewManager = viewManager;
// Setup the need paint delegate
@@ -285,7 +285,7 @@ public virtual bool AllowMouseMove(Message m, Point pt) =>
///
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Advanced)]
- public ToolStripRenderer CreateToolStripRenderer() => Renderer.RenderToolStrip(GetResolvedPalette());
+ public ToolStripRenderer CreateToolStripRenderer() => Renderer.RenderToolStrip(GetResolvedPalette()!);
///
/// Gets the resolved palette to actually use when drawing.
@@ -300,7 +300,7 @@ public virtual bool AllowMouseMove(Message m, Point pt) =>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Advanced)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public IRenderer? Renderer
+ public IRenderer Renderer
{
[DebuggerStepThrough]
get;
@@ -465,7 +465,7 @@ protected override void OnLayout(LayoutEventArgs lEvent)
/// Raises the Paint event.
///
/// A PaintEventArgs that contains the event data.
- protected override void OnPaint(PaintEventArgs e)
+ protected override void OnPaint(PaintEventArgs? e)
{
// Cannot process a message for a disposed control
if (!IsDisposed)
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualPopupManager.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualPopupManager.cs
index 11e68e3e8..e4d34c3e8 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualPopupManager.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualPopupManager.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -18,7 +18,7 @@ namespace Krypton.Toolkit
public class VisualPopupManager : IMessageFilter
{
#region Type Declarations
- private class PopupStack : Stack {}
+ private class PopupStack : Stack;
#endregion
#region Static Fields
@@ -60,7 +60,7 @@ public static VisualPopupManager Singleton
public bool IsShowingCMS { get; private set; }
#endregion
-
+
#region IsTracking
///
/// Gets a value indicating if currently tracking a popup.
@@ -101,7 +101,7 @@ public VisualPopup? CurrentPopup
if (IsTracking)
{
// Is the current popup matching the type?
- if (CurrentPopup.GetType() == t)
+ if (CurrentPopup?.GetType() == t)
{
return CurrentPopup;
}
@@ -131,8 +131,8 @@ public VisualPopup? CurrentPopup
/// Popup instance to track.
public void StartTracking([DisallowNull] VisualPopup popup)
{
- Debug.Assert(popup != null);
- Debug.Assert(!popup.IsDisposed);
+ Debug.Assert(popup is not null);
+ Debug.Assert(!popup!.IsDisposed);
Debug.Assert(popup.IsHandleCreated);
Debug.Assert(_suspended == 0);
@@ -289,7 +289,7 @@ public void ShowContextMenuStrip(ContextMenuStrip cms,
/// Reference to ContextMenuStrip.
/// Screen position for showing the context menu strip.
/// Delegate to call when strip dismissed.
- public void ShowContextMenuStrip([DisallowNull] ContextMenuStrip cms,
+ public void ShowContextMenuStrip([DisallowNull] ContextMenuStrip cms,
Point screenPt,
EventHandler? cmsFinishDelegate)
{
@@ -463,7 +463,7 @@ public bool PreFilterMessage(ref Message m)
private bool ProcessKeyboard(ref Message m)
{
// If focus is not inside the current popup...
- if (!CurrentPopup.ContainsFocus)
+ if (!CurrentPopup!.ContainsFocus)
{
// ...then redirect the message to the popup so it can process all
// keyboard input. We just send the message on by altering the handle
@@ -481,12 +481,12 @@ private bool ProcessKeyboard(ref Message m)
private bool ProcessClientMouseDown(ref Message m)
{
var processed = false;
-
+
// Convert the client position to screen point
Point screenPt = CommonHelper.ClientMouseMessageToScreenPt(m);
// Is this message for the current popup?
- if (m.HWnd == CurrentPopup.Handle)
+ if (m.HWnd == CurrentPopup!.Handle)
{
// Message is intended for the current popup which means we ask the popup if it
// would like to kill the entire stack because it knows the mouse down should
@@ -574,7 +574,7 @@ private bool ProcessNonClientMouseDown(ref Message m)
var screenPt = new Point(PI.LOWORD((int)m.LParam), PI.HIWORD((int)m.LParam));
// Ask the popup if this message causes the entire stack to be killed
- if (CurrentPopup.DoesCurrentMouseDownEndAllTracking(m, ScreenPtToClientPt(screenPt)))
+ if (CurrentPopup!.DoesCurrentMouseDownEndAllTracking(m, ScreenPtToClientPt(screenPt)))
{
EndAllTracking();
}
@@ -608,7 +608,7 @@ private bool ProcessNonClientMouseDown(ref Message m)
private bool ProcessMouseMove(ref Message m)
{
// Is this message for a different window?
- if (m.HWnd != CurrentPopup.Handle)
+ if (m.HWnd != CurrentPopup!.Handle)
{
// Convert the client position to screen point
Point screenPt = CommonHelper.ClientMouseMessageToScreenPt(m);
@@ -676,7 +676,7 @@ private bool ProcessMouseMoveWithCMS(ref Message m)
// Mouse move is not over a popup, so allow it
}
- private Point ScreenPtToClientPt(Point pt) => ScreenPtToClientPt(pt, CurrentPopup.Handle);
+ private Point ScreenPtToClientPt(Point pt) => ScreenPtToClientPt(pt, CurrentPopup!.Handle);
private Point ScreenPtToClientPt(Point pt, IntPtr handle)
{
@@ -741,11 +741,11 @@ private void FilterMessages(bool filter)
}
}
- private void OnCMSClosed(object sender, ToolStripDropDownClosedEventArgs e)
+ private void OnCMSClosed(object? sender, ToolStripDropDownClosedEventArgs e)
{
// Unhook event from object
var cms = sender as ContextMenuStrip;
- cms.Closed -= OnCMSClosed;
+ cms!.Closed -= OnCMSClosed;
// Revoke the suspended state
_suspended--;
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualPopupShadow.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualPopupShadow.cs
index 0a933add2..ba0e3a009 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualPopupShadow.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualPopupShadow.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -24,9 +24,9 @@ public class VisualPopupShadow : Form
#endregion
#region Instance Fields
- private GraphicsPath _path1;
- private GraphicsPath _path2;
- private GraphicsPath _path3;
+ private GraphicsPath? _path1;
+ private GraphicsPath? _path2;
+ private GraphicsPath? _path3;
#endregion
#region Identity
@@ -177,9 +177,9 @@ private void ClearPaths()
private void DrawPaths(Graphics g)
{
- g.FillPath(_brushes[2], _path1);
- g.FillPath(_brushes[1],_path2);
- g.FillPath(_brushes[0], _path3);
+ g.FillPath(_brushes[2], _path1!);
+ g.FillPath(_brushes[1], _path2!);
+ g.FillPath(_brushes[0], _path3!);
}
private void DrawShadow(Graphics g, Rectangle area)
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualPopupShadow.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualPopupShadow.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualPopupShadow.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualPopupTooltip.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualPopupTooltip.cs
index f960a1308..c55ca5385 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualPopupTooltip.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualPopupTooltip.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -32,7 +32,7 @@ public class VisualPopupToolTip : VisualPopup
/// Source of content values.
/// Drawing renderer.
/// Does the Tooltip need a shadow effect.
- public VisualPopupToolTip(PaletteRedirect? redirector,
+ public VisualPopupToolTip(PaletteRedirect redirector,
IContentValues contentValues,
IRenderer renderer,
bool shadow)
@@ -55,18 +55,18 @@ public VisualPopupToolTip(PaletteRedirect? redirector,
/// Style for the tooltip content.
/// Does the Tooltip need a shadow effect.
public VisualPopupToolTip([DisallowNull] PaletteRedirect redirector,
- [DisallowNull] IContentValues contentValues,
- IRenderer? renderer,
- PaletteBackStyle backStyle,
- PaletteBorderStyle borderStyle,
- PaletteContentStyle contentStyle,
- bool shadow)
+ [DisallowNull] IContentValues contentValues,
+ IRenderer renderer,
+ PaletteBackStyle backStyle,
+ PaletteBorderStyle borderStyle,
+ PaletteContentStyle contentStyle,
+ bool shadow)
: base(renderer, shadow)
{
- Debug.Assert(contentValues != null);
+ Debug.Assert(contentValues is not null);
// Remember references needed later
- _contentValues = contentValues;
+ _contentValues = contentValues ?? throw new NullReferenceException(GlobalStaticValues.VariableCannotBeNull(nameof(contentValues)));
// Create the triple redirector needed by view elements
_palette = new PaletteTripleMetricRedirect(redirector, backStyle, borderStyle, contentStyle, NeedPaintDelegate);
@@ -154,7 +154,7 @@ public void ShowRelativeTo(ViewBase target, Point controlMousePosition)
}
// Get the size the popup would like to be
- Size popupSize = ViewManager.GetPreferredSize(Renderer, new Size(100, 10));
+ Size popupSize = ViewManager!.GetPreferredSize(Renderer, new Size(100, 10));
Point popupLocation;
switch (position.PlacementMode)
@@ -214,7 +214,7 @@ public void ShowRelativeTo(ViewBase target, Point controlMousePosition)
public void ShowCalculatingSize(Point controlMousePosition)
{
// Get the size the popup would like to be
- Size popupSize = ViewManager.GetPreferredSize(Renderer, Size.Empty);
+ Size popupSize = ViewManager!.GetPreferredSize(Renderer, Size.Empty);
// Find the screen position the popup will be relative to
Point currentCursorHotSpot = CommonHelper.CaptureCursor();
@@ -236,6 +236,7 @@ protected override void OnLayout(LayoutEventArgs lEvent)
// Need a render context for accessing the renderer
using var context = new RenderContext(this, null, ClientRectangle, Renderer);
+ using var gh = new GraphicsHint(context.Graphics, _palette.Border.GetBorderGraphicsHint(PaletteState.Normal));
// Grab a path that is the outside edge of the border
Rectangle borderRect = ClientRectangle;
GraphicsPath borderPath1 = Renderer.RenderStandardBorder.GetOutsideBorderPath(context, borderRect, _palette.Border, VisualOrientation.Top, PaletteState.Normal);
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualShadowBase.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualShadowBase.cs
index aad2adf3c..0a7475d04 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualShadowBase.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualShadowBase.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualSimple.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualSimple.cs
index d53687c94..02fe74349 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualSimple.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualSimple.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualSimpleBase.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualSimpleBase.cs
index d21cf7fd6..eb4e33a21 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualSimpleBase.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualSimpleBase.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualTaskDialog.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualTaskDialog.cs
index 5df2c185b..92eb2de1b 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualTaskDialog.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualTaskDialog.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -66,12 +66,6 @@ protected override void WndProc(ref Message m)
}
#endregion
- #region Static Fields
-
- private const int BUTTON_GAP = 10;
-
- #endregion
-
#region Instance Fields
private KryptonTaskDialog? _taskDialog;
private readonly string _windowTitle;
@@ -81,7 +75,7 @@ protected override void WndProc(ref Message m)
private readonly Image? _customMainIcon;
private readonly KryptonTaskDialogCommandCollection _radioButtons;
private readonly KryptonTaskDialogCommandCollection _commandButtons;
- private KryptonTaskDialogCommand _defaultRadioButton;
+ private KryptonTaskDialogCommand? _defaultRadioButton;
private readonly TaskDialogButtons _commonButtons;
private readonly TaskDialogButtons _defaultButton;
private readonly KryptonMessageBoxIcon _footerIcon;
@@ -91,6 +85,7 @@ protected override void WndProc(ref Message m)
private readonly string _checkboxText;
private bool _checkboxState;
private readonly bool _allowDialogClose;
+ private readonly bool _useNativeOSIcons;
// User Interface
private KryptonPanel _panelMain;
@@ -150,6 +145,7 @@ public VisualTaskDialog(KryptonTaskDialog taskDialog)
_checkboxText = taskDialog.CheckboxText;
_checkboxState = taskDialog.CheckboxState;
_allowDialogClose = taskDialog.AllowDialogClose;
+ _useNativeOSIcons = taskDialog.UseNativeOSIcons;
InitializeComponent();
TextExtra = taskDialog.TextExtra;
@@ -269,7 +265,7 @@ private void UpdateIcon()
case KryptonMessageBoxIcon.WindowsLogo:
// Because Windows 11 displays a generic application icon,
// we need to rely on a image instead
- if (OSUtilities.IsWindowsEleven)
+ if (OSUtilities.IsAtLeastWindowsEleven)
{
_messageIcon.Image = TaskDialogImageResources.TaskDialog_Windows_11_Logo;
}
@@ -330,7 +326,7 @@ private void UpdateRadioButtons()
maxButtonSize.Width = Math.Min(Math.Max(maxButtonSize.Width, 150), 400);
// Position the radio buttons in a vertical stack and size owning panel
- var offset = new Point(BUTTON_GAP - 1, 2);
+ var offset = new Point(GlobalStaticValues.GLOBAL_BUTTON_PADDING - 1, 2);
foreach (KryptonRadioButton button in _panelMainRadio.Controls)
{
button.Location = offset;
@@ -362,7 +358,7 @@ private void UpdateCommandButtons()
{
ButtonStyle = ButtonStyle.Command
};
- button.StateCommon.Content.Image.ImageH = PaletteRelativeAlign.Near;
+ button.StateCommon.Content.Image!.ImageH = PaletteRelativeAlign.Near;
button.StateCommon.Content.ShortText.TextH = PaletteRelativeAlign.Near;
button.StateCommon.Content.LongText.TextH = PaletteRelativeAlign.Near;
button.Values.Text = command.Text;
@@ -385,7 +381,7 @@ private void UpdateCommandButtons()
maxButtonSize.Width = Math.Min(Math.Max(maxButtonSize.Width, 150), 400);
// Position the buttons in a vertical stack and size owning panel
- var offset = new Point(BUTTON_GAP - 1, 2);
+ var offset = new Point(GlobalStaticValues.GLOBAL_BUTTON_PADDING - 1, 2);
foreach (KryptonButton button in _panelMainCommands.Controls)
{
button.Location = offset;
@@ -411,7 +407,7 @@ private void UpdateButtons()
}
firstButton = _buttonOK;
- _buttonOK.Text = KryptonLanguageManager.GeneralToolkitStrings.OK;
+ _buttonOK.Text = KryptonManager.Strings.GeneralStrings.OK;
_buttonOK.Visible = true;
}
else
@@ -428,7 +424,7 @@ private void UpdateButtons()
firstButton ??= _buttonYes;
- _buttonYes.Text = KryptonLanguageManager.GeneralToolkitStrings.Yes;
+ _buttonYes.Text = KryptonManager.Strings.GeneralStrings.Yes;
_buttonYes.Visible = true;
}
else
@@ -445,7 +441,7 @@ private void UpdateButtons()
firstButton ??= _buttonNo;
- _buttonNo.Text = KryptonLanguageManager.GeneralToolkitStrings.No;
+ _buttonNo.Text = KryptonManager.Strings.GeneralStrings.No;
_buttonNo.Visible = true;
}
else
@@ -462,7 +458,7 @@ private void UpdateButtons()
firstButton ??= _buttonCancel;
- _buttonCancel.Text = KryptonLanguageManager.GeneralToolkitStrings.Cancel;
+ _buttonCancel.Text = KryptonManager.Strings.GeneralStrings.Cancel;
_buttonCancel.Visible = true;
}
else
@@ -479,7 +475,7 @@ private void UpdateButtons()
firstButton ??= _buttonRetry;
- _buttonRetry.Text = KryptonLanguageManager.GeneralToolkitStrings.Retry;
+ _buttonRetry.Text = KryptonManager.Strings.GeneralStrings.Retry;
_buttonRetry.Visible = true;
}
else
@@ -496,7 +492,7 @@ private void UpdateButtons()
firstButton ??= _buttonClose;
- _buttonClose.Text = KryptonLanguageManager.GeneralToolkitStrings.Close;
+ _buttonClose.Text = KryptonManager.Strings.GeneralStrings.Close;
_buttonClose.Visible = true;
}
else
@@ -532,35 +528,34 @@ private void UpdateFooter()
}
else
{
- // TODO: These icons may need to be 16 x 16
switch (_footerIcon)
{
case KryptonMessageBoxIcon.None:
_iconFooter.Visible = false;
break;
case KryptonMessageBoxIcon.Question:
- _iconFooter.Image = MessageBoxImageResources.GenericQuestion;
+ ChangeFooterIcon(KryptonMessageBoxIcon.Question, _useNativeOSIcons);
break;
case KryptonMessageBoxIcon.Information:
- _iconFooter.Image = MessageBoxImageResources.GenericInformation;
+ ChangeFooterIcon(KryptonMessageBoxIcon.Information, _useNativeOSIcons);
break;
case KryptonMessageBoxIcon.Warning:
- _iconFooter.Image = MessageBoxImageResources.GenericWarning;
+ ChangeFooterIcon(KryptonMessageBoxIcon.Warning, _useNativeOSIcons);
break;
case KryptonMessageBoxIcon.Error:
- _iconFooter.Image = MessageBoxImageResources.GenericCritical;
+ ChangeFooterIcon(KryptonMessageBoxIcon.Error, _useNativeOSIcons);
break;
case KryptonMessageBoxIcon.Hand:
- _iconFooter.Image = MessageBoxImageResources.GenericHand;
+ ChangeFooterIcon(KryptonMessageBoxIcon.Hand, _useNativeOSIcons);
break;
case KryptonMessageBoxIcon.Exclamation:
- _iconFooter.Image = MessageBoxImageResources.GenericWarning;
+ ChangeFooterIcon(KryptonMessageBoxIcon.Exclamation, _useNativeOSIcons);
break;
case KryptonMessageBoxIcon.Asterisk:
- _iconFooter.Image = MessageBoxImageResources.GenericAsterisk;
+ ChangeFooterIcon(KryptonMessageBoxIcon.Asterisk, _useNativeOSIcons);
break;
case KryptonMessageBoxIcon.Stop:
- _iconFooter.Image = MessageBoxImageResources.GenericStop;
+ ChangeFooterIcon(KryptonMessageBoxIcon.Stop, _useNativeOSIcons);
break;
case KryptonMessageBoxIcon.Shield:
_iconFooter.Image = GraphicsExtensions.ScaleImage(SystemIcons.Shield.ToBitmap(), new Size(16, 16));
@@ -568,18 +563,19 @@ private void UpdateFooter()
case KryptonMessageBoxIcon.WindowsLogo:
// Because Windows 11 displays a generic application icon,
// we need to rely on a image instead
- if (OSUtilities.IsWindowsEleven)
+ if (OSUtilities.IsAtLeastWindowsEleven)
{
- _iconFooter.Image = MessageBoxImageResources.Windows11;
+ _iconFooter.Image = TaskDialogImageResources.TaskDialog_Windows_11_Logo;
}
// Windows 10
else if (OSUtilities.IsWindowsTen)
{
- _iconFooter.Image = MessageBoxImageResources.Windows_8_and_10_Logo;
+ _iconFooter.Image = TaskDialogImageResources.TaskDialog_Windows_8_and_10_Logo;
}
else
{
- _iconFooter.Image = SystemIcons.WinLogo.ToBitmap();
+ _iconFooter.Image =
+ GraphicsExtensions.ScaleImage(SystemIcons.WinLogo.ToBitmap(), new Size(16, 16));
}
break;
@@ -590,6 +586,103 @@ private void UpdateFooter()
_linkLabelFooter.Text = _footerHyperlink;
}
+ private void ChangeFooterIcon(KryptonMessageBoxIcon icon, bool useNativeOsIcons)
+ {
+ switch (icon)
+ {
+ case KryptonMessageBoxIcon.Hand:
+ if (useNativeOsIcons)
+ {
+ _iconFooter.Image =
+ GraphicsExtensions.ScaleImage(SystemIcons.Hand.ToBitmap(), new Size(16, 16));
+ }
+ else
+ {
+ _iconFooter.Image = TaskDialogImageResources.TaskDialogHandGeneric;
+ }
+ break;
+ case KryptonMessageBoxIcon.Question:
+ if (useNativeOsIcons)
+ {
+ _iconFooter.Image =
+ GraphicsExtensions.ScaleImage(SystemIcons.Question.ToBitmap(), new Size(16, 16));
+ }
+ else
+ {
+ _iconFooter.Image = TaskDialogImageResources.TaskDialogQuestionGeneric;
+ }
+ break;
+ case KryptonMessageBoxIcon.Exclamation:
+ if (useNativeOsIcons)
+ {
+ _iconFooter.Image =
+ GraphicsExtensions.ScaleImage(SystemIcons.Exclamation.ToBitmap(), new Size(16, 16));
+ }
+ else
+ {
+ _iconFooter.Image = TaskDialogImageResources.TaskDialogWarningGeneric;
+ }
+ break;
+ case KryptonMessageBoxIcon.Asterisk:
+ if (useNativeOsIcons)
+ {
+ _iconFooter.Image =
+ GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), new Size(16, 16));
+ }
+ else
+ {
+ _iconFooter.Image = TaskDialogImageResources.TaskDialogAsteriskGeneric;
+ }
+ break;
+ case KryptonMessageBoxIcon.Stop:
+ if (useNativeOsIcons)
+ {
+ _iconFooter.Image =
+ GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), new Size(16, 16));
+ }
+ else
+ {
+ _iconFooter.Image = TaskDialogImageResources.TaskDialogStopGeneric;
+ }
+ break;
+ case KryptonMessageBoxIcon.Error:
+ if (useNativeOsIcons)
+ {
+ _iconFooter.Image =
+ GraphicsExtensions.ScaleImage(SystemIcons.Error.ToBitmap(), new Size(16, 16));
+ }
+ else
+ {
+ _iconFooter.Image = TaskDialogImageResources.TaskDialogAsteriskGeneric;
+ }
+ break;
+ case KryptonMessageBoxIcon.Warning:
+ if (useNativeOsIcons)
+ {
+ _iconFooter.Image =
+ GraphicsExtensions.ScaleImage(SystemIcons.Warning.ToBitmap(), new Size(16, 16));
+ }
+ else
+ {
+ _iconFooter.Image = TaskDialogImageResources.TaskDialogWarningGeneric;
+ }
+ break;
+ case KryptonMessageBoxIcon.Information:
+ if (useNativeOsIcons)
+ {
+ _iconFooter.Image =
+ GraphicsExtensions.ScaleImage(SystemIcons.Information.ToBitmap(), new Size(16, 16));
+ }
+ else
+ {
+ _iconFooter.Image = TaskDialogImageResources.TaskDialogInformationGeneric;
+ }
+ break;
+ default:
+ throw new ArgumentOutOfRangeException(nameof(icon), icon, null);
+ }
+ }
+
private void UpdateChrome()
{
if (((_commonButtons & TaskDialogButtons.Cancel) == TaskDialogButtons.Cancel) || _allowDialogClose)
@@ -667,7 +760,7 @@ private Size UpdateMainTextSizing()
// Resize panel containing the main text
Padding panelMessagePadding = _panelMainText.Padding;
_panelMainText.Width = Math.Max(_messageText.Size.Width, messageContentSize.Width) + panelMessagePadding.Horizontal;
- _panelMainText.Height = _messageText.Size.Height + messageContentSize.Height + panelMessagePadding.Vertical + BUTTON_GAP;
+ _panelMainText.Height = _messageText.Size.Height + messageContentSize.Height + panelMessagePadding.Vertical + GlobalStaticValues.GLOBAL_BUTTON_PADDING;
// Position the content label below the main label
_messageContent.Location = new Point(_messageText.Left + 2, _messageText.Bottom);
@@ -687,7 +780,7 @@ private Size UpdateRadioSizing()
return Size.Empty;
}
- return _panelMainRadio.Size with { Width = _panelMainRadio.Size.Width + BUTTON_GAP + 2 };
+ return _panelMainRadio.Size with { Width = _panelMainRadio.Size.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING + 2 };
}
private Size UpdateCommandSizing()
@@ -700,7 +793,7 @@ private Size UpdateCommandSizing()
return Size.Empty;
}
- return _panelMainCommands.Size with { Width = _panelMainCommands.Size.Width + BUTTON_GAP + 2 };
+ return _panelMainCommands.Size with { Width = _panelMainCommands.Size.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING + 2 };
}
private Size UpdateSpacerSizing()
@@ -719,7 +812,7 @@ private Size UpdateButtonsSizing()
{
numButtons++;
Size buttonCancelSize = _buttonClose.GetPreferredSize(Size.Empty);
- maxButtonSize.Width = Math.Max(maxButtonSize.Width, buttonCancelSize.Width + BUTTON_GAP);
+ maxButtonSize.Width = Math.Max(maxButtonSize.Width, buttonCancelSize.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING);
maxButtonSize.Height = Math.Max(maxButtonSize.Height, buttonCancelSize.Height);
}
@@ -727,7 +820,7 @@ private Size UpdateButtonsSizing()
{
numButtons++;
Size buttonRetrySize = _buttonRetry.GetPreferredSize(Size.Empty);
- maxButtonSize.Width = Math.Max(maxButtonSize.Width, buttonRetrySize.Width + BUTTON_GAP);
+ maxButtonSize.Width = Math.Max(maxButtonSize.Width, buttonRetrySize.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING);
maxButtonSize.Height = Math.Max(maxButtonSize.Height, buttonRetrySize.Height);
}
@@ -735,7 +828,7 @@ private Size UpdateButtonsSizing()
{
numButtons++;
Size buttonCancelSize = _buttonCancel.GetPreferredSize(Size.Empty);
- maxButtonSize.Width = Math.Max(maxButtonSize.Width, buttonCancelSize.Width + BUTTON_GAP);
+ maxButtonSize.Width = Math.Max(maxButtonSize.Width, buttonCancelSize.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING);
maxButtonSize.Height = Math.Max(maxButtonSize.Height, buttonCancelSize.Height);
}
@@ -743,7 +836,7 @@ private Size UpdateButtonsSizing()
{
numButtons++;
Size buttonNoSize = _buttonNo.GetPreferredSize(Size.Empty);
- maxButtonSize.Width = Math.Max(maxButtonSize.Width, buttonNoSize.Width + BUTTON_GAP);
+ maxButtonSize.Width = Math.Max(maxButtonSize.Width, buttonNoSize.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING);
maxButtonSize.Height = Math.Max(maxButtonSize.Height, buttonNoSize.Height);
}
@@ -751,7 +844,7 @@ private Size UpdateButtonsSizing()
{
numButtons++;
Size buttonYesSize = _buttonYes.GetPreferredSize(Size.Empty);
- maxButtonSize.Width = Math.Max(maxButtonSize.Width, buttonYesSize.Width + BUTTON_GAP);
+ maxButtonSize.Width = Math.Max(maxButtonSize.Width, buttonYesSize.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING);
maxButtonSize.Height = Math.Max(maxButtonSize.Height, buttonYesSize.Height);
}
@@ -759,54 +852,54 @@ private Size UpdateButtonsSizing()
{
numButtons++;
Size buttonOKSize = _buttonOK.GetPreferredSize(Size.Empty);
- maxButtonSize.Width = Math.Max(maxButtonSize.Width, buttonOKSize.Width + BUTTON_GAP);
+ maxButtonSize.Width = Math.Max(maxButtonSize.Width, buttonOKSize.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING);
maxButtonSize.Height = Math.Max(maxButtonSize.Height, buttonOKSize.Height);
}
// Start positioning buttons from right edge
- var right = _panelButtons.Right - BUTTON_GAP;
+ var right = _panelButtons.Right - GlobalStaticValues.GLOBAL_BUTTON_PADDING;
if ((_commonButtons & TaskDialogButtons.Close) == TaskDialogButtons.Close)
{
- _buttonClose.Location = new Point(right - maxButtonSize.Width, BUTTON_GAP);
+ _buttonClose.Location = new Point(right - maxButtonSize.Width, GlobalStaticValues.GLOBAL_BUTTON_PADDING);
_buttonClose.Size = maxButtonSize;
- right -= maxButtonSize.Width + BUTTON_GAP;
+ right -= maxButtonSize.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING;
}
if ((_commonButtons & TaskDialogButtons.Retry) == TaskDialogButtons.Retry)
{
- _buttonRetry.Location = new Point(right - maxButtonSize.Width, BUTTON_GAP);
+ _buttonRetry.Location = new Point(right - maxButtonSize.Width, GlobalStaticValues.GLOBAL_BUTTON_PADDING);
_buttonRetry.Size = maxButtonSize;
- right -= maxButtonSize.Width + BUTTON_GAP;
+ right -= maxButtonSize.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING;
}
if ((_commonButtons & TaskDialogButtons.Cancel) == TaskDialogButtons.Cancel)
{
- _buttonCancel.Location = new Point(right - maxButtonSize.Width, BUTTON_GAP);
+ _buttonCancel.Location = new Point(right - maxButtonSize.Width, GlobalStaticValues.GLOBAL_BUTTON_PADDING);
_buttonCancel.Size = maxButtonSize;
- right -= maxButtonSize.Width + BUTTON_GAP;
+ right -= maxButtonSize.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING;
}
if ((_commonButtons & TaskDialogButtons.No) == TaskDialogButtons.No)
{
- _buttonNo.Location = new Point(right - maxButtonSize.Width, BUTTON_GAP);
+ _buttonNo.Location = new Point(right - maxButtonSize.Width, GlobalStaticValues.GLOBAL_BUTTON_PADDING);
_buttonNo.Size = maxButtonSize;
- right -= maxButtonSize.Width + BUTTON_GAP;
+ right -= maxButtonSize.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING;
}
if ((_commonButtons & TaskDialogButtons.Yes) == TaskDialogButtons.Yes)
{
- _buttonYes.Location = new Point(right - maxButtonSize.Width, BUTTON_GAP);
+ _buttonYes.Location = new Point(right - maxButtonSize.Width, GlobalStaticValues.GLOBAL_BUTTON_PADDING);
_buttonYes.Size = maxButtonSize;
- right -= maxButtonSize.Width + BUTTON_GAP;
+ right -= maxButtonSize.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING;
}
if ((_commonButtons & TaskDialogButtons.OK) == TaskDialogButtons.OK)
{
- _buttonOK.Location = new Point(right - maxButtonSize.Width, BUTTON_GAP);
+ _buttonOK.Location = new Point(right - maxButtonSize.Width, GlobalStaticValues.GLOBAL_BUTTON_PADDING);
_buttonOK.Size = maxButtonSize;
- right -= maxButtonSize.Width + BUTTON_GAP;
+ right -= maxButtonSize.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING;
}
var checkboxSize = Size.Empty;
@@ -825,22 +918,22 @@ private Size UpdateButtonsSizing()
else
{
_panelButtons.Visible = true;
- _checkBox.Location = new Point(BUTTON_GAP, BUTTON_GAP);
- return new Size(checkboxSize.Width + (BUTTON_GAP * 2), checkboxSize.Height + (BUTTON_GAP * 2));
+ _checkBox.Location = new Point(GlobalStaticValues.GLOBAL_BUTTON_PADDING, GlobalStaticValues.GLOBAL_BUTTON_PADDING);
+ return new Size(checkboxSize.Width + (GlobalStaticValues.GLOBAL_BUTTON_PADDING * 2), checkboxSize.Height + (GlobalStaticValues.GLOBAL_BUTTON_PADDING * 2));
}
}
else
{
_panelButtons.Visible = true;
- var panelButtonSize = new Size((maxButtonSize.Width * numButtons) + (BUTTON_GAP * (numButtons + 1)),
- maxButtonSize.Height + (BUTTON_GAP * 2));
+ var panelButtonSize = new Size((maxButtonSize.Width * numButtons) + (GlobalStaticValues.GLOBAL_BUTTON_PADDING * (numButtons + 1)),
+ maxButtonSize.Height + (GlobalStaticValues.GLOBAL_BUTTON_PADDING * 2));
if (!checkboxSize.IsEmpty)
{
panelButtonSize.Width += checkboxSize.Width;
- panelButtonSize.Height = Math.Max(panelButtonSize.Height, checkboxSize.Height + (BUTTON_GAP * 2));
- _checkBox.Location = new Point(BUTTON_GAP, (panelButtonSize.Height - checkboxSize.Height) / 2);
+ panelButtonSize.Height = Math.Max(panelButtonSize.Height, checkboxSize.Height + (GlobalStaticValues.GLOBAL_BUTTON_PADDING * 2));
+ _checkBox.Location = new Point(GlobalStaticValues.GLOBAL_BUTTON_PADDING, (panelButtonSize.Height - checkboxSize.Height) / 2);
}
return panelButtonSize;
@@ -880,14 +973,14 @@ private Size UpdateFooterSizing()
if ((_footerIcon != KryptonMessageBoxIcon.None) || (_customFooterIcon != null))
{
- requiredSize.Width += _iconFooter.Width + BUTTON_GAP;
+ requiredSize.Width += _iconFooter.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING;
requiredSize.Height = Math.Max(requiredSize.Height, _iconFooter.Size.Height);
}
if (requiredSize.Width > 0)
{
- requiredSize.Width += BUTTON_GAP * 2;
- requiredSize.Height += BUTTON_GAP * 2;
+ requiredSize.Width += GlobalStaticValues.GLOBAL_BUTTON_PADDING * 2;
+ requiredSize.Height += GlobalStaticValues.GLOBAL_BUTTON_PADDING * 2;
}
// Do we have anything to show?
@@ -897,12 +990,12 @@ private Size UpdateFooterSizing()
if (requiredSize.Width > 0)
{
_panelFooter.Size = requiredSize;
- var offset = BUTTON_GAP;
+ var offset = GlobalStaticValues.GLOBAL_BUTTON_PADDING;
if ((_footerIcon != KryptonMessageBoxIcon.None) || (_customFooterIcon != null))
{
_iconFooter.Location = new Point(offset, (requiredSize.Height - _iconFooter.Height) / 2);
- offset += _iconFooter.Width + (BUTTON_GAP / 2);
+ offset += _iconFooter.Width + (GlobalStaticValues.GLOBAL_BUTTON_PADDING / 2);
}
if (!string.IsNullOrEmpty(_footerText))
@@ -924,7 +1017,7 @@ private Size UpdateFooterSizing()
return requiredSize;
}
- private void OnRadioButtonCheckedChanged(object sender, EventArgs e)
+ private void OnRadioButtonCheckedChanged(object? sender, EventArgs e)
{
var button = sender as KryptonRadioButton;
_defaultRadioButton = button?.Tag as KryptonTaskDialogCommand;
@@ -934,17 +1027,17 @@ private void OnRadioButtonCheckedChanged(object sender, EventArgs e)
}
}
- private void OnCommandClicked(object sender, EventArgs e)
+ private void OnCommandClicked(object? sender, EventArgs e)
{
Close();
// Update the result code from the command button
- var button = (KryptonButton)sender;
- DialogResult = button.DialogResult;
+ var button = sender as KryptonButton;
+ DialogResult = button!.DialogResult;
// Invoke any event handlers from the command button
- var command = (KryptonTaskDialogCommand)button.Tag;
- command.PerformExecute();
+ var command = button.Tag as KryptonTaskDialogCommand;
+ command?.PerformExecute();
}
private void OnTaskDialogFormClosing(object sender, FormClosingEventArgs e)
@@ -1036,368 +1129,364 @@ private void button_keyDown(object sender, KeyEventArgs e)
private void InitializeComponent()
{
- _panelMain = new KryptonPanel();
- _panelMainSpacer = new KryptonPanel();
- _panelMainCommands = new KryptonPanel();
- _panelMainRadio = new KryptonPanel();
- _panelMainText = new KryptonPanel();
- _messageContent = new KryptonWrapLabel();
- _messageContentMultiline = new KryptonTextBox();
- _messageText = new KryptonWrapLabel();
- _panelIcon = new KryptonPanel();
- _messageIcon = new PictureBox();
- _panelButtons = new KryptonPanel();
- _checkBox = new KryptonCheckBox();
- _panelButtonsBorderTop = new KryptonBorderEdge();
- _buttonOK = new MessageButton();
- _buttonYes = new MessageButton();
- _buttonNo = new MessageButton();
- _buttonRetry = new MessageButton();
- _buttonCancel = new MessageButton();
- _buttonClose = new MessageButton();
- _panelFooter = new KryptonPanel();
- _linkLabelFooter = new KryptonLinkLabel();
- _iconFooter = new PictureBox();
- _footerLabel = new KryptonWrapLabel();
- _panelFooterBorderTop = new KryptonBorderEdge();
- ((ISupportInitialize)(_panelMain)).BeginInit();
- _panelMain.SuspendLayout();
- ((ISupportInitialize)(_panelMainSpacer)).BeginInit();
- ((ISupportInitialize)(_panelMainCommands)).BeginInit();
- ((ISupportInitialize)(_panelMainRadio)).BeginInit();
- ((ISupportInitialize)(_panelMainText)).BeginInit();
- _panelMainText.SuspendLayout();
- ((ISupportInitialize)(_panelIcon)).BeginInit();
- _panelIcon.SuspendLayout();
- ((ISupportInitialize)(_messageIcon)).BeginInit();
- ((ISupportInitialize)(_panelButtons)).BeginInit();
- _panelButtons.SuspendLayout();
- ((ISupportInitialize)(_panelFooter)).BeginInit();
- _panelFooter.SuspendLayout();
- ((ISupportInitialize)(_iconFooter)).BeginInit();
- SuspendLayout();
+ this._panelMain = new Krypton.Toolkit.KryptonPanel();
+ this._panelMainSpacer = new Krypton.Toolkit.KryptonPanel();
+ this._panelMainCommands = new Krypton.Toolkit.KryptonPanel();
+ this._panelMainRadio = new Krypton.Toolkit.KryptonPanel();
+ this._panelMainText = new Krypton.Toolkit.KryptonPanel();
+ this._messageContent = new Krypton.Toolkit.KryptonWrapLabel();
+ this._messageContentMultiline = new Krypton.Toolkit.KryptonTextBox();
+ this._messageText = new Krypton.Toolkit.KryptonWrapLabel();
+ this._panelIcon = new Krypton.Toolkit.KryptonPanel();
+ this._messageIcon = new System.Windows.Forms.PictureBox();
+ this._panelButtons = new Krypton.Toolkit.KryptonPanel();
+ this._checkBox = new Krypton.Toolkit.KryptonCheckBox();
+ this._panelButtonsBorderTop = new Krypton.Toolkit.KryptonBorderEdge();
+ this._buttonOK = new Krypton.Toolkit.VisualTaskDialog.MessageButton();
+ this._buttonYes = new Krypton.Toolkit.VisualTaskDialog.MessageButton();
+ this._buttonNo = new Krypton.Toolkit.VisualTaskDialog.MessageButton();
+ this._buttonRetry = new Krypton.Toolkit.VisualTaskDialog.MessageButton();
+ this._buttonCancel = new Krypton.Toolkit.VisualTaskDialog.MessageButton();
+ this._buttonClose = new Krypton.Toolkit.VisualTaskDialog.MessageButton();
+ this._panelFooter = new Krypton.Toolkit.KryptonPanel();
+ this._linkLabelFooter = new Krypton.Toolkit.KryptonLinkLabel();
+ this._iconFooter = new System.Windows.Forms.PictureBox();
+ this._footerLabel = new Krypton.Toolkit.KryptonWrapLabel();
+ this._panelFooterBorderTop = new Krypton.Toolkit.KryptonBorderEdge();
+ ((System.ComponentModel.ISupportInitialize)(this._panelMain)).BeginInit();
+ this._panelMain.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this._panelMainSpacer)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this._panelMainCommands)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this._panelMainRadio)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this._panelMainText)).BeginInit();
+ this._panelMainText.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this._panelIcon)).BeginInit();
+ this._panelIcon.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this._messageIcon)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this._panelButtons)).BeginInit();
+ this._panelButtons.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this._panelFooter)).BeginInit();
+ this._panelFooter.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this._iconFooter)).BeginInit();
+ this.SuspendLayout();
//
// _panelMain
//
- _panelMain.AutoSize = true;
- _panelMain.AutoSizeMode = AutoSizeMode.GrowAndShrink;
- _panelMain.Controls.Add(_panelMainSpacer);
- _panelMain.Controls.Add(_panelMainCommands);
- _panelMain.Controls.Add(_panelMainRadio);
- _panelMain.Controls.Add(_panelMainText);
- _panelMain.Controls.Add(_panelIcon);
- _panelMain.Dock = DockStyle.Top;
- _panelMain.Location = new Point(0, 0);
- _panelMain.Name = "_panelMain";
- _panelMain.Size = new Size(578, 72);
- _panelMain.TabIndex = 0;
+ this._panelMain.AutoSize = true;
+ this._panelMain.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this._panelMain.Controls.Add(this._panelMainSpacer);
+ this._panelMain.Controls.Add(this._panelMainCommands);
+ this._panelMain.Controls.Add(this._panelMainRadio);
+ this._panelMain.Controls.Add(this._panelMainText);
+ this._panelMain.Controls.Add(this._panelIcon);
+ this._panelMain.Dock = System.Windows.Forms.DockStyle.Top;
+ this._panelMain.Location = new System.Drawing.Point(0, 0);
+ this._panelMain.Name = "_panelMain";
+ this._panelMain.Size = new System.Drawing.Size(790, 72);
+ this._panelMain.TabIndex = 0;
//
// _panelMainSpacer
//
- _panelMainSpacer.Location = new Point(42, 59);
- _panelMainSpacer.Name = "_panelMainSpacer";
- _panelMainSpacer.Size = new Size(10, 10);
- _panelMainSpacer.TabIndex = 3;
+ this._panelMainSpacer.Location = new System.Drawing.Point(42, 59);
+ this._panelMainSpacer.Name = "_panelMainSpacer";
+ this._panelMainSpacer.Size = new System.Drawing.Size(10, 10);
+ this._panelMainSpacer.TabIndex = 3;
//
// _panelMainCommands
//
- _panelMainCommands.AutoSize = true;
- _panelMainCommands.AutoSizeMode = AutoSizeMode.GrowAndShrink;
- _panelMainCommands.Location = new Point(208, 10);
- _panelMainCommands.Name = "_panelMainCommands";
- _panelMainCommands.Size = new Size(0, 0);
- _panelMainCommands.TabIndex = 2;
+ this._panelMainCommands.AutoSize = true;
+ this._panelMainCommands.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this._panelMainCommands.Location = new System.Drawing.Point(208, 10);
+ this._panelMainCommands.Name = "_panelMainCommands";
+ this._panelMainCommands.Size = new System.Drawing.Size(0, 0);
+ this._panelMainCommands.TabIndex = 2;
//
// _panelMainRadio
//
- _panelMainRadio.AutoSize = true;
- _panelMainRadio.AutoSizeMode = AutoSizeMode.GrowAndShrink;
- _panelMainRadio.Location = new Point(208, 32);
- _panelMainRadio.Name = "_panelMainRadio";
- _panelMainRadio.Size = new Size(0, 0);
- _panelMainRadio.TabIndex = 1;
+ this._panelMainRadio.AutoSize = true;
+ this._panelMainRadio.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this._panelMainRadio.Location = new System.Drawing.Point(208, 32);
+ this._panelMainRadio.Name = "_panelMainRadio";
+ this._panelMainRadio.Size = new System.Drawing.Size(0, 0);
+ this._panelMainRadio.TabIndex = 1;
//
// _panelMainText
//
- _panelMainText.AutoSize = true;
- _panelMainText.Controls.Add(_messageContent);
- _panelMainText.Controls.Add(_messageContentMultiline);
- _panelMainText.Controls.Add(_messageText);
- _panelMainText.Location = new Point(42, 0);
- _panelMainText.Margin = new Padding(0);
- _panelMainText.Name = "_panelMainText";
- _panelMainText.Padding = new Padding(5, 5, 5, 0);
- _panelMainText.Size = new Size(407, 60);
- _panelMainText.TabIndex = 0;
+ this._panelMainText.AutoSize = true;
+ this._panelMainText.Controls.Add(this._messageContent);
+ this._panelMainText.Controls.Add(this._messageContentMultiline);
+ this._panelMainText.Controls.Add(this._messageText);
+ this._panelMainText.Location = new System.Drawing.Point(42, 0);
+ this._panelMainText.Margin = new System.Windows.Forms.Padding(0);
+ this._panelMainText.Name = "_panelMainText";
+ this._panelMainText.Padding = new System.Windows.Forms.Padding(5, 5, 5, 0);
+ this._panelMainText.Size = new System.Drawing.Size(407, 60);
+ this._panelMainText.TabIndex = 0;
//
// _messageContent
//
- _messageContent.AutoSize = false;
- _messageContent.Font = new Font("Segoe UI", 9F);
- _messageContent.ForeColor = Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
- _messageContent.Location = new Point(6, 34);
- _messageContent.Margin = new Padding(0);
- _messageContent.Name = "_messageContent";
- _messageContent.Size = new Size(78, 15);
- _messageContent.Text = "Content";
+ this._messageContent.AutoSize = false;
+ this._messageContent.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this._messageContent.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this._messageContent.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this._messageContent.Location = new System.Drawing.Point(6, 34);
+ this._messageContent.Margin = new System.Windows.Forms.Padding(0);
+ this._messageContent.Name = "_messageContent";
+ this._messageContent.Size = new System.Drawing.Size(78, 15);
+ this._messageContent.Text = "Content";
//
// _messageContentMultiline
//
- _messageContentMultiline.Location = new Point(48, 45);
- _messageContentMultiline.Multiline = true;
- _messageContentMultiline.Name = "_messageContentMultiline";
- _messageContentMultiline.ReadOnly = true;
- _messageContentMultiline.ScrollBars = ScrollBars.Both;
- _messageContentMultiline.Size = new Size(351, 10);
- _messageContentMultiline.TabIndex = 4;
+ this._messageContentMultiline.Location = new System.Drawing.Point(48, 45);
+ this._messageContentMultiline.Multiline = true;
+ this._messageContentMultiline.Name = "_messageContentMultiline";
+ this._messageContentMultiline.ReadOnly = true;
+ this._messageContentMultiline.ScrollBars = System.Windows.Forms.ScrollBars.Both;
+ this._messageContentMultiline.Size = new System.Drawing.Size(351, 10);
+ this._messageContentMultiline.TabIndex = 4;
//
// _messageText
//
- _messageText.AutoSize = false;
- _messageText.Font = new Font("Segoe UI", 13.5F, FontStyle.Bold);
- _messageText.ForeColor = Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
- _messageText.LabelStyle = LabelStyle.TitlePanel;
- _messageText.Location = new Point(5, 5);
- _messageText.Margin = new Padding(0);
- _messageText.Name = "_messageText";
- _messageText.Size = new Size(139, 27);
- _messageText.Text = "Message Text";
+ this._messageText.AutoSize = false;
+ this._messageText.Font = new System.Drawing.Font("Segoe UI", 13.5F, System.Drawing.FontStyle.Bold);
+ this._messageText.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this._messageText.LabelStyle = Krypton.Toolkit.LabelStyle.TitlePanel;
+ this._messageText.Location = new System.Drawing.Point(5, 5);
+ this._messageText.Margin = new System.Windows.Forms.Padding(0);
+ this._messageText.Name = "_messageText";
+ this._messageText.Size = new System.Drawing.Size(139, 27);
+ this._messageText.Text = "Message Text";
//
// _panelIcon
//
- _panelIcon.AutoSize = true;
- _panelIcon.AutoSizeMode = AutoSizeMode.GrowAndShrink;
- _panelIcon.Controls.Add(_messageIcon);
- _panelIcon.Location = new Point(0, 0);
- _panelIcon.Margin = new Padding(0);
- _panelIcon.Name = "_panelIcon";
- _panelIcon.Padding = new Padding(10, 10, 0, 10);
- _panelIcon.Size = new Size(42, 52);
- _panelIcon.TabIndex = 0;
+ this._panelIcon.AutoSize = true;
+ this._panelIcon.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this._panelIcon.Controls.Add(this._messageIcon);
+ this._panelIcon.Location = new System.Drawing.Point(0, 0);
+ this._panelIcon.Margin = new System.Windows.Forms.Padding(0);
+ this._panelIcon.Name = "_panelIcon";
+ this._panelIcon.Padding = new System.Windows.Forms.Padding(10, 10, 0, 10);
+ this._panelIcon.Size = new System.Drawing.Size(42, 52);
+ this._panelIcon.TabIndex = 0;
//
// _messageIcon
//
- _messageIcon.BackColor = Color.Transparent;
- _messageIcon.Location = new Point(10, 10);
- _messageIcon.Margin = new Padding(0);
- _messageIcon.Name = "_messageIcon";
- _messageIcon.Size = new Size(32, 32);
- _messageIcon.TabIndex = 0;
- _messageIcon.TabStop = false;
+ this._messageIcon.BackColor = System.Drawing.Color.Transparent;
+ this._messageIcon.Location = new System.Drawing.Point(10, 10);
+ this._messageIcon.Margin = new System.Windows.Forms.Padding(0);
+ this._messageIcon.Name = "_messageIcon";
+ this._messageIcon.Size = new System.Drawing.Size(32, 32);
+ this._messageIcon.TabIndex = 0;
+ this._messageIcon.TabStop = false;
//
// _panelButtons
//
- _panelButtons.Controls.Add(_checkBox);
- _panelButtons.Controls.Add(_panelButtonsBorderTop);
- _panelButtons.Controls.Add(_buttonOK);
- _panelButtons.Controls.Add(_buttonYes);
- _panelButtons.Controls.Add(_buttonNo);
- _panelButtons.Controls.Add(_buttonRetry);
- _panelButtons.Controls.Add(_buttonCancel);
- _panelButtons.Controls.Add(_buttonClose);
- _panelButtons.Dock = DockStyle.Top;
- _panelButtons.Location = new Point(0, 72);
- _panelButtons.Margin = new Padding(0);
- _panelButtons.Name = "_panelButtons";
- _panelButtons.PanelBackStyle = PaletteBackStyle.PanelAlternate;
- _panelButtons.Size = new Size(578, 46);
- _panelButtons.TabIndex = 1;
+ this._panelButtons.Controls.Add(this._checkBox);
+ this._panelButtons.Controls.Add(this._panelButtonsBorderTop);
+ this._panelButtons.Controls.Add(this._buttonOK);
+ this._panelButtons.Controls.Add(this._buttonYes);
+ this._panelButtons.Controls.Add(this._buttonNo);
+ this._panelButtons.Controls.Add(this._buttonRetry);
+ this._panelButtons.Controls.Add(this._buttonCancel);
+ this._panelButtons.Controls.Add(this._buttonClose);
+ this._panelButtons.Dock = System.Windows.Forms.DockStyle.Top;
+ this._panelButtons.Location = new System.Drawing.Point(0, 72);
+ this._panelButtons.Margin = new System.Windows.Forms.Padding(0);
+ this._panelButtons.Name = "_panelButtons";
+ this._panelButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this._panelButtons.Size = new System.Drawing.Size(790, 46);
+ this._panelButtons.TabIndex = 1;
//
// _checkBox
//
- _checkBox.Location = new Point(12, 12);
- _checkBox.Name = "_checkBox";
- _checkBox.Size = new Size(75, 20);
- _checkBox.TabIndex = 0;
- _checkBox.Values.Text = "checkBox";
+ this._checkBox.Location = new System.Drawing.Point(12, 12);
+ this._checkBox.Name = "_checkBox";
+ this._checkBox.Size = new System.Drawing.Size(75, 20);
+ this._checkBox.TabIndex = 0;
+ this._checkBox.Values.Text = "checkBox";
//
// _panelButtonsBorderTop
//
- _panelButtonsBorderTop.BorderStyle = PaletteBorderStyle.HeaderPrimary;
- _panelButtonsBorderTop.Dock = DockStyle.Top;
- _panelButtonsBorderTop.Location = new Point(0, 0);
- _panelButtonsBorderTop.Name = "_panelButtonsBorderTop";
- _panelButtonsBorderTop.Size = new Size(578, 1);
- _panelButtonsBorderTop.Text = "kryptonBorderEdge1";
+ this._panelButtonsBorderTop.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this._panelButtonsBorderTop.Dock = System.Windows.Forms.DockStyle.Top;
+ this._panelButtonsBorderTop.Location = new System.Drawing.Point(0, 0);
+ this._panelButtonsBorderTop.Name = "_panelButtonsBorderTop";
+ this._panelButtonsBorderTop.Size = new System.Drawing.Size(790, 1);
+ this._panelButtonsBorderTop.Text = "kryptonBorderEdge1";
//
// _buttonOK
//
- _buttonOK.Anchor = ((AnchorStyles)((AnchorStyles.Top | AnchorStyles.Right)));
- _buttonOK.AutoSize = true;
- _buttonOK.CornerRoundingRadius = -1F;
- _buttonOK.DialogResult = DialogResult.OK;
- _buttonOK.IgnoreAltF4 = false;
- _buttonOK.Location = new Point(469, 9);
- _buttonOK.Margin = new Padding(0);
- _buttonOK.MinimumSize = new Size(50, 26);
- _buttonOK.Name = "_buttonOK";
- _buttonOK.Size = new Size(50, 26);
- _buttonOK.TabIndex = 1;
- _buttonOK.Values.Text = "OK";
+ this._buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this._buttonOK.AutoSize = true;
+ this._buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this._buttonOK.IgnoreAltF4 = false;
+ this._buttonOK.Location = new System.Drawing.Point(681, 9);
+ this._buttonOK.Margin = new System.Windows.Forms.Padding(0);
+ this._buttonOK.MinimumSize = new System.Drawing.Size(50, 26);
+ this._buttonOK.Name = "_buttonOK";
+ this._buttonOK.Size = new System.Drawing.Size(50, 26);
+ this._buttonOK.TabIndex = 1;
+ this._buttonOK.Values.Text = "OK";
//
// _buttonYes
//
- _buttonYes.Anchor = ((AnchorStyles)((AnchorStyles.Top | AnchorStyles.Right)));
- _buttonYes.AutoSize = true;
- _buttonYes.CornerRoundingRadius = -1F;
- _buttonYes.DialogResult = DialogResult.Yes;
- _buttonYes.IgnoreAltF4 = false;
- _buttonYes.Location = new Point(369, 9);
- _buttonYes.Margin = new Padding(0);
- _buttonYes.MinimumSize = new Size(50, 26);
- _buttonYes.Name = "_buttonYes";
- _buttonYes.Size = new Size(50, 26);
- _buttonYes.TabIndex = 2;
- _buttonYes.Values.Text = "Yes";
+ this._buttonYes.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this._buttonYes.AutoSize = true;
+ this._buttonYes.DialogResult = System.Windows.Forms.DialogResult.Yes;
+ this._buttonYes.IgnoreAltF4 = false;
+ this._buttonYes.Location = new System.Drawing.Point(581, 9);
+ this._buttonYes.Margin = new System.Windows.Forms.Padding(0);
+ this._buttonYes.MinimumSize = new System.Drawing.Size(50, 26);
+ this._buttonYes.Name = "_buttonYes";
+ this._buttonYes.Size = new System.Drawing.Size(50, 26);
+ this._buttonYes.TabIndex = 2;
+ this._buttonYes.Values.Text = "Yes";
//
// _buttonNo
//
- _buttonNo.Anchor = ((AnchorStyles)((AnchorStyles.Top | AnchorStyles.Right)));
- _buttonNo.AutoSize = true;
- _buttonNo.CornerRoundingRadius = -1F;
- _buttonNo.DialogResult = DialogResult.No;
- _buttonNo.IgnoreAltF4 = false;
- _buttonNo.Location = new Point(319, 9);
- _buttonNo.Margin = new Padding(0);
- _buttonNo.MinimumSize = new Size(50, 26);
- _buttonNo.Name = "_buttonNo";
- _buttonNo.Size = new Size(50, 26);
- _buttonNo.TabIndex = 3;
- _buttonNo.Values.Text = "No";
+ this._buttonNo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this._buttonNo.AutoSize = true;
+ this._buttonNo.DialogResult = System.Windows.Forms.DialogResult.No;
+ this._buttonNo.IgnoreAltF4 = false;
+ this._buttonNo.Location = new System.Drawing.Point(531, 9);
+ this._buttonNo.Margin = new System.Windows.Forms.Padding(0);
+ this._buttonNo.MinimumSize = new System.Drawing.Size(50, 26);
+ this._buttonNo.Name = "_buttonNo";
+ this._buttonNo.Size = new System.Drawing.Size(50, 26);
+ this._buttonNo.TabIndex = 3;
+ this._buttonNo.Values.Text = "No";
//
// _buttonRetry
//
- _buttonRetry.Anchor = ((AnchorStyles)((AnchorStyles.Top | AnchorStyles.Right)));
- _buttonRetry.AutoSize = true;
- _buttonRetry.CornerRoundingRadius = -1F;
- _buttonRetry.DialogResult = DialogResult.Retry;
- _buttonRetry.IgnoreAltF4 = false;
- _buttonRetry.Location = new Point(419, 9);
- _buttonRetry.Margin = new Padding(0);
- _buttonRetry.MinimumSize = new Size(50, 26);
- _buttonRetry.Name = "_buttonRetry";
- _buttonRetry.Size = new Size(50, 26);
- _buttonRetry.TabIndex = 5;
- _buttonRetry.Values.Text = "Retry";
+ this._buttonRetry.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this._buttonRetry.AutoSize = true;
+ this._buttonRetry.DialogResult = System.Windows.Forms.DialogResult.Retry;
+ this._buttonRetry.IgnoreAltF4 = false;
+ this._buttonRetry.Location = new System.Drawing.Point(631, 9);
+ this._buttonRetry.Margin = new System.Windows.Forms.Padding(0);
+ this._buttonRetry.MinimumSize = new System.Drawing.Size(50, 26);
+ this._buttonRetry.Name = "_buttonRetry";
+ this._buttonRetry.Size = new System.Drawing.Size(50, 26);
+ this._buttonRetry.TabIndex = 5;
+ this._buttonRetry.Values.Text = "Retry";
//
// _buttonCancel
//
- _buttonCancel.Anchor = ((AnchorStyles)((AnchorStyles.Top | AnchorStyles.Right)));
- _buttonCancel.AutoSize = true;
- _buttonCancel.CornerRoundingRadius = -1F;
- _buttonCancel.DialogResult = DialogResult.Cancel;
- _buttonCancel.IgnoreAltF4 = false;
- _buttonCancel.Location = new Point(262, 9);
- _buttonCancel.Margin = new Padding(0);
- _buttonCancel.MinimumSize = new Size(50, 26);
- _buttonCancel.Name = "_buttonCancel";
- _buttonCancel.Size = new Size(57, 26);
- _buttonCancel.TabIndex = 4;
- _buttonCancel.Values.Text = "Cancel";
+ this._buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this._buttonCancel.AutoSize = true;
+ this._buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this._buttonCancel.IgnoreAltF4 = false;
+ this._buttonCancel.Location = new System.Drawing.Point(474, 9);
+ this._buttonCancel.Margin = new System.Windows.Forms.Padding(0);
+ this._buttonCancel.MinimumSize = new System.Drawing.Size(50, 26);
+ this._buttonCancel.Name = "_buttonCancel";
+ this._buttonCancel.Size = new System.Drawing.Size(57, 26);
+ this._buttonCancel.TabIndex = 4;
+ this._buttonCancel.Values.Text = "Cancel";
//
// _buttonClose
//
- _buttonClose.Anchor = ((AnchorStyles)((AnchorStyles.Top | AnchorStyles.Right)));
- _buttonClose.AutoSize = true;
- _buttonClose.CornerRoundingRadius = -1F;
- _buttonClose.IgnoreAltF4 = false;
- _buttonClose.Location = new Point(519, 9);
- _buttonClose.Margin = new Padding(0);
- _buttonClose.MinimumSize = new Size(50, 26);
- _buttonClose.Name = "_buttonClose";
- _buttonClose.Size = new Size(50, 26);
- _buttonClose.TabIndex = 6;
- _buttonClose.Values.Text = "Close";
+ this._buttonClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this._buttonClose.AutoSize = true;
+ this._buttonClose.IgnoreAltF4 = false;
+ this._buttonClose.Location = new System.Drawing.Point(731, 9);
+ this._buttonClose.Margin = new System.Windows.Forms.Padding(0);
+ this._buttonClose.MinimumSize = new System.Drawing.Size(50, 26);
+ this._buttonClose.Name = "_buttonClose";
+ this._buttonClose.Size = new System.Drawing.Size(50, 26);
+ this._buttonClose.TabIndex = 6;
+ this._buttonClose.Values.Text = "Close";
//
// _panelFooter
//
- _panelFooter.Controls.Add(_linkLabelFooter);
- _panelFooter.Controls.Add(_iconFooter);
- _panelFooter.Controls.Add(_footerLabel);
- _panelFooter.Controls.Add(_panelFooterBorderTop);
- _panelFooter.Dock = DockStyle.Top;
- _panelFooter.Location = new Point(0, 118);
- _panelFooter.Name = "_panelFooter";
- _panelFooter.PanelBackStyle = PaletteBackStyle.PanelAlternate;
- _panelFooter.Size = new Size(578, 49);
- _panelFooter.TabIndex = 2;
+ this._panelFooter.Controls.Add(this._linkLabelFooter);
+ this._panelFooter.Controls.Add(this._iconFooter);
+ this._panelFooter.Controls.Add(this._footerLabel);
+ this._panelFooter.Controls.Add(this._panelFooterBorderTop);
+ this._panelFooter.Dock = System.Windows.Forms.DockStyle.Top;
+ this._panelFooter.Location = new System.Drawing.Point(0, 118);
+ this._panelFooter.Name = "_panelFooter";
+ this._panelFooter.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this._panelFooter.Size = new System.Drawing.Size(790, 49);
+ this._panelFooter.TabIndex = 2;
//
// _linkLabelFooter
//
- _linkLabelFooter.Location = new Point(127, 11);
- _linkLabelFooter.Name = "_linkLabelFooter";
- _linkLabelFooter.Size = new Size(110, 20);
- _linkLabelFooter.TabIndex = 0;
- _linkLabelFooter.Values.Text = "kryptonLinkLabel1";
+ this._linkLabelFooter.Location = new System.Drawing.Point(127, 11);
+ this._linkLabelFooter.Name = "_linkLabelFooter";
+ this._linkLabelFooter.Size = new System.Drawing.Size(110, 20);
+ this._linkLabelFooter.TabIndex = 0;
+ this._linkLabelFooter.Values.Text = "kryptonLinkLabel1";
//
// _iconFooter
//
- _iconFooter.BackColor = Color.Transparent;
- _iconFooter.Location = new Point(10, 10);
- _iconFooter.Margin = new Padding(0);
- _iconFooter.Name = "_iconFooter";
- _iconFooter.Size = new Size(16, 16);
- _iconFooter.TabIndex = 4;
- _iconFooter.TabStop = false;
+ this._iconFooter.BackColor = System.Drawing.Color.Transparent;
+ this._iconFooter.Location = new System.Drawing.Point(10, 10);
+ this._iconFooter.Margin = new System.Windows.Forms.Padding(0);
+ this._iconFooter.Name = "_iconFooter";
+ this._iconFooter.Size = new System.Drawing.Size(16, 16);
+ this._iconFooter.TabIndex = 4;
+ this._iconFooter.TabStop = false;
//
// _footerLabel
//
- _footerLabel.AutoSize = false;
- _footerLabel.Font = new Font("Segoe UI", 9F);
- _footerLabel.ForeColor = Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
- _footerLabel.Location = new Point(36, 11);
- _footerLabel.Margin = new Padding(0);
- _footerLabel.Name = "_footerLabel";
- _footerLabel.Size = new Size(78, 15);
- _footerLabel.Text = "Content";
+ this._footerLabel.AutoSize = false;
+ this._footerLabel.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this._footerLabel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
+ this._footerLabel.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this._footerLabel.Location = new System.Drawing.Point(36, 11);
+ this._footerLabel.Margin = new System.Windows.Forms.Padding(0);
+ this._footerLabel.Name = "_footerLabel";
+ this._footerLabel.Size = new System.Drawing.Size(78, 15);
+ this._footerLabel.Text = "Content";
//
// _panelFooterBorderTop
//
- _panelFooterBorderTop.BorderStyle = PaletteBorderStyle.HeaderPrimary;
- _panelFooterBorderTop.Dock = DockStyle.Top;
- _panelFooterBorderTop.Location = new Point(0, 0);
- _panelFooterBorderTop.Name = "_panelFooterBorderTop";
- _panelFooterBorderTop.Size = new Size(578, 1);
- _panelFooterBorderTop.Text = "kryptonBorderEdge1";
+ this._panelFooterBorderTop.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this._panelFooterBorderTop.Dock = System.Windows.Forms.DockStyle.Top;
+ this._panelFooterBorderTop.Location = new System.Drawing.Point(0, 0);
+ this._panelFooterBorderTop.Name = "_panelFooterBorderTop";
+ this._panelFooterBorderTop.Size = new System.Drawing.Size(790, 1);
+ this._panelFooterBorderTop.Text = "kryptonBorderEdge1";
//
// VisualTaskDialog
//
- AutoScaleDimensions = new SizeF(6F, 13F);
- AutoScaleMode = AutoScaleMode.Font;
- AutoScroll = true;
- ClientSize = new Size(595, 164);
- Controls.Add(_panelFooter);
- Controls.Add(_panelButtons);
- Controls.Add(_panelMain);
- FormBorderStyle = FormBorderStyle.FixedDialog;
- MaximizeBox = false;
- MinimizeBox = false;
- Name = "VisualTaskDialog";
- ShowIcon = false;
- ShowInTaskbar = false;
- SizeGripStyle = SizeGripStyle.Hide;
- StartPosition = FormStartPosition.CenterParent;
- ((ISupportInitialize)(_panelMain)).EndInit();
- _panelMain.ResumeLayout(false);
- _panelMain.PerformLayout();
- ((ISupportInitialize)(_panelMainSpacer)).EndInit();
- ((ISupportInitialize)(_panelMainCommands)).EndInit();
- ((ISupportInitialize)(_panelMainRadio)).EndInit();
- ((ISupportInitialize)(_panelMainText)).EndInit();
- _panelMainText.ResumeLayout(false);
- _panelMainText.PerformLayout();
- ((ISupportInitialize)(_panelIcon)).EndInit();
- _panelIcon.ResumeLayout(false);
- ((ISupportInitialize)(_messageIcon)).EndInit();
- ((ISupportInitialize)(_panelButtons)).EndInit();
- _panelButtons.ResumeLayout(false);
- _panelButtons.PerformLayout();
- ((ISupportInitialize)(_panelFooter)).EndInit();
- _panelFooter.ResumeLayout(false);
- _panelFooter.PerformLayout();
- ((ISupportInitialize)(_iconFooter)).EndInit();
- ResumeLayout(false);
- PerformLayout();
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.AutoScroll = true;
+ this.ClientSize = new System.Drawing.Size(790, 172);
+ this.Controls.Add(this._panelFooter);
+ this.Controls.Add(this._panelButtons);
+ this.Controls.Add(this._panelMain);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualTaskDialog";
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+ ((System.ComponentModel.ISupportInitialize)(this._panelMain)).EndInit();
+ this._panelMain.ResumeLayout(false);
+ this._panelMain.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this._panelMainSpacer)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this._panelMainCommands)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this._panelMainRadio)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this._panelMainText)).EndInit();
+ this._panelMainText.ResumeLayout(false);
+ this._panelMainText.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this._panelIcon)).EndInit();
+ this._panelIcon.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this._messageIcon)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this._panelButtons)).EndInit();
+ this._panelButtons.ResumeLayout(false);
+ this._panelButtons.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this._panelFooter)).EndInit();
+ this._panelFooter.ResumeLayout(false);
+ this._panelFooter.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this._iconFooter)).EndInit();
+ this.ResumeLayout(false);
+ this.PerformLayout();
}
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualTaskDialogForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualTaskDialogForm.Designer.cs
new file mode 100644
index 000000000..277015018
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualTaskDialogForm.Designer.cs
@@ -0,0 +1,424 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualTaskDialogForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this._panelMain = new Krypton.Toolkit.KryptonPanel();
+ this._panelMainSpacer = new Krypton.Toolkit.KryptonPanel();
+ this._panelMainCommands = new Krypton.Toolkit.KryptonPanel();
+ this._panelMainRadio = new Krypton.Toolkit.KryptonPanel();
+ this._panelMainText = new Krypton.Toolkit.KryptonPanel();
+ this._messageContent = new Krypton.Toolkit.KryptonWrapLabel();
+ this._messageContentMultiline = new Krypton.Toolkit.KryptonTextBox();
+ this._messageText = new Krypton.Toolkit.KryptonWrapLabel();
+ this._panelIcon = new Krypton.Toolkit.KryptonPanel();
+ this._messageIcon = new System.Windows.Forms.PictureBox();
+ this._panelButtons = new Krypton.Toolkit.KryptonPanel();
+ this._checkBox = new Krypton.Toolkit.KryptonCheckBox();
+ this._panelButtonsBorderTop = new Krypton.Toolkit.KryptonBorderEdge();
+ this._buttonOK = new Krypton.Toolkit.TaskDialogMessageButton();
+ this._buttonYes = new Krypton.Toolkit.TaskDialogMessageButton();
+ this._buttonNo = new Krypton.Toolkit.TaskDialogMessageButton();
+ this._buttonRetry = new Krypton.Toolkit.TaskDialogMessageButton();
+ this._buttonCancel = new Krypton.Toolkit.TaskDialogMessageButton();
+ this._buttonClose = new Krypton.Toolkit.TaskDialogMessageButton();
+ this._panelFooter = new Krypton.Toolkit.KryptonPanel();
+ this._linkLabelFooter = new Krypton.Toolkit.KryptonLinkLabel();
+ this._iconFooter = new System.Windows.Forms.PictureBox();
+ this._footerLabel = new Krypton.Toolkit.KryptonWrapLabel();
+ this._panelFooterBorderTop = new Krypton.Toolkit.KryptonBorderEdge();
+ ((System.ComponentModel.ISupportInitialize)(this._panelMain)).BeginInit();
+ this._panelMain.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this._panelMainSpacer)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this._panelMainCommands)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this._panelMainRadio)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this._panelMainText)).BeginInit();
+ this._panelMainText.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this._panelIcon)).BeginInit();
+ this._panelIcon.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this._messageIcon)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this._panelButtons)).BeginInit();
+ this._panelButtons.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this._panelFooter)).BeginInit();
+ this._panelFooter.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this._iconFooter)).BeginInit();
+ this.SuspendLayout();
+ //
+ // _panelMain
+ //
+ this._panelMain.AutoSize = true;
+ this._panelMain.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this._panelMain.Controls.Add(this._panelMainSpacer);
+ this._panelMain.Controls.Add(this._panelMainCommands);
+ this._panelMain.Controls.Add(this._panelMainRadio);
+ this._panelMain.Controls.Add(this._panelMainText);
+ this._panelMain.Controls.Add(this._panelIcon);
+ this._panelMain.Dock = System.Windows.Forms.DockStyle.Top;
+ this._panelMain.Location = new System.Drawing.Point(0, 0);
+ this._panelMain.Name = "_panelMain";
+ this._panelMain.Size = new System.Drawing.Size(782, 72);
+ this._panelMain.TabIndex = 1;
+ //
+ // _panelMainSpacer
+ //
+ this._panelMainSpacer.Location = new System.Drawing.Point(42, 59);
+ this._panelMainSpacer.Name = "_panelMainSpacer";
+ this._panelMainSpacer.Size = new System.Drawing.Size(10, 10);
+ this._panelMainSpacer.TabIndex = 3;
+ //
+ // _panelMainCommands
+ //
+ this._panelMainCommands.AutoSize = true;
+ this._panelMainCommands.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this._panelMainCommands.Location = new System.Drawing.Point(208, 10);
+ this._panelMainCommands.Name = "_panelMainCommands";
+ this._panelMainCommands.Size = new System.Drawing.Size(0, 0);
+ this._panelMainCommands.TabIndex = 2;
+ //
+ // _panelMainRadio
+ //
+ this._panelMainRadio.AutoSize = true;
+ this._panelMainRadio.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this._panelMainRadio.Location = new System.Drawing.Point(208, 32);
+ this._panelMainRadio.Name = "_panelMainRadio";
+ this._panelMainRadio.Size = new System.Drawing.Size(0, 0);
+ this._panelMainRadio.TabIndex = 1;
+ //
+ // _panelMainText
+ //
+ this._panelMainText.AutoSize = true;
+ this._panelMainText.Controls.Add(this._messageContent);
+ this._panelMainText.Controls.Add(this._messageContentMultiline);
+ this._panelMainText.Controls.Add(this._messageText);
+ this._panelMainText.Location = new System.Drawing.Point(42, 0);
+ this._panelMainText.Margin = new System.Windows.Forms.Padding(0);
+ this._panelMainText.Name = "_panelMainText";
+ this._panelMainText.Padding = new System.Windows.Forms.Padding(5, 5, 5, 0);
+ this._panelMainText.Size = new System.Drawing.Size(407, 60);
+ this._panelMainText.TabIndex = 0;
+ //
+ // _messageContent
+ //
+ this._messageContent.AutoSize = false;
+ this._messageContent.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this._messageContent.ForeColor = System.Drawing.Color.White;
+ this._messageContent.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this._messageContent.Location = new System.Drawing.Point(6, 34);
+ this._messageContent.Margin = new System.Windows.Forms.Padding(0);
+ this._messageContent.Name = "_messageContent";
+ this._messageContent.Size = new System.Drawing.Size(78, 15);
+ this._messageContent.Text = "Content";
+ //
+ // _messageContentMultiline
+ //
+ this._messageContentMultiline.Location = new System.Drawing.Point(48, 45);
+ this._messageContentMultiline.Multiline = true;
+ this._messageContentMultiline.Name = "_messageContentMultiline";
+ this._messageContentMultiline.ReadOnly = true;
+ this._messageContentMultiline.ScrollBars = System.Windows.Forms.ScrollBars.Both;
+ this._messageContentMultiline.Size = new System.Drawing.Size(351, 10);
+ this._messageContentMultiline.TabIndex = 4;
+ //
+ // _messageText
+ //
+ this._messageText.AutoSize = false;
+ this._messageText.Font = new System.Drawing.Font("Segoe UI", 13.5F, System.Drawing.FontStyle.Bold);
+ this._messageText.ForeColor = System.Drawing.Color.White;
+ this._messageText.LabelStyle = Krypton.Toolkit.LabelStyle.TitlePanel;
+ this._messageText.Location = new System.Drawing.Point(5, 5);
+ this._messageText.Margin = new System.Windows.Forms.Padding(0);
+ this._messageText.Name = "_messageText";
+ this._messageText.Size = new System.Drawing.Size(139, 27);
+ this._messageText.Text = "Message Text";
+ //
+ // _panelIcon
+ //
+ this._panelIcon.AutoSize = true;
+ this._panelIcon.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this._panelIcon.Controls.Add(this._messageIcon);
+ this._panelIcon.Location = new System.Drawing.Point(0, 0);
+ this._panelIcon.Margin = new System.Windows.Forms.Padding(0);
+ this._panelIcon.Name = "_panelIcon";
+ this._panelIcon.Padding = new System.Windows.Forms.Padding(10, 10, 0, 10);
+ this._panelIcon.Size = new System.Drawing.Size(42, 52);
+ this._panelIcon.TabIndex = 0;
+ //
+ // _messageIcon
+ //
+ this._messageIcon.BackColor = System.Drawing.Color.Transparent;
+ this._messageIcon.Location = new System.Drawing.Point(10, 10);
+ this._messageIcon.Margin = new System.Windows.Forms.Padding(0);
+ this._messageIcon.Name = "_messageIcon";
+ this._messageIcon.Size = new System.Drawing.Size(32, 32);
+ this._messageIcon.TabIndex = 0;
+ this._messageIcon.TabStop = false;
+ //
+ // _panelButtons
+ //
+ this._panelButtons.Controls.Add(this._checkBox);
+ this._panelButtons.Controls.Add(this._panelButtonsBorderTop);
+ this._panelButtons.Controls.Add(this._buttonOK);
+ this._panelButtons.Controls.Add(this._buttonYes);
+ this._panelButtons.Controls.Add(this._buttonNo);
+ this._panelButtons.Controls.Add(this._buttonRetry);
+ this._panelButtons.Controls.Add(this._buttonCancel);
+ this._panelButtons.Controls.Add(this._buttonClose);
+ this._panelButtons.Dock = System.Windows.Forms.DockStyle.Top;
+ this._panelButtons.Location = new System.Drawing.Point(0, 72);
+ this._panelButtons.Margin = new System.Windows.Forms.Padding(0);
+ this._panelButtons.Name = "_panelButtons";
+ this._panelButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this._panelButtons.Size = new System.Drawing.Size(782, 46);
+ this._panelButtons.TabIndex = 2;
+ //
+ // _checkBox
+ //
+ this._checkBox.Location = new System.Drawing.Point(12, 12);
+ this._checkBox.Name = "_checkBox";
+ this._checkBox.Size = new System.Drawing.Size(75, 20);
+ this._checkBox.TabIndex = 0;
+ this._checkBox.Values.Text = "checkBox";
+ //
+ // _panelButtonsBorderTop
+ //
+ this._panelButtonsBorderTop.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this._panelButtonsBorderTop.Dock = System.Windows.Forms.DockStyle.Top;
+ this._panelButtonsBorderTop.Location = new System.Drawing.Point(0, 0);
+ this._panelButtonsBorderTop.Name = "_panelButtonsBorderTop";
+ this._panelButtonsBorderTop.Size = new System.Drawing.Size(782, 1);
+ this._panelButtonsBorderTop.Text = "kryptonBorderEdge1";
+ //
+ // _buttonOK
+ //
+ this._buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this._buttonOK.AutoSize = true;
+ this._buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this._buttonOK.IgnoreAltF4 = false;
+ this._buttonOK.Location = new System.Drawing.Point(673, 9);
+ this._buttonOK.Margin = new System.Windows.Forms.Padding(0);
+ this._buttonOK.MinimumSize = new System.Drawing.Size(50, 26);
+ this._buttonOK.Name = "_buttonOK";
+ this._buttonOK.Size = new System.Drawing.Size(50, 26);
+ this._buttonOK.TabIndex = 1;
+ this._buttonOK.Values.Text = "OK";
+ //
+ // _buttonYes
+ //
+ this._buttonYes.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this._buttonYes.AutoSize = true;
+ this._buttonYes.DialogResult = System.Windows.Forms.DialogResult.Yes;
+ this._buttonYes.IgnoreAltF4 = false;
+ this._buttonYes.Location = new System.Drawing.Point(573, 9);
+ this._buttonYes.Margin = new System.Windows.Forms.Padding(0);
+ this._buttonYes.MinimumSize = new System.Drawing.Size(50, 26);
+ this._buttonYes.Name = "_buttonYes";
+ this._buttonYes.Size = new System.Drawing.Size(50, 26);
+ this._buttonYes.TabIndex = 2;
+ this._buttonYes.Values.Text = "Yes";
+ //
+ // _buttonNo
+ //
+ this._buttonNo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this._buttonNo.AutoSize = true;
+ this._buttonNo.DialogResult = System.Windows.Forms.DialogResult.No;
+ this._buttonNo.IgnoreAltF4 = false;
+ this._buttonNo.Location = new System.Drawing.Point(523, 9);
+ this._buttonNo.Margin = new System.Windows.Forms.Padding(0);
+ this._buttonNo.MinimumSize = new System.Drawing.Size(50, 26);
+ this._buttonNo.Name = "_buttonNo";
+ this._buttonNo.Size = new System.Drawing.Size(50, 26);
+ this._buttonNo.TabIndex = 3;
+ this._buttonNo.Values.Text = "No";
+ //
+ // _buttonRetry
+ //
+ this._buttonRetry.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this._buttonRetry.AutoSize = true;
+ this._buttonRetry.DialogResult = System.Windows.Forms.DialogResult.Retry;
+ this._buttonRetry.IgnoreAltF4 = false;
+ this._buttonRetry.Location = new System.Drawing.Point(623, 9);
+ this._buttonRetry.Margin = new System.Windows.Forms.Padding(0);
+ this._buttonRetry.MinimumSize = new System.Drawing.Size(50, 26);
+ this._buttonRetry.Name = "_buttonRetry";
+ this._buttonRetry.Size = new System.Drawing.Size(50, 26);
+ this._buttonRetry.TabIndex = 5;
+ this._buttonRetry.Values.Text = "Retry";
+ //
+ // _buttonCancel
+ //
+ this._buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this._buttonCancel.AutoSize = true;
+ this._buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this._buttonCancel.IgnoreAltF4 = false;
+ this._buttonCancel.Location = new System.Drawing.Point(466, 9);
+ this._buttonCancel.Margin = new System.Windows.Forms.Padding(0);
+ this._buttonCancel.MinimumSize = new System.Drawing.Size(50, 26);
+ this._buttonCancel.Name = "_buttonCancel";
+ this._buttonCancel.Size = new System.Drawing.Size(57, 26);
+ this._buttonCancel.TabIndex = 4;
+ this._buttonCancel.Values.Text = "Cancel";
+ //
+ // _buttonClose
+ //
+ this._buttonClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this._buttonClose.AutoSize = true;
+ this._buttonClose.IgnoreAltF4 = false;
+ this._buttonClose.Location = new System.Drawing.Point(723, 9);
+ this._buttonClose.Margin = new System.Windows.Forms.Padding(0);
+ this._buttonClose.MinimumSize = new System.Drawing.Size(50, 26);
+ this._buttonClose.Name = "_buttonClose";
+ this._buttonClose.Size = new System.Drawing.Size(50, 26);
+ this._buttonClose.TabIndex = 6;
+ this._buttonClose.Values.Text = "Close";
+ //
+ // _panelFooter
+ //
+ this._panelFooter.Controls.Add(this._linkLabelFooter);
+ this._panelFooter.Controls.Add(this._iconFooter);
+ this._panelFooter.Controls.Add(this._footerLabel);
+ this._panelFooter.Controls.Add(this._panelFooterBorderTop);
+ this._panelFooter.Dock = System.Windows.Forms.DockStyle.Top;
+ this._panelFooter.Location = new System.Drawing.Point(0, 118);
+ this._panelFooter.Name = "_panelFooter";
+ this._panelFooter.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this._panelFooter.Size = new System.Drawing.Size(782, 49);
+ this._panelFooter.TabIndex = 3;
+ //
+ // _linkLabelFooter
+ //
+ this._linkLabelFooter.Location = new System.Drawing.Point(127, 11);
+ this._linkLabelFooter.Name = "_linkLabelFooter";
+ this._linkLabelFooter.Size = new System.Drawing.Size(110, 20);
+ this._linkLabelFooter.TabIndex = 0;
+ this._linkLabelFooter.Values.Text = "kryptonLinkLabel1";
+ //
+ // _iconFooter
+ //
+ this._iconFooter.BackColor = System.Drawing.Color.Transparent;
+ this._iconFooter.Location = new System.Drawing.Point(10, 10);
+ this._iconFooter.Margin = new System.Windows.Forms.Padding(0);
+ this._iconFooter.Name = "_iconFooter";
+ this._iconFooter.Size = new System.Drawing.Size(16, 16);
+ this._iconFooter.TabIndex = 4;
+ this._iconFooter.TabStop = false;
+ //
+ // _footerLabel
+ //
+ this._footerLabel.AutoSize = false;
+ this._footerLabel.Font = new System.Drawing.Font("Segoe UI", 9F);
+ this._footerLabel.ForeColor = System.Drawing.Color.White;
+ this._footerLabel.LabelStyle = Krypton.Toolkit.LabelStyle.AlternateControl;
+ this._footerLabel.Location = new System.Drawing.Point(36, 11);
+ this._footerLabel.Margin = new System.Windows.Forms.Padding(0);
+ this._footerLabel.Name = "_footerLabel";
+ this._footerLabel.Size = new System.Drawing.Size(78, 15);
+ this._footerLabel.Text = "Content";
+ //
+ // _panelFooterBorderTop
+ //
+ this._panelFooterBorderTop.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary;
+ this._panelFooterBorderTop.Dock = System.Windows.Forms.DockStyle.Top;
+ this._panelFooterBorderTop.Location = new System.Drawing.Point(0, 0);
+ this._panelFooterBorderTop.Name = "_panelFooterBorderTop";
+ this._panelFooterBorderTop.Size = new System.Drawing.Size(782, 1);
+ this._panelFooterBorderTop.Text = "kryptonBorderEdge1";
+ //
+ // VisualTaskDialogForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.AutoScroll = true;
+ this.ClientSize = new System.Drawing.Size(799, 164);
+ this.Controls.Add(this._panelFooter);
+ this.Controls.Add(this._panelButtons);
+ this.Controls.Add(this._panelMain);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+ this.FormTitleAlign = Krypton.Toolkit.PaletteRelativeAlign.Near;
+ this.GroupBackStyle = Krypton.Toolkit.PaletteBackStyle.FormMain;
+ this.GroupBorderStyle = Krypton.Toolkit.PaletteBorderStyle.FormMain;
+ this.HeaderStyle = Krypton.Toolkit.HeaderStyle.Form;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualTaskDialogForm";
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+ this.TitleStyle = Krypton.Toolkit.KryptonFormTitleStyle.Inherit;
+ ((System.ComponentModel.ISupportInitialize)(this._panelMain)).EndInit();
+ this._panelMain.ResumeLayout(false);
+ this._panelMain.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this._panelMainSpacer)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this._panelMainCommands)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this._panelMainRadio)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this._panelMainText)).EndInit();
+ this._panelMainText.ResumeLayout(false);
+ this._panelMainText.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this._panelIcon)).EndInit();
+ this._panelIcon.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this._messageIcon)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this._panelButtons)).EndInit();
+ this._panelButtons.ResumeLayout(false);
+ this._panelButtons.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this._panelFooter)).EndInit();
+ this._panelFooter.ResumeLayout(false);
+ this._panelFooter.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this._iconFooter)).EndInit();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private KryptonPanel _panelMain;
+ private KryptonPanel _panelMainSpacer;
+ private KryptonPanel _panelMainCommands;
+ private KryptonPanel _panelMainRadio;
+ private KryptonPanel _panelMainText;
+ private KryptonWrapLabel _messageContent;
+ private KryptonTextBox _messageContentMultiline;
+ private KryptonWrapLabel _messageText;
+ private KryptonPanel _panelIcon;
+ private PictureBox _messageIcon;
+ private KryptonPanel _panelButtons;
+ private KryptonCheckBox _checkBox;
+ private KryptonBorderEdge _panelButtonsBorderTop;
+ private TaskDialogMessageButton _buttonOK;
+ private TaskDialogMessageButton _buttonYes;
+ private TaskDialogMessageButton _buttonNo;
+ private TaskDialogMessageButton _buttonRetry;
+ private TaskDialogMessageButton _buttonCancel;
+ private TaskDialogMessageButton _buttonClose;
+ private KryptonPanel _panelFooter;
+ private KryptonLinkLabel _linkLabelFooter;
+ private PictureBox _iconFooter;
+ private KryptonWrapLabel _footerLabel;
+ private KryptonBorderEdge _panelFooterBorderTop;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualTaskDialogForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualTaskDialogForm.cs
new file mode 100644
index 000000000..265b9496a
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualTaskDialogForm.cs
@@ -0,0 +1,1045 @@
+#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. 2023 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+namespace Krypton.Toolkit
+{
+ public partial class VisualTaskDialogForm : KryptonForm
+ {
+ #region Static Fields
+
+ private const int BUTTON_GAP = 10;
+
+ #endregion
+
+ #region Instance Fields
+
+ private KryptonTaskDialog? _taskDialog;
+ private readonly string _windowTitle;
+ private readonly string _mainInstruction;
+ private readonly string _content;
+ private readonly KryptonMessageBoxIcon _mainIcon;
+ private readonly Image? _customMainIcon;
+ private readonly KryptonTaskDialogCommandCollection _radioButtons;
+ private readonly KryptonTaskDialogCommandCollection _commandButtons;
+ private KryptonTaskDialogCommand? _defaultRadioButton;
+ private readonly TaskDialogButtons _commonButtons;
+ private readonly TaskDialogButtons _defaultButton;
+ private readonly KryptonMessageBoxIcon _footerIcon;
+ private readonly Image? _customFooterIcon;
+ private readonly string _footerText;
+ private readonly string _footerHyperlink;
+ private readonly string _checkboxText;
+ private bool _checkboxState;
+ private readonly bool _allowDialogClose;
+ private readonly bool _useNativeOSIcons;
+
+ #endregion
+
+ #region Identity
+
+ /// Initializes a new instance of the class.
+ /// The task dialog.
+ /// taskDialog
+ public VisualTaskDialogForm(KryptonTaskDialog taskDialog)
+ {
+ // Must provide a valid reference
+
+ _taskDialog = taskDialog ??
+ throw new ArgumentNullException(nameof(taskDialog));
+
+ // Initialize with task dialog values
+ _windowTitle = taskDialog.WindowTitle;
+ _mainInstruction = taskDialog.MainInstruction;
+ _content = taskDialog.Content;
+ _mainIcon = taskDialog.Icon;
+ _customMainIcon = taskDialog.CustomIcon;
+ _radioButtons = taskDialog.RadioButtons;
+ _commandButtons = taskDialog.CommandButtons;
+ _commonButtons = taskDialog.CommonButtons;
+ _defaultRadioButton = taskDialog.DefaultRadioButton;
+ _defaultButton = taskDialog.DefaultButton;
+ _footerIcon = taskDialog.FooterIcon;
+ _customFooterIcon = taskDialog.CustomFooterIcon;
+ _footerText = taskDialog.FooterText;
+ _footerHyperlink = taskDialog.FooterHyperlink;
+ _checkboxText = taskDialog.CheckboxText;
+ _checkboxState = taskDialog.CheckboxState;
+ _allowDialogClose = taskDialog.AllowDialogClose;
+ _useNativeOSIcons = taskDialog.UseNativeOSIcons;
+
+ TextExtra = taskDialog.TextExtra;
+
+ InitializeComponent();
+
+ UpdateContents();
+ }
+
+ #endregion
+
+ #region Implementation
+
+ private void UpdateContents()
+ {
+ // Update contents to match requirements
+ UpdateText();
+ UpdateIcon();
+ UpdateRadioButtons();
+ UpdateCommandButtons();
+ UpdateButtons();
+ UpdateCheckbox();
+ UpdateFooter();
+ UpdateChrome();
+
+ // Finally calculate and set form sizing
+ UpdateSizing();
+ }
+
+ private void UpdateText()
+ {
+ Text = _windowTitle;
+ _messageText.Text = _mainInstruction;
+ // If the content has more than 20 lines, use the multi-line text control
+ if (string.IsNullOrEmpty(_content))
+ {
+ _messageContent.Text = string.Empty;
+ }
+ else if (_content.Length - _content.Replace("\n", string.Empty).Length > 20)
+ {
+ _messageContentMultiline.Text = _content;
+ _messageContentMultiline.Visible = true;
+ _messageContent.Visible = false;
+ }
+ else
+ {
+ _messageContent.Text = _content;
+ _messageContentMultiline.Visible = false;
+ _messageContent.Visible = true;
+ }
+ }
+
+ private void UpdateIcon()
+ {
+ _panelIcon.Visible = true;
+
+ // Always use the custom icon as the preferred option
+ if (_customMainIcon != null)
+ {
+ _messageIcon.Image = _customMainIcon;
+ }
+ else
+ {
+ switch (_mainIcon)
+ {
+ case KryptonMessageBoxIcon.None:
+ _panelIcon.Visible = false;
+ _panelMainText.Left -= _messageIcon.Right;
+ break;
+ case KryptonMessageBoxIcon.Hand:
+ _messageIcon.Image = TaskDialogImageResources.TaskDialogHandGeneric;
+ SystemSounds.Hand.Play();
+ break;
+ case KryptonMessageBoxIcon.Question:
+ _messageIcon.Image = TaskDialogImageResources.TaskDialogQuestionGeneric;
+ SystemSounds.Question.Play();
+ break;
+ case KryptonMessageBoxIcon.Exclamation:
+ _messageIcon.Image = TaskDialogImageResources.TaskDialogWarningGeneric;
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.Asterisk:
+ _messageIcon.Image = TaskDialogImageResources.TaskDialogAsteriskGeneric;
+ SystemSounds.Asterisk.Play();
+ break;
+ case KryptonMessageBoxIcon.Stop:
+ _messageIcon.Image = TaskDialogImageResources.TaskDialogStopGeneric;
+ SystemSounds.Asterisk.Play();
+ break;
+ case KryptonMessageBoxIcon.Information:
+ _messageIcon.Image = TaskDialogImageResources.TaskDialogInformationGeneric;
+ SystemSounds.Asterisk.Play();
+ break;
+ case KryptonMessageBoxIcon.Warning:
+ _messageIcon.Image = TaskDialogImageResources.TaskDialogWarningGeneric;
+ SystemSounds.Exclamation.Play();
+ break;
+ case KryptonMessageBoxIcon.Error:
+ _messageIcon.Image = TaskDialogImageResources.TaskDialogCriticalGeneric;
+ SystemSounds.Hand.Play();
+ break;
+ case KryptonMessageBoxIcon.Shield:
+ _messageIcon.Image = GraphicsExtensions.ScaleImage(SystemIcons.Shield.ToBitmap(), new Size(16, 16));
+ break;
+ case KryptonMessageBoxIcon.WindowsLogo:
+ // Because Windows 11 displays a generic application icon,
+ // we need to rely on a image instead
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ _messageIcon.Image = TaskDialogImageResources.TaskDialog_Windows_11_Logo;
+ }
+ // Windows 10
+ else if (OSUtilities.IsWindowsTen)
+ {
+ _messageIcon.Image = TaskDialogImageResources.TaskDialog_Windows_8_and_10_Logo;
+ }
+ else
+ {
+ _messageIcon.Image = GraphicsExtensions.ScaleImage(SystemIcons.WinLogo.ToBitmap(), new Size(16, 16));
+ }
+ break;
+ }
+ }
+ }
+
+ private void UpdateRadioButtons()
+ {
+ if (_radioButtons.Count == 0)
+ {
+ _panelMainRadio.Visible = false;
+ }
+ else
+ {
+ _panelMainRadio.Controls.Clear();
+ _panelMainRadio.Visible = true;
+
+ var maxButtonSize = Size.Empty;
+ foreach (KryptonTaskDialogCommand command in _radioButtons)
+ {
+ // Create and add a new radio button instance
+ var button = new KryptonRadioButton
+ {
+ LabelStyle = LabelStyle.NormalPanel
+ };
+ button.Values.Text = command.Text;
+ button.Values.ExtraText = command.ExtraText;
+ button.Values.Image = command.Image;
+ button.Values.ImageTransparentColor = command.ImageTransparentColor;
+ button.Enabled = command.Enabled;
+ button.CheckedChanged += OnRadioButtonCheckedChanged;
+ button.Tag = command;
+ if (_defaultRadioButton == command)
+ {
+ button.Checked = true;
+ }
+
+ _panelMainRadio.Controls.Add(button);
+
+ // Note that largest radio button encountered
+ Size buttonSize = button.GetPreferredSize(Size.Empty);
+ maxButtonSize.Width = Math.Max(maxButtonSize.Width, buttonSize.Width);
+ maxButtonSize.Height = Math.Max(maxButtonSize.Height, buttonSize.Height);
+ }
+
+ // Enforce a maximum width to the commands
+ maxButtonSize.Width = Math.Min(Math.Max(maxButtonSize.Width, 150), 400);
+
+ // Position the radio buttons in a vertical stack and size owning panel
+ var offset = new Point(BUTTON_GAP - 1, 2);
+ foreach (KryptonRadioButton button in _panelMainRadio.Controls)
+ {
+ button.Location = offset;
+ button.Size = maxButtonSize;
+ offset.Y += maxButtonSize.Height;
+ }
+
+ // Size to the contained command controls
+ _panelMainRadio.Size = maxButtonSize with { Height = offset.Y };
+ }
+ }
+
+ private void UpdateCommandButtons()
+ {
+ if (_commandButtons.Count == 0)
+ {
+ _panelMainCommands.Visible = false;
+ }
+ else
+ {
+ _panelMainCommands.Controls.Clear();
+ _panelMainCommands.Visible = true;
+
+ var maxButtonSize = Size.Empty;
+ foreach (KryptonTaskDialogCommand command in _commandButtons)
+ {
+ // Create and add a new button instance
+ var button = new KryptonButton
+ {
+ ButtonStyle = ButtonStyle.Command
+ };
+ button.StateCommon.Content.Image!.ImageH = PaletteRelativeAlign.Near;
+ button.StateCommon.Content.ShortText.TextH = PaletteRelativeAlign.Near;
+ button.StateCommon.Content.LongText.TextH = PaletteRelativeAlign.Near;
+ button.Values.Text = command.Text;
+ button.Values.ExtraText = command.ExtraText;
+ button.Values.Image = command.Image;
+ button.Values.ImageTransparentColor = command.ImageTransparentColor;
+ button.Enabled = command.Enabled;
+ button.DialogResult = command.DialogResult;
+ button.Tag = command;
+ button.Click += OnCommandClicked;
+ _panelMainCommands.Controls.Add(button);
+
+ // Note that largest button encountered
+ Size buttonSize = button.GetPreferredSize(Size.Empty);
+ maxButtonSize.Width = Math.Max(maxButtonSize.Width, buttonSize.Width);
+ maxButtonSize.Height = Math.Max(maxButtonSize.Height, buttonSize.Height);
+ }
+
+ // Enforce a maximum width to the commands
+ maxButtonSize.Width = Math.Min(Math.Max(maxButtonSize.Width, 150), 400);
+
+ // Position the buttons in a vertical stack and size owning panel
+ var offset = new Point(BUTTON_GAP - 1, 2);
+ foreach (KryptonButton button in _panelMainCommands.Controls)
+ {
+ button.Location = offset;
+ button.Size = maxButtonSize;
+ offset.Y += maxButtonSize.Height;
+ }
+
+ // Size to the contained command controls
+ _panelMainCommands.Size = maxButtonSize with { Height = offset.Y };
+ }
+ }
+
+ private void UpdateButtons()
+ {
+ TaskDialogMessageButton? firstButton = null;
+ TaskDialogMessageButton? defaultButton = null;
+
+ if ((_commonButtons & TaskDialogButtons.OK) == TaskDialogButtons.OK)
+ {
+ if ((_defaultButton & TaskDialogButtons.OK) == TaskDialogButtons.OK)
+ {
+ defaultButton = _buttonOK;
+ }
+
+ firstButton = _buttonOK;
+ _buttonOK.Text = KryptonManager.Strings.GeneralStrings.OK;
+ _buttonOK.Visible = true;
+ }
+ else
+ {
+ _buttonOK.Visible = false;
+ }
+
+ if ((_commonButtons & TaskDialogButtons.Yes) == TaskDialogButtons.Yes)
+ {
+ if ((_defaultButton & TaskDialogButtons.Yes) == TaskDialogButtons.Yes)
+ {
+ defaultButton = _buttonYes;
+ }
+
+ firstButton ??= _buttonYes;
+
+ _buttonYes.Text = KryptonManager.Strings.GeneralStrings.Yes;
+ _buttonYes.Visible = true;
+ }
+ else
+ {
+ _buttonYes.Visible = false;
+ }
+
+ if ((_commonButtons & TaskDialogButtons.No) == TaskDialogButtons.No)
+ {
+ if ((_defaultButton & TaskDialogButtons.No) == TaskDialogButtons.No)
+ {
+ defaultButton = _buttonNo;
+ }
+
+ firstButton ??= _buttonNo;
+
+ _buttonNo.Text = KryptonManager.Strings.GeneralStrings.No;
+ _buttonNo.Visible = true;
+ }
+ else
+ {
+ _buttonNo.Visible = false;
+ }
+
+ if ((_commonButtons & TaskDialogButtons.Cancel) == TaskDialogButtons.Cancel)
+ {
+ if ((_defaultButton & TaskDialogButtons.Cancel) == TaskDialogButtons.Cancel)
+ {
+ defaultButton = _buttonCancel;
+ }
+
+ firstButton ??= _buttonCancel;
+
+ _buttonCancel.Text = KryptonManager.Strings.GeneralStrings.Cancel;
+ _buttonCancel.Visible = true;
+ }
+ else
+ {
+ _buttonCancel.Visible = false;
+ }
+
+ if ((_commonButtons & TaskDialogButtons.Retry) == TaskDialogButtons.Retry)
+ {
+ if ((_defaultButton & TaskDialogButtons.Retry) == TaskDialogButtons.Retry)
+ {
+ defaultButton = _buttonRetry;
+ }
+
+ firstButton ??= _buttonRetry;
+
+ _buttonRetry.Text = KryptonManager.Strings.GeneralStrings.Retry;
+ _buttonRetry.Visible = true;
+ }
+ else
+ {
+ _buttonRetry.Visible = false;
+ }
+
+ if ((_commonButtons & TaskDialogButtons.Close) == TaskDialogButtons.Close)
+ {
+ if ((_defaultButton & TaskDialogButtons.Close) == TaskDialogButtons.Close)
+ {
+ defaultButton = _buttonClose;
+ }
+
+ firstButton ??= _buttonClose;
+
+ _buttonClose.Text = KryptonManager.Strings.GeneralStrings.Close;
+ _buttonClose.Visible = true;
+ }
+ else
+ {
+ _buttonClose.Visible = false;
+ }
+
+ if (defaultButton != null)
+ {
+ defaultButton.Select();
+ }
+ else
+ {
+ firstButton?.Select();
+ }
+ }
+
+ private void UpdateCheckbox()
+ {
+ _checkBox.Checked = _checkboxState;
+ _checkBox.Text = _checkboxText;
+ _checkBox.Visible = !string.IsNullOrEmpty(_checkboxText);
+ }
+
+ private void UpdateFooter()
+ {
+ _iconFooter.Visible = true;
+
+ // Always use the custom icon as the preferred option
+ if (_customFooterIcon != null)
+ {
+ _iconFooter.Image = _customFooterIcon;
+ }
+ else
+ {
+ switch (_footerIcon)
+ {
+ case KryptonMessageBoxIcon.None:
+ _iconFooter.Visible = false;
+ break;
+ case KryptonMessageBoxIcon.Question:
+ ChangeFooterIcon(KryptonMessageBoxIcon.Question, _useNativeOSIcons);
+ break;
+ case KryptonMessageBoxIcon.Information:
+ ChangeFooterIcon(KryptonMessageBoxIcon.Information, _useNativeOSIcons);
+ break;
+ case KryptonMessageBoxIcon.Warning:
+ ChangeFooterIcon(KryptonMessageBoxIcon.Warning, _useNativeOSIcons);
+ break;
+ case KryptonMessageBoxIcon.Error:
+ ChangeFooterIcon(KryptonMessageBoxIcon.Error, _useNativeOSIcons);
+ break;
+ case KryptonMessageBoxIcon.Hand:
+ ChangeFooterIcon(KryptonMessageBoxIcon.Hand, _useNativeOSIcons);
+ break;
+ case KryptonMessageBoxIcon.Exclamation:
+ ChangeFooterIcon(KryptonMessageBoxIcon.Exclamation, _useNativeOSIcons);
+ break;
+ case KryptonMessageBoxIcon.Asterisk:
+ ChangeFooterIcon(KryptonMessageBoxIcon.Asterisk, _useNativeOSIcons);
+ break;
+ case KryptonMessageBoxIcon.Stop:
+ ChangeFooterIcon(KryptonMessageBoxIcon.Stop, _useNativeOSIcons);
+ break;
+ case KryptonMessageBoxIcon.Shield:
+ _iconFooter.Image = GraphicsExtensions.ScaleImage(SystemIcons.Shield.ToBitmap(), new Size(16, 16));
+ break;
+ case KryptonMessageBoxIcon.WindowsLogo:
+ // Because Windows 11 displays a generic application icon,
+ // we need to rely on a image instead
+ if (OSUtilities.IsAtLeastWindowsEleven)
+ {
+ _iconFooter.Image = TaskDialogImageResources.TaskDialog_Windows_11_Logo;
+ }
+ // Windows 10
+ else if (OSUtilities.IsWindowsTen)
+ {
+ _iconFooter.Image = TaskDialogImageResources.TaskDialog_Windows_8_and_10_Logo;
+ }
+ else
+ {
+ _iconFooter.Image =
+ GraphicsExtensions.ScaleImage(SystemIcons.WinLogo.ToBitmap(), new Size(16, 16));
+ }
+
+ break;
+ }
+ }
+
+ _footerLabel.Text = _footerText;
+ _linkLabelFooter.Text = _footerHyperlink;
+ }
+
+ private void ChangeFooterIcon(KryptonMessageBoxIcon icon, bool useNativeOsIcons)
+ {
+ switch (icon)
+ {
+ case KryptonMessageBoxIcon.Hand:
+ if (useNativeOsIcons)
+ {
+ _iconFooter.Image =
+ GraphicsExtensions.ScaleImage(SystemIcons.Hand.ToBitmap(), new Size(16, 16));
+ }
+ else
+ {
+ _iconFooter.Image = TaskDialogImageResources.TaskDialogHandGeneric;
+ }
+ break;
+ case KryptonMessageBoxIcon.Question:
+ if (useNativeOsIcons)
+ {
+ _iconFooter.Image =
+ GraphicsExtensions.ScaleImage(SystemIcons.Question.ToBitmap(), new Size(16, 16));
+ }
+ else
+ {
+ _iconFooter.Image = TaskDialogImageResources.TaskDialogQuestionGeneric;
+ }
+ break;
+ case KryptonMessageBoxIcon.Exclamation:
+ if (useNativeOsIcons)
+ {
+ _iconFooter.Image =
+ GraphicsExtensions.ScaleImage(SystemIcons.Exclamation.ToBitmap(), new Size(16, 16));
+ }
+ else
+ {
+ _iconFooter.Image = TaskDialogImageResources.TaskDialogWarningGeneric;
+ }
+ break;
+ case KryptonMessageBoxIcon.Asterisk:
+ if (useNativeOsIcons)
+ {
+ _iconFooter.Image =
+ GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), new Size(16, 16));
+ }
+ else
+ {
+ _iconFooter.Image = TaskDialogImageResources.TaskDialogAsteriskGeneric;
+ }
+ break;
+ case KryptonMessageBoxIcon.Stop:
+ if (useNativeOsIcons)
+ {
+ _iconFooter.Image =
+ GraphicsExtensions.ScaleImage(SystemIcons.Asterisk.ToBitmap(), new Size(16, 16));
+ }
+ else
+ {
+ _iconFooter.Image = TaskDialogImageResources.TaskDialogStopGeneric;
+ }
+ break;
+ case KryptonMessageBoxIcon.Error:
+ if (useNativeOsIcons)
+ {
+ _iconFooter.Image =
+ GraphicsExtensions.ScaleImage(SystemIcons.Error.ToBitmap(), new Size(16, 16));
+ }
+ else
+ {
+ _iconFooter.Image = TaskDialogImageResources.TaskDialogAsteriskGeneric;
+ }
+ break;
+ case KryptonMessageBoxIcon.Warning:
+ if (useNativeOsIcons)
+ {
+ _iconFooter.Image =
+ GraphicsExtensions.ScaleImage(SystemIcons.Warning.ToBitmap(), new Size(16, 16));
+ }
+ else
+ {
+ _iconFooter.Image = TaskDialogImageResources.TaskDialogWarningGeneric;
+ }
+ break;
+ case KryptonMessageBoxIcon.Information:
+ if (useNativeOsIcons)
+ {
+ _iconFooter.Image =
+ GraphicsExtensions.ScaleImage(SystemIcons.Information.ToBitmap(), new Size(16, 16));
+ }
+ else
+ {
+ _iconFooter.Image = TaskDialogImageResources.TaskDialogInformationGeneric;
+ }
+ break;
+ default:
+ throw new ArgumentOutOfRangeException(nameof(icon), icon, null);
+ }
+ }
+
+ private void UpdateChrome()
+ {
+ if (((_commonButtons & TaskDialogButtons.Cancel) == TaskDialogButtons.Cancel) || _allowDialogClose)
+ {
+ ControlBox = true;
+ }
+ else
+ {
+ ControlBox = false;
+ }
+
+ _buttonOK.IgnoreAltF4 = !ControlBox;
+ _buttonYes.IgnoreAltF4 = !ControlBox;
+ _buttonNo.IgnoreAltF4 = !ControlBox;
+ _buttonCancel.IgnoreAltF4 = !ControlBox;
+ _buttonRetry.IgnoreAltF4 = !ControlBox;
+ _buttonClose.IgnoreAltF4 = !ControlBox;
+ }
+
+ private void UpdateSizing()
+ {
+ Size messageSizing = UpdateMainTextSizing();
+ Size radioSizing = UpdateRadioSizing();
+ Size commandSizing = UpdateCommandSizing();
+ Size spacerSizing = UpdateSpacerSizing();
+ Size iconSizing = UpdateIconSizing();
+ Size buttonsSizing = UpdateButtonsSizing();
+ Size footerSizing = UpdateFooterSizing();
+
+ // Size of window is calculated from the client area
+ ClientSize = new Size(iconSizing.Width + Math.Max(messageSizing.Width, Math.Max(commandSizing.Width, Math.Max(radioSizing.Width, Math.Max(buttonsSizing.Width, footerSizing.Width)))),
+ Math.Max(iconSizing.Height, messageSizing.Height + radioSizing.Height + commandSizing.Height + spacerSizing.Height) + buttonsSizing.Height + footerSizing.Height);
+ }
+
+ private Size UpdateMainTextSizing()
+ {
+ Size messageContentSize;
+
+ // Update size of the main instruction and content labels but applying a sensible maximum
+ using (Graphics g = CreateGraphics())
+ {
+ // Find size of the labels when it has a maximum length of 400
+ _messageText.UpdateFont();
+ _messageContent.UpdateFont();
+ _messageContentMultiline.Font = _messageContent.Font;
+ var messageMainSize = g.MeasureString(_mainInstruction, _messageText.Font, 400).ToSize();
+ messageContentSize = g.MeasureString(_content, _messageContent.Font, 400).ToSize();
+
+ // Get the display size and make sure that the content size is not greater than 0.6 of display size
+ Rectangle dispSize = Screen.GetWorkingArea(Location);
+
+ var h = (int)Math.Min(messageContentSize.Height, dispSize.Height * 0.6);
+ var w = (int)Math.Min(messageContentSize.Width, dispSize.Width * 0.6);
+ var sz = new Size(w, h);
+ if (messageContentSize != sz)
+ {
+ messageContentSize = sz;
+ }
+
+ // Work out DPI adjustment factor
+ messageMainSize.Width = (int)(messageMainSize.Width * FactorDpiX);
+ messageMainSize.Height = (int)(messageMainSize.Height * FactorDpiY);
+ messageContentSize.Width = (int)(messageContentSize.Width * FactorDpiX);
+ messageContentSize.Height = (int)(messageContentSize.Height * FactorDpiY);
+
+ // Always add on an extra 5 pixels as sometimes the measure size does not draw the last
+ // character it contains, this ensures there is always definitely enough space for it all
+ messageMainSize.Width += 5;
+ messageContentSize.Width += 5;
+ _messageText.Size = messageMainSize;
+ _messageContent.Size = messageContentSize;
+ _messageContentMultiline.Size = messageContentSize;
+ }
+
+ // Resize panel containing the main text
+ Padding panelMessagePadding = _panelMainText.Padding;
+ _panelMainText.Width = Math.Max(_messageText.Size.Width, messageContentSize.Width) + panelMessagePadding.Horizontal;
+ _panelMainText.Height = _messageText.Size.Height + messageContentSize.Height + panelMessagePadding.Vertical + BUTTON_GAP;
+
+ // Position the content label below the main label
+ _messageContent.Location = new Point(_messageText.Left + 2, _messageText.Bottom);
+ _messageContentMultiline.Location = _messageContent.Location;
+ return _panelMainText.Size;
+ }
+
+ private Size UpdateIconSizing() => _messageIcon.Image == null ? Size.Empty : _panelIcon.Size;
+
+ private Size UpdateRadioSizing()
+ {
+ _panelMainRadio.Location = new Point(_panelMainText.Left, _panelMainText.Top + _panelMainText.Height);
+
+ if (_radioButtons.Count == 0)
+ {
+ _panelMainRadio.Size = Size.Empty;
+ return Size.Empty;
+ }
+
+ return _panelMainRadio.Size with { Width = _panelMainRadio.Size.Width + BUTTON_GAP + 2 };
+ }
+
+ private Size UpdateCommandSizing()
+ {
+ _panelMainCommands.Location = new Point(_panelMainRadio.Left, _panelMainRadio.Top + _panelMainRadio.Height);
+
+ if (_commandButtons.Count == 0)
+ {
+ _panelMainCommands.Size = Size.Empty;
+ return Size.Empty;
+ }
+
+ return _panelMainCommands.Size with { Width = _panelMainCommands.Size.Width + BUTTON_GAP + 2 };
+ }
+
+ private Size UpdateSpacerSizing()
+ {
+ _panelMainSpacer.Location = new Point(_panelMainCommands.Left, _panelMainCommands.Top + _panelMainCommands.Height);
+ return _panelMainSpacer.Size;
+ }
+
+ private Size UpdateButtonsSizing()
+ {
+ var numButtons = 0;
+ var maxButtonSize = Size.Empty;
+
+ // Find the size of the largest button we need
+ if ((_commonButtons & TaskDialogButtons.Close) == TaskDialogButtons.Close)
+ {
+ numButtons++;
+ Size buttonCancelSize = _buttonClose.GetPreferredSize(Size.Empty);
+ maxButtonSize.Width = Math.Max(maxButtonSize.Width, buttonCancelSize.Width + BUTTON_GAP);
+ maxButtonSize.Height = Math.Max(maxButtonSize.Height, buttonCancelSize.Height);
+ }
+
+ if ((_commonButtons & TaskDialogButtons.Retry) == TaskDialogButtons.Retry)
+ {
+ numButtons++;
+ Size buttonRetrySize = _buttonRetry.GetPreferredSize(Size.Empty);
+ maxButtonSize.Width = Math.Max(maxButtonSize.Width, buttonRetrySize.Width + BUTTON_GAP);
+ maxButtonSize.Height = Math.Max(maxButtonSize.Height, buttonRetrySize.Height);
+ }
+
+ if ((_commonButtons & TaskDialogButtons.Cancel) == TaskDialogButtons.Cancel)
+ {
+ numButtons++;
+ Size buttonCancelSize = _buttonCancel.GetPreferredSize(Size.Empty);
+ maxButtonSize.Width = Math.Max(maxButtonSize.Width, buttonCancelSize.Width + BUTTON_GAP);
+ maxButtonSize.Height = Math.Max(maxButtonSize.Height, buttonCancelSize.Height);
+ }
+
+ if ((_commonButtons & TaskDialogButtons.No) == TaskDialogButtons.No)
+ {
+ numButtons++;
+ Size buttonNoSize = _buttonNo.GetPreferredSize(Size.Empty);
+ maxButtonSize.Width = Math.Max(maxButtonSize.Width, buttonNoSize.Width + BUTTON_GAP);
+ maxButtonSize.Height = Math.Max(maxButtonSize.Height, buttonNoSize.Height);
+ }
+
+ if ((_commonButtons & TaskDialogButtons.Yes) == TaskDialogButtons.Yes)
+ {
+ numButtons++;
+ Size buttonYesSize = _buttonYes.GetPreferredSize(Size.Empty);
+ maxButtonSize.Width = Math.Max(maxButtonSize.Width, buttonYesSize.Width + BUTTON_GAP);
+ maxButtonSize.Height = Math.Max(maxButtonSize.Height, buttonYesSize.Height);
+ }
+
+ if ((_commonButtons & TaskDialogButtons.OK) == TaskDialogButtons.OK)
+ {
+ numButtons++;
+ Size buttonOKSize = _buttonOK.GetPreferredSize(Size.Empty);
+ maxButtonSize.Width = Math.Max(maxButtonSize.Width, buttonOKSize.Width + BUTTON_GAP);
+ maxButtonSize.Height = Math.Max(maxButtonSize.Height, buttonOKSize.Height);
+ }
+
+
+ // Start positioning buttons from right edge
+ var right = _panelButtons.Right - BUTTON_GAP;
+
+ if ((_commonButtons & TaskDialogButtons.Close) == TaskDialogButtons.Close)
+ {
+ _buttonClose.Location = new Point(right - maxButtonSize.Width, BUTTON_GAP);
+ _buttonClose.Size = maxButtonSize;
+ right -= maxButtonSize.Width + BUTTON_GAP;
+ }
+
+ if ((_commonButtons & TaskDialogButtons.Retry) == TaskDialogButtons.Retry)
+ {
+ _buttonRetry.Location = new Point(right - maxButtonSize.Width, BUTTON_GAP);
+ _buttonRetry.Size = maxButtonSize;
+ right -= maxButtonSize.Width + BUTTON_GAP;
+ }
+
+ if ((_commonButtons & TaskDialogButtons.Cancel) == TaskDialogButtons.Cancel)
+ {
+ _buttonCancel.Location = new Point(right - maxButtonSize.Width, BUTTON_GAP);
+ _buttonCancel.Size = maxButtonSize;
+ right -= maxButtonSize.Width + BUTTON_GAP;
+ }
+
+ if ((_commonButtons & TaskDialogButtons.No) == TaskDialogButtons.No)
+ {
+ _buttonNo.Location = new Point(right - maxButtonSize.Width, BUTTON_GAP);
+ _buttonNo.Size = maxButtonSize;
+ right -= maxButtonSize.Width + BUTTON_GAP;
+ }
+
+ if ((_commonButtons & TaskDialogButtons.Yes) == TaskDialogButtons.Yes)
+ {
+ _buttonYes.Location = new Point(right - maxButtonSize.Width, BUTTON_GAP);
+ _buttonYes.Size = maxButtonSize;
+ right -= maxButtonSize.Width + BUTTON_GAP;
+ }
+
+ if ((_commonButtons & TaskDialogButtons.OK) == TaskDialogButtons.OK)
+ {
+ _buttonOK.Location = new Point(right - maxButtonSize.Width, BUTTON_GAP);
+ _buttonOK.Size = maxButtonSize;
+ right -= maxButtonSize.Width + BUTTON_GAP;
+ }
+
+ var checkboxSize = Size.Empty;
+ if (!string.IsNullOrEmpty(_checkboxText))
+ {
+ checkboxSize = _checkBox.GetPreferredSize(Size.Empty);
+ }
+
+ if (numButtons == 0)
+ {
+ if (checkboxSize.IsEmpty)
+ {
+ _panelButtons.Visible = false;
+ return Size.Empty;
+ }
+ else
+ {
+ _panelButtons.Visible = true;
+ _checkBox.Location = new Point(BUTTON_GAP, BUTTON_GAP);
+ return new Size(checkboxSize.Width + (BUTTON_GAP * 2), checkboxSize.Height + (BUTTON_GAP * 2));
+ }
+ }
+ else
+ {
+ _panelButtons.Visible = true;
+
+ var panelButtonSize = new Size((maxButtonSize.Width * numButtons) + (BUTTON_GAP * (numButtons + 1)),
+ maxButtonSize.Height + (BUTTON_GAP * 2));
+
+ if (!checkboxSize.IsEmpty)
+ {
+ panelButtonSize.Width += checkboxSize.Width;
+ panelButtonSize.Height = Math.Max(panelButtonSize.Height, checkboxSize.Height + (BUTTON_GAP * 2));
+ _checkBox.Location = new Point(BUTTON_GAP, (panelButtonSize.Height - checkboxSize.Height) / 2);
+ }
+
+ return panelButtonSize;
+ }
+ }
+
+ private Size UpdateFooterSizing()
+ {
+ // Update size of the footer but applying a sensible maximum
+ using Graphics g = CreateGraphics();
+ // Find size of the labels when it has a maximum length of 400
+ _footerLabel.UpdateFont();
+ var footerTextSize = g.MeasureString(_footerText, _footerLabel.Font, 200).ToSize();
+ var footerHyperlinkSize = g.MeasureString(_footerHyperlink, _footerLabel.Font, 200).ToSize();
+
+ // Always add on an extra 5 pixels as sometimes the measure size does not draw the last
+ // character it contains, this ensures there is always definitely enough space for it all
+ footerTextSize.Width += 5;
+ footerHyperlinkSize.Width += 5;
+ _footerLabel.Size = footerTextSize;
+ _linkLabelFooter.Size = footerHyperlinkSize;
+
+ // Find required size of the footer panel
+ var requiredSize = Size.Empty;
+
+ if (!string.IsNullOrEmpty(_footerText))
+ {
+ requiredSize.Width += footerTextSize.Width;
+ requiredSize.Height = footerTextSize.Height;
+ }
+
+ if (!string.IsNullOrEmpty(_footerHyperlink))
+ {
+ requiredSize.Width += footerHyperlinkSize.Width;
+ requiredSize.Height = Math.Max(requiredSize.Height, footerHyperlinkSize.Height);
+ }
+
+ if ((_footerIcon != KryptonMessageBoxIcon.None) || (_customFooterIcon != null))
+ {
+ requiredSize.Width += _iconFooter.Width + BUTTON_GAP;
+ requiredSize.Height = Math.Max(requiredSize.Height, _iconFooter.Size.Height);
+ }
+
+ if (requiredSize.Width > 0)
+ {
+ requiredSize.Width += BUTTON_GAP * 2;
+ requiredSize.Height += BUTTON_GAP * 2;
+ }
+
+ // Do we have anything to show?
+ _panelFooter.Visible = requiredSize.Width > 0;
+
+ // Position the footer elements
+ if (requiredSize.Width > 0)
+ {
+ _panelFooter.Size = requiredSize;
+ var offset = BUTTON_GAP;
+
+ if ((_footerIcon != KryptonMessageBoxIcon.None) || (_customFooterIcon != null))
+ {
+ _iconFooter.Location = new Point(offset, (requiredSize.Height - _iconFooter.Height) / 2);
+ offset += _iconFooter.Width + (BUTTON_GAP / 2);
+ }
+
+ if (!string.IsNullOrEmpty(_footerText))
+ {
+ _footerLabel.Location = new Point(offset, (requiredSize.Height - footerTextSize.Height) / 2);
+ offset += _footerLabel.Width - 8;
+ }
+
+ if (!string.IsNullOrEmpty(_footerHyperlink))
+ {
+ _linkLabelFooter.Location = !string.IsNullOrEmpty(_footerText)
+ ? new Point(offset, _footerLabel.Location.Y - 1)
+ : new Point(offset, (requiredSize.Height - footerHyperlinkSize.Height) / 2);
+
+ offset += _footerLabel.Width;
+ }
+ }
+
+ return requiredSize;
+ }
+
+ private void OnRadioButtonCheckedChanged(object? sender, EventArgs e)
+ {
+ var button = sender as KryptonRadioButton;
+ _defaultRadioButton = button?.Tag as KryptonTaskDialogCommand;
+ if (_taskDialog != null)
+ {
+ _taskDialog.DefaultRadioButton = _defaultRadioButton;
+ }
+ }
+
+ private void OnCommandClicked(object? sender, EventArgs e)
+ {
+ Close();
+
+ // Update the result code from the command button
+ var button = sender as KryptonButton;
+ DialogResult = button!.DialogResult;
+
+ // Invoke any event handlers from the command button
+ var command = button.Tag as KryptonTaskDialogCommand;
+ command?.PerformExecute();
+ }
+
+ private void OnTaskDialogFormClosing(object sender, FormClosingEventArgs e)
+ {
+ // If the dialog is being closed because of a user event then it would be either
+ // Alt+F4, Hit the close chrome button or the Close common dialog button
+ if (e.CloseReason == CloseReason.UserClosing)
+ {
+ DialogResult = DialogResult.Cancel;
+ }
+ }
+
+#pragma warning disable IDE1006 // Naming Styles
+ private void checkBox_CheckedChanged(object sender, EventArgs e)
+#pragma warning restore IDE1006 // Naming Styles
+ {
+ _checkboxState = _checkBox.Checked;
+ if (_taskDialog != null)
+ {
+ _taskDialog.CheckboxState = _checkboxState;
+ }
+ }
+
+ private void LinkLabelFooter_LinkClicked(object sender, EventArgs e) => _taskDialog?.RaiseFooterHyperlinkClicked();
+
+ private void _buttonClose_Click(object sender, EventArgs e) => Close();
+
+#pragma warning disable IDE1006 // Naming Styles
+ private void button_keyDown(object sender, KeyEventArgs e)
+#pragma warning restore IDE1006 // Naming Styles
+ {
+ // Escape key kills the dialog if we allow it to be closed
+ if ((e.KeyCode == Keys.Escape) && ControlBox)
+ {
+ Close();
+ }
+ else
+ {
+ // Pressing Ctrl+C should copy message text into the clipboard
+ if (e is { Modifiers: Keys.Control, KeyCode: Keys.C })
+ {
+ var sb = new StringBuilder();
+
+ sb.AppendLine("---------------------------");
+ sb.AppendLine(_windowTitle);
+ sb.AppendLine("---------------------------");
+ sb.AppendLine(_mainInstruction);
+ sb.AppendLine("---------------------------");
+ sb.AppendLine(_content);
+ sb.AppendLine("---------------------------");
+ if (_buttonOK.Visible)
+ {
+ sb.Append(_buttonOK.Text);
+ sb.Append(" ");
+ }
+ if (_buttonYes.Visible)
+ {
+ sb.Append(_buttonYes.Text);
+ sb.Append(" ");
+ }
+ if (_buttonNo.Visible)
+ {
+ sb.Append(_buttonNo.Text);
+ sb.Append(" ");
+ }
+ if (_buttonCancel.Visible)
+ {
+ sb.Append(_buttonCancel.Text);
+ sb.Append(" ");
+ }
+ if (_buttonRetry.Visible)
+ {
+ sb.Append(_buttonRetry.Text);
+ sb.Append(" ");
+ }
+ if (_buttonClose.Visible)
+ {
+ sb.Append(_buttonClose.Text);
+ sb.Append(" ");
+ }
+ sb.AppendLine("");
+ sb.AppendLine("---------------------------");
+
+ Clipboard.SetText(sb.ToString(), TextDataFormat.Text);
+ Clipboard.SetText(sb.ToString(), TextDataFormat.UnicodeText);
+ }
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualTaskDialogForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualTaskDialogForm.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualTaskDialogForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualThemeBrowserForm.Designer.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualThemeBrowserForm.Designer.cs
new file mode 100644
index 000000000..4d350c3dc
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualThemeBrowserForm.Designer.cs
@@ -0,0 +1,412 @@
+namespace Krypton.Toolkit
+{
+ partial class VisualThemeBrowserForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ this.kcpbCustom = new Krypton.Toolkit.KryptonCustomPaletteBase(this.components);
+ this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ this.kbtnImport = new Krypton.Toolkit.KryptonButton();
+ this.kbtnOK = new Krypton.Toolkit.KryptonButton();
+ this.kbtnCancel = new Krypton.Toolkit.KryptonButton();
+ this.kchkSilent = new Krypton.Toolkit.KryptonCheckBox();
+ this.klblSelectedIndex = new Krypton.Toolkit.KryptonLabel();
+ this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge();
+ this.kryptonPanel2 = new Krypton.Toolkit.KryptonPanel();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.klblDescription = new Krypton.Toolkit.KryptonLabel();
+ this.klbThemeList = new Krypton.Toolkit.KryptonListBox();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
+ this.kryptonPanel1.SuspendLayout();
+ this.tableLayoutPanel1.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit();
+ this.kryptonPanel2.SuspendLayout();
+ this.tableLayoutPanel2.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // kcpbCustom
+ //
+ this.kcpbCustom.BaseFont = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.kcpbCustom.BasePaletteType = Krypton.Toolkit.BasePaletteType.Custom;
+ this.kcpbCustom.Ribbon.RibbonAppButton.StateNormal.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(245)))), ((int)(((byte)(248)))));
+ this.kcpbCustom.Ribbon.RibbonAppButton.StateNormal.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonAppButton.StateNormal.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonAppButton.StateNormal.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonAppButton.StateNormal.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(206)))), ((int)(((byte)(213)))), ((int)(((byte)(225)))));
+ this.kcpbCustom.Ribbon.RibbonAppButton.StatePressed.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(227)))), ((int)(((byte)(196)))));
+ this.kcpbCustom.Ribbon.RibbonAppButton.StatePressed.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonAppButton.StatePressed.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonAppButton.StatePressed.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonAppButton.StatePressed.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(136)))), ((int)(((byte)(9)))));
+ this.kcpbCustom.Ribbon.RibbonAppButton.StateTracking.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(251)))), ((int)(((byte)(230)))));
+ this.kcpbCustom.Ribbon.RibbonAppButton.StateTracking.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonAppButton.StateTracking.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonAppButton.StateTracking.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonAppButton.StateTracking.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(201)))), ((int)(((byte)(41)))));
+ this.kcpbCustom.Ribbon.RibbonAppMenuDocs.BackColor1 = System.Drawing.Color.White;
+ this.kcpbCustom.Ribbon.RibbonAppMenuDocs.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonAppMenuDocs.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonAppMenuDocs.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonAppMenuDocs.BackColor5 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonAppMenuOuter.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(195)))), ((int)(((byte)(212)))), ((int)(((byte)(235)))));
+ this.kcpbCustom.Ribbon.RibbonAppMenuOuter.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonAppMenuOuter.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonAppMenuOuter.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonAppMenuOuter.BackColor5 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGalleryBack.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(237)))), ((int)(((byte)(245)))), ((int)(((byte)(253)))));
+ this.kcpbCustom.Ribbon.RibbonGalleryBack.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGalleryBack.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGalleryBack.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGalleryBack.BackColor5 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGalleryBorder.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(177)))), ((int)(((byte)(192)))), ((int)(((byte)(214)))));
+ this.kcpbCustom.Ribbon.RibbonGalleryBorder.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGalleryBorder.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGalleryBorder.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGalleryBorder.BackColor5 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateCheckedNormal.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(159)))), ((int)(((byte)(178)))), ((int)(((byte)(199)))));
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateCheckedNormal.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateCheckedNormal.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateCheckedNormal.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateCheckedNormal.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(228)))), ((int)(((byte)(242)))));
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateContextCheckedNormal.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateContextCheckedNormal.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateContextCheckedNormal.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateContextCheckedNormal.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(228)))), ((int)(((byte)(242)))));
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateContextPressed.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(159)))), ((int)(((byte)(178)))), ((int)(((byte)(199)))));
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateContextPressed.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateContextPressed.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateContextPressed.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateContextPressed.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(228)))), ((int)(((byte)(242)))));
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateContextTracking.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(159)))), ((int)(((byte)(178)))), ((int)(((byte)(199)))));
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateContextTracking.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateContextTracking.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateContextTracking.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateContextTracking.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(228)))), ((int)(((byte)(242)))));
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateTracking.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(159)))), ((int)(((byte)(178)))), ((int)(((byte)(199)))));
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateTracking.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateTracking.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateTracking.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupArea.StateTracking.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(228)))), ((int)(((byte)(242)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateContextNormal.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(240)))), ((int)(((byte)(246)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateContextNormal.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateContextNormal.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateContextNormal.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateContextNormal.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(251)))), ((int)(((byte)(251)))), ((int)(((byte)(252)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateContextTracking.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(240)))), ((int)(((byte)(246)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateContextTracking.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateContextTracking.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateContextTracking.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateContextTracking.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(251)))), ((int)(((byte)(251)))), ((int)(((byte)(252)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateNormal.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(240)))), ((int)(((byte)(246)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateNormal.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateNormal.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateNormal.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateNormal.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(251)))), ((int)(((byte)(251)))), ((int)(((byte)(252)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateTracking.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(240)))), ((int)(((byte)(246)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateTracking.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateTracking.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateTracking.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedBorder.StateTracking.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(251)))), ((int)(((byte)(251)))), ((int)(((byte)(252)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateContextNormal.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(233)))), ((int)(((byte)(241)))), ((int)(((byte)(250)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateContextNormal.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateContextNormal.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateContextNormal.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateContextNormal.BackColor5 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateContextTracking.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(233)))), ((int)(((byte)(241)))), ((int)(((byte)(250)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateContextTracking.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateContextTracking.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateContextTracking.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateContextTracking.BackColor5 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateNormal.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(233)))), ((int)(((byte)(241)))), ((int)(((byte)(250)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateNormal.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateNormal.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateNormal.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateNormal.BackColor5 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateTracking.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(233)))), ((int)(((byte)(241)))), ((int)(((byte)(250)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateTracking.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateTracking.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateTracking.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBack.StateTracking.BackColor5 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateContextNormal.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(189)))), ((int)(((byte)(203)))), ((int)(((byte)(218)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateContextNormal.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateContextNormal.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateContextNormal.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateContextNormal.BackColor5 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateContextTracking.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(189)))), ((int)(((byte)(203)))), ((int)(((byte)(218)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateContextTracking.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateContextTracking.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateContextTracking.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateContextTracking.BackColor5 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateNormal.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(189)))), ((int)(((byte)(203)))), ((int)(((byte)(218)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateNormal.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateNormal.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateNormal.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateNormal.BackColor5 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateTracking.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(189)))), ((int)(((byte)(203)))), ((int)(((byte)(218)))));
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateTracking.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateTracking.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateTracking.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupCollapsedFrameBorder.StateTracking.BackColor5 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateContextNormal.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(240)))), ((int)(((byte)(246)))));
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateContextNormal.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateContextNormal.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateContextNormal.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateContextNormal.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(251)))), ((int)(((byte)(251)))), ((int)(((byte)(252)))));
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateContextTracking.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(240)))), ((int)(((byte)(246)))));
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateContextTracking.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateContextTracking.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateContextTracking.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateContextTracking.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(251)))), ((int)(((byte)(251)))), ((int)(((byte)(252)))));
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateNormal.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(240)))), ((int)(((byte)(246)))));
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateNormal.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateNormal.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateNormal.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateNormal.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(251)))), ((int)(((byte)(251)))), ((int)(((byte)(252)))));
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateTracking.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(240)))), ((int)(((byte)(246)))));
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateTracking.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateTracking.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateTracking.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonGroupNormalBorder.StateTracking.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(251)))), ((int)(((byte)(251)))), ((int)(((byte)(252)))));
+ this.kcpbCustom.Ribbon.RibbonQATFullbar.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(213)))), ((int)(((byte)(232)))), ((int)(((byte)(254)))));
+ this.kcpbCustom.Ribbon.RibbonQATFullbar.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonQATFullbar.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonQATFullbar.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonQATFullbar.BackColor5 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonQATMinibar.StateActive.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(154)))), ((int)(((byte)(179)))), ((int)(((byte)(213)))));
+ this.kcpbCustom.Ribbon.RibbonQATMinibar.StateActive.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonQATMinibar.StateActive.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonQATMinibar.StateActive.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonQATMinibar.StateActive.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(72)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
+ this.kcpbCustom.Ribbon.RibbonQATMinibar.StateInactive.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(153)))), ((int)(((byte)(176)))), ((int)(((byte)(206)))));
+ this.kcpbCustom.Ribbon.RibbonQATMinibar.StateInactive.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonQATMinibar.StateInactive.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonQATMinibar.StateInactive.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonQATMinibar.StateInactive.BackColor5 = System.Drawing.Color.FromArgb(((int)(((byte)(72)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
+ this.kcpbCustom.Ribbon.RibbonQATOverflow.BackColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(236)))), ((int)(((byte)(252)))));
+ this.kcpbCustom.Ribbon.RibbonQATOverflow.BackColor2 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonQATOverflow.BackColor3 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonQATOverflow.BackColor4 = System.Drawing.Color.Empty;
+ this.kcpbCustom.Ribbon.RibbonQATOverflow.BackColor5 = System.Drawing.Color.Empty;
+ this.kcpbCustom.ThemeName = null;
+ this.kcpbCustom.UseThemeFormChromeBorderWidth = Krypton.Toolkit.InheritBool.True;
+ //
+ // kryptonPanel1
+ //
+ this.kryptonPanel1.Controls.Add(this.tableLayoutPanel1);
+ this.kryptonPanel1.Controls.Add(this.klblSelectedIndex);
+ this.kryptonPanel1.Controls.Add(this.kryptonBorderEdge1);
+ this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.kryptonPanel1.Location = new System.Drawing.Point(0, 441);
+ this.kryptonPanel1.Name = "kryptonPanel1";
+ this.kryptonPanel1.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate;
+ this.kryptonPanel1.Size = new System.Drawing.Size(796, 50);
+ this.kryptonPanel1.TabIndex = 0;
+ //
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel1.ColumnCount = 4;
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel1.Controls.Add(this.kbtnImport, 0, 0);
+ this.tableLayoutPanel1.Controls.Add(this.kbtnOK, 2, 0);
+ this.tableLayoutPanel1.Controls.Add(this.kbtnCancel, 3, 0);
+ this.tableLayoutPanel1.Controls.Add(this.kchkSilent, 1, 0);
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 1);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 1;
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(796, 49);
+ this.tableLayoutPanel1.TabIndex = 17;
+ //
+ // kbtnImport
+ //
+ this.kbtnImport.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.kbtnImport.Location = new System.Drawing.Point(10, 12);
+ this.kbtnImport.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnImport.Name = "kbtnImport";
+ this.kbtnImport.Size = new System.Drawing.Size(90, 25);
+ this.kbtnImport.TabIndex = 1;
+ this.kbtnImport.Values.DropDownArrowColor = System.Drawing.Color.Empty;
+ this.kbtnImport.Values.Text = "&Import...";
+ this.kbtnImport.Click += new System.EventHandler(this.kbtnImport_Click);
+ //
+ // kbtnOK
+ //
+ this.kbtnOK.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.kbtnOK.Location = new System.Drawing.Point(586, 12);
+ this.kbtnOK.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnOK.Name = "kbtnOK";
+ this.kbtnOK.Size = new System.Drawing.Size(90, 25);
+ this.kbtnOK.TabIndex = 3;
+ this.kbtnOK.Values.DropDownArrowColor = System.Drawing.Color.Empty;
+ this.kbtnOK.Values.Text = "O&K";
+ this.kbtnOK.Values.UseAsADialogButton = true;
+ this.kbtnOK.Click += new System.EventHandler(this.kbtnOK_Click);
+ //
+ // kbtnCancel
+ //
+ this.kbtnCancel.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.kbtnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this.kbtnCancel.Location = new System.Drawing.Point(696, 12);
+ this.kbtnCancel.Margin = new System.Windows.Forms.Padding(10);
+ this.kbtnCancel.Name = "kbtnCancel";
+ this.kbtnCancel.Size = new System.Drawing.Size(90, 25);
+ this.kbtnCancel.TabIndex = 2;
+ this.kbtnCancel.Values.DropDownArrowColor = System.Drawing.Color.Empty;
+ this.kbtnCancel.Values.Text = "Cance&l";
+ this.kbtnCancel.Values.UseAsADialogButton = true;
+ this.kbtnCancel.Click += new System.EventHandler(this.kbtnCancel_Click);
+ //
+ // kchkSilent
+ //
+ this.kchkSilent.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.kchkSilent.Location = new System.Drawing.Point(120, 14);
+ this.kchkSilent.Margin = new System.Windows.Forms.Padding(10);
+ this.kchkSilent.Name = "kchkSilent";
+ this.kchkSilent.Size = new System.Drawing.Size(54, 20);
+ this.kchkSilent.TabIndex = 13;
+ this.kchkSilent.Values.Text = "&Silent";
+ //
+ // klblSelectedIndex
+ //
+ this.klblSelectedIndex.Location = new System.Drawing.Point(170, 13);
+ this.klblSelectedIndex.Name = "klblSelectedIndex";
+ this.klblSelectedIndex.Size = new System.Drawing.Size(6, 2);
+ this.klblSelectedIndex.TabIndex = 15;
+ this.klblSelectedIndex.Values.Text = "";
+ this.klblSelectedIndex.Visible = false;
+ //
+ // kryptonBorderEdge1
+ //
+ this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderSecondary;
+ this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0);
+ this.kryptonBorderEdge1.Name = "kryptonBorderEdge1";
+ this.kryptonBorderEdge1.Size = new System.Drawing.Size(796, 1);
+ this.kryptonBorderEdge1.Text = "kryptonBorderEdge1";
+ //
+ // kryptonPanel2
+ //
+ this.kryptonPanel2.Controls.Add(this.tableLayoutPanel2);
+ this.kryptonPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.kryptonPanel2.Location = new System.Drawing.Point(0, 0);
+ this.kryptonPanel2.Name = "kryptonPanel2";
+ this.kryptonPanel2.Size = new System.Drawing.Size(796, 441);
+ this.kryptonPanel2.TabIndex = 1;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent;
+ this.tableLayoutPanel2.ColumnCount = 1;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Controls.Add(this.klblDescription, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.klbThemeList, 0, 1);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 0);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 2;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(796, 441);
+ this.tableLayoutPanel2.TabIndex = 2;
+ //
+ // klblDescription
+ //
+ this.klblDescription.LabelStyle = Krypton.Toolkit.LabelStyle.BoldPanel;
+ this.klblDescription.Location = new System.Drawing.Point(10, 10);
+ this.klblDescription.Margin = new System.Windows.Forms.Padding(10);
+ this.klblDescription.Name = "klblDescription";
+ this.klblDescription.Size = new System.Drawing.Size(94, 20);
+ this.klblDescription.TabIndex = 1;
+ this.klblDescription.Values.Text = "kryptonLabel1";
+ //
+ // klbThemeList
+ //
+ this.klbThemeList.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.klbThemeList.Location = new System.Drawing.Point(10, 50);
+ this.klbThemeList.Margin = new System.Windows.Forms.Padding(10);
+ this.klbThemeList.Name = "klbThemeList";
+ this.klbThemeList.Size = new System.Drawing.Size(776, 381);
+ this.klbThemeList.TabIndex = 0;
+ this.klbThemeList.SelectedIndexChanged += new System.EventHandler(this.klbThemeList_SelectedIndexChanged);
+ //
+ // VisualThemeBrowserForm
+ //
+ this.AcceptButton = this.kbtnOK;
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.CancelButton = this.kbtnCancel;
+ this.ClientSize = new System.Drawing.Size(796, 491);
+ this.Controls.Add(this.kryptonPanel2);
+ this.Controls.Add(this.kryptonPanel1);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "VisualThemeBrowserForm";
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.Text = "Select a Theme";
+ this.UseThemeFormChromeBorderWidth = false;
+ this.Load += new System.EventHandler(this.KryptonThemeBrowserForm_Load);
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
+ this.kryptonPanel1.ResumeLayout(false);
+ this.kryptonPanel1.PerformLayout();
+ this.tableLayoutPanel1.ResumeLayout(false);
+ this.tableLayoutPanel1.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit();
+ this.kryptonPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private KryptonCustomPaletteBase kcpbCustom;
+ private KryptonPanel kryptonPanel1;
+ private KryptonPanel kryptonPanel2;
+ private KryptonBorderEdge kryptonBorderEdge1;
+ private KryptonButton kbtnImport;
+ private KryptonButton kbtnCancel;
+ private KryptonListBox klbThemeList;
+ private KryptonButton kbtnOK;
+ private KryptonCheckBox kchkSilent;
+ private KryptonLabel klblDescription;
+ private KryptonLabel klblSelectedIndex;
+ private TableLayoutPanel tableLayoutPanel1;
+ private TableLayoutPanel tableLayoutPanel2;
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualThemeBrowserForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualThemeBrowserForm.cs
new file mode 100644
index 000000000..8aa2cfead
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualThemeBrowserForm.cs
@@ -0,0 +1,89 @@
+#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. 2023 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+namespace Krypton.Toolkit
+{
+ internal partial class VisualThemeBrowserForm : KryptonForm
+ {
+ #region Instance Fields
+
+ private readonly KryptonThemeBrowserData _themeBrowserData;
+
+ #endregion
+
+ #region Identity
+
+ /// Initializes a new instance of the class.
+ /// The data to provide to the .
+ public VisualThemeBrowserForm(KryptonThemeBrowserData themeBrowserData)
+ {
+ InitializeComponent();
+
+ _themeBrowserData = themeBrowserData;
+
+ AdjustUI();
+ }
+
+ #endregion
+
+ #region Implementation
+
+ private void AdjustUI()
+ {
+ Text = _themeBrowserData.WindowTitle;
+
+ kbtnImport.Visible = _themeBrowserData.ShowImportButton ?? false;
+
+ kchkSilent.Visible = _themeBrowserData.ShowSilentOption ?? false;
+
+ StartPosition = _themeBrowserData.StartPosition ?? FormStartPosition.CenterScreen;
+
+ //klbThemeList.SelectedIndex = _startIndex;
+
+ klblDescription.Text = KryptonManager.Strings.MiscellaneousThemeStrings.ThemeBrowserDescription;
+
+ kbtnImport.Text = KryptonManager.Strings.MiscellaneousThemeStrings.Import;
+
+ kchkSilent.Text = KryptonManager.Strings.MiscellaneousThemeStrings.Silent;
+
+ kbtnCancel.Text = KryptonManager.Strings.GeneralStrings.Cancel;
+
+ kbtnOK.Text = KryptonManager.Strings.GeneralStrings.OK;
+ }
+
+ private void kbtnImport_Click(object sender, EventArgs e) => kcpbCustom.Import(kchkSilent.Checked);
+
+ private void KryptonThemeBrowserForm_Load(object sender, EventArgs e)
+ {
+ foreach (var themeName in ThemeManager.SupportedInternalThemeNames)
+ {
+ if (themeName != null)
+ {
+ klbThemeList.Items.Add(themeName);
+ }
+ }
+
+ klbThemeList.SelectedItem = _themeBrowserData.StartIndex;
+ }
+
+ private void kbtnOK_Click(object sender, EventArgs e) => DialogResult = DialogResult.OK;
+
+ private void kbtnCancel_Click(object sender, EventArgs e) => DialogResult = DialogResult.Cancel;
+
+ private void klbThemeList_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ ThemeManager.ApplyTheme(klbThemeList.GetItemText(klbThemeList.SelectedItem)!, new KryptonManager());
+
+ SetIndexText($@"{klbThemeList.GetItemText(klbThemeList.SelectedItem)} - Index: {klbThemeList.SelectedIndex}");
+ }
+
+ private void SetIndexText(string v) => klblSelectedIndex.Text = v;
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualThemeBrowserForm.resx b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualThemeBrowserForm.resx
new file mode 100644
index 000000000..28b419daf
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualThemeBrowserForm.resx
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 17, 17
+
+
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/ButtonSpecFormFixedConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/ButtonSpecFormFixedConverter.cs
index e8deee38d..6789a994f 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Converters/ButtonSpecFormFixedConverter.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Converters/ButtonSpecFormFixedConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/ButtonStyleConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/ButtonStyleConverter.cs
index 18d9b8cf4..46f819bb8 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Converters/ButtonStyleConverter.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Converters/ButtonStyleConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,7 +20,8 @@ internal class ButtonStyleConverter : StringLookupConverter
#region Static Fields
[Localizable(true)]
- private static readonly IReadOnlyDictionary _pairs = new Dictionary
+ private static readonly BiDictionary _pairs = new BiDictionary(
+ new Dictionary
{
{ButtonStyle.Standalone, DesignTimeUtilities.DEFAULT_BUTTON_SPEC_STYLE_STANDALONE},
{ButtonStyle.Alternate, DesignTimeUtilities.DEFAULT_BUTTON_SPEC_STYLE_ALTERNATE},
@@ -41,7 +42,7 @@ internal class ButtonStyleConverter : StringLookupConverter
{ButtonStyle.Custom1, DesignTimeUtilities.DEFAULT_BUTTON_SPEC_STYLE_CUSTOM_ONE},
{ButtonStyle.Custom2, DesignTimeUtilities.DEFAULT_BUTTON_SPEC_STYLE_CUSTOM_TWO},
{ButtonStyle.Custom3, DesignTimeUtilities.DEFAULT_BUTTON_SPEC_STYLE_CUSTOM_THREE}
- };
+ });
#endregion
@@ -50,7 +51,8 @@ internal class ButtonStyleConverter : StringLookupConverter
///
/// Gets an array of lookup pairs.
///
- protected override IReadOnlyDictionary Pairs => _pairs;
+ protected override IReadOnlyDictionary PairsEnumToString => _pairs.FirstToSecond;
+ protected override IReadOnlyDictionary PairsStringToEnum => _pairs.SecondToFirst;
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/DataGridViewStyleConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/DataGridViewStyleConverter.cs
index 2f213cc17..e09fa8166 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Converters/DataGridViewStyleConverter.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Converters/DataGridViewStyleConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,7 +20,8 @@ internal class DataGridViewStyleConverter : StringLookupConverter _pairs = new Dictionary
+ private static readonly BiDictionary _pairs = new BiDictionary(
+ new Dictionary
{
{DataGridViewStyle.List, DesignTimeUtilities.DEFAULT_DATA_GRID_VIEW_STYLE_LIST},
{DataGridViewStyle.Sheet, DesignTimeUtilities.DEFAULT_DATA_GRID_VIEW_STYLE_SHEET},
@@ -28,7 +29,7 @@ internal class DataGridViewStyleConverter : StringLookupConverter
/// Gets an array of lookup pairs.
///
- protected override IReadOnlyDictionary Pairs => _pairs;
+ protected override IReadOnlyDictionary PairsEnumToString => _pairs.FirstToSecond;
+ protected override IReadOnlyDictionary PairsStringToEnum => _pairs.SecondToFirst;
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/DateTimeNullableConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/DateTimeNullableConverter.cs
index 42d961b0e..42fe9b7fe 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Converters/DateTimeNullableConverter.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Converters/DateTimeNullableConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -41,7 +41,7 @@ public DateTimeNullableConverter()
// We allow an empty string or a string with DBNull/null/Nothing to be converted to a DBNull value.
if (value is string)
{
- var stringValue = value.ToString().ToLower();
+ var stringValue = value.ToString()!.ToLower();
if (stringValue is "dbnull" or "null" or "nothing")
{
return DBNull.Value;
diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/GridStyleConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/GridStyleConverter.cs
index 84f290198..de22db4f1 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Converters/GridStyleConverter.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Converters/GridStyleConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,14 +20,15 @@ internal class GridStyleConverter : StringLookupConverter
#region Static Fields
[Localizable(true)]
- private static readonly IReadOnlyDictionary _pairs = new Dictionary
+ private static readonly BiDictionary _pairs = new BiDictionary(
+ new Dictionary
{
{GridStyle.List, DesignTimeUtilities.DEFAULT_GRID_STYLE_LIST},
{GridStyle.Sheet, DesignTimeUtilities.DEFAULT_GRID_STYLE_SHEET},
{GridStyle.Custom1, DesignTimeUtilities.DEFAULT_GRID_STYLE_CUSTOM_ONE},
{GridStyle.Custom2, DesignTimeUtilities.DEFAULT_GRID_STYLE_CUSTOM_TWO},
{GridStyle.Custom3, DesignTimeUtilities.DEFAULT_GRID_STYLE_CUSTOM_THREE}
- };
+ });
#endregion
@@ -36,7 +37,8 @@ internal class GridStyleConverter : StringLookupConverter
///
/// Gets an array of lookup pairs.
///
- protected override IReadOnlyDictionary Pairs => _pairs;
+ protected override IReadOnlyDictionary PairsEnumToString => _pairs.FirstToSecond;
+ protected override IReadOnlyDictionary PairsStringToEnum => _pairs.SecondToFirst;
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/HeaderGroupCollapseTargetConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/HeaderGroupCollapseTargetConverter.cs
index f45efa56b..8684e2eec 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Converters/HeaderGroupCollapseTargetConverter.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Converters/HeaderGroupCollapseTargetConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,12 +20,13 @@ internal class HeaderGroupCollapsedTargetConverter : StringLookupConverter _pairs = new Dictionary
+ private static readonly BiDictionary _pairs = new BiDictionary(
+ new Dictionary
{
{ HeaderGroupCollapsedTarget.CollapsedToPrimary, DesignTimeUtilities.DEFAULT_HEADER_GROUP_COLLAPSED_TARGET_COLLAPSED_TO_PRIMARY},
{HeaderGroupCollapsedTarget.CollapsedToSecondary, DesignTimeUtilities.DEFAULT_HEADER_GROUP_COLLAPSED_TARGET_COLLAPSED_TO_SECONDARY},
{HeaderGroupCollapsedTarget.CollapsedToBoth, DesignTimeUtilities.DEFAULT_HEADER_GROUP_COLLAPSED_TARGET_COLLAPSED_TO_BOTH}
- };
+ });
#endregion
@@ -34,7 +35,8 @@ internal class HeaderGroupCollapsedTargetConverter : StringLookupConverter
/// Gets an array of lookup pairs.
///
- protected override IReadOnlyDictionary Pairs => _pairs;
+ protected override IReadOnlyDictionary PairsEnumToString => _pairs.FirstToSecond;
+ protected override IReadOnlyDictionary PairsStringToEnum => _pairs.SecondToFirst;
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/HeaderStyleConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/HeaderStyleConverter.cs
index 7fd25c1b1..f79b25a86 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Converters/HeaderStyleConverter.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Converters/HeaderStyleConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,7 +20,8 @@ internal class HeaderStyleConverter : StringLookupConverter
#region Static Fields
[Localizable(true)]
- private static readonly IReadOnlyDictionary _pairs = new Dictionary
+ private static readonly BiDictionary _pairs = new BiDictionary(
+ new Dictionary
{
{HeaderStyle.Primary, DesignTimeUtilities.DEFAULT_HEADER_STYLE_PRIMARY},
{HeaderStyle.Secondary, DesignTimeUtilities.DEFAULT_HEADER_STYLE_SECONDARY},
@@ -31,7 +32,7 @@ internal class HeaderStyleConverter : StringLookupConverter
{HeaderStyle.Custom1, DesignTimeUtilities.DEFAULT_HEADER_STYLE_CUSTOM_ONE},
{HeaderStyle.Custom2, DesignTimeUtilities.DEFAULT_HEADER_STYLE_CUSTOM_TWO},
{HeaderStyle.Custom3, DesignTimeUtilities.DEFAULT_HEADER_STYLE_CUSTOM_THREE}
- };
+ });
#endregion
@@ -39,7 +40,8 @@ internal class HeaderStyleConverter : StringLookupConverter
///
/// Gets an array of lookup pairs.
///
- protected override IReadOnlyDictionary Pairs => _pairs;
+ protected override IReadOnlyDictionary PairsEnumToString => _pairs.FirstToSecond;
+ protected override IReadOnlyDictionary PairsStringToEnum => _pairs.SecondToFirst;
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/InputControlStyleConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/InputControlStyleConverter.cs
index 125219651..6e30e619a 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Converters/InputControlStyleConverter.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Converters/InputControlStyleConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,7 +20,8 @@ internal class InputControlStyleConverter : StringLookupConverter _pairs = new Dictionary
+ private static readonly BiDictionary _pairs = new BiDictionary(
+ new Dictionary
{
{InputControlStyle.Standalone, DesignTimeUtilities.DEFAULT_INPUT_CONTROL_STYLE_STANDALONE},
{InputControlStyle.Ribbon, DesignTimeUtilities.DEFAULT_INPUT_CONTROL_STYLE_RIBBON},
@@ -28,9 +29,9 @@ internal class InputControlStyleConverter : StringLookupConverter
/// Gets an array of lookup pairs.
///
- protected override IReadOnlyDictionary Pairs => _pairs;
+ protected override IReadOnlyDictionary PairsEnumToString => _pairs.FirstToSecond;
+ protected override IReadOnlyDictionary PairsStringToEnum => _pairs.SecondToFirst;
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/KryptonCheckedButtonConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/KryptonCheckedButtonConverter.cs
index 731d89bac..4f9549b85 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Converters/KryptonCheckedButtonConverter.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Converters/KryptonCheckedButtonConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/KryptonLinkBehaviorConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/KryptonLinkBehaviorConverter.cs
index 7e47bd433..d9390256b 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Converters/KryptonLinkBehaviorConverter.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Converters/KryptonLinkBehaviorConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,12 +20,13 @@ internal class KryptonLinkBehaviorConverter : StringLookupConverter _pairs = new Dictionary
+ private static readonly BiDictionary _pairs = new BiDictionary(
+ new Dictionary
{
{KryptonLinkBehavior.AlwaysUnderline, DesignTimeUtilities.DEFAULT_LINK_BEHAVIOR_ALWAYS_UNDERLINE},
{KryptonLinkBehavior.HoverUnderline, DesignTimeUtilities.DEFAULT_LINK_BEHAVIOR_HOVER_UNDERLINE},
{KryptonLinkBehavior.NeverUnderline, DesignTimeUtilities.DEFAULT_LINK_BEHAVIOR_NEVER_UNDERLINE}
- };
+ });
#endregion
@@ -33,7 +34,8 @@ internal class KryptonLinkBehaviorConverter : StringLookupConverter
/// Gets an array of lookup pairs.
///
- protected override IReadOnlyDictionary Pairs => _pairs;
+ protected override IReadOnlyDictionary PairsEnumToString => _pairs.FirstToSecond;
+ protected override IReadOnlyDictionary PairsStringToEnum => _pairs.SecondToFirst;
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/KryptonMessageBoxIconConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/KryptonMessageBoxIconConverter.cs
new file mode 100644
index 000000000..caf828506
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Converters/KryptonMessageBoxIconConverter.cs
@@ -0,0 +1,57 @@
+#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. 2023 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+namespace Krypton.Toolkit
+{
+ /// Custom type converter so that values appear as neat text at design time.
+ internal class KryptonMessageBoxIconConverter : StringLookupConverter
+ {
+ #region Static Fields
+
+ [Localizable(true)]
+ private static readonly BiDictionary _iconPairs =
+ new BiDictionary(new Dictionary
+ {
+ { KryptonMessageBoxIcon.None, DesignTimeUtilities.DEFAULT_ICON_NONE },
+ { KryptonMessageBoxIcon.Hand, DesignTimeUtilities.DEFAULT_ICON_HAND },
+ { KryptonMessageBoxIcon.SystemHand, DesignTimeUtilities.DEFAULT_ICON_SYSTEM_HAND },
+ { KryptonMessageBoxIcon.Question, DesignTimeUtilities.DEFAULT_ICON_QUESTION },
+ { KryptonMessageBoxIcon.SystemQuestion, DesignTimeUtilities.DEFAULT_ICON_SYSTEM_QUESTION },
+ { KryptonMessageBoxIcon.Exclamation, DesignTimeUtilities.DEFAULT_ICON_EXCLAMATION },
+ { KryptonMessageBoxIcon.SystemExclamation, DesignTimeUtilities.DEFAULT_ICON_SYSTEM_EXCLAMATION },
+ { KryptonMessageBoxIcon.Asterisk, DesignTimeUtilities.DEFAULT_ICON_ASTERISK },
+ { KryptonMessageBoxIcon.SystemAsterisk, DesignTimeUtilities.DEFAULT_ICON_SYSTEM_ASTERISK },
+ { KryptonMessageBoxIcon.Stop, DesignTimeUtilities.DEFAULT_ICON_STOP },
+ { KryptonMessageBoxIcon.SystemStop, DesignTimeUtilities.DEFAULT_ICON_SYSTEM_STOP },
+ { KryptonMessageBoxIcon.Error, DesignTimeUtilities.DEFAULT_ICON_ERROR },
+ { KryptonMessageBoxIcon.SystemError, DesignTimeUtilities.DEFAULT_ICON_SYSTEM_ERROR },
+ { KryptonMessageBoxIcon.Warning, DesignTimeUtilities.DEFAULT_ICON_WARNING },
+ { KryptonMessageBoxIcon.SystemWarning, DesignTimeUtilities.DEFAULT_ICON_SYSTEM_WARNING },
+ { KryptonMessageBoxIcon.Information, DesignTimeUtilities.DEFAULT_ICON_INFORMATION },
+ { KryptonMessageBoxIcon.SystemInformation, DesignTimeUtilities.DEFAULT_ICON_SYSTEM_INFORMATION },
+ { KryptonMessageBoxIcon.Shield, DesignTimeUtilities.DEFAULT_ICON_SHIELD },
+ { KryptonMessageBoxIcon.WindowsLogo, DesignTimeUtilities.DEFAULT_ICON_WINDOWS_LOGO },
+ { KryptonMessageBoxIcon.Application, DesignTimeUtilities.DEFAULT_ICON_APPLICATION },
+ { KryptonMessageBoxIcon.SystemApplication, DesignTimeUtilities.DEFAULT_ICON_SYSTEM_APPLICATION }
+ });
+
+ #endregion
+
+ #region Protected
+
+ /// Gets an array of lookup pairs.
+ protected override IReadOnlyDictionary PairsStringToEnum => _iconPairs.SecondToFirst;
+
+ /// Gets the pairs enum to string.
+ /// The pairs enum to string.
+ protected override IReadOnlyDictionary PairsEnumToString => _iconPairs.FirstToSecond;
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/KryptonToastNotificationIconConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/KryptonToastNotificationIconConverter.cs
new file mode 100644
index 000000000..a449e3bae
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Converters/KryptonToastNotificationIconConverter.cs
@@ -0,0 +1,59 @@
+#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. 2023 - 2024. All rights reserved.
+ *
+ */
+#endregion
+
+namespace Krypton.Toolkit
+{
+ /// Custom type converter so that values appear as neat text at design time.
+ internal class KryptonToastNotificationIconConverter : StringLookupConverter
+ {
+ #region Static Fields
+
+ [Localizable(true)]
+ private static readonly BiDictionary _iconPairs =
+ new BiDictionary(new Dictionary
+ {
+ { KryptonToastNotificationIcon.None, DesignTimeUtilities.DEFAULT_ICON_NONE },
+ { KryptonToastNotificationIcon.Hand, DesignTimeUtilities.DEFAULT_ICON_HAND },
+ { KryptonToastNotificationIcon.SystemHand, DesignTimeUtilities.DEFAULT_ICON_SYSTEM_HAND },
+ { KryptonToastNotificationIcon.Question, DesignTimeUtilities.DEFAULT_ICON_QUESTION },
+ { KryptonToastNotificationIcon.SystemQuestion, DesignTimeUtilities.DEFAULT_ICON_SYSTEM_QUESTION },
+ { KryptonToastNotificationIcon.Exclamation, DesignTimeUtilities.DEFAULT_ICON_EXCLAMATION },
+ { KryptonToastNotificationIcon.SystemExclamation, DesignTimeUtilities.DEFAULT_ICON_SYSTEM_EXCLAMATION },
+ { KryptonToastNotificationIcon.Asterisk, DesignTimeUtilities.DEFAULT_ICON_ASTERISK },
+ { KryptonToastNotificationIcon.SystemAsterisk, DesignTimeUtilities.DEFAULT_ICON_SYSTEM_ASTERISK },
+ { KryptonToastNotificationIcon.Stop, DesignTimeUtilities.DEFAULT_ICON_STOP },
+ { KryptonToastNotificationIcon.SystemStop, DesignTimeUtilities.DEFAULT_ICON_SYSTEM_STOP },
+ { KryptonToastNotificationIcon.Error, DesignTimeUtilities.DEFAULT_ICON_ERROR },
+ { KryptonToastNotificationIcon.SystemError, DesignTimeUtilities.DEFAULT_ICON_SYSTEM_ERROR },
+ { KryptonToastNotificationIcon.Warning, DesignTimeUtilities.DEFAULT_ICON_WARNING },
+ { KryptonToastNotificationIcon.SystemWarning, DesignTimeUtilities.DEFAULT_ICON_SYSTEM_WARNING },
+ { KryptonToastNotificationIcon.Information, DesignTimeUtilities.DEFAULT_ICON_INFORMATION },
+ { KryptonToastNotificationIcon.SystemInformation, DesignTimeUtilities.DEFAULT_ICON_SYSTEM_INFORMATION },
+ { KryptonToastNotificationIcon.Shield, DesignTimeUtilities.DEFAULT_ICON_SHIELD },
+ { KryptonToastNotificationIcon.WindowsLogo, DesignTimeUtilities.DEFAULT_ICON_WINDOWS_LOGO },
+ { KryptonToastNotificationIcon.Application, DesignTimeUtilities.DEFAULT_ICON_APPLICATION },
+ { KryptonToastNotificationIcon.SystemApplication, DesignTimeUtilities.DEFAULT_ICON_SYSTEM_APPLICATION },
+ { KryptonToastNotificationIcon.Ok, DesignTimeUtilities.DEFAULT_ICON_OK },
+ { KryptonToastNotificationIcon.Custom, DesignTimeUtilities.DEFAULT_ICON_CUSTOM }
+ });
+
+ #endregion
+
+ #region Protected
+
+ /// Gets an array of lookup pairs.
+ protected override IReadOnlyDictionary PairsStringToEnum => _iconPairs.SecondToFirst;
+
+ /// Gets the pairs enum to string.
+ /// The pairs enum to string.
+ protected override IReadOnlyDictionary PairsEnumToString => _iconPairs.FirstToSecond;
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/LabelStyleConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/LabelStyleConverter.cs
index 9fcdc422a..e53ea3f4a 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Converters/LabelStyleConverter.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Converters/LabelStyleConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,7 +20,8 @@ internal class LabelStyleConverter : StringLookupConverter
#region Static Fields
[Localizable(true)]
- private static readonly IReadOnlyDictionary _pairs = new Dictionary
+ private static readonly BiDictionary _pairs = new BiDictionary(
+ new Dictionary
{
{LabelStyle.AlternateControl, DesignTimeUtilities.DEFAULT_LABEL_STYLE_ALTERNATE_CONTROL},
{LabelStyle.NormalControl, DesignTimeUtilities.DEFAULT_LABEL_STYLE_NORMAL_CONTROL},
@@ -39,7 +40,7 @@ internal class LabelStyleConverter : StringLookupConverter
{LabelStyle.Custom1, DesignTimeUtilities.DEFAULT_LABEL_STYLE_CUSTOM_ONE},
{LabelStyle.Custom2, DesignTimeUtilities.DEFAULT_LABEL_STYLE_CUSTOM_TWO},
{LabelStyle.Custom3, DesignTimeUtilities.DEFAULT_LABEL_STYLE_CUSTOM_THREE}
- };
+ });
#endregion
@@ -48,7 +49,8 @@ internal class LabelStyleConverter : StringLookupConverter
///
/// Gets an array of lookup pairs.
///
- protected override IReadOnlyDictionary Pairs => _pairs;
+ protected override IReadOnlyDictionary PairsEnumToString => _pairs.FirstToSecond;
+ protected override IReadOnlyDictionary PairsStringToEnum => _pairs.SecondToFirst;
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteBackStyleConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteBackStyleConverter.cs
index 50c935afa..5ea4e2395 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteBackStyleConverter.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteBackStyleConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,7 +20,8 @@ internal class PaletteBackStyleConverter : StringLookupConverter _pairs = new Dictionary
+ private static readonly BiDictionary _pairs = new BiDictionary(
+ new Dictionary
{
{PaletteBackStyle.ButtonStandalone, DesignTimeUtilities.DEFAULT_BUTTON_STANDALONE},
{PaletteBackStyle.ButtonAlternate, DesignTimeUtilities.DEFAULT_BUTTON_ALTERNATE},
@@ -115,7 +116,7 @@ internal class PaletteBackStyleConverter : StringLookupConverter
/// Gets an array of lookup pairs.
///
- protected override IReadOnlyDictionary Pairs => _pairs;
+ protected override IReadOnlyDictionary PairsEnumToString => _pairs.FirstToSecond;
+ protected override IReadOnlyDictionary PairsStringToEnum => _pairs.SecondToFirst;
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteBorderStyleConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteBorderStyleConverter.cs
index 57f9fd86b..01f01d306 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteBorderStyleConverter.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteBorderStyleConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,7 +20,8 @@ internal class PaletteBorderStyleConverter : StringLookupConverter _pairs = new Dictionary
+ private static readonly BiDictionary _pairs = new BiDictionary(
+ new Dictionary
{
{PaletteBorderStyle.ButtonStandalone, DesignTimeUtilities.DEFAULT_PALETTE_BORDER_BUTTON_STANDALONE},
{PaletteBorderStyle.ButtonAlternate, DesignTimeUtilities.DEFAULT_PALETTE_BORDER_BUTTON_ALTERNATE},
@@ -102,8 +103,8 @@ internal class PaletteBorderStyleConverter : StringLookupConverter
/// Gets an array of lookup pairs.
///
- protected override IReadOnlyDictionary Pairs => _pairs;
+ protected override IReadOnlyDictionary PairsEnumToString => _pairs.FirstToSecond;
+ protected override IReadOnlyDictionary PairsStringToEnum => _pairs.SecondToFirst;
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteButtonOrientationConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteButtonOrientationConverter.cs
index 87dd7fa33..82c896ea8 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteButtonOrientationConverter.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteButtonOrientationConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,7 +20,8 @@ internal class PaletteButtonOrientationConverter : StringLookupConverter _pairs = new Dictionary
+ private static readonly BiDictionary _pairs = new BiDictionary(
+ new Dictionary
{
{PaletteButtonOrientation.Inherit, DesignTimeUtilities.DEFAULT_PALETTE_BUTTON_ORIENTATION_INHERIT},
{PaletteButtonOrientation.Auto, DesignTimeUtilities.DEFAULT_PALETTE_BUTTON_ORIENTATION_AUTO},
@@ -28,7 +29,7 @@ internal class PaletteButtonOrientationConverter : StringLookupConverter
/// Gets an array of lookup pairs.
///
- protected override IReadOnlyDictionary Pairs => _pairs;
+ protected override IReadOnlyDictionary PairsEnumToString => _pairs.FirstToSecond;
+ protected override IReadOnlyDictionary PairsStringToEnum => _pairs.SecondToFirst;
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteButtonSpecStyleConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteButtonSpecStyleConverter.cs
index 32598682c..355e8e0d3 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteButtonSpecStyleConverter.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteButtonSpecStyleConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,7 +20,8 @@ internal class PaletteButtonSpecStyleConverter : StringLookupConverter _pairs = new Dictionary
+ private static readonly BiDictionary _pairs = new BiDictionary(
+ new Dictionary
{
{PaletteButtonSpecStyle.Close, DesignTimeUtilities.DEFAULT_PALETTE_BUTTON_SPEC_STYLE_CLOSE},
{PaletteButtonSpecStyle.Context, DesignTimeUtilities.DEFAULT_PALETTE_BUTTON_SPEC_STYLE_CONTEXT},
@@ -60,7 +61,7 @@ internal class PaletteButtonSpecStyleConverter : StringLookupConverter
/// Gets an array of lookup pairs.
///
- protected override IReadOnlyDictionary Pairs => _pairs;
+ protected override IReadOnlyDictionary PairsEnumToString => _pairs.FirstToSecond;
+ protected override IReadOnlyDictionary PairsStringToEnum => _pairs.SecondToFirst;
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteButtonStyleConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteButtonStyleConverter.cs
index a21d38d5c..f50626654 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteButtonStyleConverter.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteButtonStyleConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,7 +20,8 @@ internal class PaletteButtonStyleConverter : StringLookupConverter _pairs = new Dictionary
+ private static readonly BiDictionary _pairs = new BiDictionary(
+ new Dictionary
{
{PaletteButtonStyle.Inherit, DesignTimeUtilities.DEFAULT_PALETTE_BUTTON_STYLE_INHERIT},
{PaletteButtonStyle.Standalone, DesignTimeUtilities.DEFAULT_PALETTE_BUTTON_STYLE_STANDALONE},
@@ -40,7 +41,7 @@ internal class PaletteButtonStyleConverter : StringLookupConverter
/// Gets an array of lookup pairs.
///
- protected override IReadOnlyDictionary Pairs => _pairs;
+ protected override IReadOnlyDictionary PairsEnumToString => _pairs.FirstToSecond;
+ protected override IReadOnlyDictionary PairsStringToEnum => _pairs.SecondToFirst;
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteClassTypeConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteClassTypeConverter.cs
new file mode 100644
index 000000000..22924e229
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteClassTypeConverter.cs
@@ -0,0 +1,128 @@
+namespace Krypton.Toolkit.Converters;
+
+///
+/// Custom type converter so that PaletteBase Class type are converted to their appropriate mode type
+///
+internal class PaletteClassTypeConverter : EnumConverter
+{
+ #region Static Fields
+
+ [Localizable(true)]
+ private static readonly BiDictionary _pairs = new BiDictionary
+ (new Dictionary
+ {
+ {PaletteMode.ProfessionalSystem, typeof(PaletteProfessionalSystem)},
+ {PaletteMode.ProfessionalOffice2003, typeof(PaletteProfessionalOffice2003)},
+ {PaletteMode.Office2007Blue, typeof(PaletteOffice2007Blue)},
+ //{PaletteMode.Office2007DarkGray, typeof(PaletteOffice2007DarkGray)},
+ {PaletteMode.Office2007BlueDarkMode, typeof(PaletteOffice2007BlueDarkMode)},
+ {PaletteMode.Office2007BlueLightMode, typeof(PaletteOffice2007BlueLightMode)},
+ {PaletteMode.Office2007Silver, typeof(PaletteOffice2007Silver)},
+ {PaletteMode.Office2007SilverDarkMode, typeof(PaletteOffice2007SilverDarkMode)},
+ {PaletteMode.Office2007SilverLightMode, typeof(PaletteOffice2007SilverLightMode)},
+ {PaletteMode.Office2007White, typeof(PaletteOffice2007White)},
+ {PaletteMode.Office2007Black, typeof(PaletteOffice2007Black)},
+ //{PaletteMode.Office2010DarkGray, typeof(PaletteOffice2010DarkGray)},
+ {PaletteMode.Office2007BlackDarkMode, typeof(PaletteOffice2007BlackDarkMode)},
+ {PaletteMode.Office2010Blue, typeof(PaletteOffice2010Blue)},
+ {PaletteMode.Office2010BlueDarkMode, typeof(PaletteOffice2010BlueDarkMode)},
+ {PaletteMode.Office2010BlueLightMode, typeof(PaletteOffice2010BlueLightMode)},
+ {PaletteMode.Office2010Silver, typeof(PaletteOffice2010Silver)},
+ {PaletteMode.Office2010SilverDarkMode, typeof(PaletteOffice2010SilverDarkMode)},
+ {PaletteMode.Office2010SilverLightMode, typeof(PaletteOffice2010SilverLightMode)},
+ {PaletteMode.Office2010White, typeof(PaletteOffice2010White)},
+ {PaletteMode.Office2010Black, typeof(PaletteOffice2010Black)},
+ {PaletteMode.Office2010BlackDarkMode, typeof(PaletteOffice2010BlackDarkMode)},
+ //PaletteMode.Office2013LightGray, typeof(PaletteOffice2013LightGray)},
+ {PaletteMode.Office2013White, typeof(PaletteOffice2013White)},
+ {PaletteMode.SparkleBlue, typeof(PaletteSparkleBlue)},
+ {PaletteMode.SparkleBlueDarkMode, typeof(PaletteSparkleBlueDarkMode)},
+ {PaletteMode.SparkleBlueLightMode, typeof(PaletteSparkleBlueLightMode)},
+ {PaletteMode.SparkleOrange, typeof(PaletteSparkleOrange)},
+ {PaletteMode.SparkleOrangeDarkMode, typeof(PaletteSparkleOrangeDarkMode)},
+ {PaletteMode.SparkleOrangeLightMode, typeof(PaletteSparkleOrangeLightMode)},
+ {PaletteMode.SparklePurple, typeof(PaletteSparklePurple)},
+ {PaletteMode.SparklePurpleDarkMode, typeof(PaletteSparklePurpleDarkMode)},
+ {PaletteMode.SparklePurpleLightMode, typeof(PaletteSparklePurpleLightMode)},
+ {PaletteMode.Microsoft365Black, typeof(PaletteMicrosoft365Black)},
+ {PaletteMode.Microsoft365BlackDarkMode, typeof(PaletteMicrosoft365BlackDarkMode)},
+ {PaletteMode.Microsoft365BlackDarkModeAlternate, typeof(PaletteMicrosoft365BlackDarkModeAlternate)},
+ {PaletteMode.Microsoft365BlueDarkMode, typeof(PaletteMicrosoft365BlueDarkMode)},
+ {PaletteMode.Microsoft365BlueLightMode, typeof(PaletteMicrosoft365BlueLightMode)},
+ {PaletteMode.Microsoft365Blue, typeof(PaletteMicrosoft365Blue)},
+ //{PaletteMode.Microsoft365DarkGray, typeof(PaletteMicrosoft365DarkGray)},
+ {PaletteMode.Microsoft365Silver, typeof(PaletteMicrosoft365Silver)},
+ {PaletteMode.Microsoft365SilverDarkMode, typeof(PaletteMicrosoft365SilverDarkMode)},
+ {PaletteMode.Microsoft365SilverLightMode, typeof(PaletteMicrosoft365SilverLightMode)},
+ {PaletteMode.Microsoft365White, typeof(PaletteMicrosoft365White)},
+ {PaletteMode.VisualStudio2010Render2007, typeof(PaletteVisualStudio2010Office2007Variation)},
+ {PaletteMode.VisualStudio2010Render2010, typeof(PaletteVisualStudio2010Office2010Variation)},
+ {PaletteMode.VisualStudio2010Render2013, typeof(PaletteVisualStudio2010Office2013Variation)},
+ {PaletteMode.VisualStudio2010Render365, typeof(PaletteVisualStudio2010Microsoft365Variation)}
+ //{PaletteMode.Custom, typeof(KryptonCustomPaletteBase)}
+ });
+
+ #endregion
+
+ #region Identity
+ ///
+ /// Initialize a new instance of the PaletteClassTypeConverter class.
+ ///
+ public PaletteClassTypeConverter()
+ : base(typeof(PaletteMode))
+ {
+ }
+ #endregion
+
+ #region Public
+ ///
+ /// Converts the given value object to the specified type, using the specified context and culture information.
+ ///
+ /// An ITypeDescriptorContext that provides a format context.
+ /// A CultureInfo object. If a null reference the current culture is assumed.
+ /// The Object to convert.
+ /// The Type to convert the value parameter to.
+ /// An Object that represents the converted value.
+ public override object? ConvertTo(ITypeDescriptorContext? context,
+ CultureInfo? culture,
+ object? value,
+ Type destinationType)
+ {
+ if (value is PaletteMode val)
+ {
+ // Search for a matching value
+ if (_pairs.FirstToSecond.TryGetValue(val, out var classType))
+ {
+ return classType;
+ }
+ }
+
+ // Let base class perform default conversion
+ return base.ConvertTo(context, culture, value, destinationType);
+ }
+
+ ///
+ /// Converts the given object to the type of this converter, using the specified context and culture information.
+ ///
+ /// An ITypeDescriptorContext that provides a format context.
+ /// The CultureInfo to use as the current culture.
+ /// The Object to convert.
+ /// An Object that represents the converted value.
+ public override object? ConvertFrom(ITypeDescriptorContext? context,
+ CultureInfo? culture,
+ object? value)
+ {
+ if (value is Type val)
+ {
+ // Search for a matching Class
+ if( _pairs.SecondToFirst.TryGetValue(val, out var mode))
+ {
+ return mode;
+ }
+ }
+
+ // Let base class perform default conversion
+ return base.ConvertFrom(context!, culture!, value!);
+ }
+ #endregion
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteContentStyleConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteContentStyleConverter.cs
index f502fc083..984f293ee 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteContentStyleConverter.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteContentStyleConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,7 +20,8 @@ internal class PaletteContentStyleConverter : StringLookupConverter _pairs = new Dictionary
+ private static readonly BiDictionary _pairs = new BiDictionary(
+ new Dictionary
{
{PaletteContentStyle.ButtonStandalone, DesignTimeUtilities.DEFAULT_PALETTE_CONTENT_STYLE_BUTTON_STANDALONE},
{PaletteContentStyle.ButtonLowProfile, DesignTimeUtilities.DEFAULT_PALETTE_CONTENT_STYLE_BUTTON_LOW_PROFILE},
@@ -99,7 +100,7 @@ internal class PaletteContentStyleConverter : StringLookupConverter
/// Gets an array of lookup pairs.
///
- protected override IReadOnlyDictionary Pairs => _pairs;
+ protected override IReadOnlyDictionary PairsEnumToString => _pairs.FirstToSecond;
+ protected override IReadOnlyDictionary PairsStringToEnum => _pairs.SecondToFirst;
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteDrawBordersConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteDrawBordersConverter.cs
index 69713bade..39f5eb174 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteDrawBordersConverter.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteDrawBordersConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -115,7 +115,7 @@ public PaletteDrawBordersConverter()
/// An Object that represents the converted value.
public override object? ConvertFrom(ITypeDescriptorContext? context,
CultureInfo? culture,
- object value)
+ object? value)
{
// Convert incoming value to a string
// We are only interested in adding functionality for converting from strings
@@ -162,7 +162,7 @@ public PaletteDrawBordersConverter()
}
// Let base class perform default conversion
- return base.ConvertFrom(context, culture, value);
+ return base.ConvertFrom(context!, culture!, value!);
}
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteImageEffectConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteImageEffectConverter.cs
index 8f7da2b36..94f60ab44 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteImageEffectConverter.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteImageEffectConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,7 +20,8 @@ internal class PaletteImageEffectConverter : StringLookupConverter _pairs = new Dictionary
+ private static readonly BiDictionary _pairs = new BiDictionary(
+ new Dictionary
{
{PaletteImageEffect.Inherit, DesignTimeUtilities.DEFAULT_PALETTE_IMAGE_EFFECT_INHERIT},
{PaletteImageEffect.Light, DesignTimeUtilities.DEFAULT_PALETTE_IMAGE_EFFECT_LIGHT},
@@ -33,7 +34,7 @@ internal class PaletteImageEffectConverter : StringLookupConverter
/// Gets an array of lookup pairs.
///
- protected override IReadOnlyDictionary Pairs => _pairs;
+ protected override IReadOnlyDictionary PairsEnumToString => _pairs.FirstToSecond;
+ protected override IReadOnlyDictionary PairsStringToEnum => _pairs.SecondToFirst;
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteImageStyleConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteImageStyleConverter.cs
index ab7fd67c6..7422f243a 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteImageStyleConverter.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteImageStyleConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,7 +20,8 @@ internal class PaletteImageStyleConverter : StringLookupConverter _pairs = new Dictionary
+ private static readonly BiDictionary _pairs = new BiDictionary(
+ new Dictionary
{
{PaletteImageStyle.Inherit, DesignTimeUtilities.DEFAULT_PALETTE_IMAGE_STYLE_INHERIT},
{PaletteImageStyle.Stretch, DesignTimeUtilities.DEFAULT_PALETTE_IMAGE_STYLE_STRETCH},
@@ -37,7 +38,7 @@ internal class PaletteImageStyleConverter : StringLookupConverter
/// Gets an array of lookup pairs.
///
- protected override IReadOnlyDictionary Pairs => _pairs;
+ protected override IReadOnlyDictionary PairsEnumToString => _pairs.FirstToSecond;
+ protected override IReadOnlyDictionary PairsStringToEnum => _pairs.SecondToFirst;
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteModeConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteModeConverter.cs
index 4c2d0634b..40a36c797 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteModeConverter.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteModeConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -21,7 +21,8 @@ public class PaletteModeConverter : StringLookupConverter
///
/// Gets an array of lookup pairs.
///
- protected override IReadOnlyDictionary Pairs => PaletteModeStrings.SupportedThemes.SecondToFirst;
+ protected override IReadOnlyDictionary PairsStringToEnum => PaletteModeStrings.SupportedThemes.FirstToSecond;
+ protected override IReadOnlyDictionary PairsEnumToString => PaletteModeStrings.SupportedThemes.SecondToFirst;
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteTextTrimConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteTextTrimConverter.cs
index 1014ccfbf..bc80017ad 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteTextTrimConverter.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteTextTrimConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,7 +20,8 @@ internal class PaletteTextTrimConverter : StringLookupConverter
#region Static Fields
[Localizable(true)]
- private static readonly IReadOnlyDictionary _pairs = new Dictionary
+ private static readonly BiDictionary _pairs = new BiDictionary(
+ new Dictionary
{
{PaletteTextTrim.Inherit, DesignTimeUtilities.DEFAULT_PALETTE_TEXT_TRIM_INHERIT},
{PaletteTextTrim.Hide, DesignTimeUtilities.DEFAULT_PALETTE_TEXT_TRIM_HIDE},
@@ -29,7 +30,7 @@ internal class PaletteTextTrimConverter : StringLookupConverter
{PaletteTextTrim.EllipsisCharacter, DesignTimeUtilities.DEFAULT_PALETTE_TEXT_TRIM_ELLIPSIS_CHARACTER},
{PaletteTextTrim.EllipsisWord, DesignTimeUtilities.DEFAULT_PALETTE_TEXT_TRIM_ELLIPSIS_WORD},
{PaletteTextTrim.EllipsisPath, DesignTimeUtilities.DEFAULT_PALETTE_TEXT_TRIM_ELLIPSIS_PATH}
- };
+ });
#endregion
@@ -37,7 +38,8 @@ internal class PaletteTextTrimConverter : StringLookupConverter
///
/// Gets an array of lookup pairs.
///
- protected override IReadOnlyDictionary Pairs => _pairs;
+ protected override IReadOnlyDictionary PairsEnumToString => _pairs.FirstToSecond;
+ protected override IReadOnlyDictionary PairsStringToEnum => _pairs.SecondToFirst;
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/PlacementModeConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/PlacementModeConverter.cs
index 8ef55c307..ccead8cbc 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Converters/PlacementModeConverter.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Converters/PlacementModeConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -17,7 +17,8 @@ internal class PlacementModeConverter : StringLookupConverter
#region Static Fields
[Localizable(true)]
- private static readonly IReadOnlyDictionary _pairs = new Dictionary
+ private static readonly BiDictionary _pairs = new BiDictionary(
+ new Dictionary
{
{PlacementMode.Absolute, DesignTimeUtilities.DEFAULT_PLACEMENT_MODE_ABSOLUTE},
{PlacementMode.AbsolutePoint, DesignTimeUtilities.DEFAULT_PLACEMENT_MODE_ABSOLUTE_POINT},
@@ -30,13 +31,14 @@ internal class PlacementModeConverter : StringLookupConverter
{PlacementMode.RelativePoint, DesignTimeUtilities.DEFAULT_PLACEMENT_MODE_RELATIVE_POINT},
{PlacementMode.Right, DesignTimeUtilities.DEFAULT_PLACEMENT_MODE_RIGHT},
{PlacementMode.Top, DesignTimeUtilities.DEFAULT_PLACEMENT_MODE_TOP}
- };
+ });
#endregion
#region Protected
- protected override IReadOnlyDictionary Pairs => _pairs;
+ protected override IReadOnlyDictionary PairsEnumToString => _pairs.FirstToSecond;
+ protected override IReadOnlyDictionary PairsStringToEnum => _pairs.SecondToFirst;
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/SeparatorStyleConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/SeparatorStyleConverter.cs
index df9b2343e..f085e7352 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Converters/SeparatorStyleConverter.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Converters/SeparatorStyleConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,7 +20,8 @@ internal class SeparatorStyleConverter : StringLookupConverter
#region Static Fields
[Localizable(true)]
- private static readonly IReadOnlyDictionary _pairs = new Dictionary
+ private static readonly BiDictionary _pairs = new BiDictionary(
+ new Dictionary
{
{SeparatorStyle.LowProfile, DesignTimeUtilities.DEFAULT_SEPARATOR_STYLE_LOW_PROFILE},
{SeparatorStyle.HighProfile, DesignTimeUtilities.DEFAULT_SEPARATOR_STYLE_HIGH_PROFILE},
@@ -28,7 +29,7 @@ internal class SeparatorStyleConverter : StringLookupConverter
{SeparatorStyle.Custom1, DesignTimeUtilities.DEFAULT_SEPARATOR_STYLE_CUSTOM1},
{SeparatorStyle.Custom2, DesignTimeUtilities.DEFAULT_SEPARATOR_STYLE_CUSTOM2},
{SeparatorStyle.Custom3, DesignTimeUtilities.DEFAULT_SEPARATOR_STYLE_CUSTOM3}
- };
+ });
#endregion
@@ -37,7 +38,8 @@ internal class SeparatorStyleConverter : StringLookupConverter
///
/// Gets an array of lookup pairs.
///
- protected override IReadOnlyDictionary Pairs => _pairs;
+ protected override IReadOnlyDictionary PairsEnumToString => _pairs.FirstToSecond;
+ protected override IReadOnlyDictionary PairsStringToEnum => _pairs.SecondToFirst;
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/StringLookupConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/StringLookupConverter.cs
index 431991ca0..489c16bca 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Converters/StringLookupConverter.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Converters/StringLookupConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -21,7 +21,7 @@ public abstract class StringLookupConverter : EnumConverter
///
/// Initialize a new instance of the StringLookupConverter class.
///
- public StringLookupConverter()
+ protected StringLookupConverter()
: base(typeof(TEnumType))
{
}
@@ -31,7 +31,8 @@ public StringLookupConverter()
///
/// Gets an array of lookup pairs.
///
- protected abstract IReadOnlyDictionary Pairs { get; }
+ protected abstract IReadOnlyDictionary PairsStringToEnum { get; }
+ protected abstract IReadOnlyDictionary PairsEnumToString { get; }
#endregion
#region Public
@@ -44,8 +45,8 @@ public StringLookupConverter()
/// The Type to convert the value parameter to.
/// An Object that represents the converted value.
public override object? ConvertTo(ITypeDescriptorContext? context,
- CultureInfo? culture,
- object? value,
+ CultureInfo? culture,
+ object? value,
Type destinationType)
{
// We are only interested in adding functionality for converting to strings
@@ -54,9 +55,9 @@ public StringLookupConverter()
)
{
// Search for a matching value
- if ( Pairs.TryGetValue(val, out var display) )
+ if (PairsEnumToString.TryGetValue(val, out var display))
{
- return display;
+ return display;
}
}
@@ -72,22 +73,21 @@ public StringLookupConverter()
/// The Object to convert.
/// An Object that represents the converted value.
public override object? ConvertFrom(ITypeDescriptorContext? context,
- CultureInfo? culture,
+ CultureInfo? culture,
object? value)
{
// We are only interested in adding functionality for converting from strings
if (value is string val)
{
// Search for a matching string
- var key = Pairs.FirstOrDefault(x => x.Value == val).Key;
- if ( key != null)
- {
- return key;
+ if (PairsStringToEnum.TryGetValue(val, out TEnumType? key))
+ {
+ return key;
}
}
// Let base class perform default conversion
- return base.ConvertFrom(context, culture, value);
+ return base.ConvertFrom(context!, culture!, value!);
}
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/TabBorderStyleConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/TabBorderStyleConverter.cs
index 149f50b82..1e5cd02ee 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Converters/TabBorderStyleConverter.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Converters/TabBorderStyleConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,7 +20,8 @@ internal class TabBorderStyleConverter : StringLookupConverter
#region Static Fields
[Localizable(true)]
- private static readonly IReadOnlyDictionary _pairs = new Dictionary
+ private static readonly BiDictionary _pairs = new BiDictionary(
+ new Dictionary
{
{TabBorderStyle.OneNote, DesignTimeUtilities.DEFAULT_TAB_BORDER_STYLE_ONE_NOTE},
{TabBorderStyle.SquareEqualSmall, DesignTimeUtilities.DEFAULT_TAB_BORDER_STYLE_SQUARE_EQUAL_SMALL},
@@ -45,7 +46,7 @@ internal class TabBorderStyleConverter : StringLookupConverter
{TabBorderStyle.SmoothOutsize, DesignTimeUtilities.DEFAULT_TAB_BORDER_STYLE_SMOOTH_OUTSIZE},
{TabBorderStyle.DockEqual, DesignTimeUtilities.DEFAULT_TAB_BORDER_STYLE_DOCK_EQUAL},
{TabBorderStyle.DockOutsize, DesignTimeUtilities.DEFAULT_TAB_BORDER_STYLE_DOCK_OUTSIZE}
- };
+ });
#endregion
@@ -54,7 +55,8 @@ internal class TabBorderStyleConverter : StringLookupConverter
///
/// Gets an array of lookup pairs.
///
- protected override IReadOnlyDictionary Pairs => _pairs;
+ protected override IReadOnlyDictionary PairsEnumToString => _pairs.FirstToSecond;
+ protected override IReadOnlyDictionary PairsStringToEnum => _pairs.SecondToFirst;
#endregion
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/TabStyleConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/TabStyleConverter.cs
index 61ad9f65a..2474a2c10 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Converters/TabStyleConverter.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Converters/TabStyleConverter.cs
@@ -5,7 +5,7 @@
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
*
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
- * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ * Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed et al. 2017 - 2024. All rights reserved.
*
*/
#endregion
@@ -20,7 +20,8 @@ internal class TabStyleConverter : StringLookupConverter
#region Static Fields
[Localizable(true)]
- private static readonly IReadOnlyDictionary _pairs = new Dictionary
+ private static readonly BiDictionary